@valbuild/ui 0.58.0 → 0.60.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.
@@ -1,241 +0,0 @@
1
- var H$=Object.defineProperty;var W$=(t,e,n)=>e in t?H$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var mt=(t,e,n)=>(W$(t,typeof e!="symbol"?e+"":e,n),n),K$=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)};var Zg=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)};var Hf=(t,e,n)=>(K$(t,e,"access private method"),n);function L_(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in t)){const i=Object.getOwnPropertyDescriptor(r,o);i&&Object.defineProperty(t,o,i.get?i:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var q$=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ki(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var j_={exports:{}},Ue={};/**
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 yf=Symbol.for("react.element"),G$=Symbol.for("react.portal"),Y$=Symbol.for("react.fragment"),Z$=Symbol.for("react.strict_mode"),J$=Symbol.for("react.profiler"),X$=Symbol.for("react.provider"),Q$=Symbol.for("react.context"),eA=Symbol.for("react.forward_ref"),tA=Symbol.for("react.suspense"),nA=Symbol.for("react.memo"),rA=Symbol.for("react.lazy"),iw=Symbol.iterator;function oA(t){return t===null||typeof t!="object"?null:(t=iw&&t[iw]||t["@@iterator"],typeof t=="function"?t:null)}var z_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},F_=Object.assign,B_={};function Nc(t,e,n){this.props=t,this.context=e,this.refs=B_,this.updater=n||z_}Nc.prototype.isReactComponent={};Nc.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=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,t,e,"setState")};Nc.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function U_(){}U_.prototype=Nc.prototype;function yx(t,e,n){this.props=t,this.context=e,this.refs=B_,this.updater=n||z_}var xx=yx.prototype=new U_;xx.constructor=yx;F_(xx,Nc.prototype);xx.isPureReactComponent=!0;var sw=Array.isArray,V_=Object.prototype.hasOwnProperty,bx={current:null},H_={key:!0,ref:!0,__self:!0,__source:!0};function W_(t,e,n){var r,o={},i=null,s=null;if(e!=null)for(r in e.ref!==void 0&&(s=e.ref),e.key!==void 0&&(i=""+e.key),e)V_.call(e,r)&&!H_.hasOwnProperty(r)&&(o[r]=e[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];o.children=l}if(t&&t.defaultProps)for(r in a=t.defaultProps,a)o[r]===void 0&&(o[r]=a[r]);return{$$typeof:yf,type:t,key:i,ref:s,props:o,_owner:bx.current}}function iA(t,e){return{$$typeof:yf,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function wx(t){return typeof t=="object"&&t!==null&&t.$$typeof===yf}function sA(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var aw=/\/+/g;function Jg(t,e){return typeof t=="object"&&t!==null&&t.key!=null?sA(""+t.key):e.toString(36)}function Ep(t,e,n,r,o){var i=typeof t;(i==="undefined"||i==="boolean")&&(t=null);var s=!1;if(t===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case yf:case G$:s=!0}}if(s)return s=t,o=o(s),t=r===""?"."+Jg(s,0):r,sw(o)?(n="",t!=null&&(n=t.replace(aw,"$&/")+"/"),Ep(o,e,n,"",function(c){return c})):o!=null&&(wx(o)&&(o=iA(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(aw,"$&/")+"/")+t)),e.push(o)),1;if(s=0,r=r===""?".":r+":",sw(t))for(var a=0;a<t.length;a++){i=t[a];var l=r+Jg(i,a);s+=Ep(i,e,n,l,o)}else if(l=oA(t),typeof l=="function")for(t=l.call(t),a=0;!(i=t.next()).done;)i=i.value,l=r+Jg(i,a++),s+=Ep(i,e,n,l,o);else if(i==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return s}function Wf(t,e,n){if(t==null)return t;var r=[],o=0;return Ep(t,r,"","",function(i){return e.call(n,i,o++)}),r}function aA(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var Vn={current:null},_p={transition:null},lA={ReactCurrentDispatcher:Vn,ReactCurrentBatchConfig:_p,ReactCurrentOwner:bx};Ue.Children={map:Wf,forEach:function(t,e,n){Wf(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return Wf(t,function(){e++}),e},toArray:function(t){return Wf(t,function(e){return e})||[]},only:function(t){if(!wx(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Ue.Component=Nc;Ue.Fragment=Y$;Ue.Profiler=J$;Ue.PureComponent=yx;Ue.StrictMode=Z$;Ue.Suspense=tA;Ue.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=lA;Ue.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=F_({},t.props),o=t.key,i=t.ref,s=t._owner;if(e!=null){if(e.ref!==void 0&&(i=e.ref,s=bx.current),e.key!==void 0&&(o=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(l in e)V_.call(e,l)&&!H_.hasOwnProperty(l)&&(r[l]=e[l]===void 0&&a!==void 0?a[l]:e[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:yf,type:t.type,key:o,ref:i,props:r,_owner:s}};Ue.createContext=function(t){return t={$$typeof:Q$,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:X$,_context:t},t.Consumer=t};Ue.createElement=W_;Ue.createFactory=function(t){var e=W_.bind(null,t);return e.type=t,e};Ue.createRef=function(){return{current:null}};Ue.forwardRef=function(t){return{$$typeof:eA,render:t}};Ue.isValidElement=wx;Ue.lazy=function(t){return{$$typeof:rA,_payload:{_status:-1,_result:t},_init:aA}};Ue.memo=function(t,e){return{$$typeof:nA,type:t,compare:e===void 0?null:e}};Ue.startTransition=function(t){var e=_p.transition;_p.transition={};try{t()}finally{_p.transition=e}};Ue.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};Ue.useCallback=function(t,e){return Vn.current.useCallback(t,e)};Ue.useContext=function(t){return Vn.current.useContext(t)};Ue.useDebugValue=function(){};Ue.useDeferredValue=function(t){return Vn.current.useDeferredValue(t)};Ue.useEffect=function(t,e){return Vn.current.useEffect(t,e)};Ue.useId=function(){return Vn.current.useId()};Ue.useImperativeHandle=function(t,e,n){return Vn.current.useImperativeHandle(t,e,n)};Ue.useInsertionEffect=function(t,e){return Vn.current.useInsertionEffect(t,e)};Ue.useLayoutEffect=function(t,e){return Vn.current.useLayoutEffect(t,e)};Ue.useMemo=function(t,e){return Vn.current.useMemo(t,e)};Ue.useReducer=function(t,e,n){return Vn.current.useReducer(t,e,n)};Ue.useRef=function(t){return Vn.current.useRef(t)};Ue.useState=function(t){return Vn.current.useState(t)};Ue.useSyncExternalStore=function(t,e,n){return Vn.current.useSyncExternalStore(t,e,n)};Ue.useTransition=function(){return Vn.current.useTransition()};Ue.version="18.2.0";j_.exports=Ue;var h=j_.exports;const oe=ki(h),K_=L_({__proto__:null,default:oe},[h]);var sy={},q_={exports:{}},gr={},G_={exports:{}},Y_={};/**
10
- * @license React
11
- * scheduler.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
- */(function(t){function e(O,P){var I=O.length;O.push(P);e:for(;0<I;){var H=I-1>>>1,le=O[H];if(0<o(le,P))O[H]=P,O[I]=le,I=H;else break e}}function n(O){return O.length===0?null:O[0]}function r(O){if(O.length===0)return null;var P=O[0],I=O.pop();if(I!==P){O[0]=I;e:for(var H=0,le=O.length,Le=le>>>1;H<Le;){var Ee=2*(H+1)-1,Je=O[Ee],Ae=Ee+1,ne=O[Ae];if(0>o(Je,I))Ae<le&&0>o(ne,Je)?(O[H]=ne,O[Ae]=I,H=Ae):(O[H]=Je,O[Ee]=I,H=Ee);else if(Ae<le&&0>o(ne,I))O[H]=ne,O[Ae]=I,H=Ae;else break e}}return P}function o(O,P){var I=O.sortIndex-P.sortIndex;return I!==0?I:O.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();t.unstable_now=function(){return s.now()-a}}var l=[],c=[],u=1,d=null,f=3,p=!1,m=!1,g=!1,y=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(O){for(var P=n(c);P!==null;){if(P.callback===null)r(c);else if(P.startTime<=O)r(c),P.sortIndex=P.expirationTime,e(l,P);else break;P=n(c)}}function S(O){if(g=!1,w(O),!m)if(n(l)!==null)m=!0,R(_);else{var P=n(c);P!==null&&N(S,P.startTime-O)}}function _(O,P){m=!1,g&&(g=!1,v(C),C=-1),p=!0;var I=f;try{for(w(P),d=n(l);d!==null&&(!(d.expirationTime>P)||O&&!B());){var H=d.callback;if(typeof H=="function"){d.callback=null,f=d.priorityLevel;var le=H(d.expirationTime<=P);P=t.unstable_now(),typeof le=="function"?d.callback=le:d===n(l)&&r(l),w(P)}else r(l);d=n(l)}if(d!==null)var Le=!0;else{var Ee=n(c);Ee!==null&&N(S,Ee.startTime-P),Le=!1}return Le}finally{d=null,f=I,p=!1}}var k=!1,E=null,C=-1,T=5,A=-1;function B(){return!(t.unstable_now()-A<T)}function D(){if(E!==null){var O=t.unstable_now();A=O;var P=!0;try{P=E(!0,O)}finally{P?Z():(k=!1,E=null)}}else k=!1}var Z;if(typeof x=="function")Z=function(){x(D)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,G=U.port2;U.port1.onmessage=D,Z=function(){G.postMessage(null)}}else Z=function(){y(D,0)};function R(O){E=O,k||(k=!0,Z())}function N(O,P){C=y(function(){O(t.unstable_now())},P)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(O){O.callback=null},t.unstable_continueExecution=function(){m||p||(m=!0,R(_))},t.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<O?Math.floor(1e3/O):5},t.unstable_getCurrentPriorityLevel=function(){return f},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function(O){switch(f){case 1:case 2:case 3:var P=3;break;default:P=f}var I=f;f=P;try{return O()}finally{f=I}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(O,P){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var I=f;f=O;try{return P()}finally{f=I}},t.unstable_scheduleCallback=function(O,P,I){var H=t.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?H+I:H):I=H,O){case 1:var le=-1;break;case 2:le=250;break;case 5:le=1073741823;break;case 4:le=1e4;break;default:le=5e3}return le=I+le,O={id:u++,callback:P,priorityLevel:O,startTime:I,expirationTime:le,sortIndex:-1},I>H?(O.sortIndex=I,e(c,O),n(l)===null&&O===n(c)&&(g?(v(C),C=-1):g=!0,N(S,I-H))):(O.sortIndex=le,e(l,O),m||p||(m=!0,R(_))),O},t.unstable_shouldYield=B,t.unstable_wrapCallback=function(O){var P=f;return function(){var I=f;f=P;try{return O.apply(this,arguments)}finally{f=I}}}})(Y_);G_.exports=Y_;var cA=G_.exports;/**
18
- * @license React
19
- * react-dom.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 Z_=h,pr=cA;function V(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var J_=new Set,ud={};function Ya(t,e){ic(t,e),ic(t+"Capture",e)}function ic(t,e){for(ud[t]=e,t=0;t<e.length;t++)J_.add(e[t])}var di=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ay=Object.prototype.hasOwnProperty,uA=/^[: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]*$/,lw={},cw={};function dA(t){return ay.call(cw,t)?!0:ay.call(lw,t)?!1:uA.test(t)?cw[t]=!0:(lw[t]=!0,!1)}function fA(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function pA(t,e,n,r){if(e===null||typeof e>"u"||fA(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Hn(t,e,n,r,o,i,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=i,this.removeEmptyString=s}var vn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){vn[t]=new Hn(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];vn[e]=new Hn(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){vn[t]=new Hn(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){vn[t]=new Hn(t,2,!1,t,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(t){vn[t]=new Hn(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){vn[t]=new Hn(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){vn[t]=new Hn(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){vn[t]=new Hn(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){vn[t]=new Hn(t,5,!1,t.toLowerCase(),null,!1,!1)});var kx=/[\-:]([a-z])/g;function Sx(t){return t[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(t){var e=t.replace(kx,Sx);vn[e]=new Hn(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(kx,Sx);vn[e]=new Hn(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(kx,Sx);vn[e]=new Hn(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){vn[t]=new Hn(t,1,!1,t.toLowerCase(),null,!1,!1)});vn.xlinkHref=new Hn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){vn[t]=new Hn(t,1,!1,t.toLowerCase(),null,!0,!0)});function Ex(t,e,n,r){var o=vn.hasOwnProperty(e)?vn[e]:null;(o!==null?o.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(pA(e,n,o,r)&&(n=null),r||o===null?dA(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):o.mustUseProperty?t[o.propertyName]=n===null?o.type===3?!1:"":n:(e=o.attributeName,r=o.attributeNamespace,n===null?t.removeAttribute(e):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}var Si=Z_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Kf=Symbol.for("react.element"),Nl=Symbol.for("react.portal"),Pl=Symbol.for("react.fragment"),_x=Symbol.for("react.strict_mode"),ly=Symbol.for("react.profiler"),X_=Symbol.for("react.provider"),Q_=Symbol.for("react.context"),Cx=Symbol.for("react.forward_ref"),cy=Symbol.for("react.suspense"),uy=Symbol.for("react.suspense_list"),Tx=Symbol.for("react.memo"),Yi=Symbol.for("react.lazy"),eC=Symbol.for("react.offscreen"),uw=Symbol.iterator;function Gc(t){return t===null||typeof t!="object"?null:(t=uw&&t[uw]||t["@@iterator"],typeof t=="function"?t:null)}var Mt=Object.assign,Xg;function vu(t){if(Xg===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Xg=e&&e[1]||""}return`
26
- `+Xg+t}var Qg=!1;function ev(t,e){if(!t||Qg)return"";Qg=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(c){var r=c}Reflect.construct(t,[],e)}else{try{e.call()}catch(c){r=c}t.call(e.prototype)}else{try{throw Error()}catch(c){r=c}t()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var o=c.stack.split(`
27
- `),i=r.stack.split(`
28
- `),s=o.length-1,a=i.length-1;1<=s&&0<=a&&o[s]!==i[a];)a--;for(;1<=s&&0<=a;s--,a--)if(o[s]!==i[a]){if(s!==1||a!==1)do if(s--,a--,0>a||o[s]!==i[a]){var l=`
29
- `+o[s].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}while(1<=s&&0<=a);break}}}finally{Qg=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?vu(t):""}function hA(t){switch(t.tag){case 5:return vu(t.type);case 16:return vu("Lazy");case 13:return vu("Suspense");case 19:return vu("SuspenseList");case 0:case 2:case 15:return t=ev(t.type,!1),t;case 11:return t=ev(t.type.render,!1),t;case 1:return t=ev(t.type,!0),t;default:return""}}function dy(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Pl:return"Fragment";case Nl:return"Portal";case ly:return"Profiler";case _x:return"StrictMode";case cy:return"Suspense";case uy:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Q_:return(t.displayName||"Context")+".Consumer";case X_:return(t._context.displayName||"Context")+".Provider";case Cx:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Tx:return e=t.displayName||null,e!==null?e:dy(t.type)||"Memo";case Yi:e=t._payload,t=t._init;try{return dy(t(e))}catch{}}return null}function mA(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return dy(e);case 8:return e===_x?"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 e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function _s(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function tC(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function gA(t){var e=tC(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function qf(t){t._valueTracker||(t._valueTracker=gA(t))}function nC(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=tC(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function th(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function fy(t,e){var n=e.checked;return Mt({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function dw(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=_s(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function rC(t,e){e=e.checked,e!=null&&Ex(t,"checked",e,!1)}function py(t,e){rC(t,e);var n=_s(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?hy(t,e.type,n):e.hasOwnProperty("defaultValue")&&hy(t,e.type,_s(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function fw(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function hy(t,e,n){(e!=="number"||th(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var yu=Array.isArray;function Kl(t,e,n,r){if(t=t.options,e){e={};for(var o=0;o<n.length;o++)e["$"+n[o]]=!0;for(n=0;n<t.length;n++)o=e.hasOwnProperty("$"+t[n].value),t[n].selected!==o&&(t[n].selected=o),o&&r&&(t[n].defaultSelected=!0)}else{for(n=""+_s(n),e=null,o=0;o<t.length;o++){if(t[o].value===n){t[o].selected=!0,r&&(t[o].defaultSelected=!0);return}e!==null||t[o].disabled||(e=t[o])}e!==null&&(e.selected=!0)}}function my(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(V(91));return Mt({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function pw(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(V(92));if(yu(n)){if(1<n.length)throw Error(V(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:_s(n)}}function oC(t,e){var n=_s(e.value),r=_s(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function hw(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function iC(t){switch(t){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 gy(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?iC(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Gf,sC=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,o){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,o)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(Gf=Gf||document.createElement("div"),Gf.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Gf.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function dd(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Wu={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},vA=["Webkit","ms","Moz","O"];Object.keys(Wu).forEach(function(t){vA.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Wu[e]=Wu[t]})});function aC(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Wu.hasOwnProperty(t)&&Wu[t]?(""+e).trim():e+"px"}function lC(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=aC(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,o):t[n]=o}}var yA=Mt({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 vy(t,e){if(e){if(yA[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(V(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(V(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(V(61))}if(e.style!=null&&typeof e.style!="object")throw Error(V(62))}}function yy(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 xy=null;function Ox(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var by=null,ql=null,Gl=null;function mw(t){if(t=wf(t)){if(typeof by!="function")throw Error(V(280));var e=t.stateNode;e&&(e=Im(e),by(t.stateNode,t.type,e))}}function cC(t){ql?Gl?Gl.push(t):Gl=[t]:ql=t}function uC(){if(ql){var t=ql,e=Gl;if(Gl=ql=null,mw(t),e)for(t=0;t<e.length;t++)mw(e[t])}}function dC(t,e){return t(e)}function fC(){}var tv=!1;function pC(t,e,n){if(tv)return t(e,n);tv=!0;try{return dC(t,e,n)}finally{tv=!1,(ql!==null||Gl!==null)&&(fC(),uC())}}function fd(t,e){var n=t.stateNode;if(n===null)return null;var r=Im(n);if(r===null)return null;n=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(V(231,e,typeof n));return n}var wy=!1;if(di)try{var Yc={};Object.defineProperty(Yc,"passive",{get:function(){wy=!0}}),window.addEventListener("test",Yc,Yc),window.removeEventListener("test",Yc,Yc)}catch{wy=!1}function xA(t,e,n,r,o,i,s,a,l){var c=Array.prototype.slice.call(arguments,3);try{e.apply(n,c)}catch(u){this.onError(u)}}var Ku=!1,nh=null,rh=!1,ky=null,bA={onError:function(t){Ku=!0,nh=t}};function wA(t,e,n,r,o,i,s,a,l){Ku=!1,nh=null,xA.apply(bA,arguments)}function kA(t,e,n,r,o,i,s,a,l){if(wA.apply(this,arguments),Ku){if(Ku){var c=nh;Ku=!1,nh=null}else throw Error(V(198));rh||(rh=!0,ky=c)}}function Za(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function hC(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function gw(t){if(Za(t)!==t)throw Error(V(188))}function SA(t){var e=t.alternate;if(!e){if(e=Za(t),e===null)throw Error(V(188));return e!==t?null:t}for(var n=t,r=e;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return gw(o),t;if(i===r)return gw(o),e;i=i.sibling}throw Error(V(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,a=o.child;a;){if(a===n){s=!0,n=o,r=i;break}if(a===r){s=!0,r=o,n=i;break}a=a.sibling}if(!s){for(a=i.child;a;){if(a===n){s=!0,n=i,r=o;break}if(a===r){s=!0,r=i,n=o;break}a=a.sibling}if(!s)throw Error(V(189))}}if(n.alternate!==r)throw Error(V(190))}if(n.tag!==3)throw Error(V(188));return n.stateNode.current===n?t:e}function mC(t){return t=SA(t),t!==null?gC(t):null}function gC(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=gC(t);if(e!==null)return e;t=t.sibling}return null}var vC=pr.unstable_scheduleCallback,vw=pr.unstable_cancelCallback,EA=pr.unstable_shouldYield,_A=pr.unstable_requestPaint,Lt=pr.unstable_now,CA=pr.unstable_getCurrentPriorityLevel,Mx=pr.unstable_ImmediatePriority,yC=pr.unstable_UserBlockingPriority,oh=pr.unstable_NormalPriority,TA=pr.unstable_LowPriority,xC=pr.unstable_IdlePriority,Nm=null,Ro=null;function OA(t){if(Ro&&typeof Ro.onCommitFiberRoot=="function")try{Ro.onCommitFiberRoot(Nm,t,void 0,(t.current.flags&128)===128)}catch{}}var io=Math.clz32?Math.clz32:NA,MA=Math.log,RA=Math.LN2;function NA(t){return t>>>=0,t===0?32:31-(MA(t)/RA|0)|0}var Yf=64,Zf=4194304;function xu(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function ih(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,o=t.suspendedLanes,i=t.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=xu(a):(i&=s,i!==0&&(r=xu(i)))}else s=n&~o,s!==0?r=xu(s):i!==0&&(r=xu(i));if(r===0)return 0;if(e!==0&&e!==r&&!(e&o)&&(o=r&-r,i=e&-e,o>=i||o===16&&(i&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-io(e),o=1<<n,r|=t[n],e&=~o;return r}function PA(t,e){switch(t){case 1:case 2:case 4:return e+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 e+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 $A(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,o=t.expirationTimes,i=t.pendingLanes;0<i;){var s=31-io(i),a=1<<s,l=o[s];l===-1?(!(a&n)||a&r)&&(o[s]=PA(a,e)):l<=e&&(t.expiredLanes|=a),i&=~a}}function Sy(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function bC(){var t=Yf;return Yf<<=1,!(Yf&4194240)&&(Yf=64),t}function nv(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function xf(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-io(e),t[e]=n}function AA(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0<n;){var o=31-io(n),i=1<<o;e[o]=0,r[o]=-1,t[o]=-1,n&=~i}}function Rx(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-io(n),o=1<<r;o&e|t[r]&e&&(t[r]|=e),n&=~o}}var st=0;function wC(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var kC,Nx,SC,EC,_C,Ey=!1,Jf=[],cs=null,us=null,ds=null,pd=new Map,hd=new Map,Qi=[],IA="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 yw(t,e){switch(t){case"focusin":case"focusout":cs=null;break;case"dragenter":case"dragleave":us=null;break;case"mouseover":case"mouseout":ds=null;break;case"pointerover":case"pointerout":pd.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":hd.delete(e.pointerId)}}function Zc(t,e,n,r,o,i){return t===null||t.nativeEvent!==i?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},e!==null&&(e=wf(e),e!==null&&Nx(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,o!==null&&e.indexOf(o)===-1&&e.push(o),t)}function DA(t,e,n,r,o){switch(e){case"focusin":return cs=Zc(cs,t,e,n,r,o),!0;case"dragenter":return us=Zc(us,t,e,n,r,o),!0;case"mouseover":return ds=Zc(ds,t,e,n,r,o),!0;case"pointerover":var i=o.pointerId;return pd.set(i,Zc(pd.get(i)||null,t,e,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,hd.set(i,Zc(hd.get(i)||null,t,e,n,r,o)),!0}return!1}function CC(t){var e=aa(t.target);if(e!==null){var n=Za(e);if(n!==null){if(e=n.tag,e===13){if(e=hC(n),e!==null){t.blockedOn=e,_C(t.priority,function(){SC(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Cp(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=_y(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);xy=r,n.target.dispatchEvent(r),xy=null}else return e=wf(n),e!==null&&Nx(e),t.blockedOn=n,!1;e.shift()}return!0}function xw(t,e,n){Cp(t)&&n.delete(e)}function LA(){Ey=!1,cs!==null&&Cp(cs)&&(cs=null),us!==null&&Cp(us)&&(us=null),ds!==null&&Cp(ds)&&(ds=null),pd.forEach(xw),hd.forEach(xw)}function Jc(t,e){t.blockedOn===e&&(t.blockedOn=null,Ey||(Ey=!0,pr.unstable_scheduleCallback(pr.unstable_NormalPriority,LA)))}function md(t){function e(o){return Jc(o,t)}if(0<Jf.length){Jc(Jf[0],t);for(var n=1;n<Jf.length;n++){var r=Jf[n];r.blockedOn===t&&(r.blockedOn=null)}}for(cs!==null&&Jc(cs,t),us!==null&&Jc(us,t),ds!==null&&Jc(ds,t),pd.forEach(e),hd.forEach(e),n=0;n<Qi.length;n++)r=Qi[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<Qi.length&&(n=Qi[0],n.blockedOn===null);)CC(n),n.blockedOn===null&&Qi.shift()}var Yl=Si.ReactCurrentBatchConfig,sh=!0;function jA(t,e,n,r){var o=st,i=Yl.transition;Yl.transition=null;try{st=1,Px(t,e,n,r)}finally{st=o,Yl.transition=i}}function zA(t,e,n,r){var o=st,i=Yl.transition;Yl.transition=null;try{st=4,Px(t,e,n,r)}finally{st=o,Yl.transition=i}}function Px(t,e,n,r){if(sh){var o=_y(t,e,n,r);if(o===null)fv(t,e,r,ah,n),yw(t,r);else if(DA(o,t,e,n,r))r.stopPropagation();else if(yw(t,r),e&4&&-1<IA.indexOf(t)){for(;o!==null;){var i=wf(o);if(i!==null&&kC(i),i=_y(t,e,n,r),i===null&&fv(t,e,r,ah,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else fv(t,e,r,null,n)}}var ah=null;function _y(t,e,n,r){if(ah=null,t=Ox(r),t=aa(t),t!==null)if(e=Za(t),e===null)t=null;else if(n=e.tag,n===13){if(t=hC(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return ah=t,null}function TC(t){switch(t){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(CA()){case Mx:return 1;case yC:return 4;case oh:case TA:return 16;case xC:return 536870912;default:return 16}default:return 16}}var rs=null,$x=null,Tp=null;function OC(){if(Tp)return Tp;var t,e=$x,n=e.length,r,o="value"in rs?rs.value:rs.textContent,i=o.length;for(t=0;t<n&&e[t]===o[t];t++);var s=n-t;for(r=1;r<=s&&e[n-r]===o[i-r];r++);return Tp=o.slice(t,1<r?1-r:void 0)}function Op(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Xf(){return!0}function bw(){return!1}function vr(t){function e(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var a in t)t.hasOwnProperty(a)&&(n=t[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Xf:bw,this.isPropagationStopped=bw,this}return Mt(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Xf)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Xf)},persist:function(){},isPersistent:Xf}),e}var Pc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ax=vr(Pc),bf=Mt({},Pc,{view:0,detail:0}),FA=vr(bf),rv,ov,Xc,Pm=Mt({},bf,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ix,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Xc&&(Xc&&t.type==="mousemove"?(rv=t.screenX-Xc.screenX,ov=t.screenY-Xc.screenY):ov=rv=0,Xc=t),rv)},movementY:function(t){return"movementY"in t?t.movementY:ov}}),ww=vr(Pm),BA=Mt({},Pm,{dataTransfer:0}),UA=vr(BA),VA=Mt({},bf,{relatedTarget:0}),iv=vr(VA),HA=Mt({},Pc,{animationName:0,elapsedTime:0,pseudoElement:0}),WA=vr(HA),KA=Mt({},Pc,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),qA=vr(KA),GA=Mt({},Pc,{data:0}),kw=vr(GA),YA={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ZA={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"},JA={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function XA(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=JA[t])?!!e[t]:!1}function Ix(){return XA}var QA=Mt({},bf,{key:function(t){if(t.key){var e=YA[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Op(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?ZA[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ix,charCode:function(t){return t.type==="keypress"?Op(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Op(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),eI=vr(QA),tI=Mt({},Pm,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sw=vr(tI),nI=Mt({},bf,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ix}),rI=vr(nI),oI=Mt({},Pc,{propertyName:0,elapsedTime:0,pseudoElement:0}),iI=vr(oI),sI=Mt({},Pm,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),aI=vr(sI),lI=[9,13,27,32],Dx=di&&"CompositionEvent"in window,qu=null;di&&"documentMode"in document&&(qu=document.documentMode);var cI=di&&"TextEvent"in window&&!qu,MC=di&&(!Dx||qu&&8<qu&&11>=qu),Ew=" ",_w=!1;function RC(t,e){switch(t){case"keyup":return lI.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function NC(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var $l=!1;function uI(t,e){switch(t){case"compositionend":return NC(e);case"keypress":return e.which!==32?null:(_w=!0,Ew);case"textInput":return t=e.data,t===Ew&&_w?null:t;default:return null}}function dI(t,e){if($l)return t==="compositionend"||!Dx&&RC(t,e)?(t=OC(),Tp=$x=rs=null,$l=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return MC&&e.locale!=="ko"?null:e.data;default:return null}}var fI={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 Cw(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!fI[t.type]:e==="textarea"}function PC(t,e,n,r){cC(r),e=lh(e,"onChange"),0<e.length&&(n=new Ax("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var Gu=null,gd=null;function pI(t){VC(t,0)}function $m(t){var e=Dl(t);if(nC(e))return t}function hI(t,e){if(t==="change")return e}var $C=!1;if(di){var sv;if(di){var av="oninput"in document;if(!av){var Tw=document.createElement("div");Tw.setAttribute("oninput","return;"),av=typeof Tw.oninput=="function"}sv=av}else sv=!1;$C=sv&&(!document.documentMode||9<document.documentMode)}function Ow(){Gu&&(Gu.detachEvent("onpropertychange",AC),gd=Gu=null)}function AC(t){if(t.propertyName==="value"&&$m(gd)){var e=[];PC(e,gd,t,Ox(t)),pC(pI,e)}}function mI(t,e,n){t==="focusin"?(Ow(),Gu=e,gd=n,Gu.attachEvent("onpropertychange",AC)):t==="focusout"&&Ow()}function gI(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return $m(gd)}function vI(t,e){if(t==="click")return $m(e)}function yI(t,e){if(t==="input"||t==="change")return $m(e)}function xI(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var po=typeof Object.is=="function"?Object.is:xI;function vd(t,e){if(po(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!ay.call(e,o)||!po(t[o],e[o]))return!1}return!0}function Mw(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Rw(t,e){var n=Mw(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Mw(n)}}function IC(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?IC(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function DC(){for(var t=window,e=th();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=th(t.document)}return e}function Lx(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function bI(t){var e=DC(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&IC(n.ownerDocument.documentElement,n)){if(r!==null&&Lx(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!t.extend&&i>r&&(o=r,r=i,i=o),o=Rw(n,i);var s=Rw(n,r);o&&s&&(t.rangeCount!==1||t.anchorNode!==o.node||t.anchorOffset!==o.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(o.node,o.offset),t.removeAllRanges(),i>r?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var wI=di&&"documentMode"in document&&11>=document.documentMode,Al=null,Cy=null,Yu=null,Ty=!1;function Nw(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ty||Al==null||Al!==th(r)||(r=Al,"selectionStart"in r&&Lx(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Yu&&vd(Yu,r)||(Yu=r,r=lh(Cy,"onSelect"),0<r.length&&(e=new Ax("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=Al)))}function Qf(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Il={animationend:Qf("Animation","AnimationEnd"),animationiteration:Qf("Animation","AnimationIteration"),animationstart:Qf("Animation","AnimationStart"),transitionend:Qf("Transition","TransitionEnd")},lv={},LC={};di&&(LC=document.createElement("div").style,"AnimationEvent"in window||(delete Il.animationend.animation,delete Il.animationiteration.animation,delete Il.animationstart.animation),"TransitionEvent"in window||delete Il.transitionend.transition);function Am(t){if(lv[t])return lv[t];if(!Il[t])return t;var e=Il[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in LC)return lv[t]=e[n];return t}var jC=Am("animationend"),zC=Am("animationiteration"),FC=Am("animationstart"),BC=Am("transitionend"),UC=new Map,Pw="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 zs(t,e){UC.set(t,e),Ya(e,[t])}for(var cv=0;cv<Pw.length;cv++){var uv=Pw[cv],kI=uv.toLowerCase(),SI=uv[0].toUpperCase()+uv.slice(1);zs(kI,"on"+SI)}zs(jC,"onAnimationEnd");zs(zC,"onAnimationIteration");zs(FC,"onAnimationStart");zs("dblclick","onDoubleClick");zs("focusin","onFocus");zs("focusout","onBlur");zs(BC,"onTransitionEnd");ic("onMouseEnter",["mouseout","mouseover"]);ic("onMouseLeave",["mouseout","mouseover"]);ic("onPointerEnter",["pointerout","pointerover"]);ic("onPointerLeave",["pointerout","pointerover"]);Ya("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ya("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ya("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ya("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ya("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ya("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bu="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(" "),EI=new Set("cancel close invalid load scroll toggle".split(" ").concat(bu));function $w(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,kA(r,e,void 0,t),t.currentTarget=null}function VC(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],o=r.event;r=r.listeners;e:{var i=void 0;if(e)for(var s=r.length-1;0<=s;s--){var a=r[s],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==i&&o.isPropagationStopped())break e;$w(o,a,c),i=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,c=a.currentTarget,a=a.listener,l!==i&&o.isPropagationStopped())break e;$w(o,a,c),i=l}}}if(rh)throw t=ky,rh=!1,ky=null,t}function vt(t,e){var n=e[Py];n===void 0&&(n=e[Py]=new Set);var r=t+"__bubble";n.has(r)||(HC(e,t,2,!1),n.add(r))}function dv(t,e,n){var r=0;e&&(r|=4),HC(n,t,r,e)}var ep="_reactListening"+Math.random().toString(36).slice(2);function yd(t){if(!t[ep]){t[ep]=!0,J_.forEach(function(n){n!=="selectionchange"&&(EI.has(n)||dv(n,!1,t),dv(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[ep]||(e[ep]=!0,dv("selectionchange",!1,e))}}function HC(t,e,n,r){switch(TC(e)){case 1:var o=jA;break;case 4:o=zA;break;default:o=Px}n=o.bind(null,e,n,t),o=void 0,!wy||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(o=!0),r?o!==void 0?t.addEventListener(e,n,{capture:!0,passive:o}):t.addEventListener(e,n,!0):o!==void 0?t.addEventListener(e,n,{passive:o}):t.addEventListener(e,n,!1)}function fv(t,e,n,r,o){var i=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var a=r.stateNode.containerInfo;if(a===o||a.nodeType===8&&a.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===o||l.nodeType===8&&l.parentNode===o))return;s=s.return}for(;a!==null;){if(s=aa(a),s===null)return;if(l=s.tag,l===5||l===6){r=i=s;continue e}a=a.parentNode}}r=r.return}pC(function(){var c=i,u=Ox(n),d=[];e:{var f=UC.get(t);if(f!==void 0){var p=Ax,m=t;switch(t){case"keypress":if(Op(n)===0)break e;case"keydown":case"keyup":p=eI;break;case"focusin":m="focus",p=iv;break;case"focusout":m="blur",p=iv;break;case"beforeblur":case"afterblur":p=iv;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=ww;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=UA;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=rI;break;case jC:case zC:case FC:p=WA;break;case BC:p=iI;break;case"scroll":p=FA;break;case"wheel":p=aI;break;case"copy":case"cut":case"paste":p=qA;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Sw}var g=(e&4)!==0,y=!g&&t==="scroll",v=g?f!==null?f+"Capture":null:f;g=[];for(var x=c,w;x!==null;){w=x;var S=w.stateNode;if(w.tag===5&&S!==null&&(w=S,v!==null&&(S=fd(x,v),S!=null&&g.push(xd(x,S,w)))),y)break;x=x.return}0<g.length&&(f=new p(f,m,null,n,u),d.push({event:f,listeners:g}))}}if(!(e&7)){e:{if(f=t==="mouseover"||t==="pointerover",p=t==="mouseout"||t==="pointerout",f&&n!==xy&&(m=n.relatedTarget||n.fromElement)&&(aa(m)||m[fi]))break e;if((p||f)&&(f=u.window===u?u:(f=u.ownerDocument)?f.defaultView||f.parentWindow:window,p?(m=n.relatedTarget||n.toElement,p=c,m=m?aa(m):null,m!==null&&(y=Za(m),m!==y||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=c),p!==m)){if(g=ww,S="onMouseLeave",v="onMouseEnter",x="mouse",(t==="pointerout"||t==="pointerover")&&(g=Sw,S="onPointerLeave",v="onPointerEnter",x="pointer"),y=p==null?f:Dl(p),w=m==null?f:Dl(m),f=new g(S,x+"leave",p,n,u),f.target=y,f.relatedTarget=w,S=null,aa(u)===c&&(g=new g(v,x+"enter",m,n,u),g.target=w,g.relatedTarget=y,S=g),y=S,p&&m)t:{for(g=p,v=m,x=0,w=g;w;w=ul(w))x++;for(w=0,S=v;S;S=ul(S))w++;for(;0<x-w;)g=ul(g),x--;for(;0<w-x;)v=ul(v),w--;for(;x--;){if(g===v||v!==null&&g===v.alternate)break t;g=ul(g),v=ul(v)}g=null}else g=null;p!==null&&Aw(d,f,p,g,!1),m!==null&&y!==null&&Aw(d,y,m,g,!0)}}e:{if(f=c?Dl(c):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var _=hI;else if(Cw(f))if($C)_=yI;else{_=gI;var k=mI}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(_=vI);if(_&&(_=_(t,c))){PC(d,_,n,u);break e}k&&k(t,f,c),t==="focusout"&&(k=f._wrapperState)&&k.controlled&&f.type==="number"&&hy(f,"number",f.value)}switch(k=c?Dl(c):window,t){case"focusin":(Cw(k)||k.contentEditable==="true")&&(Al=k,Cy=c,Yu=null);break;case"focusout":Yu=Cy=Al=null;break;case"mousedown":Ty=!0;break;case"contextmenu":case"mouseup":case"dragend":Ty=!1,Nw(d,n,u);break;case"selectionchange":if(wI)break;case"keydown":case"keyup":Nw(d,n,u)}var E;if(Dx)e:{switch(t){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else $l?RC(t,n)&&(C="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(MC&&n.locale!=="ko"&&($l||C!=="onCompositionStart"?C==="onCompositionEnd"&&$l&&(E=OC()):(rs=u,$x="value"in rs?rs.value:rs.textContent,$l=!0)),k=lh(c,C),0<k.length&&(C=new kw(C,t,null,n,u),d.push({event:C,listeners:k}),E?C.data=E:(E=NC(n),E!==null&&(C.data=E)))),(E=cI?uI(t,n):dI(t,n))&&(c=lh(c,"onBeforeInput"),0<c.length&&(u=new kw("onBeforeInput","beforeinput",null,n,u),d.push({event:u,listeners:c}),u.data=E))}VC(d,e)})}function xd(t,e,n){return{instance:t,listener:e,currentTarget:n}}function lh(t,e){for(var n=e+"Capture",r=[];t!==null;){var o=t,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=fd(t,n),i!=null&&r.unshift(xd(t,i,o)),i=fd(t,e),i!=null&&r.push(xd(t,i,o))),t=t.return}return r}function ul(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Aw(t,e,n,r,o){for(var i=e._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,o?(l=fd(n,i),l!=null&&s.unshift(xd(n,l,a))):o||(l=fd(n,i),l!=null&&s.push(xd(n,l,a)))),n=n.return}s.length!==0&&t.push({event:e,listeners:s})}var _I=/\r\n?/g,CI=/\u0000|\uFFFD/g;function Iw(t){return(typeof t=="string"?t:""+t).replace(_I,`
30
- `).replace(CI,"")}function tp(t,e,n){if(e=Iw(e),Iw(t)!==e&&n)throw Error(V(425))}function ch(){}var Oy=null,My=null;function Ry(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Ny=typeof setTimeout=="function"?setTimeout:void 0,TI=typeof clearTimeout=="function"?clearTimeout:void 0,Dw=typeof Promise=="function"?Promise:void 0,OI=typeof queueMicrotask=="function"?queueMicrotask:typeof Dw<"u"?function(t){return Dw.resolve(null).then(t).catch(MI)}:Ny;function MI(t){setTimeout(function(){throw t})}function pv(t,e){var n=e,r=0;do{var o=n.nextSibling;if(t.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){t.removeChild(o),md(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);md(e)}function fs(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function Lw(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var $c=Math.random().toString(36).slice(2),_o="__reactFiber$"+$c,bd="__reactProps$"+$c,fi="__reactContainer$"+$c,Py="__reactEvents$"+$c,RI="__reactListeners$"+$c,NI="__reactHandles$"+$c;function aa(t){var e=t[_o];if(e)return e;for(var n=t.parentNode;n;){if(e=n[fi]||n[_o]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=Lw(t);t!==null;){if(n=t[_o])return n;t=Lw(t)}return e}t=n,n=t.parentNode}return null}function wf(t){return t=t[_o]||t[fi],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Dl(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(V(33))}function Im(t){return t[bd]||null}var $y=[],Ll=-1;function Fs(t){return{current:t}}function xt(t){0>Ll||(t.current=$y[Ll],$y[Ll]=null,Ll--)}function ht(t,e){Ll++,$y[Ll]=t.current,t.current=e}var Cs={},Tn=Fs(Cs),Jn=Fs(!1),Oa=Cs;function sc(t,e){var n=t.type.contextTypes;if(!n)return Cs;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=e[i];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=o),o}function Xn(t){return t=t.childContextTypes,t!=null}function uh(){xt(Jn),xt(Tn)}function jw(t,e,n){if(Tn.current!==Cs)throw Error(V(168));ht(Tn,e),ht(Jn,n)}function WC(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in e))throw Error(V(108,mA(t)||"Unknown",o));return Mt({},n,r)}function dh(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Cs,Oa=Tn.current,ht(Tn,t),ht(Jn,Jn.current),!0}function zw(t,e,n){var r=t.stateNode;if(!r)throw Error(V(169));n?(t=WC(t,e,Oa),r.__reactInternalMemoizedMergedChildContext=t,xt(Jn),xt(Tn),ht(Tn,t)):xt(Jn),ht(Jn,n)}var ti=null,Dm=!1,hv=!1;function KC(t){ti===null?ti=[t]:ti.push(t)}function PI(t){Dm=!0,KC(t)}function Bs(){if(!hv&&ti!==null){hv=!0;var t=0,e=st;try{var n=ti;for(st=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}ti=null,Dm=!1}catch(o){throw ti!==null&&(ti=ti.slice(t+1)),vC(Mx,Bs),o}finally{st=e,hv=!1}}return null}var jl=[],zl=0,fh=null,ph=0,Cr=[],Tr=0,Ma=null,ri=1,oi="";function Ys(t,e){jl[zl++]=ph,jl[zl++]=fh,fh=t,ph=e}function qC(t,e,n){Cr[Tr++]=ri,Cr[Tr++]=oi,Cr[Tr++]=Ma,Ma=t;var r=ri;t=oi;var o=32-io(r)-1;r&=~(1<<o),n+=1;var i=32-io(e)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,ri=1<<32-io(e)+o|n<<o|r,oi=i+t}else ri=1<<i|n<<o|r,oi=t}function jx(t){t.return!==null&&(Ys(t,1),qC(t,1,0))}function zx(t){for(;t===fh;)fh=jl[--zl],jl[zl]=null,ph=jl[--zl],jl[zl]=null;for(;t===Ma;)Ma=Cr[--Tr],Cr[Tr]=null,oi=Cr[--Tr],Cr[Tr]=null,ri=Cr[--Tr],Cr[Tr]=null}var dr=null,ur=null,wt=!1,Jr=null;function GC(t,e){var n=Or(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function Fw(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,dr=t,ur=fs(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,dr=t,ur=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=Ma!==null?{id:ri,overflow:oi}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=Or(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,dr=t,ur=null,!0):!1;default:return!1}}function Ay(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Iy(t){if(wt){var e=ur;if(e){var n=e;if(!Fw(t,e)){if(Ay(t))throw Error(V(418));e=fs(n.nextSibling);var r=dr;e&&Fw(t,e)?GC(r,n):(t.flags=t.flags&-4097|2,wt=!1,dr=t)}}else{if(Ay(t))throw Error(V(418));t.flags=t.flags&-4097|2,wt=!1,dr=t}}}function Bw(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;dr=t}function np(t){if(t!==dr)return!1;if(!wt)return Bw(t),wt=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!Ry(t.type,t.memoizedProps)),e&&(e=ur)){if(Ay(t))throw YC(),Error(V(418));for(;e;)GC(t,e),e=fs(e.nextSibling)}if(Bw(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(V(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){ur=fs(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}ur=null}}else ur=dr?fs(t.stateNode.nextSibling):null;return!0}function YC(){for(var t=ur;t;)t=fs(t.nextSibling)}function ac(){ur=dr=null,wt=!1}function Fx(t){Jr===null?Jr=[t]:Jr.push(t)}var $I=Si.ReactCurrentBatchConfig;function Gr(t,e){if(t&&t.defaultProps){e=Mt({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}var hh=Fs(null),mh=null,Fl=null,Bx=null;function Ux(){Bx=Fl=mh=null}function Vx(t){var e=hh.current;xt(hh),t._currentValue=e}function Dy(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Zl(t,e){mh=t,Bx=Fl=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Yn=!0),t.firstContext=null)}function Pr(t){var e=t._currentValue;if(Bx!==t)if(t={context:t,memoizedValue:e,next:null},Fl===null){if(mh===null)throw Error(V(308));Fl=t,mh.dependencies={lanes:0,firstContext:t}}else Fl=Fl.next=t;return e}var la=null;function Hx(t){la===null?la=[t]:la.push(t)}function ZC(t,e,n,r){var o=e.interleaved;return o===null?(n.next=n,Hx(e)):(n.next=o.next,o.next=n),e.interleaved=n,pi(t,r)}function pi(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Zi=!1;function Wx(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function JC(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function li(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function ps(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,Ge&2){var o=r.pending;return o===null?e.next=e:(e.next=o.next,o.next=e),r.pending=e,pi(t,n)}return o=r.interleaved,o===null?(e.next=e,Hx(r)):(e.next=o.next,o.next=e),r.interleaved=e,pi(t,n)}function Mp(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Rx(t,n)}}function Uw(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=e:i=i.next=e}else o=i=e;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function gh(t,e,n,r){var o=t.updateQueue;Zi=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?i=c:s.next=c,s=l;var u=t.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==s&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(i!==null){var d=o.baseState;s=0,u=c=l=null,a=i;do{var f=a.lane,p=a.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=t,g=a;switch(f=e,p=n,g.tag){case 1:if(m=g.payload,typeof m=="function"){d=m.call(p,d,f);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m=="function"?m.call(p,d,f):m,f==null)break e;d=Mt({},d,f);break e;case 2:Zi=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,f=o.effects,f===null?o.effects=[a]:f.push(a))}else p={eventTime:p,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=p,l=d):u=u.next=p,s|=f;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;f=a,a=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(u===null&&(l=d),o.baseState=l,o.firstBaseUpdate=c,o.lastBaseUpdate=u,e=o.shared.interleaved,e!==null){o=e;do s|=o.lane,o=o.next;while(o!==e)}else i===null&&(o.shared.lanes=0);Na|=s,t.lanes=s,t.memoizedState=d}}function Vw(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(V(191,o));o.call(r)}}}var XC=new Z_.Component().refs;function Ly(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:Mt({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var Lm={isMounted:function(t){return(t=t._reactInternals)?Za(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=Dn(),o=ms(t),i=li(r,o);i.payload=e,n!=null&&(i.callback=n),e=ps(t,i,o),e!==null&&(so(e,t,o,r),Mp(e,t,o))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=Dn(),o=ms(t),i=li(r,o);i.tag=1,i.payload=e,n!=null&&(i.callback=n),e=ps(t,i,o),e!==null&&(so(e,t,o,r),Mp(e,t,o))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=Dn(),r=ms(t),o=li(n,r);o.tag=2,e!=null&&(o.callback=e),e=ps(t,o,r),e!==null&&(so(e,t,r,n),Mp(e,t,r))}};function Hw(t,e,n,r,o,i,s){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,i,s):e.prototype&&e.prototype.isPureReactComponent?!vd(n,r)||!vd(o,i):!0}function QC(t,e,n){var r=!1,o=Cs,i=e.contextType;return typeof i=="object"&&i!==null?i=Pr(i):(o=Xn(e)?Oa:Tn.current,r=e.contextTypes,i=(r=r!=null)?sc(t,o):Cs),e=new e(n,i),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=Lm,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=o,t.__reactInternalMemoizedMaskedChildContext=i),e}function Ww(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&Lm.enqueueReplaceState(e,e.state,null)}function jy(t,e,n,r){var o=t.stateNode;o.props=n,o.state=t.memoizedState,o.refs=XC,Wx(t);var i=e.contextType;typeof i=="object"&&i!==null?o.context=Pr(i):(i=Xn(e)?Oa:Tn.current,o.context=sc(t,i)),o.state=t.memoizedState,i=e.getDerivedStateFromProps,typeof i=="function"&&(Ly(t,e,i,n),o.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(e=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),e!==o.state&&Lm.enqueueReplaceState(o,o.state,null),gh(t,n,o,r),o.state=t.memoizedState),typeof o.componentDidMount=="function"&&(t.flags|=4194308)}function Qc(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(V(309));var r=n.stateNode}if(!r)throw Error(V(147,t));var o=r,i=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===i?e.ref:(e=function(s){var a=o.refs;a===XC&&(a=o.refs={}),s===null?delete a[i]:a[i]=s},e._stringRef=i,e)}if(typeof t!="string")throw Error(V(284));if(!n._owner)throw Error(V(290,t))}return t}function rp(t,e){throw t=Object.prototype.toString.call(e),Error(V(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function Kw(t){var e=t._init;return e(t._payload)}function eT(t){function e(v,x){if(t){var w=v.deletions;w===null?(v.deletions=[x],v.flags|=16):w.push(x)}}function n(v,x){if(!t)return null;for(;x!==null;)e(v,x),x=x.sibling;return null}function r(v,x){for(v=new Map;x!==null;)x.key!==null?v.set(x.key,x):v.set(x.index,x),x=x.sibling;return v}function o(v,x){return v=gs(v,x),v.index=0,v.sibling=null,v}function i(v,x,w){return v.index=w,t?(w=v.alternate,w!==null?(w=w.index,w<x?(v.flags|=2,x):w):(v.flags|=2,x)):(v.flags|=1048576,x)}function s(v){return t&&v.alternate===null&&(v.flags|=2),v}function a(v,x,w,S){return x===null||x.tag!==6?(x=wv(w,v.mode,S),x.return=v,x):(x=o(x,w),x.return=v,x)}function l(v,x,w,S){var _=w.type;return _===Pl?u(v,x,w.props.children,S,w.key):x!==null&&(x.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Yi&&Kw(_)===x.type)?(S=o(x,w.props),S.ref=Qc(v,x,w),S.return=v,S):(S=Ip(w.type,w.key,w.props,null,v.mode,S),S.ref=Qc(v,x,w),S.return=v,S)}function c(v,x,w,S){return x===null||x.tag!==4||x.stateNode.containerInfo!==w.containerInfo||x.stateNode.implementation!==w.implementation?(x=kv(w,v.mode,S),x.return=v,x):(x=o(x,w.children||[]),x.return=v,x)}function u(v,x,w,S,_){return x===null||x.tag!==7?(x=ya(w,v.mode,S,_),x.return=v,x):(x=o(x,w),x.return=v,x)}function d(v,x,w){if(typeof x=="string"&&x!==""||typeof x=="number")return x=wv(""+x,v.mode,w),x.return=v,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Kf:return w=Ip(x.type,x.key,x.props,null,v.mode,w),w.ref=Qc(v,null,x),w.return=v,w;case Nl:return x=kv(x,v.mode,w),x.return=v,x;case Yi:var S=x._init;return d(v,S(x._payload),w)}if(yu(x)||Gc(x))return x=ya(x,v.mode,w,null),x.return=v,x;rp(v,x)}return null}function f(v,x,w,S){var _=x!==null?x.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return _!==null?null:a(v,x,""+w,S);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Kf:return w.key===_?l(v,x,w,S):null;case Nl:return w.key===_?c(v,x,w,S):null;case Yi:return _=w._init,f(v,x,_(w._payload),S)}if(yu(w)||Gc(w))return _!==null?null:u(v,x,w,S,null);rp(v,w)}return null}function p(v,x,w,S,_){if(typeof S=="string"&&S!==""||typeof S=="number")return v=v.get(w)||null,a(x,v,""+S,_);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Kf:return v=v.get(S.key===null?w:S.key)||null,l(x,v,S,_);case Nl:return v=v.get(S.key===null?w:S.key)||null,c(x,v,S,_);case Yi:var k=S._init;return p(v,x,w,k(S._payload),_)}if(yu(S)||Gc(S))return v=v.get(w)||null,u(x,v,S,_,null);rp(x,S)}return null}function m(v,x,w,S){for(var _=null,k=null,E=x,C=x=0,T=null;E!==null&&C<w.length;C++){E.index>C?(T=E,E=null):T=E.sibling;var A=f(v,E,w[C],S);if(A===null){E===null&&(E=T);break}t&&E&&A.alternate===null&&e(v,E),x=i(A,x,C),k===null?_=A:k.sibling=A,k=A,E=T}if(C===w.length)return n(v,E),wt&&Ys(v,C),_;if(E===null){for(;C<w.length;C++)E=d(v,w[C],S),E!==null&&(x=i(E,x,C),k===null?_=E:k.sibling=E,k=E);return wt&&Ys(v,C),_}for(E=r(v,E);C<w.length;C++)T=p(E,v,C,w[C],S),T!==null&&(t&&T.alternate!==null&&E.delete(T.key===null?C:T.key),x=i(T,x,C),k===null?_=T:k.sibling=T,k=T);return t&&E.forEach(function(B){return e(v,B)}),wt&&Ys(v,C),_}function g(v,x,w,S){var _=Gc(w);if(typeof _!="function")throw Error(V(150));if(w=_.call(w),w==null)throw Error(V(151));for(var k=_=null,E=x,C=x=0,T=null,A=w.next();E!==null&&!A.done;C++,A=w.next()){E.index>C?(T=E,E=null):T=E.sibling;var B=f(v,E,A.value,S);if(B===null){E===null&&(E=T);break}t&&E&&B.alternate===null&&e(v,E),x=i(B,x,C),k===null?_=B:k.sibling=B,k=B,E=T}if(A.done)return n(v,E),wt&&Ys(v,C),_;if(E===null){for(;!A.done;C++,A=w.next())A=d(v,A.value,S),A!==null&&(x=i(A,x,C),k===null?_=A:k.sibling=A,k=A);return wt&&Ys(v,C),_}for(E=r(v,E);!A.done;C++,A=w.next())A=p(E,v,C,A.value,S),A!==null&&(t&&A.alternate!==null&&E.delete(A.key===null?C:A.key),x=i(A,x,C),k===null?_=A:k.sibling=A,k=A);return t&&E.forEach(function(D){return e(v,D)}),wt&&Ys(v,C),_}function y(v,x,w,S){if(typeof w=="object"&&w!==null&&w.type===Pl&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Kf:e:{for(var _=w.key,k=x;k!==null;){if(k.key===_){if(_=w.type,_===Pl){if(k.tag===7){n(v,k.sibling),x=o(k,w.props.children),x.return=v,v=x;break e}}else if(k.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Yi&&Kw(_)===k.type){n(v,k.sibling),x=o(k,w.props),x.ref=Qc(v,k,w),x.return=v,v=x;break e}n(v,k);break}else e(v,k);k=k.sibling}w.type===Pl?(x=ya(w.props.children,v.mode,S,w.key),x.return=v,v=x):(S=Ip(w.type,w.key,w.props,null,v.mode,S),S.ref=Qc(v,x,w),S.return=v,v=S)}return s(v);case Nl:e:{for(k=w.key;x!==null;){if(x.key===k)if(x.tag===4&&x.stateNode.containerInfo===w.containerInfo&&x.stateNode.implementation===w.implementation){n(v,x.sibling),x=o(x,w.children||[]),x.return=v,v=x;break e}else{n(v,x);break}else e(v,x);x=x.sibling}x=kv(w,v.mode,S),x.return=v,v=x}return s(v);case Yi:return k=w._init,y(v,x,k(w._payload),S)}if(yu(w))return m(v,x,w,S);if(Gc(w))return g(v,x,w,S);rp(v,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,x!==null&&x.tag===6?(n(v,x.sibling),x=o(x,w),x.return=v,v=x):(n(v,x),x=wv(w,v.mode,S),x.return=v,v=x),s(v)):n(v,x)}return y}var lc=eT(!0),tT=eT(!1),kf={},No=Fs(kf),wd=Fs(kf),kd=Fs(kf);function ca(t){if(t===kf)throw Error(V(174));return t}function Kx(t,e){switch(ht(kd,e),ht(wd,t),ht(No,kf),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:gy(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=gy(e,t)}xt(No),ht(No,e)}function cc(){xt(No),xt(wd),xt(kd)}function nT(t){ca(kd.current);var e=ca(No.current),n=gy(e,t.type);e!==n&&(ht(wd,t),ht(No,n))}function qx(t){wd.current===t&&(xt(No),xt(wd))}var Ct=Fs(0);function vh(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var mv=[];function Gx(){for(var t=0;t<mv.length;t++)mv[t]._workInProgressVersionPrimary=null;mv.length=0}var Rp=Si.ReactCurrentDispatcher,gv=Si.ReactCurrentBatchConfig,Ra=0,Ot=null,Ht=null,tn=null,yh=!1,Zu=!1,Sd=0,AI=0;function wn(){throw Error(V(321))}function Yx(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!po(t[n],e[n]))return!1;return!0}function Zx(t,e,n,r,o,i){if(Ra=i,Ot=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Rp.current=t===null||t.memoizedState===null?jI:zI,t=n(r,o),Zu){i=0;do{if(Zu=!1,Sd=0,25<=i)throw Error(V(301));i+=1,tn=Ht=null,e.updateQueue=null,Rp.current=FI,t=n(r,o)}while(Zu)}if(Rp.current=xh,e=Ht!==null&&Ht.next!==null,Ra=0,tn=Ht=Ot=null,yh=!1,e)throw Error(V(300));return t}function Jx(){var t=Sd!==0;return Sd=0,t}function So(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tn===null?Ot.memoizedState=tn=t:tn=tn.next=t,tn}function $r(){if(Ht===null){var t=Ot.alternate;t=t!==null?t.memoizedState:null}else t=Ht.next;var e=tn===null?Ot.memoizedState:tn.next;if(e!==null)tn=e,Ht=t;else{if(t===null)throw Error(V(310));Ht=t,t={memoizedState:Ht.memoizedState,baseState:Ht.baseState,baseQueue:Ht.baseQueue,queue:Ht.queue,next:null},tn===null?Ot.memoizedState=tn=t:tn=tn.next=t}return tn}function Ed(t,e){return typeof e=="function"?e(t):e}function vv(t){var e=$r(),n=e.queue;if(n===null)throw Error(V(311));n.lastRenderedReducer=t;var r=Ht,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var a=s=null,l=null,c=i;do{var u=c.lane;if((Ra&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:t(r,c.action);else{var d={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=d,s=r):l=l.next=d,Ot.lanes|=u,Na|=u}c=c.next}while(c!==null&&c!==i);l===null?s=r:l.next=a,po(r,e.memoizedState)||(Yn=!0),e.memoizedState=r,e.baseState=s,e.baseQueue=l,n.lastRenderedState=r}if(t=n.interleaved,t!==null){o=t;do i=o.lane,Ot.lanes|=i,Na|=i,o=o.next;while(o!==t)}else o===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function yv(t){var e=$r(),n=e.queue;if(n===null)throw Error(V(311));n.lastRenderedReducer=t;var r=n.dispatch,o=n.pending,i=e.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=t(i,s.action),s=s.next;while(s!==o);po(i,e.memoizedState)||(Yn=!0),e.memoizedState=i,e.baseQueue===null&&(e.baseState=i),n.lastRenderedState=i}return[i,r]}function rT(){}function oT(t,e){var n=Ot,r=$r(),o=e(),i=!po(r.memoizedState,o);if(i&&(r.memoizedState=o,Yn=!0),r=r.queue,Xx(aT.bind(null,n,r,t),[t]),r.getSnapshot!==e||i||tn!==null&&tn.memoizedState.tag&1){if(n.flags|=2048,_d(9,sT.bind(null,n,r,o,e),void 0,null),on===null)throw Error(V(349));Ra&30||iT(n,e,o)}return o}function iT(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=Ot.updateQueue,e===null?(e={lastEffect:null,stores:null},Ot.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function sT(t,e,n,r){e.value=n,e.getSnapshot=r,lT(e)&&cT(t)}function aT(t,e,n){return n(function(){lT(e)&&cT(t)})}function lT(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!po(t,n)}catch{return!0}}function cT(t){var e=pi(t,1);e!==null&&so(e,t,1,-1)}function qw(t){var e=So();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ed,lastRenderedState:t},e.queue=t,t=t.dispatch=LI.bind(null,Ot,t),[e.memoizedState,t]}function _d(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=Ot.updateQueue,e===null?(e={lastEffect:null,stores:null},Ot.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}function uT(){return $r().memoizedState}function Np(t,e,n,r){var o=So();Ot.flags|=t,o.memoizedState=_d(1|e,n,void 0,r===void 0?null:r)}function jm(t,e,n,r){var o=$r();r=r===void 0?null:r;var i=void 0;if(Ht!==null){var s=Ht.memoizedState;if(i=s.destroy,r!==null&&Yx(r,s.deps)){o.memoizedState=_d(e,n,i,r);return}}Ot.flags|=t,o.memoizedState=_d(1|e,n,i,r)}function Gw(t,e){return Np(8390656,8,t,e)}function Xx(t,e){return jm(2048,8,t,e)}function dT(t,e){return jm(4,2,t,e)}function fT(t,e){return jm(4,4,t,e)}function pT(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function hT(t,e,n){return n=n!=null?n.concat([t]):null,jm(4,4,pT.bind(null,e,t),n)}function Qx(){}function mT(t,e){var n=$r();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&Yx(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function gT(t,e){var n=$r();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&Yx(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function vT(t,e,n){return Ra&21?(po(n,e)||(n=bC(),Ot.lanes|=n,Na|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,Yn=!0),t.memoizedState=n)}function II(t,e){var n=st;st=n!==0&&4>n?n:4,t(!0);var r=gv.transition;gv.transition={};try{t(!1),e()}finally{st=n,gv.transition=r}}function yT(){return $r().memoizedState}function DI(t,e,n){var r=ms(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},xT(t))bT(e,n);else if(n=ZC(t,e,n,r),n!==null){var o=Dn();so(n,t,r,o),wT(n,e,r)}}function LI(t,e,n){var r=ms(t),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(xT(t))bT(e,o);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var s=e.lastRenderedState,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,po(a,s)){var l=e.interleaved;l===null?(o.next=o,Hx(e)):(o.next=l.next,l.next=o),e.interleaved=o;return}}catch{}finally{}n=ZC(t,e,o,r),n!==null&&(o=Dn(),so(n,t,r,o),wT(n,e,r))}}function xT(t){var e=t.alternate;return t===Ot||e!==null&&e===Ot}function bT(t,e){Zu=yh=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function wT(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Rx(t,n)}}var xh={readContext:Pr,useCallback:wn,useContext:wn,useEffect:wn,useImperativeHandle:wn,useInsertionEffect:wn,useLayoutEffect:wn,useMemo:wn,useReducer:wn,useRef:wn,useState:wn,useDebugValue:wn,useDeferredValue:wn,useTransition:wn,useMutableSource:wn,useSyncExternalStore:wn,useId:wn,unstable_isNewReconciler:!1},jI={readContext:Pr,useCallback:function(t,e){return So().memoizedState=[t,e===void 0?null:e],t},useContext:Pr,useEffect:Gw,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Np(4194308,4,pT.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Np(4194308,4,t,e)},useInsertionEffect:function(t,e){return Np(4,2,t,e)},useMemo:function(t,e){var n=So();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=So();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=DI.bind(null,Ot,t),[r.memoizedState,t]},useRef:function(t){var e=So();return t={current:t},e.memoizedState=t},useState:qw,useDebugValue:Qx,useDeferredValue:function(t){return So().memoizedState=t},useTransition:function(){var t=qw(!1),e=t[0];return t=II.bind(null,t[1]),So().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Ot,o=So();if(wt){if(n===void 0)throw Error(V(407));n=n()}else{if(n=e(),on===null)throw Error(V(349));Ra&30||iT(r,e,n)}o.memoizedState=n;var i={value:n,getSnapshot:e};return o.queue=i,Gw(aT.bind(null,r,i,t),[t]),r.flags|=2048,_d(9,sT.bind(null,r,i,n,e),void 0,null),n},useId:function(){var t=So(),e=on.identifierPrefix;if(wt){var n=oi,r=ri;n=(r&~(1<<32-io(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Sd++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=AI++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},zI={readContext:Pr,useCallback:mT,useContext:Pr,useEffect:Xx,useImperativeHandle:hT,useInsertionEffect:dT,useLayoutEffect:fT,useMemo:gT,useReducer:vv,useRef:uT,useState:function(){return vv(Ed)},useDebugValue:Qx,useDeferredValue:function(t){var e=$r();return vT(e,Ht.memoizedState,t)},useTransition:function(){var t=vv(Ed)[0],e=$r().memoizedState;return[t,e]},useMutableSource:rT,useSyncExternalStore:oT,useId:yT,unstable_isNewReconciler:!1},FI={readContext:Pr,useCallback:mT,useContext:Pr,useEffect:Xx,useImperativeHandle:hT,useInsertionEffect:dT,useLayoutEffect:fT,useMemo:gT,useReducer:yv,useRef:uT,useState:function(){return yv(Ed)},useDebugValue:Qx,useDeferredValue:function(t){var e=$r();return Ht===null?e.memoizedState=t:vT(e,Ht.memoizedState,t)},useTransition:function(){var t=yv(Ed)[0],e=$r().memoizedState;return[t,e]},useMutableSource:rT,useSyncExternalStore:oT,useId:yT,unstable_isNewReconciler:!1};function uc(t,e){try{var n="",r=e;do n+=hA(r),r=r.return;while(r);var o=n}catch(i){o=`
31
- Error generating stack: `+i.message+`
32
- `+i.stack}return{value:t,source:e,stack:o,digest:null}}function xv(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function zy(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var BI=typeof WeakMap=="function"?WeakMap:Map;function kT(t,e,n){n=li(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){wh||(wh=!0,Yy=r),zy(t,e)},n}function ST(t,e,n){n=li(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var o=e.value;n.payload=function(){return r(o)},n.callback=function(){zy(t,e)}}var i=t.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){zy(t,e),typeof r!="function"&&(hs===null?hs=new Set([this]):hs.add(this));var s=e.stack;this.componentDidCatch(e.value,{componentStack:s!==null?s:""})}),n}function Yw(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new BI;var o=new Set;r.set(e,o)}else o=r.get(e),o===void 0&&(o=new Set,r.set(e,o));o.has(n)||(o.add(n),t=tD.bind(null,t,e,n),e.then(t,t))}function Zw(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function Jw(t,e,n,r,o){return t.mode&1?(t.flags|=65536,t.lanes=o,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=li(-1,1),e.tag=2,ps(n,e,1))),n.lanes|=1),t)}var UI=Si.ReactCurrentOwner,Yn=!1;function Pn(t,e,n,r){e.child=t===null?tT(e,null,n,r):lc(e,t.child,n,r)}function Xw(t,e,n,r,o){n=n.render;var i=e.ref;return Zl(e,o),r=Zx(t,e,n,r,i,o),n=Jx(),t!==null&&!Yn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~o,hi(t,e,o)):(wt&&n&&jx(e),e.flags|=1,Pn(t,e,r,o),e.child)}function Qw(t,e,n,r,o){if(t===null){var i=n.type;return typeof i=="function"&&!a1(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=i,ET(t,e,i,r,o)):(t=Ip(n.type,null,r,e,e.mode,o),t.ref=e.ref,t.return=e,e.child=t)}if(i=t.child,!(t.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:vd,n(s,r)&&t.ref===e.ref)return hi(t,e,o)}return e.flags|=1,t=gs(i,r),t.ref=e.ref,t.return=e,e.child=t}function ET(t,e,n,r,o){if(t!==null){var i=t.memoizedProps;if(vd(i,r)&&t.ref===e.ref)if(Yn=!1,e.pendingProps=r=i,(t.lanes&o)!==0)t.flags&131072&&(Yn=!0);else return e.lanes=t.lanes,hi(t,e,o)}return Fy(t,e,n,r,o)}function _T(t,e,n){var r=e.pendingProps,o=r.children,i=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},ht(Ul,ir),ir|=n;else{if(!(n&1073741824))return t=i!==null?i.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,ht(Ul,ir),ir|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,ht(Ul,ir),ir|=r}else i!==null?(r=i.baseLanes|n,e.memoizedState=null):r=n,ht(Ul,ir),ir|=r;return Pn(t,e,o,n),e.child}function CT(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function Fy(t,e,n,r,o){var i=Xn(n)?Oa:Tn.current;return i=sc(e,i),Zl(e,o),n=Zx(t,e,n,r,i,o),r=Jx(),t!==null&&!Yn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~o,hi(t,e,o)):(wt&&r&&jx(e),e.flags|=1,Pn(t,e,n,o),e.child)}function ek(t,e,n,r,o){if(Xn(n)){var i=!0;dh(e)}else i=!1;if(Zl(e,o),e.stateNode===null)Pp(t,e),QC(e,n,r),jy(e,n,r,o),r=!0;else if(t===null){var s=e.stateNode,a=e.memoizedProps;s.props=a;var l=s.context,c=n.contextType;typeof c=="object"&&c!==null?c=Pr(c):(c=Xn(n)?Oa:Tn.current,c=sc(e,c));var u=n.getDerivedStateFromProps,d=typeof u=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==c)&&Ww(e,s,r,c),Zi=!1;var f=e.memoizedState;s.state=f,gh(e,r,s,o),l=e.memoizedState,a!==r||f!==l||Jn.current||Zi?(typeof u=="function"&&(Ly(e,n,u,r),l=e.memoizedState),(a=Zi||Hw(e,n,a,r,f,l,c))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(e.flags|=4194308)):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=l),s.props=r,s.state=l,s.context=c,r=a):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{s=e.stateNode,JC(t,e),a=e.memoizedProps,c=e.type===e.elementType?a:Gr(e.type,a),s.props=c,d=e.pendingProps,f=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Pr(l):(l=Xn(n)?Oa:Tn.current,l=sc(e,l));var p=n.getDerivedStateFromProps;(u=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==d||f!==l)&&Ww(e,s,r,l),Zi=!1,f=e.memoizedState,s.state=f,gh(e,r,s,o);var m=e.memoizedState;a!==d||f!==m||Jn.current||Zi?(typeof p=="function"&&(Ly(e,n,p,r),m=e.memoizedState),(c=Zi||Hw(e,n,c,r,f,m,l)||!1)?(u||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,m,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,m,l)),typeof s.componentDidUpdate=="function"&&(e.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=m),s.props=r,s.state=m,s.context=l,r=c):(typeof s.componentDidUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),r=!1)}return By(t,e,n,r,i,o)}function By(t,e,n,r,o,i){CT(t,e);var s=(e.flags&128)!==0;if(!r&&!s)return o&&zw(e,n,!1),hi(t,e,i);r=e.stateNode,UI.current=e;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&s?(e.child=lc(e,t.child,null,i),e.child=lc(e,null,a,i)):Pn(t,e,a,i),e.memoizedState=r.state,o&&zw(e,n,!0),e.child}function TT(t){var e=t.stateNode;e.pendingContext?jw(t,e.pendingContext,e.pendingContext!==e.context):e.context&&jw(t,e.context,!1),Kx(t,e.containerInfo)}function tk(t,e,n,r,o){return ac(),Fx(o),e.flags|=256,Pn(t,e,n,r),e.child}var Uy={dehydrated:null,treeContext:null,retryLane:0};function Vy(t){return{baseLanes:t,cachePool:null,transitions:null}}function OT(t,e,n){var r=e.pendingProps,o=Ct.current,i=!1,s=(e.flags&128)!==0,a;if((a=s)||(a=t!==null&&t.memoizedState===null?!1:(o&2)!==0),a?(i=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(o|=1),ht(Ct,o&1),t===null)return Iy(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(s=r.children,t=r.fallback,i?(r=e.mode,i=e.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=Bm(s,r,0,null),t=ya(t,r,n,null),i.return=e,t.return=e,i.sibling=t,e.child=i,e.child.memoizedState=Vy(n),e.memoizedState=Uy,t):e1(e,s));if(o=t.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return VI(t,e,s,r,a,o,n);if(i){i=r.fallback,s=e.mode,o=t.child,a=o.sibling;var l={mode:"hidden",children:r.children};return!(s&1)&&e.child!==o?(r=e.child,r.childLanes=0,r.pendingProps=l,e.deletions=null):(r=gs(o,l),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?i=gs(a,i):(i=ya(i,s,n,null),i.flags|=2),i.return=e,r.return=e,r.sibling=i,e.child=r,r=i,i=e.child,s=t.child.memoizedState,s=s===null?Vy(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=t.childLanes&~n,e.memoizedState=Uy,r}return i=t.child,t=i.sibling,r=gs(i,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function e1(t,e){return e=Bm({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function op(t,e,n,r){return r!==null&&Fx(r),lc(e,t.child,null,n),t=e1(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function VI(t,e,n,r,o,i,s){if(n)return e.flags&256?(e.flags&=-257,r=xv(Error(V(422))),op(t,e,s,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(i=r.fallback,o=e.mode,r=Bm({mode:"visible",children:r.children},o,0,null),i=ya(i,o,s,null),i.flags|=2,r.return=e,i.return=e,r.sibling=i,e.child=r,e.mode&1&&lc(e,t.child,null,s),e.child.memoizedState=Vy(s),e.memoizedState=Uy,i);if(!(e.mode&1))return op(t,e,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(V(419)),r=xv(i,r,void 0),op(t,e,s,r)}if(a=(s&t.childLanes)!==0,Yn||a){if(r=on,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=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:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,pi(t,o),so(r,t,o,-1))}return s1(),r=xv(Error(V(421))),op(t,e,s,r)}return o.data==="$?"?(e.flags|=128,e.child=t.child,e=nD.bind(null,t),o._reactRetry=e,null):(t=i.treeContext,ur=fs(o.nextSibling),dr=e,wt=!0,Jr=null,t!==null&&(Cr[Tr++]=ri,Cr[Tr++]=oi,Cr[Tr++]=Ma,ri=t.id,oi=t.overflow,Ma=e),e=e1(e,r.children),e.flags|=4096,e)}function nk(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),Dy(t.return,e,n)}function bv(t,e,n,r,o){var i=t.memoizedState;i===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=e,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function MT(t,e,n){var r=e.pendingProps,o=r.revealOrder,i=r.tail;if(Pn(t,e,r.children,n),r=Ct.current,r&2)r=r&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&nk(t,n,e);else if(t.tag===19)nk(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(ht(Ct,r),!(e.mode&1))e.memoizedState=null;else switch(o){case"forwards":for(n=e.child,o=null;n!==null;)t=n.alternate,t!==null&&vh(t)===null&&(o=n),n=n.sibling;n=o,n===null?(o=e.child,e.child=null):(o=n.sibling,n.sibling=null),bv(e,!1,o,n,i);break;case"backwards":for(n=null,o=e.child,e.child=null;o!==null;){if(t=o.alternate,t!==null&&vh(t)===null){e.child=o;break}t=o.sibling,o.sibling=n,n=o,o=t}bv(e,!0,n,null,i);break;case"together":bv(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Pp(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function hi(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Na|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(V(153));if(e.child!==null){for(t=e.child,n=gs(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=gs(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function HI(t,e,n){switch(e.tag){case 3:TT(e),ac();break;case 5:nT(e);break;case 1:Xn(e.type)&&dh(e);break;case 4:Kx(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,o=e.memoizedProps.value;ht(hh,r._currentValue),r._currentValue=o;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(ht(Ct,Ct.current&1),e.flags|=128,null):n&e.child.childLanes?OT(t,e,n):(ht(Ct,Ct.current&1),t=hi(t,e,n),t!==null?t.sibling:null);ht(Ct,Ct.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return MT(t,e,n);e.flags|=128}if(o=e.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ht(Ct,Ct.current),r)break;return null;case 22:case 23:return e.lanes=0,_T(t,e,n)}return hi(t,e,n)}var RT,Hy,NT,PT;RT=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Hy=function(){};NT=function(t,e,n,r){var o=t.memoizedProps;if(o!==r){t=e.stateNode,ca(No.current);var i=null;switch(n){case"input":o=fy(t,o),r=fy(t,r),i=[];break;case"select":o=Mt({},o,{value:void 0}),r=Mt({},r,{value:void 0}),i=[];break;case"textarea":o=my(t,o),r=my(t,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=ch)}vy(n,r);var s;n=null;for(c in o)if(!r.hasOwnProperty(c)&&o.hasOwnProperty(c)&&o[c]!=null)if(c==="style"){var a=o[c];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(ud.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var l=r[c];if(a=o!=null?o[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(i||(i=[]),i.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(ud.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&vt("scroll",t),i||a===l||(i=[])):(i=i||[]).push(c,l))}n&&(i=i||[]).push("style",n);var c=i;(e.updateQueue=c)&&(e.flags|=4)}};PT=function(t,e,n,r){n!==r&&(e.flags|=4)};function eu(t,e){if(!wt)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function kn(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var o=t.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=t,o=o.sibling;else for(o=t.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=t,o=o.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function WI(t,e,n){var r=e.pendingProps;switch(zx(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kn(e),null;case 1:return Xn(e.type)&&uh(),kn(e),null;case 3:return r=e.stateNode,cc(),xt(Jn),xt(Tn),Gx(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(np(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Jr!==null&&(Xy(Jr),Jr=null))),Hy(t,e),kn(e),null;case 5:qx(e);var o=ca(kd.current);if(n=e.type,t!==null&&e.stateNode!=null)NT(t,e,n,r,o),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(V(166));return kn(e),null}if(t=ca(No.current),np(e)){r=e.stateNode,n=e.type;var i=e.memoizedProps;switch(r[_o]=e,r[bd]=i,t=(e.mode&1)!==0,n){case"dialog":vt("cancel",r),vt("close",r);break;case"iframe":case"object":case"embed":vt("load",r);break;case"video":case"audio":for(o=0;o<bu.length;o++)vt(bu[o],r);break;case"source":vt("error",r);break;case"img":case"image":case"link":vt("error",r),vt("load",r);break;case"details":vt("toggle",r);break;case"input":dw(r,i),vt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},vt("invalid",r);break;case"textarea":pw(r,i),vt("invalid",r)}vy(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var a=i[s];s==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&tp(r.textContent,a,t),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&tp(r.textContent,a,t),o=["children",""+a]):ud.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&vt("scroll",r)}switch(n){case"input":qf(r),fw(r,i,!0);break;case"textarea":qf(r),hw(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=ch)}r=o,e.updateQueue=r,r!==null&&(e.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=iC(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=s.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=s.createElement(n,{is:r.is}):(t=s.createElement(n),n==="select"&&(s=t,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):t=s.createElementNS(t,n),t[_o]=e,t[bd]=r,RT(t,e,!1,!1),e.stateNode=t;e:{switch(s=yy(n,r),n){case"dialog":vt("cancel",t),vt("close",t),o=r;break;case"iframe":case"object":case"embed":vt("load",t),o=r;break;case"video":case"audio":for(o=0;o<bu.length;o++)vt(bu[o],t);o=r;break;case"source":vt("error",t),o=r;break;case"img":case"image":case"link":vt("error",t),vt("load",t),o=r;break;case"details":vt("toggle",t),o=r;break;case"input":dw(t,r),o=fy(t,r),vt("invalid",t);break;case"option":o=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},o=Mt({},r,{value:void 0}),vt("invalid",t);break;case"textarea":pw(t,r),o=my(t,r),vt("invalid",t);break;default:o=r}vy(n,o),a=o;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?lC(t,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&sC(t,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&dd(t,l):typeof l=="number"&&dd(t,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(ud.hasOwnProperty(i)?l!=null&&i==="onScroll"&&vt("scroll",t):l!=null&&Ex(t,i,l,s))}switch(n){case"input":qf(t),fw(t,r,!1);break;case"textarea":qf(t),hw(t);break;case"option":r.value!=null&&t.setAttribute("value",""+_s(r.value));break;case"select":t.multiple=!!r.multiple,i=r.value,i!=null?Kl(t,!!r.multiple,i,!1):r.defaultValue!=null&&Kl(t,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(t.onclick=ch)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return kn(e),null;case 6:if(t&&e.stateNode!=null)PT(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(V(166));if(n=ca(kd.current),ca(No.current),np(e)){if(r=e.stateNode,n=e.memoizedProps,r[_o]=e,(i=r.nodeValue!==n)&&(t=dr,t!==null))switch(t.tag){case 3:tp(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&tp(r.nodeValue,n,(t.mode&1)!==0)}i&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[_o]=e,e.stateNode=r}return kn(e),null;case 13:if(xt(Ct),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(wt&&ur!==null&&e.mode&1&&!(e.flags&128))YC(),ac(),e.flags|=98560,i=!1;else if(i=np(e),r!==null&&r.dehydrated!==null){if(t===null){if(!i)throw Error(V(318));if(i=e.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(V(317));i[_o]=e}else ac(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;kn(e),i=!1}else Jr!==null&&(Xy(Jr),Jr=null),i=!0;if(!i)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(t===null||Ct.current&1?Kt===0&&(Kt=3):s1())),e.updateQueue!==null&&(e.flags|=4),kn(e),null);case 4:return cc(),Hy(t,e),t===null&&yd(e.stateNode.containerInfo),kn(e),null;case 10:return Vx(e.type._context),kn(e),null;case 17:return Xn(e.type)&&uh(),kn(e),null;case 19:if(xt(Ct),i=e.memoizedState,i===null)return kn(e),null;if(r=(e.flags&128)!==0,s=i.rendering,s===null)if(r)eu(i,!1);else{if(Kt!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(s=vh(t),s!==null){for(e.flags|=128,eu(i,!1),r=s.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)i=n,t=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=t,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,t=s.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return ht(Ct,Ct.current&1|2),e.child}t=t.sibling}i.tail!==null&&Lt()>dc&&(e.flags|=128,r=!0,eu(i,!1),e.lanes=4194304)}else{if(!r)if(t=vh(s),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),eu(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!wt)return kn(e),null}else 2*Lt()-i.renderingStartTime>dc&&n!==1073741824&&(e.flags|=128,r=!0,eu(i,!1),e.lanes=4194304);i.isBackwards?(s.sibling=e.child,e.child=s):(n=i.last,n!==null?n.sibling=s:e.child=s,i.last=s)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Lt(),e.sibling=null,n=Ct.current,ht(Ct,r?n&1|2:n&1),e):(kn(e),null);case 22:case 23:return i1(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?ir&1073741824&&(kn(e),e.subtreeFlags&6&&(e.flags|=8192)):kn(e),null;case 24:return null;case 25:return null}throw Error(V(156,e.tag))}function KI(t,e){switch(zx(e),e.tag){case 1:return Xn(e.type)&&uh(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return cc(),xt(Jn),xt(Tn),Gx(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return qx(e),null;case 13:if(xt(Ct),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(V(340));ac()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return xt(Ct),null;case 4:return cc(),null;case 10:return Vx(e.type._context),null;case 22:case 23:return i1(),null;case 24:return null;default:return null}}var ip=!1,_n=!1,qI=typeof WeakSet=="function"?WeakSet:Set,ie=null;function Bl(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Nt(t,e,r)}else n.current=null}function Wy(t,e,n){try{n()}catch(r){Nt(t,e,r)}}var rk=!1;function GI(t,e){if(Oy=sh,t=DC(),Lx(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,u=0,d=t,f=null;t:for(;;){for(var p;d!==n||o!==0&&d.nodeType!==3||(a=s+o),d!==i||r!==0&&d.nodeType!==3||(l=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===t)break t;if(f===n&&++c===o&&(a=s),f===i&&++u===r&&(l=s),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(My={focusedElem:t,selectionRange:n},sh=!1,ie=e;ie!==null;)if(e=ie,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ie=t;else for(;ie!==null;){e=ie;try{var m=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var g=m.memoizedProps,y=m.memoizedState,v=e.stateNode,x=v.getSnapshotBeforeUpdate(e.elementType===e.type?g:Gr(e.type,g),y);v.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var w=e.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(V(163))}}catch(S){Nt(e,e.return,S)}if(t=e.sibling,t!==null){t.return=e.return,ie=t;break}ie=e.return}return m=rk,rk=!1,m}function Ju(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&t)===t){var i=o.destroy;o.destroy=void 0,i!==void 0&&Wy(e,n,i)}o=o.next}while(o!==r)}}function zm(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function Ky(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function $T(t){var e=t.alternate;e!==null&&(t.alternate=null,$T(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[_o],delete e[bd],delete e[Py],delete e[RI],delete e[NI])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function AT(t){return t.tag===5||t.tag===3||t.tag===4}function ok(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||AT(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function qy(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=ch));else if(r!==4&&(t=t.child,t!==null))for(qy(t,e,n),t=t.sibling;t!==null;)qy(t,e,n),t=t.sibling}function Gy(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(Gy(t,e,n),t=t.sibling;t!==null;)Gy(t,e,n),t=t.sibling}var fn=null,Yr=!1;function $i(t,e,n){for(n=n.child;n!==null;)IT(t,e,n),n=n.sibling}function IT(t,e,n){if(Ro&&typeof Ro.onCommitFiberUnmount=="function")try{Ro.onCommitFiberUnmount(Nm,n)}catch{}switch(n.tag){case 5:_n||Bl(n,e);case 6:var r=fn,o=Yr;fn=null,$i(t,e,n),fn=r,Yr=o,fn!==null&&(Yr?(t=fn,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):fn.removeChild(n.stateNode));break;case 18:fn!==null&&(Yr?(t=fn,n=n.stateNode,t.nodeType===8?pv(t.parentNode,n):t.nodeType===1&&pv(t,n),md(t)):pv(fn,n.stateNode));break;case 4:r=fn,o=Yr,fn=n.stateNode.containerInfo,Yr=!0,$i(t,e,n),fn=r,Yr=o;break;case 0:case 11:case 14:case 15:if(!_n&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&Wy(n,e,s),o=o.next}while(o!==r)}$i(t,e,n);break;case 1:if(!_n&&(Bl(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Nt(n,e,a)}$i(t,e,n);break;case 21:$i(t,e,n);break;case 22:n.mode&1?(_n=(r=_n)||n.memoizedState!==null,$i(t,e,n),_n=r):$i(t,e,n);break;default:$i(t,e,n)}}function ik(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new qI),e.forEach(function(r){var o=rD.bind(null,t,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Vr(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=t,s=e,a=s;e:for(;a!==null;){switch(a.tag){case 5:fn=a.stateNode,Yr=!1;break e;case 3:fn=a.stateNode.containerInfo,Yr=!0;break e;case 4:fn=a.stateNode.containerInfo,Yr=!0;break e}a=a.return}if(fn===null)throw Error(V(160));IT(i,s,o),fn=null,Yr=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(c){Nt(o,e,c)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)DT(e,t),e=e.sibling}function DT(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Vr(e,t),wo(t),r&4){try{Ju(3,t,t.return),zm(3,t)}catch(g){Nt(t,t.return,g)}try{Ju(5,t,t.return)}catch(g){Nt(t,t.return,g)}}break;case 1:Vr(e,t),wo(t),r&512&&n!==null&&Bl(n,n.return);break;case 5:if(Vr(e,t),wo(t),r&512&&n!==null&&Bl(n,n.return),t.flags&32){var o=t.stateNode;try{dd(o,"")}catch(g){Nt(t,t.return,g)}}if(r&4&&(o=t.stateNode,o!=null)){var i=t.memoizedProps,s=n!==null?n.memoizedProps:i,a=t.type,l=t.updateQueue;if(t.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&rC(o,i),yy(a,s);var c=yy(a,i);for(s=0;s<l.length;s+=2){var u=l[s],d=l[s+1];u==="style"?lC(o,d):u==="dangerouslySetInnerHTML"?sC(o,d):u==="children"?dd(o,d):Ex(o,u,d,c)}switch(a){case"input":py(o,i);break;case"textarea":oC(o,i);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?Kl(o,!!i.multiple,p,!1):f!==!!i.multiple&&(i.defaultValue!=null?Kl(o,!!i.multiple,i.defaultValue,!0):Kl(o,!!i.multiple,i.multiple?[]:"",!1))}o[bd]=i}catch(g){Nt(t,t.return,g)}}break;case 6:if(Vr(e,t),wo(t),r&4){if(t.stateNode===null)throw Error(V(162));o=t.stateNode,i=t.memoizedProps;try{o.nodeValue=i}catch(g){Nt(t,t.return,g)}}break;case 3:if(Vr(e,t),wo(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{md(e.containerInfo)}catch(g){Nt(t,t.return,g)}break;case 4:Vr(e,t),wo(t);break;case 13:Vr(e,t),wo(t),o=t.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(r1=Lt())),r&4&&ik(t);break;case 22:if(u=n!==null&&n.memoizedState!==null,t.mode&1?(_n=(c=_n)||u,Vr(e,t),_n=c):Vr(e,t),wo(t),r&8192){if(c=t.memoizedState!==null,(t.stateNode.isHidden=c)&&!u&&t.mode&1)for(ie=t,u=t.child;u!==null;){for(d=ie=u;ie!==null;){switch(f=ie,p=f.child,f.tag){case 0:case 11:case 14:case 15:Ju(4,f,f.return);break;case 1:Bl(f,f.return);var m=f.stateNode;if(typeof m.componentWillUnmount=="function"){r=f,n=f.return;try{e=r,m.props=e.memoizedProps,m.state=e.memoizedState,m.componentWillUnmount()}catch(g){Nt(r,n,g)}}break;case 5:Bl(f,f.return);break;case 22:if(f.memoizedState!==null){ak(d);continue}}p!==null?(p.return=f,ie=p):ak(d)}u=u.sibling}e:for(u=null,d=t;;){if(d.tag===5){if(u===null){u=d;try{o=d.stateNode,c?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=d.stateNode,l=d.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=aC("display",s))}catch(g){Nt(t,t.return,g)}}}else if(d.tag===6){if(u===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(g){Nt(t,t.return,g)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===t)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;u===d&&(u=null),d=d.return}u===d&&(u=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Vr(e,t),wo(t),r&4&&ik(t);break;case 21:break;default:Vr(e,t),wo(t)}}function wo(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(AT(n)){var r=n;break e}n=n.return}throw Error(V(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(dd(o,""),r.flags&=-33);var i=ok(t);Gy(t,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,a=ok(t);qy(t,a,s);break;default:throw Error(V(161))}}catch(l){Nt(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function YI(t,e,n){ie=t,LT(t)}function LT(t,e,n){for(var r=(t.mode&1)!==0;ie!==null;){var o=ie,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||ip;if(!s){var a=o.alternate,l=a!==null&&a.memoizedState!==null||_n;a=ip;var c=_n;if(ip=s,(_n=l)&&!c)for(ie=o;ie!==null;)s=ie,l=s.child,s.tag===22&&s.memoizedState!==null?lk(o):l!==null?(l.return=s,ie=l):lk(o);for(;i!==null;)ie=i,LT(i),i=i.sibling;ie=o,ip=a,_n=c}sk(t)}else o.subtreeFlags&8772&&i!==null?(i.return=o,ie=i):sk(t)}}function sk(t){for(;ie!==null;){var e=ie;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:_n||zm(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!_n)if(n===null)r.componentDidMount();else{var o=e.elementType===e.type?n.memoizedProps:Gr(e.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=e.updateQueue;i!==null&&Vw(e,i,r);break;case 3:var s=e.updateQueue;if(s!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}Vw(e,s,n)}break;case 5:var a=e.stateNode;if(n===null&&e.flags&4){n=a;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var c=e.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var d=u.dehydrated;d!==null&&md(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(V(163))}_n||e.flags&512&&Ky(e)}catch(f){Nt(e,e.return,f)}}if(e===t){ie=null;break}if(n=e.sibling,n!==null){n.return=e.return,ie=n;break}ie=e.return}}function ak(t){for(;ie!==null;){var e=ie;if(e===t){ie=null;break}var n=e.sibling;if(n!==null){n.return=e.return,ie=n;break}ie=e.return}}function lk(t){for(;ie!==null;){var e=ie;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{zm(4,e)}catch(l){Nt(e,n,l)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var o=e.return;try{r.componentDidMount()}catch(l){Nt(e,o,l)}}var i=e.return;try{Ky(e)}catch(l){Nt(e,i,l)}break;case 5:var s=e.return;try{Ky(e)}catch(l){Nt(e,s,l)}}}catch(l){Nt(e,e.return,l)}if(e===t){ie=null;break}var a=e.sibling;if(a!==null){a.return=e.return,ie=a;break}ie=e.return}}var ZI=Math.ceil,bh=Si.ReactCurrentDispatcher,t1=Si.ReactCurrentOwner,Rr=Si.ReactCurrentBatchConfig,Ge=0,on=null,Bt=null,mn=0,ir=0,Ul=Fs(0),Kt=0,Cd=null,Na=0,Fm=0,n1=0,Xu=null,Gn=null,r1=0,dc=1/0,Xo=null,wh=!1,Yy=null,hs=null,sp=!1,is=null,kh=0,Qu=0,Zy=null,$p=-1,Ap=0;function Dn(){return Ge&6?Lt():$p!==-1?$p:$p=Lt()}function ms(t){return t.mode&1?Ge&2&&mn!==0?mn&-mn:$I.transition!==null?(Ap===0&&(Ap=bC()),Ap):(t=st,t!==0||(t=window.event,t=t===void 0?16:TC(t.type)),t):1}function so(t,e,n,r){if(50<Qu)throw Qu=0,Zy=null,Error(V(185));xf(t,n,r),(!(Ge&2)||t!==on)&&(t===on&&(!(Ge&2)&&(Fm|=n),Kt===4&&es(t,mn)),Qn(t,r),n===1&&Ge===0&&!(e.mode&1)&&(dc=Lt()+500,Dm&&Bs()))}function Qn(t,e){var n=t.callbackNode;$A(t,e);var r=ih(t,t===on?mn:0);if(r===0)n!==null&&vw(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&vw(n),e===1)t.tag===0?PI(ck.bind(null,t)):KC(ck.bind(null,t)),OI(function(){!(Ge&6)&&Bs()}),n=null;else{switch(wC(r)){case 1:n=Mx;break;case 4:n=yC;break;case 16:n=oh;break;case 536870912:n=xC;break;default:n=oh}n=WT(n,jT.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function jT(t,e){if($p=-1,Ap=0,Ge&6)throw Error(V(327));var n=t.callbackNode;if(Jl()&&t.callbackNode!==n)return null;var r=ih(t,t===on?mn:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=Sh(t,r);else{e=r;var o=Ge;Ge|=2;var i=FT();(on!==t||mn!==e)&&(Xo=null,dc=Lt()+500,va(t,e));do try{QI();break}catch(a){zT(t,a)}while(!0);Ux(),bh.current=i,Ge=o,Bt!==null?e=0:(on=null,mn=0,e=Kt)}if(e!==0){if(e===2&&(o=Sy(t),o!==0&&(r=o,e=Jy(t,o))),e===1)throw n=Cd,va(t,0),es(t,r),Qn(t,Lt()),n;if(e===6)es(t,r);else{if(o=t.current.alternate,!(r&30)&&!JI(o)&&(e=Sh(t,r),e===2&&(i=Sy(t),i!==0&&(r=i,e=Jy(t,i))),e===1))throw n=Cd,va(t,0),es(t,r),Qn(t,Lt()),n;switch(t.finishedWork=o,t.finishedLanes=r,e){case 0:case 1:throw Error(V(345));case 2:Zs(t,Gn,Xo);break;case 3:if(es(t,r),(r&130023424)===r&&(e=r1+500-Lt(),10<e)){if(ih(t,0)!==0)break;if(o=t.suspendedLanes,(o&r)!==r){Dn(),t.pingedLanes|=t.suspendedLanes&o;break}t.timeoutHandle=Ny(Zs.bind(null,t,Gn,Xo),e);break}Zs(t,Gn,Xo);break;case 4:if(es(t,r),(r&4194240)===r)break;for(e=t.eventTimes,o=-1;0<r;){var s=31-io(r);i=1<<s,s=e[s],s>o&&(o=s),r&=~i}if(r=o,r=Lt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ZI(r/1960))-r,10<r){t.timeoutHandle=Ny(Zs.bind(null,t,Gn,Xo),r);break}Zs(t,Gn,Xo);break;case 5:Zs(t,Gn,Xo);break;default:throw Error(V(329))}}}return Qn(t,Lt()),t.callbackNode===n?jT.bind(null,t):null}function Jy(t,e){var n=Xu;return t.current.memoizedState.isDehydrated&&(va(t,e).flags|=256),t=Sh(t,e),t!==2&&(e=Gn,Gn=n,e!==null&&Xy(e)),t}function Xy(t){Gn===null?Gn=t:Gn.push.apply(Gn,t)}function JI(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!po(i(),o))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function es(t,e){for(e&=~n1,e&=~Fm,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-io(e),r=1<<n;t[n]=-1,e&=~r}}function ck(t){if(Ge&6)throw Error(V(327));Jl();var e=ih(t,0);if(!(e&1))return Qn(t,Lt()),null;var n=Sh(t,e);if(t.tag!==0&&n===2){var r=Sy(t);r!==0&&(e=r,n=Jy(t,r))}if(n===1)throw n=Cd,va(t,0),es(t,e),Qn(t,Lt()),n;if(n===6)throw Error(V(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,Zs(t,Gn,Xo),Qn(t,Lt()),null}function o1(t,e){var n=Ge;Ge|=1;try{return t(e)}finally{Ge=n,Ge===0&&(dc=Lt()+500,Dm&&Bs())}}function Pa(t){is!==null&&is.tag===0&&!(Ge&6)&&Jl();var e=Ge;Ge|=1;var n=Rr.transition,r=st;try{if(Rr.transition=null,st=1,t)return t()}finally{st=r,Rr.transition=n,Ge=e,!(Ge&6)&&Bs()}}function i1(){ir=Ul.current,xt(Ul)}function va(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,TI(n)),Bt!==null)for(n=Bt.return;n!==null;){var r=n;switch(zx(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&uh();break;case 3:cc(),xt(Jn),xt(Tn),Gx();break;case 5:qx(r);break;case 4:cc();break;case 13:xt(Ct);break;case 19:xt(Ct);break;case 10:Vx(r.type._context);break;case 22:case 23:i1()}n=n.return}if(on=t,Bt=t=gs(t.current,null),mn=ir=e,Kt=0,Cd=null,n1=Fm=Na=0,Gn=Xu=null,la!==null){for(e=0;e<la.length;e++)if(n=la[e],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}la=null}return t}function zT(t,e){do{var n=Bt;try{if(Ux(),Rp.current=xh,yh){for(var r=Ot.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}yh=!1}if(Ra=0,tn=Ht=Ot=null,Zu=!1,Sd=0,t1.current=null,n===null||n.return===null){Kt=1,Cd=e,Bt=null;break}e:{var i=t,s=n.return,a=n,l=e;if(e=mn,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,d=u.tag;if(!(u.mode&1)&&(d===0||d===11||d===15)){var f=u.alternate;f?(u.updateQueue=f.updateQueue,u.memoizedState=f.memoizedState,u.lanes=f.lanes):(u.updateQueue=null,u.memoizedState=null)}var p=Zw(s);if(p!==null){p.flags&=-257,Jw(p,s,a,i,e),p.mode&1&&Yw(i,c,e),e=p,l=c;var m=e.updateQueue;if(m===null){var g=new Set;g.add(l),e.updateQueue=g}else m.add(l);break e}else{if(!(e&1)){Yw(i,c,e),s1();break e}l=Error(V(426))}}else if(wt&&a.mode&1){var y=Zw(s);if(y!==null){!(y.flags&65536)&&(y.flags|=256),Jw(y,s,a,i,e),Fx(uc(l,a));break e}}i=l=uc(l,a),Kt!==4&&(Kt=2),Xu===null?Xu=[i]:Xu.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,e&=-e,i.lanes|=e;var v=kT(i,l,e);Uw(i,v);break e;case 1:a=l;var x=i.type,w=i.stateNode;if(!(i.flags&128)&&(typeof x.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(hs===null||!hs.has(w)))){i.flags|=65536,e&=-e,i.lanes|=e;var S=ST(i,a,e);Uw(i,S);break e}}i=i.return}while(i!==null)}UT(n)}catch(_){e=_,Bt===n&&n!==null&&(Bt=n=n.return);continue}break}while(!0)}function FT(){var t=bh.current;return bh.current=xh,t===null?xh:t}function s1(){(Kt===0||Kt===3||Kt===2)&&(Kt=4),on===null||!(Na&268435455)&&!(Fm&268435455)||es(on,mn)}function Sh(t,e){var n=Ge;Ge|=2;var r=FT();(on!==t||mn!==e)&&(Xo=null,va(t,e));do try{XI();break}catch(o){zT(t,o)}while(!0);if(Ux(),Ge=n,bh.current=r,Bt!==null)throw Error(V(261));return on=null,mn=0,Kt}function XI(){for(;Bt!==null;)BT(Bt)}function QI(){for(;Bt!==null&&!EA();)BT(Bt)}function BT(t){var e=HT(t.alternate,t,ir);t.memoizedProps=t.pendingProps,e===null?UT(t):Bt=e,t1.current=null}function UT(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=KI(n,e),n!==null){n.flags&=32767,Bt=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Kt=6,Bt=null;return}}else if(n=WI(n,e,ir),n!==null){Bt=n;return}if(e=e.sibling,e!==null){Bt=e;return}Bt=e=t}while(e!==null);Kt===0&&(Kt=5)}function Zs(t,e,n){var r=st,o=Rr.transition;try{Rr.transition=null,st=1,eD(t,e,n,r)}finally{Rr.transition=o,st=r}return null}function eD(t,e,n,r){do Jl();while(is!==null);if(Ge&6)throw Error(V(327));n=t.finishedWork;var o=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(V(177));t.callbackNode=null,t.callbackPriority=0;var i=n.lanes|n.childLanes;if(AA(t,i),t===on&&(Bt=on=null,mn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||sp||(sp=!0,WT(oh,function(){return Jl(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Rr.transition,Rr.transition=null;var s=st;st=1;var a=Ge;Ge|=4,t1.current=null,GI(t,n),DT(n,t),bI(My),sh=!!Oy,My=Oy=null,t.current=n,YI(n),_A(),Ge=a,st=s,Rr.transition=i}else t.current=n;if(sp&&(sp=!1,is=t,kh=o),i=t.pendingLanes,i===0&&(hs=null),OA(n.stateNode),Qn(t,Lt()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)o=e[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(wh)throw wh=!1,t=Yy,Yy=null,t;return kh&1&&t.tag!==0&&Jl(),i=t.pendingLanes,i&1?t===Zy?Qu++:(Qu=0,Zy=t):Qu=0,Bs(),null}function Jl(){if(is!==null){var t=wC(kh),e=Rr.transition,n=st;try{if(Rr.transition=null,st=16>t?16:t,is===null)var r=!1;else{if(t=is,is=null,kh=0,Ge&6)throw Error(V(331));var o=Ge;for(Ge|=4,ie=t.current;ie!==null;){var i=ie,s=i.child;if(ie.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(ie=c;ie!==null;){var u=ie;switch(u.tag){case 0:case 11:case 15:Ju(8,u,i)}var d=u.child;if(d!==null)d.return=u,ie=d;else for(;ie!==null;){u=ie;var f=u.sibling,p=u.return;if($T(u),u===c){ie=null;break}if(f!==null){f.return=p,ie=f;break}ie=p}}}var m=i.alternate;if(m!==null){var g=m.child;if(g!==null){m.child=null;do{var y=g.sibling;g.sibling=null,g=y}while(g!==null)}}ie=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,ie=s;else e:for(;ie!==null;){if(i=ie,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Ju(9,i,i.return)}var v=i.sibling;if(v!==null){v.return=i.return,ie=v;break e}ie=i.return}}var x=t.current;for(ie=x;ie!==null;){s=ie;var w=s.child;if(s.subtreeFlags&2064&&w!==null)w.return=s,ie=w;else e:for(s=x;ie!==null;){if(a=ie,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:zm(9,a)}}catch(_){Nt(a,a.return,_)}if(a===s){ie=null;break e}var S=a.sibling;if(S!==null){S.return=a.return,ie=S;break e}ie=a.return}}if(Ge=o,Bs(),Ro&&typeof Ro.onPostCommitFiberRoot=="function")try{Ro.onPostCommitFiberRoot(Nm,t)}catch{}r=!0}return r}finally{st=n,Rr.transition=e}}return!1}function uk(t,e,n){e=uc(n,e),e=kT(t,e,1),t=ps(t,e,1),e=Dn(),t!==null&&(xf(t,1,e),Qn(t,e))}function Nt(t,e,n){if(t.tag===3)uk(t,t,n);else for(;e!==null;){if(e.tag===3){uk(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(hs===null||!hs.has(r))){t=uc(n,t),t=ST(e,t,1),e=ps(e,t,1),t=Dn(),e!==null&&(xf(e,1,t),Qn(e,t));break}}e=e.return}}function tD(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=Dn(),t.pingedLanes|=t.suspendedLanes&n,on===t&&(mn&n)===n&&(Kt===4||Kt===3&&(mn&130023424)===mn&&500>Lt()-r1?va(t,0):n1|=n),Qn(t,e)}function VT(t,e){e===0&&(t.mode&1?(e=Zf,Zf<<=1,!(Zf&130023424)&&(Zf=4194304)):e=1);var n=Dn();t=pi(t,e),t!==null&&(xf(t,e,n),Qn(t,n))}function nD(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),VT(t,n)}function rD(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,o=t.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(V(314))}r!==null&&r.delete(e),VT(t,n)}var HT;HT=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||Jn.current)Yn=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Yn=!1,HI(t,e,n);Yn=!!(t.flags&131072)}else Yn=!1,wt&&e.flags&1048576&&qC(e,ph,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Pp(t,e),t=e.pendingProps;var o=sc(e,Tn.current);Zl(e,n),o=Zx(null,e,r,t,o,n);var i=Jx();return e.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Xn(r)?(i=!0,dh(e)):i=!1,e.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Wx(e),o.updater=Lm,e.stateNode=o,o._reactInternals=e,jy(e,r,t,n),e=By(null,e,r,!0,i,n)):(e.tag=0,wt&&i&&jx(e),Pn(null,e,o,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Pp(t,e),t=e.pendingProps,o=r._init,r=o(r._payload),e.type=r,o=e.tag=iD(r),t=Gr(r,t),o){case 0:e=Fy(null,e,r,t,n);break e;case 1:e=ek(null,e,r,t,n);break e;case 11:e=Xw(null,e,r,t,n);break e;case 14:e=Qw(null,e,r,Gr(r.type,t),n);break e}throw Error(V(306,r,""))}return e;case 0:return r=e.type,o=e.pendingProps,o=e.elementType===r?o:Gr(r,o),Fy(t,e,r,o,n);case 1:return r=e.type,o=e.pendingProps,o=e.elementType===r?o:Gr(r,o),ek(t,e,r,o,n);case 3:e:{if(TT(e),t===null)throw Error(V(387));r=e.pendingProps,i=e.memoizedState,o=i.element,JC(t,e),gh(e,r,null,n);var s=e.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){o=uc(Error(V(423)),e),e=tk(t,e,r,n,o);break e}else if(r!==o){o=uc(Error(V(424)),e),e=tk(t,e,r,n,o);break e}else for(ur=fs(e.stateNode.containerInfo.firstChild),dr=e,wt=!0,Jr=null,n=tT(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ac(),r===o){e=hi(t,e,n);break e}Pn(t,e,r,n)}e=e.child}return e;case 5:return nT(e),t===null&&Iy(e),r=e.type,o=e.pendingProps,i=t!==null?t.memoizedProps:null,s=o.children,Ry(r,o)?s=null:i!==null&&Ry(r,i)&&(e.flags|=32),CT(t,e),Pn(t,e,s,n),e.child;case 6:return t===null&&Iy(e),null;case 13:return OT(t,e,n);case 4:return Kx(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=lc(e,null,r,n):Pn(t,e,r,n),e.child;case 11:return r=e.type,o=e.pendingProps,o=e.elementType===r?o:Gr(r,o),Xw(t,e,r,o,n);case 7:return Pn(t,e,e.pendingProps,n),e.child;case 8:return Pn(t,e,e.pendingProps.children,n),e.child;case 12:return Pn(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,o=e.pendingProps,i=e.memoizedProps,s=o.value,ht(hh,r._currentValue),r._currentValue=s,i!==null)if(po(i.value,s)){if(i.children===o.children&&!Jn.current){e=hi(t,e,n);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=li(-1,n&-n),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Dy(i.return,n,e),a.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===e.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(V(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Dy(s,n,e),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}Pn(t,e,o.children,n),e=e.child}return e;case 9:return o=e.type,r=e.pendingProps.children,Zl(e,n),o=Pr(o),r=r(o),e.flags|=1,Pn(t,e,r,n),e.child;case 14:return r=e.type,o=Gr(r,e.pendingProps),o=Gr(r.type,o),Qw(t,e,r,o,n);case 15:return ET(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,o=e.pendingProps,o=e.elementType===r?o:Gr(r,o),Pp(t,e),e.tag=1,Xn(r)?(t=!0,dh(e)):t=!1,Zl(e,n),QC(e,r,o),jy(e,r,o,n),By(null,e,r,!0,t,n);case 19:return MT(t,e,n);case 22:return _T(t,e,n)}throw Error(V(156,e.tag))};function WT(t,e){return vC(t,e)}function oD(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Or(t,e,n,r){return new oD(t,e,n,r)}function a1(t){return t=t.prototype,!(!t||!t.isReactComponent)}function iD(t){if(typeof t=="function")return a1(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Cx)return 11;if(t===Tx)return 14}return 2}function gs(t,e){var n=t.alternate;return n===null?(n=Or(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Ip(t,e,n,r,o,i){var s=2;if(r=t,typeof t=="function")a1(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case Pl:return ya(n.children,o,i,e);case _x:s=8,o|=8;break;case ly:return t=Or(12,n,e,o|2),t.elementType=ly,t.lanes=i,t;case cy:return t=Or(13,n,e,o),t.elementType=cy,t.lanes=i,t;case uy:return t=Or(19,n,e,o),t.elementType=uy,t.lanes=i,t;case eC:return Bm(n,o,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case X_:s=10;break e;case Q_:s=9;break e;case Cx:s=11;break e;case Tx:s=14;break e;case Yi:s=16,r=null;break e}throw Error(V(130,t==null?t:typeof t,""))}return e=Or(s,n,e,o),e.elementType=t,e.type=r,e.lanes=i,e}function ya(t,e,n,r){return t=Or(7,t,r,e),t.lanes=n,t}function Bm(t,e,n,r){return t=Or(22,t,r,e),t.elementType=eC,t.lanes=n,t.stateNode={isHidden:!1},t}function wv(t,e,n){return t=Or(6,t,null,e),t.lanes=n,t}function kv(t,e,n){return e=Or(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function sD(t,e,n,r,o){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=nv(0),this.expirationTimes=nv(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nv(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function l1(t,e,n,r,o,i,s,a,l){return t=new sD(t,e,n,a,l),e===1?(e=1,i===!0&&(e|=8)):e=0,i=Or(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Wx(i),t}function aD(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Nl,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function KT(t){if(!t)return Cs;t=t._reactInternals;e:{if(Za(t)!==t||t.tag!==1)throw Error(V(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Xn(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(V(171))}if(t.tag===1){var n=t.type;if(Xn(n))return WC(t,n,e)}return e}function qT(t,e,n,r,o,i,s,a,l){return t=l1(n,r,!0,t,o,i,s,a,l),t.context=KT(null),n=t.current,r=Dn(),o=ms(n),i=li(r,o),i.callback=e??null,ps(n,i,o),t.current.lanes=o,xf(t,o,r),Qn(t,r),t}function Um(t,e,n,r){var o=e.current,i=Dn(),s=ms(o);return n=KT(n),e.context===null?e.context=n:e.pendingContext=n,e=li(i,s),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=ps(o,e,s),t!==null&&(so(t,o,s,i),Mp(t,o,s)),s}function Eh(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function dk(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function c1(t,e){dk(t,e),(t=t.alternate)&&dk(t,e)}function lD(){return null}var GT=typeof reportError=="function"?reportError:function(t){console.error(t)};function u1(t){this._internalRoot=t}Vm.prototype.render=u1.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(V(409));Um(t,e,null,null)};Vm.prototype.unmount=u1.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Pa(function(){Um(null,t,null,null)}),e[fi]=null}};function Vm(t){this._internalRoot=t}Vm.prototype.unstable_scheduleHydration=function(t){if(t){var e=EC();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Qi.length&&e!==0&&e<Qi[n].priority;n++);Qi.splice(n,0,t),n===0&&CC(t)}};function d1(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Hm(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function fk(){}function cD(t,e,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var c=Eh(s);i.call(c)}}var s=qT(e,r,t,0,null,!1,!1,"",fk);return t._reactRootContainer=s,t[fi]=s.current,yd(t.nodeType===8?t.parentNode:t),Pa(),s}for(;o=t.lastChild;)t.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var c=Eh(l);a.call(c)}}var l=l1(t,0,!1,null,null,!1,!1,"",fk);return t._reactRootContainer=l,t[fi]=l.current,yd(t.nodeType===8?t.parentNode:t),Pa(function(){Um(e,l,n,r)}),l}function Wm(t,e,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var a=o;o=function(){var l=Eh(s);a.call(l)}}Um(e,s,t,o)}else s=cD(n,e,t,o,r);return Eh(s)}kC=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=xu(e.pendingLanes);n!==0&&(Rx(e,n|1),Qn(e,Lt()),!(Ge&6)&&(dc=Lt()+500,Bs()))}break;case 13:Pa(function(){var r=pi(t,1);if(r!==null){var o=Dn();so(r,t,1,o)}}),c1(t,1)}};Nx=function(t){if(t.tag===13){var e=pi(t,134217728);if(e!==null){var n=Dn();so(e,t,134217728,n)}c1(t,134217728)}};SC=function(t){if(t.tag===13){var e=ms(t),n=pi(t,e);if(n!==null){var r=Dn();so(n,t,e,r)}c1(t,e)}};EC=function(){return st};_C=function(t,e){var n=st;try{return st=t,e()}finally{st=n}};by=function(t,e,n){switch(e){case"input":if(py(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var o=Im(r);if(!o)throw Error(V(90));nC(r),py(r,o)}}}break;case"textarea":oC(t,n);break;case"select":e=n.value,e!=null&&Kl(t,!!n.multiple,e,!1)}};dC=o1;fC=Pa;var uD={usingClientEntryPoint:!1,Events:[wf,Dl,Im,cC,uC,o1]},tu={findFiberByHostInstance:aa,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},dD={bundleType:tu.bundleType,version:tu.version,rendererPackageName:tu.rendererPackageName,rendererConfig:tu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Si.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=mC(t),t===null?null:t.stateNode},findFiberByHostInstance:tu.findFiberByHostInstance||lD,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ap=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ap.isDisabled&&ap.supportsFiber)try{Nm=ap.inject(dD),Ro=ap}catch{}}gr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=uD;gr.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d1(e))throw Error(V(200));return aD(t,e,null,n)};gr.createRoot=function(t,e){if(!d1(t))throw Error(V(299));var n=!1,r="",o=GT;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(o=e.onRecoverableError)),e=l1(t,1,!1,null,null,n,!1,r,o),t[fi]=e.current,yd(t.nodeType===8?t.parentNode:t),new u1(e)};gr.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(V(188)):(t=Object.keys(t).join(","),Error(V(268,t)));return t=mC(e),t=t===null?null:t.stateNode,t};gr.flushSync=function(t){return Pa(t)};gr.hydrate=function(t,e,n){if(!Hm(e))throw Error(V(200));return Wm(null,t,e,!0,n)};gr.hydrateRoot=function(t,e,n){if(!d1(t))throw Error(V(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=GT;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),e=qT(e,null,t,1,n??null,o,!1,i,s),t[fi]=e.current,yd(t),r)for(t=0;t<r.length;t++)n=r[t],o=n._getVersion,o=o(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,o]:e.mutableSourceEagerHydrationData.push(n,o);return new Vm(e)};gr.render=function(t,e,n){if(!Hm(e))throw Error(V(200));return Wm(null,t,e,!1,n)};gr.unmountComponentAtNode=function(t){if(!Hm(t))throw Error(V(40));return t._reactRootContainer?(Pa(function(){Wm(null,null,t,!1,function(){t._reactRootContainer=null,t[fi]=null})}),!0):!1};gr.unstable_batchedUpdates=o1;gr.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!Hm(n))throw Error(V(200));if(t==null||t._reactInternals===void 0)throw Error(V(38));return Wm(t,e,n,!1,r)};gr.version="18.2.0-next-9e3b772b8-20220608";function YT(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(YT)}catch(t){console.error(t)}}YT(),q_.exports=gr;var Vo=q_.exports;const ZT=ki(Vo),fD=L_({__proto__:null,default:ZT},[Vo]);var pk=Vo;sy.createRoot=pk.createRoot,sy.hydrateRoot=pk.hydrateRoot;var JT={exports:{}},Km={};/**
33
- * @license React
34
- * react-jsx-runtime.production.min.js
35
- *
36
- * Copyright (c) Facebook, Inc. and its affiliates.
37
- *
38
- * This source code is licensed under the MIT license found in the
39
- * LICENSE file in the root directory of this source tree.
40
- */var pD=h,hD=Symbol.for("react.element"),mD=Symbol.for("react.fragment"),gD=Object.prototype.hasOwnProperty,vD=pD.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,yD={key:!0,ref:!0,__self:!0,__source:!0};function XT(t,e,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(s=e.ref);for(r in e)gD.call(e,r)&&!yD.hasOwnProperty(r)&&(o[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)o[r]===void 0&&(o[r]=e[r]);return{$$typeof:hD,type:t,key:i,ref:s,props:o,_owner:vD.current}}Km.Fragment=mD;Km.jsx=XT;Km.jsxs=XT;JT.exports=Km;var b=JT.exports;function Qy(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function f1(t,e){if(t){if(typeof t=="string")return Qy(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qy(t,e)}}function qm(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=f1(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
41
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,s=!1,a;return{s:function(){n=n.call(t)},n:function(){var l=n.next();return i=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!i&&n.return!=null&&n.return()}finally{if(s)throw a}}}}function QT(t){return t.length>0}var Sf=Object.freeze({kind:"ok",value:void 0});function Ef(t){return t===void 0?Sf:{kind:"ok",value:t}}function Po(t){return{kind:"err",error:t}}function Ac(t){return t===Sf||t.kind==="ok"}function p1(t){return t!==Sf&&t.kind==="err"}function eO(t){var e=[],n=[],r=qm(t),o;try{for(r.s();!(o=r.n()).done;){var i=o.value;Ac(i)?e.push(i.value):n.push(i.error)}}catch(s){r.e(s)}finally{r.f()}return QT(n)?Po(n):Ef(e)}function xD(t){return eO(t)}function bD(t){var e=[],n=qm(t),r;try{for(n.s();!(r=n.n()).done;){var o=r.value;p1(o)&&e.push(o.error)}}catch(i){n.e(i)}finally{n.f()}return QT(e)?Po(e):Sf}function wD(t,e){return function(n){for(var r=Ef(e),o=0;o<n.length&&Ac(r);++o)r=t(r.value,n[o],o);return r}}function kD(t){return function(e){return Ac(e)?Ef(t(e.value)):e}}function SD(t){return function(e){return Ac(e)?t(e.value):e}}function ED(t){return function(e){return p1(e)?Po(t(e.error)):e}}function _D(t,e){return function(n){return t(n)?Ef(n):Po(e(n))}}var CD=function(e,n){return function(r){return Ac(r)?e(r.value)?r:Po(n(r.value)):r}},xa=Object.freeze({__proto__:null,voidOk:Sf,ok:Ef,err:Po,isOk:Ac,isErr:p1,allT:eO,all:xD,allV:bD,flatMapReduce:wD,map:kD,flatMap:SD,mapErr:ED,fromPredicate:_D,filterOrElse:CD});function TD(t){if(Array.isArray(t))return Qy(t)}function OD(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function MD(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
42
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tO(t){return TD(t)||OD(t)||f1(t)||MD()}function ke(t){"@babel/helpers - typeof";return ke=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ke(t)}function RD(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function nO(t){var e=RD(t,"string");return typeof e=="symbol"?e:String(e)}function fe(t,e,n){return e=nO(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function hk(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function fc(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?hk(Object(n),!0).forEach(function(r){fe(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):hk(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function ND(t){if(Array.isArray(t))return t}function PD(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(u){c=!0,o=u}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}function $D(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
43
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vs(t,e){return ND(t)||PD(t,e)||f1(t,e)||$D()}function yn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mk(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,nO(r.key),r)}}function xn(t,e,n){return e&&mk(t.prototype,e),n&&mk(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function _h(t){return _h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_h(t)}function rO(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(rO=function(){return!!t})()}function oO(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function AD(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oO(t)}function yr(t,e,n){return e=_h(e),AD(t,rO()?Reflect.construct(e,n||[],_h(t).constructor):e.apply(t,n))}function e0(t,e){return e0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},e0(t,e)}function xr(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&e0(t,e)}var br=function(){function t(){yn(this,t)}return xn(t,[{key:"appendValidationError",value:function(n,r,o,i){return n?(n[r]?n[r].push({message:o,value:i}):n[r]=[{message:o,value:i}],n):fe({},r,[{message:o,value:i}])}}]),t}(),ba=Symbol("GetSchema"),In=Symbol("Path"),Wt=Symbol("GetSource");function ID(t){return t[ba]}var h1=xn(function t(e){yn(this,t),this.span=e}),DD=function(t){xr(e,t);function e(n,r){var o;return yn(this,e),o=yr(this,e,[r]),fe(oO(o),"type","Sym"),o.value=n,o}return xn(e,[{key:"transpile",value:function(){return this.value}}]),e}(h1);new DD("()");var sn="_type",gn="_ref",gk="_tag",LD=function(t){xr(e,t);function e(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return yn(this,e),r=yr(this,e),r.options=n,r.opt=o,r}return xn(e,[{key:"validate",value:function(r,o){return this.opt&&o==null?!1:o==null?fe({},r,[{message:"Non-optional file was null or undefined.",value:o}]):typeof o[gn]!="string"?fe({},r,[{message:"File did not have a file reference string. Got: ".concat(ke(o[gn])),value:o}]):o[sn]!=="file"?fe({},r,[{message:"File did not have the valid file extension type. Got: ".concat(o[sn]),value:o}]):o.metadata?fe({},r,[{message:"Found metadata, but it could not be validated. File metadata must be an object with the required props: width (positive number), height (positive number) and sha256 (string of length 64 of the base16 hash).",value:o,fixes:["file:check-metadata"]}]):fe({},r,[{message:"Missing File metadata.",value:o,fixes:["file:add-metadata"]}])}},{key:"assert",value:function(r){return this.opt&&r==null?!0:(r==null?void 0:r[gn])==="file"&&(r==null?void 0:r[sn])==="file"}},{key:"optional",value:function(){return new e(this.options,!0)}},{key:"serialize",value:function(){return{type:"file",options:this.options,opt:this.opt}}}]),e}(br),jD=function(e){return new LD(e)};function iO(t){var e,n;if(!t[gn].startsWith("/public")){var r,o;return{url:t[gn]+((r=t.metadata)!==null&&r!==void 0&&r.sha256?"?sha256=".concat((o=t.metadata)===null||o===void 0?void 0:o.sha256):""),metadata:t.metadata}}return{url:t[gn].slice(7)+((e=t.metadata)!==null&&e!==void 0&&e.sha256?"?sha256=".concat((n=t.metadata)===null||n===void 0?void 0:n.sha256):""),metadata:t.metadata}}function sO(t){return ke(t)==="object"&&t!==null&&t!==void 0&&("val"in t||"valPath"in t)}function zD(t){return ke(t)==="object"&&t!==null&&t!==void 0&&In in t&&"val"in t}function aO(t){return t[In]}function FD(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function vk(t,e,n){return e?Qt(t(Qt(e,n))):Qt(e,n)}function ys(t){return ke(t)==="object"&&t!==null&&(Wt in t||In in t)}function Qt(t,e,n){if(ke(t)==="object"){if(ys(t))return t;if(sO(t))return Qt(t.val,t.valPath)}if(t&&t[gn]&&t[sn]==="file"){var r=t[gn];if(typeof r!="string")throw Error("Invalid file ref: "+r);return Qt(iO(t),e,n)}switch(ke(t)){case"function":case"symbol":throw Error("Invalid selector type: ".concat(ke(t),": ").concat(t));case"object":if(t!==null)return new Proxy(t,{has:function(i,s){return s===Wt||s===In||s==="andThen"||s===ba?!0:s in i},get:function(i,s){if(s===Wt)return t;if(s===In)return e;if(s===ba)return n;if(s==="andThen")return function(l){return vk(l,t,e)};if(Array.isArray(i)){if(s==="filter")return function(l){var c=i.map(function(u,d){return Qt(u,Mr(e,d),n==null?void 0:n.item)}).filter(function(u){return l&&l instanceof br?l.assert(yk(u)):yk(l(u))});return Qt(c,e,n)};if(s==="map")return function(l){var c=i.map(function(u,d){var f=l(Qt(u,Mr(e,d),n==null?void 0:n.item),Qt(d));return ys(f)?f:Qt(f)});return Qt(c,e,n)}}if(Array.isArray(i)&&s==="length")return Qt(i.length);var a=Reflect.get(i,s);return FD(t,s)?Number.isNaN(Number(s))?Qt(a,Mr(e,s),n==null?void 0:n.items[s]):Qt(a,Mr(e,Number(s)),n==null?void 0:n.item):a}});default:return fe(fe(fe({eq:function(i){var s=i;if(ys(i)&&(s=i[Wt],s instanceof h1))throw Error("TODO: Cannot evaluate equality with an Expr");return Qt(t===s,void 0)},andThen:function(i){return vk(i,t===void 0?null:t,e)}},Wt,t===void 0?null:t),In,e),ba,n)}}function Mr(t,e){if(ke(e)==="symbol")throw Error("Cannot create val path of array item with symbol prop: ".concat(e.toString()));return t&&"".concat(t,".").concat(JSON.stringify(e))}function yk(t){if(ke(t)==="object"&&(Wt in t||In in t)){var e=t[Wt];return e}return t}var m1=function(t){xr(e,t);function e(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return yn(this,e),r=yr(this,e),r.items=n,r.opt=o,r}return xn(e,[{key:"validate",value:function(r,o){var i=this,s=!1;return this.opt&&o==null?!1:ke(o)!=="object"?fe({},r,[{message:"Expected 'object', got '".concat(ke(o),"'")}]):Array.isArray(o)?fe({},r,[{message:"Expected 'object', got 'array'"}]):(Object.entries(this.items).forEach(function(a){var l=vs(a,2),c=l[0],u=l[1],d=Mr(r,c);if(!d)s=i.appendValidationError(s,r,"Internal error: could not create path at ".concat(!r&&typeof r=="string"?"<empty string>":r," at key ").concat(c),o);else{var f=u.validate(d,o[c]);f&&s?s=fc(fc({},f),s):f&&(s=f)}}),s)}},{key:"assert",value:function(r){if(this.opt&&r==null)return!0;if(!r)return!1;for(var o=0,i=Object.entries(this.items);o<i.length;o++){var s=vs(i[o],2),a=s[0],l=s[1];if(!l.assert(r[a]))return!1}return ke(r)==="object"&&!Array.isArray(r)}},{key:"optional",value:function(){return new e(this.items,!0)}},{key:"serialize",value:function(){return{type:"object",items:Object.fromEntries(Object.entries(this.items).map(function(r){var o=vs(r,2),i=o[0],s=o[1];return[i,s.serialize()]})),opt:this.opt}}}]),e}(br),BD=function(e){return new m1(e)},lO=function(t){xr(e,t);function e(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return yn(this,e),r=yr(this,e),r.item=n,r.opt=o,r}return xn(e,[{key:"validate",value:function(r,o){var i=this,s=!1;return this.opt&&o==null?!1:ke(o)!=="object"||!Array.isArray(o)?fe({},r,[{message:"Expected 'array', got '".concat(ke(o),"'")}]):(o.forEach(function(a,l){var c=Mr(r,l);if(!c)s=i.appendValidationError(s,r,"Internal error: could not create path at ".concat(!r&&typeof r=="string"?"<empty string>":r," at index ").concat(l),o);else{var u=i.item.validate(c,a);u&&s?s=fc(fc({},u),s):u&&(s=u)}}),s)}},{key:"assert",value:function(r){if(this.opt&&r==null)return!0;if(!r)return!1;var o=qm(r),i;try{for(o.s();!(i=o.n()).done;){var s=i.value;if(!this.item.assert(s))return!1}}catch(a){o.e(a)}finally{o.f()}return ke(r)==="object"&&Array.isArray(r)}},{key:"optional",value:function(){return new e(this.item,!0)}},{key:"serialize",value:function(){return{type:"array",item:this.item.serialize(),opt:this.opt}}}]),e}(br),UD=function(e){return new lO(e)},t0=function(t){xr(e,t);function e(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return yn(this,e),r=yr(this,e),r.value=n,r.opt=o,r}return xn(e,[{key:"validate",value:function(r,o){return this.opt&&o==null?!1:typeof o!="string"?fe({},r,[{message:"Expected 'string', got '".concat(ke(o),"'"),value:o}]):o!==this.value?fe({},r,[{message:"Expected literal '".concat(this.value,"', got '").concat(o,"'"),value:o}]):!1}},{key:"assert",value:function(r){return this.opt&&r==null?!0:typeof r=="string"}},{key:"optional",value:function(){return new e(this.value,!0)}},{key:"serialize",value:function(){return{type:"literal",value:this.value,opt:this.opt}}}]),e}(br),VD=function(e){return new t0(e)},cO=function(t){xr(e,t);function e(n,r){var o,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return yn(this,e),o=yr(this,e),o.key=n,o.items=r,o.opt=i,o}return xn(e,[{key:"validate",value:function(r,o){var i=o,s=!1;if(this.opt&&i==null)return!1;if(!this.key)return fe({},r,[{message:"Missing required first argument in union"}]);var a=this.key;if(!Array.isArray(this.items))return fe({},r,[{message:"A union schema must take more than 1 schema arguments",fatal:!0}]);if(typeof a=="string"){if(this.items.some(function(C){return!(C instanceof m1)}))return fe({},r,[{message:"Key is a string, so all schema items must be objects",fatal:!0}]);var l=this.items,c=l.map(function(C){return C.serialize()}),u=c.filter(function(C){return C.type!=="object"||C.items[a].type!=="literal"});if(u.length>0)return fe({},r,[{message:"All schema items must be objects with a key: ".concat(a," that is a literal schema. Found: ").concat(JSON.stringify(u,null,2)),fatal:!0}]);var d=c,f=d.filter(function(C){return C.items[a].opt});if(f.length>1)return fe({},r,[{message:"Schema cannot have an optional keys: ".concat(a),fatal:!0}]);if(ke(i)!=="object")return fe({},r,[{message:"Expected an object"}]);var p=i;if(p[a]===void 0)return fe({},r,[{message:"Missing required key: ".concat(a)}]);var m=[],g=qm(d),y;try{for(g.s();!(y=g.n()).done;){var v=y.value,x=v.items[a];if(x.type==="literal")if(!m.includes(x.value))m.push(x.value);else return fe({},r,[{message:"Found duplicate key in schema: ".concat(x.value),fatal:!0}])}}catch(C){g.e(C)}finally{g.f()}var w=l.find(function(C){return!C.items[a].validate(r,p[a])});if(!w){var S=Mr(r,a);if(!S)throw new Error("Internal error: could not create path at ".concat(!r&&typeof r=="string"?"<empty string>":r," at key ").concat(a));return fe({},S,[{message:'Invalid key: "'.concat(a,'". Value was: "').concat(p[a],'". Valid values: ').concat(d.map(function(C){var T=C.items[a];if(T.type==="literal"&&T.value)return'"'.concat(T.value,'"');throw new Error("Expected literal schema, got ".concat(JSON.stringify(T,null,2)))}).join(", "))}])}var _=w.validate(r,p);if(_)return _}else if(a instanceof t0){if(this.items.some(function(C){return!(C instanceof t0)}))return fe({},r,[{message:"Key is a literal schema, so all schema items must be literals",fatal:!0}]);var k=[a].concat(tO(this.items));if(typeof i=="string"){var E=k.some(function(C){return!C.validate(r,i)});if(!E)return fe({},r,[{message:"Union must match one of the following: ".concat(k.map(function(C){return'"'.concat(C.value,'"')}).join(", "))}])}}else return fe({},r,[{message:"Expected a string or literal"}]);return s}},{key:"assert",value:function(r){return!0}},{key:"optional",value:function(){return new e(this.key,this.items,!0)}},{key:"serialize",value:function(){return typeof this.key=="string"?{type:"union",key:this.key,items:this.items.map(function(r){return r.serialize()}),opt:this.opt}:{type:"union",items:this.items.map(function(r){return r.serialize()}),opt:this.opt}}}]),e}(br),HD=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return new cO(e,r)},uO=function(t){xr(e,t);function e(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return yn(this,e),r=yr(this,e),r.options=n,r.opt=o,r}return xn(e,[{key:"validate",value:function(r,o){return!1}},{key:"assert",value:function(r){return!0}},{key:"optional",value:function(){return new e(this.options,!0)}},{key:"serialize",value:function(){return{type:"richtext",opt:this.opt,options:this.options}}}]),e}(br),WD=function(e){return new uO(e??{})},dO=function(t){xr(e,t);function e(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return yn(this,e),r=yr(this,e),r.options=n,r.opt=o,r}return xn(e,[{key:"validate",value:function(r,o){return this.opt&&o==null?!1:o==null?fe({},r,[{message:"Non-optional image was null or undefined.",value:o}]):typeof o[gn]!="string"?fe({},r,[{message:"Image did not have a file reference string. Got: ".concat(ke(o[gn])),value:o}]):o[sn]!=="file"?fe({},r,[{message:"Image did not have the valid file extension type. Got: ".concat(o[sn]),value:o}]):o.metadata?fe({},r,[{message:"Found metadata, but it could not be validated. Image metadata must be an object with the required props: width (positive number), height (positive number) and sha256 (string of length 64 of the base16 hash).",value:o,fixes:["image:replace-metadata"]}]):fe({},r,[{message:"Could not validate Image metadata.",value:o,fixes:["image:add-metadata"]}])}},{key:"assert",value:function(r){return this.opt&&r==null?!0:(r==null?void 0:r[gn])==="image"&&(r==null?void 0:r[sn])==="file"}},{key:"optional",value:function(){return new e(this.options,!0)}},{key:"serialize",value:function(){return{type:"image",options:this.options,opt:this.opt}}}]),e}(br),KD=function(e){return new dO(e)},fO=function(t){xr(e,t);function e(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return yn(this,e),r=yr(this,e),r.item=n,r.opt=o,r}return xn(e,[{key:"validate",value:function(r,o){var i=this,s=!1;return this.opt&&o==null?!1:ke(o)!=="object"?fe({},r,[{message:"Expected 'object', got '".concat(ke(o),"'")}]):Array.isArray(o)?fe({},r,[{message:"Expected 'object', got 'array'"}]):(Object.entries(o).forEach(function(a){var l=vs(a,2),c=l[0],u=l[1],d=Mr(r,c);if(!d)s=i.appendValidationError(s,r,"Internal error: could not create path at ".concat(!r&&typeof r=="string"?"<empty string>":r," at key ").concat(u),o);else{var f=i.item.validate(d,u);f&&s?s=fc(fc({},f),s):f&&(s=f)}}),s)}},{key:"assert",value:function(r){if(this.opt&&r==null)return!0;if(!r)return!1;for(var o=0,i=Object.entries(r);o<i.length;o++){var s=vs(i[o],2),a=s[1];if(!this.item.assert(a))return!1}return ke(r)==="object"&&!Array.isArray(r)}},{key:"optional",value:function(){return new e(this.item,!0)}},{key:"serialize",value:function(){return{type:"record",item:this.item.serialize(),opt:this.opt}}}]),e}(br),qD=function(e){return new fO(e)};function GD(t){var e=t[Wt];if(e instanceof h1)throw Error("Cannot get raw source of an Expr");var n=e;return n}function YD(t){return t.indexOf(".")===-1?[t,""]:[t.slice(0,t.indexOf(".")),t.slice(t.indexOf(".")+1)]}function ZD(t){return t instanceof m1||ke(t)==="object"&&"type"in t&&t.type==="object"}function JD(t){return t instanceof fO||ke(t)==="object"&&"type"in t&&t.type==="record"}function XD(t){return t instanceof lO||ke(t)==="object"&&"type"in t&&t.type==="array"}function QD(t){return t instanceof cO||ke(t)==="object"&&"type"in t&&t.type==="union"}function e3(t){return t instanceof uO||ke(t)==="object"&&"type"in t&&t.type==="richtext"}function t3(t){return t instanceof dO||ke(t)==="object"&&"type"in t&&t.type==="image"}function n3(t,e,n){for(var r=r3(t),o=tO(r),i=n,s=e,a=function(){var u=r.shift();if(u===void 0)throw Error("Unexpected undefined part");if(XD(i)){if(Number.isNaN(Number(u)))throw Error("Invalid path: array schema ".concat(JSON.stringify(i)," must have a number as path, but got ").concat(u,". Path: ").concat(t));if(ke(s)!=="object"&&!Array.isArray(s))throw Error("Schema type error: expected source to be type of array, but got ".concat(ke(s)));if(s[u]===void 0){var d;throw Error("Invalid path: array source (length: ".concat((d=s)===null||d===void 0?void 0:d.length,") did not have index ").concat(u," from path: ").concat(t))}s=s[u],i=i.item}else if(JD(i)){if(typeof u!="string")throw Error("Invalid path: record schema ".concat(i," must have path: ").concat(u," as string"));if(ke(s)!=="object"&&!Array.isArray(s))throw Error("Schema type error: expected source to be type of record, but got ".concat(ke(s)));if(!s[u])throw Error("Invalid path: record source did not have key ".concat(u," from path: ").concat(t));s=s[u],i=i.item}else if(ZD(i)){if(ke(s)!=="object")throw Error("Schema type error: expected source to be type of object, but got ".concat(ke(s)));if(!s[u])throw Error("Invalid path: object source did not have key ".concat(u," from path: ").concat(t));s=s[u],i=i.items[u]}else{if(t3(i))return{v:{path:o.slice(0,o.length-r.length-1).map(function(g){return JSON.stringify(g)}).join("."),schema:i,source:s}};if(QD(i)){var f=i.key;if(!f)return{v:{path:o.map(function(g){return Number.isNaN(Number(g))?JSON.stringify(g):g}).join("."),schema:i,source:s}};var p=s[f];if(!p)throw Error("Invalid path: union source ".concat(i," did not have required key ").concat(f," in path: ").concat(t));var m=i.items.find(function(g){var y;return(g==null||(y=g.items)===null||y===void 0||(y=y[f])===null||y===void 0?void 0:y.value)===p});if(!m)throw Error("Invalid path: union schema ".concat(i," did not have a child object with ").concat(f," of value ").concat(p," in path: ").concat(t));i=m.items[u],s=s[u]}else{if(e3(i))return{v:{path:o.slice(0,o.length-r.length-1).map(function(g){return JSON.stringify(g)}).join("."),schema:i,source:s}};throw Error("Invalid path: ".concat(u," resolved to an unexpected schema ").concat(JSON.stringify(i)))}}},l;r.length>0;)if(l=a(),l)return l.v;if(r.length>0)throw Error("Invalid path: ".concat(r.join(".")," is not a valid path"));return{path:o.map(function(c){return Number.isNaN(Number(c))?JSON.stringify(c):c}).join("."),schema:i,source:s}}function r3(t){for(var e=[],n=0;n<t.length;){var r="";if(t[n]==='"'){for(n++;n<t.length&&t[n]!=='"';)t[n]==="\\"&&t[n+1]==='"'?(r+='"',n++):r+=t[n],n++;if(t[n]!=='"'){var o;throw new Error("Invalid input (".concat(JSON.stringify(t),"): Missing closing double quote: ").concat((o=t[n])!==null&&o!==void 0?o:"at end of string"," (char: ").concat(n,"; length: ").concat(t.length,")"))}}else for(;n<t.length&&t[n]!==".";)r+=t[n],n++;r!==""&&e.push(r),n++}return e}var o3=function(t){xr(e,t);function e(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return yn(this,e),r=yr(this,e),r.options=n,r.opt=o,r}return xn(e,[{key:"validate",value:function(r,o){return this.opt&&o==null?!1:typeof o!="number"?fe({},r,[{message:"Expected 'number', got '".concat(ke(o),"'"),value:o}]):!1}},{key:"assert",value:function(r){return this.opt&&r==null?!0:typeof r=="number"}},{key:"optional",value:function(){return new e(this.options,!0)}},{key:"serialize",value:function(){return{type:"number",options:this.options,opt:this.opt}}}]),e}(br),i3=function(e){return new o3(e)},pO=function(t){xr(e,t);function e(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return yn(this,e),r=yr(this,e),r.options=n,r.opt=o,r.isRaw=i,r}return xn(e,[{key:"validate",value:function(r,o){var i,s,a;if(this.opt&&o==null)return!1;if(typeof o!="string")return fe({},r,[{message:"Expected 'string', got '".concat(ke(o),"'"),value:o}]);var l=[];return(i=this.options)!==null&&i!==void 0&&i.maxLength&&o.length>this.options.maxLength&&l.push({message:"Expected string to be at most ".concat(this.options.maxLength," characters long, got ").concat(o.length),value:o}),(s=this.options)!==null&&s!==void 0&&s.minLength&&o.length<this.options.minLength&&l.push({message:"Expected string to be at least ".concat(this.options.minLength," characters long, got ").concat(o.length),value:o}),(a=this.options)!==null&&a!==void 0&&a.regexp&&!this.options.regexp.test(o)&&l.push({message:"Expected string to match reg exp: ".concat(this.options.regexp.toString(),", got '").concat(o,"'"),value:o}),l.length>0?fe({},r,l):!1}},{key:"assert",value:function(r){return this.opt&&r==null?!0:typeof r=="string"}},{key:"optional",value:function(){return new e(this.options,!0,this.isRaw)}},{key:"raw",value:function(){return new e(this.options,this.opt,!0)}},{key:"serialize",value:function(){var r,o,i;return{type:"string",options:{maxLength:(r=this.options)===null||r===void 0?void 0:r.maxLength,minLength:(o=this.options)===null||o===void 0?void 0:o.minLength,regexp:((i=this.options)===null||i===void 0?void 0:i.regexp)&&{source:this.options.regexp.source,flags:this.options.regexp.flags}},opt:this.opt,raw:this.isRaw}}}]),e}(br),s3=function(e){return new pO(e)},a3=function(t){xr(e,t);function e(){var n,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return yn(this,e),n=yr(this,e),n.opt=r,n}return xn(e,[{key:"validate",value:function(r,o){return this.opt&&o==null?!1:typeof o!="boolean"?fe({},r,[{message:"Expected 'boolean', got '".concat(ke(o),"'"),value:o}]):!1}},{key:"assert",value:function(r){return this.opt&&r==null?!0:typeof r=="boolean"}},{key:"optional",value:function(){return new e(!0)}},{key:"serialize",value:function(){return{type:"boolean",opt:this.opt}}}]),e}(br),l3=function(){return new a3},c3=function(t){xr(e,t);function e(n){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return yn(this,e),r=yr(this,e),r.selector=n,r.opt=o,r}return xn(e,[{key:"validate",value:function(r,o){if(this.opt&&o==null)return!1;var i=this.selector[ba];if(!i)return fe({},r,[{message:"Schema not found for module. keyOf must be used with a Val Module"}]);var s=i.serialize();if(!(s.type==="array"||s.type==="object"||s.type==="record"))return fe({},r,[{message:"Schema in keyOf must be an 'array', 'object' or 'record'. Found '".concat(s.type,"'")}]);if(s.opt&&o==null)return!1;if(s.type==="array"&&typeof o!="number")return fe({},r,[{message:"Type of value in keyof (array) must be 'number'"}]);if(s.type==="record"&&typeof o!="string")return fe({},r,[{message:"Type of value in keyof (record) must be 'string'"}]);if(s.type==="object"){var a=Object.keys(s.items);if(!a.includes(o))return fe({},r,[{message:"Value of keyOf (object) must be: ".concat(a.join(", "),". Found: ").concat(o)}])}return!1}},{key:"assert",value:function(r){if(this.opt&&r==null)return!0;var o=this.selector[ba];if(!o)return!1;var i=o.serialize();if(!(i.type==="array"||i.type==="object"||i.type==="record"))return!1;if(i.opt&&r==null)return!0;if(i.type==="array"&&typeof r!="number"||i.type==="record"&&typeof r!="string")return!1;if(i.type==="object"){var s=Object.keys(i.items);if(!s.includes(r))return!1}return!0}},{key:"optional",value:function(){return new e(this.selector,!0)}},{key:"serialize",value:function(){var r,o=aO(this.selector);if(!o)throw new Error("Cannot serialize keyOf schema with empty selector. TIP: keyOf must be used with a Val Module.");var i=(r=this.selector[ba])===null||r===void 0?void 0:r.serialize();if(!i)throw new Error("Cannot serialize oneOf schema with empty selector.");var s;switch(i.type){case"array":s="number";break;case"record":s="string";break;case"object":s=Object.keys(i.items);break;default:throw new Error("Cannot serialize oneOf schema with selector of type '".concat(i.type,"'. keyOf must be used with a Val Module."))}return{type:"keyOf",selector:o,opt:this.opt,values:s}}}]),e}(br),u3=function(e){return new c3(e)};function d3(){return{string:s3,boolean:l3,array:UD,object:BD,number:i3,union:HD,richtext:WD,image:KD,literal:VD,keyOf:u3,record:qD,file:jD}}var xk="rt_image";function f3(t){return hO(m3(t))}function p3(t){return ys(t)?ke(t[Wt])==="object"&&t[Wt]!==null&&Array.isArray(t[Wt]):Array.isArray(t)}function h3(t){return ys(t)?ke(t[Wt])==="object"&&t[Wt]!==null&&!Array.isArray(t[Wt]):ke(t)==="object"}function m3(t){var e=Qt(t);function n(r){var o=p3(r),i=h3(r);if(o){var s=Wt in r?r[Wt]:r,a=In in r?r[In]:void 0;return{val:s.map(function(u,d){return n(ys(u)?u:Qt(u,Mr(a,d)))}),valPath:a}}else if(i){var l=Wt in r?r[Wt]:r,c=In in r?r[In]:void 0;return{val:l!==null&&Object.fromEntries(Object.entries(l).map(function(u){var d=vs(u,2),f=d[0],p=d[1];return[f,n(ys(p)?p:Qt(p,Mr(c,f)))]})),valPath:c}}else return ys(r)?{val:n(r[Wt]),valPath:r[In]}:r}return n(e)}function n0(t){var e=sO(t)?t.val:t;switch(ke(e)){case"function":case"symbol":throw Error("Invalid val type: ".concat(ke(e)));case"object":return e===null?null:Array.isArray(e)?e.map(n0):Object.fromEntries(Object.entries(e).map(function(n){var r=vs(n,2),o=r[0],i=r[1];return[o,i&&n0(i)]}));default:return e}}function hO(t){var e=t.val;switch(ke(e)){case"function":case"symbol":throw Error("Invalid val type: ".concat(ke(e)));case"object":if(e!==null)return new Proxy(e,{has:function(r,o){return o==="val"||o===In?!0:bk(r,o)},get:function(r,o){if(o===In)return t.valPath;if(o==="val")return n0(t);if(Array.isArray(r)&&o==="length")return r.length;if(bk(e,o)){var i,s;return hO({val:Reflect.get(r,o).val,valPath:(i=(s=Reflect.get(r,o))===null||s===void 0?void 0:s.valPath)!==null&&i!==void 0?i:Mr(t.valPath,Array.isArray(r)?Number(o):o)})}return Reflect.get(r,o)}});default:return fe(fe({},In,t.valPath),"val",t.val)}}function bk(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var g3=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],lt=function(t){return t[t.inputBytes=64]="inputBytes",t[t.inputWords=16]="inputWords",t[t.highIndex=14]="highIndex",t[t.lowIndex=15]="lowIndex",t[t.workWords=64]="workWords",t[t.allocBytes=80]="allocBytes",t[t.allocWords=20]="allocWords",t[t.allocTotal=8e3]="allocTotal",t}(lt||{}),wk={sha256:1};function v3(t){if(t&&!wk[t]&&!wk[t.toLowerCase()])throw new Error("Digest method not supported");return new y3}var y3=function(){function t(){yn(this,t),fe(this,"A",1779033703),fe(this,"B",-1150833019),fe(this,"C",1013904242),fe(this,"D",-1521486534),fe(this,"E",1359893119),fe(this,"F",-1694144372),fe(this,"G",528734635),fe(this,"H",1541459225),fe(this,"_size",0),fe(this,"_sp",0),(!lp||nu>=lt.allocTotal)&&(lp=new ArrayBuffer(lt.allocTotal),nu=0),this._byte=new Uint8Array(lp,nu,lt.allocBytes),this._word=new Int32Array(lp,nu,lt.allocWords),nu+=lt.allocBytes}return xn(t,[{key:"update",value:function(n){if(typeof n=="string")return this._utf8(n);if(n==null)throw new TypeError("Invalid type: "+ke(n));var r=n.byteOffset,o=n.byteLength,i=o/lt.inputBytes|0,s=0;if(i&&!(r&3)&&!(this._size%lt.inputBytes)){for(var a=new Int32Array(n.buffer,r,i*lt.inputWords);i--;)this._int32(a,s>>2),s+=lt.inputBytes;this._size+=s}var l=n.BYTES_PER_ELEMENT;if(l!==1&&n.buffer){var c=new Uint8Array(n.buffer,r+s,o-s);return this._uint8(c)}return s===o?this:this._uint8(n,s)}},{key:"_uint8",value:function(n,r){var o=this._byte,i=this._word,s=n.length;for(r=r|0;r<s;){for(var a=this._size%lt.inputBytes,l=a;r<s&&l<lt.inputBytes;)o[l++]=n[r++];l>=lt.inputBytes&&this._int32(i),this._size+=l-a}return this}},{key:"_utf8",value:function(n){for(var r=this._byte,o=this._word,i=n.length,s=this._sp,a=0;a<i;){for(var l=this._size%lt.inputBytes,c=l;a<i&&c<lt.inputBytes;){var u=n.charCodeAt(a++)|0;u<128?r[c++]=u:u<2048?(r[c++]=192|u>>>6,r[c++]=128|u&63):u<55296||u>57343?(r[c++]=224|u>>>12,r[c++]=128|u>>>6&63,r[c++]=128|u&63):s?(u=((s&1023)<<10)+(u&1023)+65536,r[c++]=240|u>>>18,r[c++]=128|u>>>12&63,r[c++]=128|u>>>6&63,r[c++]=128|u&63,s=0):s=u}c>=lt.inputBytes&&(this._int32(o),o[0]=o[lt.inputWords]),this._size+=c-l}return this._sp=s,this}},{key:"_int32",value:function(n,r){var o=this.A,i=this.B,s=this.C,a=this.D,l=this.E,c=this.F,u=this.G,d=this.H,f=0;for(r=r|0;f<lt.inputWords;)Gs[f++]=Hr(n[r++]);for(f=lt.inputWords;f<lt.workWords;f++)Gs[f]=C3(Gs[f-2])+Gs[f-7]+_3(Gs[f-15])+Gs[f-16]|0;for(f=0;f<lt.workWords;f++){var p=d+E3(l)+w3(l,c,u)+g3[f]+Gs[f]|0,m=S3(o)+k3(o,i,s)|0;d=u,u=c,c=l,l=a+p|0,a=s,s=i,i=o,o=p+m|0}this.A=o+this.A|0,this.B=i+this.B|0,this.C=s+this.C|0,this.D=a+this.D|0,this.E=l+this.E|0,this.F=c+this.F|0,this.G=u+this.G|0,this.H=d+this.H|0}},{key:"digest",value:function(n){var r=this._byte,o=this._word,i=this._size%lt.inputBytes|0;for(r[i++]=128;i&3;)r[i++]=0;if(i>>=2,i>lt.highIndex){for(;i<lt.inputWords;)o[i++]=0;i=0,this._int32(o)}for(;i<lt.inputWords;)o[i++]=0;var s=this._size*8,a=(s&4294967295)>>>0,l=(s-a)/4294967296;return l&&(o[lt.highIndex]=Hr(l)),a&&(o[lt.lowIndex]=Hr(a)),this._int32(o),n==="hex"?this._hex():this._bin()}},{key:"_hex",value:function(){var n=this.A,r=this.B,o=this.C,i=this.D,s=this.E,a=this.F,l=this.G,c=this.H;return Ai(n)+Ai(r)+Ai(o)+Ai(i)+Ai(s)+Ai(a)+Ai(l)+Ai(c)}},{key:"_bin",value:function(){var n=this.A,r=this.B,o=this.C,i=this.D,s=this.E,a=this.F,l=this.G,c=this.H,u=this._byte,d=this._word;return d[0]=Hr(n),d[1]=Hr(r),d[2]=Hr(o),d[3]=Hr(i),d[4]=Hr(s),d[5]=Hr(a),d[6]=Hr(l),d[7]=Hr(c),u.slice(0,32)}}]),t}(),Gs=new Int32Array(lt.workWords),lp,nu=0,Ai=function(e){return(e+4294967296).toString(16).substr(-8)},x3=function(e){return e<<24&4278190080|e<<8&16711680|e>>8&65280|e>>24&255},b3=function(e){return e},Hr=T3()?b3:x3,w3=function(e,n,r){return r^e&(n^r)},k3=function(e,n,r){return e&n|r&(e|n)},S3=function(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)},E3=function(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)},_3=function(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3},C3=function(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10};function T3(){var t=new Uint8Array(new Uint16Array([65279]).buffer);return t[0]===254}var O3=function(e){return v3().update(e).digest("hex")};function Td(){Td=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(R,N,O){R[N]=O.value},i=typeof Symbol=="function"?Symbol:{},s=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function c(R,N,O){return Object.defineProperty(R,N,{value:O,enumerable:!0,configurable:!0,writable:!0}),R[N]}try{c({},"")}catch{c=function(N,O,P){return N[O]=P}}function u(R,N,O,P){var I=N&&N.prototype instanceof v?N:v,H=Object.create(I.prototype),le=new U(P||[]);return o(H,"_invoke",{value:A(R,O,le)}),H}function d(R,N,O){try{return{type:"normal",arg:R.call(N,O)}}catch(P){return{type:"throw",arg:P}}}e.wrap=u;var f="suspendedStart",p="suspendedYield",m="executing",g="completed",y={};function v(){}function x(){}function w(){}var S={};c(S,s,function(){return this});var _=Object.getPrototypeOf,k=_&&_(_(G([])));k&&k!==n&&r.call(k,s)&&(S=k);var E=w.prototype=v.prototype=Object.create(S);function C(R){["next","throw","return"].forEach(function(N){c(R,N,function(O){return this._invoke(N,O)})})}function T(R,N){function O(I,H,le,Le){var Ee=d(R[I],R,H);if(Ee.type!=="throw"){var Je=Ee.arg,Ae=Je.value;return Ae&&typeof Ae=="object"&&r.call(Ae,"__await")?N.resolve(Ae.__await).then(function(ne){O("next",ne,le,Le)},function(ne){O("throw",ne,le,Le)}):N.resolve(Ae).then(function(ne){Je.value=ne,le(Je)},function(ne){return O("throw",ne,le,Le)})}Le(Ee.arg)}var P;o(this,"_invoke",{value:function(I,H){function le(){return new N(function(Le,Ee){O(I,H,Le,Ee)})}return P=P?P.then(le,le):le()}})}function A(R,N,O){var P=f;return function(I,H){if(P===m)throw new Error("Generator is already running");if(P===g){if(I==="throw")throw H;return{value:t,done:!0}}for(O.method=I,O.arg=H;;){var le=O.delegate;if(le){var Le=B(le,O);if(Le){if(Le===y)continue;return Le}}if(O.method==="next")O.sent=O._sent=O.arg;else if(O.method==="throw"){if(P===f)throw P=g,O.arg;O.dispatchException(O.arg)}else O.method==="return"&&O.abrupt("return",O.arg);P=m;var Ee=d(R,N,O);if(Ee.type==="normal"){if(P=O.done?g:p,Ee.arg===y)continue;return{value:Ee.arg,done:O.done}}Ee.type==="throw"&&(P=g,O.method="throw",O.arg=Ee.arg)}}}function B(R,N){var O=N.method,P=R.iterator[O];if(P===t)return N.delegate=null,O==="throw"&&R.iterator.return&&(N.method="return",N.arg=t,B(R,N),N.method==="throw")||O!=="return"&&(N.method="throw",N.arg=new TypeError("The iterator does not provide a '"+O+"' method")),y;var I=d(P,R.iterator,N.arg);if(I.type==="throw")return N.method="throw",N.arg=I.arg,N.delegate=null,y;var H=I.arg;return H?H.done?(N[R.resultName]=H.value,N.next=R.nextLoc,N.method!=="return"&&(N.method="next",N.arg=t),N.delegate=null,y):H:(N.method="throw",N.arg=new TypeError("iterator result is not an object"),N.delegate=null,y)}function D(R){var N={tryLoc:R[0]};1 in R&&(N.catchLoc=R[1]),2 in R&&(N.finallyLoc=R[2],N.afterLoc=R[3]),this.tryEntries.push(N)}function Z(R){var N=R.completion||{};N.type="normal",delete N.arg,R.completion=N}function U(R){this.tryEntries=[{tryLoc:"root"}],R.forEach(D,this),this.reset(!0)}function G(R){if(R||R===""){var N=R[s];if(N)return N.call(R);if(typeof R.next=="function")return R;if(!isNaN(R.length)){var O=-1,P=function I(){for(;++O<R.length;)if(r.call(R,O))return I.value=R[O],I.done=!1,I;return I.value=t,I.done=!0,I};return P.next=P}}throw new TypeError(typeof R+" is not iterable")}return x.prototype=w,o(E,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:x,configurable:!0}),x.displayName=c(w,l,"GeneratorFunction"),e.isGeneratorFunction=function(R){var N=typeof R=="function"&&R.constructor;return!!N&&(N===x||(N.displayName||N.name)==="GeneratorFunction")},e.mark=function(R){return Object.setPrototypeOf?Object.setPrototypeOf(R,w):(R.__proto__=w,c(R,l,"GeneratorFunction")),R.prototype=Object.create(E),R},e.awrap=function(R){return{__await:R}},C(T.prototype),c(T.prototype,a,function(){return this}),e.AsyncIterator=T,e.async=function(R,N,O,P,I){I===void 0&&(I=Promise);var H=new T(u(R,N,O,P),I);return e.isGeneratorFunction(N)?H:H.next().then(function(le){return le.done?le.value:H.next()})},C(E),c(E,l,"Generator"),c(E,s,function(){return this}),c(E,"toString",function(){return"[object Generator]"}),e.keys=function(R){var N=Object(R),O=[];for(var P in N)O.push(P);return O.reverse(),function I(){for(;O.length;){var H=O.pop();if(H in N)return I.value=H,I.done=!1,I}return I.done=!0,I}},e.values=G,U.prototype={constructor:U,reset:function(R){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(Z),!R)for(var N in this)N.charAt(0)==="t"&&r.call(this,N)&&!isNaN(+N.slice(1))&&(this[N]=t)},stop:function(){this.done=!0;var R=this.tryEntries[0].completion;if(R.type==="throw")throw R.arg;return this.rval},dispatchException:function(R){if(this.done)throw R;var N=this;function O(Ee,Je){return H.type="throw",H.arg=R,N.next=Ee,Je&&(N.method="next",N.arg=t),!!Je}for(var P=this.tryEntries.length-1;P>=0;--P){var I=this.tryEntries[P],H=I.completion;if(I.tryLoc==="root")return O("end");if(I.tryLoc<=this.prev){var le=r.call(I,"catchLoc"),Le=r.call(I,"finallyLoc");if(le&&Le){if(this.prev<I.catchLoc)return O(I.catchLoc,!0);if(this.prev<I.finallyLoc)return O(I.finallyLoc)}else if(le){if(this.prev<I.catchLoc)return O(I.catchLoc,!0)}else{if(!Le)throw new Error("try statement without catch or finally");if(this.prev<I.finallyLoc)return O(I.finallyLoc)}}}},abrupt:function(R,N){for(var O=this.tryEntries.length-1;O>=0;--O){var P=this.tryEntries[O];if(P.tryLoc<=this.prev&&r.call(P,"finallyLoc")&&this.prev<P.finallyLoc){var I=P;break}}I&&(R==="break"||R==="continue")&&I.tryLoc<=N&&N<=I.finallyLoc&&(I=null);var H=I?I.completion:{};return H.type=R,H.arg=N,I?(this.method="next",this.next=I.finallyLoc,y):this.complete(H)},complete:function(R,N){if(R.type==="throw")throw R.arg;return R.type==="break"||R.type==="continue"?this.next=R.arg:R.type==="return"?(this.rval=this.arg=R.arg,this.method="return",this.next="end"):R.type==="normal"&&N&&(this.next=N),y},finish:function(R){for(var N=this.tryEntries.length-1;N>=0;--N){var O=this.tryEntries[N];if(O.finallyLoc===R)return this.complete(O.completion,O.afterLoc),Z(O),y}},catch:function(R){for(var N=this.tryEntries.length-1;N>=0;--N){var O=this.tryEntries[N];if(O.tryLoc===R){var P=O.completion;if(P.type==="throw"){var I=P.arg;Z(O)}return I}}throw new Error("illegal catch attempt")},delegateYield:function(R,N,O){return this.delegate={iterator:G(R),resultName:N,nextLoc:O},this.method==="next"&&(this.arg=t),y}},e}function kk(t,e,n,r,o,i,s){try{var a=t[i](s),l=a.value}catch(c){n(c);return}a.done?e(l):Promise.resolve(l).then(r,o)}function mO(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function s(l){kk(i,r,o,s,a,"next",l)}function a(l){kk(i,r,o,s,a,"throw",l)}s(void 0)})}}var M3=function(){function t(e){yn(this,t),this.host=e}return xn(t,[{key:"getDisableUrl",value:function(n){return"".concat(this.host,"/disable?redirect_to=").concat(encodeURIComponent(n))}},{key:"getLoginUrl",value:function(n){return"".concat(this.host,"/authorize?redirect_to=").concat(encodeURIComponent(n))}},{key:"getEnableUrl",value:function(n){return"".concat(this.host,"/enable?redirect_to=").concat(encodeURIComponent(n))}},{key:"getPatches",value:function(){var e=mO(Td().mark(function r(o){var i,s,a;return Td().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return i=o.patchIds,s=o.headers,a=i?"?".concat(i.map(function(u){return"".concat(u,"=").concat(encodeURIComponent(u))}).join("&")):"",c.abrupt("return",fetch("".concat(this.host,"/patches/~").concat(a),{headers:s||{"Content-Type":"application/json"}}).then(function(u){return ou(u)}).catch(ru));case 3:case"end":return c.stop()}},r,this)}));function n(r){return e.apply(this,arguments)}return n}()},{key:"getEditUrl",value:function(){return"/val"}},{key:"postPatches",value:function(n,r,o){return fetch("".concat(this.host,"/patches/~"),{headers:o||{"Content-Type":"application/json"},method:"POST",body:JSON.stringify(fe({},n,r))}).then(function(i){return ou(i)}).catch(ru)}},{key:"getSession",value:function(){return fetch("".concat(this.host,"/session")).then(function(n){return ou(n).catch(ru)})}},{key:"getTree",value:function(n){var r=n.patch,o=r===void 0?!1:r,i=n.includeSchema,s=i===void 0?!1:i,a=n.includeSource,l=a===void 0?!1:a,c=n.treePath,u=c===void 0?"/":c,d=n.headers,f=new URLSearchParams;return f.set("patch",o.toString()),f.set("schema",s.toString()),f.set("source",l.toString()),fetch("".concat(this.host,"/tree/~").concat(u,"?").concat(f.toString()),{headers:d}).then(function(p){return ou(p)}).catch(ru)}},{key:"postCommit",value:function(n){var r=n.patches,o=n.headers;return fetch("".concat(this.host,"/commit"),{method:"POST",body:JSON.stringify({patches:r}),headers:o||{"Content-Type":"application/json"}}).then(function(i){return ou(i)}).catch(ru)}}]),t}();function ru(t){return Po({statusCode:500,message:t instanceof Error?t.message:"Unknown error"})}function ou(t){return r0.apply(this,arguments)}function r0(){return r0=mO(Td().mark(function t(e){var n;return Td().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(o.prev=0,!e.ok){o.next=9;break}return o.t0=xa,o.next=5,e.json();case 5:return o.t1=o.sent,o.abrupt("return",o.t0.ok.call(o.t0,o.t1));case 9:return o.prev=9,o.next=12,e.json();case 12:return n=o.sent,o.abrupt("return",Po({statusCode:e.status,message:n.message||e.statusText,details:n.details||Object.fromEntries(Object.entries(n).filter(function(i){var s=vs(i,1),a=s[0];return a!=="message"}))}));case 16:return o.prev=16,o.t2=o.catch(9),o.abrupt("return",Po({statusCode:e.status,message:e.statusText}));case 19:o.next=24;break;case 21:return o.prev=21,o.t3=o.catch(0),o.abrupt("return",Po({message:o.t3 instanceof Error?o.t3.message:"Unknown error"}));case 24:case"end":return o.stop()}},t,null,[[0,21],[9,16]])})),r0.apply(this,arguments)}var yt={convertFileSource:iO,getSchema:ID,getValPath:aO,getVal:f3,getSource:GD,resolvePath:n3,splitModuleIdAndModulePath:YD,isVal:zD,createValPathOfItem:Mr,getSHA256Hash:O3,initSchema:d3,createPatchJSONPath:function(e){return"/".concat(e.split(".").map(function(n){return n&&R3(n)}).join("/"))},VAL_ENABLE_COOKIE_NAME:"val_enable",VAL_STATE_COOKIE:"val_state",VAL_SESSION_COOKIE:"val_session"};function R3(t){try{return JSON.parse(t)}catch{return t}}var gO={exports:{}};/*!
44
- Copyright (c) 2018 Jed Watson.
45
- Licensed under the MIT License (MIT), see
46
- http://jedwatson.github.io/classnames
47
- */(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var i="",s=0;s<arguments.length;s++){var a=arguments[s];a&&(i=o(i,r(a)))}return i}function r(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return n.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var s="";for(var a in i)e.call(i,a)&&i[a]&&(s=o(s,a));return s}function o(i,s){return s?i?i+" "+s:i+s:i}t.exports?(n.default=n,t.exports=n):window.classNames=n})()})(gO);var N3=gO.exports;const Ln=ki(N3);function z(){return z=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},z.apply(this,arguments)}function P3(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function Gm(...t){return e=>t.forEach(n=>P3(n,e))}function We(...t){return h.useCallback(Gm(...t),t)}const mi=h.forwardRef((t,e)=>{const{children:n,...r}=t,o=h.Children.toArray(n),i=o.find(A3);if(i){const s=i.props.children,a=o.map(l=>l===i?h.Children.count(s)>1?h.Children.only(null):h.isValidElement(s)?s.props.children:null:l);return h.createElement(o0,z({},r,{ref:e}),h.isValidElement(s)?h.cloneElement(s,void 0,a):null)}return h.createElement(o0,z({},r,{ref:e}),n)});mi.displayName="Slot";const o0=h.forwardRef((t,e)=>{const{children:n,...r}=t;return h.isValidElement(n)?h.cloneElement(n,{...I3(r,n.props),ref:e?Gm(e,n.ref):n.ref}):h.Children.count(n)>1?h.Children.only(null):null});o0.displayName="SlotClone";const $3=({children:t})=>h.createElement(h.Fragment,null,t);function A3(t){return h.isValidElement(t)&&t.type===$3}function I3(t,e){const n={...e};for(const r in e){const o=t[r],i=e[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...t,...n}}const D3=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Re=D3.reduce((t,e)=>{const n=h.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?mi:e;return h.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),h.createElement(a,z({},s,{ref:o}))});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function vO(t,e){t&&Vo.flushSync(()=>t.dispatchEvent(e))}const hr=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{};function L3(t,e){return h.useReducer((n,r)=>{const o=e[n][r];return o??n},t)}const Wn=t=>{const{present:e,children:n}=t,r=j3(e),o=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),i=We(r.ref,o.ref);return typeof n=="function"||r.isPresent?h.cloneElement(o,{ref:i}):null};Wn.displayName="Presence";function j3(t){const[e,n]=h.useState(),r=h.useRef({}),o=h.useRef(t),i=h.useRef("none"),s=t?"mounted":"unmounted",[a,l]=L3(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const c=cp(r.current);i.current=a==="mounted"?c:"none"},[a]),hr(()=>{const c=r.current,u=o.current;if(u!==t){const f=i.current,p=cp(c);t?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&f!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,l]),hr(()=>{if(e){const c=d=>{const p=cp(r.current).includes(d.animationName);d.target===e&&p&&Vo.flushSync(()=>l("ANIMATION_END"))},u=d=>{d.target===e&&(i.current=cp(r.current))};return e.addEventListener("animationstart",u),e.addEventListener("animationcancel",c),e.addEventListener("animationend",c),()=>{e.removeEventListener("animationstart",u),e.removeEventListener("animationcancel",c),e.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:h.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function cp(t){return(t==null?void 0:t.animationName)||"none"}function Lr(t,e=[]){let n=[];function r(i,s){const a=h.createContext(s),l=n.length;n=[...n,s];function c(d){const{scope:f,children:p,...m}=d,g=(f==null?void 0:f[t][l])||a,y=h.useMemo(()=>m,Object.values(m));return h.createElement(g.Provider,{value:y},p)}function u(d,f){const p=(f==null?void 0:f[t][l])||a,m=h.useContext(p);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(s=>h.createContext(s));return function(a){const l=(a==null?void 0:a[t])||i;return h.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return o.scopeName=t,[r,z3(o,...e)]}function z3(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...a,...d}},{});return h.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])}};return n.scopeName=e.scopeName,n}function rn(t){const e=h.useRef(t);return h.useEffect(()=>{e.current=t}),h.useMemo(()=>(...n)=>{var r;return(r=e.current)===null||r===void 0?void 0:r.call(e,...n)},[])}const F3=h.createContext(void 0);function _f(t){const e=h.useContext(F3);return t||e||"ltr"}function i0(t,[e,n]){return Math.min(n,Math.max(e,t))}function se(t,e,{checkForDefaultPrevented:n=!0}={}){return function(o){if(t==null||t(o),n===!1||!o.defaultPrevented)return e==null?void 0:e(o)}}function B3(t,e){return h.useReducer((n,r)=>{const o=e[n][r];return o??n},t)}const yO="ScrollArea",[xO,Koe]=Lr(yO),[U3,jr]=xO(yO),V3=h.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=t,[a,l]=h.useState(null),[c,u]=h.useState(null),[d,f]=h.useState(null),[p,m]=h.useState(null),[g,y]=h.useState(null),[v,x]=h.useState(0),[w,S]=h.useState(0),[_,k]=h.useState(!1),[E,C]=h.useState(!1),T=We(e,B=>l(B)),A=_f(o);return h.createElement(U3,{scope:n,type:r,dir:A,scrollHideDelay:i,scrollArea:a,viewport:c,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:_,onScrollbarXEnabledChange:k,scrollbarY:g,onScrollbarYChange:y,scrollbarYEnabled:E,onScrollbarYEnabledChange:C,onCornerWidthChange:x,onCornerHeightChange:S},h.createElement(Re.div,z({dir:A},s,{ref:T,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":w+"px",...t.style}})))}),H3="ScrollAreaViewport",W3=h.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:r,...o}=t,i=jr(H3,n),s=h.useRef(null),a=We(e,s,i.onViewportChange);return h.createElement(h.Fragment,null,h.createElement("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}"}}),h.createElement(Re.div,z({"data-radix-scroll-area-viewport":""},o,{ref:a,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...t.style}}),h.createElement("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),Ei="ScrollAreaScrollbar",bO=h.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=jr(Ei,t.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=t.orientation==="horizontal";return h.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?h.createElement(K3,z({},r,{ref:e,forceMount:n})):o.type==="scroll"?h.createElement(q3,z({},r,{ref:e,forceMount:n})):o.type==="auto"?h.createElement(wO,z({},r,{ref:e,forceMount:n})):o.type==="always"?h.createElement(g1,z({},r,{ref:e})):null}),K3=h.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=jr(Ei,t.__scopeScrollArea),[i,s]=h.useState(!1);return h.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),s(!0)},u=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),h.createElement(Wn,{present:n||i},h.createElement(wO,z({"data-state":i?"visible":"hidden"},r,{ref:e})))}),q3=h.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=jr(Ei,t.__scopeScrollArea),i=t.orientation==="horizontal",s=Zm(()=>l("SCROLL_END"),100),[a,l]=B3("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 h.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),h.useEffect(()=>{const c=o.viewport,u=i?"scrollLeft":"scrollTop";if(c){let d=c[u];const f=()=>{const p=c[u];d!==p&&(l("SCROLL"),s()),d=p};return c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[o.viewport,i,l,s]),h.createElement(Wn,{present:n||a!=="hidden"},h.createElement(g1,z({"data-state":a==="hidden"?"hidden":"visible"},r,{ref:e,onPointerEnter:se(t.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:se(t.onPointerLeave,()=>l("POINTER_LEAVE"))})))}),wO=h.forwardRef((t,e)=>{const n=jr(Ei,t.__scopeScrollArea),{forceMount:r,...o}=t,[i,s]=h.useState(!1),a=t.orientation==="horizontal",l=Zm(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:u)}},10);return pc(n.viewport,l),pc(n.content,l),h.createElement(Wn,{present:r||i},h.createElement(g1,z({"data-state":i?"visible":"hidden"},o,{ref:e})))}),g1=h.forwardRef((t,e)=>{const{orientation:n="vertical",...r}=t,o=jr(Ei,t.__scopeScrollArea),i=h.useRef(null),s=h.useRef(0),[a,l]=h.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=_O(a.viewport,a.content),u={...r,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:f=>i.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function d(f,p){return t5(f,s.current,a,p)}return n==="horizontal"?h.createElement(G3,z({},u,{ref:e,onThumbPositionChange:()=>{if(o.viewport&&i.current){const f=o.viewport.scrollLeft,p=Sk(f,a,o.dir);i.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollLeft=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollLeft=d(f,o.dir))}})):n==="vertical"?h.createElement(Y3,z({},u,{ref:e,onThumbPositionChange:()=>{if(o.viewport&&i.current){const f=o.viewport.scrollTop,p=Sk(f,a);i.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollTop=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollTop=d(f))}})):null}),G3=h.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...o}=t,i=jr(Ei,t.__scopeScrollArea),[s,a]=h.useState(),l=h.useRef(null),c=We(e,l,i.onScrollbarXChange);return h.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),h.createElement(SO,z({"data-orientation":"horizontal"},o,{ref:c,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Ym(n)+"px",...t.style},onThumbPointerDown:u=>t.onThumbPointerDown(u.x),onDragScroll:u=>t.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(i.viewport){const f=i.viewport.scrollLeft+u.deltaX;t.onWheelScroll(f),TO(f,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Ch(s.paddingLeft),paddingEnd:Ch(s.paddingRight)}})}}))}),Y3=h.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...o}=t,i=jr(Ei,t.__scopeScrollArea),[s,a]=h.useState(),l=h.useRef(null),c=We(e,l,i.onScrollbarYChange);return h.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),h.createElement(SO,z({"data-orientation":"vertical"},o,{ref:c,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Ym(n)+"px",...t.style},onThumbPointerDown:u=>t.onThumbPointerDown(u.y),onDragScroll:u=>t.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(i.viewport){const f=i.viewport.scrollTop+u.deltaY;t.onWheelScroll(f),TO(f,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Ch(s.paddingTop),paddingEnd:Ch(s.paddingBottom)}})}}))}),[Z3,kO]=xO(Ei),SO=h.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:d,...f}=t,p=jr(Ei,n),[m,g]=h.useState(null),y=We(e,T=>g(T)),v=h.useRef(null),x=h.useRef(""),w=p.viewport,S=r.content-r.viewport,_=rn(u),k=rn(l),E=Zm(d,10);function C(T){if(v.current){const A=T.clientX-v.current.left,B=T.clientY-v.current.top;c({x:A,y:B})}}return h.useEffect(()=>{const T=A=>{const B=A.target;(m==null?void 0:m.contains(B))&&_(A,S)};return document.addEventListener("wheel",T,{passive:!1}),()=>document.removeEventListener("wheel",T,{passive:!1})},[w,m,S,_]),h.useEffect(k,[r,k]),pc(m,E),pc(p.content,E),h.createElement(Z3,{scope:n,scrollbar:m,hasThumb:o,onThumbChange:rn(i),onThumbPointerUp:rn(s),onThumbPositionChange:k,onThumbPointerDown:rn(a)},h.createElement(Re.div,z({},f,{ref:y,style:{position:"absolute",...f.style},onPointerDown:se(t.onPointerDown,T=>{T.button===0&&(T.target.setPointerCapture(T.pointerId),v.current=m.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),C(T))}),onPointerMove:se(t.onPointerMove,C),onPointerUp:se(t.onPointerUp,T=>{const A=T.target;A.hasPointerCapture(T.pointerId)&&A.releasePointerCapture(T.pointerId),document.body.style.webkitUserSelect=x.current,p.viewport&&(p.viewport.style.scrollBehavior=""),v.current=null})})))}),s0="ScrollAreaThumb",J3=h.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=kO(s0,t.__scopeScrollArea);return h.createElement(Wn,{present:n||o.hasThumb},h.createElement(X3,z({ref:e},r)))}),X3=h.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:r,...o}=t,i=jr(s0,n),s=kO(s0,n),{onThumbPositionChange:a}=s,l=We(e,d=>s.onThumbChange(d)),c=h.useRef(),u=Zm(()=>{c.current&&(c.current(),c.current=void 0)},100);return h.useEffect(()=>{const d=i.viewport;if(d){const f=()=>{if(u(),!c.current){const p=n5(d,a);c.current=p,a()}};return a(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[i.viewport,u,a]),h.createElement(Re.div,z({"data-state":s.hasThumb?"visible":"hidden"},o,{ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:se(t.onPointerDownCapture,d=>{const p=d.target.getBoundingClientRect(),m=d.clientX-p.left,g=d.clientY-p.top;s.onThumbPointerDown({x:m,y:g})}),onPointerUp:se(t.onPointerUp,s.onThumbPointerUp)}))}),EO="ScrollAreaCorner",Q3=h.forwardRef((t,e)=>{const n=jr(EO,t.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?h.createElement(e5,z({},t,{ref:e})):null}),e5=h.forwardRef((t,e)=>{const{__scopeScrollArea:n,...r}=t,o=jr(EO,n),[i,s]=h.useState(0),[a,l]=h.useState(0),c=!!(i&&a);return pc(o.scrollbarX,()=>{var u;const d=((u=o.scrollbarX)===null||u===void 0?void 0:u.offsetHeight)||0;o.onCornerHeightChange(d),l(d)}),pc(o.scrollbarY,()=>{var u;const d=((u=o.scrollbarY)===null||u===void 0?void 0:u.offsetWidth)||0;o.onCornerWidthChange(d),s(d)}),c?h.createElement(Re.div,z({},r,{ref:e,style:{width:i,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...t.style}})):null});function Ch(t){return t?parseInt(t,10):0}function _O(t,e){const n=t/e;return isNaN(n)?0:n}function Ym(t){const e=_O(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function t5(t,e,n,r="ltr"){const o=Ym(n),i=o/2,s=e||i,a=o-s,l=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,u=n.content-n.viewport,d=r==="ltr"?[0,u]:[u*-1,0];return CO([l,c],d)(t)}function Sk(t,e,n="ltr"){const r=Ym(e),o=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=e.scrollbar.size-o,s=e.content-e.viewport,a=i-r,l=n==="ltr"?[0,s]:[s*-1,0],c=i0(t,l);return CO([0,s],[0,a])(c)}function CO(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function TO(t,e){return t>0&&t<e}const n5=(t,e=()=>{})=>{let n={left:t.scrollLeft,top:t.scrollTop},r=0;return function o(){const i={left:t.scrollLeft,top:t.scrollTop},s=n.left!==i.left,a=n.top!==i.top;(s||a)&&e(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function Zm(t,e){const n=rn(t),r=h.useRef(0);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),h.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,e)},[n,e])}function pc(t,e){const n=rn(e);hr(()=>{let r=0;if(t){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(t),()=>{window.cancelAnimationFrame(r),o.unobserve(t)}}},[t,n])}const OO=V3,r5=W3,o5=Q3;function MO(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(n=MO(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function i5(){for(var t,e,n=0,r="",o=arguments.length;n<o;n++)(t=arguments[n])&&(e=MO(t))&&(r&&(r+=" "),r+=e);return r}const v1="-";function s5(t){const e=l5(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;function o(s){const a=s.split(v1);return a[0]===""&&a.length!==1&&a.shift(),RO(a,e)||a5(s)}function i(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function RO(t,e){var s;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),o=r?RO(t.slice(1),r):void 0;if(o)return o;if(e.validators.length===0)return;const i=t.join(v1);return(s=e.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId}const Ek=/^\[(.+)\]$/;function a5(t){if(Ek.test(t)){const e=Ek.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}}function l5(t){const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return u5(Object.entries(t.classGroups),n).forEach(([i,s])=>{a0(s,r,i,e)}),r}function a0(t,e,n,r){t.forEach(o=>{if(typeof o=="string"){const i=o===""?e:_k(e,o);i.classGroupId=n;return}if(typeof o=="function"){if(c5(o)){a0(o(r),e,n,r);return}e.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{a0(s,_k(e,i),n,r)})})}function _k(t,e){let n=t;return e.split(v1).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function c5(t){return t.isThemeGetter}function u5(t,e){return e?t.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[e+s,a])):i);return[n,o]}):t}function d5(t){if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;function o(i,s){n.set(i,s),e++,e>t&&(e=0,r=n,n=new Map)}return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}}const NO="!";function f5(t){const e=t.separator,n=e.length===1,r=e[0],o=e.length;return function(s){const a=[];let l=0,c=0,u;for(let g=0;g<s.length;g++){let y=s[g];if(l===0){if(y===r&&(n||s.slice(g,g+o)===e)){a.push(s.slice(c,g)),c=g+o;continue}if(y==="/"){u=g;continue}}y==="["?l++:y==="]"&&l--}const d=a.length===0?s:s.substring(c),f=d.startsWith(NO),p=f?d.substring(1):d,m=u&&u>c?u-c:void 0;return{modifiers:a,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}}}function p5(t){if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e}function h5(t){return{cache:d5(t.cacheSize),splitModifiers:f5(t),...s5(t)}}const m5=/\s+/;function g5(t,e){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=e,i=new Set;return t.trim().split(m5).map(s=>{const{modifiers:a,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:u}=n(s);let d=r(u?c.substring(0,u):c),f=!!u;if(!d){if(!u)return{isTailwindClass:!1,originalClassName:s};if(d=r(c),!d)return{isTailwindClass:!1,originalClassName:s};f=!1}const p=p5(a).join(":");return{isTailwindClass:!0,modifierId:l?p+NO:p,classGroupId:d,originalClassName:s,hasPostfixModifier:f}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:c}=s,u=a+l;return i.has(u)?!1:(i.add(u),o(l,c).forEach(d=>i.add(a+d)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function v5(){let t=0,e,n,r="";for(;t<arguments.length;)(e=arguments[t++])&&(n=PO(e))&&(r&&(r+=" "),r+=n);return r}function PO(t){if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=PO(t[r]))&&(n&&(n+=" "),n+=e);return n}function y5(t,...e){let n,r,o,i=s;function s(l){const c=e.reduce((u,d)=>d(u),t());return n=h5(c),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=g5(l,n);return o(l,u),u}return function(){return i(v5.apply(null,arguments))}}function gt(t){const e=n=>n[t]||[];return e.isThemeGetter=!0,e}const $O=/^\[(?:([a-z-]+):)?(.+)\]$/i,x5=/^\d+\/\d+$/,b5=new Set(["px","full","screen"]),w5=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,k5=/\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$/,S5=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,E5=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Ho(t){return ua(t)||b5.has(t)||x5.test(t)}function Ii(t){return Ic(t,"length",P5)}function ua(t){return!!t&&!Number.isNaN(Number(t))}function up(t){return Ic(t,"number",ua)}function iu(t){return!!t&&Number.isInteger(Number(t))}function _5(t){return t.endsWith("%")&&ua(t.slice(0,-1))}function Me(t){return $O.test(t)}function Di(t){return w5.test(t)}const C5=new Set(["length","size","percentage"]);function T5(t){return Ic(t,C5,AO)}function O5(t){return Ic(t,"position",AO)}const M5=new Set(["image","url"]);function R5(t){return Ic(t,M5,A5)}function N5(t){return Ic(t,"",$5)}function su(){return!0}function Ic(t,e,n){const r=$O.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1}function P5(t){return k5.test(t)}function AO(){return!1}function $5(t){return S5.test(t)}function A5(t){return E5.test(t)}function I5(){const t=gt("colors"),e=gt("spacing"),n=gt("blur"),r=gt("brightness"),o=gt("borderColor"),i=gt("borderRadius"),s=gt("borderSpacing"),a=gt("borderWidth"),l=gt("contrast"),c=gt("grayscale"),u=gt("hueRotate"),d=gt("invert"),f=gt("gap"),p=gt("gradientColorStops"),m=gt("gradientColorStopPositions"),g=gt("inset"),y=gt("margin"),v=gt("opacity"),x=gt("padding"),w=gt("saturate"),S=gt("scale"),_=gt("sepia"),k=gt("skew"),E=gt("space"),C=gt("translate"),T=()=>["auto","contain","none"],A=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto",Me,e],D=()=>[Me,e],Z=()=>["",Ho,Ii],U=()=>["auto",ua,Me],G=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],R=()=>["solid","dashed","dotted","double","none"],N=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],O=()=>["start","end","center","between","around","evenly","stretch"],P=()=>["","0",Me],I=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[ua,up],le=()=>[ua,Me];return{cacheSize:500,separator:":",theme:{colors:[su],spacing:[Ho,Ii],blur:["none","",Di,Me],brightness:H(),borderColor:[t],borderRadius:["none","","full",Di,Me],borderSpacing:D(),borderWidth:Z(),contrast:H(),grayscale:P(),hueRotate:le(),invert:P(),gap:D(),gradientColorStops:[t],gradientColorStopPositions:[_5,Ii],inset:B(),margin:B(),opacity:H(),padding:D(),saturate:H(),scale:H(),sepia:P(),skew:le(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",Me]}],container:["container"],columns:[{columns:[Di]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"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"],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:[...G(),Me]}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",iu,Me]}],basis:[{basis:B()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Me]}],grow:[{grow:P()}],shrink:[{shrink:P()}],order:[{order:["first","last","none",iu,Me]}],"grid-cols":[{"grid-cols":[su]}],"col-start-end":[{col:["auto",{span:["full",iu,Me]},Me]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[su]}],"row-start-end":[{row:["auto",{span:[iu,Me]},Me]}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Me]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Me]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...O()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...O(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...O(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Me,e]}],"min-w":[{"min-w":[Me,e,"min","max","fit"]}],"max-w":[{"max-w":[Me,e,"none","full","min","max","fit","prose",{screen:[Di]},Di]}],h:[{h:[Me,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Me,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Me,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Me,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Di,Ii]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",up]}],"font-family":[{font:[su]}],"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-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Me]}],"line-clamp":[{"line-clamp":["none",ua,up]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ho,Me]}],"list-image":[{"list-image":["none",Me]}],"list-style-type":[{list:["none","disc","decimal",Me]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...R(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ho,Ii]}],"underline-offset":[{"underline-offset":["auto",Ho,Me]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...G(),O5]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",T5]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},R5]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...R(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:R()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...R()]}],"outline-offset":[{"outline-offset":[Ho,Me]}],"outline-w":[{outline:[Ho,Ii]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:Z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Ho,Ii]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Di,N5]}],"shadow-color":[{shadow:[su]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":N()}],"bg-blend":[{"bg-blend":N()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Di,Me]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[w]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Me]}],duration:[{duration:le()}],ease:[{ease:["linear","in","out","in-out",Me]}],delay:[{delay:le()}],animate:[{animate:["none","spin","ping","pulse","bounce",Me]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[iu,Me]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Me]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],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]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"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]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Ho,Ii,up]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-s","border-w-e","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-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"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","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-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"]}}}const D5=y5(I5);function ze(...t){return D5(i5(t))}const ed=h.forwardRef(({className:t,children:e,innerRef:n,...r},o)=>b.jsxs(OO,{ref:o,className:ze("relative overflow-hidden",t),...r,children:[b.jsx(r5,{className:"h-full w-full rounded-[inherit]",ref:n,children:e}),b.jsx(IO,{}),b.jsx(o5,{})]}));ed.displayName=OO.displayName;const IO=h.forwardRef(({className:t,orientation:e="vertical",...n},r)=>b.jsx(bO,{ref:r,orientation:e,className:ze("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",t),...n,children:b.jsx(J3,{className:ze("relative rounded-full bg-border",e==="vertical"&&"flex-1")})}));IO.displayName=bO.displayName;var L5={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const j5=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ve=(t,e)=>{const n=h.forwardRef(({color:r="currentColor",size:o=24,strokeWidth:i=2,absoluteStrokeWidth:s,children:a,...l},c)=>h.createElement("svg",{ref:c,...L5,width:o,height:o,stroke:r,strokeWidth:s?Number(i)*24/Number(o):i,className:`lucide lucide-${j5(t)}`,...l},[...e.map(([u,d])=>h.createElement(u,d)),...(Array.isArray(a)?a:[a])||[]]));return n.displayName=`${t}`,n},z5=Ve("Bold",[["path",{d:"M14 12a4 4 0 0 0 0-8H6v8",key:"v2sylx"}],["path",{d:"M15 20a4 4 0 0 0 0-8H6v8Z",key:"1ef5ya"}]]),y1=Ve("Check",[["polyline",{points:"20 6 9 17 4 12",key:"10jjfj"}]]),Th=Ve("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),F5=Ve("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),B5=Ve("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),U5=Ve("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),V5=Ve("Diff",[["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 10h14",key:"elsbfy"}],["path",{d:"M5 21h14",key:"11awu3"}]]),H5=Ve("ExternalLink",[["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}],["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["line",{x1:"10",x2:"21",y1:"14",y2:"3",key:"18c3s4"}]]),W5=Ve("File",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}]]),Ck=Ve("Heading1",[["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"}]]),Tk=Ve("Heading2",[["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"}]]),Ok=Ve("Heading3",[["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"}]]),Mk=Ve("Heading4",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17 10v4h4",key:"13sv97"}],["path",{d:"M21 10v8",key:"1kdml4"}]]),Rk=Ve("Heading5",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17 13v-3h4",key:"1nvgqp"}],["path",{d:"M17 17.7c.4.2.8.3 1.3.3 1.5 0 2.7-1.1 2.7-2.5S19.8 13 18.3 13H17",key:"2nebdn"}]]),Nk=Ve("Heading6",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["circle",{cx:"19",cy:"16",r:"2",key:"15mx69"}],["path",{d:"M20 10c-2 2-3 3.5-3 6",key:"f35dl0"}]]),K5=Ve("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),q5=Ve("Italic",[["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"}]]),G5=Ve("Link",[["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"}]]),Y5=Ve("ListOrdered",[["line",{x1:"10",x2:"21",y1:"6",y2:"6",key:"76qw6h"}],["line",{x1:"10",x2:"21",y1:"12",y2:"12",key:"16nom4"}],["line",{x1:"10",x2:"21",y1:"18",y2:"18",key:"u3jurt"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]),Z5=Ve("List",[["line",{x1:"8",x2:"21",y1:"6",y2:"6",key:"7ey8pc"}],["line",{x1:"8",x2:"21",y1:"12",y2:"12",key:"rjfblc"}],["line",{x1:"8",x2:"21",y1:"18",y2:"18",key:"c3b1m8"}],["line",{x1:"3",x2:"3.01",y1:"6",y2:"6",key:"1g7gq3"}],["line",{x1:"3",x2:"3.01",y1:"12",y2:"12",key:"1pjlvk"}],["line",{x1:"3",x2:"3.01",y1:"18",y2:"18",key:"28t2mc"}]]),Pk=Ve("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]),J5=Ve("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]),X5=Ve("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]),Q5=Ve("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]),eL=Ve("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]),tL=Ve("MoreHorizontal",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]),nL=Ve("Pause",[["rect",{width:"4",height:"16",x:"6",y:"4",key:"iffhe4"}],["rect",{width:"4",height:"16",x:"14",y:"4",key:"sjin7j"}]]),rL=Ve("Play",[["polygon",{points:"5 3 19 12 5 21 5 3",key:"191637"}]]),oL=Ve("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),DO=Ve("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]),iL=Ve("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]),sL=Ve("Strikethrough",[["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"}]]),aL=Ve("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),LO=Ve("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]),lL=Ve("Unlink",[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]]),Oh=Ve("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function td({children:t}){const e=h.useRef(null),n=h.useRef(null),r=h.useRef(!1),o=h.useRef(0),i=h.useRef(null),s=h.useRef(0),[a,l]=h.useState(!0),c=()=>{r.current=!1,i.current=null,o.current=0,s.current=0},u=x=>{x.preventDefault();const w=i.current==="left"?e:n;if(w.current&&r.current){const S=i.current==="left"?x.screenX-o.current:o.current-x.screenX;w.current.style.width=`${Math.max(s.current+S,150)}px`}},d=x=>w=>{if(w.target){const _=x==="left"?e:x==="right"?n:null;r.current=!0,_&&_.current&&(o.current=w.screenX,i.current=x,_.current&&(s.current=_.current.offsetWidth))}},[f,p,m,g,y,v]=h.Children.toArray(t);return h.useEffect(()=>(document.addEventListener("mouseup",c),document.addEventListener("mousemove",u),()=>{document.removeEventListener("mouseup",c),document.removeEventListener("mousemove",u)}),[]),b.jsxs("div",{className:"relative flex h-screen",children:[b.jsxs("div",{ref:e,className:Ln("absolute top-0 left-0 border-r border-border md:relative z-[1] bg-gradient-to-br from-card from-50% to-background",{"w-[300px]":a,"w-0 md:w-[300px]":!a}),children:[b.jsxs(td.Column,{children:[b.jsx($k,{showOnMobile:!a,onClick:()=>{l(!a)},children:f}),b.jsx(ed,{style:{height:"calc(100vh - 50px)"},onClick:()=>{l(!1)},children:p})]}),b.jsx("div",{className:"absolute inset-y-0 right-0 cursor-col-resize w-[1px] hover:w-[3px] h-full hover:bg-border",onMouseDown:d("left")})]}),b.jsx("div",{className:Ln("",{"w-full":!y&&!v}),children:b.jsxs(td.Column,{children:[b.jsxs("span",{className:"flex w-full border-b border-border",children:[b.jsx($k,{className:"md:hidden",showOnMobile:a,onClick:()=>{l(!a)},children:f}),b.jsx("span",{className:Ln({"pl-[300px] md:pl-0":a}),children:m})]}),b.jsx(ed,{style:{height:"calc(100vh - 50px)"},children:g})]})}),y||v&&b.jsxs("div",{ref:n,className:"relative h-screen border-l border-border",style:{width:300},children:[b.jsxs(td.Column,{children:[y,b.jsx(ed,{style:{height:"calc(100vh - 50px)"},children:v})]}),b.jsx("div",{onMouseDown:d("right"),className:"absolute inset-y-0 left-0 cursor-col-resize w-[1px] bg-border hover:w-[3px] hover:bg-border"})]})]})}function $k({className:t,showOnMobile:e,onClick:n,children:r}){return b.jsxs("div",{className:Ln("flex items-center px-4 md:px-4",t,{"hidden md:flex":e}),children:[b.jsx("button",{className:"md:hidden",onClick:n,children:b.jsx(X5,{})}),b.jsx("span",{className:"flex items-center justify-between w-full",children:r})]})}td.Column=({children:t,className:e})=>{const[n,r]=h.Children.toArray(t);return b.jsxs("div",{className:Ln("flex flex-col",e),children:[b.jsx("div",{className:"flex items-center border-b border-border",children:n}),r]})};const cL=({className:t})=>b.jsxs("svg",{width:"58",height:"34",viewBox:"0 0 58 34",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[b.jsx("g",{filter:"url(#filter0_d_21_1677)",children:b.jsx("path",{d:"M5 5.36426C5 5.16309 5.16309 5 5.36426 5H17.6581C17.8593 5 18.0223 5.16309 18.0223 5.36426V28.4949C18.0223 28.696 17.8593 28.8591 17.6581 28.8591H5.36426C5.16309 28.8591 5 28.696 5 28.4949V5.36426Z",fill:"hsl(var(--accent))"})}),b.jsx("g",{filter:"url(#filter1_i_21_1677)",children:b.jsx("circle",{cx:"11.4656",cy:"23.7595",r:"2.18557",fill:"currentColor"})}),b.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M52.8588 23.839H48.7257H48.537H48.1128C47.6715 23.839 47.4508 23.5942 47.4508 23.1044V13.7293C47.4508 13.5784 47.3285 13.4561 47.1777 13.4561H45.8118C45.6609 13.4561 45.5386 13.5784 45.5386 13.7293V15.1836C45.5386 15.2844 45.4569 15.3661 45.3561 15.3661C45.2876 15.3661 45.225 15.3275 45.1924 15.2672C44.805 14.5503 44.283 14.02 43.6264 13.6765C42.9563 13.301 42.2045 13.1132 41.3709 13.1132C40.6028 13.1132 39.8755 13.252 39.189 13.5295C38.5026 13.8071 37.8979 14.2152 37.3748 14.7539C36.8682 15.2764 36.4678 15.9212 36.1736 16.6885C35.8794 17.4558 35.7323 18.3374 35.7323 19.3332V19.725C35.7323 20.7372 35.8794 21.627 36.1736 22.3942C36.4678 23.1615 36.8682 23.8146 37.3748 24.3533C37.8979 24.8757 38.5026 25.2757 39.189 25.5532C39.8755 25.8144 40.6191 25.945 41.42 25.945C42.1881 25.945 42.9154 25.7491 43.6019 25.3573C44.2751 24.982 44.8058 24.4119 45.1941 23.6471C45.2255 23.5852 45.2886 23.5452 45.358 23.5452H45.3917C45.4728 23.5452 45.5386 23.611 45.5386 23.6921C45.5386 23.7904 45.544 23.8856 45.5547 23.9777V25.1392C45.5547 25.3904 45.7584 25.5941 46.0096 25.5941H47.2261C47.2914 25.5995 47.3581 25.6022 47.4263 25.6022H48.537H48.7257H57.7268C57.8777 25.6022 58 25.4799 58 25.329V24.1122C58 23.9614 57.8777 23.839 57.7268 23.839H55.3174C55.1665 23.839 55.0442 23.7167 55.0442 23.5659V8.73368C55.0442 8.58279 54.9219 8.46048 54.771 8.46048H50.5054C50.3545 8.46048 50.2322 8.58279 50.2322 8.73368V9.95043C50.2322 10.1013 50.3545 10.2236 50.5054 10.2236H52.8588C53.0097 10.2236 53.132 10.3459 53.132 10.4968V23.5659C53.132 23.7167 53.0097 23.839 52.8588 23.839ZM41.6161 24.1329C42.1881 24.1329 42.7111 24.0268 43.1851 23.8146C43.6754 23.6023 44.0922 23.3003 44.4354 22.9085C44.7786 22.5167 45.0483 22.0514 45.2444 21.5127C45.4406 20.9576 45.5386 20.3454 45.5386 19.6761V19.3822C45.5386 18.7292 45.4406 18.1333 45.2444 17.5946C45.0483 17.0395 44.7705 16.5661 44.4109 16.1743C44.0677 15.7824 43.6509 15.4804 43.1606 15.2682C42.6866 15.0396 42.1718 14.9254 41.6161 14.9254C41.044 14.9254 40.521 15.0315 40.0471 15.2437C39.5731 15.4559 39.1563 15.758 38.7968 16.1498C38.4535 16.5252 38.1839 16.9905 37.9877 17.5456C37.7916 18.0843 37.6936 18.6802 37.6936 19.3332V19.725C37.6936 21.1127 38.0531 22.1983 38.7722 22.982C39.5077 23.7493 40.4557 24.1329 41.6161 24.1329ZM31.1115 25.4191C31.0732 25.5287 30.9698 25.6022 30.8536 25.6022H27.4661C27.35 25.6022 27.2465 25.5287 27.2082 25.4191L23.1578 13.8193C23.0958 13.6417 23.2276 13.4561 23.4157 13.4561H25.089C25.2068 13.4561 25.3114 13.5316 25.3484 13.6435L28.9666 24.581C28.9942 24.6643 29.0721 24.7206 29.1599 24.7206C29.2477 24.7206 29.3256 24.6643 29.3532 24.581L32.9714 13.6435C33.0084 13.5316 33.1129 13.4561 33.2308 13.4561H34.9041C35.0922 13.4561 35.224 13.6417 35.162 13.8193L31.1115 25.4191Z",fill:"currentColor"}),b.jsxs("defs",{children:[b.jsxs("filter",{id:"filter0_d_21_1677",x:"0.124722",y:"0.124722",width:"22.7729",height:"33.6097",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[b.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),b.jsx("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),b.jsx("feOffset",{}),b.jsx("feGaussianBlur",{stdDeviation:"2.43764"}),b.jsx("feComposite",{in2:"hardAlpha",operator:"out"}),b.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.219608 0 0 0 0 0.803922 0 0 0 0 0.501961 0 0 0 0.3 0"}),b.jsx("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_21_1677"}),b.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_21_1677",result:"shape"})]}),b.jsxs("filter",{id:"filter1_i_21_1677",x:"9.28003",y:"21.5739",width:"4.37112",height:"4.37112",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[b.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),b.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),b.jsx("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),b.jsx("feOffset",{}),b.jsx("feGaussianBlur",{stdDeviation:"0.546392"}),b.jsx("feComposite",{in2:"hardAlpha",operator:"arithmetic",k2:"-1",k3:"1"}),b.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.219608 0 0 0 0 0.803922 0 0 0 0 0.501961 0 0 0 0.3 0"}),b.jsx("feBlend",{mode:"normal",in2:"shape",result:"effect1_innerShadow_21_1677"})]})]})]}),jO=cL,zO=oe.createContext({get session(){throw Error("ValUIContext not found. Ensure components are wrapped by ValUIProvider!")},get theme(){throw Error("ValUIContext not found. Ensure components are wrapped by ValUIProvider!")},get setTheme(){throw Error("ValUIContext not found. Ensure components are wrapped by ValUIProvider!")},get editMode(){throw Error("ValUIContext not found. Ensure components are wrapped by ValUIProvider!")},get setEditMode(){throw Error("ValUIContext not found. Ensure components are wrapped by ValUIProvider!")},get setWindowSize(){throw Error("ValOverlayContext not found. Ensure components are wrapped by ValOverlayProvider!")},get windowSize(){throw Error("ValOverlayContext not found. Ensure components are wrapped by ValOverlayProvider!")}});function x1(){return oe.useContext(zO)}/**
48
- * @remix-run/router v1.14.2
49
- *
50
- * Copyright (c) Remix Software Inc.
51
- *
52
- * This source code is licensed under the MIT license found in the
53
- * LICENSE.md file in the root directory of this source tree.
54
- *
55
- * @license MIT
56
- */function Pt(){return Pt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Pt.apply(this,arguments)}var Dt;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(Dt||(Dt={}));const Ak="popstate";function uL(t){t===void 0&&(t={});function e(r,o){let{pathname:i,search:s,hash:a}=r.location;return Od("",{pathname:i,search:s,hash:a},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:Cf(o)}return fL(e,n,null,t)}function Be(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function $a(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function dL(){return Math.random().toString(36).substr(2,8)}function Ik(t,e){return{usr:t.state,key:t.key,idx:e}}function Od(t,e,n,r){return n===void 0&&(n=null),Pt({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?_i(e):e,{state:n,key:e&&e.key||r||dL()})}function Cf(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function _i(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function fL(t,e,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,s=o.history,a=Dt.Pop,l=null,c=u();c==null&&(c=0,s.replaceState(Pt({},s.state,{idx:c}),""));function u(){return(s.state||{idx:null}).idx}function d(){a=Dt.Pop;let y=u(),v=y==null?null:y-c;c=y,l&&l({action:a,location:g.location,delta:v})}function f(y,v){a=Dt.Push;let x=Od(g.location,y,v);n&&n(x,y),c=u()+1;let w=Ik(x,c),S=g.createHref(x);try{s.pushState(w,"",S)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;o.location.assign(S)}i&&l&&l({action:a,location:g.location,delta:1})}function p(y,v){a=Dt.Replace;let x=Od(g.location,y,v);n&&n(x,y),c=u();let w=Ik(x,c),S=g.createHref(x);s.replaceState(w,"",S),i&&l&&l({action:a,location:g.location,delta:0})}function m(y){let v=o.location.origin!=="null"?o.location.origin:o.location.href,x=typeof y=="string"?y:Cf(y);return Be(v,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,v)}let g={get action(){return a},get location(){return t(o,s)},listen(y){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(Ak,d),l=y,()=>{o.removeEventListener(Ak,d),l=null}},createHref(y){return e(o,y)},createURL:m,encodeLocation(y){let v=m(y);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:f,replace:p,go(y){return s.go(y)}};return g}var Rt;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(Rt||(Rt={}));const pL=new Set(["lazy","caseSensitive","path","id","index","children"]);function hL(t){return t.index===!0}function l0(t,e,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),t.map((o,i)=>{let s=[...n,i],a=typeof o.id=="string"?o.id:s.join("-");if(Be(o.index!==!0||!o.children,"Cannot specify children on an index route"),Be(!r[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),hL(o)){let l=Pt({},o,e(o),{id:a});return r[a]=l,l}else{let l=Pt({},o,e(o),{id:a,children:void 0});return r[a]=l,o.children&&(l.children=l0(o.children,e,s,r)),l}})}function Vl(t,e,n){n===void 0&&(n="/");let r=typeof e=="string"?_i(e):e,o=Tf(r.pathname||"/",n);if(o==null)return null;let i=FO(t);gL(i);let s=null;for(let a=0;s==null&&a<i.length;++a)s=_L(i[a],OL(o));return s}function mL(t,e){let{route:n,pathname:r,params:o}=t;return{id:n.id,pathname:r,params:o,data:e[n.id],handle:n.handle}}function FO(t,e,n,r){e===void 0&&(e=[]),n===void 0&&(n=[]),r===void 0&&(r="");let o=(i,s,a)=>{let l={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};l.relativePath.startsWith("/")&&(Be(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=xs([r,l.relativePath]),u=n.concat(l);i.children&&i.children.length>0&&(Be(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),FO(i.children,e,u,c)),!(i.path==null&&!i.index)&&e.push({path:c,score:SL(c,i.index),routesMeta:u})};return t.forEach((i,s)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))o(i,s);else for(let l of BO(i.path))o(i,s,l)}),e}function BO(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let s=BO(r.join("/")),a=[];return a.push(...s.map(l=>l===""?i:[i,l].join("/"))),o&&a.push(...s),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function gL(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:EL(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const vL=/^:[\w-]+$/,yL=3,xL=2,bL=1,wL=10,kL=-2,Dk=t=>t==="*";function SL(t,e){let n=t.split("/"),r=n.length;return n.some(Dk)&&(r+=kL),e&&(r+=xL),n.filter(o=>!Dk(o)).reduce((o,i)=>o+(vL.test(i)?yL:i===""?bL:wL),r)}function EL(t,e){return t.length===e.length&&t.slice(0,-1).every((r,o)=>r===e[o])?t[t.length-1]-e[e.length-1]:0}function _L(t,e){let{routesMeta:n}=t,r={},o="/",i=[];for(let s=0;s<n.length;++s){let a=n[s],l=s===n.length-1,c=o==="/"?e:e.slice(o.length)||"/",u=CL({path:a.relativePath,caseSensitive:a.caseSensitive,end:l},c);if(!u)return null;Object.assign(r,u.params);let d=a.route;i.push({params:r,pathname:xs([o,u.pathname]),pathnameBase:PL(xs([o,u.pathnameBase])),route:d}),u.pathnameBase!=="/"&&(o=xs([o,u.pathnameBase]))}return i}function CL(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=TL(t.path,t.caseSensitive,t.end),o=e.match(n);if(!o)return null;let i=o[0],s=i.replace(/(.)\/+$/,"$1"),a=o.slice(1);return{params:r.reduce((c,u,d)=>{let{paramName:f,isOptional:p}=u;if(f==="*"){let g=a[d]||"";s=i.slice(0,i.length-g.length).replace(/(.)\/+$/,"$1")}const m=a[d];return p&&!m?c[f]=void 0:c[f]=ML(m||"",f),c},{}),pathname:i,pathnameBase:s,pattern:t}}function TL(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),$a(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],o="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),o+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":t!==""&&t!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,e?void 0:"i"),r]}function OL(t){try{return decodeURI(t)}catch(e){return $a(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function ML(t,e){try{return decodeURIComponent(t)}catch(n){return $a(!1,'The value for the URL param "'+e+'" will not be decoded because'+(' the string "'+t+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),t}}function Tf(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function RL(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:o=""}=typeof t=="string"?_i(t):t;return{pathname:n?n.startsWith("/")?n:NL(n,e):e,search:$L(r),hash:AL(o)}}function NL(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function Sv(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function UO(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function VO(t,e){let n=UO(t);return e?n.map((r,o)=>o===t.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function HO(t,e,n,r){r===void 0&&(r=!1);let o;typeof t=="string"?o=_i(t):(o=Pt({},t),Be(!o.pathname||!o.pathname.includes("?"),Sv("?","pathname","search",o)),Be(!o.pathname||!o.pathname.includes("#"),Sv("#","pathname","hash",o)),Be(!o.search||!o.search.includes("#"),Sv("#","search","hash",o)));let i=t===""||o.pathname==="",s=i?"/":o.pathname,a;if(s==null)a=n;else{let d=e.length-1;if(!r&&s.startsWith("..")){let f=s.split("/");for(;f[0]==="..";)f.shift(),d-=1;o.pathname=f.join("/")}a=d>=0?e[d]:"/"}let l=RL(o,a),c=s&&s!=="/"&&s.endsWith("/"),u=(i||s===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const xs=t=>t.join("/").replace(/\/\/+/g,"/"),PL=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),$L=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,AL=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;class b1{constructor(e,n,r,o){o===void 0&&(o=!1),this.status=e,this.statusText=n||"",this.internal=o,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function WO(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const KO=["post","put","patch","delete"],IL=new Set(KO),DL=["get",...KO],LL=new Set(DL),jL=new Set([301,302,303,307,308]),zL=new Set([307,308]),Ev={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},FL={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},au={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},qO=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,BL=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),GO="remix-router-transitions";function UL(t){const e=t.window?t.window:typeof window<"u"?window:void 0,n=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u",r=!n;Be(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let o;if(t.mapRouteProperties)o=t.mapRouteProperties;else if(t.detectErrorBoundary){let M=t.detectErrorBoundary;o=$=>({hasErrorBoundary:M($)})}else o=BL;let i={},s=l0(t.routes,o,void 0,i),a,l=t.basename||"/",c=Pt({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1},t.future),u=null,d=new Set,f=null,p=null,m=null,g=t.hydrationData!=null,y=Vl(s,t.history.location,l),v=null;if(y==null){let M=Er(404,{pathname:t.history.location.pathname}),{matches:$,route:L}=Hk(s);y=$,v={[L.id]:M}}let x,w=y.some(M=>M.route.lazy),S=y.some(M=>M.route.loader);if(w)x=!1;else if(!S)x=!0;else if(c.v7_partialHydration){let M=t.hydrationData?t.hydrationData.loaderData:null,$=t.hydrationData?t.hydrationData.errors:null;x=y.every(L=>L.route.loader&&L.route.loader.hydrate!==!0&&(M&&M[L.route.id]!==void 0||$&&$[L.route.id]!==void 0))}else x=t.hydrationData!=null;let _,k={historyAction:t.history.action,location:t.history.location,matches:y,initialized:x,navigation:Ev,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||v,fetchers:new Map,blockers:new Map},E=Dt.Pop,C=!1,T,A=!1,B=new Map,D=null,Z=!1,U=!1,G=[],R=[],N=new Map,O=0,P=-1,I=new Map,H=new Set,le=new Map,Le=new Map,Ee=new Set,Je=new Map,Ae=new Map,ne=!1;function et(){if(u=t.history.listen(M=>{let{action:$,location:L,delta:X}=M;if(ne){ne=!1;return}$a(Ae.size===0||X!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ce=nw({currentLocation:k.location,nextLocation:L,historyAction:$});if(ce&&X!=null){ne=!0,t.history.go(X*-1),Bf(ce,{state:"blocked",location:L,proceed(){Bf(ce,{state:"proceeding",proceed:void 0,reset:void 0,location:L}),t.history.go(X)},reset(){let De=new Map(k.blockers);De.set(ce,au),Te({blockers:De})}});return}return un($,L)}),n){QL(e,B);let M=()=>e4(e,B);e.addEventListener("pagehide",M),D=()=>e.removeEventListener("pagehide",M)}return k.initialized||un(Dt.Pop,k.location,{initialHydration:!0}),_}function tt(){u&&u(),D&&D(),d.clear(),T&&T.abort(),k.fetchers.forEach((M,$)=>Ff($)),k.blockers.forEach((M,$)=>tw($))}function nt(M){return d.add(M),()=>d.delete(M)}function Te(M,$){$===void 0&&($={}),k=Pt({},k,M);let L=[],X=[];c.v7_fetcherPersist&&k.fetchers.forEach((ce,De)=>{ce.state==="idle"&&(Ee.has(De)?X.push(De):L.push(De))}),[...d].forEach(ce=>ce(k,{deletedFetchers:X,unstable_viewTransitionOpts:$.viewTransitionOpts,unstable_flushSync:$.flushSync===!0})),c.v7_fetcherPersist&&(L.forEach(ce=>k.fetchers.delete(ce)),X.forEach(ce=>Ff(ce)))}function Ke(M,$,L){var X,ce;let{flushSync:De}=L===void 0?{}:L,we=k.actionData!=null&&k.navigation.formMethod!=null&&Zr(k.navigation.formMethod)&&k.navigation.state==="loading"&&((X=M.state)==null?void 0:X._isRedirect)!==!0,be;$.actionData?Object.keys($.actionData).length>0?be=$.actionData:be=null:we?be=k.actionData:be=null;let me=$.loaderData?Vk(k.loaderData,$.loaderData,$.matches||[],$.errors):k.loaderData,He=k.blockers;He.size>0&&(He=new Map(He),He.forEach((ft,dn)=>He.set(dn,au)));let Zt=C===!0||k.navigation.formMethod!=null&&Zr(k.navigation.formMethod)&&((ce=M.state)==null?void 0:ce._isRedirect)!==!0;a&&(s=a,a=void 0),Z||E===Dt.Pop||(E===Dt.Push?t.history.push(M,M.state):E===Dt.Replace&&t.history.replace(M,M.state));let Ne;if(E===Dt.Pop){let ft=B.get(k.location.pathname);ft&&ft.has(M.pathname)?Ne={currentLocation:k.location,nextLocation:M}:B.has(M.pathname)&&(Ne={currentLocation:M,nextLocation:k.location})}else if(A){let ft=B.get(k.location.pathname);ft?ft.add(M.pathname):(ft=new Set([M.pathname]),B.set(k.location.pathname,ft)),Ne={currentLocation:k.location,nextLocation:M}}Te(Pt({},$,{actionData:be,loaderData:me,historyAction:E,location:M,initialized:!0,navigation:Ev,revalidation:"idle",restoreScrollPosition:ow(M,$.matches||k.matches),preventScrollReset:Zt,blockers:He}),{viewTransitionOpts:Ne,flushSync:De===!0}),E=Dt.Pop,C=!1,A=!1,Z=!1,U=!1,G=[],R=[]}async function bn(M,$){if(typeof M=="number"){t.history.go(M);return}let L=c0(k.location,k.matches,l,c.v7_prependBasename,M,c.v7_relativeSplatPath,$==null?void 0:$.fromRouteId,$==null?void 0:$.relative),{path:X,submission:ce,error:De}=Lk(c.v7_normalizeFormMethod,!1,L,$),we=k.location,be=Od(k.location,X,$&&$.state);be=Pt({},be,t.history.encodeLocation(be));let me=$&&$.replace!=null?$.replace:void 0,He=Dt.Push;me===!0?He=Dt.Replace:me===!1||ce!=null&&Zr(ce.formMethod)&&ce.formAction===k.location.pathname+k.location.search&&(He=Dt.Replace);let Zt=$&&"preventScrollReset"in $?$.preventScrollReset===!0:void 0,Ne=($&&$.unstable_flushSync)===!0,ft=nw({currentLocation:we,nextLocation:be,historyAction:He});if(ft){Bf(ft,{state:"blocked",location:be,proceed(){Bf(ft,{state:"proceeding",proceed:void 0,reset:void 0,location:be}),bn(M,$)},reset(){let dn=new Map(k.blockers);dn.set(ft,au),Te({blockers:dn})}});return}return await un(He,be,{submission:ce,pendingError:De,preventScrollReset:Zt,replace:$&&$.replace,enableViewTransition:$&&$.unstable_viewTransition,flushSync:Ne})}function Rn(){if(Hg(),Te({revalidation:"loading"}),k.navigation.state!=="submitting"){if(k.navigation.state==="idle"){un(k.historyAction,k.location,{startUninterruptedRevalidation:!0});return}un(E||k.historyAction,k.navigation.location,{overrideNavigation:k.navigation})}}async function un(M,$,L){T&&T.abort(),T=null,E=M,Z=(L&&L.startUninterruptedRevalidation)===!0,B$(k.location,k.matches),C=(L&&L.preventScrollReset)===!0,A=(L&&L.enableViewTransition)===!0;let X=a||s,ce=L&&L.overrideNavigation,De=Vl(X,$,l),we=(L&&L.flushSync)===!0;if(!De){let dn=Er(404,{pathname:$.pathname}),{matches:Sr,route:Jt}=Hk(X);Wg(),Ke($,{matches:Sr,loaderData:{},errors:{[Jt.id]:dn}},{flushSync:we});return}if(k.initialized&&!U&&qL(k.location,$)&&!(L&&L.submission&&Zr(L.submission.formMethod))){Ke($,{matches:De},{flushSync:we});return}T=new AbortController;let be=cu(t.history,$,T.signal,L&&L.submission),me,He;if(L&&L.pendingError)He={[nd(De).route.id]:L.pendingError};else if(L&&L.submission&&Zr(L.submission.formMethod)){let dn=await Mi(be,$,L.submission,De,{replace:L.replace,flushSync:we});if(dn.shortCircuited)return;me=dn.pendingActionData,He=dn.pendingActionError,ce=_v($,L.submission),we=!1,be=new Request(be.url,{signal:be.signal})}let{shortCircuited:Zt,loaderData:Ne,errors:ft}=await Ks(be,$,De,ce,L&&L.submission,L&&L.fetcherSubmission,L&&L.replace,L&&L.initialHydration===!0,we,me,He);Zt||(T=null,Ke($,Pt({matches:De},me?{actionData:me}:{},{loaderData:Ne,errors:ft})))}async function Mi(M,$,L,X,ce){ce===void 0&&(ce={}),Hg();let De=JL($,L);Te({navigation:De},{flushSync:ce.flushSync===!0});let we,be=d0(X,$);if(!be.route.action&&!be.route.lazy)we={type:Rt.error,error:Er(405,{method:M.method,pathname:$.pathname,routeId:be.route.id})};else if(we=await lu("action",M,be,X,i,o,l,c.v7_relativeSplatPath),M.signal.aborted)return{shortCircuited:!0};if(fa(we)){let me;return ce&&ce.replace!=null?me=ce.replace:me=we.location===k.location.pathname+k.location.search,await xo(k,we,{submission:L,replace:me}),{shortCircuited:!0}}if(Hl(we)){let me=nd(X,be.route.id);return(ce&&ce.replace)!==!0&&(E=Dt.Push),{pendingActionData:{},pendingActionError:{[me.route.id]:we.error}}}if(da(we))throw Er(400,{type:"defer-action"});return{pendingActionData:{[be.route.id]:we.data}}}async function Ks(M,$,L,X,ce,De,we,be,me,He,Zt){let Ne=X||_v($,ce),ft=ce||De||qk(Ne),dn=a||s,[Sr,Jt]=jk(t.history,k,L,ft,$,c.v7_partialHydration&&be===!0,U,G,R,Ee,le,H,dn,l,He,Zt);if(Wg(ut=>!(L&&L.some(bt=>bt.route.id===ut))||Sr&&Sr.some(bt=>bt.route.id===ut)),P=++O,Sr.length===0&&Jt.length===0){let ut=Qb();return Ke($,Pt({matches:L,loaderData:{},errors:Zt||null},He?{actionData:He}:{},ut?{fetchers:new Map(k.fetchers)}:{}),{flushSync:me}),{shortCircuited:!0}}if(!Z&&(!c.v7_partialHydration||!be)){Jt.forEach(bt=>{let bo=k.fetchers.get(bt.key),Vf=uu(void 0,bo?bo.data:void 0);k.fetchers.set(bt.key,Vf)});let ut=He||k.actionData;Te(Pt({navigation:Ne},ut?Object.keys(ut).length===0?{actionData:null}:{actionData:ut}:{},Jt.length>0?{fetchers:new Map(k.fetchers)}:{}),{flushSync:me})}Jt.forEach(ut=>{N.has(ut.key)&&Ni(ut.key),ut.controller&&N.set(ut.key,ut.controller)});let al=()=>Jt.forEach(ut=>Ni(ut.key));T&&T.signal.addEventListener("abort",al);let{results:Kg,loaderResults:ll,fetcherResults:Pi}=await Zb(k.matches,L,Sr,Jt,M);if(M.signal.aborted)return{shortCircuited:!0};T&&T.signal.removeEventListener("abort",al),Jt.forEach(ut=>N.delete(ut.key));let qs=Wk(Kg);if(qs){if(qs.idx>=Sr.length){let ut=Jt[qs.idx-Sr.length].key;H.add(ut)}return await xo(k,qs.result,{replace:we}),{shortCircuited:!0}}let{loaderData:qg,errors:Gg}=Uk(k,L,Sr,ll,Zt,Jt,Pi,Je);Je.forEach((ut,bt)=>{ut.subscribe(bo=>{(bo||ut.done)&&Je.delete(bt)})});let Yg=Qb(),cl=ew(P),Uf=Yg||cl||Jt.length>0;return Pt({loaderData:qg,errors:Gg},Uf?{fetchers:new Map(k.fetchers)}:{})}function Bg(M,$,L,X){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");N.has(M)&&Ni(M);let ce=(X&&X.unstable_flushSync)===!0,De=a||s,we=c0(k.location,k.matches,l,c.v7_prependBasename,L,c.v7_relativeSplatPath,$,X==null?void 0:X.relative),be=Vl(De,we,l);if(!be){qc(M,$,Er(404,{pathname:we}),{flushSync:ce});return}let{path:me,submission:He,error:Zt}=Lk(c.v7_normalizeFormMethod,!0,we,X);if(Zt){qc(M,$,Zt,{flushSync:ce});return}let Ne=d0(be,me);if(C=(X&&X.preventScrollReset)===!0,He&&Zr(He.formMethod)){Ug(M,$,me,Ne,be,ce,He);return}le.set(M,{routeId:$,path:me}),Vg(M,$,me,Ne,be,ce,He)}async function Ug(M,$,L,X,ce,De,we){if(Hg(),le.delete(M),!X.route.action&&!X.route.lazy){let bt=Er(405,{method:we.formMethod,pathname:L,routeId:$});qc(M,$,bt,{flushSync:De});return}let be=k.fetchers.get(M);Ri(M,XL(we,be),{flushSync:De});let me=new AbortController,He=cu(t.history,L,me.signal,we);N.set(M,me);let Zt=O,Ne=await lu("action",He,X,ce,i,o,l,c.v7_relativeSplatPath);if(He.signal.aborted){N.get(M)===me&&N.delete(M);return}if(c.v7_fetcherPersist&&Ee.has(M)){if(fa(Ne)||Hl(Ne)){Ri(M,Fi(void 0));return}}else{if(fa(Ne))if(N.delete(M),P>Zt){Ri(M,Fi(void 0));return}else return H.add(M),Ri(M,uu(we)),xo(k,Ne,{fetcherSubmission:we});if(Hl(Ne)){qc(M,$,Ne.error);return}}if(da(Ne))throw Er(400,{type:"defer-action"});let ft=k.navigation.location||k.location,dn=cu(t.history,ft,me.signal),Sr=a||s,Jt=k.navigation.state!=="idle"?Vl(Sr,k.navigation.location,l):k.matches;Be(Jt,"Didn't find any matches after fetcher action");let al=++O;I.set(M,al);let Kg=uu(we,Ne.data);k.fetchers.set(M,Kg);let[ll,Pi]=jk(t.history,k,Jt,we,ft,!1,U,G,R,Ee,le,H,Sr,l,{[X.route.id]:Ne.data},void 0);Pi.filter(bt=>bt.key!==M).forEach(bt=>{let bo=bt.key,Vf=k.fetchers.get(bo),V$=uu(void 0,Vf?Vf.data:void 0);k.fetchers.set(bo,V$),N.has(bo)&&Ni(bo),bt.controller&&N.set(bo,bt.controller)}),Te({fetchers:new Map(k.fetchers)});let qs=()=>Pi.forEach(bt=>Ni(bt.key));me.signal.addEventListener("abort",qs);let{results:qg,loaderResults:Gg,fetcherResults:Yg}=await Zb(k.matches,Jt,ll,Pi,dn);if(me.signal.aborted)return;me.signal.removeEventListener("abort",qs),I.delete(M),N.delete(M),Pi.forEach(bt=>N.delete(bt.key));let cl=Wk(qg);if(cl){if(cl.idx>=ll.length){let bt=Pi[cl.idx-ll.length].key;H.add(bt)}return xo(k,cl.result)}let{loaderData:Uf,errors:ut}=Uk(k,k.matches,ll,Gg,void 0,Pi,Yg,Je);if(k.fetchers.has(M)){let bt=Fi(Ne.data);k.fetchers.set(M,bt)}ew(al),k.navigation.state==="loading"&&al>P?(Be(E,"Expected pending action"),T&&T.abort(),Ke(k.navigation.location,{matches:Jt,loaderData:Uf,errors:ut,fetchers:new Map(k.fetchers)})):(Te({errors:ut,loaderData:Vk(k.loaderData,Uf,Jt,ut),fetchers:new Map(k.fetchers)}),U=!1)}async function Vg(M,$,L,X,ce,De,we){let be=k.fetchers.get(M);Ri(M,uu(we,be?be.data:void 0),{flushSync:De});let me=new AbortController,He=cu(t.history,L,me.signal);N.set(M,me);let Zt=O,Ne=await lu("loader",He,X,ce,i,o,l,c.v7_relativeSplatPath);if(da(Ne)&&(Ne=await JO(Ne,He.signal,!0)||Ne),N.get(M)===me&&N.delete(M),!He.signal.aborted){if(Ee.has(M)){Ri(M,Fi(void 0));return}if(fa(Ne))if(P>Zt){Ri(M,Fi(void 0));return}else{H.add(M),await xo(k,Ne);return}if(Hl(Ne)){qc(M,$,Ne.error);return}Be(!da(Ne),"Unhandled fetcher deferred data"),Ri(M,Fi(Ne.data))}}async function xo(M,$,L){let{submission:X,fetcherSubmission:ce,replace:De}=L===void 0?{}:L;$.revalidate&&(U=!0);let we=Od(M.location,$.location,{_isRedirect:!0});if(Be(we,"Expected a location on the redirect navigation"),n){let ft=!1;if($.reloadDocument)ft=!0;else if(qO.test($.location)){const dn=t.history.createURL($.location);ft=dn.origin!==e.location.origin||Tf(dn.pathname,l)==null}if(ft){De?e.location.replace($.location):e.location.assign($.location);return}}T=null;let be=De===!0?Dt.Replace:Dt.Push,{formMethod:me,formAction:He,formEncType:Zt}=M.navigation;!X&&!ce&&me&&He&&Zt&&(X=qk(M.navigation));let Ne=X||ce;if(zL.has($.status)&&Ne&&Zr(Ne.formMethod))await un(be,we,{submission:Pt({},Ne,{formAction:$.location}),preventScrollReset:C});else{let ft=_v(we,X);await un(be,we,{overrideNavigation:ft,fetcherSubmission:ce,preventScrollReset:C})}}async function Zb(M,$,L,X,ce){let De=await Promise.all([...L.map(me=>lu("loader",ce,me,$,i,o,l,c.v7_relativeSplatPath)),...X.map(me=>me.matches&&me.match&&me.controller?lu("loader",cu(t.history,me.path,me.controller.signal),me.match,me.matches,i,o,l,c.v7_relativeSplatPath):{type:Rt.error,error:Er(404,{pathname:me.path})})]),we=De.slice(0,L.length),be=De.slice(L.length);return await Promise.all([Kk(M,L,we,we.map(()=>ce.signal),!1,k.loaderData),Kk(M,X.map(me=>me.match),be,X.map(me=>me.controller?me.controller.signal:null),!0)]),{results:De,loaderResults:we,fetcherResults:be}}function Hg(){U=!0,G.push(...Wg()),le.forEach((M,$)=>{N.has($)&&(R.push($),Ni($))})}function Ri(M,$,L){L===void 0&&(L={}),k.fetchers.set(M,$),Te({fetchers:new Map(k.fetchers)},{flushSync:(L&&L.flushSync)===!0})}function qc(M,$,L,X){X===void 0&&(X={});let ce=nd(k.matches,$);Ff(M),Te({errors:{[ce.route.id]:L},fetchers:new Map(k.fetchers)},{flushSync:(X&&X.flushSync)===!0})}function Jb(M){return c.v7_fetcherPersist&&(Le.set(M,(Le.get(M)||0)+1),Ee.has(M)&&Ee.delete(M)),k.fetchers.get(M)||FL}function Ff(M){let $=k.fetchers.get(M);N.has(M)&&!($&&$.state==="loading"&&I.has(M))&&Ni(M),le.delete(M),I.delete(M),H.delete(M),Ee.delete(M),k.fetchers.delete(M)}function j$(M){if(c.v7_fetcherPersist){let $=(Le.get(M)||0)-1;$<=0?(Le.delete(M),Ee.add(M)):Le.set(M,$)}else Ff(M);Te({fetchers:new Map(k.fetchers)})}function Ni(M){let $=N.get(M);Be($,"Expected fetch controller: "+M),$.abort(),N.delete(M)}function Xb(M){for(let $ of M){let L=Jb($),X=Fi(L.data);k.fetchers.set($,X)}}function Qb(){let M=[],$=!1;for(let L of H){let X=k.fetchers.get(L);Be(X,"Expected fetcher: "+L),X.state==="loading"&&(H.delete(L),M.push(L),$=!0)}return Xb(M),$}function ew(M){let $=[];for(let[L,X]of I)if(X<M){let ce=k.fetchers.get(L);Be(ce,"Expected fetcher: "+L),ce.state==="loading"&&(Ni(L),I.delete(L),$.push(L))}return Xb($),$.length>0}function z$(M,$){let L=k.blockers.get(M)||au;return Ae.get(M)!==$&&Ae.set(M,$),L}function tw(M){k.blockers.delete(M),Ae.delete(M)}function Bf(M,$){let L=k.blockers.get(M)||au;Be(L.state==="unblocked"&&$.state==="blocked"||L.state==="blocked"&&$.state==="blocked"||L.state==="blocked"&&$.state==="proceeding"||L.state==="blocked"&&$.state==="unblocked"||L.state==="proceeding"&&$.state==="unblocked","Invalid blocker state transition: "+L.state+" -> "+$.state);let X=new Map(k.blockers);X.set(M,$),Te({blockers:X})}function nw(M){let{currentLocation:$,nextLocation:L,historyAction:X}=M;if(Ae.size===0)return;Ae.size>1&&$a(!1,"A router only supports one blocker at a time");let ce=Array.from(Ae.entries()),[De,we]=ce[ce.length-1],be=k.blockers.get(De);if(!(be&&be.state==="proceeding")&&we({currentLocation:$,nextLocation:L,historyAction:X}))return De}function Wg(M){let $=[];return Je.forEach((L,X)=>{(!M||M(X))&&(L.cancel(),$.push(X),Je.delete(X))}),$}function F$(M,$,L){if(f=M,m=$,p=L||null,!g&&k.navigation===Ev){g=!0;let X=ow(k.location,k.matches);X!=null&&Te({restoreScrollPosition:X})}return()=>{f=null,m=null,p=null}}function rw(M,$){return p&&p(M,$.map(X=>mL(X,k.loaderData)))||M.key}function B$(M,$){if(f&&m){let L=rw(M,$);f[L]=m()}}function ow(M,$){if(f){let L=rw(M,$),X=f[L];if(typeof X=="number")return X}return null}function U$(M){i={},a=l0(M,o,void 0,i)}return _={get basename(){return l},get future(){return c},get state(){return k},get routes(){return s},get window(){return e},initialize:et,subscribe:nt,enableScrollRestoration:F$,navigate:bn,fetch:Bg,revalidate:Rn,createHref:M=>t.history.createHref(M),encodeLocation:M=>t.history.encodeLocation(M),getFetcher:Jb,deleteFetcher:j$,dispose:tt,getBlocker:z$,deleteBlocker:tw,_internalFetchControllers:N,_internalActiveDeferreds:Je,_internalSetRoutes:U$},_}function VL(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function c0(t,e,n,r,o,i,s,a){let l,c;if(s){l=[];for(let d of e)if(l.push(d),d.route.id===s){c=d;break}}else l=e,c=e[e.length-1];let u=HO(o||".",VO(l,i),Tf(t.pathname,n)||t.pathname,a==="path");return o==null&&(u.search=t.search,u.hash=t.hash),(o==null||o===""||o===".")&&c&&c.route.index&&!w1(u.search)&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(u.pathname=u.pathname==="/"?n:xs([n,u.pathname])),Cf(u)}function Lk(t,e,n,r){if(!r||!VL(r))return{path:n};if(r.formMethod&&!ZL(r.formMethod))return{path:n,error:Er(405,{method:r.formMethod})};let o=()=>({path:n,error:Er(400,{type:"invalid-body"})}),i=r.formMethod||"get",s=t?i.toUpperCase():i.toLowerCase(),a=ZO(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Zr(s))return o();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((p,m)=>{let[g,y]=m;return""+p+g+"="+y+`
57
- `},""):String(r.body);return{path:n,submission:{formMethod:s,formAction:a,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!Zr(s))return o();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:s,formAction:a,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return o()}}}Be(typeof FormData=="function","FormData is not available in this environment");let l,c;if(r.formData)l=u0(r.formData),c=r.formData;else if(r.body instanceof FormData)l=u0(r.body),c=r.body;else if(r.body instanceof URLSearchParams)l=r.body,c=Bk(l);else if(r.body==null)l=new URLSearchParams,c=new FormData;else try{l=new URLSearchParams(r.body),c=Bk(l)}catch{return o()}let u={formMethod:s,formAction:a,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(Zr(u.formMethod))return{path:n,submission:u};let d=_i(n);return e&&d.search&&w1(d.search)&&l.append("index",""),d.search="?"+l,{path:Cf(d),submission:u}}function HL(t,e){let n=t;if(e){let r=t.findIndex(o=>o.route.id===e);r>=0&&(n=t.slice(0,r))}return n}function jk(t,e,n,r,o,i,s,a,l,c,u,d,f,p,m,g){let y=g?Object.values(g)[0]:m?Object.values(m)[0]:void 0,v=t.createURL(e.location),x=t.createURL(o),w=g?Object.keys(g)[0]:void 0,_=HL(n,w).filter((E,C)=>{let{route:T}=E;if(T.lazy)return!0;if(T.loader==null)return!1;if(i)return T.loader.hydrate?!0:e.loaderData[T.id]===void 0&&(!e.errors||e.errors[T.id]===void 0);if(WL(e.loaderData,e.matches[C],E)||a.some(D=>D===E.route.id))return!0;let A=e.matches[C],B=E;return zk(E,Pt({currentUrl:v,currentParams:A.params,nextUrl:x,nextParams:B.params},r,{actionResult:y,defaultShouldRevalidate:s||v.pathname+v.search===x.pathname+x.search||v.search!==x.search||YO(A,B)}))}),k=[];return u.forEach((E,C)=>{if(i||!n.some(Z=>Z.route.id===E.routeId)||c.has(C))return;let T=Vl(f,E.path,p);if(!T){k.push({key:C,routeId:E.routeId,path:E.path,matches:null,match:null,controller:null});return}let A=e.fetchers.get(C),B=d0(T,E.path),D=!1;d.has(C)?D=!1:l.includes(C)?D=!0:A&&A.state!=="idle"&&A.data===void 0?D=s:D=zk(B,Pt({currentUrl:v,currentParams:e.matches[e.matches.length-1].params,nextUrl:x,nextParams:n[n.length-1].params},r,{actionResult:y,defaultShouldRevalidate:s})),D&&k.push({key:C,routeId:E.routeId,path:E.path,matches:T,match:B,controller:new AbortController})}),[_,k]}function WL(t,e,n){let r=!e||n.route.id!==e.route.id,o=t[n.route.id]===void 0;return r||o}function YO(t,e){let n=t.route.path;return t.pathname!==e.pathname||n!=null&&n.endsWith("*")&&t.params["*"]!==e.params["*"]}function zk(t,e){if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate(e);if(typeof n=="boolean")return n}return e.defaultShouldRevalidate}async function Fk(t,e,n){if(!t.lazy)return;let r=await t.lazy();if(!t.lazy)return;let o=n[t.id];Be(o,"No route found in manifest");let i={};for(let s in r){let l=o[s]!==void 0&&s!=="hasErrorBoundary";$a(!l,'Route "'+o.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+s+'" will be ignored.')),!l&&!pL.has(s)&&(i[s]=r[s])}Object.assign(o,i),Object.assign(o,Pt({},e(o),{lazy:void 0}))}async function lu(t,e,n,r,o,i,s,a,l){l===void 0&&(l={});let c,u,d,f=g=>{let y,v=new Promise((x,w)=>y=w);return d=()=>y(),e.signal.addEventListener("abort",d),Promise.race([g({request:e,params:n.params,context:l.requestContext}),v])};try{let g=n.route[t];if(n.route.lazy)if(g){let y,v=await Promise.all([f(g).catch(x=>{y=x}),Fk(n.route,i,o)]);if(y)throw y;u=v[0]}else if(await Fk(n.route,i,o),g=n.route[t],g)u=await f(g);else if(t==="action"){let y=new URL(e.url),v=y.pathname+y.search;throw Er(405,{method:e.method,pathname:v,routeId:n.route.id})}else return{type:Rt.data,data:void 0};else if(g)u=await f(g);else{let y=new URL(e.url),v=y.pathname+y.search;throw Er(404,{pathname:v})}Be(u!==void 0,"You defined "+(t==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+t+"` ")+"function. Please return a value or `null`.")}catch(g){c=Rt.error,u=g}finally{d&&e.signal.removeEventListener("abort",d)}if(YL(u)){let g=u.status;if(jL.has(g)){let v=u.headers.get("Location");if(Be(v,"Redirects returned/thrown from loaders/actions must have a Location header"),!qO.test(v))v=c0(new URL(e.url),r.slice(0,r.indexOf(n)+1),s,!0,v,a);else if(!l.isStaticRequest){let x=new URL(e.url),w=v.startsWith("//")?new URL(x.protocol+v):new URL(v),S=Tf(w.pathname,s)!=null;w.origin===x.origin&&S&&(v=w.pathname+w.search+w.hash)}if(l.isStaticRequest)throw u.headers.set("Location",v),u;return{type:Rt.redirect,status:g,location:v,revalidate:u.headers.get("X-Remix-Revalidate")!==null,reloadDocument:u.headers.get("X-Remix-Reload-Document")!==null}}if(l.isRouteRequest)throw{type:c===Rt.error?Rt.error:Rt.data,response:u};let y;try{let v=u.headers.get("Content-Type");v&&/\bapplication\/json\b/.test(v)?u.body==null?y=null:y=await u.json():y=await u.text()}catch(v){return{type:Rt.error,error:v}}return c===Rt.error?{type:c,error:new b1(g,u.statusText,y),headers:u.headers}:{type:Rt.data,data:y,statusCode:u.status,headers:u.headers}}if(c===Rt.error)return{type:c,error:u};if(GL(u)){var p,m;return{type:Rt.deferred,deferredData:u,statusCode:(p=u.init)==null?void 0:p.status,headers:((m=u.init)==null?void 0:m.headers)&&new Headers(u.init.headers)}}return{type:Rt.data,data:u}}function cu(t,e,n,r){let o=t.createURL(ZO(e)).toString(),i={signal:n};if(r&&Zr(r.formMethod)){let{formMethod:s,formEncType:a}=r;i.method=s.toUpperCase(),a==="application/json"?(i.headers=new Headers({"Content-Type":a}),i.body=JSON.stringify(r.json)):a==="text/plain"?i.body=r.text:a==="application/x-www-form-urlencoded"&&r.formData?i.body=u0(r.formData):i.body=r.formData}return new Request(o,i)}function u0(t){let e=new URLSearchParams;for(let[n,r]of t.entries())e.append(n,typeof r=="string"?r:r.name);return e}function Bk(t){let e=new FormData;for(let[n,r]of t.entries())e.append(n,r);return e}function KL(t,e,n,r,o){let i={},s=null,a,l=!1,c={};return n.forEach((u,d)=>{let f=e[d].route.id;if(Be(!fa(u),"Cannot handle redirect results in processLoaderData"),Hl(u)){let p=nd(t,f),m=u.error;r&&(m=Object.values(r)[0],r=void 0),s=s||{},s[p.route.id]==null&&(s[p.route.id]=m),i[f]=void 0,l||(l=!0,a=WO(u.error)?u.error.status:500),u.headers&&(c[f]=u.headers)}else da(u)?(o.set(f,u.deferredData),i[f]=u.deferredData.data):i[f]=u.data,u.statusCode!=null&&u.statusCode!==200&&!l&&(a=u.statusCode),u.headers&&(c[f]=u.headers)}),r&&(s=r,i[Object.keys(r)[0]]=void 0),{loaderData:i,errors:s,statusCode:a||200,loaderHeaders:c}}function Uk(t,e,n,r,o,i,s,a){let{loaderData:l,errors:c}=KL(e,n,r,o,a);for(let u=0;u<i.length;u++){let{key:d,match:f,controller:p}=i[u];Be(s!==void 0&&s[u]!==void 0,"Did not find corresponding fetcher result");let m=s[u];if(!(p&&p.signal.aborted))if(Hl(m)){let g=nd(t.matches,f==null?void 0:f.route.id);c&&c[g.route.id]||(c=Pt({},c,{[g.route.id]:m.error})),t.fetchers.delete(d)}else if(fa(m))Be(!1,"Unhandled fetcher revalidation redirect");else if(da(m))Be(!1,"Unhandled fetcher deferred data");else{let g=Fi(m.data);t.fetchers.set(d,g)}}return{loaderData:l,errors:c}}function Vk(t,e,n,r){let o=Pt({},e);for(let i of n){let s=i.route.id;if(e.hasOwnProperty(s)?e[s]!==void 0&&(o[s]=e[s]):t[s]!==void 0&&i.route.loader&&(o[s]=t[s]),r&&r.hasOwnProperty(s))break}return o}function nd(t,e){return(e?t.slice(0,t.findIndex(r=>r.route.id===e)+1):[...t]).reverse().find(r=>r.route.hasErrorBoundary===!0)||t[0]}function Hk(t){let e=t.length===1?t[0]:t.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function Er(t,e){let{pathname:n,routeId:r,method:o,type:i}=e===void 0?{}:e,s="Unknown Server Error",a="Unknown @remix-run/router error";return t===400?(s="Bad Request",o&&n&&r?a="You made a "+o+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":i==="defer-action"?a="defer() is not supported in actions":i==="invalid-body"&&(a="Unable to encode submission body")):t===403?(s="Forbidden",a='Route "'+r+'" does not match URL "'+n+'"'):t===404?(s="Not Found",a='No route matches URL "'+n+'"'):t===405&&(s="Method Not Allowed",o&&n&&r?a="You made a "+o.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":o&&(a='Invalid request method "'+o.toUpperCase()+'"')),new b1(t||500,s,new Error(a),!0)}function Wk(t){for(let e=t.length-1;e>=0;e--){let n=t[e];if(fa(n))return{result:n,idx:e}}}function ZO(t){let e=typeof t=="string"?_i(t):t;return Cf(Pt({},e,{hash:""}))}function qL(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function da(t){return t.type===Rt.deferred}function Hl(t){return t.type===Rt.error}function fa(t){return(t&&t.type)===Rt.redirect}function GL(t){let e=t;return e&&typeof e=="object"&&typeof e.data=="object"&&typeof e.subscribe=="function"&&typeof e.cancel=="function"&&typeof e.resolveData=="function"}function YL(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function ZL(t){return LL.has(t.toLowerCase())}function Zr(t){return IL.has(t.toLowerCase())}async function Kk(t,e,n,r,o,i){for(let s=0;s<n.length;s++){let a=n[s],l=e[s];if(!l)continue;let c=t.find(d=>d.route.id===l.route.id),u=c!=null&&!YO(c,l)&&(i&&i[l.route.id])!==void 0;if(da(a)&&(o||u)){let d=r[s];Be(d,"Expected an AbortSignal for revalidating fetcher deferred result"),await JO(a,d,o).then(f=>{f&&(n[s]=f||n[s])})}}}async function JO(t,e,n){if(n===void 0&&(n=!1),!await t.deferredData.resolveData(e)){if(n)try{return{type:Rt.data,data:t.deferredData.unwrappedData}}catch(o){return{type:Rt.error,error:o}}return{type:Rt.data,data:t.deferredData.data}}}function w1(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function d0(t,e){let n=typeof e=="string"?_i(e).search:e.search;if(t[t.length-1].route.index&&w1(n||""))return t[t.length-1];let r=UO(t);return r[r.length-1]}function qk(t){let{formMethod:e,formAction:n,formEncType:r,text:o,formData:i,json:s}=t;if(!(!e||!n||!r)){if(o!=null)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o};if(i!=null)return{formMethod:e,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(s!==void 0)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:s,text:void 0}}}function _v(t,e){return e?{state:"loading",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function JL(t,e){return{state:"submitting",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function uu(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function XL(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function Fi(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function QL(t,e){try{let n=t.sessionStorage.getItem(GO);if(n){let r=JSON.parse(n);for(let[o,i]of Object.entries(r||{}))i&&Array.isArray(i)&&e.set(o,new Set(i||[]))}}catch{}}function e4(t,e){if(e.size>0){let n={};for(let[r,o]of e)n[r]=[...o];try{t.sessionStorage.setItem(GO,JSON.stringify(n))}catch(r){$a(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
58
- * React Router v6.21.2
59
- *
60
- * Copyright (c) Remix Software Inc.
61
- *
62
- * This source code is licensed under the MIT license found in the
63
- * LICENSE.md file in the root directory of this source tree.
64
- *
65
- * @license MIT
66
- */function Md(){return Md=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Md.apply(this,arguments)}const Jm=h.createContext(null),XO=h.createContext(null),Xm=h.createContext(null),Qm=h.createContext(null),Ja=h.createContext({outlet:null,matches:[],isDataRoute:!1}),QO=h.createContext(null);function eg(){return h.useContext(Qm)!=null}function e2(){return eg()||Be(!1),h.useContext(Qm).location}function t2(t){h.useContext(Xm).static||h.useLayoutEffect(t)}function k1(){let{isDataRoute:t}=h.useContext(Ja);return t?p4():t4()}function t4(){eg()||Be(!1);let t=h.useContext(Jm),{basename:e,future:n,navigator:r}=h.useContext(Xm),{matches:o}=h.useContext(Ja),{pathname:i}=e2(),s=JSON.stringify(VO(o,n.v7_relativeSplatPath)),a=h.useRef(!1);return t2(()=>{a.current=!0}),h.useCallback(function(c,u){if(u===void 0&&(u={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let d=HO(c,JSON.parse(s),i,u.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:xs([e,d.pathname])),(u.replace?r.replace:r.push)(d,u.state,u)},[e,r,s,i,t])}function n4(){let{matches:t}=h.useContext(Ja),e=t[t.length-1];return e?e.params:{}}function r4(t,e,n,r){eg()||Be(!1);let{navigator:o}=h.useContext(Xm),{matches:i}=h.useContext(Ja),s=i[i.length-1],a=s?s.params:{};s&&s.pathname;let l=s?s.pathnameBase:"/";s&&s.route;let c=e2(),u;if(e){var d;let y=typeof e=="string"?_i(e):e;l==="/"||(d=y.pathname)!=null&&d.startsWith(l)||Be(!1),u=y}else u=c;let f=u.pathname||"/",p=l==="/"?f:f.slice(l.length)||"/",m=Vl(t,{pathname:p}),g=l4(m&&m.map(y=>Object.assign({},y,{params:Object.assign({},a,y.params),pathname:xs([l,o.encodeLocation?o.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:xs([l,o.encodeLocation?o.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),i,n,r);return e&&g?h.createElement(Qm.Provider,{value:{location:Md({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:Dt.Pop}},g):g}function o4(){let t=f4(),e=WO(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},e),n?h.createElement("pre",{style:o},n):null,null)}const i4=h.createElement(o4,null);class s4 extends h.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?h.createElement(Ja.Provider,{value:this.props.routeContext},h.createElement(QO.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function a4(t){let{routeContext:e,match:n,children:r}=t,o=h.useContext(Jm);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),h.createElement(Ja.Provider,{value:e},r)}function l4(t,e,n,r){var o;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var i;if((i=n)!=null&&i.errors)t=n.matches;else return null}let s=t,a=(o=n)==null?void 0:o.errors;if(a!=null){let u=s.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id]));u>=0||Be(!1),s=s.slice(0,Math.min(s.length,u+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u<s.length;u++){let d=s[u];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(c=u),d.route.id){let{loaderData:f,errors:p}=n,m=d.route.loader&&f[d.route.id]===void 0&&(!p||p[d.route.id]===void 0);if(d.route.lazy||m){l=!0,c>=0?s=s.slice(0,c+1):s=[s[0]];break}}}return s.reduceRight((u,d,f)=>{let p,m=!1,g=null,y=null;n&&(p=a&&d.route.id?a[d.route.id]:void 0,g=d.route.errorElement||i4,l&&(c<0&&f===0?(h4("route-fallback",!1),m=!0,y=null):c===f&&(m=!0,y=d.route.hydrateFallbackElement||null)));let v=e.concat(s.slice(0,f+1)),x=()=>{let w;return p?w=g:m?w=y:d.route.Component?w=h.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=u,h.createElement(a4,{match:d,routeContext:{outlet:u,matches:v,isDataRoute:n!=null},children:w})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?h.createElement(s4,{location:n.location,revalidation:n.revalidation,component:g,error:p,children:x(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):x()},null)}var n2=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(n2||{}),Mh=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(Mh||{});function c4(t){let e=h.useContext(Jm);return e||Be(!1),e}function u4(t){let e=h.useContext(XO);return e||Be(!1),e}function d4(t){let e=h.useContext(Ja);return e||Be(!1),e}function r2(t){let e=d4(),n=e.matches[e.matches.length-1];return n.route.id||Be(!1),n.route.id}function f4(){var t;let e=h.useContext(QO),n=u4(Mh.UseRouteError),r=r2(Mh.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function p4(){let{router:t}=c4(n2.UseNavigateStable),e=r2(Mh.UseNavigateStable),n=h.useRef(!1);return t2(()=>{n.current=!0}),h.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?t.navigate(o):t.navigate(o,Md({fromRouteId:e},i)))},[t,e])}const Gk={};function h4(t,e,n){!e&&!Gk[t]&&(Gk[t]=!0)}function m4(t){let{basename:e="/",children:n=null,location:r,navigationType:o=Dt.Pop,navigator:i,static:s=!1,future:a}=t;eg()&&Be(!1);let l=e.replace(/^\/*/,"/"),c=h.useMemo(()=>({basename:l,navigator:i,static:s,future:Md({v7_relativeSplatPath:!1},a)}),[l,a,i,s]);typeof r=="string"&&(r=_i(r));let{pathname:u="/",search:d="",hash:f="",state:p=null,key:m="default"}=r,g=h.useMemo(()=>{let y=Tf(u,l);return y==null?null:{location:{pathname:y,search:d,hash:f,state:p,key:m},navigationType:o}},[l,u,d,f,p,m,o]);return g==null?null:h.createElement(Xm.Provider,{value:c},h.createElement(Qm.Provider,{children:n,value:g}))}new Promise(()=>{});function g4(t){let e={hasErrorBoundary:t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&Object.assign(e,{element:h.createElement(t.Component),Component:void 0}),t.HydrateFallback&&Object.assign(e,{hydrateFallbackElement:h.createElement(t.HydrateFallback),HydrateFallback:void 0}),t.ErrorBoundary&&Object.assign(e,{errorElement:h.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),e}function v4(t="dark"){const[e,n]=h.useState(t);return h.useEffect(()=>{localStorage.getItem("val-theme")==="light"?n("light"):localStorage.getItem("val-theme")==="dark"||window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?n("dark"):window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches&&n("light");const r=o=>{localStorage.getItem("val-theme")||n(o.matches?"dark":"light")};return window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",r),()=>{window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",r)}},[]),[e,r=>{localStorage.setItem("val-theme",r),n(r)}]}function Ao({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,o]=y4({defaultProp:e,onChange:n}),i=t!==void 0,s=i?t:r,a=rn(n),l=h.useCallback(c=>{if(i){const d=typeof c=="function"?c(t):c;d!==t&&a(d)}else o(c)},[i,t,o,a]);return[s,l]}function y4({defaultProp:t,onChange:e}){const n=h.useState(t),[r]=n,o=h.useRef(r),i=rn(e);return h.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}function o2(t){const e=h.useRef({value:t,previous:t});return h.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function i2(t){const[e,n]=h.useState(void 0);return hr(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=t.offsetWidth,a=t.offsetHeight;n({width:s,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}const s2="Switch",[x4,qoe]=Lr(s2),[b4,w4]=x4(s2),k4=h.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,...u}=t,[d,f]=h.useState(null),p=We(e,x=>f(x)),m=h.useRef(!1),g=d?!!d.closest("form"):!0,[y=!1,v]=Ao({prop:o,defaultProp:i,onChange:c});return h.createElement(b4,{scope:n,checked:y,disabled:a},h.createElement(Re.button,z({type:"button",role:"switch","aria-checked":y,"aria-required":s,"data-state":l2(y),"data-disabled":a?"":void 0,disabled:a,value:l},u,{ref:p,onClick:se(t.onClick,x=>{v(w=>!w),g&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})})),g&&h.createElement(E4,{control:d,bubbles:!m.current,name:r,value:l,checked:y,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),S4="SwitchThumb",a2=h.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,o=w4(S4,n);return h.createElement(Re.span,z({"data-state":l2(o.checked),"data-disabled":o.disabled?"":void 0},r,{ref:e}))}),E4=t=>{const{control:e,checked:n,bubbles:r=!0,...o}=t,i=h.useRef(null),s=o2(n),a=i2(e);return h.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&d){const f=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(f)}},[s,n,r]),h.createElement("input",z({type:"checkbox","aria-hidden":!0,defaultChecked:n},o,{tabIndex:-1,ref:i,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function l2(t){return t?"checked":"unchecked"}const S1=k4,_4=a2;function C4(t,e=globalThis==null?void 0:globalThis.document){const n=rn(t);h.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return e.addEventListener("keydown",r),()=>e.removeEventListener("keydown",r)},[n,e])}const f0="dismissableLayer.update",T4="dismissableLayer.pointerDownOutside",O4="dismissableLayer.focusOutside";let Yk;const M4=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),tg=h.forwardRef((t,e)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:l,...c}=t,u=h.useContext(M4),[d,f]=h.useState(null),p=(n=d==null?void 0:d.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,m]=h.useState({}),g=We(e,C=>f(C)),y=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=y.indexOf(v),w=d?y.indexOf(d):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,_=w>=x,k=R4(C=>{const T=C.target,A=[...u.branches].some(B=>B.contains(T));!_||A||(i==null||i(C),a==null||a(C),C.defaultPrevented||l==null||l())},p),E=N4(C=>{const T=C.target;[...u.branches].some(B=>B.contains(T))||(s==null||s(C),a==null||a(C),C.defaultPrevented||l==null||l())},p);return C4(C=>{w===u.layers.size-1&&(o==null||o(C),!C.defaultPrevented&&l&&(C.preventDefault(),l()))},p),h.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Yk=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Zk(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Yk)}},[d,p,r,u]),h.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Zk())},[d,u]),h.useEffect(()=>{const C=()=>m({});return document.addEventListener(f0,C),()=>document.removeEventListener(f0,C)},[]),h.createElement(Re.div,z({},c,{ref:g,style:{pointerEvents:S?_?"auto":"none":void 0,...t.style},onFocusCapture:se(t.onFocusCapture,E.onFocusCapture),onBlurCapture:se(t.onBlurCapture,E.onBlurCapture),onPointerDownCapture:se(t.onPointerDownCapture,k.onPointerDownCapture)}))});function R4(t,e=globalThis==null?void 0:globalThis.document){const n=rn(t),r=h.useRef(!1),o=h.useRef(()=>{});return h.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let u=function(){c2(T4,n,c,{discrete:!0})};var l=u;const c={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",o.current),o.current=u,e.addEventListener("click",o.current,{once:!0})):u()}else e.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),e.removeEventListener("pointerdown",i),e.removeEventListener("click",o.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function N4(t,e=globalThis==null?void 0:globalThis.document){const n=rn(t),r=h.useRef(!1);return h.useEffect(()=>{const o=i=>{i.target&&!r.current&&c2(O4,n,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Zk(){const t=new CustomEvent(f0);document.dispatchEvent(t)}function c2(t,e,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?vO(o,i):o.dispatchEvent(i)}let Cv=0;function ng(){h.useEffect(()=>{var t,e;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(t=n[0])!==null&&t!==void 0?t:Jk()),document.body.insertAdjacentElement("beforeend",(e=n[1])!==null&&e!==void 0?e:Jk()),Cv++,()=>{Cv===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Cv--}},[])}function Jk(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}const Tv="focusScope.autoFocusOnMount",Ov="focusScope.autoFocusOnUnmount",Xk={bubbles:!1,cancelable:!0},rg=h.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=t,[a,l]=h.useState(null),c=rn(o),u=rn(i),d=h.useRef(null),f=We(e,g=>l(g)),p=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(r){let x=function(k){if(p.paused||!a)return;const E=k.target;a.contains(E)?d.current=E:Bi(d.current,{select:!0})},w=function(k){if(p.paused||!a)return;const E=k.relatedTarget;E!==null&&(a.contains(E)||Bi(d.current,{select:!0}))},S=function(k){if(document.activeElement===document.body)for(const C of k)C.removedNodes.length>0&&Bi(a)};var g=x,y=w,v=S;document.addEventListener("focusin",x),document.addEventListener("focusout",w);const _=new MutationObserver(S);return a&&_.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",w),_.disconnect()}}},[r,a,p.paused]),h.useEffect(()=>{if(a){eS.add(p);const g=document.activeElement;if(!a.contains(g)){const v=new CustomEvent(Tv,Xk);a.addEventListener(Tv,c),a.dispatchEvent(v),v.defaultPrevented||(P4(L4(u2(a)),{select:!0}),document.activeElement===g&&Bi(a))}return()=>{a.removeEventListener(Tv,c),setTimeout(()=>{const v=new CustomEvent(Ov,Xk);a.addEventListener(Ov,u),a.dispatchEvent(v),v.defaultPrevented||Bi(g??document.body,{select:!0}),a.removeEventListener(Ov,u),eS.remove(p)},0)}}},[a,c,u,p]);const m=h.useCallback(g=>{if(!n&&!r||p.paused)return;const y=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,v=document.activeElement;if(y&&v){const x=g.currentTarget,[w,S]=$4(x);w&&S?!g.shiftKey&&v===S?(g.preventDefault(),n&&Bi(w,{select:!0})):g.shiftKey&&v===w&&(g.preventDefault(),n&&Bi(S,{select:!0})):v===x&&g.preventDefault()}},[n,r,p.paused]);return h.createElement(Re.div,z({tabIndex:-1},s,{ref:f,onKeyDown:m}))});function P4(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Bi(r,{select:e}),document.activeElement!==n)return}function $4(t){const e=u2(t),n=Qk(e,t),r=Qk(e.reverse(),t);return[n,r]}function u2(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Qk(t,e){for(const n of t)if(!A4(n,{upTo:e}))return n}function A4(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function I4(t){return t instanceof HTMLInputElement&&"select"in t}function Bi(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&I4(t)&&e&&t.select()}}const eS=D4();function D4(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=tS(t,e),t.unshift(e)},remove(e){var n;t=tS(t,e),(n=t[0])===null||n===void 0||n.resume()}}}function tS(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function L4(t){return t.filter(e=>e.tagName!=="A")}const j4=K_.useId||(()=>{});let z4=0;function ao(t){const[e,n]=h.useState(j4());return hr(()=>{t||n(r=>r??String(z4++))},[t]),t||(e?`radix-${e}`:"")}const F4=["top","right","bottom","left"],Ts=Math.min,ar=Math.max,Rh=Math.round,dp=Math.floor,Os=t=>({x:t,y:t}),B4={left:"right",right:"left",bottom:"top",top:"bottom"},U4={start:"end",end:"start"};function p0(t,e,n){return ar(t,Ts(e,n))}function gi(t,e){return typeof t=="function"?t(e):t}function vi(t){return t.split("-")[0]}function Dc(t){return t.split("-")[1]}function E1(t){return t==="x"?"y":"x"}function _1(t){return t==="y"?"height":"width"}function Lc(t){return["top","bottom"].includes(vi(t))?"y":"x"}function C1(t){return E1(Lc(t))}function V4(t,e,n){n===void 0&&(n=!1);const r=Dc(t),o=C1(t),i=_1(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=Nh(s)),[s,Nh(s)]}function H4(t){const e=Nh(t);return[h0(t),e,h0(e)]}function h0(t){return t.replace(/start|end/g,e=>U4[e])}function W4(t,e,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?o:r:e?r:o;case"left":case"right":return e?i:s;default:return[]}}function K4(t,e,n,r){const o=Dc(t);let i=W4(vi(t),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),e&&(i=i.concat(i.map(h0)))),i}function Nh(t){return t.replace(/left|right|bottom|top/g,e=>B4[e])}function q4(t){return{top:0,right:0,bottom:0,left:0,...t}}function d2(t){return typeof t!="number"?q4(t):{top:t,right:t,bottom:t,left:t}}function Ph(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function nS(t,e,n){let{reference:r,floating:o}=t;const i=Lc(e),s=C1(e),a=_1(s),l=vi(e),c=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Dc(e)){case"start":p[s]-=f*(n&&c?-1:1);break;case"end":p[s]+=f*(n&&c?-1:1);break}return p}const G4=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:o}),{x:u,y:d}=nS(c,r,l),f=r,p={},m=0;for(let g=0;g<a.length;g++){const{name:y,fn:v}=a[g],{x,y:w,data:S,reset:_}=await v({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:p,rects:c,platform:s,elements:{reference:t,floating:e}});if(u=x??u,d=w??d,p={...p,[y]:{...p[y],...S}},_&&m<=50){m++,typeof _=="object"&&(_.placement&&(f=_.placement),_.rects&&(c=_.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:o}):_.rects),{x:u,y:d}=nS(c,f,l)),g=-1;continue}}return{x:u,y:d,placement:f,strategy:o,middlewareData:p}};async function Rd(t,e){var n;e===void 0&&(e={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=gi(e,t),m=d2(p),y=a[f?d==="floating"?"reference":"floating":d],v=Ph(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),x=d==="floating"?{...s.floating,x:r,y:o}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},_=Ph(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:x,offsetParent:w,strategy:l}):x);return{top:(v.top-_.top+m.top)/S.y,bottom:(_.bottom-v.bottom+m.bottom)/S.y,left:(v.left-_.left+m.left)/S.x,right:(_.right-v.right+m.right)/S.x}}const Y4=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=e,{element:c,padding:u=0}=gi(t,e)||{};if(c==null)return{};const d=d2(u),f={x:n,y:r},p=C1(o),m=_1(p),g=await s.getDimensions(c),y=p==="y",v=y?"top":"left",x=y?"bottom":"right",w=y?"clientHeight":"clientWidth",S=i.reference[m]+i.reference[p]-f[p]-i.floating[m],_=f[p]-i.reference[p],k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let E=k?k[w]:0;(!E||!await(s.isElement==null?void 0:s.isElement(k)))&&(E=a.floating[w]||i.floating[m]);const C=S/2-_/2,T=E/2-g[m]/2-1,A=Ts(d[v],T),B=Ts(d[x],T),D=A,Z=E-g[m]-B,U=E/2-g[m]/2+C,G=p0(D,U,Z),R=!l.arrow&&Dc(o)!=null&&U!=G&&i.reference[m]/2-(U<D?A:B)-g[m]/2<0,N=R?U<D?U-D:U-Z:0;return{[p]:f[p]+N,data:{[p]:G,centerOffset:U-G-N,...R&&{alignmentOffset:N}},reset:R}}}),Z4=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=gi(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=vi(o),x=vi(a)===a,w=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=f||(x||!g?[Nh(a)]:H4(a));!f&&m!=="none"&&S.push(...K4(a,g,m,w));const _=[a,...S],k=await Rd(e,y),E=[];let C=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&E.push(k[v]),d){const D=V4(o,s,w);E.push(k[D[0]],k[D[1]])}if(C=[...C,{placement:o,overflows:E}],!E.every(D=>D<=0)){var T,A;const D=(((T=i.flip)==null?void 0:T.index)||0)+1,Z=_[D];if(Z)return{data:{index:D,overflows:C},reset:{placement:Z}};let U=(A=C.filter(G=>G.overflows[0]<=0).sort((G,R)=>G.overflows[1]-R.overflows[1])[0])==null?void 0:A.placement;if(!U)switch(p){case"bestFit":{var B;const G=(B=C.map(R=>[R.placement,R.overflows.filter(N=>N>0).reduce((N,O)=>N+O,0)]).sort((R,N)=>R[1]-N[1])[0])==null?void 0:B[0];G&&(U=G);break}case"initialPlacement":U=a;break}if(o!==U)return{reset:{placement:U}}}return{}}}};function rS(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function oS(t){return F4.some(e=>t[e]>=0)}const J4=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...o}=gi(t,e);switch(r){case"referenceHidden":{const i=await Rd(e,{...o,elementContext:"reference"}),s=rS(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:oS(s)}}}case"escaped":{const i=await Rd(e,{...o,altBoundary:!0}),s=rS(i,n.floating);return{data:{escapedOffsets:s,escaped:oS(s)}}}default:return{}}}}};async function X4(t,e){const{placement:n,platform:r,elements:o}=t,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=vi(n),a=Dc(n),l=Lc(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=gi(e,t);let{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof m=="number"&&(p=a==="end"?m*-1:m),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}const Q4=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=e,l=await X4(e,t);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},e6=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:o}=e,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:y=>{let{x:v,y:x}=y;return{x:v,y:x}}},...l}=gi(t,e),c={x:n,y:r},u=await Rd(e,l),d=Lc(vi(o)),f=E1(d);let p=c[f],m=c[d];if(i){const y=f==="y"?"top":"left",v=f==="y"?"bottom":"right",x=p+u[y],w=p-u[v];p=p0(x,p,w)}if(s){const y=d==="y"?"top":"left",v=d==="y"?"bottom":"right",x=m+u[y],w=m-u[v];m=p0(x,m,w)}const g=a.fn({...e,[f]:p,[d]:m});return{...g,data:{x:g.x-n,y:g.y-r}}}}},t6=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=e,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=gi(t,e),u={x:n,y:r},d=Lc(o),f=E1(d);let p=u[f],m=u[d];const g=gi(a,e),y=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const w=f==="y"?"height":"width",S=i.reference[f]-i.floating[w]+y.mainAxis,_=i.reference[f]+i.reference[w]-y.mainAxis;p<S?p=S:p>_&&(p=_)}if(c){var v,x;const w=f==="y"?"width":"height",S=["top","left"].includes(vi(o)),_=i.reference[d]-i.floating[w]+(S&&((v=s.offset)==null?void 0:v[d])||0)+(S?0:y.crossAxis),k=i.reference[d]+i.reference[w]+(S?0:((x=s.offset)==null?void 0:x[d])||0)-(S?y.crossAxis:0);m<_?m=_:m>k&&(m=k)}return{[f]:p,[d]:m}}}},n6=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:o,elements:i}=e,{apply:s=()=>{},...a}=gi(t,e),l=await Rd(e,a),c=vi(n),u=Dc(n),d=Lc(n)==="y",{width:f,height:p}=r.floating;let m,g;c==="top"||c==="bottom"?(m=c,g=u===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(g=c,m=u==="end"?"top":"bottom");const y=p-l[m],v=f-l[g],x=!e.middlewareData.shift;let w=y,S=v;if(d){const k=f-l.left-l.right;S=u||x?Ts(v,k):k}else{const k=p-l.top-l.bottom;w=u||x?Ts(y,k):k}if(x&&!u){const k=ar(l.left,0),E=ar(l.right,0),C=ar(l.top,0),T=ar(l.bottom,0);d?S=f-2*(k!==0||E!==0?k+E:ar(l.left,l.right)):w=p-2*(C!==0||T!==0?C+T:ar(l.top,l.bottom))}await s({...e,availableWidth:S,availableHeight:w});const _=await o.getDimensions(i.floating);return f!==_.width||p!==_.height?{reset:{rects:!0}}:{}}}};function Ms(t){return f2(t)?(t.nodeName||"").toLowerCase():"#document"}function fr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Ci(t){var e;return(e=(f2(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function f2(t){return t instanceof Node||t instanceof fr(t).Node}function yi(t){return t instanceof Element||t instanceof fr(t).Element}function Io(t){return t instanceof HTMLElement||t instanceof fr(t).HTMLElement}function iS(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof fr(t).ShadowRoot}function Of(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=Ar(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(o)}function r6(t){return["table","td","th"].includes(Ms(t))}function T1(t){const e=O1(),n=Ar(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function o6(t){let e=hc(t);for(;Io(e)&&!og(e);){if(T1(e))return e;e=hc(e)}return null}function O1(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function og(t){return["html","body","#document"].includes(Ms(t))}function Ar(t){return fr(t).getComputedStyle(t)}function ig(t){return yi(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function hc(t){if(Ms(t)==="html")return t;const e=t.assignedSlot||t.parentNode||iS(t)&&t.host||Ci(t);return iS(e)?e.host:e}function p2(t){const e=hc(t);return og(e)?t.ownerDocument?t.ownerDocument.body:t.body:Io(e)&&Of(e)?e:p2(e)}function Nd(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const o=p2(t),i=o===((r=t.ownerDocument)==null?void 0:r.body),s=fr(o);return i?e.concat(s,s.visualViewport||[],Of(o)?o:[],s.frameElement&&n?Nd(s.frameElement):[]):e.concat(o,Nd(o,[],n))}function h2(t){const e=Ar(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=Io(t),i=o?t.offsetWidth:n,s=o?t.offsetHeight:r,a=Rh(n)!==i||Rh(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function M1(t){return yi(t)?t:t.contextElement}function Xl(t){const e=M1(t);if(!Io(e))return Os(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:i}=h2(e);let s=(i?Rh(n.width):n.width)/r,a=(i?Rh(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const i6=Os(0);function m2(t){const e=fr(t);return!O1()||!e.visualViewport?i6:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function s6(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==fr(t)?!1:e}function Aa(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),i=M1(t);let s=Os(1);e&&(r?yi(r)&&(s=Xl(r)):s=Xl(t));const a=s6(i,n,r)?m2(i):Os(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const f=fr(i),p=r&&yi(r)?fr(r):r;let m=f.frameElement;for(;m&&r&&p!==f;){const g=Xl(m),y=m.getBoundingClientRect(),v=Ar(m),x=y.left+(m.clientLeft+parseFloat(v.paddingLeft))*g.x,w=y.top+(m.clientTop+parseFloat(v.paddingTop))*g.y;l*=g.x,c*=g.y,u*=g.x,d*=g.y,l+=x,c+=w,m=fr(m).frameElement}}return Ph({width:u,height:d,x:l,y:c})}function a6(t){let{rect:e,offsetParent:n,strategy:r}=t;const o=Io(n),i=Ci(n);if(n===i)return e;let s={scrollLeft:0,scrollTop:0},a=Os(1);const l=Os(0);if((o||!o&&r!=="fixed")&&((Ms(n)!=="body"||Of(i))&&(s=ig(n)),Io(n))){const c=Aa(n);a=Xl(n),l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{width:e.width*a.x,height:e.height*a.y,x:e.x*a.x-s.scrollLeft*a.x+l.x,y:e.y*a.y-s.scrollTop*a.y+l.y}}function l6(t){return Array.from(t.getClientRects())}function g2(t){return Aa(Ci(t)).left+ig(t).scrollLeft}function c6(t){const e=Ci(t),n=ig(t),r=t.ownerDocument.body,o=ar(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=ar(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+g2(t);const a=-n.scrollTop;return Ar(r).direction==="rtl"&&(s+=ar(e.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function u6(t,e){const n=fr(t),r=Ci(t),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=O1();(!c||c&&e==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function d6(t,e){const n=Aa(t,!0,e==="fixed"),r=n.top+t.clientTop,o=n.left+t.clientLeft,i=Io(t)?Xl(t):Os(1),s=t.clientWidth*i.x,a=t.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function sS(t,e,n){let r;if(e==="viewport")r=u6(t,n);else if(e==="document")r=c6(Ci(t));else if(yi(e))r=d6(e,n);else{const o=m2(t);r={...e,x:e.x-o.x,y:e.y-o.y}}return Ph(r)}function v2(t,e){const n=hc(t);return n===e||!yi(n)||og(n)?!1:Ar(n).position==="fixed"||v2(n,e)}function f6(t,e){const n=e.get(t);if(n)return n;let r=Nd(t,[],!1).filter(a=>yi(a)&&Ms(a)!=="body"),o=null;const i=Ar(t).position==="fixed";let s=i?hc(t):t;for(;yi(s)&&!og(s);){const a=Ar(s),l=T1(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Of(s)&&!l&&v2(t,s))?r=r.filter(u=>u!==s):o=a,s=hc(s)}return e.set(t,r),r}function p6(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const s=[...n==="clippingAncestors"?f6(e,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const d=sS(e,u,o);return c.top=ar(d.top,c.top),c.right=Ts(d.right,c.right),c.bottom=Ts(d.bottom,c.bottom),c.left=ar(d.left,c.left),c},sS(e,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function h6(t){const{width:e,height:n}=h2(t);return{width:e,height:n}}function m6(t,e,n){const r=Io(e),o=Ci(e),i=n==="fixed",s=Aa(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const l=Os(0);if(r||!r&&!i)if((Ms(e)!=="body"||Of(o))&&(a=ig(e)),r){const c=Aa(e,!0,i,e);l.x=c.x+e.clientLeft,l.y=c.y+e.clientTop}else o&&(l.x=g2(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function aS(t,e){return!Io(t)||Ar(t).position==="fixed"?null:e?e(t):t.offsetParent}function y2(t,e){const n=fr(t);if(!Io(t))return n;let r=aS(t,e);for(;r&&r6(r)&&Ar(r).position==="static";)r=aS(r,e);return r&&(Ms(r)==="html"||Ms(r)==="body"&&Ar(r).position==="static"&&!T1(r))?n:r||o6(t)||n}const g6=async function(t){let{reference:e,floating:n,strategy:r}=t;const o=this.getOffsetParent||y2,i=this.getDimensions;return{reference:m6(e,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function v6(t){return Ar(t).direction==="rtl"}const y6={convertOffsetParentRelativeRectToViewportRelativeRect:a6,getDocumentElement:Ci,getClippingRect:p6,getOffsetParent:y2,getElementRects:g6,getClientRects:l6,getDimensions:h6,getScale:Xl,isElement:yi,isRTL:v6};function x6(t,e){let n=null,r;const o=Ci(t);function i(){clearTimeout(r),n&&n.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const{left:c,top:u,width:d,height:f}=t.getBoundingClientRect();if(a||e(),!d||!f)return;const p=dp(u),m=dp(o.clientWidth-(c+d)),g=dp(o.clientHeight-(u+f)),y=dp(c),x={rootMargin:-p+"px "+-m+"px "+-g+"px "+-y+"px",threshold:ar(0,Ts(1,l))||1};let w=!0;function S(_){const k=_[0].intersectionRatio;if(k!==l){if(!w)return s();k?s(!1,k):r=setTimeout(()=>{s(!1,1e-7)},100)}w=!1}try{n=new IntersectionObserver(S,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(S,x)}n.observe(t)}return s(!0),i}function b6(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=M1(t),u=o||i?[...c?Nd(c):[],...Nd(e)]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const d=c&&a?x6(c,n):null;let f=-1,p=null;s&&(p=new ResizeObserver(v=>{let[x]=v;x&&x.target===c&&p&&(p.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{p&&p.observe(e)})),n()}),c&&!l&&p.observe(c),p.observe(e));let m,g=l?Aa(t):null;l&&y();function y(){const v=Aa(t);g&&(v.x!==g.x||v.y!==g.y||v.width!==g.width||v.height!==g.height)&&n(),g=v,m=requestAnimationFrame(y)}return n(),()=>{u.forEach(v=>{o&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),d&&d(),p&&p.disconnect(),p=null,l&&cancelAnimationFrame(m)}}const w6=e6,k6=Z4,S6=n6,E6=J4,lS=Y4,_6=t6,C6=(t,e,n)=>{const r=new Map,o={platform:y6,...n},i={...o.platform,_c:r};return G4(t,e,{...o,platform:i})},T6=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:o}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?lS({element:r.current,padding:o}).fn(n):{}:r?lS({element:r,padding:o}).fn(n):{}}}};var Dp=typeof document<"u"?h.useLayoutEffect:h.useEffect;function $h(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,o;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(!$h(t[r],e[r]))return!1;return!0}if(o=Object.keys(t),n=o.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&t.$$typeof)&&!$h(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function x2(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function cS(t,e){const n=x2(t);return Math.round(e*n)/n}function uS(t){const e=h.useRef(t);return Dp(()=>{e.current=t}),e}function O6(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=t,[u,d]=h.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,p]=h.useState(r);$h(f,r)||p(r);const[m,g]=h.useState(null),[y,v]=h.useState(null),x=h.useCallback(R=>{R!=k.current&&(k.current=R,g(R))},[g]),w=h.useCallback(R=>{R!==E.current&&(E.current=R,v(R))},[v]),S=i||m,_=s||y,k=h.useRef(null),E=h.useRef(null),C=h.useRef(u),T=uS(l),A=uS(o),B=h.useCallback(()=>{if(!k.current||!E.current)return;const R={placement:e,strategy:n,middleware:f};A.current&&(R.platform=A.current),C6(k.current,E.current,R).then(N=>{const O={...N,isPositioned:!0};D.current&&!$h(C.current,O)&&(C.current=O,Vo.flushSync(()=>{d(O)}))})},[f,e,n,A]);Dp(()=>{c===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,d(R=>({...R,isPositioned:!1})))},[c]);const D=h.useRef(!1);Dp(()=>(D.current=!0,()=>{D.current=!1}),[]),Dp(()=>{if(S&&(k.current=S),_&&(E.current=_),S&&_){if(T.current)return T.current(S,_,B);B()}},[S,_,B,T]);const Z=h.useMemo(()=>({reference:k,floating:E,setReference:x,setFloating:w}),[x,w]),U=h.useMemo(()=>({reference:S,floating:_}),[S,_]),G=h.useMemo(()=>{const R={position:n,left:0,top:0};if(!U.floating)return R;const N=cS(U.floating,u.x),O=cS(U.floating,u.y);return a?{...R,transform:"translate("+N+"px, "+O+"px)",...x2(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:N,top:O}},[n,a,U.floating,u.x,u.y]);return h.useMemo(()=>({...u,update:B,refs:Z,elements:U,floatingStyles:G}),[u,B,Z,U,G])}const b2="Popper",[w2,jc]=Lr(b2),[M6,k2]=w2(b2),R6=t=>{const{__scopePopper:e,children:n}=t,[r,o]=h.useState(null);return h.createElement(M6,{scope:e,anchor:r,onAnchorChange:o},n)},N6="PopperAnchor",P6=h.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...o}=t,i=k2(N6,n),s=h.useRef(null),a=We(e,s);return h.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:h.createElement(Re.div,z({},o,{ref:a}))}),S2="PopperContent",[$6,Goe]=w2(S2),A6=h.forwardRef((t,e)=>{var n,r,o,i,s,a,l,c;const{__scopePopper:u,side:d="bottom",sideOffset:f=0,align:p="center",alignOffset:m=0,arrowPadding:g=0,avoidCollisions:y=!0,collisionBoundary:v=[],collisionPadding:x=0,sticky:w="partial",hideWhenDetached:S=!1,updatePositionStrategy:_="optimized",onPlaced:k,...E}=t,C=k2(S2,u),[T,A]=h.useState(null),B=We(e,un=>A(un)),[D,Z]=h.useState(null),U=i2(D),G=(n=U==null?void 0:U.width)!==null&&n!==void 0?n:0,R=(r=U==null?void 0:U.height)!==null&&r!==void 0?r:0,N=d+(p!=="center"?"-"+p:""),O=typeof x=="number"?x:{top:0,right:0,bottom:0,left:0,...x},P=Array.isArray(v)?v:[v],I=P.length>0,H={padding:O,boundary:P.filter(I6),altBoundary:I},{refs:le,floatingStyles:Le,placement:Ee,isPositioned:Je,middlewareData:Ae}=O6({strategy:"fixed",placement:N,whileElementsMounted:(...un)=>b6(...un,{animationFrame:_==="always"}),elements:{reference:C.anchor},middleware:[Q4({mainAxis:f+R,alignmentAxis:m}),y&&w6({mainAxis:!0,crossAxis:!1,limiter:w==="partial"?_6():void 0,...H}),y&&k6({...H}),S6({...H,apply:({elements:un,rects:Mi,availableWidth:Ks,availableHeight:Bg})=>{const{width:Ug,height:Vg}=Mi.reference,xo=un.floating.style;xo.setProperty("--radix-popper-available-width",`${Ks}px`),xo.setProperty("--radix-popper-available-height",`${Bg}px`),xo.setProperty("--radix-popper-anchor-width",`${Ug}px`),xo.setProperty("--radix-popper-anchor-height",`${Vg}px`)}}),D&&T6({element:D,padding:g}),D6({arrowWidth:G,arrowHeight:R}),S&&E6({strategy:"referenceHidden",...H})]}),[ne,et]=E2(Ee),tt=rn(k);hr(()=>{Je&&(tt==null||tt())},[Je,tt]);const nt=(o=Ae.arrow)===null||o===void 0?void 0:o.x,Te=(i=Ae.arrow)===null||i===void 0?void 0:i.y,Ke=((s=Ae.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[bn,Rn]=h.useState();return hr(()=>{T&&Rn(window.getComputedStyle(T).zIndex)},[T]),h.createElement("div",{ref:le.setFloating,"data-radix-popper-content-wrapper":"",style:{...Le,transform:Je?Le.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:bn,"--radix-popper-transform-origin":[(a=Ae.transformOrigin)===null||a===void 0?void 0:a.x,(l=Ae.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:t.dir},h.createElement($6,{scope:u,placedSide:ne,onArrowChange:Z,arrowX:nt,arrowY:Te,shouldHideArrow:Ke},h.createElement(Re.div,z({"data-side":ne,"data-align":et},E,{ref:B,style:{...E.style,animation:Je?void 0:"none",opacity:(c=Ae.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))});function I6(t){return t!==null}const D6=t=>({name:"transformOrigin",options:t,fn(e){var n,r,o,i,s;const{placement:a,rects:l,middlewareData:c}=e,d=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,f=d?0:t.arrowWidth,p=d?0:t.arrowHeight,[m,g]=E2(a),y={start:"0%",center:"50%",end:"100%"}[g],v=((r=(o=c.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+f/2,x=((i=(s=c.arrow)===null||s===void 0?void 0:s.y)!==null&&i!==void 0?i:0)+p/2;let w="",S="";return m==="bottom"?(w=d?y:`${v}px`,S=`${-p}px`):m==="top"?(w=d?y:`${v}px`,S=`${l.floating.height+p}px`):m==="right"?(w=`${-p}px`,S=d?y:`${x}px`):m==="left"&&(w=`${l.floating.width+p}px`,S=d?y:`${x}px`),{data:{x:w,y:S}}}});function E2(t){const[e,n="center"]=t.split("-");return[e,n]}const R1=R6,N1=P6,P1=A6,sg=h.forwardRef((t,e)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=t;return r?ZT.createPortal(h.createElement(Re.div,z({},o,{ref:e})),r):null});var L6=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},dl=new WeakMap,fp=new WeakMap,pp={},Mv=0,_2=function(t){return t&&(t.host||_2(t.parentNode))},j6=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=_2(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},z6=function(t,e,n,r){var o=j6(e,Array.isArray(t)?t:[t]);pp[n]||(pp[n]=new WeakMap);var i=pp[n],s=[],a=new Set,l=new Set(o),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};o.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))u(f);else{var p=f.getAttribute(r),m=p!==null&&p!=="false",g=(dl.get(f)||0)+1,y=(i.get(f)||0)+1;dl.set(f,g),i.set(f,y),s.push(f),g===1&&m&&fp.set(f,!0),y===1&&f.setAttribute(n,"true"),m||f.setAttribute(r,"true")}})};return u(e),a.clear(),Mv++,function(){s.forEach(function(d){var f=dl.get(d)-1,p=i.get(d)-1;dl.set(d,f),i.set(d,p),f||(fp.has(d)||d.removeAttribute(r),fp.delete(d)),p||d.removeAttribute(n)}),Mv--,Mv||(dl=new WeakMap,dl=new WeakMap,fp=new WeakMap,pp={})}},ag=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),o=e||L6(t);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),z6(r,o,n,"aria-hidden")):function(){return null}},Co=function(){return Co=Object.assign||function(e){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Co.apply(this,arguments)};function C2(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]]);return n}function F6(t,e,n){if(n||arguments.length===2)for(var r=0,o=e.length,i;r<o;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}var Lp="right-scroll-bar-position",jp="width-before-scroll-bar",B6="with-scroll-bars-hidden",U6="--removed-body-scroll-bar-size";function Rv(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function V6(t,e){var n=h.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=e,n.facade}var dS=new WeakMap;function H6(t,e){var n=V6(e||null,function(r){return t.forEach(function(o){return Rv(o,r)})});return h.useLayoutEffect(function(){var r=dS.get(n);if(r){var o=new Set(r),i=new Set(t),s=n.current;o.forEach(function(a){i.has(a)||Rv(a,null)}),i.forEach(function(a){o.has(a)||Rv(a,s)})}dS.set(n,t)},[t]),n}function W6(t){return t}function K6(t,e){e===void 0&&(e=W6);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(i){var s=e(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var l=function(){var u=s;s=[],u.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){s.push(u),c()},filter:function(u){return s=s.filter(u),n}}}};return o}function q6(t){t===void 0&&(t={});var e=K6(null);return e.options=Co({async:!0,ssr:!1},t),e}var T2=function(t){var e=t.sideCar,n=C2(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return h.createElement(r,Co({},n))};T2.isSideCarExport=!0;function G6(t,e){return t.useMedium(e),T2}var O2=q6(),Nv=function(){},lg=h.forwardRef(function(t,e){var n=h.useRef(null),r=h.useState({onScrollCapture:Nv,onWheelCapture:Nv,onTouchMoveCapture:Nv}),o=r[0],i=r[1],s=t.forwardProps,a=t.children,l=t.className,c=t.removeScrollBar,u=t.enabled,d=t.shards,f=t.sideCar,p=t.noIsolation,m=t.inert,g=t.allowPinchZoom,y=t.as,v=y===void 0?"div":y,x=C2(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),w=f,S=H6([n,e]),_=Co(Co({},x),o);return h.createElement(h.Fragment,null,u&&h.createElement(w,{sideCar:O2,removeScrollBar:c,shards:d,noIsolation:p,inert:m,setCallbacks:i,allowPinchZoom:!!g,lockRef:n}),s?h.cloneElement(h.Children.only(a),Co(Co({},_),{ref:S})):h.createElement(v,Co({},_,{className:l,ref:S}),a))});lg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};lg.classNames={fullWidth:jp,zeroRight:Lp};var Y6=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Z6(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=Y6();return e&&t.setAttribute("nonce",e),t}function J6(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function X6(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var Q6=function(){var t=0,e=null;return{add:function(n){t==0&&(e=Z6())&&(J6(e,n),X6(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},ej=function(){var t=Q6();return function(e,n){h.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},M2=function(){var t=ej(),e=function(n){var r=n.styles,o=n.dynamic;return t(r,o),null};return e},tj={left:0,top:0,right:0,gap:0},Pv=function(t){return parseInt(t||"",10)||0},nj=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],o=e[t==="padding"?"paddingRight":"marginRight"];return[Pv(n),Pv(r),Pv(o)]},rj=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return tj;var e=nj(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},oj=M2(),ij=function(t,e,n,r){var o=t.left,i=t.top,s=t.right,a=t.gap;return n===void 0&&(n="margin"),`
67
- .`.concat(B6,` {
68
- overflow: hidden `).concat(r,`;
69
- padding-right: `).concat(a,"px ").concat(r,`;
70
- }
71
- body {
72
- overflow: hidden `).concat(r,`;
73
- overscroll-behavior: contain;
74
- `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
75
- padding-left: `.concat(o,`px;
76
- padding-top: `).concat(i,`px;
77
- padding-right: `).concat(s,`px;
78
- margin-left:0;
79
- margin-top:0;
80
- margin-right: `).concat(a,"px ").concat(r,`;
81
- `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
82
- }
83
-
84
- .`).concat(Lp,` {
85
- right: `).concat(a,"px ").concat(r,`;
86
- }
87
-
88
- .`).concat(jp,` {
89
- margin-right: `).concat(a,"px ").concat(r,`;
90
- }
91
-
92
- .`).concat(Lp," .").concat(Lp,` {
93
- right: 0 `).concat(r,`;
94
- }
95
-
96
- .`).concat(jp," .").concat(jp,` {
97
- margin-right: 0 `).concat(r,`;
98
- }
99
-
100
- body {
101
- `).concat(U6,": ").concat(a,`px;
102
- }
103
- `)},sj=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,o=r===void 0?"margin":r,i=h.useMemo(function(){return rj(o)},[o]);return h.createElement(oj,{styles:ij(i,!e,o,n?"":"!important")})},m0=!1;if(typeof window<"u")try{var hp=Object.defineProperty({},"passive",{get:function(){return m0=!0,!0}});window.addEventListener("test",hp,hp),window.removeEventListener("test",hp,hp)}catch{m0=!1}var fl=m0?{passive:!1}:!1,aj=function(t){return t.tagName==="TEXTAREA"},R2=function(t,e){var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!aj(t)&&n[e]==="visible")},lj=function(t){return R2(t,"overflowY")},cj=function(t){return R2(t,"overflowX")},fS=function(t,e){var n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=N2(t,n);if(r){var o=P2(t,n),i=o[1],s=o[2];if(i>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},uj=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},dj=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},N2=function(t,e){return t==="v"?lj(e):cj(e)},P2=function(t,e){return t==="v"?uj(e):dj(e)},fj=function(t,e){return t==="h"&&e==="rtl"?-1:1},pj=function(t,e,n,r,o){var i=fj(t,window.getComputedStyle(e).direction),s=i*r,a=n.target,l=e.contains(a),c=!1,u=s>0,d=0,f=0;do{var p=P2(t,a),m=p[0],g=p[1],y=p[2],v=g-y-i*m;(m||v)&&N2(t,a)&&(d+=v,f+=m),a=a.parentNode}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return(u&&(o&&d===0||!o&&s>d)||!u&&(o&&f===0||!o&&-s>f))&&(c=!0),c},mp=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},pS=function(t){return[t.deltaX,t.deltaY]},hS=function(t){return t&&"current"in t?t.current:t},hj=function(t,e){return t[0]===e[0]&&t[1]===e[1]},mj=function(t){return`
104
- .block-interactivity-`.concat(t,` {pointer-events: none;}
105
- .allow-interactivity-`).concat(t,` {pointer-events: all;}
106
- `)},gj=0,pl=[];function vj(t){var e=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),o=h.useState(gj++)[0],i=h.useState(function(){return M2()})[0],s=h.useRef(t);h.useEffect(function(){s.current=t},[t]),h.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var g=F6([t.lockRef.current],(t.shards||[]).map(hS),!0).filter(Boolean);return g.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var a=h.useCallback(function(g,y){if("touches"in g&&g.touches.length===2)return!s.current.allowPinchZoom;var v=mp(g),x=n.current,w="deltaX"in g?g.deltaX:x[0]-v[0],S="deltaY"in g?g.deltaY:x[1]-v[1],_,k=g.target,E=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in g&&E==="h"&&k.type==="range")return!1;var C=fS(E,k);if(!C)return!0;if(C?_=E:(_=E==="v"?"h":"v",C=fS(E,k)),!C)return!1;if(!r.current&&"changedTouches"in g&&(w||S)&&(r.current=_),!_)return!0;var T=r.current||_;return pj(T,y,g,T==="h"?w:S,!0)},[]),l=h.useCallback(function(g){var y=g;if(!(!pl.length||pl[pl.length-1]!==i)){var v="deltaY"in y?pS(y):mp(y),x=e.current.filter(function(_){return _.name===y.type&&_.target===y.target&&hj(_.delta,v)})[0];if(x&&x.should){y.cancelable&&y.preventDefault();return}if(!x){var w=(s.current.shards||[]).map(hS).filter(Boolean).filter(function(_){return _.contains(y.target)}),S=w.length>0?a(y,w[0]):!s.current.noIsolation;S&&y.cancelable&&y.preventDefault()}}},[]),c=h.useCallback(function(g,y,v,x){var w={name:g,delta:y,target:v,should:x};e.current.push(w),setTimeout(function(){e.current=e.current.filter(function(S){return S!==w})},1)},[]),u=h.useCallback(function(g){n.current=mp(g),r.current=void 0},[]),d=h.useCallback(function(g){c(g.type,pS(g),g.target,a(g,t.lockRef.current))},[]),f=h.useCallback(function(g){c(g.type,mp(g),g.target,a(g,t.lockRef.current))},[]);h.useEffect(function(){return pl.push(i),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,fl),document.addEventListener("touchmove",l,fl),document.addEventListener("touchstart",u,fl),function(){pl=pl.filter(function(g){return g!==i}),document.removeEventListener("wheel",l,fl),document.removeEventListener("touchmove",l,fl),document.removeEventListener("touchstart",u,fl)}},[]);var p=t.removeScrollBar,m=t.inert;return h.createElement(h.Fragment,null,m?h.createElement(i,{styles:mj(o)}):null,p?h.createElement(sj,{gapMode:"margin"}):null)}const yj=G6(O2,vj);var $2=h.forwardRef(function(t,e){return h.createElement(lg,Co({},t,{ref:e,sideCar:yj}))});$2.classNames=lg.classNames;const cg=$2,A2="Popover",[I2,Yoe]=Lr(A2,[jc]),$1=jc(),[xj,zc]=I2(A2),bj=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=t,a=$1(e),l=h.useRef(null),[c,u]=h.useState(!1),[d=!1,f]=Ao({prop:r,defaultProp:o,onChange:i});return h.createElement(R1,a,h.createElement(xj,{scope:e,contentId:ao(),triggerRef:l,open:d,onOpenChange:f,onOpenToggle:h.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:c,onCustomAnchorAdd:h.useCallback(()=>u(!0),[]),onCustomAnchorRemove:h.useCallback(()=>u(!1),[]),modal:s},n))},wj="PopoverTrigger",kj=h.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,o=zc(wj,n),i=$1(n),s=We(e,o.triggerRef),a=h.createElement(Re.button,z({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":j2(o.open)},r,{ref:s,onClick:se(t.onClick,o.onOpenToggle)}));return o.hasCustomAnchor?a:h.createElement(N1,z({asChild:!0},i),a)}),D2="PopoverPortal",[Sj,Ej]=I2(D2,{forceMount:void 0}),_j=t=>{const{__scopePopover:e,forceMount:n,children:r,container:o}=t,i=zc(D2,e);return h.createElement(Sj,{scope:e,forceMount:n},h.createElement(Wn,{present:n||i.open},h.createElement(sg,{asChild:!0,container:o},r)))},Pd="PopoverContent",Cj=h.forwardRef((t,e)=>{const n=Ej(Pd,t.__scopePopover),{forceMount:r=n.forceMount,...o}=t,i=zc(Pd,t.__scopePopover);return h.createElement(Wn,{present:r||i.open},i.modal?h.createElement(Tj,z({},o,{ref:e})):h.createElement(Oj,z({},o,{ref:e})))}),Tj=h.forwardRef((t,e)=>{const n=zc(Pd,t.__scopePopover),r=h.useRef(null),o=We(e,r),i=h.useRef(!1);return h.useEffect(()=>{const s=r.current;if(s)return ag(s)},[]),h.createElement(cg,{as:mi,allowPinchZoom:!0},h.createElement(L2,z({},t,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:se(t.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:se(t.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:se(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})))}),Oj=h.forwardRef((t,e)=>{const n=zc(Pd,t.__scopePopover),r=h.useRef(!1),o=h.useRef(!1);return h.createElement(L2,z({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=t.onCloseAutoFocus)===null||s===void 0||s.call(t,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var s,a;(s=t.onInteractOutside)===null||s===void 0||s.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),L2=h.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=t,f=zc(Pd,n),p=$1(n);return ng(),h.createElement(rg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},h.createElement(tg,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1)},h.createElement(P1,z({"data-state":j2(f.open),role:"dialog",id:f.contentId},p,d,{ref:e,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))});function j2(t){return t?"open":"closed"}const Mj=bj,Rj=kj,z2=_j,A1=Cj,Nj=Mj,Pj=Rj,$j=h.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},o)=>b.jsx(z2,{children:b.jsx(A1,{ref:o,align:e,sideOffset:n,className:ze("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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",t),...r})}));$j.displayName=A1.displayName;const I1="p-1 border rounded-full shadow border-accent",mS="valbuild:urlBeforeNavigation";function Aj({api:t,patches:e,direction:n,onClickPatches:r}){const{theme:o,setTheme:i,editMode:s,setEditMode:a,session:l}=x1();if(l.status==="success"&&l.data.mode==="unauthorized")return b.jsxs(gS,{direction:n,href:t.getLoginUrl(window.location.href),children:[b.jsx("span",{children:"Login"}),b.jsx(Pk,{size:18})]});if(l.status==="success"&&!l.data.enabled)return b.jsxs(gS,{direction:n,href:t.getEnableUrl(window.location.href),children:[b.jsx("span",{children:"Enable"}),b.jsx(Pk,{size:18})]});const[c,u]=h.useState();return h.useEffect(()=>{let d=0;for(const f in e)d+=e[f].length;u(d)},[e]),b.jsxs(F2,{direction:n,children:[b.jsx($v,{active:s==="hover"||s==="window",onClick:()=>{a(d=>d==="hover"||s==="window"?"off":"hover")},children:b.jsx("div",{className:"h-[24px] w-[24px] flex justify-center items-center",children:s==="hover"||s==="window"?b.jsx(nL,{size:18}):b.jsx(rL,{size:18})})}),b.jsx($v,{active:s==="full",onClick:()=>{if(s!=="full")localStorage.setItem(mS,window.location.href),window.location.href=t.getEditUrl();else if(s==="full"){const d=localStorage.getItem(mS);window.location.href=d||"/"}},children:b.jsx("div",{className:"h-[24px] w-[24px] flex justify-center items-center",children:s==="full"?b.jsx(Q5,{size:15}):b.jsx(J5,{size:15})})}),c!==void 0&&l.status==="success"&&l.data.mode==="proxy"&&b.jsx($v,{onClick:()=>{c>0&&r()},children:b.jsxs("div",{className:"relative h-[24px] w-[24px] flex justify-center items-center",children:[b.jsx("div",{className:"absolute -right-[10px] -top-[10px] border border-border rounded-full px-1 font-sans text-xs bg-card text-accent",children:c}),b.jsx(iL,{size:18})]})}),b.jsx(Pj,{className:I1,children:b.jsx("div",{className:"h-[24px] w-[24px] flex justify-center items-center",children:b.jsx(tL,{size:18})})}),b.jsx(A1,{align:"start",sideOffset:12,side:"right",className:"z-50 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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",children:b.jsxs("div",{className:"flex flex-col items-start justify-center p-4 gap-x-4",children:[b.jsx("div",{className:"flex items-end justify-end w-full",children:b.jsx("div",{className:"h-[34px] w-[34px] flex justify-center items-center",children:b.jsxs(S1,{className:"relative peer inline-flex h-[24px] w-[34px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent 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-slate-800 data-[state=unchecked]:bg-slate-800",defaultChecked:o==="light",onClick:()=>{i(o==="dark"?"light":"dark")},children:[o==="dark"&&b.jsx(eL,{size:13,className:"absolute top-[4px] left-[17px] text-white"}),b.jsx(a2,{className:"pointer-events-none block h-[16px] w-[16px] rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-[15px] data-[state=unchecked]:translate-x-0"}),o==="light"&&b.jsx(aL,{size:13,className:"absolute top-[4px] left-[1px] text-white"})]})})}),b.jsx("div",{children:b.jsxs("a",{className:"flex items-center justify-center font-bold h-[34px] gap-x-1",href:t.getDisableUrl(window.location.href),children:[b.jsx("span",{children:"Disable"}),b.jsx(H5,{size:18})]})})]})})]})}function gS({href:t,direction:e,children:n}){return b.jsx(F2,{direction:e,border:!1,children:b.jsx("a",{className:I1,href:t,children:b.jsx("div",{className:"flex items-center justify-center px-2 gap-y-2",children:n})})})}function F2({children:t,direction:e,border:n=!0}){return b.jsx("div",{className:Ln("flex justify-center w-full h-full px-2 py-2 font-sans rounded-full gap-3 text-primary border-fill bg-gradient-to-br from-background/90 from-40% to-background backdrop-blur-lg drop-shadow-2xl",{"flex-col items-start":e==="vertical","flex-row items-center":e==="horizontal"},{border:n}),children:t})}function $v({active:t,onClick:e,children:n}){return b.jsx("button",{className:Ln(I1,{"bg-accent text-accent-foreground drop-shadow-[0px_0px_12px_hsl(var(--accent))]":t}),onClick:e,children:n})}function Ij(t,e){const[n,r]=h.useState({}),[o,i]=h.useState(0);return h.useEffect(()=>{t.status==="success"&&t.data.mode==="proxy"&&e.getPatches({}).then(s=>{if(xa.isOk(s)){const a={};for(const l in s.value)a[l]=s.value[l].map(c=>c.patch_id);r(a)}else console.error("Could not load patches",s.error)})},[t,o]),{patches:n,setPatchResetId:i}}var Ye;(function(t){t.assertEqual=o=>o;function e(o){}t.assertIs=e;function n(o){throw new Error}t.assertNever=n,t.arrayToEnum=o=>{const i={};for(const s of o)i[s]=s;return i},t.getValidEnumValues=o=>{const i=t.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),s={};for(const a of i)s[a]=o[a];return t.objectValues(s)},t.objectValues=o=>t.objectKeys(o).map(function(i){return o[i]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const i=[];for(const s in o)Object.prototype.hasOwnProperty.call(o,s)&&i.push(s);return i},t.find=(o,i)=>{for(const s of o)if(i(s))return s},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&isFinite(o)&&Math.floor(o)===o;function r(o,i=" | "){return o.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(Ye||(Ye={}));var g0;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(g0||(g0={}));const te=Ye.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ts=t=>{switch(typeof t){case"undefined":return te.undefined;case"string":return te.string;case"number":return isNaN(t)?te.nan:te.number;case"boolean":return te.boolean;case"function":return te.function;case"bigint":return te.bigint;case"symbol":return te.symbol;case"object":return Array.isArray(t)?te.array:t===null?te.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?te.promise:typeof Map<"u"&&t instanceof Map?te.map:typeof Set<"u"&&t instanceof Set?te.set:typeof Date<"u"&&t instanceof Date?te.date:te.object;default:return te.unknown}},W=Ye.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Dj=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class lo extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(i){return i.message},r={_errors:[]},o=i=>{for(const s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(o);else if(s.code==="invalid_return_type")o(s.returnTypeError);else if(s.code==="invalid_arguments")o(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,l=0;for(;l<s.path.length;){const c=s.path[l];l===s.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(s))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return o(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ye.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const o of this.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(e(o))):r.push(e(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}lo.create=t=>new lo(t);const $d=(t,e)=>{let n;switch(t.code){case W.invalid_type:t.received===te.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case W.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Ye.jsonStringifyReplacer)}`;break;case W.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ye.joinValues(t.keys,", ")}`;break;case W.invalid_union:n="Invalid input";break;case W.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ye.joinValues(t.options)}`;break;case W.invalid_enum_value:n=`Invalid enum value. Expected ${Ye.joinValues(t.options)}, received '${t.received}'`;break;case W.invalid_arguments:n="Invalid function arguments";break;case W.invalid_return_type:n="Invalid function return type";break;case W.invalid_date:n="Invalid date";break;case W.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Ye.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case W.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case W.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case W.custom:n="Invalid input";break;case W.invalid_intersection_types:n="Intersection results could not be merged";break;case W.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case W.not_finite:n="Number must be finite";break;default:n=e.defaultError,Ye.assertNever(t)}return{message:n}};let B2=$d;function Lj(t){B2=t}function Ah(){return B2}const Ih=t=>{const{data:e,path:n,errorMaps:r,issueData:o}=t,i=[...n,...o.path||[]],s={...o,path:i};let a="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)a=c(s,{data:e,defaultError:a}).message;return{...o,path:i,message:o.message||a}},jj=[];function re(t,e){const n=Ih({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Ah(),$d].filter(r=>!!r)});t.common.issues.push(n)}class On{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const o of n){if(o.status==="aborted")return _e;o.status==="dirty"&&e.dirty(),r.push(o.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const o of n)r.push({key:await o.key,value:await o.value});return On.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const o of n){const{key:i,value:s}=o;if(i.status==="aborted"||s.status==="aborted")return _e;i.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||o.alwaysSet)&&(r[i.value]=s.value)}return{status:e.value,value:r}}}const _e=Object.freeze({status:"aborted"}),U2=t=>({status:"dirty",value:t}),zn=t=>({status:"valid",value:t}),v0=t=>t.status==="aborted",y0=t=>t.status==="dirty",Ad=t=>t.status==="valid",Dh=t=>typeof Promise<"u"&&t instanceof Promise;var ge;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ge||(ge={}));class Do{constructor(e,n,r,o){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const vS=(t,e)=>{if(Ad(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new lo(t.common.issues);return this._error=n,this._error}}};function Oe(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:o}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(s,a)=>s.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:r??a.defaultError}:{message:n??a.defaultError},description:o}}class $e{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return ts(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:ts(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new On,ctx:{common:e.parent.common,data:e.data,parsedType:ts(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Dh(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){var r;const o={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ts(e)},i=this._parseSync({data:e,path:o.path,parent:o});return vS(o,i)}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ts(e)},o=this._parse({data:e,path:r.path,parent:r}),i=await(Dh(o)?o:Promise.resolve(o));return vS(r,i)}refine(e,n){const r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,i)=>{const s=e(o),a=()=>i.addIssue({code:W.custom,...r(o)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,o)=>e(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(e){return new ho({schema:this,typeName:xe.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ci.create(this,this._def)}nullable(){return La.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return co.create(this,this._def)}promise(){return gc.create(this,this._def)}or(e){return jd.create([this,e],this._def)}and(e){return zd.create(this,e,this._def)}transform(e){return new ho({...Oe(this._def),schema:this,typeName:xe.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Hd({...Oe(this._def),innerType:this,defaultValue:n,typeName:xe.ZodDefault})}brand(){return new H2({typeName:xe.ZodBranded,type:this,...Oe(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Fh({...Oe(this._def),innerType:this,catchValue:n,typeName:xe.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Mf.create(this,e)}readonly(){return Uh.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const zj=/^c[^\s-]{8,}$/i,Fj=/^[a-z][a-z0-9]*$/,Bj=/^[0-9A-HJKMNP-TV-Z]{26}$/,Uj=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Vj=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Hj="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Av;const Wj=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Kj=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,qj=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function Gj(t,e){return!!((e==="v4"||!e)&&Wj.test(t)||(e==="v6"||!e)&&Kj.test(t))}class no extends $e{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==te.string){const i=this._getOrReturnCtx(e);return re(i,{code:W.invalid_type,expected:te.string,received:i.parsedType}),_e}const r=new On;let o;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(o=this._getOrReturnCtx(e,o),re(o,{code:W.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")e.data.length>i.value&&(o=this._getOrReturnCtx(e,o),re(o,{code:W.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const s=e.data.length>i.value,a=e.data.length<i.value;(s||a)&&(o=this._getOrReturnCtx(e,o),s?re(o,{code:W.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&re(o,{code:W.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")Vj.test(e.data)||(o=this._getOrReturnCtx(e,o),re(o,{validation:"email",code:W.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")Av||(Av=new RegExp(Hj,"u")),Av.test(e.data)||(o=this._getOrReturnCtx(e,o),re(o,{validation:"emoji",code:W.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")Uj.test(e.data)||(o=this._getOrReturnCtx(e,o),re(o,{validation:"uuid",code:W.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")zj.test(e.data)||(o=this._getOrReturnCtx(e,o),re(o,{validation:"cuid",code:W.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")Fj.test(e.data)||(o=this._getOrReturnCtx(e,o),re(o,{validation:"cuid2",code:W.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")Bj.test(e.data)||(o=this._getOrReturnCtx(e,o),re(o,{validation:"ulid",code:W.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),re(o,{validation:"url",code:W.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),re(o,{validation:"regex",code:W.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(e,o),re(o,{code:W.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(o=this._getOrReturnCtx(e,o),re(o,{code:W.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(o=this._getOrReturnCtx(e,o),re(o,{code:W.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?qj(i).test(e.data)||(o=this._getOrReturnCtx(e,o),re(o,{code:W.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="ip"?Gj(e.data,i.version)||(o=this._getOrReturnCtx(e,o),re(o,{validation:"ip",code:W.invalid_string,message:i.message}),r.dirty()):Ye.assertNever(i);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(o=>e.test(o),{validation:n,code:W.invalid_string,...ge.errToObj(r)})}_addCheck(e){return new no({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ge.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ge.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ge.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ge.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ge.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ge.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ge.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ge.errToObj(e)})}datetime(e){var n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,...ge.errToObj(e==null?void 0:e.message)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...ge.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...ge.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...ge.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...ge.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...ge.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...ge.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...ge.errToObj(n)})}nonempty(e){return this.min(1,ge.errToObj(e))}trim(){return new no({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new no({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new no({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}no.create=t=>{var e;return new no({checks:[],typeName:xe.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Oe(t)})};function Yj(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,o=n>r?n:r,i=parseInt(t.toFixed(o).replace(".","")),s=parseInt(e.toFixed(o).replace(".",""));return i%s/Math.pow(10,o)}class Rs extends $e{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==te.number){const i=this._getOrReturnCtx(e);return re(i,{code:W.invalid_type,expected:te.number,received:i.parsedType}),_e}let r;const o=new On;for(const i of this._def.checks)i.kind==="int"?Ye.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),re(r,{code:W.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),re(r,{code:W.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),re(r,{code:W.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?Yj(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),re(r,{code:W.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),re(r,{code:W.not_finite,message:i.message}),o.dirty()):Ye.assertNever(i);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ge.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ge.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ge.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ge.toString(n))}setLimit(e,n,r,o){return new Rs({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:ge.toString(o)}]})}_addCheck(e){return new Rs({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ge.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ge.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ge.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ge.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ge.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ge.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:ge.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ge.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ge.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Ye.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Rs.create=t=>new Rs({checks:[],typeName:xe.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Oe(t)});class Ns extends $e{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==te.bigint){const i=this._getOrReturnCtx(e);return re(i,{code:W.invalid_type,expected:te.bigint,received:i.parsedType}),_e}let r;const o=new On;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),re(r,{code:W.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),re(r,{code:W.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),re(r,{code:W.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):Ye.assertNever(i);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ge.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ge.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ge.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ge.toString(n))}setLimit(e,n,r,o){return new Ns({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:ge.toString(o)}]})}_addCheck(e){return new Ns({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ge.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ge.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ge.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ge.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ge.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Ns.create=t=>{var e;return new Ns({checks:[],typeName:xe.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Oe(t)})};class Id extends $e{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==te.boolean){const r=this._getOrReturnCtx(e);return re(r,{code:W.invalid_type,expected:te.boolean,received:r.parsedType}),_e}return zn(e.data)}}Id.create=t=>new Id({typeName:xe.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Oe(t)});class Ia extends $e{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==te.date){const i=this._getOrReturnCtx(e);return re(i,{code:W.invalid_type,expected:te.date,received:i.parsedType}),_e}if(isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return re(i,{code:W.invalid_date}),_e}const r=new On;let o;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(o=this._getOrReturnCtx(e,o),re(o,{code:W.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(o=this._getOrReturnCtx(e,o),re(o,{code:W.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):Ye.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ia({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:ge.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:ge.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Ia.create=t=>new Ia({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:xe.ZodDate,...Oe(t)});class Lh extends $e{_parse(e){if(this._getType(e)!==te.symbol){const r=this._getOrReturnCtx(e);return re(r,{code:W.invalid_type,expected:te.symbol,received:r.parsedType}),_e}return zn(e.data)}}Lh.create=t=>new Lh({typeName:xe.ZodSymbol,...Oe(t)});class Dd extends $e{_parse(e){if(this._getType(e)!==te.undefined){const r=this._getOrReturnCtx(e);return re(r,{code:W.invalid_type,expected:te.undefined,received:r.parsedType}),_e}return zn(e.data)}}Dd.create=t=>new Dd({typeName:xe.ZodUndefined,...Oe(t)});class Ld extends $e{_parse(e){if(this._getType(e)!==te.null){const r=this._getOrReturnCtx(e);return re(r,{code:W.invalid_type,expected:te.null,received:r.parsedType}),_e}return zn(e.data)}}Ld.create=t=>new Ld({typeName:xe.ZodNull,...Oe(t)});class mc extends $e{constructor(){super(...arguments),this._any=!0}_parse(e){return zn(e.data)}}mc.create=t=>new mc({typeName:xe.ZodAny,...Oe(t)});class wa extends $e{constructor(){super(...arguments),this._unknown=!0}_parse(e){return zn(e.data)}}wa.create=t=>new wa({typeName:xe.ZodUnknown,...Oe(t)});class xi extends $e{_parse(e){const n=this._getOrReturnCtx(e);return re(n,{code:W.invalid_type,expected:te.never,received:n.parsedType}),_e}}xi.create=t=>new xi({typeName:xe.ZodNever,...Oe(t)});class jh extends $e{_parse(e){if(this._getType(e)!==te.undefined){const r=this._getOrReturnCtx(e);return re(r,{code:W.invalid_type,expected:te.void,received:r.parsedType}),_e}return zn(e.data)}}jh.create=t=>new jh({typeName:xe.ZodVoid,...Oe(t)});class co extends $e{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),o=this._def;if(n.parsedType!==te.array)return re(n,{code:W.invalid_type,expected:te.array,received:n.parsedType}),_e;if(o.exactLength!==null){const s=n.data.length>o.exactLength.value,a=n.data.length<o.exactLength.value;(s||a)&&(re(n,{code:s?W.too_big:W.too_small,minimum:a?o.exactLength.value:void 0,maximum:s?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(re(n,{code:W.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(re(n,{code:W.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>o.type._parseAsync(new Do(n,s,n.path,a)))).then(s=>On.mergeArray(r,s));const i=[...n.data].map((s,a)=>o.type._parseSync(new Do(n,s,n.path,a)));return On.mergeArray(r,i)}get element(){return this._def.type}min(e,n){return new co({...this._def,minLength:{value:e,message:ge.toString(n)}})}max(e,n){return new co({...this._def,maxLength:{value:e,message:ge.toString(n)}})}length(e,n){return new co({...this._def,exactLength:{value:e,message:ge.toString(n)}})}nonempty(e){return this.min(1,e)}}co.create=(t,e)=>new co({type:t,minLength:null,maxLength:null,exactLength:null,typeName:xe.ZodArray,...Oe(e)});function wl(t){if(t instanceof _t){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=ci.create(wl(r))}return new _t({...t._def,shape:()=>e})}else return t instanceof co?new co({...t._def,type:wl(t.element)}):t instanceof ci?ci.create(wl(t.unwrap())):t instanceof La?La.create(wl(t.unwrap())):t instanceof Lo?Lo.create(t.items.map(e=>wl(e))):t}class _t extends $e{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Ye.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==te.object){const c=this._getOrReturnCtx(e);return re(c,{code:W.invalid_type,expected:te.object,received:c.parsedType}),_e}const{status:r,ctx:o}=this._processInputParams(e),{shape:i,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof xi&&this._def.unknownKeys==="strip"))for(const c in o.data)s.includes(c)||a.push(c);const l=[];for(const c of s){const u=i[c],d=o.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Do(o,d,o.path,c)),alwaysSet:c in o.data})}if(this._def.catchall instanceof xi){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:o.data[u]}});else if(c==="strict")a.length>0&&(re(o,{code:W.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of a){const d=o.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Do(o,d,o.path,u)),alwaysSet:u in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const d=await u.key;c.push({key:d,value:await u.value,alwaysSet:u.alwaysSet})}return c}).then(c=>On.mergeObjectSync(r,c)):On.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return ge.errToObj,new _t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var o,i,s,a;const l=(s=(i=(o=this._def).errorMap)===null||i===void 0?void 0:i.call(o,n,r).message)!==null&&s!==void 0?s:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=ge.errToObj(e).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new _t({...this._def,unknownKeys:"strip"})}passthrough(){return new _t({...this._def,unknownKeys:"passthrough"})}extend(e){return new _t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new _t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:xe.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new _t({...this._def,catchall:e})}pick(e){const n={};return Ye.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new _t({...this._def,shape:()=>n})}omit(e){const n={};return Ye.objectKeys(this.shape).forEach(r=>{e[r]||(n[r]=this.shape[r])}),new _t({...this._def,shape:()=>n})}deepPartial(){return wl(this)}partial(e){const n={};return Ye.objectKeys(this.shape).forEach(r=>{const o=this.shape[r];e&&!e[r]?n[r]=o:n[r]=o.optional()}),new _t({...this._def,shape:()=>n})}required(e){const n={};return Ye.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof ci;)i=i._def.innerType;n[r]=i}}),new _t({...this._def,shape:()=>n})}keyof(){return V2(Ye.objectKeys(this.shape))}}_t.create=(t,e)=>new _t({shape:()=>t,unknownKeys:"strip",catchall:xi.create(),typeName:xe.ZodObject,...Oe(e)});_t.strictCreate=(t,e)=>new _t({shape:()=>t,unknownKeys:"strict",catchall:xi.create(),typeName:xe.ZodObject,...Oe(e)});_t.lazycreate=(t,e)=>new _t({shape:t,unknownKeys:"strip",catchall:xi.create(),typeName:xe.ZodObject,...Oe(e)});class jd extends $e{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function o(i){for(const a of i)if(a.result.status==="valid")return a.result;for(const a of i)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const s=i.map(a=>new lo(a.ctx.common.issues));return re(n,{code:W.invalid_union,unionErrors:s}),_e}if(n.common.async)return Promise.all(r.map(async i=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(o);{let i;const s=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!i&&(i={result:u,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const a=s.map(l=>new lo(l));return re(n,{code:W.invalid_union,unionErrors:a}),_e}}get options(){return this._def.options}}jd.create=(t,e)=>new jd({options:t,typeName:xe.ZodUnion,...Oe(e)});const zp=t=>t instanceof Bd?zp(t.schema):t instanceof ho?zp(t.innerType()):t instanceof Ud?[t.value]:t instanceof Ps?t.options:t instanceof Vd?Object.keys(t.enum):t instanceof Hd?zp(t._def.innerType):t instanceof Dd?[void 0]:t instanceof Ld?[null]:null;class ug extends $e{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==te.object)return re(n,{code:W.invalid_type,expected:te.object,received:n.parsedType}),_e;const r=this.discriminator,o=n.data[r],i=this.optionsMap.get(o);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(re(n,{code:W.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),_e)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const o=new Map;for(const i of n){const s=zp(i.shape[e]);if(!s)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of s){if(o.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);o.set(a,i)}}return new ug({typeName:xe.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:o,...Oe(r)})}}function x0(t,e){const n=ts(t),r=ts(e);if(t===e)return{valid:!0,data:t};if(n===te.object&&r===te.object){const o=Ye.objectKeys(e),i=Ye.objectKeys(t).filter(a=>o.indexOf(a)!==-1),s={...t,...e};for(const a of i){const l=x0(t[a],e[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(n===te.array&&r===te.array){if(t.length!==e.length)return{valid:!1};const o=[];for(let i=0;i<t.length;i++){const s=t[i],a=e[i],l=x0(s,a);if(!l.valid)return{valid:!1};o.push(l.data)}return{valid:!0,data:o}}else return n===te.date&&r===te.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class zd extends $e{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),o=(i,s)=>{if(v0(i)||v0(s))return _e;const a=x0(i.value,s.value);return a.valid?((y0(i)||y0(s))&&n.dirty(),{status:n.value,value:a.data}):(re(r,{code:W.invalid_intersection_types}),_e)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,s])=>o(i,s)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}zd.create=(t,e,n)=>new zd({left:t,right:e,typeName:xe.ZodIntersection,...Oe(n)});class Lo extends $e{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==te.array)return re(r,{code:W.invalid_type,expected:te.array,received:r.parsedType}),_e;if(r.data.length<this._def.items.length)return re(r,{code:W.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_e;!this._def.rest&&r.data.length>this._def.items.length&&(re(r,{code:W.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((s,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new Do(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(i).then(s=>On.mergeArray(n,s)):On.mergeArray(n,i)}get items(){return this._def.items}rest(e){return new Lo({...this._def,rest:e})}}Lo.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Lo({items:t,typeName:xe.ZodTuple,rest:null,...Oe(e)})};class Fd extends $e{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==te.object)return re(r,{code:W.invalid_type,expected:te.object,received:r.parsedType}),_e;const o=[],i=this._def.keyType,s=this._def.valueType;for(const a in r.data)o.push({key:i._parse(new Do(r,a,r.path,a)),value:s._parse(new Do(r,r.data[a],r.path,a))});return r.common.async?On.mergeObjectAsync(n,o):On.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof $e?new Fd({keyType:e,valueType:n,typeName:xe.ZodRecord,...Oe(r)}):new Fd({keyType:no.create(),valueType:e,typeName:xe.ZodRecord,...Oe(n)})}}class zh extends $e{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==te.map)return re(r,{code:W.invalid_type,expected:te.map,received:r.parsedType}),_e;const o=this._def.keyType,i=this._def.valueType,s=[...r.data.entries()].map(([a,l],c)=>({key:o._parse(new Do(r,a,r.path,[c,"key"])),value:i._parse(new Do(r,l,r.path,[c,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of s){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return _e;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of s){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return _e;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}}}}zh.create=(t,e,n)=>new zh({valueType:e,keyType:t,typeName:xe.ZodMap,...Oe(n)});class Da extends $e{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==te.set)return re(r,{code:W.invalid_type,expected:te.set,received:r.parsedType}),_e;const o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(re(r,{code:W.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(re(r,{code:W.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const i=this._def.valueType;function s(l){const c=new Set;for(const u of l){if(u.status==="aborted")return _e;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const a=[...r.data.values()].map((l,c)=>i._parse(new Do(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(e,n){return new Da({...this._def,minSize:{value:e,message:ge.toString(n)}})}max(e,n){return new Da({...this._def,maxSize:{value:e,message:ge.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Da.create=(t,e)=>new Da({valueType:t,minSize:null,maxSize:null,typeName:xe.ZodSet,...Oe(e)});class Ql extends $e{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==te.function)return re(n,{code:W.invalid_type,expected:te.function,received:n.parsedType}),_e;function r(a,l){return Ih({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ah(),$d].filter(c=>!!c),issueData:{code:W.invalid_arguments,argumentsError:l}})}function o(a,l){return Ih({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ah(),$d].filter(c=>!!c),issueData:{code:W.invalid_return_type,returnTypeError:l}})}const i={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof gc){const a=this;return zn(async function(...l){const c=new lo([]),u=await a._def.args.parseAsync(l,i).catch(p=>{throw c.addIssue(r(l,p)),c}),d=await Reflect.apply(s,this,u);return await a._def.returns._def.type.parseAsync(d,i).catch(p=>{throw c.addIssue(o(d,p)),c})})}else{const a=this;return zn(function(...l){const c=a._def.args.safeParse(l,i);if(!c.success)throw new lo([r(l,c.error)]);const u=Reflect.apply(s,this,c.data),d=a._def.returns.safeParse(u,i);if(!d.success)throw new lo([o(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Ql({...this._def,args:Lo.create(e).rest(wa.create())})}returns(e){return new Ql({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new Ql({args:e||Lo.create([]).rest(wa.create()),returns:n||wa.create(),typeName:xe.ZodFunction,...Oe(r)})}}class Bd extends $e{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Bd.create=(t,e)=>new Bd({getter:t,typeName:xe.ZodLazy,...Oe(e)});class Ud extends $e{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return re(n,{received:n.data,code:W.invalid_literal,expected:this._def.value}),_e}return{status:"valid",value:e.data}}get value(){return this._def.value}}Ud.create=(t,e)=>new Ud({value:t,typeName:xe.ZodLiteral,...Oe(e)});function V2(t,e){return new Ps({values:t,typeName:xe.ZodEnum,...Oe(e)})}class Ps extends $e{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return re(n,{expected:Ye.joinValues(r),received:n.parsedType,code:W.invalid_type}),_e}if(this._def.values.indexOf(e.data)===-1){const n=this._getOrReturnCtx(e),r=this._def.values;return re(n,{received:n.data,code:W.invalid_enum_value,options:r}),_e}return zn(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e){return Ps.create(e)}exclude(e){return Ps.create(this.options.filter(n=>!e.includes(n)))}}Ps.create=V2;class Vd extends $e{_parse(e){const n=Ye.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==te.string&&r.parsedType!==te.number){const o=Ye.objectValues(n);return re(r,{expected:Ye.joinValues(o),received:r.parsedType,code:W.invalid_type}),_e}if(n.indexOf(e.data)===-1){const o=Ye.objectValues(n);return re(r,{received:r.data,code:W.invalid_enum_value,options:o}),_e}return zn(e.data)}get enum(){return this._def.values}}Vd.create=(t,e)=>new Vd({values:t,typeName:xe.ZodNativeEnum,...Oe(e)});class gc extends $e{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==te.promise&&n.common.async===!1)return re(n,{code:W.invalid_type,expected:te.promise,received:n.parsedType}),_e;const r=n.parsedType===te.promise?n.data:Promise.resolve(n.data);return zn(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}gc.create=(t,e)=>new gc({type:t,typeName:xe.ZodPromise,...Oe(e)});class ho extends $e{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===xe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),o=this._def.effect||null,i={addIssue:s=>{re(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){const s=o.transform(r.data,i);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(s).then(a=>this._def.schema._parseAsync({data:a,path:r.path,parent:r})):this._def.schema._parseSync({data:s,path:r.path,parent:r})}if(o.type==="refinement"){const s=a=>{const l=o.refinement(a,i);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?_e:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?_e:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(o.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Ad(s))return s;const a=o.transform(s.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>Ad(s)?Promise.resolve(o.transform(s.value,i)).then(a=>({status:n.value,value:a})):s);Ye.assertNever(o)}}ho.create=(t,e,n)=>new ho({schema:t,typeName:xe.ZodEffects,effect:e,...Oe(n)});ho.createWithPreprocess=(t,e,n)=>new ho({schema:e,effect:{type:"preprocess",transform:t},typeName:xe.ZodEffects,...Oe(n)});class ci extends $e{_parse(e){return this._getType(e)===te.undefined?zn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ci.create=(t,e)=>new ci({innerType:t,typeName:xe.ZodOptional,...Oe(e)});class La extends $e{_parse(e){return this._getType(e)===te.null?zn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}La.create=(t,e)=>new La({innerType:t,typeName:xe.ZodNullable,...Oe(e)});class Hd extends $e{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===te.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Hd.create=(t,e)=>new Hd({innerType:t,typeName:xe.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Oe(e)});class Fh extends $e{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Dh(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new lo(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new lo(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Fh.create=(t,e)=>new Fh({innerType:t,typeName:xe.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Oe(e)});class Bh extends $e{_parse(e){if(this._getType(e)!==te.nan){const r=this._getOrReturnCtx(e);return re(r,{code:W.invalid_type,expected:te.nan,received:r.parsedType}),_e}return{status:"valid",value:e.data}}}Bh.create=t=>new Bh({typeName:xe.ZodNaN,...Oe(t)});const Zj=Symbol("zod_brand");class H2 extends $e{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Mf extends $e{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?_e:i.status==="dirty"?(n.dirty(),U2(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?_e:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(e,n){return new Mf({in:e,out:n,typeName:xe.ZodPipeline})}}class Uh extends $e{_parse(e){const n=this._def.innerType._parse(e);return Ad(n)&&(n.value=Object.freeze(n.value)),n}}Uh.create=(t,e)=>new Uh({innerType:t,typeName:xe.ZodReadonly,...Oe(e)});const W2=(t,e={},n)=>t?mc.create().superRefine((r,o)=>{var i,s;if(!t(r)){const a=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,l=(s=(i=a.fatal)!==null&&i!==void 0?i:n)!==null&&s!==void 0?s:!0,c=typeof a=="string"?{message:a}:a;o.addIssue({code:"custom",...c,fatal:l})}}):mc.create(),Jj={object:_t.lazycreate};var xe;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(xe||(xe={}));const Xj=(t,e={message:`Input not instance of ${t.name}`})=>W2(n=>n instanceof t,e),K2=no.create,q2=Rs.create,Qj=Bh.create,e7=Ns.create,G2=Id.create,t7=Ia.create,n7=Lh.create,r7=Dd.create,o7=Ld.create,i7=mc.create,s7=wa.create,a7=xi.create,l7=jh.create,c7=co.create,u7=_t.create,d7=_t.strictCreate,f7=jd.create,p7=ug.create,h7=zd.create,m7=Lo.create,g7=Fd.create,v7=zh.create,y7=Da.create,x7=Ql.create,b7=Bd.create,w7=Ud.create,k7=Ps.create,S7=Vd.create,E7=gc.create,yS=ho.create,_7=ci.create,C7=La.create,T7=ho.createWithPreprocess,O7=Mf.create,M7=()=>K2().optional(),R7=()=>q2().optional(),N7=()=>G2().optional(),P7={string:t=>no.create({...t,coerce:!0}),number:t=>Rs.create({...t,coerce:!0}),boolean:t=>Id.create({...t,coerce:!0}),bigint:t=>Ns.create({...t,coerce:!0}),date:t=>Ia.create({...t,coerce:!0})},$7=_e;var j=Object.freeze({__proto__:null,defaultErrorMap:$d,setErrorMap:Lj,getErrorMap:Ah,makeIssue:Ih,EMPTY_PATH:jj,addIssueToContext:re,ParseStatus:On,INVALID:_e,DIRTY:U2,OK:zn,isAborted:v0,isDirty:y0,isValid:Ad,isAsync:Dh,get util(){return Ye},get objectUtil(){return g0},ZodParsedType:te,getParsedType:ts,ZodType:$e,ZodString:no,ZodNumber:Rs,ZodBigInt:Ns,ZodBoolean:Id,ZodDate:Ia,ZodSymbol:Lh,ZodUndefined:Dd,ZodNull:Ld,ZodAny:mc,ZodUnknown:wa,ZodNever:xi,ZodVoid:jh,ZodArray:co,ZodObject:_t,ZodUnion:jd,ZodDiscriminatedUnion:ug,ZodIntersection:zd,ZodTuple:Lo,ZodRecord:Fd,ZodMap:zh,ZodSet:Da,ZodFunction:Ql,ZodLazy:Bd,ZodLiteral:Ud,ZodEnum:Ps,ZodNativeEnum:Vd,ZodPromise:gc,ZodEffects:ho,ZodTransformer:ho,ZodOptional:ci,ZodNullable:La,ZodDefault:Hd,ZodCatch:Fh,ZodNaN:Bh,BRAND:Zj,ZodBranded:H2,ZodPipeline:Mf,ZodReadonly:Uh,custom:W2,Schema:$e,ZodSchema:$e,late:Jj,get ZodFirstPartyTypeKind(){return xe},coerce:P7,any:i7,array:c7,bigint:e7,boolean:G2,date:t7,discriminatedUnion:p7,effect:yS,enum:k7,function:x7,instanceof:Xj,intersection:h7,lazy:b7,literal:w7,map:v7,nan:Qj,nativeEnum:S7,never:a7,null:o7,nullable:C7,number:q2,object:u7,oboolean:N7,onumber:R7,optional:_7,ostring:M7,pipeline:O7,preprocess:T7,promise:E7,record:g7,set:y7,strictObject:d7,string:K2,symbol:n7,transformer:yS,tuple:m7,undefined:r7,union:f7,unknown:s7,void:l7,NEVER:$7,ZodIssueCode:W,quotelessJson:Dj,ZodError:lo});const A7=j.union([j.object({id:j.string(),mode:j.literal("proxy"),full_name:j.string().optional().nullable(),username:j.string().optional().nullable(),avatar_url:j.string().url().optional().nullable(),enabled:j.boolean()}),j.object({mode:j.literal("local"),enabled:j.boolean().optional()}),j.object({mode:j.literal("unauthorized"),enabled:j.boolean().optional()})]);function I7(t){const[e,n]=h.useState({status:"not-asked"}),[r,o]=h.useState(0);return h.useEffect(()=>{n({status:"loading"}),t.getSession().then(async i=>{try{if(xa.isOk(i)){const s=i.value;n({status:"success",data:A7.parse(s)})}else i.error.statusCode===401?(console.error("Unauthorized",i.error),n({status:"success",data:{mode:"unauthorized"}})):r<3?setTimeout(()=>{o(r+1)},200*r):n({status:"error",error:"Could not fetch session"})}catch(s){console.error("Could not authorize:",s),n({status:"error",error:"Got an error while trying to get session"})}})},[r]),e}function ka({children:t}){const e=t.split("/").filter(n=>n);return e.map((n,r)=>r!==e.length-1?b.jsxs(h.Fragment,{children:[b.jsx("span",{children:n}),b.jsx("span",{className:"px-[2px] text-muted",children:"/"})]},`${t}/${n}`):b.jsx(D7,{children:n},t))}function D7({children:t}){if(t.includes(".")){const e=t.split(".");return e.map((n,r)=>r!==e.length-1?b.jsxs(h.Fragment,{children:[b.jsx("span",{children:r===0?n:JSON.parse(n)}),b.jsx("span",{className:"px-[2px] text-muted",children:"."})]},`${t}.${n}`):b.jsx("span",{children:r===0?n:JSON.parse(n)},t))}return b.jsx("span",{children:t})}function Y2(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=Y2(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function L7(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=Y2(t))&&(r&&(r+=" "),r+=e);return r}const xS=t=>typeof t=="boolean"?"".concat(t):t===0?"0":t,bS=L7,j7=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return bS(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=e,s=Object.keys(o).map(c=>{const u=n==null?void 0:n[c],d=i==null?void 0:i[c];if(u===null)return null;const f=xS(u)||xS(d);return o[c][f]}),a=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:f,...p}=u;return Object.entries(p).every(m=>{let[g,y]=m;return Array.isArray(y)?y.includes({...i,...a}[g]):{...i,...a}[g]===y})?[...c,d,f]:c},[]);return bS(t,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},z7=j7("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),vc=h.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...o},i)=>{const s=r?mi:"button";return b.jsx(s,{className:ze(z7({variant:e,size:n,className:t})),ref:i,...o})});vc.displayName="Button";function dg(t){const e=t+"CollectionProvider",[n,r]=Lr(e),[o,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:m,children:g}=p,y=oe.useRef(null),v=oe.useRef(new Map).current;return oe.createElement(o,{scope:m,itemMap:v,collectionRef:y},g)},a=t+"CollectionSlot",l=oe.forwardRef((p,m)=>{const{scope:g,children:y}=p,v=i(a,g),x=We(m,v.collectionRef);return oe.createElement(mi,{ref:x},y)}),c=t+"CollectionItemSlot",u="data-radix-collection-item",d=oe.forwardRef((p,m)=>{const{scope:g,children:y,...v}=p,x=oe.useRef(null),w=We(m,x),S=i(c,g);return oe.useEffect(()=>(S.itemMap.set(x,{ref:x,...v}),()=>void S.itemMap.delete(x))),oe.createElement(mi,{[u]:"",ref:w},y)});function f(p){const m=i(t+"CollectionConsumer",p);return oe.useCallback(()=>{const y=m.collectionRef.current;if(!y)return[];const v=Array.from(y.querySelectorAll(`[${u}]`));return Array.from(m.itemMap.values()).sort((S,_)=>v.indexOf(S.ref.current)-v.indexOf(_.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:s,Slot:l,ItemSlot:d},f,r]}const Z2="Collapsible",[F7,J2]=Lr(Z2),[B7,D1]=F7(Z2),U7=h.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=t,[l=!1,c]=Ao({prop:r,defaultProp:o,onChange:s});return h.createElement(B7,{scope:n,disabled:i,contentId:ao(),open:l,onOpenToggle:h.useCallback(()=>c(u=>!u),[c])},h.createElement(Re.div,z({"data-state":L1(l),"data-disabled":i?"":void 0},a,{ref:e})))}),V7="CollapsibleTrigger",H7=h.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,o=D1(V7,n);return h.createElement(Re.button,z({type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":L1(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled},r,{ref:e,onClick:se(t.onClick,o.onOpenToggle)}))}),X2="CollapsibleContent",W7=h.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=D1(X2,t.__scopeCollapsible);return h.createElement(Wn,{present:n||o.open},({present:i})=>h.createElement(K7,z({},r,{ref:e,present:i})))}),K7=h.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=t,s=D1(X2,n),[a,l]=h.useState(r),c=h.useRef(null),u=We(e,c),d=h.useRef(0),f=d.current,p=h.useRef(0),m=p.current,g=s.open||a,y=h.useRef(g),v=h.useRef();return h.useEffect(()=>{const x=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(x)},[]),hr(()=>{const x=c.current;if(x){v.current=v.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const w=x.getBoundingClientRect();d.current=w.height,p.current=w.width,y.current||(x.style.transitionDuration=v.current.transitionDuration,x.style.animationName=v.current.animationName),l(r)}},[s.open,r]),h.createElement(Re.div,z({"data-state":L1(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!g},i,{ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...t.style}}),g&&o)});function L1(t){return t?"open":"closed"}const q7=U7,G7=H7,Y7=W7,Us="Accordion",Z7=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[j1,J7,X7]=dg(Us),[fg,Zoe]=Lr(Us,[X7,J2]),z1=J2(),Q2=oe.forwardRef((t,e)=>{const{type:n,...r}=t,o=r,i=r;return oe.createElement(j1.Provider,{scope:t.__scopeAccordion},n==="multiple"?oe.createElement(n8,z({},i,{ref:e})):oe.createElement(t8,z({},o,{ref:e})))});Q2.propTypes={type(t){const e=t.value||t.defaultValue;return t.type&&!["single","multiple"].includes(t.type)?new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):t.type==="multiple"&&typeof e=="string"?new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):t.type==="single"&&Array.isArray(e)?new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};const[eM,Q7]=fg(Us),[tM,e8]=fg(Us,{collapsible:!1}),t8=oe.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...s}=t,[a,l]=Ao({prop:n,defaultProp:r,onChange:o});return oe.createElement(eM,{scope:t.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:oe.useCallback(()=>i&&l(""),[i,l])},oe.createElement(tM,{scope:t.__scopeAccordion,collapsible:i},oe.createElement(nM,z({},s,{ref:e}))))}),n8=oe.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=t,[s=[],a]=Ao({prop:n,defaultProp:r,onChange:o}),l=oe.useCallback(u=>a((d=[])=>[...d,u]),[a]),c=oe.useCallback(u=>a((d=[])=>d.filter(f=>f!==u)),[a]);return oe.createElement(eM,{scope:t.__scopeAccordion,value:s,onItemOpen:l,onItemClose:c},oe.createElement(tM,{scope:t.__scopeAccordion,collapsible:!0},oe.createElement(nM,z({},i,{ref:e}))))}),[r8,pg]=fg(Us),nM=oe.forwardRef((t,e)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:i="vertical",...s}=t,a=oe.useRef(null),l=We(a,e),c=J7(n),d=_f(o)==="ltr",f=se(t.onKeyDown,p=>{var m;if(!Z7.includes(p.key))return;const g=p.target,y=c().filter(T=>{var A;return!((A=T.ref.current)!==null&&A!==void 0&&A.disabled)}),v=y.findIndex(T=>T.ref.current===g),x=y.length;if(v===-1)return;p.preventDefault();let w=v;const S=0,_=x-1,k=()=>{w=v+1,w>_&&(w=S)},E=()=>{w=v-1,w<S&&(w=_)};switch(p.key){case"Home":w=S;break;case"End":w=_;break;case"ArrowRight":i==="horizontal"&&(d?k():E());break;case"ArrowDown":i==="vertical"&&k();break;case"ArrowLeft":i==="horizontal"&&(d?E():k());break;case"ArrowUp":i==="vertical"&&E();break}const C=w%x;(m=y[C].ref.current)===null||m===void 0||m.focus()});return oe.createElement(r8,{scope:n,disabled:r,direction:o,orientation:i},oe.createElement(j1.Slot,{scope:n},oe.createElement(Re.div,z({},s,{"data-orientation":i,ref:l,onKeyDown:r?void 0:f}))))}),b0="AccordionItem",[o8,F1]=fg(b0),w0=oe.forwardRef((t,e)=>{const{__scopeAccordion:n,value:r,...o}=t,i=pg(b0,n),s=Q7(b0,n),a=z1(n),l=ao(),c=r&&s.value.includes(r)||!1,u=i.disabled||t.disabled;return oe.createElement(o8,{scope:n,open:c,disabled:u,triggerId:l},oe.createElement(q7,z({"data-orientation":i.orientation,"data-state":rM(c)},a,o,{ref:e,disabled:u,open:c,onOpenChange:d=>{d?s.onItemOpen(r):s.onItemClose(r)}})))}),i8="AccordionHeader",s8=oe.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,o=pg(Us,n),i=F1(i8,n);return oe.createElement(Re.h3,z({"data-orientation":o.orientation,"data-state":rM(i.open),"data-disabled":i.disabled?"":void 0},r,{ref:e}))}),wS="AccordionTrigger",k0=oe.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,o=pg(Us,n),i=F1(wS,n),s=e8(wS,n),a=z1(n);return oe.createElement(j1.ItemSlot,{scope:n},oe.createElement(G7,z({"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId},a,r,{ref:e})))}),a8="AccordionContent",l8=oe.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,o=pg(Us,n),i=F1(a8,n),s=z1(n);return oe.createElement(Y7,z({role:"region","aria-labelledby":i.triggerId,"data-orientation":o.orientation},s,r,{ref:e,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}}))});function rM(t){return t?"open":"closed"}const c8=Q2,u8=w0,d8=s8,oM=k0,iM=l8,S0=c8,sM=h.forwardRef(({className:t,...e},n)=>b.jsx(u8,{ref:n,className:ze("border-b",t),...e}));sM.displayName="AccordionItem";const aM=h.forwardRef(({className:t,children:e,...n},r)=>b.jsx(d8,{className:"flex",children:b.jsxs(oM,{ref:r,className:ze("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",t),...n,children:[e,b.jsx(Th,{className:"w-4 h-4 transition-transform duration-200 shrink-0"})]})}));aM.displayName=oM.displayName;const Vh=h.forwardRef(({className:t,children:e,...n},r)=>b.jsx(iM,{ref:r,className:ze("overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",t),...n,children:b.jsx("div",{className:"pt-0 pb-4",children:e})}));Vh.displayName=iM.displayName;function f8({api:t,patches:e,onCommit:n,onCancel:r}){const[o,i]=h.useState(!1);return h.useEffect(()=>{const s=a=>{a.key==="Escape"&&r()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[]),b.jsxs(p8,{children:[b.jsx("div",{className:"flex justify-end p-2",children:b.jsx("button",{onClick:r,children:b.jsx(Oh,{})})}),b.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8 gap-y-5",children:[b.jsx("h1",{className:"block font-sans text-xl font-bold",children:"Review changes"}),b.jsx("ul",{children:Object.entries(e).map(([s,a])=>b.jsx("li",{children:b.jsx(S0,{type:"single",collapsible:!0,children:b.jsxs(w0,{value:s,children:[b.jsxs(k0,{className:"grid grid-cols-[1fr_min-content] gap-x-2",children:[b.jsx("span",{children:s}),b.jsxs("span",{className:"flex",children:[b.jsx(V5,{size:14}),b.jsx("span",{children:a.length}),b.jsx("span",{children:b.jsx(Th,{size:14})})]})]}),b.jsx(Vh,{children:b.jsx(S0,{type:"multiple",children:a.map(l=>b.jsxs(w0,{value:l,children:[b.jsx(k0,{children:b.jsxs("div",{className:"flex items-center gap-x-5",children:[b.jsx("span",{children:"Changed by: John Smith"}),b.jsx("span",{children:"Changed at: 2024-01-04 13:25:00"}),b.jsx("img",{className:"h-[14px] w-[14px]",src:"https://randomuser.me/api/portraits/men/3.jpg"}),b.jsx(Oh,{size:14}),b.jsx(Th,{size:14})]})}),b.jsx(Vh,{children:b.jsx("div",{children:'Changed to: "Foo bar"'})})]}))})})]})})},s))}),b.jsxs("div",{className:"flex gap-x-4",children:[b.jsx(vc,{variant:"secondary",onClick:r,children:"Cancel"}),b.jsx(vc,{disabled:Object.keys(e).length===0||o,onClick:()=>{i(!0),t.postCommit({patches:e}).then(s=>{xa.isErr(s)?(console.error(s.error),alert("Could not commit patches: "+s.error.message)):(console.log("Committed patches: ",s.value),n())}).finally(()=>{i(!1)})},children:o?"Committing...":"Commit"})]})]})]})}function p8({children:t}){return b.jsx("div",{className:"h-full w-full rounded-lg bg-gradient-to-br from-background/90 from-40% to-background backdrop-blur-lg text-primary drop-shadow-2xl",children:t})}function B1(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Xa=B1();function lM(t){Xa=t}const cM=/[&<>"']/,h8=new RegExp(cM.source,"g"),uM=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,m8=new RegExp(uM.source,"g"),g8={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},kS=t=>g8[t];function sr(t,e){if(e){if(cM.test(t))return t.replace(h8,kS)}else if(uM.test(t))return t.replace(m8,kS);return t}const v8=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function y8(t){return t.replace(v8,(e,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const x8=/(^|[^\[])\^/g;function rt(t,e){t=typeof t=="string"?t:t.source,e=e||"";const n={replace:(r,o)=>(o=typeof o=="object"&&"source"in o?o.source:o,o=o.replace(x8,"$1"),t=t.replace(r,o),n),getRegex:()=>new RegExp(t,e)};return n}function SS(t){try{t=encodeURI(t).replace(/%25/g,"%")}catch{return null}return t}const Hh={exec:()=>null};function ES(t,e){const n=t.replace(/\|/g,(i,s,a)=>{let l=!1,c=s;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),r=n.split(/ \|/);let o=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;o<r.length;o++)r[o]=r[o].trim().replace(/\\\|/g,"|");return r}function gp(t,e,n){const r=t.length;if(r===0)return"";let o=0;for(;o<r;){const i=t.charAt(r-o-1);if(i===e&&!n)o++;else if(i!==e&&n)o++;else break}return t.slice(0,r-o)}function b8(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])n++;else if(t[r]===e[1]&&(n--,n<0))return r;return-1}function _S(t,e,n,r){const o=e.href,i=e.title?sr(e.title):null,s=t[1].replace(/\\([\[\]])/g,"$1");if(t[0].charAt(0)!=="!"){r.state.inLink=!0;const a={type:"link",raw:n,href:o,title:i,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,a}return{type:"image",raw:n,href:o,title:i,text:sr(s)}}function w8(t,e){const n=t.match(/^(\s+)(?:```)/);if(n===null)return e;const r=n[1];return e.split(`
107
- `).map(o=>{const i=o.match(/^\s+/);if(i===null)return o;const[s]=i;return s.length>=r.length?o.slice(r.length):o}).join(`
108
- `)}class Wh{constructor(e){mt(this,"options");mt(this,"rules");mt(this,"lexer");this.options=e||Xa}space(e){const n=this.rules.block.newline.exec(e);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(e){const n=this.rules.block.code.exec(e);if(n){const r=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:gp(r,`
109
- `)}}}fences(e){const n=this.rules.block.fences.exec(e);if(n){const r=n[0],o=w8(r,n[3]||"");return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:o}}}heading(e){const n=this.rules.block.heading.exec(e);if(n){let r=n[2].trim();if(/#$/.test(r)){const o=gp(r,"#");(this.options.pedantic||!o||/ $/.test(o))&&(r=o.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){const n=this.rules.block.hr.exec(e);if(n)return{type:"hr",raw:n[0]}}blockquote(e){const n=this.rules.block.blockquote.exec(e);if(n){const r=gp(n[0].replace(/^ *>[ \t]?/gm,""),`
110
- `),o=this.lexer.state.top;this.lexer.state.top=!0;const i=this.lexer.blockTokens(r);return this.lexer.state.top=o,{type:"blockquote",raw:n[0],tokens:i,text:r}}}list(e){let n=this.rules.block.list.exec(e);if(n){let r=n[1].trim();const o=r.length>1,i={type:"list",raw:"",ordered:o,start:o?+r.slice(0,-1):"",loose:!1,items:[]};r=o?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=o?r:"[*+-]");const s=new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`);let a="",l="",c=!1;for(;e;){let u=!1;if(!(n=s.exec(e))||this.rules.block.hr.test(e))break;a=n[0],e=e.substring(a.length);let d=n[2].split(`
111
- `,1)[0].replace(/^\t+/,v=>" ".repeat(3*v.length)),f=e.split(`
112
- `,1)[0],p=0;this.options.pedantic?(p=2,l=d.trimStart()):(p=n[2].search(/[^ ]/),p=p>4?1:p,l=d.slice(p),p+=n[1].length);let m=!1;if(!d&&/^ *$/.test(f)&&(a+=f+`
113
- `,e=e.substring(f.length+1),u=!0),!u){const v=new RegExp(`^ {0,${Math.min(3,p-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),x=new RegExp(`^ {0,${Math.min(3,p-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),w=new RegExp(`^ {0,${Math.min(3,p-1)}}(?:\`\`\`|~~~)`),S=new RegExp(`^ {0,${Math.min(3,p-1)}}#`);for(;e;){const _=e.split(`
114
- `,1)[0];if(f=_,this.options.pedantic&&(f=f.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),w.test(f)||S.test(f)||v.test(f)||x.test(e))break;if(f.search(/[^ ]/)>=p||!f.trim())l+=`
115
- `+f.slice(p);else{if(m||d.search(/[^ ]/)>=4||w.test(d)||S.test(d)||x.test(d))break;l+=`
116
- `+f}!m&&!f.trim()&&(m=!0),a+=_+`
117
- `,e=e.substring(_.length+1),d=f.slice(p)}}i.loose||(c?i.loose=!0:/\n *\n *$/.test(a)&&(c=!0));let g=null,y;this.options.gfm&&(g=/^\[[ xX]\] /.exec(l),g&&(y=g[0]!=="[ ] ",l=l.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:a,task:!!g,checked:y,loose:!1,text:l,tokens:[]}),i.raw+=a}i.items[i.items.length-1].raw=a.trimEnd(),i.items[i.items.length-1].text=l.trimEnd(),i.raw=i.raw.trimEnd();for(let u=0;u<i.items.length;u++)if(this.lexer.state.top=!1,i.items[u].tokens=this.lexer.blockTokens(i.items[u].text,[]),!i.loose){const d=i.items[u].tokens.filter(p=>p.type==="space"),f=d.length>0&&d.some(p=>/\n.*\n/.test(p.raw));i.loose=f}if(i.loose)for(let u=0;u<i.items.length;u++)i.items[u].loose=!0;return i}}html(e){const n=this.rules.block.html.exec(e);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(e){const n=this.rules.block.def.exec(e);if(n){const r=n[1].toLowerCase().replace(/\s+/g," "),o=n[2]?n[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",i=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline._escapes,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:o,title:i}}}table(e){const n=this.rules.block.table.exec(e);if(n){if(!/[:|]/.test(n[2]))return;const r={type:"table",raw:n[0],header:ES(n[1]).map(o=>({text:o,tokens:[]})),align:n[2].replace(/^\||\| *$/g,"").split("|"),rows:n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(`
118
- `):[]};if(r.header.length===r.align.length){let o=r.align.length,i,s,a,l;for(i=0;i<o;i++){const c=r.align[i];c&&(/^ *-+: *$/.test(c)?r.align[i]="right":/^ *:-+: *$/.test(c)?r.align[i]="center":/^ *:-+ *$/.test(c)?r.align[i]="left":r.align[i]=null)}for(o=r.rows.length,i=0;i<o;i++)r.rows[i]=ES(r.rows[i],r.header.length).map(c=>({text:c,tokens:[]}));for(o=r.header.length,s=0;s<o;s++)r.header[s].tokens=this.lexer.inline(r.header[s].text);for(o=r.rows.length,s=0;s<o;s++)for(l=r.rows[s],a=0;a<l.length;a++)l[a].tokens=this.lexer.inline(l[a].text);return r}}}lheading(e){const n=this.rules.block.lheading.exec(e);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(e){const n=this.rules.block.paragraph.exec(e);if(n){const r=n[1].charAt(n[1].length-1)===`
119
- `?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:r,tokens:this.lexer.inline(r)}}}text(e){const n=this.rules.block.text.exec(e);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(e){const n=this.rules.inline.escape.exec(e);if(n)return{type:"escape",raw:n[0],text:sr(n[1])}}tag(e){const n=this.rules.inline.tag.exec(e);if(n)return!this.lexer.state.inLink&&/^<a /i.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(e){const n=this.rules.inline.link.exec(e);if(n){const r=n[2].trim();if(!this.options.pedantic&&/^</.test(r)){if(!/>$/.test(r))return;const s=gp(r.slice(0,-1),"\\");if((r.length-s.length)%2===0)return}else{const s=b8(n[2],"()");if(s>-1){const l=(n[0].indexOf("!")===0?5:4)+n[1].length+s;n[2]=n[2].substring(0,s),n[0]=n[0].substring(0,l).trim(),n[3]=""}}let o=n[2],i="";if(this.options.pedantic){const s=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);s&&(o=s[1],i=s[3])}else i=n[3]?n[3].slice(1,-1):"";return o=o.trim(),/^</.test(o)&&(this.options.pedantic&&!/>$/.test(r)?o=o.slice(1):o=o.slice(1,-1)),_S(n,{href:o&&o.replace(this.rules.inline._escapes,"$1"),title:i&&i.replace(this.rules.inline._escapes,"$1")},n[0],this.lexer)}}reflink(e,n){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let o=(r[2]||r[1]).replace(/\s+/g," ");if(o=n[o.toLowerCase()],!o){const i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return _S(r,o,r[0],this.lexer)}}emStrong(e,n,r=""){let o=this.rules.inline.emStrong.lDelim.exec(e);if(!o||o[3]&&r.match(/[\p{L}\p{N}]/u))return;if(!(o[1]||o[2]||"")||!r||this.rules.inline.punctuation.exec(r)){const s=[...o[0]].length-1;let a,l,c=s,u=0;const d=o[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,n=n.slice(-1*e.length+s);(o=d.exec(n))!=null;){if(a=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!a)continue;if(l=[...a].length,o[3]||o[4]){c+=l;continue}else if((o[5]||o[6])&&s%3&&!((s+l)%3)){u+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+u);const f=[...o[0]][0].length,p=e.slice(0,s+o.index+f+l);if(Math.min(s,l)%2){const g=p.slice(1,-1);return{type:"em",raw:p,text:g,tokens:this.lexer.inlineTokens(g)}}const m=p.slice(2,-2);return{type:"strong",raw:p,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(e){const n=this.rules.inline.code.exec(e);if(n){let r=n[2].replace(/\n/g," ");const o=/[^ ]/.test(r),i=/^ /.test(r)&&/ $/.test(r);return o&&i&&(r=r.substring(1,r.length-1)),r=sr(r,!0),{type:"codespan",raw:n[0],text:r}}}br(e){const n=this.rules.inline.br.exec(e);if(n)return{type:"br",raw:n[0]}}del(e){const n=this.rules.inline.del.exec(e);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(e){const n=this.rules.inline.autolink.exec(e);if(n){let r,o;return n[2]==="@"?(r=sr(n[1]),o="mailto:"+r):(r=sr(n[1]),o=r),{type:"link",raw:n[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}url(e){let n;if(n=this.rules.inline.url.exec(e)){let r,o;if(n[2]==="@")r=sr(n[0]),o="mailto:"+r;else{let i;do i=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0];while(i!==n[0]);r=sr(n[0]),n[1]==="www."?o="http://"+n[0]:o=n[0]}return{type:"link",raw:n[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){const n=this.rules.inline.text.exec(e);if(n){let r;return this.lexer.state.inRawBlock?r=n[0]:r=sr(n[0]),{type:"text",raw:n[0],text:r}}}}const he={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Hh,lheading:/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};he._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;he._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;he.def=rt(he.def).replace("label",he._label).replace("title",he._title).getRegex();he.bullet=/(?:[*+-]|\d{1,9}[.)])/;he.listItemStart=rt(/^( *)(bull) */).replace("bull",he.bullet).getRegex();he.list=rt(he.list).replace(/bull/g,he.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+he.def.source+")").getRegex();he._tag="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";he._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;he.html=rt(he.html,"i").replace("comment",he._comment).replace("tag",he._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();he.lheading=rt(he.lheading).replace(/bull/g,he.bullet).getRegex();he.paragraph=rt(he._paragraph).replace("hr",he.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",he._tag).getRegex();he.blockquote=rt(he.blockquote).replace("paragraph",he.paragraph).getRegex();he.normal={...he};he.gfm={...he.normal,table:"^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};he.gfm.table=rt(he.gfm.table).replace("hr",he.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",he._tag).getRegex();he.gfm.paragraph=rt(he._paragraph).replace("hr",he.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",he.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",he._tag).getRegex();he.pedantic={...he.normal,html:rt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",he._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Hh,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:rt(he.normal._paragraph).replace("hr",he.hr).replace("heading",` *#{1,6} *[^
120
- ]`).replace("lheading",he.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const ee={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Hh,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,rDelimAst:/^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Hh,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^((?![*_])[\spunctuation])/};ee._punctuation="\\p{P}$+<=>`^|~";ee.punctuation=rt(ee.punctuation,"u").replace(/punctuation/g,ee._punctuation).getRegex();ee.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g;ee.anyPunctuation=/\\[punct]/g;ee._escapes=/\\([punct])/g;ee._comment=rt(he._comment).replace("(?:-->|$)","-->").getRegex();ee.emStrong.lDelim=rt(ee.emStrong.lDelim,"u").replace(/punct/g,ee._punctuation).getRegex();ee.emStrong.rDelimAst=rt(ee.emStrong.rDelimAst,"gu").replace(/punct/g,ee._punctuation).getRegex();ee.emStrong.rDelimUnd=rt(ee.emStrong.rDelimUnd,"gu").replace(/punct/g,ee._punctuation).getRegex();ee.anyPunctuation=rt(ee.anyPunctuation,"gu").replace(/punct/g,ee._punctuation).getRegex();ee._escapes=rt(ee._escapes,"gu").replace(/punct/g,ee._punctuation).getRegex();ee._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;ee._email=/[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])?)+(?![-_])/;ee.autolink=rt(ee.autolink).replace("scheme",ee._scheme).replace("email",ee._email).getRegex();ee._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;ee.tag=rt(ee.tag).replace("comment",ee._comment).replace("attribute",ee._attribute).getRegex();ee._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;ee._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;ee._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;ee.link=rt(ee.link).replace("label",ee._label).replace("href",ee._href).replace("title",ee._title).getRegex();ee.reflink=rt(ee.reflink).replace("label",ee._label).replace("ref",he._label).getRegex();ee.nolink=rt(ee.nolink).replace("ref",he._label).getRegex();ee.reflinkSearch=rt(ee.reflinkSearch,"g").replace("reflink",ee.reflink).replace("nolink",ee.nolink).getRegex();ee.normal={...ee};ee.pedantic={...ee.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:rt(/^!?\[(label)\]\((.*?)\)/).replace("label",ee._label).getRegex(),reflink:rt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ee._label).getRegex()};ee.gfm={...ee.normal,escape:rt(ee.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/};ee.gfm.url=rt(ee.gfm.url,"i").replace("email",ee.gfm._extended_email).getRegex();ee.breaks={...ee.gfm,br:rt(ee.br).replace("{2,}","*").getRegex(),text:rt(ee.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};class Oo{constructor(e){mt(this,"tokens");mt(this,"options");mt(this,"state");mt(this,"tokenizer");mt(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Xa,this.options.tokenizer=this.options.tokenizer||new Wh,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={block:he.normal,inline:ee.normal};this.options.pedantic?(n.block=he.pedantic,n.inline=ee.pedantic):this.options.gfm&&(n.block=he.gfm,this.options.breaks?n.inline=ee.breaks:n.inline=ee.gfm),this.tokenizer.rules=n}static get rules(){return{block:he,inline:ee}}static lex(e,n){return new Oo(n).lex(e)}static lexInline(e,n){return new Oo(n).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,`
121
- `),this.blockTokens(e,this.tokens);let n;for(;n=this.inlineQueue.shift();)this.inlineTokens(n.src,n.tokens);return this.tokens}blockTokens(e,n=[]){this.options.pedantic?e=e.replace(/\t/g," ").replace(/^ +$/gm,""):e=e.replace(/^( *)(\t+)/gm,(a,l,c)=>l+" ".repeat(c.length));let r,o,i,s;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(r=a.call({lexer:this},e,n))?(e=e.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length),r.raw.length===1&&n.length>0?n[n.length-1].raw+=`
122
- `:n.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length),o=n[n.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=`
123
- `+r.raw,o.text+=`
124
- `+r.text,this.inlineQueue[this.inlineQueue.length-1].src=o.text):n.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length),o=n[n.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=`
125
- `+r.raw,o.text+=`
126
- `+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=o.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),n.push(r);continue}if(i=e,this.options.extensions&&this.options.extensions.startBlock){let a=1/0;const l=e.slice(1);let c;this.options.extensions.startBlock.forEach(u=>{c=u.call({lexer:this},l),typeof c=="number"&&c>=0&&(a=Math.min(a,c))}),a<1/0&&a>=0&&(i=e.substring(0,a+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){o=n[n.length-1],s&&o.type==="paragraph"?(o.raw+=`
127
- `+r.raw,o.text+=`
128
- `+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):n.push(r),s=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length),o=n[n.length-1],o&&o.type==="text"?(o.raw+=`
129
- `+r.raw,o.text+=`
130
- `+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):n.push(r);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){let r,o,i,s=e,a,l,c;if(this.tokens.links){const u=Object.keys(this.tokens.links);if(u.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)u.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,a.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(u=>(r=u.call({lexer:this},e,n))?(e=e.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),o=n[n.length-1],o&&r.type==="text"&&o.type==="text"?(o.raw+=r.raw,o.text+=r.text):n.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length),o=n[n.length-1],o&&r.type==="text"&&o.type==="text"?(o.raw+=r.raw,o.text+=r.text):n.push(r);continue}if(r=this.tokenizer.emStrong(e,s,c)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),n.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),n.push(r);continue}if(i=e,this.options.extensions&&this.options.extensions.startInline){let u=1/0;const d=e.slice(1);let f;this.options.extensions.startInline.forEach(p=>{f=p.call({lexer:this},d),typeof f=="number"&&f>=0&&(u=Math.min(u,f))}),u<1/0&&u>=0&&(i=e.substring(0,u+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!=="_"&&(c=r.raw.slice(-1)),l=!0,o=n[n.length-1],o&&o.type==="text"?(o.raw+=r.raw,o.text+=r.text):n.push(r);continue}if(e){const u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return n}}class Kh{constructor(e){mt(this,"options");this.options=e||Xa}code(e,n,r){var i;const o=(i=(n||"").match(/^\S*/))==null?void 0:i[0];return e=e.replace(/\n$/,"")+`
131
- `,o?'<pre><code class="language-'+sr(o)+'">'+(r?e:sr(e,!0))+`</code></pre>
132
- `:"<pre><code>"+(r?e:sr(e,!0))+`</code></pre>
133
- `}blockquote(e){return`<blockquote>
134
- ${e}</blockquote>
135
- `}html(e,n){return e}heading(e,n,r){return`<h${n}>${e}</h${n}>
136
- `}hr(){return`<hr>
137
- `}list(e,n,r){const o=n?"ol":"ul",i=n&&r!==1?' start="'+r+'"':"";return"<"+o+i+`>
138
- `+e+"</"+o+`>
139
- `}listitem(e,n,r){return`<li>${e}</li>
140
- `}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return`<p>${e}</p>
141
- `}table(e,n){return n&&(n=`<tbody>${n}</tbody>`),`<table>
142
- <thead>
143
- `+e+`</thead>
144
- `+n+`</table>
145
- `}tablerow(e){return`<tr>
146
- ${e}</tr>
147
- `}tablecell(e,n){const r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+e+`</${r}>
148
- `}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,n,r){const o=SS(e);if(o===null)return r;e=o;let i='<a href="'+e+'"';return n&&(i+=' title="'+n+'"'),i+=">"+r+"</a>",i}image(e,n,r){const o=SS(e);if(o===null)return r;e=o;let i=`<img src="${e}" alt="${r}"`;return n&&(i+=` title="${n}"`),i+=">",i}text(e){return e}}class U1{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,n,r){return""+r}image(e,n,r){return""+r}br(){return""}}class Mo{constructor(e){mt(this,"options");mt(this,"renderer");mt(this,"textRenderer");this.options=e||Xa,this.options.renderer=this.options.renderer||new Kh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new U1}static parse(e,n){return new Mo(n).parse(e)}static parseInline(e,n){return new Mo(n).parseInline(e)}parse(e,n=!0){let r="";for(let o=0;o<e.length;o++){const i=e[o];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const s=i,a=this.options.extensions.renderers[s.type].call({parser:this},s);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(s.type)){r+=a||"";continue}}switch(i.type){case"space":continue;case"hr":{r+=this.renderer.hr();continue}case"heading":{const s=i;r+=this.renderer.heading(this.parseInline(s.tokens),s.depth,y8(this.parseInline(s.tokens,this.textRenderer)));continue}case"code":{const s=i;r+=this.renderer.code(s.text,s.lang,!!s.escaped);continue}case"table":{const s=i;let a="",l="";for(let u=0;u<s.header.length;u++)l+=this.renderer.tablecell(this.parseInline(s.header[u].tokens),{header:!0,align:s.align[u]});a+=this.renderer.tablerow(l);let c="";for(let u=0;u<s.rows.length;u++){const d=s.rows[u];l="";for(let f=0;f<d.length;f++)l+=this.renderer.tablecell(this.parseInline(d[f].tokens),{header:!1,align:s.align[f]});c+=this.renderer.tablerow(l)}r+=this.renderer.table(a,c);continue}case"blockquote":{const s=i,a=this.parse(s.tokens);r+=this.renderer.blockquote(a);continue}case"list":{const s=i,a=s.ordered,l=s.start,c=s.loose;let u="";for(let d=0;d<s.items.length;d++){const f=s.items[d],p=f.checked,m=f.task;let g="";if(f.task){const y=this.renderer.checkbox(!!p);c?f.tokens.length>0&&f.tokens[0].type==="paragraph"?(f.tokens[0].text=y+" "+f.tokens[0].text,f.tokens[0].tokens&&f.tokens[0].tokens.length>0&&f.tokens[0].tokens[0].type==="text"&&(f.tokens[0].tokens[0].text=y+" "+f.tokens[0].tokens[0].text)):f.tokens.unshift({type:"text",text:y+" "}):g+=y+" "}g+=this.parse(f.tokens,c),u+=this.renderer.listitem(g,m,!!p)}r+=this.renderer.list(u,a,l);continue}case"html":{const s=i;r+=this.renderer.html(s.text,s.block);continue}case"paragraph":{const s=i;r+=this.renderer.paragraph(this.parseInline(s.tokens));continue}case"text":{let s=i,a=s.tokens?this.parseInline(s.tokens):s.text;for(;o+1<e.length&&e[o+1].type==="text";)s=e[++o],a+=`
149
- `+(s.tokens?this.parseInline(s.tokens):s.text);r+=n?this.renderer.paragraph(a):a;continue}default:{const s='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return r}parseInline(e,n){n=n||this.renderer;let r="";for(let o=0;o<e.length;o++){const i=e[o];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const s=this.options.extensions.renderers[i.type].call({parser:this},i);if(s!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=s||"";continue}}switch(i.type){case"escape":{const s=i;r+=n.text(s.text);break}case"html":{const s=i;r+=n.html(s.text);break}case"link":{const s=i;r+=n.link(s.href,s.title,this.parseInline(s.tokens,n));break}case"image":{const s=i;r+=n.image(s.href,s.title,s.text);break}case"strong":{const s=i;r+=n.strong(this.parseInline(s.tokens,n));break}case"em":{const s=i;r+=n.em(this.parseInline(s.tokens,n));break}case"codespan":{const s=i;r+=n.codespan(s.text);break}case"br":{r+=n.br();break}case"del":{const s=i;r+=n.del(this.parseInline(s.tokens,n));break}case"text":{const s=i;r+=n.text(s.text);break}default:{const s='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return r}}class rd{constructor(e){mt(this,"options");this.options=e||Xa}preprocess(e){return e}postprocess(e){return e}}mt(rd,"passThroughHooks",new Set(["preprocess","postprocess"]));var vf,E0,Rm,dM;class k8{constructor(...e){Zg(this,vf);Zg(this,Rm);mt(this,"defaults",B1());mt(this,"options",this.setOptions);mt(this,"parse",Hf(this,vf,E0).call(this,Oo.lex,Mo.parse));mt(this,"parseInline",Hf(this,vf,E0).call(this,Oo.lexInline,Mo.parseInline));mt(this,"Parser",Mo);mt(this,"Renderer",Kh);mt(this,"TextRenderer",U1);mt(this,"Lexer",Oo);mt(this,"Tokenizer",Wh);mt(this,"Hooks",rd);this.use(...e)}walkTokens(e,n){var o,i;let r=[];for(const s of e)switch(r=r.concat(n.call(this,s)),s.type){case"table":{const a=s;for(const l of a.header)r=r.concat(this.walkTokens(l.tokens,n));for(const l of a.rows)for(const c of l)r=r.concat(this.walkTokens(c.tokens,n));break}case"list":{const a=s;r=r.concat(this.walkTokens(a.items,n));break}default:{const a=s;(i=(o=this.defaults.extensions)==null?void 0:o.childTokens)!=null&&i[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{r=r.concat(this.walkTokens(a[l],n))}):a.tokens&&(r=r.concat(this.walkTokens(a.tokens,n)))}}return r}use(...e){const n=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{const o={...r};if(o.async=this.defaults.async||o.async||!1,r.extensions&&(r.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){const s=n.renderers[i.name];s?n.renderers[i.name]=function(...a){let l=i.renderer.apply(this,a);return l===!1&&(l=s.apply(this,a)),l}:n.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const s=n[i.level];s?s.unshift(i.tokenizer):n[i.level]=[i.tokenizer],i.start&&(i.level==="block"?n.startBlock?n.startBlock.push(i.start):n.startBlock=[i.start]:i.level==="inline"&&(n.startInline?n.startInline.push(i.start):n.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(n.childTokens[i.name]=i.childTokens)}),o.extensions=n),r.renderer){const i=this.defaults.renderer||new Kh(this.defaults);for(const s in r.renderer){const a=r.renderer[s],l=s,c=i[l];i[l]=(...u)=>{let d=a.apply(i,u);return d===!1&&(d=c.apply(i,u)),d||""}}o.renderer=i}if(r.tokenizer){const i=this.defaults.tokenizer||new Wh(this.defaults);for(const s in r.tokenizer){const a=r.tokenizer[s],l=s,c=i[l];i[l]=(...u)=>{let d=a.apply(i,u);return d===!1&&(d=c.apply(i,u)),d}}o.tokenizer=i}if(r.hooks){const i=this.defaults.hooks||new rd;for(const s in r.hooks){const a=r.hooks[s],l=s,c=i[l];rd.passThroughHooks.has(s)?i[l]=u=>{if(this.defaults.async)return Promise.resolve(a.call(i,u)).then(f=>c.call(i,f));const d=a.call(i,u);return c.call(i,d)}:i[l]=(...u)=>{let d=a.apply(i,u);return d===!1&&(d=c.apply(i,u)),d}}o.hooks=i}if(r.walkTokens){const i=this.defaults.walkTokens,s=r.walkTokens;o.walkTokens=function(a){let l=[];return l.push(s.call(this,a)),i&&(l=l.concat(i.call(this,a))),l}}this.defaults={...this.defaults,...o}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,n){return Oo.lex(e,n??this.defaults)}parser(e,n){return Mo.parse(e,n??this.defaults)}}vf=new WeakSet,E0=function(e,n){return(r,o)=>{const i={...o},s={...this.defaults,...i};this.defaults.async===!0&&i.async===!1&&(s.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),s.async=!0);const a=Hf(this,Rm,dM).call(this,!!s.silent,!!s.async);if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(s.hooks&&(s.hooks.options=s),s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(r):r).then(l=>e(l,s)).then(l=>s.walkTokens?Promise.all(this.walkTokens(l,s.walkTokens)).then(()=>l):l).then(l=>n(l,s)).then(l=>s.hooks?s.hooks.postprocess(l):l).catch(a);try{s.hooks&&(r=s.hooks.preprocess(r));const l=e(r,s);s.walkTokens&&this.walkTokens(l,s.walkTokens);let c=n(l,s);return s.hooks&&(c=s.hooks.postprocess(c)),c}catch(l){return a(l)}}},Rm=new WeakSet,dM=function(e,n){return r=>{if(r.message+=`
150
- Please report this to https://github.com/markedjs/marked.`,e){const o="<p>An error occurred:</p><pre>"+sr(r.message+"",!0)+"</pre>";return n?Promise.resolve(o):o}if(n)return Promise.reject(r);throw r}};const ja=new k8;function ct(t,e){return ja.parse(t,e)}ct.options=ct.setOptions=function(t){return ja.setOptions(t),ct.defaults=ja.defaults,lM(ct.defaults),ct};ct.getDefaults=B1;ct.defaults=Xa;ct.use=function(...t){return ja.use(...t),ct.defaults=ja.defaults,lM(ct.defaults),ct};ct.walkTokens=function(t,e){return ja.walkTokens(t,e)};ct.parseInline=ja.parseInline;ct.Parser=Mo;ct.parser=Mo.parse;ct.Renderer=Kh;ct.TextRenderer=U1;ct.Lexer=Oo;ct.lexer=Oo.lex;ct.Tokenizer=Wh;ct.Hooks=rd;ct.parse=ct;ct.options;ct.setOptions;ct.use;ct.walkTokens;ct.parseInline;Mo.parse;const S8=Oo.lex;function E8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function _8(t){var e=E8(t,"string");return typeof e=="symbol"?e:String(e)}function $n(t,e,n){return e=_8(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _0(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function V1(t,e){if(t){if(typeof t=="string")return _0(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _0(t,e)}}function fM(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=V1(t))||e&&t&&typeof t.length=="number"){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(l){throw l},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
151
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,s=!1,a;return{s:function(){n=n.call(t)},n:function(){var l=n.next();return i=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!i&&n.return!=null&&n.return()}finally{if(s)throw a}}}}function C8(t){if(Array.isArray(t))return _0(t)}function T8(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function O8(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
152
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wd(t){return C8(t)||T8(t)||V1(t)||O8()}function M8(t){if(Array.isArray(t))return t}function R8(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(u){c=!0,o=u}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}function N8(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
153
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function P8(t,e){return M8(t)||R8(t,e)||V1(t,e)||N8()}var pM={x3d:"application/vnd.hzn-3d-crossword","3gp":"video/3gpp","3g2":"video/3gpp2",mseq:"application/vnd.mseq",pwn:"application/vnd.3m.post-it-notes",plb:"application/vnd.3gpp.pic-bw-large",psb:"application/vnd.3gpp.pic-bw-small",pvb:"application/vnd.3gpp.pic-bw-var",tcap:"application/vnd.3gpp2.tcap","7z":"application/x-7z-compressed",abw:"application/x-abiword",ace:"application/x-ace-compressed",acc:"application/vnd.americandynamics.acc",acu:"application/vnd.acucobol",atc:"application/vnd.acucorp",adp:"audio/adpcm",aab:"application/x-authorware-bin",aam:"application/x-authorware-map",aas:"application/x-authorware-seg",air:"application/vnd.adobe.air-application-installer-package+zip",swf:"application/x-shockwave-flash",fxp:"application/vnd.adobe.fxp",pdf:"application/pdf",ppd:"application/vnd.cups-ppd",dir:"application/x-director",xdp:"application/vnd.adobe.xdp+xml",xfdf:"application/vnd.adobe.xfdf",aac:"audio/x-aac",ahead:"application/vnd.ahead.space",azf:"application/vnd.airzip.filesecure.azf",azs:"application/vnd.airzip.filesecure.azs",azw:"application/vnd.amazon.ebook",ami:"application/vnd.amiga.ami","N/A":"application/andrew-inset",apk:"application/vnd.android.package-archive",cii:"application/vnd.anser-web-certificate-issue-initiation",fti:"application/vnd.anser-web-funds-transfer-initiation",atx:"application/vnd.antix.game-component",dmg:"application/x-apple-diskimage",mpkg:"application/vnd.apple.installer+xml",aw:"application/applixware",mp3:"audio/mpeg",les:"application/vnd.hhe.lesson-player",swi:"application/vnd.aristanetworks.swi",s:"text/x-asm",atomcat:"application/atomcat+xml",atomsvc:"application/atomsvc+xml",atom:"application/atom+xml",ac:"application/pkix-attr-cert",aif:"audio/x-aiff",avi:"video/x-msvideo",aep:"application/vnd.audiograph",dxf:"image/vnd.dxf",dwf:"model/vnd.dwf",par:"text/plain-bas",bcpio:"application/x-bcpio",bin:"application/octet-stream",bmp:"image/bmp",torrent:"application/x-bittorrent",cod:"application/vnd.rim.cod",mpm:"application/vnd.blueice.multipass",bmi:"application/vnd.bmi",sh:"application/x-sh",btif:"image/prs.btif",rep:"application/vnd.businessobjects",bz:"application/x-bzip",bz2:"application/x-bzip2",csh:"application/x-csh",c:"text/x-c",cdxml:"application/vnd.chemdraw+xml",css:"text/css",cdx:"chemical/x-cdx",cml:"chemical/x-cml",csml:"chemical/x-csml",cdbcmsg:"application/vnd.contact.cmsg",cla:"application/vnd.claymore",c4g:"application/vnd.clonk.c4group",sub:"image/vnd.dvb.subtitle",cdmia:"application/cdmi-capability",cdmic:"application/cdmi-container",cdmid:"application/cdmi-domain",cdmio:"application/cdmi-object",cdmiq:"application/cdmi-queue",c11amc:"application/vnd.cluetrust.cartomobile-config",c11amz:"application/vnd.cluetrust.cartomobile-config-pkg",ras:"image/x-cmu-raster",dae:"model/vnd.collada+xml",csv:"text/csv",cpt:"application/mac-compactpro",wmlc:"application/vnd.wap.wmlc",cgm:"image/cgm",ice:"x-conference/x-cooltalk",cmx:"image/x-cmx",xar:"application/vnd.xara",cmc:"application/vnd.cosmocaller",cpio:"application/x-cpio",clkx:"application/vnd.crick.clicker",clkk:"application/vnd.crick.clicker.keyboard",clkp:"application/vnd.crick.clicker.palette",clkt:"application/vnd.crick.clicker.template",clkw:"application/vnd.crick.clicker.wordbank",wbs:"application/vnd.criticaltools.wbs+xml",cryptonote:"application/vnd.rig.cryptonote",cif:"chemical/x-cif",cmdf:"chemical/x-cmdf",cu:"application/cu-seeme",cww:"application/prs.cww",curl:"text/vnd.curl",dcurl:"text/vnd.curl.dcurl",mcurl:"text/vnd.curl.mcurl",scurl:"text/vnd.curl.scurl",car:"application/vnd.curl.car",pcurl:"application/vnd.curl.pcurl",cmp:"application/vnd.yellowriver-custom-menu",dssc:"application/dssc+der",xdssc:"application/dssc+xml",deb:"application/x-debian-package",uva:"audio/vnd.dece.audio",uvi:"image/vnd.dece.graphic",uvh:"video/vnd.dece.hd",uvm:"video/vnd.dece.mobile",uvu:"video/vnd.uvvu.mp4",uvp:"video/vnd.dece.pd",uvs:"video/vnd.dece.sd",uvv:"video/vnd.dece.video",dvi:"application/x-dvi",seed:"application/vnd.fdsn.seed",dtb:"application/x-dtbook+xml",res:"application/x-dtbresource+xml",ait:"application/vnd.dvb.ait",svc:"application/vnd.dvb.service",eol:"audio/vnd.digital-winds",djvu:"image/vnd.djvu",dtd:"application/xml-dtd",mlp:"application/vnd.dolby.mlp",wad:"application/x-doom",dpg:"application/vnd.dpgraph",dra:"audio/vnd.dra",dfac:"application/vnd.dreamfactory",dts:"audio/vnd.dts",dtshd:"audio/vnd.dts.hd",dwg:"image/vnd.dwg",geo:"application/vnd.dynageo",es:"application/ecmascript",mag:"application/vnd.ecowin.chart",mmr:"image/vnd.fujixerox.edmics-mmr",rlc:"image/vnd.fujixerox.edmics-rlc",exi:"application/exi",mgz:"application/vnd.proteus.magazine",epub:"application/epub+zip",eml:"message/rfc822",nml:"application/vnd.enliven",xpr:"application/vnd.is-xpr",xif:"image/vnd.xiff",xfdl:"application/vnd.xfdl",emma:"application/emma+xml",ez2:"application/vnd.ezpix-album",ez3:"application/vnd.ezpix-package",fst:"image/vnd.fst",fvt:"video/vnd.fvt",fbs:"image/vnd.fastbidsheet",fe_launch:"application/vnd.denovo.fcselayout-link",f4v:"video/x-f4v",flv:"video/x-flv",fpx:"image/vnd.fpx",npx:"image/vnd.net-fpx",flx:"text/vnd.fmi.flexstor",fli:"video/x-fli",ftc:"application/vnd.fluxtime.clip",fdf:"application/vnd.fdf",f:"text/x-fortran",mif:"application/vnd.mif",fm:"application/vnd.framemaker",fh:"image/x-freehand",fsc:"application/vnd.fsc.weblaunch",fnc:"application/vnd.frogans.fnc",ltf:"application/vnd.frogans.ltf",ddd:"application/vnd.fujixerox.ddd",xdw:"application/vnd.fujixerox.docuworks",xbd:"application/vnd.fujixerox.docuworks.binder",oas:"application/vnd.fujitsu.oasys",oa2:"application/vnd.fujitsu.oasys2",oa3:"application/vnd.fujitsu.oasys3",fg5:"application/vnd.fujitsu.oasysgp",bh2:"application/vnd.fujitsu.oasysprs",spl:"application/x-futuresplash",fzs:"application/vnd.fuzzysheet",g3:"image/g3fax",gmx:"application/vnd.gmx",gtw:"model/vnd.gtw",txd:"application/vnd.genomatix.tuxedo",ggb:"application/vnd.geogebra.file",ggt:"application/vnd.geogebra.tool",gdl:"model/vnd.gdl",gex:"application/vnd.geometry-explorer",gxt:"application/vnd.geonext",g2w:"application/vnd.geoplan",g3w:"application/vnd.geospace",gsf:"application/x-font-ghostscript",bdf:"application/x-font-bdf",gtar:"application/x-gtar",texinfo:"application/x-texinfo",gnumeric:"application/x-gnumeric",kml:"application/vnd.google-earth.kml+xml",kmz:"application/vnd.google-earth.kmz",gqf:"application/vnd.grafeq",gif:"image/gif",gv:"text/vnd.graphviz",gac:"application/vnd.groove-account",ghf:"application/vnd.groove-help",gim:"application/vnd.groove-identity-message",grv:"application/vnd.groove-injector",gtm:"application/vnd.groove-tool-message",tpl:"application/vnd.groove-tool-template",vcg:"application/vnd.groove-vcard",h261:"video/h261",h263:"video/h263",h264:"video/h264",hpid:"application/vnd.hp-hpid",hps:"application/vnd.hp-hps",hdf:"application/x-hdf",rip:"audio/vnd.rip",hbci:"application/vnd.hbci",jlt:"application/vnd.hp-jlyt",pcl:"application/vnd.hp-pcl",hpgl:"application/vnd.hp-hpgl",hvs:"application/vnd.yamaha.hv-script",hvd:"application/vnd.yamaha.hv-dic",hvp:"application/vnd.yamaha.hv-voice","sfd-hdstx":"application/vnd.hydrostatix.sof-data",stk:"application/hyperstudio",hal:"application/vnd.hal+xml",html:"text/html",irm:"application/vnd.ibm.rights-management",sc:"application/vnd.ibm.secure-container",ics:"text/calendar",icc:"application/vnd.iccprofile",ico:"image/x-icon",igl:"application/vnd.igloader",ief:"image/ief",ivp:"application/vnd.immervision-ivp",ivu:"application/vnd.immervision-ivu",rif:"application/reginfo+xml","3dml":"text/vnd.in3d.3dml",spot:"text/vnd.in3d.spot",igs:"model/iges",i2g:"application/vnd.intergeo",cdy:"application/vnd.cinderella",xpw:"application/vnd.intercon.formnet",fcs:"application/vnd.isac.fcs",ipfix:"application/ipfix",cer:"application/pkix-cert",pki:"application/pkixcmp",crl:"application/pkix-crl",pkipath:"application/pkix-pkipath",igm:"application/vnd.insors.igm",rcprofile:"application/vnd.ipunplugged.rcprofile",irp:"application/vnd.irepository.package+xml",jad:"text/vnd.sun.j2me.app-descriptor",jar:"application/java-archive",class:"application/java-vm",jnlp:"application/x-java-jnlp-file",ser:"application/java-serialized-object",java:"text/x-java-source,java",js:"application/javascript",json:"application/json",joda:"application/vnd.joost.joda-archive",jpm:"video/jpm",jpeg:"image/jpeg",jpg:"image/jpeg",pjpeg:"image/pjpeg",jpgv:"video/jpeg",ktz:"application/vnd.kahootz",mmd:"application/vnd.chipnuts.karaoke-mmd",karbon:"application/vnd.kde.karbon",chrt:"application/vnd.kde.kchart",kfo:"application/vnd.kde.kformula",flw:"application/vnd.kde.kivio",kon:"application/vnd.kde.kontour",kpr:"application/vnd.kde.kpresenter",ksp:"application/vnd.kde.kspread",kwd:"application/vnd.kde.kword",htke:"application/vnd.kenameaapp",kia:"application/vnd.kidspiration",kne:"application/vnd.kinar",sse:"application/vnd.kodak-descriptor",lasxml:"application/vnd.las.las+xml",latex:"application/x-latex",lbd:"application/vnd.llamagraphics.life-balance.desktop",lbe:"application/vnd.llamagraphics.life-balance.exchange+xml",jam:"application/vnd.jam",123:"application/vnd.lotus-1-2-3",apr:"application/vnd.lotus-approach",pre:"application/vnd.lotus-freelance",nsf:"application/vnd.lotus-notes",org:"application/vnd.lotus-organizer",scm:"application/vnd.lotus-screencam",lwp:"application/vnd.lotus-wordpro",lvp:"audio/vnd.lucent.voice",m3u:"audio/x-mpegurl",m4v:"video/x-m4v",hqx:"application/mac-binhex40",portpkg:"application/vnd.macports.portpkg",mgp:"application/vnd.osgeo.mapguide.package",mrc:"application/marc",mrcx:"application/marcxml+xml",mxf:"application/mxf",nbp:"application/vnd.wolfram.player",ma:"application/mathematica",mathml:"application/mathml+xml",mbox:"application/mbox",mc1:"application/vnd.medcalcdata",mscml:"application/mediaservercontrol+xml",cdkey:"application/vnd.mediastation.cdkey",mwf:"application/vnd.mfer",mfm:"application/vnd.mfmp",msh:"model/mesh",mads:"application/mads+xml",mets:"application/mets+xml",mods:"application/mods+xml",meta4:"application/metalink4+xml",mcd:"application/vnd.mcd",flo:"application/vnd.micrografx.flo",igx:"application/vnd.micrografx.igx",es3:"application/vnd.eszigno3+xml",mdb:"application/x-msaccess",asf:"video/x-ms-asf",exe:"application/x-msdownload",cil:"application/vnd.ms-artgalry",cab:"application/vnd.ms-cab-compressed",ims:"application/vnd.ms-ims",application:"application/x-ms-application",clp:"application/x-msclip",mdi:"image/vnd.ms-modi",eot:"application/vnd.ms-fontobject",xls:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xltm:"application/vnd.ms-excel.template.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",chm:"application/vnd.ms-htmlhelp",crd:"application/x-mscardfile",lrm:"application/vnd.ms-lrm",mvb:"application/x-msmediaview",mny:"application/x-msmoney",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",sldx:"application/vnd.openxmlformats-officedocument.presentationml.slide",ppsx:"application/vnd.openxmlformats-officedocument.presentationml.slideshow",potx:"application/vnd.openxmlformats-officedocument.presentationml.template",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",obd:"application/x-msbinder",thmx:"application/vnd.ms-officetheme",onetoc:"application/onenote",pya:"audio/vnd.ms-playready.media.pya",pyv:"video/vnd.ms-playready.media.pyv",ppt:"application/vnd.ms-powerpoint",ppam:"application/vnd.ms-powerpoint.addin.macroenabled.12",sldm:"application/vnd.ms-powerpoint.slide.macroenabled.12",pptm:"application/vnd.ms-powerpoint.presentation.macroenabled.12",ppsm:"application/vnd.ms-powerpoint.slideshow.macroenabled.12",potm:"application/vnd.ms-powerpoint.template.macroenabled.12",mpp:"application/vnd.ms-project",pub:"application/x-mspublisher",scd:"application/x-msschedule",xap:"application/x-silverlight-app",stl:"application/vnd.ms-pki.stl",cat:"application/vnd.ms-pki.seccat",vsd:"application/vnd.visio",vsdx:"application/vnd.visio2013",wm:"video/x-ms-wm",wma:"audio/x-ms-wma",wax:"audio/x-ms-wax",wmx:"video/x-ms-wmx",wmd:"application/x-ms-wmd",wpl:"application/vnd.ms-wpl",wmz:"application/x-ms-wmz",wmv:"video/x-ms-wmv",wvx:"video/x-ms-wvx",wmf:"application/x-msmetafile",trm:"application/x-msterminal",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",dotm:"application/vnd.ms-word.template.macroenabled.12",wri:"application/x-mswrite",wps:"application/vnd.ms-works",xbap:"application/x-ms-xbap",xps:"application/vnd.ms-xpsdocument",mid:"audio/midi",mpy:"application/vnd.ibm.minipay",afp:"application/vnd.ibm.modcap",rms:"application/vnd.jcp.javame.midlet-rms",tmo:"application/vnd.tmobile-livetv",prc:"application/x-mobipocket-ebook",mbk:"application/vnd.mobius.mbk",dis:"application/vnd.mobius.dis",plc:"application/vnd.mobius.plc",mqy:"application/vnd.mobius.mqy",msl:"application/vnd.mobius.msl",txf:"application/vnd.mobius.txf",daf:"application/vnd.mobius.daf",fly:"text/vnd.fly",mpc:"application/vnd.mophun.certificate",mpn:"application/vnd.mophun.application",mj2:"video/mj2",mpga:"audio/mpeg",mxu:"video/vnd.mpegurl",mpeg:"video/mpeg",m21:"application/mp21",mp4a:"audio/mp4",mp4:"video/mp4",m3u8:"application/vnd.apple.mpegurl",mus:"application/vnd.musician",msty:"application/vnd.muvee.style",mxml:"application/xv+xml",ngdat:"application/vnd.nokia.n-gage.data","n-gage":"application/vnd.nokia.n-gage.symbian.install",ncx:"application/x-dtbncx+xml",nc:"application/x-netcdf",nlu:"application/vnd.neurolanguage.nlu",dna:"application/vnd.dna",nnd:"application/vnd.noblenet-directory",nns:"application/vnd.noblenet-sealer",nnw:"application/vnd.noblenet-web",rpst:"application/vnd.nokia.radio-preset",rpss:"application/vnd.nokia.radio-presets",n3:"text/n3",edm:"application/vnd.novadigm.edm",edx:"application/vnd.novadigm.edx",ext:"application/vnd.novadigm.ext",gph:"application/vnd.flographit",ecelp4800:"audio/vnd.nuera.ecelp4800",ecelp7470:"audio/vnd.nuera.ecelp7470",ecelp9600:"audio/vnd.nuera.ecelp9600",oda:"application/oda",ogx:"application/ogg",oga:"audio/ogg",ogv:"video/ogg",dd2:"application/vnd.oma.dd2+xml",oth:"application/vnd.oasis.opendocument.text-web",opf:"application/oebps-package+xml",qbo:"application/vnd.intu.qbo",oxt:"application/vnd.openofficeorg.extension",osf:"application/vnd.yamaha.openscoreformat",weba:"audio/webm",webm:"video/webm",odc:"application/vnd.oasis.opendocument.chart",otc:"application/vnd.oasis.opendocument.chart-template",odb:"application/vnd.oasis.opendocument.database",odf:"application/vnd.oasis.opendocument.formula",odft:"application/vnd.oasis.opendocument.formula-template",odg:"application/vnd.oasis.opendocument.graphics",otg:"application/vnd.oasis.opendocument.graphics-template",odi:"application/vnd.oasis.opendocument.image",oti:"application/vnd.oasis.opendocument.image-template",odp:"application/vnd.oasis.opendocument.presentation",otp:"application/vnd.oasis.opendocument.presentation-template",ods:"application/vnd.oasis.opendocument.spreadsheet",ots:"application/vnd.oasis.opendocument.spreadsheet-template",odt:"application/vnd.oasis.opendocument.text",odm:"application/vnd.oasis.opendocument.text-master",ott:"application/vnd.oasis.opendocument.text-template",ktx:"image/ktx",sxc:"application/vnd.sun.xml.calc",stc:"application/vnd.sun.xml.calc.template",sxd:"application/vnd.sun.xml.draw",std:"application/vnd.sun.xml.draw.template",sxi:"application/vnd.sun.xml.impress",sti:"application/vnd.sun.xml.impress.template",sxm:"application/vnd.sun.xml.math",sxw:"application/vnd.sun.xml.writer",sxg:"application/vnd.sun.xml.writer.global",stw:"application/vnd.sun.xml.writer.template",otf:"application/x-font-otf",osfpvg:"application/vnd.yamaha.openscoreformat.osfpvg+xml",dp:"application/vnd.osgi.dp",pdb:"application/vnd.palm",p:"text/x-pascal",paw:"application/vnd.pawaafile",pclxl:"application/vnd.hp-pclxl",efif:"application/vnd.picsel",pcx:"image/x-pcx",psd:"image/vnd.adobe.photoshop",prf:"application/pics-rules",pic:"image/x-pict",chat:"application/x-chat",p10:"application/pkcs10",p12:"application/x-pkcs12",p7m:"application/pkcs7-mime",p7s:"application/pkcs7-signature",p7r:"application/x-pkcs7-certreqresp",p7b:"application/x-pkcs7-certificates",p8:"application/pkcs8",plf:"application/vnd.pocketlearn",pnm:"image/x-portable-anymap",pbm:"image/x-portable-bitmap",pcf:"application/x-font-pcf",pfr:"application/font-tdpfr",pgn:"application/x-chess-pgn",pgm:"image/x-portable-graymap",png:"image/png",ppm:"image/x-portable-pixmap",pskcxml:"application/pskc+xml",pml:"application/vnd.ctc-posml",ai:"application/postscript",pfa:"application/x-font-type1",pbd:"application/vnd.powerbuilder6",pgp:"application/pgp-signature",box:"application/vnd.previewsystems.box",ptid:"application/vnd.pvi.ptid1",pls:"application/pls+xml",str:"application/vnd.pg.format",ei6:"application/vnd.pg.osasli",dsc:"text/prs.lines.tag",psf:"application/x-font-linux-psf",qps:"application/vnd.publishare-delta-tree",wg:"application/vnd.pmi.widget",qxd:"application/vnd.quark.quarkxpress",esf:"application/vnd.epson.esf",msf:"application/vnd.epson.msf",ssf:"application/vnd.epson.ssf",qam:"application/vnd.epson.quickanime",qfx:"application/vnd.intu.qfx",qt:"video/quicktime",rar:"application/x-rar-compressed",ram:"audio/x-pn-realaudio",rmp:"audio/x-pn-realaudio-plugin",rsd:"application/rsd+xml",rm:"application/vnd.rn-realmedia",bed:"application/vnd.realvnc.bed",mxl:"application/vnd.recordare.musicxml",musicxml:"application/vnd.recordare.musicxml+xml",rnc:"application/relax-ng-compact-syntax",rdz:"application/vnd.data-vision.rdz",rdf:"application/rdf+xml",rp9:"application/vnd.cloanto.rp9",jisp:"application/vnd.jisp",rtf:"application/rtf",rtx:"text/richtext",link66:"application/vnd.route66.link66+xml",rss:"application/rss+xml",shf:"application/shf+xml",st:"application/vnd.sailingtracker.track",svg:"image/svg+xml",sus:"application/vnd.sus-calendar",sru:"application/sru+xml",setpay:"application/set-payment-initiation",setreg:"application/set-registration-initiation",sema:"application/vnd.sema",semd:"application/vnd.semd",semf:"application/vnd.semf",see:"application/vnd.seemail",snf:"application/x-font-snf",spq:"application/scvp-vp-request",spp:"application/scvp-vp-response",scq:"application/scvp-cv-request",scs:"application/scvp-cv-response",sdp:"application/sdp",etx:"text/x-setext",movie:"video/x-sgi-movie",ifm:"application/vnd.shana.informed.formdata",itp:"application/vnd.shana.informed.formtemplate",iif:"application/vnd.shana.informed.interchange",ipk:"application/vnd.shana.informed.package",tfi:"application/thraud+xml",shar:"application/x-shar",rgb:"image/x-rgb",slt:"application/vnd.epson.salt",aso:"application/vnd.accpac.simply.aso",imp:"application/vnd.accpac.simply.imp",twd:"application/vnd.simtech-mindmapper",csp:"application/vnd.commonspace",saf:"application/vnd.yamaha.smaf-audio",mmf:"application/vnd.smaf",spf:"application/vnd.yamaha.smaf-phrase",teacher:"application/vnd.smart.teacher",svd:"application/vnd.svd",rq:"application/sparql-query",srx:"application/sparql-results+xml",gram:"application/srgs",grxml:"application/srgs+xml",ssml:"application/ssml+xml",skp:"application/vnd.koan",sgml:"text/sgml",sdc:"application/vnd.stardivision.calc",sda:"application/vnd.stardivision.draw",sdd:"application/vnd.stardivision.impress",smf:"application/vnd.stardivision.math",sdw:"application/vnd.stardivision.writer",sgl:"application/vnd.stardivision.writer-global",sm:"application/vnd.stepmania.stepchart",sit:"application/x-stuffit",sitx:"application/x-stuffitx",sdkm:"application/vnd.solent.sdkm+xml",xo:"application/vnd.olpc-sugar",au:"audio/basic",wqd:"application/vnd.wqd",sis:"application/vnd.symbian.install",smi:"application/smil+xml",xsm:"application/vnd.syncml+xml",bdm:"application/vnd.syncml.dm+wbxml",xdm:"application/vnd.syncml.dm+xml",sv4cpio:"application/x-sv4cpio",sv4crc:"application/x-sv4crc",sbml:"application/sbml+xml",tsv:"text/tab-separated-values",tiff:"image/tiff",tao:"application/vnd.tao.intent-module-archive",tar:"application/x-tar",tcl:"application/x-tcl",tex:"application/x-tex",tfm:"application/x-tex-tfm",tei:"application/tei+xml",txt:"text/plain",dxp:"application/vnd.spotfire.dxp",sfs:"application/vnd.spotfire.sfs",tsd:"application/timestamped-data",tpt:"application/vnd.trid.tpt",mxs:"application/vnd.triscape.mxs",t:"text/troff",tra:"application/vnd.trueapp",ttf:"application/x-font-ttf",ttl:"text/turtle",umj:"application/vnd.umajin",uoml:"application/vnd.uoml+xml",unityweb:"application/vnd.unity",ufd:"application/vnd.ufdl",uri:"text/uri-list",utz:"application/vnd.uiq.theme",ustar:"application/x-ustar",uu:"text/x-uuencode",vcs:"text/x-vcalendar",vcf:"text/x-vcard",vcd:"application/x-cdlink",vsf:"application/vnd.vsf",wrl:"model/vrml",vcx:"application/vnd.vcx",mts:"model/vnd.mts",vtu:"model/vnd.vtu",vis:"application/vnd.visionary",viv:"video/vnd.vivo",ccxml:"application/ccxml+xml,",vxml:"application/voicexml+xml",src:"application/x-wais-source",wbxml:"application/vnd.wap.wbxml",wbmp:"image/vnd.wap.wbmp",wav:"audio/x-wav",davmount:"application/davmount+xml",woff:"application/x-font-woff",wspolicy:"application/wspolicy+xml",webp:"image/webp",wtb:"application/vnd.webturbo",wgt:"application/widget",hlp:"application/winhlp",wml:"text/vnd.wap.wml",wmls:"text/vnd.wap.wmlscript",wmlsc:"application/vnd.wap.wmlscriptc",wpd:"application/vnd.wordperfect",stf:"application/vnd.wt.stf",wsdl:"application/wsdl+xml",xbm:"image/x-xbitmap",xpm:"image/x-xpixmap",xwd:"image/x-xwindowdump",der:"application/x-x509-ca-cert",fig:"application/x-xfig",xhtml:"application/xhtml+xml",xml:"application/xml",xdf:"application/xcap-diff+xml",xenc:"application/xenc+xml",xer:"application/patch-ops-error+xml",rl:"application/resource-lists+xml",rs:"application/rls-services+xml",rld:"application/resource-lists-diff+xml",xslt:"application/xslt+xml",xop:"application/xop+xml",xpi:"application/x-xpinstall",xspf:"application/xspf+xml",xul:"application/vnd.mozilla.xul+xml",xyz:"chemical/x-xyz",yaml:"text/yaml",yang:"application/yang",yin:"application/yin+xml",zir:"application/vnd.zul",zip:"application/zip",zmm:"application/vnd.handheld-entertainment+xml",zaz:"application/vnd.zzazz.deck+xml"},$8=Object.fromEntries(Object.entries(pM).map(function(t){var e=P8(t,2),n=e[0],r=e[1];return[r,n]})),A8=/^data:(.*?);base64,/;function hg(t){var e=A8.exec(t);if(e&&e[1])return e[1]}function mg(t){var e=$8[t];return e||t.split("/")[1]}function I8(t){var e=t.split(".").pop(),n=e&&pM[e];if(n)return n}function D8(t){var e={},n=t.content.map(function(r){return L8(r,e)});return j8(n,e)}function L8(t,e){if(t.type==="heading"){var n,r,o="",i=((n=t.attrs)===null||n===void 0?void 0:n.level)||1;if(Number.isNaN(i))throw new Error("Invalid header depth");for(var s=0;s<Number(i);s++)o+="#";var a=["".concat(o," ")];return{type:"block",children:a.concat.apply(a,Wd(((r=t.content)===null||r===void 0?void 0:r.map(function(d){return C0(d,e)}))||[]))}}else if(t.type==="paragraph"){var l;return!t.content||((l=t.content)===null||l===void 0?void 0:l.length)===0?{type:"block",children:["<br />"]}:{type:"block",children:t.content.map(function(d){return C0(d,e)})}}else if(t.type==="bulletList"||t.type==="orderedList"){var c;return{type:"block",children:((c=t.content)===null||c===void 0?void 0:c.flatMap(function(d,f){return hM(mM(t),d,0,e,f===0)}))||[]}}else{var u=t;throw new Error("Unhandled node type: ".concat("type"in u?"exhaustiveCheck.type":"unknown"))}}function j8(t,e){for(var n=[`
154
- `],r=[],o=0;o<t.length;o++){var i=t[o],s=fM(i.children),a;try{for(s.s();!(a=s.n()).done;){var l=a.value;if(typeof l=="string")n[n.length-1]+=l;else{if(l._type==="file")r.push(l);else if(l._type==="link")r.push(l);else{var c=l;throw new Error("Unexpected node type: ".concat(JSON.stringify(c,null,2)))}n.push("")}}}catch(u){s.e(u)}finally{s.f()}o===t.length-1?n[n.length-1]+=`
155
- `:n[n.length-1]+=`
156
-
157
- `}return $n($n($n($n({},sn,"richtext"),"templateStrings",n),"exprs",r),"files",e)}function CS(t){var e,n=((e=t.marks)===null||e===void 0?void 0:e.flatMap(function(s){return s.type==="bold"?["bold"]:s.type==="italic"?["italic"]:s.type==="strike"?["line-through"]:[]}))||[],r=t.text.trimStart(),o=t.text.length-r.length;r=r.trimEnd();var i=t.text.length-r.length-o;return n.includes("bold")&&n.includes("italic")?r="***".concat(r,"***"):n.includes("bold")?r="**".concat(r,"**"):n.includes("italic")&&(r="_".concat(r,"_")),n.includes("line-through")&&(r="~~".concat(r,"~~")),"".concat(" ".repeat(o)).concat(r).concat(" ".repeat(i))}function C0(t,e){if(t.type==="text"){var n,r=(n=t.marks)===null||n===void 0?void 0:n.find(function(i){return i.type==="link"});return(r==null?void 0:r.type)==="link"?{_type:"link",href:r.attrs.href,children:[CS(t)]}:CS(t)}else{if(t.type==="hardBreak")return"<br />";if(t.type==="image")return F8(t,e);var o=t;throw new Error("Unexpected node type: ".concat(JSON.stringify(o)))}}function hM(t,e,n,r){var o,i,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,a=s?"":`
158
- `,l=["".concat(a).concat(" ".repeat(n)).concat(t)];return((o=e.content)===null||o===void 0||(o=o[0])===null||o===void 0?void 0:o.type)==="bulletList"||((i=e.content)===null||i===void 0||(i=i[0])===null||i===void 0?void 0:i.type)==="orderedList"||l.push(" "),l.concat((e.content||[]).flatMap(function(c,u){return c.type==="bulletList"||c.type==="orderedList"?(c.content||[]).flatMap(function(d){return hM(mM(c),d,n+4,r)}):(c.content||[]).flatMap(function(d){var f,p,m=[];return(f=c.content)!==null&&f!==void 0&&f.length&&((p=c.content)===null||p===void 0?void 0:p.length)>0&&u>0&&m.push(`<br />
159
- `),m.push(C0(d,r)),m})}))}function mM(t){if(t.type==="bulletList")return"-";if(t.type==="orderedList")return"1.";var e=t;throw new Error("Unhandled list node: ".concat(JSON.stringify(e)))}var z8=new TextEncoder;function F8(t,e){if(t.attrs&&t.attrs.src.startsWith("data:")){var n=yt.getSHA256Hash(z8.encode(t.attrs.src)),r=hg(t.attrs.src);if(r===void 0)throw new Error("Could not detect Mime Type for image: ".concat(t.attrs.src));var o=mg(r),i=t.attrs.fileName||"".concat(n,".").concat(o),s="/public/".concat(i);return e[s]=t.attrs.src,$n($n($n($n({},sn,"file"),gn,s),gk,xk),"metadata",{width:typeof t.attrs.width=="number"?t.attrs.width:0,height:typeof t.attrs.height=="number"?t.attrs.height:0,sha256:n||"",mimeType:r})}else if(t.attrs){var a=B8("sha256",t.attrs.src),l=t.attrs.src.split("?")[0];return $n($n($n($n({},sn,"file"),gn,"/public".concat(t.attrs.src.split("?")[0])),gk,xk),"metadata",{width:typeof t.attrs.width=="number"?t.attrs.width:0,height:typeof t.attrs.height=="number"?t.attrs.height:0,sha256:a||"",mimeType:l&&I8(l)||""})}else throw new Error("Invalid image node (no attrs): "+JSON.stringify(t))}function B8(t,e){var n=e.split("?");if(!(n.length<2)){var r=n[1],o=new URLSearchParams(r);if(o.has(t))return o.get(t)}}var qh='<val value="',T0='">',O0="</val>";function Go(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=[];function i(l,c){var u=Go(l.tokens?l.tokens:[],e,0);o.push({tag:"span",classes:[c].concat(u.children.flatMap(function(d){return typeof d=="string"?[]:d.classes})),children:u.children.flatMap(function(d){return typeof d=="string"?d:d.children})})}for(var s=function(){var c=t[n];if(c.type==="heading")o.push({tag:"h".concat(c.depth),children:Go(c.tokens?c.tokens:[],e,0).children});else if(c.type==="paragraph")o.push({tag:"p",children:Go(c.tokens?c.tokens:[],e,0).children});else if(c.type==="strong")i(c,"bold");else if(c.type==="em")i(c,"italic");else if(c.type==="del")i(c,"line-through");else if(c.type==="text")if("tokens"in c&&Array.isArray(c.tokens))o.push.apply(o,Wd(Go(c.tokens,e,n,r).children));else if(r&&typeof c.raw=="string"){var u=c.raw.split(`
160
- `),d=u.flatMap(function(E,C){return C===u.length-1?[E]:C===u.length-1&&E===""?[]:E===""?{tag:"br"}:[E,{tag:"br"}]});o.push.apply(o,Wd(d))}else o.push(c.raw);else if(c.type==="list")o.push({tag:c.ordered?"ol":"ul",children:Go(c.items,e,0).children});else if(c.type==="list_item")o.push({tag:"li",children:Go(c.tokens?c.tokens:[],e,0,!0).children});else if(c.type!=="space")if(c.type==="html"){if(c.text===O0)return{v:{children:o,cursor:n}};var f=c.text.indexOf(T0);if(c.text.startsWith(qh)&&f>-1){var p=Number(c.text.slice(qh.length,f));if(Number.isNaN(p))throw Error("Illegal val intermediate node: ".concat(JSON.stringify(c)));var m=Go(t.map(function(E){return E.type==="link"||E.type==="list"?{type:"text",raw:E.raw,text:E.raw}:E}),e,n+1),g=m.children,y=m.cursor,v=e[p];if(v._type==="link")o.push({tag:"a",href:v.href,children:g});else if(v._type==="file"){var x,w,S;o.push({tag:"img",src:yt.convertFileSource(v).url,width:(x=v.metadata)===null||x===void 0?void 0:x.width,height:(w=v.metadata)===null||w===void 0?void 0:w.height,mimeType:(S=v.metadata)===null||S===void 0?void 0:S.mimeType})}n=y}var _=/<br\s*\/?>/gi;if(c.text.trim().match(_)){var k;o.push({tag:"br"}),((k=t[n+1])===null||k===void 0?void 0:k.raw.trim())===""&&n++}}else c.type==="link"?c.raw===c.href?o.push(c.raw):o.push({tag:"a",href:c.href,children:Go(c.tokens?c.tokens:[],e,0).children}):c.type==="br"?o.push({tag:"br"}):console.error("Could not parse markdown: unsupported token type: ".concat(c.type,". Found: ").concat(c.raw));n++},a;n<t.length;)if(a=s(),a)return a.v;return{children:o,cursor:n}}function gM(t){var e=t.templateStrings,n=t.exprs,r=e.flatMap(function(l,c){var u=n[c];return u?u[sn]==="link"?l.concat("".concat(qh).concat(c).concat(T0).concat(u.children[0]).concat(O0)):l.concat("".concat(qh).concat(c).concat(T0).concat(O0)):l}).join(""),o=S8(r,{gfm:!0}),i=Go(o,n,0),s=i.children,a=i.cursor;if(a!==o.length)throw Error("Unexpectedly terminated markdown parsing. Possible reason: unclosed html tag?");return $n($n({},sn,"richtext"),"children",s)}var vM=j.object({type:j.union([j.literal("bold"),j.literal("strike"),j.literal("italic")])}),U8=j.object({type:j.literal("link"),attrs:j.object({href:j.string(),target:j.union([j.literal("_blank"),j.null()]),auto:j.boolean()})}),yM=j.intersection(j.object({type:j.literal("text"),text:j.string()}),j.object({marks:j.array(j.union([vM,U8]))}).partial()),xM=j.intersection(j.object({type:j.literal("hardBreak")}),j.object({marks:j.array(vM)}).partial()),V8=j.intersection(j.object({type:j.literal("image")}),j.object({attrs:j.intersection(j.object({src:j.string()}),j.object({align:j.union([j.literal("center"),j.literal("end"),j.literal("justify"),j.literal("left"),j.literal("match-parent"),j.literal("right"),j.literal("start"),j.null()]),alt:j.union([j.string(),j.null()]),height:j.union([j.string(),j.number(),j.null()]),width:j.union([j.string(),j.number(),j.null()]),rotate:j.union([j.string(),j.null()]),title:j.union([j.string(),j.null()]),fileName:j.union([j.string(),j.null()])}).partial())}).partial()),H8=j.intersection(j.object({type:j.literal("heading")}),j.object({attrs:j.object({level:j.number()}),content:j.array(j.union([yM,xM]))}).partial()),bM=j.lazy(function(){return j.intersection(j.object({type:j.literal("bulletList")}),j.object({content:j.array(kM)}).partial())}),wM=j.lazy(function(){return j.intersection(j.object({type:j.literal("orderedList")}),j.object({content:j.array(kM)}).partial())}),kM=j.lazy(function(){return j.intersection(j.object({type:j.literal("listItem")}),j.object({content:j.array(j.union([SM,bM,wM]))}).partial())}),SM=j.intersection(j.object({type:j.literal("paragraph")}),j.object({content:j.array(j.union([yM,V8,xM]))}).partial()),W8=j.object({type:j.literal("doc"),content:j.array(j.union([SM,H8,bM,wM]))});function TS(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function OS(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?TS(Object(n),!0).forEach(function(r){$n(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):TS(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function K8(t){return{type:"doc",content:t.children.map(function(e){return q8(e)})}}function q8(t){switch(t.tag){case"h1":return hl(1,t.children);case"h2":return hl(2,t.children);case"h3":return hl(3,t.children);case"h4":return hl(4,t.children);case"h5":return hl(5,t.children);case"h6":return hl(6,t.children);case"p":return MS(t.children);case"ul":return CM(t);case"ol":return TM(t);case"br":return MS([t]);default:{var e=t;throw Error("Unexpected child node: "+JSON.stringify(e))}}}function hl(t,e){return{type:"heading",attrs:{level:t},content:e.flatMap(EM)}}function gg(t){return{type:"text",text:t}}function EM(t){return typeof t=="string"?[gg(t)]:H1(t)}function H1(t){if(t.classes.length===0&&t.children.length===1){if(typeof t.children[0]=="string")return[gg(t.children[0])];throw Error("Unexpected amount of children in span node: "+JSON.stringify(t,null,2))}return t.children.map(function(e){return{type:"text",text:e,marks:t.classes.map(function(n){switch(n){case"bold":return{type:"bold"};case"italic":return{type:"italic"};case"line-through":return{type:"strike"};default:{var r=n;throw Error("Unexpected span class: "+r)}}})}})}function MS(t){return{type:"paragraph",content:t.flatMap(function(e){if(typeof e=="string")return[gg(e)];switch(e.tag){case"span":return H1(e);case"a":return _M(e);case"img":return[Y8(e)];case"br":return[G8()];default:{var n=e;throw Error("Unexpected paragraph child: "+JSON.stringify(n))}}})}}function G8(){return{type:"hardBreak",marks:[]}}function _M(t){return t.children.flatMap(EM).map(function(e){return OS(OS({},e),{},{marks:(e.marks||[]).concat({type:"link",attrs:{href:t.href,auto:!1,target:null}})})})}function Y8(t){return{type:"image",attrs:{height:t.height,width:t.width,src:t.src}}}function CM(t){return{type:"bulletList",content:t.children.map(OM)}}function TM(t){return{type:"orderedList",content:t.children.map(OM)}}function OM(t){return{type:"listItem",content:Z8(t.children)}}function Z8(t){var e=[],n=fM(t),r;try{for(n.s();!(r=n.n()).done;){var o=r.value,i=e[e.length-1];i||(i={type:"paragraph",content:[]},e.push(i));var s=i.content;if(typeof o=="string")s.push(gg(o));else switch(o.tag){case"a":{s.push.apply(s,Wd(_M(o)));break}case"br":{e.push({type:"paragraph",content:[]});break}case"span":{s.push.apply(s,Wd(H1(o)));break}case"ol":{e.push(TM(o));break}case"ul":{e.push(CM(o));break}default:{var a=o;throw Error("Unexpected list item child: "+JSON.stringify(a))}}}}catch(l){n.e(l)}finally{n.f()}return e}const J8=new TextEncoder;function MM(t){return new Promise((e,n)=>{var i;const r=(i=t.currentTarget.files)==null?void 0:i[0],o=new FileReader;o.addEventListener("load",()=>{const s=o.result;if(typeof s=="string"){const a=new Image;a.addEventListener("load",()=>{const l=yt.getSHA256Hash(J8.encode(s));if(a.naturalWidth&&a.naturalHeight){const c=hg(s);e({src:s,width:a.naturalWidth,height:a.naturalHeight,filename:r==null?void 0:r.name,sha256:l,mimeType:c,fileExt:c&&mg(c)})}else e({src:s,filename:r==null?void 0:r.name,sha256:l})}),a.src=s}else n(s?{message:"Unexpected image result type",result:s}:{message:"Empty result"})}),r&&o.readAsDataURL(r)})}function RM(t,e,n){if(!n||!t)return e;const r=n.sha256.slice(0,5),o=hg(t)??"unknown",i=mg(o)??"unknown";if(e){let s=e.split(".").slice(0,-1).join(".")||e;const a=s.lastIndexOf("_");return s.slice(a+1,s.length)===r&&(s=s.slice(0,a)),`${encodeURIComponent(s).replace(/%[0-9A-Fa-f]{2}/g,"").toLowerCase()}_${r}.${i}`}return`${n.sha256}.${i}`}const W1=h.forwardRef(({className:t,type:e,...n},r)=>b.jsx("input",{type:e,className:ze("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base 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",t),ref:r,...n}));W1.displayName="Input";const X8=h.forwardRef((t,e)=>h.createElement(Re.span,z({},t,{ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}))),Q8=[" ","Enter","ArrowUp","ArrowDown"],e9=[" ","Enter"],vg="Select",[yg,K1,t9]=dg(vg),[Fc,Joe]=Lr(vg,[t9,jc]),q1=jc(),[n9,Qa]=Fc(vg),[r9,o9]=Fc(vg),i9=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:f,required:p}=t,m=q1(e),[g,y]=h.useState(null),[v,x]=h.useState(null),[w,S]=h.useState(!1),_=_f(c),[k=!1,E]=Ao({prop:r,defaultProp:o,onChange:i}),[C,T]=Ao({prop:s,defaultProp:a,onChange:l}),A=h.useRef(null),B=g?!!g.closest("form"):!0,[D,Z]=h.useState(new Set),U=Array.from(D).map(G=>G.props.value).join(";");return h.createElement(R1,m,h.createElement(n9,{required:p,scope:e,trigger:g,onTriggerChange:y,valueNode:v,onValueNodeChange:x,valueNodeHasChildren:w,onValueNodeHasChildrenChange:S,contentId:ao(),value:C,onValueChange:T,open:k,onOpenChange:E,dir:_,triggerPointerDownPosRef:A,disabled:f},h.createElement(yg.Provider,{scope:e},h.createElement(r9,{scope:t.__scopeSelect,onNativeOptionAdd:h.useCallback(G=>{Z(R=>new Set(R).add(G))},[]),onNativeOptionRemove:h.useCallback(G=>{Z(R=>{const N=new Set(R);return N.delete(G),N})},[])},n)),B?h.createElement(AM,{key:U,"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:C,onChange:G=>T(G.target.value),disabled:f},C===void 0?h.createElement("option",{value:""}):null,Array.from(D)):null))},s9="SelectTrigger",a9=h.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...o}=t,i=q1(n),s=Qa(s9,n),a=s.disabled||r,l=We(e,s.onTriggerChange),c=K1(n),[u,d,f]=IM(m=>{const g=c().filter(x=>!x.disabled),y=g.find(x=>x.value===s.value),v=DM(g,m,y);v!==void 0&&s.onValueChange(v.value)}),p=()=>{a||(s.onOpenChange(!0),f())};return h.createElement(N1,z({asChild:!0},i),h.createElement(Re.button,z({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:a,"data-disabled":a?"":void 0,"data-placeholder":$M(s.value)?"":void 0},o,{ref:l,onClick:se(o.onClick,m=>{m.currentTarget.focus()}),onPointerDown:se(o.onPointerDown,m=>{const g=m.target;g.hasPointerCapture(m.pointerId)&&g.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&(p(),s.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)},m.preventDefault())}),onKeyDown:se(o.onKeyDown,m=>{const g=u.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&d(m.key),!(g&&m.key===" ")&&Q8.includes(m.key)&&(p(),m.preventDefault())})})))}),l9="SelectValue",c9=h.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=t,l=Qa(l9,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,d=We(e,l.onValueNodeChange);return hr(()=>{c(u)},[c,u]),h.createElement(Re.span,z({},a,{ref:d,style:{pointerEvents:"none"}}),$M(l.value)?h.createElement(h.Fragment,null,s):i)}),u9=h.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...o}=t;return h.createElement(Re.span,z({"aria-hidden":!0},o,{ref:e}),r||"▼")}),d9=t=>h.createElement(sg,z({asChild:!0},t)),yc="SelectContent",f9=h.forwardRef((t,e)=>{const n=Qa(yc,t.__scopeSelect),[r,o]=h.useState();if(hr(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Vo.createPortal(h.createElement(NM,{scope:t.__scopeSelect},h.createElement(yg.Slot,{scope:t.__scopeSelect},h.createElement("div",null,t.children))),i):null}return h.createElement(p9,z({},t,{ref:e}))}),Qo=10,[NM,xg]=Fc(yc),p9=h.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:g,avoidCollisions:y,...v}=t,x=Qa(yc,n),[w,S]=h.useState(null),[_,k]=h.useState(null),E=We(e,ne=>S(ne)),[C,T]=h.useState(null),[A,B]=h.useState(null),D=K1(n),[Z,U]=h.useState(!1),G=h.useRef(!1);h.useEffect(()=>{if(w)return ag(w)},[w]),ng();const R=h.useCallback(ne=>{const[et,...tt]=D().map(Ke=>Ke.ref.current),[nt]=tt.slice(-1),Te=document.activeElement;for(const Ke of ne)if(Ke===Te||(Ke==null||Ke.scrollIntoView({block:"nearest"}),Ke===et&&_&&(_.scrollTop=0),Ke===nt&&_&&(_.scrollTop=_.scrollHeight),Ke==null||Ke.focus(),document.activeElement!==Te))return},[D,_]),N=h.useCallback(()=>R([C,w]),[R,C,w]);h.useEffect(()=>{Z&&N()},[Z,N]);const{onOpenChange:O,triggerPointerDownPosRef:P}=x;h.useEffect(()=>{if(w){let ne={x:0,y:0};const et=nt=>{var Te,Ke,bn,Rn;ne={x:Math.abs(Math.round(nt.pageX)-((Te=(Ke=P.current)===null||Ke===void 0?void 0:Ke.x)!==null&&Te!==void 0?Te:0)),y:Math.abs(Math.round(nt.pageY)-((bn=(Rn=P.current)===null||Rn===void 0?void 0:Rn.y)!==null&&bn!==void 0?bn:0))}},tt=nt=>{ne.x<=10&&ne.y<=10?nt.preventDefault():w.contains(nt.target)||O(!1),document.removeEventListener("pointermove",et),P.current=null};return P.current!==null&&(document.addEventListener("pointermove",et),document.addEventListener("pointerup",tt,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",et),document.removeEventListener("pointerup",tt,{capture:!0})}}},[w,O,P]),h.useEffect(()=>{const ne=()=>O(!1);return window.addEventListener("blur",ne),window.addEventListener("resize",ne),()=>{window.removeEventListener("blur",ne),window.removeEventListener("resize",ne)}},[O]);const[I,H]=IM(ne=>{const et=D().filter(Te=>!Te.disabled),tt=et.find(Te=>Te.ref.current===document.activeElement),nt=DM(et,ne,tt);nt&&setTimeout(()=>nt.ref.current.focus())}),le=h.useCallback((ne,et,tt)=>{const nt=!G.current&&!tt;(x.value!==void 0&&x.value===et||nt)&&(T(ne),nt&&(G.current=!0))},[x.value]),Le=h.useCallback(()=>w==null?void 0:w.focus(),[w]),Ee=h.useCallback((ne,et,tt)=>{const nt=!G.current&&!tt;(x.value!==void 0&&x.value===et||nt)&&B(ne)},[x.value]),Je=r==="popper"?RS:h9,Ae=Je===RS?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:g,avoidCollisions:y}:{};return h.createElement(NM,{scope:n,content:w,viewport:_,onViewportChange:k,itemRefCallback:le,selectedItem:C,onItemLeave:Le,itemTextRefCallback:Ee,focusSelectedItem:N,selectedItemText:A,position:r,isPositioned:Z,searchRef:I},h.createElement(cg,{as:mi,allowPinchZoom:!0},h.createElement(rg,{asChild:!0,trapped:x.open,onMountAutoFocus:ne=>{ne.preventDefault()},onUnmountAutoFocus:se(o,ne=>{var et;(et=x.trigger)===null||et===void 0||et.focus({preventScroll:!0}),ne.preventDefault()})},h.createElement(tg,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:ne=>ne.preventDefault(),onDismiss:()=>x.onOpenChange(!1)},h.createElement(Je,z({role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:ne=>ne.preventDefault()},v,Ae,{onPlaced:()=>U(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:se(v.onKeyDown,ne=>{const et=ne.ctrlKey||ne.altKey||ne.metaKey;if(ne.key==="Tab"&&ne.preventDefault(),!et&&ne.key.length===1&&H(ne.key),["ArrowUp","ArrowDown","Home","End"].includes(ne.key)){let nt=D().filter(Te=>!Te.disabled).map(Te=>Te.ref.current);if(["ArrowUp","End"].includes(ne.key)&&(nt=nt.slice().reverse()),["ArrowUp","ArrowDown"].includes(ne.key)){const Te=ne.target,Ke=nt.indexOf(Te);nt=nt.slice(Ke+1)}setTimeout(()=>R(nt)),ne.preventDefault()}})}))))))}),h9=h.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...o}=t,i=Qa(yc,n),s=xg(yc,n),[a,l]=h.useState(null),[c,u]=h.useState(null),d=We(e,E=>u(E)),f=K1(n),p=h.useRef(!1),m=h.useRef(!0),{viewport:g,selectedItem:y,selectedItemText:v,focusSelectedItem:x}=s,w=h.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&g&&y&&v){const E=i.trigger.getBoundingClientRect(),C=c.getBoundingClientRect(),T=i.valueNode.getBoundingClientRect(),A=v.getBoundingClientRect();if(i.dir!=="rtl"){const Te=A.left-C.left,Ke=T.left-Te,bn=E.left-Ke,Rn=E.width+bn,un=Math.max(Rn,C.width),Mi=window.innerWidth-Qo,Ks=i0(Ke,[Qo,Mi-un]);a.style.minWidth=Rn+"px",a.style.left=Ks+"px"}else{const Te=C.right-A.right,Ke=window.innerWidth-T.right-Te,bn=window.innerWidth-E.right-Ke,Rn=E.width+bn,un=Math.max(Rn,C.width),Mi=window.innerWidth-Qo,Ks=i0(Ke,[Qo,Mi-un]);a.style.minWidth=Rn+"px",a.style.right=Ks+"px"}const B=f(),D=window.innerHeight-Qo*2,Z=g.scrollHeight,U=window.getComputedStyle(c),G=parseInt(U.borderTopWidth,10),R=parseInt(U.paddingTop,10),N=parseInt(U.borderBottomWidth,10),O=parseInt(U.paddingBottom,10),P=G+R+Z+O+N,I=Math.min(y.offsetHeight*5,P),H=window.getComputedStyle(g),le=parseInt(H.paddingTop,10),Le=parseInt(H.paddingBottom,10),Ee=E.top+E.height/2-Qo,Je=D-Ee,Ae=y.offsetHeight/2,ne=y.offsetTop+Ae,et=G+R+ne,tt=P-et;if(et<=Ee){const Te=y===B[B.length-1].ref.current;a.style.bottom="0px";const Ke=c.clientHeight-g.offsetTop-g.offsetHeight,bn=Math.max(Je,Ae+(Te?Le:0)+Ke+N),Rn=et+bn;a.style.height=Rn+"px"}else{const Te=y===B[0].ref.current;a.style.top="0px";const bn=Math.max(Ee,G+g.offsetTop+(Te?le:0)+Ae)+tt;a.style.height=bn+"px",g.scrollTop=et-Ee+g.offsetTop}a.style.margin=`${Qo}px 0`,a.style.minHeight=I+"px",a.style.maxHeight=D+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[f,i.trigger,i.valueNode,a,c,g,y,v,i.dir,r]);hr(()=>w(),[w]);const[S,_]=h.useState();hr(()=>{c&&_(window.getComputedStyle(c).zIndex)},[c]);const k=h.useCallback(E=>{E&&m.current===!0&&(w(),x==null||x(),m.current=!1)},[w,x]);return h.createElement(m9,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:k},h.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S}},h.createElement(Re.div,z({},o,{ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}}))))}),RS=h.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Qo,...i}=t,s=q1(n);return h.createElement(P1,z({},s,i,{ref:e,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.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)"}}))}),[m9,g9]=Fc(yc,{}),NS="SelectViewport",v9=h.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=xg(NS,n),i=g9(NS,n),s=We(e,o.onViewportChange),a=h.useRef(0);return h.createElement(h.Fragment,null,h.createElement("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}"}}),h.createElement(yg.Slot,{scope:n},h.createElement(Re.div,z({"data-radix-select-viewport":"",role:"presentation"},r,{ref:s,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:se(r.onScroll,l=>{const c=l.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:d}=i;if(d!=null&&d.current&&u){const f=Math.abs(a.current-c.scrollTop);if(f>0){const p=window.innerHeight-Qo*2,m=parseFloat(u.style.minHeight),g=parseFloat(u.style.height),y=Math.max(m,g);if(y<p){const v=y+f,x=Math.min(p,v),w=v-x;u.style.height=x+"px",u.style.bottom==="0px"&&(c.scrollTop=w>0?w:0,u.style.justifyContent="flex-end")}}}a.current=c.scrollTop})}))))}),y9="SelectGroup",[Xoe,x9]=Fc(y9),b9="SelectLabel",w9=h.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=x9(b9,n);return h.createElement(Re.div,z({id:o.id},r,{ref:e}))}),M0="SelectItem",[k9,PM]=Fc(M0),S9=h.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=t,a=Qa(M0,n),l=xg(M0,n),c=a.value===r,[u,d]=h.useState(i??""),[f,p]=h.useState(!1),m=We(e,v=>{var x;return(x=l.itemRefCallback)===null||x===void 0?void 0:x.call(l,v,r,o)}),g=ao(),y=()=>{o||(a.onValueChange(r),a.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 h.createElement(k9,{scope:n,value:r,disabled:o,textId:g,isSelected:c,onItemTextChange:h.useCallback(v=>{d(x=>{var w;return x||((w=v==null?void 0:v.textContent)!==null&&w!==void 0?w:"").trim()})},[])},h.createElement(yg.ItemSlot,{scope:n,value:r,disabled:o,textValue:u},h.createElement(Re.div,z({role:"option","aria-labelledby":g,"data-highlighted":f?"":void 0,"aria-selected":c&&f,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1},s,{ref:m,onFocus:se(s.onFocus,()=>p(!0)),onBlur:se(s.onBlur,()=>p(!1)),onPointerUp:se(s.onPointerUp,y),onPointerMove:se(s.onPointerMove,v=>{if(o){var x;(x=l.onItemLeave)===null||x===void 0||x.call(l)}else v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:se(s.onPointerLeave,v=>{if(v.currentTarget===document.activeElement){var x;(x=l.onItemLeave)===null||x===void 0||x.call(l)}}),onKeyDown:se(s.onKeyDown,v=>{var x;((x=l.searchRef)===null||x===void 0?void 0:x.current)!==""&&v.key===" "||(e9.includes(v.key)&&y(),v.key===" "&&v.preventDefault())})}))))}),vp="SelectItemText",E9=h.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:o,...i}=t,s=Qa(vp,n),a=xg(vp,n),l=PM(vp,n),c=o9(vp,n),[u,d]=h.useState(null),f=We(e,v=>d(v),l.onItemTextChange,v=>{var x;return(x=a.itemTextRefCallback)===null||x===void 0?void 0:x.call(a,v,l.value,l.disabled)}),p=u==null?void 0:u.textContent,m=h.useMemo(()=>h.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},p),[l.disabled,l.value,p]),{onNativeOptionAdd:g,onNativeOptionRemove:y}=c;return hr(()=>(g(m),()=>y(m)),[g,y,m]),h.createElement(h.Fragment,null,h.createElement(Re.span,z({id:l.textId},i,{ref:f})),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Vo.createPortal(i.children,s.valueNode):null)}),_9="SelectItemIndicator",C9=h.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return PM(_9,n).isSelected?h.createElement(Re.span,z({"aria-hidden":!0},r,{ref:e})):null}),T9=h.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return h.createElement(Re.div,z({"aria-hidden":!0},r,{ref:e}))});function $M(t){return t===""||t===void 0}const AM=h.forwardRef((t,e)=>{const{value:n,...r}=t,o=h.useRef(null),i=We(e,o),s=o2(n);return h.useEffect(()=>{const a=o.current,l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&u){const d=new Event("change",{bubbles:!0});u.call(a,n),a.dispatchEvent(d)}},[s,n]),h.createElement(X8,{asChild:!0},h.createElement("select",z({},r,{ref:i,defaultValue:n})))});AM.displayName="BubbleSelect";function IM(t){const e=rn(t),n=h.useRef(""),r=h.useRef(0),o=h.useCallback(s=>{const a=n.current+s;e(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[e]),i=h.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function DM(t,e,n){const o=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let s=O9(t,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function O9(t,e){return t.map((n,r)=>t[(e+r)%t.length])}const M9=i9,LM=a9,R9=c9,N9=u9,P9=d9,jM=f9,$9=v9,zM=w9,FM=S9,A9=E9,I9=C9,BM=T9,UM=M9,VM=R9,G1=h.forwardRef(({className:t,children:e,...n},r)=>b.jsxs(LM,{ref:r,className:ze("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",t),...n,children:[e,b.jsx(N9,{asChild:!0,children:b.jsx(Th,{className:"w-4 h-4 opacity-50"})})]}));G1.displayName=LM.displayName;const Y1=h.forwardRef(({className:t,children:e,position:n="popper",...r},o)=>b.jsx(P9,{children:b.jsx(jM,{ref:o,className:ze("relative z-50 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",t),position:n,...r,children:b.jsx($9,{className:ze("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e})})}));Y1.displayName=jM.displayName;const D9=h.forwardRef(({className:t,...e},n)=>b.jsx(zM,{ref:n,className:ze("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));D9.displayName=zM.displayName;const Z1=h.forwardRef(({className:t,children:e,...n},r)=>b.jsxs(FM,{ref:r,className:ze("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",t),...n,children:[b.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b.jsx(I9,{children:b.jsx(y1,{className:"w-4 h-4"})})}),b.jsx(A9,{children:e})]}));Z1.displayName=FM.displayName;const L9=h.forwardRef(({className:t,...e},n)=>b.jsx(BM,{ref:n,className:ze("-mx-1 my-1 h-px bg-muted",t),...e}));L9.displayName=BM.displayName;let bg=()=>({events:{},emit(t,...e){(this.events[t]||[]).forEach(n=>n(...e))},on(t,e){return(this.events[t]=this.events[t]||[]).push(e),()=>this.events[t]=(this.events[t]||[]).filter(n=>n!==e)}});var R0={exports:{}};(function(t,e){var n=typeof Reflect<"u"?Reflect.construct:void 0,r=Object.defineProperty,o=Error.captureStackTrace;o===void 0&&(o=function(c){var u=new Error;r(c,"stack",{configurable:!0,get:function(){var f=u.stack;return r(this,"stack",{configurable:!0,value:f,writable:!0}),f},set:function(f){r(c,"stack",{configurable:!0,value:f,writable:!0})}})});function i(l){l!==void 0&&r(this,"message",{configurable:!0,value:l,writable:!0});var c=this.constructor.name;c!==void 0&&c!==this.name&&r(this,"name",{configurable:!0,value:c,writable:!0}),o(this,this.constructor)}i.prototype=Object.create(Error.prototype,{constructor:{configurable:!0,value:i,writable:!0}});var s=function(){function l(u,d){return r(u,"name",{configurable:!0,value:d})}try{var c=function(){};if(l(c,"foo"),c.name==="foo")return l}catch{}}();function a(l,c){if(c==null||c===Error)c=i;else if(typeof c!="function")throw new TypeError("super_ should be a function");var u;if(typeof l=="string")u=l,l=n!==void 0?function(){return n(c,arguments,this.constructor)}:function(){c.apply(this,arguments)},s!==void 0&&(s(l,u),u=void 0);else if(typeof l!="function")throw new TypeError("constructor should be either a string or a function");l.super_=l.super=c;var d={constructor:{configurable:!0,value:l,writable:!0}};return u!==void 0&&(d.name={configurable:!0,value:u,writable:!0}),l.prototype=Object.create(c.prototype,d),l}e=t.exports=a,e.BaseError=i})(R0,R0.exports);var HM=R0.exports,PS="ProseMirror-selectednode",WM="",ss="\0",$S="__state_override__",j9={LastNodeCompatible:"lastNodeCompatible",FormattingMark:"formattingMark",FormattingNode:"formattingNode",NodeCursor:"nodeCursor",FontStyle:"fontStyle",Link:"link",Color:"color",Alignment:"alignment",Indentation:"indentation",Behavior:"behavior",Code:"code",InlineNode:"inline",ListContainerNode:"listContainer",ListItemNode:"listItemNode",Block:"block",BlockNode:"block",TextBlock:"textBlock",ExcludeInputRules:"excludeFromInputRules",PreventExits:"preventsExits",Media:"media"},Ie=j9,bi=Symbol.for("__remirror__"),an=(t=>(t.PlainExtension="RemirrorPlainExtension",t.NodeExtension="RemirrorNodeExtension",t.MarkExtension="RemirrorMarkExtension",t.PlainExtensionConstructor="RemirrorPlainExtensionConstructor",t.NodeExtensionConstructor="RemirrorNodeExtensionConstructor",t.MarkExtensionConstructor="RemirrorMarkExtensionConstructor",t.Manager="RemirrorManager",t.Preset="RemirrorPreset",t.PresetConstructor="RemirrorPresetConstructor",t))(an||{}),at=(t=>(t[t.Critical=1e6]="Critical",t[t.Highest=1e5]="Highest",t[t.High=1e4]="High",t[t.Medium=1e3]="Medium",t[t.Default=100]="Default",t[t.Low=10]="Low",t[t.Lowest=0]="Lowest",t))(at||{}),qn=(t=>(t[t.None=0]="None",t[t.Create=1]="Create",t[t.EditorView=2]="EditorView",t[t.Runtime=3]="Runtime",t[t.Destroy=4]="Destroy",t))(qn||{}),q=(t=>(t.Undo="_|undo|_",t.Redo="_|redo|_",t.Bold="_|bold|_",t.Italic="_|italic|_",t.Underline="_|underline|_",t.Strike="_|strike|_",t.Code="_|code|_",t.Paragraph="_|paragraph|_",t.H1="_|h1|_",t.H2="_|h2|_",t.H3="_|h3|_",t.H4="_|h4|_",t.H5="_|h5|_",t.H6="_|h6|_",t.TaskList="_|task|_",t.BulletList="_|bullet|_",t.OrderedList="_|number|_",t.Quote="_|quote|_",t.Divider="_|divider|_",t.Codeblock="_|codeblock|_",t.ClearFormatting="_|clear|_",t.Superscript="_|sup|_",t.Subscript="_|sub|_",t.LeftAlignment="_|left-align|_",t.CenterAlignment="_|center-align|_",t.RightAlignment="_|right-align|_",t.JustifyAlignment="_|justify-align|_",t.InsertLink="_|link|_",t.Find="_|find|_",t.FindBackwards="_|find-backwards|_",t.FindReplace="_|find-replace|_",t.AddFootnote="_|footnote|_",t.AddComment="_|comment|_",t.ContextMenu="_|context-menu|_",t.IncreaseFontSize="_|inc-font-size|_",t.DecreaseFontSize="_|dec-font-size|_",t.IncreaseIndent="_|indent|_",t.DecreaseIndent="_|dedent|_",t.Shortcuts="_|shortcuts|_",t.Copy="_|copy|_",t.Cut="_|cut|_",t.Paste="_|paste|_",t.PastePlain="_|paste-plain|_",t.SelectAll="_|select-all|_",t.Format="_|format|_",t))(q||{}),K=(t=>(t.PROD="RMR0000",t.UNKNOWN="RMR0001",t.INVALID_COMMAND_ARGUMENTS="RMR0002",t.CUSTOM="RMR0003",t.CORE_HELPERS="RMR0004",t.MUTATION="RMR0005",t.INTERNAL="RMR0006",t.MISSING_REQUIRED_EXTENSION="RMR0007",t.MANAGER_PHASE_ERROR="RMR0008",t.INVALID_GET_EXTENSION="RMR0010",t.INVALID_MANAGER_ARGUMENTS="RMR0011",t.SCHEMA="RMR0012",t.HELPERS_CALLED_IN_OUTER_SCOPE="RMR0013",t.INVALID_MANAGER_EXTENSION="RMR0014",t.DUPLICATE_COMMAND_NAMES="RMR0016",t.DUPLICATE_HELPER_NAMES="RMR0017",t.NON_CHAINABLE_COMMAND="RMR0018",t.INVALID_EXTENSION="RMR0019",t.INVALID_CONTENT="RMR0021",t.INVALID_NAME="RMR0050",t.EXTENSION="RMR0100",t.EXTENSION_SPEC="RMR0101",t.EXTENSION_EXTRA_ATTRIBUTES="RMR0102",t.INVALID_SET_EXTENSION_OPTIONS="RMR0103",t.REACT_PROVIDER_CONTEXT="RMR0200",t.REACT_GET_ROOT_PROPS="RMR0201",t.REACT_EDITOR_VIEW="RMR0202",t.REACT_CONTROLLED="RMR0203",t.REACT_NODE_VIEW="RMR0204",t.REACT_GET_CONTEXT="RMR0205",t.REACT_COMPONENTS="RMR0206",t.REACT_HOOKS="RMR0207",t.I18N_CONTEXT="RMR0300",t))(K||{}),z9=function(e){return F9(e)&&!B9(e)};function F9(t){return!!t&&typeof t=="object"}function B9(t){var e=Object.prototype.toString.call(t);return e==="[object RegExp]"||e==="[object Date]"||H9(t)}var U9=typeof Symbol=="function"&&Symbol.for,V9=U9?Symbol.for("react.element"):60103;function H9(t){return t.$$typeof===V9}function W9(t){return Array.isArray(t)?[]:{}}function Kd(t,e){return e.clone!==!1&&e.isMergeableObject(t)?xc(W9(t),t,e):t}function K9(t,e,n){return t.concat(e).map(function(r){return Kd(r,n)})}function q9(t,e){if(!e.customMerge)return xc;var n=e.customMerge(t);return typeof n=="function"?n:xc}function G9(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[]}function AS(t){return Object.keys(t).concat(G9(t))}function KM(t,e){try{return e in t}catch{return!1}}function Y9(t,e){return KM(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))}function Z9(t,e,n){var r={};return n.isMergeableObject(t)&&AS(t).forEach(function(o){r[o]=Kd(t[o],n)}),AS(e).forEach(function(o){Y9(t,o)||(KM(t,o)&&n.isMergeableObject(e[o])?r[o]=q9(o,n)(t[o],e[o],n):r[o]=Kd(e[o],n))}),r}function xc(t,e,n){n=n||{},n.arrayMerge=n.arrayMerge||K9,n.isMergeableObject=n.isMergeableObject||z9,n.cloneUnlessOtherwiseSpecified=Kd;var r=Array.isArray(e),o=Array.isArray(t),i=r===o;return i?r?n.arrayMerge(t,e,n):Z9(t,e,n):Kd(e,n)}xc.all=function(e,n){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(r,o){return xc(r,o,n)},{})};var J9=xc,X9=J9;const Q9=ki(X9);/*!
161
- * isobject <https://github.com/jonschlinkert/isobject>
162
- *
163
- * Copyright (c) 2014-2017, Jon Schlinkert.
164
- * Released under the MIT License.
165
- */var qM=function(e){return e!=null&&typeof e=="object"&&Array.isArray(e)===!1};/*!
166
- * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
167
- *
168
- * Copyright (c) 2014-2017, Jon Schlinkert.
169
- * Released under the MIT License.
170
- */var ez=qM;function IS(t){return ez(t)===!0&&Object.prototype.toString.call(t)==="[object Object]"}var tz=function(e){var n,r;return!(IS(e)===!1||(n=e.constructor,typeof n!="function")||(r=n.prototype,IS(r)===!1)||r.hasOwnProperty("isPrototypeOf")===!1)};/*!
171
- * is-extendable <https://github.com/jonschlinkert/is-extendable>
172
- *
173
- * Copyright (c) 2015-2017, Jon Schlinkert.
174
- * Released under the MIT License.
175
- */var nz=tz,rz=function(e){return nz(e)||typeof e=="function"||Array.isArray(e)};/*!
176
- * object.omit <https://github.com/jonschlinkert/object.omit>
177
- *
178
- * Copyright (c) 2014-2017, Jon Schlinkert.
179
- * Released under the MIT License.
180
- */var oz=rz,iz=function(e,n,r){if(!oz(e))return{};typeof n=="function"&&(r=n,n=[]),typeof n=="string"&&(n=[n]);for(var o=typeof r=="function",i=Object.keys(e),s={},a=0;a<i.length;a++){var l=i[a],c=e[l];(!n||n.indexOf(l)===-1&&(!o||r(c,l,e)))&&(s[l]=c)}return s};const J1=ki(iz);/*!
181
- * object.pick <https://github.com/jonschlinkert/object.pick>
182
- *
183
- * Copyright (c) 2014-2015 Jon Schlinkert, contributors.
184
- * Licensed under the MIT License
185
- */var sz=qM,az=function(e,n){if(!sz(e)&&typeof e!="function")return{};var r={};if(typeof n=="string")return n in e&&(r[n]=e[n]),r;for(var o=n.length,i=-1;++i<o;){var s=n[i];s in e&&(r[s]=e[s])}return r};const N0=ki(az),GM=/^[a-zà-öø-ÿ]+|[A-ZÀ-ÖØ-ß][a-zà-öø-ÿ]+|[a-zà-öø-ÿ]+|[0-9]+|[A-ZÀ-ÖØ-ß]+(?![a-zà-öø-ÿ])/g,lz=/\S+/g;function cz(t,e){const n={parts:[],prefixes:[]},r=t.matchAll(e);let o=0;for(const s of r){if(typeof s.index!="number")continue;const a=s[0];n.parts.push(a);const l=t.slice(o,s.index).trim();n.prefixes.push(l),o=s.index+a.length}const i=t.slice(o).trim();return i&&(n.parts.push(""),n.prefixes.push(i)),n}function YM(t,e){const{keepSpecialCharacters:n=!1,keep:r,prefix:o=""}=e||{},i=t.trim().normalize("NFC"),s=i.includes(" "),l=cz(i,s?lz:GM);return l.parts.map((c,u)=>{let d=l.prefixes[u]||"",f=c;return n===!1&&(r&&(f=f.normalize("NFD").replace(new RegExp(`[^a-zA-ZØßø0-9${r.join("")}]`,"g"),"")),r||(f=f.normalize("NFD").replace(/[^a-zA-ZØßø0-9]/g,""),d="")),r&&(d=d.replace(new RegExp(`[^${r.join("")}]`,"g"),"")),u===0?d+f:!d&&!f?"":s&&!d&&o.match(/\s/)?" "+f:(d||o)+f}).filter(Boolean)}function uz(t){const e=t.matchAll(GM).next().value,n=e?e.index:0;return t.slice(0,n+1).toUpperCase()+t.slice(n+1).toLowerCase()}function ZM(t,e){return YM(t,e).reduce((n,r)=>n+uz(r),"")}function DS(t,e){return YM(t,{...e,prefix:"-"}).join("").toLowerCase()}function P0(t,e,n,r){var o,i=!1,s=0;function a(){o&&clearTimeout(o)}function l(){a(),i=!0}typeof e!="boolean"&&(r=n,n=e,e=void 0);function c(){for(var u=arguments.length,d=new Array(u),f=0;f<u;f++)d[f]=arguments[f];var p=this,m=Date.now()-s;if(i)return;function g(){s=Date.now(),n.apply(p,d)}function y(){o=void 0}r&&!o&&g(),a(),r===void 0&&m>t?g():e!==!0&&(o=setTimeout(r?y:g,r===void 0?t-m:t))}return c.cancel=l,c}function dz(t,e,n){return n===void 0?P0(t,e,!1):P0(t,n,e!==!1)}function Tt(t,e,n){const r=t[e];return JM(!kg(r),n),r}function JM(t,e){if(!t)throw new fz(e)}var fz=class extends HM.BaseError{constructor(){super(...arguments),this.name="AssertionError"}};function qt(t){return Object.entries(t)}function qd(t){return Object.keys(t)}function wg(t){return Object.values(t)}function mo(t,e,n){return t.includes(e,n)}function pe(t){return Object.assign(Object.create(null),t)}function XM(t){return Object.prototype.toString.call(t)}function QM(t){return XM(t).slice(8,-1)}function Rf(t,e){return n=>typeof n!==t?!1:e?e(n):!0}function X1(t){return e=>QM(e)===t}var kg=Rf("undefined"),Se=Rf("string"),mr=Rf("number",t=>!Number.isNaN(t)),dt=Rf("function");function pz(t){return t===null}function hz(t){return t===!0||t===!1}function el(t){if(QM(t)!=="Object")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.getPrototypeOf({})}function mz(t){return t==null||/^[bns]/.test(typeof t)}function $s(t){return pz(t)||kg(t)}function Mn(t){return!$s(t)&&(dt(t)||Rf("object")(t))}var gz=X1("RegExp");function vz(t){return X1("Map")(t)}function yz(t){return X1("Set")(t)}function Gh(t){return Mn(t)&&!vz(t)&&!yz(t)&&Object.keys(t).length===0}var Gt=Array.isArray;function As(t){return Gt(t)&&t.length===0}function LS(t){return Gt(t)&&t.length>0}function Sg(t,e,n=r=>!!r){e.lastIndex=0;const r=[],o=e.flags;let i;o.includes("g")||(e=new RegExp(e.source,`g${o}`));do i=e.exec(t),i&&r.push(i);while(n(i));return e.lastIndex=0,r}function Yh(){const t=Date.now(),e=Yh.last||t;return Yh.last=t>e?t:e+1}Yh.last=0;function Zh(t=""){return`${t}${Yh().toString(36)}`}function xz(t){return J1(t,e=>!kg(e))}function bz(t){if(!el(t))throw new Error("An invalid value was passed into this clone utility. Expected a plain object");return{...t}}function Gd(t,e=!1){const n=e?[...t].reverse():t,r=new Set(n);return e?[...r].reverse():[...r]}function eR(){}function wz(...t){return Q9.all(t,{isMergeableObject:el})}function kz({min:t,max:e,value:n}){return n<t?t:n>e?e:n}function Sz(t){return t[t.length-1]}function za(t,e){return[...t].map((n,r)=>({value:n,index:r})).sort((n,r)=>e(n.value,r.value)||n.index-r.index).map(({value:n})=>n)}function Ez(t,e,n){try{if(Se(e)&&e in t)return t[e];Gt(e)&&(e=`['${e.join("']['")}']`);let r=t;return e.replace(/\[\s*(["'])(.*?)\1\s*]|^\s*(\w+)\s*(?=\.|\[|$)|\.\s*(\w*)\s*(?=\.|\[|$)|\[\s*(-?\d+)\s*]/g,(o,i,s,a,l,c)=>(r=r[s||a||l||c],"")),r===void 0?n:r}catch{return n}}function _z(t,e){const n=bz(e);let r=n;for(const[o,i]of t.entries()){const s=o>=t.length-1;let a=r[i];if(s){if(Gt(r)){const l=Number.parseInt(i.toString(),10);mr(l)&&r.splice(l,1)}else Reflect.deleteProperty(r,i);return n}if(mz(a))return n;a=Gt(a)?[...a]:{...a},r[i]=a,r=a}return n}function Cz(t){return e=>Ez(e,t)}function tR(t,e,n=!1){const r=[],o=new Set,i=dt(e)?e:Cz(e),s=n?[...t].reverse():t;for(const a of s){const l=i(a);o.has(l)||(o.add(l),r.push(a))}return n?r.reverse():r}function nR(t,e){const n=Gt(t)?t[0]:t;return mr(e)?n<=e?Array.from({length:e+1-n},(r,o)=>o+n):Array.from({length:n+1-e},(r,o)=>-1*o+n):Array.from({length:Math.abs(n)},(r,o)=>(n<0?-1:1)*o)}function jS(t,...e){const n=e.filter(mr);return t>=Math.min(...n)&&t<=Math.max(...n)}function rR(t){return dt(t)?t():t}var oR="https://remirror.io/docs/errors",Tz={[K.UNKNOWN]:"An error occurred but we're not quite sure why. 🧐",[K.INVALID_COMMAND_ARGUMENTS]:"The arguments passed to the command method were invalid.",[K.CUSTOM]:"This is a custom error, possibly thrown by an external library.",[K.CORE_HELPERS]:"An error occurred in a function called from the `@remirror/core-helpers` library.",[K.MUTATION]:"Mutation of immutable value detected.",[K.INTERNAL]:"This is an error which should not occur and is internal to the remirror codebase.",[K.MISSING_REQUIRED_EXTENSION]:"Your editor is missing a required extension.",[K.MANAGER_PHASE_ERROR]:"This occurs when accessing a method or property before it is available.",[K.INVALID_GET_EXTENSION]:"The user requested an invalid extension from the getExtensions method. Please check the `createExtensions` return method is returning an extension with the defined constructor.",[K.INVALID_MANAGER_ARGUMENTS]:"Invalid value(s) passed into `Manager` constructor. Only `Presets` and `Extensions` are supported.",[K.SCHEMA]:"There is a problem with the schema or you are trying to access a node / mark that doesn't exists.",[K.HELPERS_CALLED_IN_OUTER_SCOPE]:"The `helpers` method which is passed into the ``create*` method should only be called within returned method since it relies on an active view (not present in the outer scope).",[K.INVALID_MANAGER_EXTENSION]:"You requested an invalid extension from the manager.",[K.DUPLICATE_COMMAND_NAMES]:"Command method names must be unique within the editor.",[K.DUPLICATE_HELPER_NAMES]:"Helper method names must be unique within the editor.",[K.NON_CHAINABLE_COMMAND]:"Attempted to chain a non chainable command.",[K.INVALID_EXTENSION]:"The provided extension is invalid.",[K.INVALID_CONTENT]:"The content provided to the editor is not supported.",[K.INVALID_NAME]:"An invalid name was used for the extension.",[K.EXTENSION]:"An error occurred within an extension. More details should be made available.",[K.EXTENSION_SPEC]:"The spec was defined without calling the `defaults`, `parse` or `dom` methods.",[K.EXTENSION_EXTRA_ATTRIBUTES]:"Extra attributes must either be a string or an object.",[K.INVALID_SET_EXTENSION_OPTIONS]:"A call to `extension.setOptions` was made with invalid keys.",[K.REACT_PROVIDER_CONTEXT]:"`useRemirrorContext` was called outside of the `remirror` context. It can only be used within an active remirror context created by the `<Remirror />`.",[K.REACT_GET_ROOT_PROPS]:"`getRootProps` has been attached to the DOM more than once. It should only be attached to the dom once per editor.",[K.REACT_EDITOR_VIEW]:"A problem occurred adding the editor view to the dom.",[K.REACT_CONTROLLED]:"There is a problem with your controlled editor setup.",[K.REACT_NODE_VIEW]:"Something went wrong with your custom ReactNodeView Component.",[K.REACT_GET_CONTEXT]:"You attempted to call `getContext` provided by the `useRemirror` prop during the first render of the editor. This is not possible and should only be after the editor first mounts.",[K.REACT_COMPONENTS]:"An error occurred within a remirror component.",[K.REACT_HOOKS]:"An error occurred within a remirror hook.",[K.I18N_CONTEXT]:"You called `useI18n()` outside of an `I18nProvider` context."};function Oz(t){return Se(t)&&mo(wg(K),t)}function Mz(t,e){const n=Tz[t],r=n?`${n}
186
-
187
- `:"",o=e?`${e}
188
-
189
- `:"";return`${r}${o}For more information visit ${oR}#${t.toLowerCase()}`}var iR=class extends HM.BaseError{constructor({code:t,message:e,disableLogging:n=!1}={}){const r=Oz(t)?t:K.CUSTOM;super(Mz(r,e)),this.errorCode=r,this.url=`${oR}#${r.toLowerCase()}`,n||console.error(this.message)}static create(t={}){return new iR(t)}};function ve(t,e){if(!t)throw iR.create(e)}function pa(t,e={}){return t}function pn(t){this.content=t}pn.prototype={constructor:pn,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),i=r.content.slice();return o==-1?i.push(n||t,e):(i[o+1]=e,n&&(i[o]=n)),new pn(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new pn(n)},addToStart:function(t,e){return new pn([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new pn(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),i=r.find(t);return o.splice(i==-1?o.length:i,0,e,n),new pn(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=pn.from(t),t.size?new pn(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=pn.from(t),t.size?new pn(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=pn.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};pn.from=function(t){if(t instanceof pn)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new pn(e)};function sR(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),i=e.child(r);if(o==i){n+=o.nodeSize;continue}if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)n++;return n}if(o.content.size||i.content.size){let s=sR(o.content,i.content,n+1);if(s!=null)return s}n+=o.nodeSize}}function aR(t,e,n,r){for(let o=t.childCount,i=e.childCount;;){if(o==0||i==0)return o==i?null:{a:n,b:r};let s=t.child(--o),a=e.child(--i),l=s.nodeSize;if(s==a){n-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let c=0,u=Math.min(s.text.length,a.text.length);for(;c<u&&s.text[s.text.length-c-1]==a.text[a.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let c=aR(s.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}class F{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,o=0,i){for(let s=0,a=0;a<n;s++){let l=this.content[s],c=a+l.nodeSize;if(c>e&&r(l,o+a,i||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,n-u),r,o+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let i="",s=!0;return this.nodesBetween(e,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?o?typeof o=="function"?o(a):o:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(s?s=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);i<e.content.length;i++)o.push(e.content[i]);return new F(o,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],o=0;if(n>e)for(let i=0,s=0;s<n;i++){let a=this.content[i],l=s+a.nodeSize;l>e&&((s<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),o+=a.nodeSize),s=l}return new F(r,o)}cutByIndex(e,n){return e==n?F.empty:e==0&&n==this.content.length?this:new F(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[e]=n,new F(o,i)}addToStart(e){return new F([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new F(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let o=this.content[n];e(o,r,n),r+=o.nodeSize}}findDiffStart(e,n=0){return sR(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return aR(this,e,n,r)}findIndex(e,n=-1){if(e==0)return yp(0,e);if(e==this.size)return yp(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,o=0;;r++){let i=this.child(r),s=o+i.nodeSize;if(s>=e)return s==e||n>0?yp(r+1,s):yp(r,o);o=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return F.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new F(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return F.empty;let n,r=0;for(let o=0;o<e.length;o++){let i=e[o];r+=i.nodeSize,o&&i.isText&&e[o-1].sameMarkup(i)?(n||(n=e.slice(0,o)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new F(n||e,r)}static from(e){if(!e)return F.empty;if(e instanceof F)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new F([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}F.empty=new F([],0);const Iv={index:0,offset:0};function yp(t,e){return Iv.index=t,Iv.offset=e,Iv}function Jh(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Jh(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Jh(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}class qe{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let o=0;o<e.length;o++){let i=e[o];if(this.eq(i))return e;if(this.type.excludes(i.type))n||(n=e.slice(0,o));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(n||(n=e.slice(0,o)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Jh(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);return r.create(n.attrs)}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return qe.none;if(e instanceof qe)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}}qe.none=[];class Xh extends Error{}class J{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=cR(this.content,e+this.openStart,n);return r&&new J(r,this.openStart,this.openEnd)}removeBetween(e,n){return new J(lR(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return J.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new J(F.fromJSON(e,n.content),r,o)}static maxOpen(e,n=!0){let r=0,o=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)o++;return new J(e,r,o)}}J.empty=new J(F.empty,0,0);function lR(t,e,n){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(o==e||i.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(lR(i.content,e-o-1,n-o-1)))}function cR(t,e,n,r){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o);if(i==e||s.isText)return r&&!r.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=cR(s.content,e-i-1,n);return a&&t.replaceChild(o,s.copy(a))}function Rz(t,e,n){if(n.openStart>t.depth)throw new Xh("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Xh("Inconsistent open depths");return uR(t,e,n,0)}function uR(t,e,n,r){let o=t.index(r),i=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let s=uR(t,e,n,r+1);return i.copy(i.content.replaceChild(o,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,a=s.content;return Ea(s,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=Nz(n,t);return Ea(i,fR(t,s,a,e,r))}else return Ea(i,Qh(t,e,r))}function dR(t,e){if(!e.type.compatibleContent(t.type))throw new Xh("Cannot join "+e.type.name+" onto "+t.type.name)}function $0(t,e,n){let r=t.node(n);return dR(r,e.node(n)),r}function Sa(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function od(t,e,n,r){let o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(Sa(t.nodeAfter,r),i++));for(let a=i;a<s;a++)Sa(o.child(a),r);e&&e.depth==n&&e.textOffset&&Sa(e.nodeBefore,r)}function Ea(t,e){return t.type.checkContent(e),t.copy(e)}function fR(t,e,n,r,o){let i=t.depth>o&&$0(t,e,o+1),s=r.depth>o&&$0(n,r,o+1),a=[];return od(null,t,o,a),i&&s&&e.index(o)==n.index(o)?(dR(i,s),Sa(Ea(i,fR(t,e,n,r,o+1)),a)):(i&&Sa(Ea(i,Qh(t,e,o+1)),a),od(e,n,o,a),s&&Sa(Ea(s,Qh(n,r,o+1)),a)),od(r,null,o,a),new F(a)}function Qh(t,e,n){let r=[];if(od(null,t,n,r),t.depth>n){let o=$0(t,e,n+1);Sa(Ea(o,Qh(t,e,n+1)),r)}return od(e,null,n,r),new F(r)}function Nz(t,e){let n=e.depth-t.openStart,o=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)o=e.node(i).copy(F.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}class bc{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(n);return r?e.child(n).cut(r):o}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let i=0;i<e;i++)o+=r.child(i).nodeSize;return o}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return qe.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),o=e.maybeChild(n);if(!r){let a=r;r=o,o=a}let i=r.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!o||!i[s].isInSet(o.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,o=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!o||!r[i].isInSet(o.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Fa(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,i=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(i),c=i-l;if(r.push(s,a,o+l),!c||(s=s.child(a),s.isText))break;i=c-1,o+=l+1}return new bc(n,r,i)}static resolveCached(e,n){for(let o=0;o<Dv.length;o++){let i=Dv[o];if(i.pos==n&&i.doc==e)return i}let r=Dv[Lv]=bc.resolve(e,n);return Lv=(Lv+1)%Pz,r}}let Dv=[],Lv=0,Pz=12;class Fa{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const $z=Object.create(null);let bs=class A0{constructor(e,n,r,o=qe.none){this.type=e,this.attrs=n,this.marks=o,this.content=r||F.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,o=0){this.content.nodesBetween(e,n,r,o,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,o){return this.content.textBetween(e,n,r,o)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Jh(this.attrs,n||e.defaultAttrs||$z)&&qe.sameSet(this.marks,r||qe.none)}copy(e=null){return e==this.content?this:new A0(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new A0(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return J.empty;let o=this.resolve(e),i=this.resolve(n),s=r?0:o.sharedDepth(n),a=o.start(s),c=o.node(s).content.cut(o.pos-a,i.pos-a);return new J(c,o.depth-s,i.depth-s)}replace(e,n,r){return Rz(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:o}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(o==e||n.isText)return n;e-=o+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}resolve(e){return bc.resolveCached(this,e)}resolveNoCache(e){return bc.resolve(this,e)}rangeHasMark(e,n,r){let o=!1;return n>e&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),pR(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=F.empty,o=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,o,i),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=o;l<i;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,o){if(o&&!this.type.allowsMarks(o))return!1;let i=this.contentMatchAt(e).matchType(r),s=i&&i.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content);let e=qe.none;for(let n=0;n<this.marks.length;n++)e=this.marks[n].addToSet(e);if(!qe.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let o=F.fromJSON(e,n.content);return e.nodeType(n.type).create(n.attrs,o,r)}};bs.prototype.text=void 0;class em extends bs{constructor(e,n,r,o){if(super(e,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):pR(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new em(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new em(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function pR(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Ba{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new Az(e,n);if(r.next==null)return Ba.empty;let o=hR(r);r.next&&r.err("Unexpected trailing text");let i=Bz(Fz(o));return Uz(i,r),i}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let o=this;for(let i=n;o&&i<r;i++)o=o.matchType(e.child(i).type);return o}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let o=[this];function i(s,a){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return F.from(a.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:u,next:d}=s.next[c];if(!(u.isText||u.hasRequiredAttrs())&&o.indexOf(d)==-1){o.push(d);let f=i(d,a.concat(u));if(f)return f}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),i=o.match;if(i.matchType(e)){let s=[];for(let a=o;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:a,next:l}=i.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!o.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:o}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let o=0;o<r.next.length;o++)e.indexOf(r.next[o].next)==-1&&n(r.next[o].next)}return n(this),e.map((r,o)=>{let i=o+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)i+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return i}).join(`
190
- `)}}Ba.empty=new Ba(!0);class Az{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function hR(t){let e=[];do e.push(Iz(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Iz(t){let e=[];do e.push(Dz(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Dz(t){let e=zz(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=Lz(t,e);else break;return e}function zS(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Lz(t,e){let n=zS(t),r=n;return t.eat(",")&&(t.next!="}"?r=zS(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function jz(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let i in n){let s=n[i];s.groups.indexOf(e)>-1&&o.push(s)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function zz(t){if(t.eat("(")){let e=hR(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=jz(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Fz(t){let e=[[]];return o(i(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,l){let c={term:l,to:a};return e[s].push(c),c}function o(s,a){s.forEach(l=>l.to=a)}function i(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(i(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=i(s.exprs[l],a);if(l==s.exprs.length-1)return c;o(c,a=n())}else if(s.type=="star"){let l=n();return r(a,l),o(i(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return o(i(s.expr,a),l),o(i(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(i(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c<s.min;c++){let u=n();o(i(s.expr,l),u),l=u}if(s.max==-1)o(i(s.expr,l),l);else for(let c=s.min;c<s.max;c++){let u=n();r(l,u),o(i(s.expr,l),u),l=u}return[r(l)]}else{if(s.type=="name")return[r(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function mR(t,e){return e-t}function FS(t,e){let n=[];return r(e),n.sort(mR);function r(o){let i=t[o];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(o);for(let s=0;s<i.length;s++){let{term:a,to:l}=i[s];!a&&n.indexOf(l)==-1&&r(l)}}}function Bz(t){let e=Object.create(null);return n(FS(t,0));function n(r){let o=[];r.forEach(s=>{t[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u<o.length;u++)o[u][0]==a&&(c=o[u][1]);FS(t,l).forEach(u=>{c||o.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new Ba(r.indexOf(t.length-1)>-1);for(let s=0;s<o.length;s++){let a=o[s][1].sort(mR);i.next.push({type:o[s][0],next:e[a.join(",")]||n(a)})}return i}}function Uz(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],i=!o.validEnd,s=[];for(let a=0;a<o.next.length;a++){let{type:l,next:c}=o.next[a];s.push(l.name),i&&!(l.isText||l.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function gR(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function vR(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(o===void 0){let i=t[r];if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function yR(t){let e=Object.create(null);if(t)for(let n in t)e[n]=new Vz(t[n]);return e}let I0=class xR{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=yR(r.attrs),this.defaultAttrs=gR(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Ba.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:vR(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new bs(this,this.computeAttrs(e),F.from(n),qe.setFrom(r))}createChecked(e=null,n,r){return n=F.from(n),this.checkContent(n),new bs(this,this.computeAttrs(e),n,qe.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=F.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let o=this.contentMatch.matchFragment(n),i=o&&o.fillBefore(F.empty,!0);return i?new bs(this,e,n.append(i),qe.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:qe.none:e}static compile(e,n){let r=Object.create(null);e.forEach((i,s)=>r[i]=new xR(i,n,s));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class Vz{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Nf{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=yR(o.attrs),this.excluded=null;let i=gR(this.attrs);this.instance=i?new qe(this,i):null}create(e=null){return!e&&this.instance?this.instance:new qe(this,vR(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((i,s)=>r[i]=new Nf(i,o++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}excludes(e){return this.excluded.indexOf(e)>-1}}class Hz{constructor(e){this.cached=Object.create(null);let n=this.spec={};for(let o in e)n[o]=e[o];n.nodes=pn.from(e.nodes),n.marks=pn.from(e.marks||{}),this.nodes=I0.compile(this.spec.nodes,this),this.marks=Nf.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],s=i.spec.content||"",a=i.spec.marks;i.contentMatch=r[s]||(r[s]=Ba.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet=a=="_"?null:a?BS(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:BS(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof I0){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,o)}text(e,n){let r=this.nodes.text;return new em(r,r.defaultAttrs,e,qe.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return bs.fromJSON(this,e)}markFromJSON(e){return qe.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function BS(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],i=t.marks[o],s=i;if(i)n.push(i);else for(let a in t.marks){let l=t.marks[a];(o=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}class wc{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let o=e.nodes[r.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new VS(this,n,!1);return r.addAll(e,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new VS(this,n,!0);return r.addAll(e,n.from,n.to),J.maxOpen(r.finish())}matchTag(e,n,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let i=this.tags[o];if(qz(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let s=i.getAttrs(e);if(s===!1)continue;i.attrs=s||void 0}return i}}}matchStyle(e,n,r,o){for(let i=o?this.styles.indexOf(o)+1:0;i<this.styles.length;i++){let s=this.styles[i],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(o){let i=o.priority==null?50:o.priority,s=0;for(;s<n.length;s++){let a=n[s];if((a.priority==null?50:a.priority)<i)break}n.splice(s,0,o)}for(let o in e.marks){let i=e.marks[o].spec.parseDOM;i&&i.forEach(s=>{r(s=HS(s)),s.mark||s.ignore||s.clearMark||(s.mark=o)})}for(let o in e.nodes){let i=e.nodes[o].spec.parseDOM;i&&i.forEach(s=>{r(s=HS(s)),s.node||s.ignore||s.mark||(s.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new wc(e,wc.schemaRules(e)))}}const bR={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},Wz={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},wR={ol:!0,ul:!0},tm=1,nm=2,id=4;function US(t,e,n){return e!=null?(e?tm:0)|(e==="full"?nm:0):t&&t.whitespace=="pre"?tm|nm:n&~id}class xp{constructor(e,n,r,o,i,s,a){this.type=e,this.attrs=n,this.marks=r,this.pendingMarks=o,this.solid=i,this.options=a,this.content=[],this.activeMarks=qe.none,this.stashMarks=[],this.match=s||(a&id?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(F.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(e.type))?(this.match=r,o):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&tm)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let n=F.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(F.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(e){for(let n=this.stashMarks.length-1;n>=0;n--)if(e.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(e){for(let n=0,r=this.pendingMarks;n<r.length;n++){let o=r[n];(this.type?this.type.allowsMarkType(o.type):Yz(o.type,e))&&!o.isInSet(this.activeMarks)&&(this.activeMarks=o.addToSet(this.activeMarks),this.pendingMarks=o.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!bR.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class VS{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0;let o=n.topNode,i,s=US(null,n.preserveWhitespace,0)|(r?id:0);o?i=new xp(o.type,o.attrs,qe.none,qe.none,!0,n.topMatch||o.type.contentMatch,s):r?i=new xp(null,null,qe.none,qe.none,!0,null,s):i=new xp(e.schema.topNodeType,null,qe.none,qe.none,!0,null,s),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){e.nodeType==3?this.addTextNode(e):e.nodeType==1&&this.addElement(e)}withStyleRules(e,n){let r=e.getAttribute("style");if(!r)return n();let o=this.readStyles(Gz(r));if(!o)return;let[i,s]=o,a=this.top;for(let l=0;l<s.length;l++)this.removePendingMark(s[l],a);for(let l=0;l<i.length;l++)this.addPendingMark(i[l]);n();for(let l=0;l<i.length;l++)this.removePendingMark(i[l],a);for(let l=0;l<s.length;l++)this.addPendingMark(s[l])}addTextNode(e){let n=e.nodeValue,r=this.top;if(r.options&nm||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(r.options&tm)r.options&nm?n=n.replace(/\r\n?/g,`
191
- `):n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let o=r.content[r.content.length-1],i=e.previousSibling;(!o||i&&i.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n)),this.findInText(e)}else this.findInside(e)}addElement(e,n){let r=e.nodeName.toLowerCase(),o;wR.hasOwnProperty(r)&&this.parser.normalizeLists&&Kz(e);let i=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));if(i?i.ignore:Wz.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(e=i.skip);let s,a=this.top,l=this.needsBlock;if(bR.hasOwnProperty(r))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),s=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e);return}i&&i.skip?this.addAll(e):this.withStyleRules(e,()=>this.addAll(e)),s&&this.sync(a),this.needsBlock=l}else this.withStyleRules(e,()=>{this.addElementByRule(e,i,i.consuming===!1?o:void 0)})}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
192
- `))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let n=qe.none,r=qe.none;for(let o=0;o<e.length;o+=2)for(let i=void 0;;){let s=this.parser.matchStyle(e[o],e[o+1],this,i);if(!s)break;if(s.ignore)return null;if(s.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(a=>{s.clearMark(a)&&(r=a.addToSet(r))}):n=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(n),s.consuming===!1)i=s;else break}return[n,r]}addElementByRule(e,n,r){let o,i,s;n.node?(i=this.parser.schema.nodes[n.node],i.isLeaf?this.insertNode(i.create(n.attrs))||this.leafFallback(e):o=this.enter(i,n.attrs||null,n.preserveWhitespace)):(s=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(s));let a=this.top;if(i&&i.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l)}o&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(e,n,r){let o=n||0;for(let i=n?e.childNodes[n]:e.firstChild,s=r==null?null:e.childNodes[r];i!=s;i=i.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(i);this.findAtPoint(e,o)}findPlace(e){let n,r;for(let o=this.open;o>=0;o--){let i=this.nodes[o],s=i.findWrapping(e);if(s&&(!n||n.length>s.length)&&(n=s,r=i,!s.length)||i.solid)break}if(!n)return!1;this.sync(r);for(let o=0;o<n.length;o++)this.enterInner(n[o],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let n=this.textblockFromContext();n&&this.enterInner(n)}if(this.findPlace(e)){this.closeExtra();let n=this.top;n.applyPending(e.type),n.match&&(n.match=n.match.matchType(e.type));let r=n.activeMarks;for(let o=0;o<e.marks.length;o++)(!n.type||n.type.allowsMarkType(e.marks[o].type))&&(r=e.marks[o].addToSet(r));return n.content.push(e.mark(r)),!0}return!1}enter(e,n,r){let o=this.findPlace(e.create(n));return o&&this.enterInner(e,n,!0,r),o}enterInner(e,n=null,r=!1,o){this.closeExtra();let i=this.top;i.applyPending(e),i.match=i.match&&i.match.matchType(e);let s=US(e,o,i.options);i.options&id&&i.content.length==0&&(s|=id),this.nodes.push(new xp(e,n,i.activeMarks,i.pendingMarks,r,null,s)),this.open++}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let n=this.open;n>=0;n--)if(this.nodes[n]==e)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=i;l--)if(s(a-1,l))return!0;return!1}else{let u=l>0||l==0&&o?this.nodes[l].type:r&&l>=i?r.node(l-i).type:null;if(!u||u.name!=c&&u.groups.indexOf(c)==-1)return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let n=Zz(e,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,n){for(let r=this.open;r>=0;r--){let o=this.nodes[r];if(o.pendingMarks.lastIndexOf(e)>-1)o.pendingMarks=e.removeFromSet(o.pendingMarks);else{o.activeMarks=e.removeFromSet(o.activeMarks);let s=o.popFromStashMark(e);s&&o.type&&o.type.allowsMarkType(s.type)&&(o.activeMarks=s.addToSet(o.activeMarks))}if(o==n)break}}}function Kz(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&wR.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function qz(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Gz(t){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,n,r=[];for(;n=e.exec(t);)r.push(n[1],n[2].trim());return r}function HS(t){let e={};for(let n in t)e[n]=t[n];return e}function Yz(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let i=[],s=a=>{i.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:u}=a.edge(l);if(c==e||i.indexOf(u)<0&&s(u))return!0}};if(s(o.contentMatch))return!0}}function Zz(t,e){for(let n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}class ro{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=jv(n).createDocumentFragment());let o=r,i=[];return e.forEach(s=>{if(i.length||s.marks.length){let a=0,l=0;for(;a<i.length&&l<s.marks.length;){let c=s.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(i[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<i.length;)o=i.pop()[1];for(;l<s.marks.length;){let c=s.marks[l++],u=this.serializeMark(c,s.isInline,n);u&&(i.push([c,o]),o.appendChild(u.dom),o=u.contentDOM||u.dom)}}o.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:o}=ro.renderSpec(jv(n),this.nodes[e.type.name](e));if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,o)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let o=e.marks.length-1;o>=0;o--){let i=this.serializeMark(e.marks[o],e.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,n,r={}){let o=this.marks[e.type.name];return o&&ro.renderSpec(jv(r),o(e,n))}static renderSpec(e,n,r=null){if(typeof n=="string")return{dom:e.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let o=n[0],i=o.indexOf(" ");i>0&&(r=o.slice(0,i),o=o.slice(i+1));let s,a=r?e.createElementNS(r,o):e.createElement(o),l=n[1],c=1;if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){c=2;for(let u in l)if(l[u]!=null){let d=u.indexOf(" ");d>0?a.setAttributeNS(u.slice(0,d),u.slice(d+1),l[u]):a.setAttribute(u,l[u])}}for(let u=c;u<n.length;u++){let d=n[u];if(d===0){if(u<n.length-1||u>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:f,contentDOM:p}=ro.renderSpec(e,d,r);if(a.appendChild(f),p){if(s)throw new RangeError("Multiple content holes");s=p}}}return{dom:a,contentDOM:s}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ro(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=WS(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return WS(e.marks)}}function WS(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function jv(t){return t.document||window.document}const kR=65535,SR=Math.pow(2,16);function Jz(t,e){return t+e*SR}function KS(t){return t&kR}function Xz(t){return(t-(t&kR))/SR}const ER=1,_R=2,Fp=4,CR=8;class D0{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&CR)>0}get deletedBefore(){return(this.delInfo&(ER|Fp))>0}get deletedAfter(){return(this.delInfo&(_R|Fp))>0}get deletedAcross(){return(this.delInfo&Fp)>0}}class cr{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&cr.empty)return cr.empty}recover(e){let n=0,r=KS(e);if(!this.inverted)for(let o=0;o<r;o++)n+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+n+Xz(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let o=0,i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?o:0);if(l>e)break;let c=this.ranges[a+i],u=this.ranges[a+s],d=l+c;if(e<=d){let f=c?e==l?-1:e==d?1:n:n,p=l+o+(f<0?0:u);if(r)return p;let m=e==(n<0?l:d)?null:Jz(a/3,e-l),g=e==l?_R:e==d?ER:Fp;return(n<0?e!=l:e!=d)&&(g|=CR),new D0(p,g,m)}o+=u-c}return r?e+o:new D0(e+o,0,null)}touches(e,n){let r=0,o=KS(n),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let c=this.ranges[a+i],u=l+c;if(e<=u&&a==o*3)return!0;r+=this.ranges[a+s]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o<this.ranges.length;o+=3){let s=this.ranges[o],a=s-(this.inverted?i:0),l=s+(this.inverted?0:i),c=this.ranges[o+n],u=this.ranges[o+r];e(a,a+c,l,l+u),i+=u-c}}invert(){return new cr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?cr.empty:new cr(e<0?[0,-e,0]:[0,0,e])}}cr.empty=new cr([]);class ec{constructor(e=[],n,r=0,o=e.length){this.maps=e,this.mirror=n,this.from=r,this.to=o}slice(e=0,n=this.maps.length){return new ec(this.maps,this.mirror,e,n)}copy(){return new ec(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,n){this.to=this.maps.push(e),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(e){for(let n=0,r=this.maps.length;n<e.maps.length;n++){let o=e.getMirror(n);this.appendMap(e.maps[n],o!=null&&o<n?r+o:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this.maps.length+e.maps.length;n>=0;n--){let o=e.getMirror(n);this.appendMap(e.maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let e=new ec;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let o=0;for(let i=this.from;i<this.to;i++){let s=this.maps[i],a=s.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(i);if(l!=null&&l>i&&l<this.to){i=l,e=this.maps[l].recover(a.recover);continue}}o|=a.delInfo,e=a.pos}return r?e:new D0(e,o,null)}}const zv=Object.create(null);class Yt{getMap(){return cr.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=zv[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in zv)throw new RangeError("Duplicate use of step JSON ID "+e);return zv[e]=n,n.prototype.jsonID=e,n}}class jt{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new jt(e,null)}static fail(e){return new jt(null,e)}static fromReplace(e,n,r,o){try{return jt.ok(e.replace(n,r,o))}catch(i){if(i instanceof Xh)return jt.fail(i.message);throw i}}}function Q1(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let i=t.child(o);i.content.size&&(i=i.copy(Q1(i.content,e,i))),i.isInline&&(i=e(i,n,o)),r.push(i)}return F.fromArray(r)}class ii extends Yt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new J(Q1(n.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),n.openStart,n.openEnd);return jt.fromReplace(e,this.from,this.to,i)}invert(){return new oo(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new ii(n.pos,r.pos,this.mark)}merge(e){return e instanceof ii&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ii(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new ii(n.from,n.to,e.markFromJSON(n.mark))}}Yt.jsonID("addMark",ii);class oo extends Yt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new J(Q1(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return jt.fromReplace(e,this.from,this.to,r)}invert(){return new ii(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new oo(n.pos,r.pos,this.mark)}merge(e){return e instanceof oo&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new oo(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new oo(n.from,n.to,e.markFromJSON(n.mark))}}Yt.jsonID("removeMark",oo);class as extends Yt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return jt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return jt.fromReplace(e,this.pos,this.pos+1,new J(F.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;o<n.marks.length;o++)if(!n.marks[o].isInSet(r))return new as(this.pos,n.marks[o]);return new as(this.pos,this.mark)}}return new kc(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new as(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new as(n.pos,e.markFromJSON(n.mark))}}Yt.jsonID("addNodeMark",as);class kc extends Yt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return jt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return jt.fromReplace(e,this.pos,this.pos+1,new J(F.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new as(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new kc(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new kc(n.pos,e.markFromJSON(n.mark))}}Yt.jsonID("removeNodeMark",kc);class nn extends Yt{constructor(e,n,r,o=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=o}apply(e){return this.structure&&L0(e,this.from,this.to)?jt.fail("Structure replace would overwrite content"):jt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new cr([this.from,this.to-this.from,this.slice.size])}invert(e){return new nn(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new nn(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof nn)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?J.empty:new J(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new nn(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?J.empty:new J(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new nn(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new nn(n.from,n.to,J.fromJSON(e,n.slice),!!n.structure)}}Yt.jsonID("replace",nn);class zt extends Yt{constructor(e,n,r,o,i,s,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=a}apply(e){if(this.structure&&(L0(e,this.from,this.gapFrom)||L0(e,this.gapTo,this.to)))return jt.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return jt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?jt.fromReplace(e,this.from,this.to,r):jt.fail("Content does not fit in gap")}getMap(){return new cr([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new zt(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=e.map(this.gapFrom,-1),i=e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||i>r.pos?null:new zt(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new zt(n.from,n.to,n.gapFrom,n.gapTo,J.fromJSON(e,n.slice),n.insert,!!n.structure)}}Yt.jsonID("replaceAround",zt);function L0(t,e,n){let r=t.resolve(e),o=n-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function Qz(t,e,n,r){let o=[],i=[],s,a;t.doc.nodesBetween(e,n,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),p=Math.min(c+l.nodeSize,n),m=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(m)||(s&&s.to==f&&s.mark.eq(d[g])?s.to=p:o.push(s=new oo(f,p,d[g])));a&&a.to==f?a.to=p:i.push(a=new ii(f,p,r))}}),o.forEach(l=>t.step(l)),i.forEach(l=>t.step(l))}function eF(t,e,n,r){let o=[],i=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;i++;let l=null;if(r instanceof Nf){let c=s.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,n);for(let u=0;u<l.length;u++){let d=l[u],f;for(let p=0;p<o.length;p++){let m=o[p];m.step==i-1&&d.eq(o[p].style)&&(f=m)}f?(f.to=c,f.step=i):o.push({style:d,from:Math.max(a,e),to:c,step:i})}}}),o.forEach(s=>t.step(new oo(s.from,s.to,s.style)))}function tF(t,e,n,r=n.contentMatch){let o=t.doc.nodeAt(e),i=[],s=e+1;for(let a=0;a<o.childCount;a++){let l=o.child(a),c=s+l.nodeSize,u=r.matchType(l.type);if(!u)i.push(new nn(s,c,J.empty));else{r=u;for(let d=0;d<l.marks.length;d++)n.allowsMarkType(l.marks[d].type)||t.step(new oo(s,c,l.marks[d]));if(l.isText&&!n.spec.code){let d,f=/\r?\n|\r/g,p;for(;d=f.exec(l.text);)p||(p=new J(F.from(n.schema.text(" ",n.allowedMarks(l.marks))),0,0)),i.push(new nn(s+d.index,s+d.index+d[0].length,p))}}s=c}if(!r.validEnd){let a=r.fillBefore(F.empty,!0);t.replace(s,s,new J(a,0,0))}for(let a=i.length-1;a>=0;a--)t.step(i[a])}function nF(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Bc(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let o=t.$from.node(r),i=t.$from.index(r),s=t.$to.indexAfter(r);if(r<t.depth&&o.canReplace(i,s,n))return r;if(r==0||o.type.spec.isolating||!nF(o,i,s))break}return null}function rF(t,e,n){let{$from:r,$to:o,depth:i}=e,s=r.before(i+1),a=o.after(i+1),l=s,c=a,u=F.empty,d=0;for(let m=i,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,u=F.from(r.node(m).copy(u)),d++):l--;let f=F.empty,p=0;for(let m=i,g=!1;m>n;m--)g||o.after(m+1)<o.end(m)?(g=!0,f=F.from(o.node(m).copy(f)),p++):c++;t.step(new zt(l,c,s,a,new J(u.append(f),d,p),u.size-d,!0))}function eb(t,e,n=null,r=t){let o=oF(t,e),i=o&&iF(r,e);return i?o.map(qS).concat({type:e,attrs:n}).concat(i.map(qS)):null}function qS(t){return{type:t,attrs:null}}function oF(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return n.canReplaceWith(r,o,s)?i:null}function iF(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let c=r;l&&c<o;c++)l=l.matchType(n.child(c).type);return!l||!l.validEnd?null:s}function sF(t,e,n){let r=F.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=F.from(n[s].type.create(n[s].attrs,r))}let o=e.start,i=e.end;t.step(new zt(o,i,o,i,new J(r,0,0),n.length,!0))}function aF(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{if(s.isTextblock&&!s.hasMarkup(r,o)&&lF(t.doc,t.mapping.slice(i).map(a),r)){t.clearIncompatible(t.mapping.slice(i).map(a,1),r);let l=t.mapping.slice(i),c=l.map(a,1),u=l.map(a+s.nodeSize,1);return t.step(new zt(c,u,c+1,u-1,new J(F.from(r.create(o,null,s.marks)),0,0),1,!0)),!1}})}function lF(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function cF(t,e,n,r,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new zt(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new J(F.from(s),0,0),1,!0))}function tc(t,e,n=1,r){let o=t.resolve(e),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,u=n-2;c>i;c--,u--){let d=o.node(c),f=o.index(c);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(f,d.childCount),m=r&&r[u+1];m&&(p=p.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[u]||d;if(!d.canReplace(f+1,d.childCount)||!g.type.validContent(p))return!1}let a=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function uF(t,e,n=1,r){let o=t.doc.resolve(e),i=F.empty,s=F.empty;for(let a=o.depth,l=o.depth-n,c=n-1;a>l;a--,c--){i=F.from(o.node(a).copy(i));let u=r&&r[c];s=F.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}t.step(new nn(e,e,new J(i.append(s),n,n),!0))}function Pf(t,e){let n=t.resolve(e),r=n.index();return dF(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function dF(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function fF(t,e,n){let r=new nn(e-n,e+n,J.empty,!0);t.step(r)}function TR(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let i=r.indexAfter(o);if(r.node(o).canReplaceWith(i,i,n))return r.after(o+1);if(i<r.node(o).childCount)return null}return null}function OR(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let i=0;i<n.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(n.openStart==0&&n.size?2:1);i++)for(let s=r.depth;s>=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(a>0?1:0),c=r.node(s),u=!1;if(i==1)u=c.canReplace(l,l,o);else{let d=c.contentMatchAt(l).findWrapping(o.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function tb(t,e,n=e,r=J.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return MR(o,i,r)?new nn(e,n,r):new pF(o,i,r).fit()}function MR(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class pF{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=F.empty;for(let o=0;o<=e.depth;o++){let i=e.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=F.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let i=this.placed,s=r.depth,a=o.depth;for(;s&&a&&i.childCount==1;)i=i.firstChild.content,s--,a--;let l=new J(i,s,a);return e>-1?new zt(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new nn(r.pos,o.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let i=n.firstChild;if(n.childCount>1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=Fv(this.unplaced.content,r-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,d=null;if(n==1&&(s?c.matchType(s.type)||(d=c.fillBefore(F.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:d};if(n==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=Fv(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new J(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=Fv(e,n);if(o.childCount<=1&&n>0){let i=e.size-n<=n+o.size;this.unplaced=new J(wu(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new J(wu(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let g=0;g<i.length;g++)this.openFrontierNode(i[g]);let s=this.unplaced,a=r?r.content:s.content,l=s.openStart-e,c=0,u=[],{match:d,type:f}=this.frontier[n];if(o){for(let g=0;g<o.childCount;g++)u.push(o.child(g));d=d.matchFragment(o)}let p=a.size+e-(s.content.size-s.openEnd);for(;c<a.childCount;){let g=a.child(c),y=d.matchType(g.type);if(!y)break;c++,(c>1||l==0||g.content.size)&&(d=y,u.push(RR(g.mark(f.allowedMarks(g.marks)),c==1?l:0,c==a.childCount?p:-1)))}let m=c==a.childCount;m||(p=-1),this.placed=ku(this.placed,n,F.from(u)),this.frontier[n].match=d,m&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=a;g<p;g++){let v=y.lastChild;this.frontier.push({type:v.type,match:v.contentMatchAt(v.childCount)}),y=v.content}this.unplaced=m?e==0?J.empty:new J(wu(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new J(wu(s.content,e,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!Bv(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,o=this.$to.after(r);for(;r>1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],i=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),s=Bv(e,n,o,r,i);if(s){for(let a=n-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],u=Bv(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:i?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=ku(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let o=e.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,i)}return e}openFrontierNode(e,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=ku(this.placed,this.depth,F.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(F.empty,!0);n.childCount&&(this.placed=ku(this.placed,this.frontier.length,n))}}function wu(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(wu(t.firstChild.content,e-1,n)))}function ku(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(ku(t.lastChild.content,e-1,n)))}function Fv(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function RR(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,RR(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(F.empty,!0)))),t.copy(r)}function Bv(t,e,n,r,o){let i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!hF(n,i.content,s)?a:null}function hF(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function mF(t){return t.spec.defining||t.spec.definingForContent}function gF(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),i=t.doc.resolve(n);if(MR(o,i,r))return t.step(new nn(e,n,r));let s=PR(o,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let f=o.depth,p=o.pos-1;f>0;f--,p--){let m=o.node(f).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;s.indexOf(f)>-1?a=f:o.before(f)==p&&s.splice(1,0,-f)}let l=s.indexOf(a),c=[],u=r.openStart;for(let f=r.content,p=0;;p++){let m=f.firstChild;if(c.push(m),p==r.openStart)break;f=m.content}for(let f=u-1;f>=0;f--){let p=c[f],m=mF(p.type);if(m&&!p.sameMarkup(o.node(Math.abs(a)-1)))u=f;else if(m||!p.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let p=(f+u+1)%(r.openStart+1),m=c[p];if(m)for(let g=0;g<s.length;g++){let y=s[(g+l)%s.length],v=!0;y<0&&(v=!1,y=-y);let x=o.node(y-1),w=o.index(y-1);if(x.canReplaceWith(w,w,m.type,m.marks))return t.replace(o.before(y),v?i.after(y):n,new J(NR(r.content,0,r.openStart,p),p,r.openEnd))}}let d=t.steps.length;for(let f=s.length-1;f>=0&&(t.replace(e,n,r),!(t.steps.length>d));f--){let p=s[f];p<0||(e=o.before(p),n=i.after(p))}}function NR(t,e,n,r,o){if(e<n){let i=t.firstChild;t=t.replaceChild(0,i.copy(NR(i.content,e+1,n,r,i)))}if(e>r){let i=o.contentMatchAt(0),s=i.fillBefore(t).append(t);t=s.append(i.matchFragment(s).fillBefore(F.empty,!0))}return t}function vF(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=TR(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new J(F.from(r),0,0))}function yF(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),i=PR(r,o);for(let s=0;s<i.length;s++){let a=i[s],l=s==i.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),o.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),o.indexAfter(a-1))))return t.delete(r.before(a),o.after(a))}for(let s=1;s<=r.depth&&s<=o.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&o.end(s)-n!=o.depth-s)return t.delete(r.before(s),n);t.delete(e,n)}function PR(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let o=r;o>=0;o--){let i=t.start(o);if(i<t.pos-(t.depth-o)||e.end(o)>e.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&n.push(o)}return n}class nc extends Yt{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return jt.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return jt.fromReplace(e,this.pos,this.pos+1,new J(F.from(o),0,n.isLeaf?0:1))}getMap(){return cr.empty}invert(e){return new nc(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new nc(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new nc(n.pos,n.attr,n.value)}}Yt.jsonID("attr",nc);class Yd extends Yt{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let o in e.attrs)n[o]=e.attrs[o];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return jt.ok(r)}getMap(){return cr.empty}invert(e){return new Yd(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Yd(n.attr,n.value)}}Yt.jsonID("docAttr",Yd);let Sc=class extends Error{};Sc=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Sc.prototype=Object.create(Error.prototype);Sc.prototype.constructor=Sc;Sc.prototype.name="TransformError";class xF{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ec}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Sc(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=J.empty){let o=tb(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new J(F.from(r),0,0))}delete(e,n){return this.replace(e,n,J.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return gF(this,e,n,r),this}replaceRangeWith(e,n,r){return vF(this,e,n,r),this}deleteRange(e,n){return yF(this,e,n),this}lift(e,n){return rF(this,e,n),this}join(e,n=1){return fF(this,e,n),this}wrap(e,n){return sF(this,e,n),this}setBlockType(e,n=e,r,o=null){return aF(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return cF(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new nc(e,n,r)),this}setDocAttribute(e,n){return this.step(new Yd(e,n)),this}addNodeMark(e,n){return this.step(new as(e,n)),this}removeNodeMark(e,n){if(!(n instanceof qe)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new kc(e,n)),this}split(e,n=1,r){return uF(this,e,n,r),this}addMark(e,n,r){return Qz(this,e,n,r),this}removeMark(e,n,r){return eF(this,e,n,r),this}clearIncompatible(e,n,r){return tF(this,e,n,r),this}}const Uv=Object.create(null);class je{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new bF(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=J.empty){let r=n.content.lastChild,o=null;for(let a=0;a<n.openEnd;a++)o=r,r=r.lastChild;let i=e.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:c}=s[a],u=e.mapping.slice(i);e.replaceRange(u.map(l.pos),u.map(c.pos),a?J.empty:n),a==0&&ZS(e,i,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,o=this.ranges;for(let i=0;i<o.length;i++){let{$from:s,$to:a}=o[i],l=e.mapping.slice(r),c=l.map(s.pos),u=l.map(a.pos);i?e.deleteRange(c,u):(e.replaceRangeWith(c,u,n),ZS(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let o=e.parent.inlineContent?new Ce(e):kl(e.node(0),e.parent,e.pos,e.index(),n,r);if(o)return o;for(let i=e.depth-1;i>=0;i--){let s=n<0?kl(e.node(0),e.node(i),e.before(i+1),e.index(i),n,r):kl(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new jn(e.node(0))}static atStart(e){return kl(e,e,0,0,1)||new jn(e)}static atEnd(e){return kl(e,e,e.content.size,e.childCount,-1)||new jn(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Uv[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Uv)throw new RangeError("Duplicate use of selection JSON ID "+e);return Uv[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Ce.between(this.$anchor,this.$head).getBookmark()}}je.prototype.visible=!0;class bF{constructor(e,n){this.$from=e,this.$to=n}}let GS=!1;function YS(t){!GS&&!t.parent.inlineContent&&(GS=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Ce extends je{constructor(e,n=e){YS(e),YS(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return je.near(r);let o=e.resolve(n.map(this.anchor));return new Ce(o.parent.inlineContent?o:r,r)}replace(e,n=J.empty){if(super.replace(e,n),n==J.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Ce&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Eg(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Ce(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let o=e.resolve(n);return new this(o,r==n?o:e.resolve(r))}static between(e,n,r){let o=e.pos-n.pos;if((!r||o)&&(r=o>=0?1:-1),!n.parent.inlineContent){let i=je.findFrom(n,r,!0)||je.findFrom(n,-r,!0);if(i)n=i.$head;else return je.near(n,r)}return e.parent.inlineContent||(o==0?e=n:(e=(je.findFrom(e,-r,!0)||je.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=o<0&&(e=n))),new Ce(e,n)}}je.jsonID("text",Ce);class Eg{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Eg(e.map(this.anchor),e.map(this.head))}resolve(e){return Ce.between(e.resolve(this.anchor),e.resolve(this.head))}}class ye extends je{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:o}=n.mapResult(this.anchor),i=e.resolve(o);return r?je.near(i):new ye(i)}content(){return new J(F.from(this.node),0,0)}eq(e){return e instanceof ye&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new nb(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ye(e.resolve(n.anchor))}static create(e,n){return new ye(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}ye.prototype.visible=!1;je.jsonID("node",ye);class nb{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Eg(r,r):new nb(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&ye.isSelectable(r)?new ye(n):je.near(n)}}class jn extends je{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=J.empty){if(n==J.empty){e.delete(0,e.doc.content.size);let r=je.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new jn(e)}map(e){return new jn(e)}eq(e){return e instanceof jn}getBookmark(){return wF}}je.jsonID("all",jn);const wF={map(){return this},resolve(t){return new jn(t)}};function kl(t,e,n,r,o,i=!1){if(e.inlineContent)return Ce.create(t,n);for(let s=r-(o>0?0:1);o>0?s<e.childCount:s>=0;s+=o){let a=e.child(s);if(a.isAtom){if(!i&&ye.isSelectable(a))return ye.create(t,n-(o<0?a.nodeSize:0))}else{let l=kl(t,a,n+o,o<0?a.childCount:0,o,i);if(l)return l}n+=a.nodeSize*o}return null}function ZS(t,e,n){let r=t.steps.length-1;if(r<e)return;let o=t.steps[r];if(!(o instanceof nn||o instanceof zt))return;let i=t.mapping.maps[r],s;i.forEach((a,l,c,u)=>{s==null&&(s=u)}),t.setSelection(je.near(t.doc.resolve(s),n))}const JS=1,bp=2,XS=4;class kF extends xF{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|JS)&~bp,this.storedMarks=null,this}get selectionSet(){return(this.updated&JS)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=bp,this}ensureMarks(e){return qe.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&bp)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~bp,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||qe.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let o=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let i=this.storedMarks;if(!i){let s=this.doc.resolve(n);i=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(e,i)),this.selection.empty||this.setSelection(je.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=XS,this}get scrolledIntoView(){return(this.updated&XS)>0}}function QS(t,e){return!e||!t?t:t.bind(e)}class Su{constructor(e,n,r){this.name=e,this.init=QS(n.init,r),this.apply=QS(n.apply,r)}}const SF=[new Su("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Su("selection",{init(t,e){return t.selection||je.atStart(e.doc)},apply(t){return t.selection}}),new Su("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Su("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Vv{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=SF.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 Su(r.key,r.spec.state,r))})}}class ha{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let o=this.config.plugins[r];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),o=null;for(;;){let i=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let l=o?o[s].n:0,c=o?o[s].state:this,u=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,c,r);if(u&&r.filterTransaction(u,s)){if(u.setMeta("appendedTransaction",e),!o){o=[];for(let d=0;d<this.config.plugins.length;d++)o.push(d<s?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),i=!0}o&&(o[s]={state:r,n:n.length})}}if(!i)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new ha(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let i=r[o];n[i.name]=i.apply(e,this[i.name],this,n)}return n}get tr(){return new kF(this)}static create(e){let n=new Vv(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new ha(n);for(let o=0;o<n.fields.length;o++)r[n.fields[o].name]=n.fields[o].init(e,r);return r}reconfigure(e){let n=new Vv(this.schema,e.plugins),r=n.fields,o=new ha(n);for(let i=0;i<r.length;i++){let s=r[i].name;o[s]=this.hasOwnProperty(s)?this[s]:r[i].init(e,o)}return o}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=e[r],i=o.spec.state;i&&i.toJSON&&(n[r]=i.toJSON.call(o,this[o.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new Vv(e.schema,e.plugins),i=new ha(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=bs.fromJSON(e.schema,n.doc);else if(s.name=="selection")i.selection=je.fromJSON(i.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){i[s.name]=c.fromJSON.call(l,e,n[a],i);return}}i[s.name]=s.init(e,i)}}),i}}function $R(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=$R(o,e,{})),n[r]=o}return n}class Ti{constructor(e){this.spec=e,this.props={},e.props&&$R(e.props,this,this.props),this.key=e.key?e.key.key:AR("plugin")}getState(e){return e[this.key]}}const Hv=Object.create(null);function AR(t){return t in Hv?t+"$"+ ++Hv[t]:(Hv[t]=0,t+"$")}class Uc{constructor(e="key"){this.key=AR(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}function IR(){return typeof document<"u"?document:null}function DR(t,e){if(typeof t!="string")return[t];var n=[t];typeof e=="string"||Array.isArray(e)?e={brackets:e}:e||(e={});var r=e.brackets?Array.isArray(e.brackets)?e.brackets:[e.brackets]:["{}","[]","()"],o=e.escape||"___",i=!!e.flat;r.forEach(function(l){var c=new RegExp(["\\",l[0],"[^\\",l[0],"\\",l[1],"]*\\",l[1]].join("")),u=[];function d(f,p,m){var g=n.push(f.slice(l[0].length,-l[1].length))-1;return u.push(g),o+g+o}n.forEach(function(f,p){for(var m,g=0;f!=m;)if(m=f,f=f.replace(c,d),g++>1e4)throw Error("References have circular dependency. Please, check them.");n[p]=f}),u=u.reverse(),n=n.map(function(f){return u.forEach(function(p){f=f.replace(new RegExp("(\\"+o+p+"\\"+o+")","g"),l[0]+"$1"+l[1])}),f})});var s=new RegExp("\\"+o+"([0-9]+)\\"+o);function a(l,c,u){for(var d=[],f,p=0;f=s.exec(l);){if(p++>1e4)throw Error("Circular references in parenthesis");d.push(l.slice(0,f.index)),d.push(a(c[f[1]],c)),l=l.slice(f.index+f[0].length)}return d.push(l),d}return i?n:a(n[0],n)}function LR(t,e){if(e&&e.flat){var n=e&&e.escape||"___",r=t[0],o;if(!r)return"";for(var i=new RegExp("\\"+n+"([0-9]+)\\"+n),s=0;r!=o;){if(s++>1e4)throw Error("Circular references in "+t);o=r,r=r.replace(i,a)}return r}return t.reduce(function l(c,u){return Array.isArray(u)&&(u=u.reduce(l,"")),c+u},"");function a(l,c){if(t[c]==null)throw Error("Reference "+c+"is undefined");return t[c]}}function jR(t,e){return Array.isArray(t)?LR(t,e):DR(t,e)}jR.parse=DR;jR.stringify=LR;const EF={id:"extension.command.copy.label",message:"Copy",comment:"Label for copy command."},_F={id:"extension.command.copy.description",message:"Copy the selected text",comment:"Description for copy command."},CF={id:"extension.command.cut.label",message:"Cut",comment:"Label for cut command."},TF={id:"extension.command.cut.description",message:"Cut the selected text",comment:"Description for cut command."},OF={id:"extension.command.paste.label",message:"Paste",comment:"Label for paste command."},MF={id:"extension.command.paste.description",message:"Paste content into the editor",comment:"Description for paste command."},RF={id:"extension.command.select-all.label",message:"Select all",comment:"Label for select all command."},NF={id:"extension.command.select-all.description",message:"Select all content within the editor",comment:"Description for select all command."};var Is=Object.freeze({__proto__:null,COPY_DESCRIPTION:_F,COPY_LABEL:EF,CUT_DESCRIPTION:TF,CUT_LABEL:CF,PASTE_DESCRIPTION:MF,PASTE_LABEL:OF,SELECT_ALL_DESCRIPTION:NF,SELECT_ALL_LABEL:RF});const PF={id:"extension.command.toggle-bold.label",message:"Bold",comment:"Label for bold formatting command."},$F={id:"extension.command.toggle-bold.description",message:"Add bold formatting to the selected text",comment:"Description for bold formatting command."};var eE=Object.freeze({__proto__:null,DESCRIPTION:$F,LABEL:PF});const AF={id:"extension.command.toggle-heading.label",message:`{level, select, 1 {Heading 1}
193
- 2 {Heading 2}
194
- 3 {Heading 3}
195
- 4 {Heading 4}
196
- 5 {Heading 5}
197
- 6 {Heading 6}
198
- other {Heading}}`,comment:"Label for heading command with support for levels."};var IF=Object.freeze({__proto__:null,LABEL:AF});const DF={id:"extension.command.undo.label",message:"Undo",comment:"Label for undo."},LF={id:"extension.command.undo.description",message:"Undo the most recent action",comment:"Description for undo."},jF={id:"extension.command.redo.label",message:"Redo",comment:"Label for redo."},zF={id:"extension.command.redo.description",message:"Redo the most recent action",comment:"Description for redo."};var rm=Object.freeze({__proto__:null,REDO_DESCRIPTION:zF,REDO_LABEL:jF,UNDO_DESCRIPTION:LF,UNDO_LABEL:DF});const FF={id:"extension.command.toggle-italic.label",message:"Italic",comment:"Label for italic formatting command."},BF={id:"extension.command.toggle-italic.description",message:"Italicize the selected text",comment:"Description for italic formatting command."};var tE=Object.freeze({__proto__:null,DESCRIPTION:BF,LABEL:FF});const UF={id:"extension.command.toggle-ordered-list.label",message:"Ordered list",comment:"Label for inserting an ordered list into the editor."},VF={id:"extension.command.toggle-bullet-list.description",message:"Bulleted list",comment:"Description for inserting a bullet list into the editor."},HF={id:"extension.command.toggle-task-list.description",message:"Tasked list",comment:"Description for inserting a task list into the editor."};var rb=Object.freeze({__proto__:null,BULLET_LIST_LABEL:VF,ORDERED_LIST_LABEL:UF,TASK_LIST_LABEL:HF});const WF={id:"extension.command.insert-paragraph.label",message:"Insert Paragraph",comment:"Label for inserting a paragraph."},KF={id:"extension.command.insert-paragraph.description",message:"Insert a new paragraph",comment:"Description for inserting a paragraph."},qF={id:"extension.command.convert-paragraph.label",message:"Convert Paragraph",comment:"Label for converting the current node into a paragraph."},GF={id:"extension.command.convert-paragraph.description",message:"Convert current block into a paragraph block.",comment:"Description for converting a paragraph."};var om=Object.freeze({__proto__:null,CONVERT_DESCRIPTION:GF,CONVERT_LABEL:qF,INSERT_DESCRIPTION:KF,INSERT_LABEL:WF});const YF={id:"extension.command.toggle-strike.label",message:"Strikethrough",comment:"Label for strike formatting command."},ZF={id:"extension.command.toggle-strike.description",message:"Strikethrough the selected text",comment:"Description for strike formatting command."};var nE=Object.freeze({__proto__:null,DESCRIPTION:ZF,LABEL:YF});class zr{constructor(e,n,r={}){this.match=e,this.match=e,this.handler=typeof n=="string"?JF(n):n,this.undoable=r.undoable!==!1}}function JF(t){return function(e,n,r,o){let i=t;if(n[1]){let s=n[0].lastIndexOf(n[1]);i+=n[0].slice(s+n[1].length),r+=s;let a=r-o;a>0&&(i=n[0].slice(s-a,s)+i,r=o)}return e.tr.insertText(i,r,o)}}const XF=500;function QF({rules:t}){let e=new Ti({state:{init(){return null},apply(n,r){let o=n.getMeta(this);return o||(n.selectionSet||n.docChanged?null:r)}},props:{handleTextInput(n,r,o,i){return rE(n,r,o,i,t,e)},handleDOMEvents:{compositionend:n=>{setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&rE(n,r.pos,r.pos,"",t,e)})}}},isInputRules:!0});return e}function rE(t,e,n,r,o,i){if(t.composing)return!1;let s=t.state,a=s.doc.resolve(e);if(a.parent.type.spec.code)return!1;let l=a.parent.textBetween(Math.max(0,a.parentOffset-XF),a.parentOffset,null,"")+r;for(let c=0;c<o.length;c++){let u=o[c],d=u.match.exec(l),f=d&&u.handler(s,d,e-(d[0].length-r.length),n);if(f)return u.undoable&&f.setMeta(i,{transform:f,from:e,to:n,text:r}),t.dispatch(f),!0}return!1}const eB=(t,e)=>{let n=t.plugins;for(let r=0;r<n.length;r++){let o=n[r],i;if(o.spec.isInputRules&&(i=o.getState(t))){if(e){let s=t.tr,a=i.transform;for(let l=a.steps.length-1;l>=0;l--)s.step(a.steps[l].invert(a.docs[l]));if(i.text){let l=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,t.schema.text(i.text,l))}else s.delete(i.from,i.to);e(s)}return!0}}return!1};new zr(/--$/,"—");new zr(/\.\.\.$/,"…");new zr(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“");new zr(/"$/,"”");new zr(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘");new zr(/'$/,"’");function ob(t,e,n=null,r){return new zr(t,(o,i,s,a)=>{let l=n instanceof Function?n(i):n,c=o.tr.delete(s,a),u=c.doc.resolve(s),d=u.blockRange(),f=d&&eb(d,e,l);if(!f)return null;c.wrap(d,f);let p=c.doc.resolve(s-1).nodeBefore;return p&&p.type==e&&Pf(c.doc,s-1)&&(!r||r(i,p))&&c.join(s-1),c})}function tB(t,e,n=null){return new zr(t,(r,o,i,s)=>{let a=r.doc.resolve(i),l=n instanceof Function?n(o):n;return a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),e)?r.tr.delete(i,s).setBlockType(i,i,e,l):null})}const An=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Zd=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let oE=null;const ei=function(t,e,n){let r=oE||(oE=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},Ua=function(t,e,n,r){return n&&(iE(t,e,n,r,-1)||iE(t,e,n,r,1))},nB=/^(img|br|input|textarea|hr)$/i;function iE(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:To(t))){let i=t.parentNode;if(!i||i.nodeType!=1||ib(t)||nB.test(t.nodeName)||t.contentEditable=="false")return!1;e=An(t)+(o<0?0:1),t=i}else if(t.nodeType==1){if(t=t.childNodes[e+(o<0?-1:0)],t.contentEditable=="false")return!1;e=o<0?To(t):0}else return!1}}function To(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function rB(t,e,n){for(let r=e==0,o=e==To(t);r||o;){if(t==n)return!0;let i=An(t);if(t=t.parentNode,!t)return!1;r=r&&i==0,o=o&&i==To(t)}}function ib(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const _g=function(t){return t.focusNode&&Ua(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function sa(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function oB(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function iB(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}const jo=typeof navigator<"u"?navigator:null,sE=typeof document<"u"?document:null,Vs=jo&&jo.userAgent||"",j0=/Edge\/(\d+)/.exec(Vs),zR=/MSIE \d/.exec(Vs),z0=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Vs),er=!!(zR||z0||j0),ws=zR?document.documentMode:z0?+z0[1]:j0?+j0[1]:0,go=!er&&/gecko\/(\d+)/i.test(Vs);go&&+(/Firefox\/(\d+)/.exec(Vs)||[0,0])[1];const F0=!er&&/Chrome\/(\d+)/.exec(Vs),Cn=!!F0,sB=F0?+F0[1]:0,Fn=!er&&!!jo&&/Apple Computer/.test(jo.vendor),Ec=Fn&&(/Mobile\/\w+/.test(Vs)||!!jo&&jo.maxTouchPoints>2),_r=Ec||(jo?/Mac/.test(jo.platform):!1),aB=jo?/Win/.test(jo.platform):!1,Xr=/Android \d/.test(Vs),$f=!!sE&&"webkitFontSmoothing"in sE.documentElement.style,lB=$f?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function cB(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Wo(t,e){return typeof t=="number"?t:t[e]}function uB(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function aE(t,e,n){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let s=n||t.dom;s;s=Zd(s)){if(s.nodeType!=1)continue;let a=s,l=a==i.body,c=l?cB(i):uB(a),u=0,d=0;if(e.top<c.top+Wo(r,"top")?d=-(c.top-e.top+Wo(o,"top")):e.bottom>c.bottom-Wo(r,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+Wo(o,"top")-c.top:e.bottom-c.bottom+Wo(o,"bottom")),e.left<c.left+Wo(r,"left")?u=-(c.left-e.left+Wo(o,"left")):e.right>c.right-Wo(r,"right")&&(u=e.right-c.right+Wo(o,"right")),u||d)if(l)i.defaultView.scrollBy(u,d);else{let f=a.scrollLeft,p=a.scrollTop;d&&(a.scrollTop+=d),u&&(a.scrollLeft+=u);let m=a.scrollLeft-f,g=a.scrollTop-p;e={left:e.left-m,top:e.top-g,right:e.right-m,bottom:e.bottom-g}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function dB(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,o;for(let i=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let a=t.root.elementFromPoint(i,s);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,o=l.top;break}}return{refDOM:r,refTop:o,stack:FR(t.dom)}}function FR(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Zd(r));return e}function fB({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;BR(n,r==0?0:r-e)}function BR(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:o,left:i}=t[n];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=i&&(r.scrollLeft=i)}}let ml=null;function pB(t){if(t.setActive)return t.setActive();if(ml)return t.focus(ml);let e=FR(t);t.focus(ml==null?{get preventScroll(){return ml={preventScroll:!0},!0}}:void 0),ml||(ml=!1,BR(e,0))}function UR(t,e){let n,r=2e8,o,i=0,s=e.top,a=e.top,l,c;for(let u=t.firstChild,d=0;u;u=u.nextSibling,d++){let f;if(u.nodeType==1)f=u.getClientRects();else if(u.nodeType==3)f=ei(u).getClientRects();else continue;for(let p=0;p<f.length;p++){let m=f[p];if(m.top<=s&&m.bottom>=a){s=Math.max(m.bottom,s),a=Math.min(m.top,a);let g=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(g<r){n=u,r=g,o=g&&n.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,u.nodeType==1&&g&&(i=d+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!l&&m.left<=e.left&&m.right>=e.left&&(l=u,c={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!n&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(i=d+1)}}return!n&&l&&(n=l,o=c,r=0),n&&n.nodeType==3?hB(n,o):!n||r&&n.nodeType==1?{node:t,offset:i}:UR(n,o)}function hB(t,e){let n=t.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(t,o+1),r.setStart(t,o);let i=Ui(r,1);if(i.top!=i.bottom&&sb(e,i))return{node:t,offset:o+(e.left>=(i.left+i.right)/2?1:0)}}return{node:t,offset:0}}function sb(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function mB(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function gB(t,e,n){let{node:r,offset:o}=UR(e,n),i=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();i=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,o,i)}function vB(t,e,n,r){let o=-1;for(let i=e,s=!1;i!=t.dom;){let a=t.docView.nearestDesc(i,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent&&!s||!a.contentDOM)){let l=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&!s&&(s=!0,l.left>r.left||l.top>r.top?o=a.posBefore:(l.right<r.left||l.bottom<r.top)&&(o=a.posAfter)),!a.contentDOM&&o<0&&!a.node.isText)return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter}i=a.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,-1)}function VR(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),i=o;;){let s=t.childNodes[i];if(s.nodeType==1){let a=s.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(sb(e,c))return VR(s,e,c)}}if((i=(i+1)%r)==o)break}return t}function yB(t,e){let n=t.dom.ownerDocument,r,o=0,i=iB(n,e.left,e.top);i&&({node:r,offset:o}=i);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let c=t.dom.getBoundingClientRect();if(!sb(e,c)||(s=VR(t.dom,e,c),!s))return null}if(Fn)for(let c=s;r&&c;c=Zd(c))c.draggable&&(r=void 0);if(s=mB(s,e),r){if(go&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let u=r.childNodes[o],d;u.nodeName=="IMG"&&(d=u.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&o++}let c;$f&&o&&r.nodeType==1&&(c=r.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&o--,r==t.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(a=vB(t,r,o,e))}a==null&&(a=gB(t,s,e));let l=t.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function lE(t){return t.top<t.bottom||t.left<t.right}function Ui(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(lE(r))return r}return Array.prototype.find.call(n,lE)||t.getBoundingClientRect()}const xB=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function HR(t,e,n){let{node:r,offset:o,atom:i}=t.docView.domFromPos(e,n<0?-1:1),s=$f||go;if(r.nodeType==3)if(s&&(xB.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let l=Ui(ei(r,o,o),n);if(go&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let c=Ui(ei(r,o-1,o-1),-1);if(c.top==l.top){let u=Ui(ei(r,o,o+1),-1);if(u.top!=l.top)return du(u,u.left<c.left)}}return l}else{let l=o,c=o,u=n<0?1:-1;return n<0&&!o?(c++,u=-1):n>=0&&o==r.nodeValue.length?(l--,u=1):n<0?l--:c++,du(Ui(ei(r,l,c),u),u<0)}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&o&&(n<0||o==To(r))){let l=r.childNodes[o-1];if(l.nodeType==1)return Wv(l.getBoundingClientRect(),!1)}if(i==null&&o<To(r)){let l=r.childNodes[o];if(l.nodeType==1)return Wv(l.getBoundingClientRect(),!0)}return Wv(r.getBoundingClientRect(),n>=0)}if(i==null&&o&&(n<0||o==To(r))){let l=r.childNodes[o-1],c=l.nodeType==3?ei(l,To(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return du(Ui(c,1),!1)}if(i==null&&o<To(r)){let l=r.childNodes[o];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?ei(l,0,s?0:1):l.nodeType==1?l:null:null;if(c)return du(Ui(c,-1),!0)}return du(Ui(r.nodeType==3?ei(r):r,-n),n>=0)}function du(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Wv(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function WR(t,e,n){let r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}function bB(t,e,n){let r=e.selection,o=n=="up"?r.$from:r.$to;return WR(t,e,()=>{let{node:i}=t.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let s=HR(t,o.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=ei(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let u=l[c];if(u.bottom>u.top+1&&(n=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const wB=/[\u0590-\u08ac]/;function kB(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=t.domSelection();return!wB.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?i:s:WR(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=t.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:m,focusOffset:g}=t.domSelectionRange(),y=m&&!p.contains(m.nodeType==1?m:m.parentNode)||l==m&&c==g;try{a.collapse(u,d),l&&(l!=u||c!=d)&&a.extend&&a.extend(l,c)}catch{}return f!=null&&(a.caretBidiLevel=f),y})}let cE=null,uE=null,dE=!1;function SB(t,e,n){return cE==e&&uE==n?dE:(cE=e,uE=n,dE=n=="up"||n=="down"?bB(t,e,n):kB(t,e,n))}const Nr=0,fE=1,ma=2,zo=3;class Af{constructor(e,n,r,o){this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=Nr,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let o=this.children[n];if(o==e)return r;r+=o.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let i,s;if(e==this.contentDOM)i=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.previousSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(s)+s.size:this.posAtStart}else{let i,s;if(e==this.contentDOM)i=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.nextSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(s):this.posAtEnd}let o;if(e==this.dom&&this.contentDOM)o=n>An(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&n==e.childNodes.length)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,o=e;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!n||i.node))if(r&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return i}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let o=e;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let o=this.children[n],i=r+o.size;if(r==e&&i!=r){for(;!o.border&&o.children.length;)o=o.children[0];return o}if(e<i)return o.descAt(e-r-o.border);r=i}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,o=0;for(let i=0;r<this.children.length;r++){let s=this.children[r],a=i+s.size;if(a>e||s instanceof qR){o=e-i;break}i=a}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof KR&&i.side>=0;r--);if(n<=0){let i,s=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,s=!1);return i&&n&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?An(i.dom)+1:0}}else{let i,s=!0;for(;i=r<this.children.length?this.children[r]:null,!(!i||i.dom.parentNode==this.contentDOM);r++,s=!1);return i&&s&&!i.border&&!i.domAtom?i.domFromPos(0,n):{node:this.contentDOM,offset:i?An(i.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,i=-1;for(let s=r,a=0;;a++){let l=this.children[a],c=s+l.size;if(o==-1&&e<=c){let u=s+l.border;if(e>=u&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,u);e=s;for(let d=a;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){o=An(f.dom)+1;break}e-=f.size}o==-1&&(o=0)}if(o>-1&&(c>n||a==this.children.length-1)){n=c;for(let u=a+1;u<this.children.length;u++){let d=this.children[u];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){i=An(d.dom);break}n+=d.size}i==-1&&(i=this.contentDOM.childNodes.length);break}s=c}return{node:this.contentDOM,from:e,to:n,fromOffset:o,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,o=!1){let i=Math.min(e,n),s=Math.max(e,n);for(let f=0,p=0;f<this.children.length;f++){let m=this.children[f],g=p+m.size;if(i>p&&s<g)return m.setSelection(e-p-m.border,n-p-m.border,r,o);p=g}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),c=r.getSelection(),u=!1;if((go||Fn)&&e==n){let{node:f,offset:p}=a;if(f.nodeType==3){if(u=!!(p&&f.nodeValue[p-1]==`
199
- `),u&&p==f.nodeValue.length)for(let m=f,g;m;m=m.parentNode){if(g=m.nextSibling){g.nodeName=="BR"&&(a=l={node:g.parentNode,offset:An(g)+1});break}let y=m.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let m=f.childNodes[p-1];u=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(go&&c.focusNode&&c.focusNode!=l.node&&c.focusNode.nodeType==1){let f=c.focusNode.childNodes[c.focusOffset];f&&f.contentEditable=="false"&&(o=!0)}if(!(o||u&&Fn)&&Ua(a.node,a.offset,c.anchorNode,c.anchorOffset)&&Ua(l.node,l.offset,c.focusNode,c.focusOffset))return;let d=!1;if((c.extend||e==n)&&!u){c.collapse(a.node,a.offset);try{e!=n&&c.extend(l.node,l.offset),d=!0}catch{}}if(!d){if(e>n){let p=a;a=l,l=p}let f=document.createRange();f.setEnd(l.node,l.offset),f.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,o=0;o<this.children.length;o++){let i=this.children[o],s=r+i.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let a=r+i.border,l=s-i.border;if(e>=a&&n<=l){this.dirty=e==r||n==s?ma:fE,e==a&&n==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=zo:i.markDirty(e-a,n-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?ma:zo}r=s}this.dirty=ma}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?ma:fE;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class KR extends Af{constructor(e,n,r,o){let i,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,i=this}matchesWidget(e){return this.dirty==Nr&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class EB extends Af{constructor(e,n,r,o){super(e,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Va extends Af{constructor(e,n,r,o){super(e,[],r,o),this.mark=n}static create(e,n,r,o){let i=o.nodeViews[n.type.name],s=i&&i(n,o,r);return(!s||!s.dom)&&(s=ro.renderSpec(document,n.type.spec.toDOM(n,r))),new Va(e,n,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&zo||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=zo&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Nr){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Nr}}slice(e,n,r){let o=Va.create(this.parent,this.mark,!0,r),i=this.children,s=this.size;n<s&&(i=V0(i,n,s,r)),e>0&&(i=V0(i,0,e,r));for(let a=0;a<i.length;a++)i[a].parent=o;return o.children=i,o}}class ks extends Af{constructor(e,n,r,o,i,s,a,l,c){super(e,[],i,s),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=a}static create(e,n,r,o,i,s){let a=i.nodeViews[n.type.name],l,c=a&&a(n,i,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,o),u=c&&c.dom,d=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=ro.renderSpec(document,n.type.spec.toDOM(n)));!d&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=ZR(u,r,n),c?l=new _B(e,n,r,o,u,d||null,f,c,i,s+1):n.isText?new Cg(e,n,r,o,u,f,i):new ks(e,n,r,o,u,d||null,f,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>F.empty)}return e}matchesNode(e,n,r){return this.dirty==Nr&&e.eq(this.node)&&U0(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,o=n,i=e.composing?this.localCompositionInfo(e,n):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new TB(this,s&&s.node,e);RB(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!d&&l.syncToMarks(u==this.node.childCount?qe.none:this.node.child(u).marks,r,e),l.placeWidget(c,e,o)},(c,u,d,f)=>{l.syncToMarks(c.marks,r,e);let p;l.findNodeMatch(c,u,d,f)||a&&e.state.selection.from>o&&e.state.selection.to<o+c.nodeSize&&(p=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(c,u,d,p,e)||l.updateNextNode(c,u,d,e,f,o)||l.addNode(c,u,d,e,o),o+=c.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==ma)&&(s&&this.protectLocalComposition(e,s),GR(this.contentDOM,this.children,e),Ec&&NB(this.dom))}localCompositionInfo(e,n){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof Ce)||r<n||o>n+this.node.content.size)return null;let i=e.domSelectionRange(),s=PB(i.focusNode,i.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let a=s.nodeValue,l=$B(this.node.content,a,r-n,o-n);return l<0?null:{node:s,pos:l,text:a}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let i=n;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new EB(this,i,n,o);e.input.compositionNodes.push(s),this.children=V0(this.children,r,r+o.length,e,s)}update(e,n,r,o){return this.dirty==zo||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,o),!0)}updateInner(e,n,r,o){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=Nr}updateOuterDeco(e){if(U0(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=YR(this.dom,this.nodeDOM,B0(this.outerDeco,this.node,n),B0(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function pE(t,e,n,r,o){ZR(r,e,t);let i=new ks(void 0,t,e,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class Cg extends ks{constructor(e,n,r,o,i,s,a){super(e,n,r,o,i,null,s,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,o){return this.dirty==zo||this.dirty!=Nr&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Nr||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=e,this.dirty=Nr,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let o=this.node.cut(e,n),i=document.createTextNode(o.text);return new Cg(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=zo)}get domAtom(){return!1}}class qR extends Af{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Nr&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class _B extends ks{constructor(e,n,r,o,i,s,a,l,c,u){super(e,n,r,o,i,s,a,c,u),this.spec=l}update(e,n,r,o){if(this.dirty==zo)return!1;if(this.spec.update){let i=this.spec.update(e,n,r);return i&&this.updateInner(e,n,r,o),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r):super.setSelection(e,n,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function GR(t,e,n){let r=t.firstChild,o=!1;for(let i=0;i<e.length;i++){let s=e[i],a=s.dom;if(a.parentNode==t){for(;a!=r;)r=hE(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(a,r);if(s instanceof Va){let l=r?r.previousSibling:t.lastChild;GR(s.contentDOM,s.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=hE(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}const sd=function(t){t&&(this.nodeName=t)};sd.prototype=Object.create(null);const ga=[new sd];function B0(t,e,n){if(t.length==0)return ga;let r=n?ga[0]:new sd,o=[r];for(let i=0;i<t.length;i++){let s=t[i].type.attrs;if(s){s.nodeName&&o.push(r=new sd(s.nodeName));for(let a in s){let l=s[a];l!=null&&(n&&o.length==1&&o.push(r=new sd(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return o}function YR(t,e,n,r){if(n==ga&&r==ga)return e;let o=e;for(let i=0;i<r.length;i++){let s=r[i],a=n[i];if(i){let l;a&&a.nodeName==s.nodeName&&o!=t&&(l=o.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(o),a=ga[0]),o=l}CB(o,a||ga[0],s)}return o}function CB(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let i=0;i<r.length;i++)o.indexOf(r[i])==-1&&t.classList.remove(r[i]);for(let i=0;i<o.length;i++)r.indexOf(o[i])==-1&&t.classList.add(o[i]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=r.exec(e.style);)t.style.removeProperty(o[1])}n.style&&(t.style.cssText+=n.style)}}function ZR(t,e,n){return YR(t,t,ga,B0(e,n,t.nodeType!=1))}function U0(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function hE(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class TB{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=OB(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let o=0,i=this.stack.length>>1,s=Math.min(i,e.length);for(;o<s&&(o==i-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&e[o].type.spec.spanning!==!1;)o++;for(;o<i;)this.destroyRest(),this.top.dirty=Nr,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let c=this.top.children[l];if(c.matchesMark(e[i])&&!this.isLocked(c.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=Va.create(this.top,e[i],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}}findNodeMatch(e,n,r,o){let i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))i=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let c=this.top.children[a];if(c.matchesNode(e,n,r)&&!this.preMatch.matched.has(c)){i=a;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,n,r,o,i){let s=this.top.children[o];return s.dirty==zo&&s.dom==s.contentDOM&&(s.dirty=ma),s.update(e,n,r,i)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==r)return o}return-1}e=n}}updateNextNode(e,n,r,o,i,s){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof ks){let c=this.preMatch.matched.get(l);if(c!=null&&c!=i)return!1;let u=l.dom,d,f=this.isLocked(u)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=zo&&U0(n,l.outerDeco));if(!f&&l.update(e,n,r,o))return this.destroyBetween(this.index,a),l.dom!=u&&(this.changed=!0),this.index++,!0;if(!f&&(d=this.recreateWrapper(l,e,n,r,o,s)))return this.top.children[this.index]=d,d.contentDOM&&(d.dirty=ma,d.updateChildren(o,s+1),d.dirty=Nr),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,o,i,s){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content))return null;let a=ks.create(this.top,n,r,o,i,s);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,n,r,o,i){let s=ks.create(this.top,e,n,r,o,i);s.contentDOM&&s.updateChildren(o,i+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,r){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(e)&&(e==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else{let i=new KR(this.top,e,n,r);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof Va;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Cg)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Fn||Cn)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let o=new qR(this.top,[],r,null);n!=this.top?n.children.push(o):n.children.splice(this.index++,0,o),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function OB(t,e){let n=e,r=n.children.length,o=t.childCount,i=new Map,s=[];e:for(;o>0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof Va)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}function MB(t,e){return t.type.side-e.type.side}function RB(t,e,n,r){let o=e.locals(t),i=0;if(o.length==0){for(let c=0;c<t.childCount;c++){let u=t.child(c);r(u,o,e.forChild(i,u),c),i+=u.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){let u,d;for(;s<o.length&&o[s].to==i;){let y=o[s++];y.widget&&(u?(d||(d=[u])).push(y):u=y)}if(u)if(d){d.sort(MB);for(let y=0;y<d.length;y++)n(d[y],c,!!l)}else n(u,c,!!l);let f,p;if(l)p=-1,f=l,l=null;else if(c<t.childCount)p=c,f=t.child(c++);else break;for(let y=0;y<a.length;y++)a[y].to<=i&&a.splice(y--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)a.push(o[s++]);let m=i+f.nodeSize;if(f.isText){let y=m;s<o.length&&o[s].from<y&&(y=o[s].from);for(let v=0;v<a.length;v++)a[v].to<y&&(y=a[v].to);y<m&&(l=f.cut(y-i),f=f.cut(0,y-i),m=y,p=-1)}else for(;s<o.length&&o[s].to<m;)s++;let g=f.isInline&&!f.isLeaf?a.filter(y=>!y.inline):a.slice();r(f,g,e.forChild(i,f),p),i=m}}function NB(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function PB(t,e){for(;;){if(t.nodeType==3)return t;if(t.nodeType==1&&e>0){if(t.childNodes.length>e&&t.childNodes[e].nodeType==3)return t.childNodes[e];t=t.childNodes[e-1],e=To(t)}else if(t.nodeType==1&&e<t.childNodes.length)t=t.childNodes[e],e=0;else return null}}function $B(t,e,n,r){for(let o=0,i=0;o<t.childCount&&i<=r;){let s=t.child(o++),a=i;if(i+=s.nodeSize,!s.isText)continue;let l=s.text;for(;o<t.childCount;){let c=t.child(o++);if(i+=c.nodeSize,!c.isText)break;l+=c.text}if(i>=n){if(i>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let c=a<r?l.lastIndexOf(e,r-a-1):-1;if(c>=0&&c+e.length+a>=n)return a+c;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function V0(t,e,n,r,o){let i=[];for(let s=0,a=0;s<t.length;s++){let l=t[s],c=a,u=a+=l.size;c>=n||u<=e?i.push(l):(c<e&&i.push(l.slice(0,e-c,r)),o&&(i.push(o),o=void 0),u>n&&i.push(l.slice(n-c,l.size,r)))}return i}function ab(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),i=o&&o.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,c;if(_g(n)){for(l=a;o&&!o.node;)o=o.parent;let u=o.node;if(o&&u.isAtom&&ye.isSelectable(u)&&o.parent&&!(u.isInline&&rB(n.focusNode,n.focusOffset,o.dom))){let d=o.posBefore;c=new ye(s==d?a:r.resolve(d))}}else{let u=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(u<0)return null;l=r.resolve(u)}if(!c){let u=e=="pointer"||t.state.selection.head<a.pos&&!i?1:-1;c=lb(t,l,a,u)}return c}function JR(t){return t.editable?t.hasFocus():QR(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function ui(t,e=!1){let n=t.state.selection;if(XR(t,n),!!JR(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Cn){let r=t.domSelectionRange(),o=t.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&Ua(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)IB(t);else{let{anchor:r,head:o}=n,i,s;mE&&!(n instanceof Ce)&&(n.$from.parent.inlineContent||(i=gE(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=gE(t,n.to))),t.docView.setSelection(r,o,t.root,e),mE&&(i&&vE(i),s&&vE(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&AB(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const mE=Fn||Cn&&sB<63;function gE(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(Fn&&o&&o.contentEditable=="false")return Kv(o);if((!o||o.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(o)return Kv(o);if(i)return Kv(i)}}function Kv(t){return t.contentEditable="true",Fn&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function vE(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function AB(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=o)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!JR(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function IB(t){let e=t.domSelection(),n=document.createRange(),r=t.cursorWrapper.dom,o=r.nodeName=="IMG";o?n.setEnd(r.parentNode,An(r)+1):n.setEnd(r,0),n.collapse(!1),e.removeAllRanges(),e.addRange(n),!o&&!t.state.selection.visible&&er&&ws<=11&&(r.disabled=!0,r.disabled=!1)}function XR(t,e){if(e instanceof ye){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(yE(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else yE(t)}function yE(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function lb(t,e,n,r){return t.someProp("createSelectionBetween",o=>o(t,e,n))||Ce.between(e,n,r)}function xE(t){return t.editable&&!t.hasFocus()?!1:QR(t)}function QR(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function DB(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Ua(e.node,e.offset,n.anchorNode,n.anchorOffset)}function H0(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return i&&je.findFrom(i,e)}function Ji(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function bE(t,e,n){let r=t.state.selection;if(r instanceof Ce)if(n.indexOf("s")>-1){let{$head:o}=r,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=t.state.doc.resolve(o.pos+i.nodeSize*(e<0?-1:1));return Ji(t,new Ce(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let o=H0(t.state,e);return o&&o instanceof ye?Ji(t,o):!1}else if(!(_r&&n.indexOf("m")>-1)){let o=r.$head,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter,s;if(!i||i.isText)return!1;let a=e<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?ye.isSelectable(i)?Ji(t,new ye(e<0?t.state.doc.resolve(o.pos-i.nodeSize):o)):$f?Ji(t,new Ce(t.state.doc.resolve(e<0?a:a+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof ye&&r.node.isInline)return Ji(t,new Ce(e>0?r.$to:r.$from));{let o=H0(t.state,e);return o?Ji(t,o):!1}}}function im(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function ad(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function gl(t,e){return e<0?LB(t):jB(t)}function LB(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=!1;for(go&&n.nodeType==1&&r<im(n)&&ad(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(ad(a,-1))o=n,i=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(eN(n))break;{let a=n.previousSibling;for(;a&&ad(a,-1);)o=n.parentNode,i=An(a),a=a.previousSibling;if(a)n=a,r=im(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?W0(t,n,r):o&&W0(t,o,i)}function jB(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o=im(n),i,s;for(;;)if(r<o){if(n.nodeType!=1)break;let a=n.childNodes[r];if(ad(a,1))i=n,s=++r;else break}else{if(eN(n))break;{let a=n.nextSibling;for(;a&&ad(a,1);)i=a.parentNode,s=An(a)+1,a=a.nextSibling;if(a)n=a,r=0,o=im(n);else{if(n=n.parentNode,n==t.dom)break;r=o=0}}}i&&W0(t,i,s)}function eN(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function zB(t,e){for(;t&&e==t.childNodes.length&&!ib(t);)e=An(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function FB(t,e){for(;t&&!e&&!ib(t);)e=An(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function W0(t,e,n){if(e.nodeType!=3){let i,s;(s=zB(e,n))?(e=s,n=0):(i=FB(e,n))&&(e=i,n=i.nodeValue.length)}let r=t.domSelection();if(_g(r)){let i=document.createRange();i.setEnd(e,n),i.setStart(e,n),r.removeAllRanges(),r.addRange(i)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:o}=t;setTimeout(()=>{t.state==o&&ui(t)},50)}function wE(t,e){let n=t.state.doc.resolve(e);if(!(Cn||aB)&&n.parent.inlineContent){let o=t.coordsAtPos(e);if(e>n.start()){let i=t.coordsAtPos(e-1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left<o.left?"ltr":"rtl"}if(e<n.end()){let i=t.coordsAtPos(e+1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function kE(t,e,n){let r=t.state.selection;if(r instanceof Ce&&!r.empty||n.indexOf("s")>-1||_r&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=H0(t.state,e);if(s&&s instanceof ye)return Ji(t,s)}if(!o.parent.inlineContent){let s=e<0?o:i,a=r instanceof jn?je.near(s,e):je.findFrom(s,e);return a?Ji(t,a):!1}return!1}function SE(t,e){if(!(t.state.selection instanceof Ce))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let s=t.state.tr;return e<0?s.delete(n.pos-i.nodeSize,n.pos):s.delete(n.pos,n.pos+i.nodeSize),t.dispatch(s),!0}return!1}function EE(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function BB(t){if(!Fn||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;EE(t,r,"true"),setTimeout(()=>EE(t,r,"false"),20)}return!1}function UB(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function VB(t,e){let n=e.keyCode,r=UB(e);if(n==8||_r&&n==72&&r=="c")return SE(t,-1)||gl(t,-1);if(n==46&&!e.shiftKey||_r&&n==68&&r=="c")return SE(t,1)||gl(t,1);if(n==13||n==27)return!0;if(n==37||_r&&n==66&&r=="c"){let o=n==37?wE(t,t.state.selection.from)=="ltr"?-1:1:-1;return bE(t,o,r)||gl(t,o)}else if(n==39||_r&&n==70&&r=="c"){let o=n==39?wE(t,t.state.selection.from)=="ltr"?1:-1:1;return bE(t,o,r)||gl(t,o)}else{if(n==38||_r&&n==80&&r=="c")return kE(t,-1,r)||gl(t,-1);if(n==40||_r&&n==78&&r=="c")return BB(t)||kE(t,1,r)||gl(t,1);if(r==(_r?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function tN(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:r,openStart:o,openEnd:i}=e;for(;o>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,i--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=t.someProp("clipboardSerializer")||ro.fromSchema(t.state.schema),a=aN(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=sN[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let m=a.createElement(u[p]);for(;l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${i}${d?` -${d}`:""} ${JSON.stringify(n)}`);let f=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,`
200
-
201
- `);return{dom:l,text:f}}function nN(t,e,n,r,o){let i=o.parent.type.spec.code,s,a;if(!n&&!e)return null;let l=e&&(r||i||!n);if(l){if(t.someProp("transformPastedText",f=>{e=f(e,i||r,t)}),i)return e?new J(F.from(t.state.schema.text(e.replace(/\r\n?/g,`
202
- `))),0,0):J.empty;let d=t.someProp("clipboardTextParser",f=>f(e,o,r,t));if(d)a=d;else{let f=o.marks(),{schema:p}=t.state,m=ro.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let y=s.appendChild(document.createElement("p"));g&&y.appendChild(m.serializeNode(p.text(g,f)))})}}else t.someProp("transformPastedHTML",d=>{n=d(n,t)}),s=KB(n),$f&&qB(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||wc.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:o,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!HB.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)a=GB(_E(a,+u[1],+u[2]),u[4]);else if(a=J.maxOpen(WB(a.content,o),!0),a.openStart||a.openEnd){let d=0,f=0;for(let p=a.content.firstChild;d<a.openStart&&!p.type.spec.isolating;d++,p=p.firstChild);for(let p=a.content.lastChild;f<a.openEnd&&!p.type.spec.isolating;f++,p=p.lastChild);a=_E(a,d,f)}return t.someProp("transformPasted",d=>{a=d(a,t)}),a}const HB=/^(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 WB(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let o=e.node(n).contentMatchAt(e.index(n)),i,s=[];if(t.forEach(a=>{if(!s)return;let l=o.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&i.length&&oN(l,i,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=iN(s[s.length-1],i.length));let u=rN(a,l);s.push(u),o=o.matchType(u.type),i=l}}),s)return F.from(s)}return t}function rN(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,F.from(t));return t}function oN(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let i=oN(t,e,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(F.from(rN(n,t,o+1))))}}function iN(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,iN(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(F.empty,!0);return t.copy(n.append(r))}function K0(t,e,n,r,o,i){let s=e<0?t.firstChild:t.lastChild,a=s.content;return t.childCount>1&&(i=0),o<r-1&&(a=K0(a,e,n,r,o+1,i)),o>=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(F.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function _E(t,e,n){return e<t.openStart&&(t=new J(K0(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new J(K0(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const sN={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 CE=null;function aN(){return CE||(CE=document.implementation.createHTMLDocument("title"))}function KB(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=aN().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),o;if((o=r&&sN[r[1].toLowerCase()])&&(t=o.map(i=>"<"+i+">").join("")+t+o.map(i=>"</"+i+">").reverse().join("")),n.innerHTML=t,o)for(let i=0;i<o.length;i++)n=n.querySelector(o[i])||n;return n}function qB(t){let e=t.querySelectorAll(Cn?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function GB(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:o,openStart:i,openEnd:s}=t;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;o=F.from(l.create(r[a+1],o)),i++,s++}return new J(o,i,s)}const Bn={},Un={},YB={touchstart:!0,touchmove:!0};class ZB{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function JB(t){for(let e in Bn){let n=Bn[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{QB(t,r)&&!cb(t,r)&&(t.editable||!(r.type in Un))&&n(t,r)},YB[e]?{passive:!0}:void 0)}Fn&&t.dom.addEventListener("input",()=>null),q0(t)}function ls(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function XB(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function q0(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>cb(t,r))})}function cb(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function QB(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function eU(t,e){!cb(t,e)&&Bn[e.type]&&(t.editable||!(e.type in Un))&&Bn[e.type](t,e)}Un.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!cN(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Xr&&Cn&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Ec&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",o=>o(t,sa(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||VB(t,n)?n.preventDefault():ls(t,"key")};Un.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};Un.keypress=(t,e)=>{let n=e;if(cN(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||_r&&n.metaKey)return;if(t.someProp("handleKeyPress",o=>o(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Ce)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode);!/[\r\n]/.test(o)&&!t.someProp("handleTextInput",i=>i(t,r.$from.pos,r.$to.pos,o))&&t.dispatch(t.state.tr.insertText(o).scrollIntoView()),n.preventDefault()}};function Tg(t){return{left:t.clientX,top:t.clientY}}function tU(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function ub(t,e,n,r,o){if(r==-1)return!1;let i=t.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(t.someProp(e,a=>s>i.depth?a(t,n,i.nodeAfter,i.before(s),o,!0):a(t,n,i.node(s),i.before(s),o,!1)))return!0;return!1}function rc(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);n=="pointer"&&r.setMeta("pointer",!0),t.dispatch(r)}function nU(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&ye.isSelectable(r)?(rc(t,new ye(n),"pointer"),!0):!1}function rU(t,e){if(e==-1)return!1;let n=t.state.selection,r,o;n instanceof ye&&(r=n.node);let i=t.state.doc.resolve(e);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s);if(ye.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?o=i.before(n.$from.depth):o=i.before(s);break}}return o!=null?(rc(t,ye.create(t.state.doc,o),"pointer"),!0):!1}function oU(t,e,n,r,o){return ub(t,"handleClickOn",e,n,r)||t.someProp("handleClick",i=>i(t,e,r))||(o?rU(t,n):nU(t,n))}function iU(t,e,n,r){return ub(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",o=>o(t,e,r))}function sU(t,e,n,r){return ub(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",o=>o(t,e,r))||aU(t,n,r)}function aU(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(rc(t,Ce.create(r,0,r.content.size),"pointer"),!0):!1;let o=r.resolve(e);for(let i=o.depth+1;i>0;i--){let s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)rc(t,Ce.create(r,a+1,a+1+s.content.size),"pointer");else if(ye.isSelectable(s))rc(t,ye.create(r,a),"pointer");else continue;return!0}}function db(t){return sm(t)}const lN=_r?"metaKey":"ctrlKey";Bn.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=db(t),o=Date.now(),i="singleClick";o-t.input.lastClick.time<500&&tU(n,t.input.lastClick)&&!n[lN]&&(t.input.lastClick.type=="singleClick"?i="doubleClick":t.input.lastClick.type=="doubleClick"&&(i="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=t.posAtCoords(Tg(n));s&&(i=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new lU(t,s,n,!!r)):(i=="doubleClick"?iU:sU)(t,s.pos,s.inside,n)?n.preventDefault():ls(t,"pointer"))};class lU{constructor(e,n,r,o){this.view=e,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[lN],this.allowDefault=r.shiftKey;let i,s;if(n.inside>-1)i=e.state.doc.nodeAt(n.inside),s=n.inside;else{let u=e.state.doc.resolve(n.pos);i=u.parent,s=u.depth?u.before():0}const a=o?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l?l.dom:null;let{selection:c}=e.state;(r.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof ye&&c.from<=s&&c.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&go&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),ls(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>ui(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Tg(e))),this.updateAllowDefault(e),this.allowDefault||!n?ls(this.view,"pointer"):oU(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Fn&&this.mightDrag&&!this.mightDrag.node.isAtom||Cn&&!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)?(rc(this.view,je.near(this.view.state.doc.resolve(n.pos)),"pointer"),e.preventDefault()):ls(this.view,"pointer")}move(e){this.updateAllowDefault(e),ls(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Bn.touchstart=t=>{t.input.lastTouch=Date.now(),db(t),ls(t,"pointer")};Bn.touchmove=t=>{t.input.lastTouch=Date.now(),ls(t,"pointer")};Bn.contextmenu=t=>db(t);function cN(t,e){return t.composing?!0:Fn&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const cU=Xr?5e3:-1;Un.compositionstart=Un.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),sm(t,!0),t.markCursor=null;else if(sm(t),go&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let o=r.focusNode,i=r.focusOffset;o&&o.nodeType==1&&i!=0;){let s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){t.domSelection().collapse(s,s.nodeValue.length);break}else o=s,i=-1}}t.input.composing=!0}uN(t,cU)};Un.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,uN(t,20))};function uN(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>sm(t),e))}function dN(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=uU());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function uU(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function sm(t,e=!1){if(!(Xr&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),dN(t),e||t.docView&&t.docView.dirty){let n=ab(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}}function dU(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const Jd=er&&ws<15||Ec&&lB<604;Bn.copy=Un.cut=(t,e)=>{let n=e,r=t.state.selection,o=n.type=="cut";if(r.empty)return;let i=Jd?null:n.clipboardData,s=r.content(),{dom:a,text:l}=tN(t,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):dU(t,a),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function fU(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function pU(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Xd(t,r.value,null,o,e):Xd(t,r.textContent,r.innerHTML,o,e)},50)}function Xd(t,e,n,r,o){let i=nN(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,o,i||J.empty)))return!0;if(!i)return!1;let s=fU(i),a=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(i);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function fN(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Un.paste=(t,e)=>{let n=e;if(t.composing&&!Xr)return;let r=Jd?null:n.clipboardData,o=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Xd(t,fN(r),r.getData("text/html"),o,n)?n.preventDefault():pU(t,n)};class pN{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const hN=_r?"altKey":"ctrlKey";Bn.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,i=o.empty?null:t.posAtCoords(Tg(n)),s;if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof ye?o.to-1:o.to))){if(r&&r.mightDrag)s=ye.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let u=t.docView.nearestDesc(n.target,!0);u&&u.node.type.spec.draggable&&u!=t.docView&&(s=ye.create(t.state.doc,u.posBefore))}}let a=(s||t.state.selection).content(),{dom:l,text:c}=tN(t,a);n.dataTransfer.clearData(),n.dataTransfer.setData(Jd?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Jd||n.dataTransfer.setData("text/plain",c),t.dragging=new pN(a,!n[hN],s)};Bn.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};Un.dragover=Un.dragenter=(t,e)=>e.preventDefault();Un.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let o=t.posAtCoords(Tg(n));if(!o)return;let i=t.state.doc.resolve(o.pos),s=r&&r.slice;s?t.someProp("transformPasted",m=>{s=m(s,t)}):s=nN(t,fN(n.dataTransfer),Jd?null:n.dataTransfer.getData("text/html"),!1,i);let a=!!(r&&!n[hN]);if(t.someProp("handleDrop",m=>m(t,n,s||J.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?OR(t.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let c=t.state.tr;if(a){let{node:m}=r;m?m.replace(c):c.deleteSelection()}let u=c.mapping.map(l),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(f))return;let p=c.doc.resolve(u);if(d&&ye.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new ye(p));else{let m=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((g,y,v,x)=>m=x),c.setSelection(lb(t,p,c.doc.resolve(m)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))};Bn.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&ui(t)},20))};Bn.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};Bn.beforeinput=(t,e)=>{if(Cn&&Xr&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",i=>i(t,sa(8,"Backspace")))))return;let{$cursor:o}=t.state.selection;o&&o.pos>0&&t.dispatch(t.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let t in Un)Bn[t]=Un[t];function Qd(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class am{constructor(e,n){this.toDOM=e,this.spec=n||_a,this.side=this.spec.side||0}map(e,n,r,o){let{pos:i,deleted:s}=e.mapResult(n.from+o,this.side<0?-1:1);return s?null:new kt(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof am&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Qd(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Ss{constructor(e,n){this.attrs=e,this.spec=n||_a}map(e,n,r,o){let i=e.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return i>=s?null:new kt(i,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Ss&&Qd(this.attrs,e.attrs)&&Qd(this.spec,e.spec)}static is(e){return e.type instanceof Ss}destroy(){}}class fb{constructor(e,n){this.attrs=e,this.spec=n||_a}map(e,n,r,o){let i=e.mapResult(n.from+o,1);if(i.deleted)return null;let s=e.mapResult(n.to+o,-1);return s.deleted||s.pos<=i.pos?null:new kt(i.pos-r,s.pos-r,this)}valid(e,n){let{index:r,offset:o}=e.content.findIndex(n.from),i;return o==n.from&&!(i=e.child(r)).isText&&o+i.nodeSize==n.to}eq(e){return this==e||e instanceof fb&&Qd(this.attrs,e.attrs)&&Qd(this.spec,e.spec)}destroy(){}}class kt{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new kt(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new kt(e,e,new am(n,r))}static inline(e,n,r,o){return new kt(e,n,new Ss(r,o))}static node(e,n,r,o){return new kt(e,n,new fb(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof Ss}get widget(){return this.type instanceof am}}const Sl=[],_a={};class Qe{constructor(e,n){this.local=e.length?e:Sl,this.children=n.length?n:Sl}static create(e,n){return n.length?lm(n,e,0,_a):En}find(e,n,r){let o=[];return this.findInner(e??0,n??1e9,o,0,r),o}findInner(e,n,r,o,i){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=n&&a.to>=e&&(!i||i(a.spec))&&r.push(a.copy(a.from+o,a.to+o))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>e){let a=this.children[s]+1;this.children[s+2].findInner(e-a,n-a,r,o+a,i)}}map(e,n,r){return this==En||e.maps.length==0?this:this.mapInner(e,n,0,0,r||_a)}mapInner(e,n,r,o,i){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,o);l&&l.type.valid(n,l)?(s||(s=[])).push(l):i.onRemove&&i.onRemove(this.local[a].spec)}return this.children.length?hU(this.children,s||[],e,n,r,o,i):s?new Qe(s.sort(Ca),Sl):En}add(e,n){return n.length?this==En?Qe.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let o,i=0;e.forEach((a,l)=>{let c=l+r,u;if(u=gN(n,a,c)){for(o||(o=this.children.slice());i<o.length&&o[i]<l;)i+=3;o[i]==l?o[i+2]=o[i+2].addInner(a,u,c+1):o.splice(i,0,l,l+a.nodeSize,lm(u,a,c+1,_a)),i+=3}});let s=mN(i?vN(n):n,-r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new Qe(s.length?this.local.concat(s).sort(Ca):this.local,o||this.children)}remove(e){return e.length==0||this==En?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,o=this.local;for(let i=0;i<r.length;i+=3){let s,a=r[i]+n,l=r[i+1]+n;for(let u=0,d;u<e.length;u++)(d=e[u])&&d.from>a&&d.to<l&&(e[u]=null,(s||(s=[])).push(d));if(!s)continue;r==this.children&&(r=this.children.slice());let c=r[i+2].removeInner(s,a+1);c!=En?r[i+2]=c:(r.splice(i,3),i-=3)}if(o.length){for(let i=0,s;i<e.length;i++)if(s=e[i])for(let a=0;a<o.length;a++)o[a].eq(s,n)&&(o==this.local&&(o=this.local.slice()),o.splice(a--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new Qe(o,r):En}forChild(e,n){if(this==En)return this;if(n.isLeaf)return Qe.empty;let r,o;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let i=e+1,s=i+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<s&&l.to>i&&l.type instanceof Ss){let c=Math.max(i,l.from)-i,u=Math.min(s,l.to)-i;c<u&&(o||(o=[])).push(l.copy(c,u))}}if(o){let a=new Qe(o.sort(Ca),Sl);return r?new ns([a,r]):a}return r||En}eq(e){if(this==e)return!0;if(!(e instanceof Qe)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return pb(this.localsInner(e))}localsInner(e){if(this==En)return Sl;if(e.inlineContent||!this.local.some(Ss.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Ss||n.push(this.local[r]);return n}}Qe.empty=new Qe([],[]);Qe.removeOverlap=pb;const En=Qe.empty;class ns{constructor(e){this.members=e}map(e,n){const r=this.members.map(o=>o.map(e,n,_a));return ns.from(r)}forChild(e,n){if(n.isLeaf)return Qe.empty;let r=[];for(let o=0;o<this.members.length;o++){let i=this.members[o].forChild(e,n);i!=En&&(i instanceof ns?r=r.concat(i.members):r.push(i))}return ns.from(r)}eq(e){if(!(e instanceof ns)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let o=0;o<this.members.length;o++){let i=this.members[o].localsInner(e);if(i.length)if(!n)n=i;else{r&&(n=n.slice(),r=!1);for(let s=0;s<i.length;s++)n.push(i[s])}}return n?pb(r?n:n.sort(Ca)):Sl}static from(e){switch(e.length){case 0:return En;case 1:return e[0];default:return new ns(e.every(n=>n instanceof Qe)?e:e.reduce((n,r)=>n.concat(r instanceof Qe?r:r.members),[]))}}}function hU(t,e,n,r,o,i,s){let a=t.slice();for(let c=0,u=i;c<n.maps.length;c++){let d=0;n.maps[c].forEach((f,p,m,g)=>{let y=g-m-(p-f);for(let v=0;v<a.length;v+=3){let x=a[v+1];if(x<0||f>x+u-d)continue;let w=a[v]+u-d;p>=w?a[v+1]=f<=w?-2:-1:f>=u&&y&&(a[v]+=y,a[v+1]+=y)}d+=y}),u=n.maps[c].map(u,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let u=n.map(t[c]+i),d=u-o;if(d<0||d>=r.content.size){l=!0;continue}let f=n.map(t[c+1]+i,-1),p=f-o,{index:m,offset:g}=r.content.findIndex(d),y=r.maybeChild(m);if(y&&g==d&&g+y.nodeSize==p){let v=a[c+2].mapInner(n,y,u+1,t[c]+i+1,s);v!=En?(a[c]=d,a[c+1]=p,a[c+2]=v):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=mU(a,t,e,n,o,i,s),u=lm(c,r,0,s);e=u.local;for(let d=0;d<a.length;d+=3)a[d+1]<0&&(a.splice(d,3),d-=3);for(let d=0,f=0;d<u.children.length;d+=3){let p=u.children[d];for(;f<a.length&&a[f]<p;)f+=3;a.splice(f,0,u.children[d],u.children[d+1],u.children[d+2])}}return new Qe(e.sort(Ca),a)}function mN(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let o=t[r];n.push(new kt(o.from+e,o.to+e,o.type))}return n}function mU(t,e,n,r,o,i,s){function a(l,c){for(let u=0;u<l.local.length;u++){let d=l.local[u].map(r,o,c);d?n.push(d):s.onRemove&&s.onRemove(l.local[u].spec)}for(let u=0;u<l.children.length;u+=3)a(l.children[u+2],l.children[u]+c+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+i+1);return n}function gN(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let i=0,s;i<t.length;i++)(s=t[i])&&s.from>n&&s.to<r&&((o||(o=[])).push(s),t[i]=null);return o}function vN(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function lm(t,e,n,r){let o=[],i=!1;e.forEach((a,l)=>{let c=gN(t,a,l+n);if(c){i=!0;let u=lm(c,a,n+l+1,r);u!=En&&o.push(l,l+a.nodeSize,u)}});let s=mN(i?vN(t):t,-n).sort(Ca);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||o.length?new Qe(s,o):En}function Ca(t,e){return t.from-e.from||t.to-e.to}function pb(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let o=n+1;o<e.length;o++){let i=e[o];if(i.from==r.from){i.to!=r.to&&(e==t&&(e=t.slice()),e[o]=i.copy(i.from,r.to),TE(e,o+1,i.copy(r.to,i.to)));continue}else{i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),TE(e,o,r.copy(i.from,r.to)));break}}}return e}function TE(t,e,n){for(;e<t.length&&Ca(n,t[e])>0;)e++;t.splice(e,0,n)}function qv(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=En&&e.push(r)}),t.cursorWrapper&&e.push(Qe.create(t.state.doc,[t.cursorWrapper.deco])),ns.from(e)}const gU={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},vU=er&&ws<=11;class yU{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class xU{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new yU,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;o<r.length;o++)this.queue.push(r[o]);er&&ws<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),vU&&(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,gU)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(xE(this.view)){if(this.suppressingSelectionUpdates)return ui(this.view);if(er&&ws<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Ua(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let i=e.focusNode;i;i=Zd(i))n.add(i);for(let i=e.anchorNode;i;i=Zd(i))if(n.has(i)){r=i;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&xE(e)&&!this.ignoreSelectionChange(r),i=-1,s=-1,a=!1,l=[];if(e.editable)for(let u=0;u<n.length;u++){let d=this.registerMutation(n[u],l);d&&(i=i<0?d.from:Math.min(d.from,i),s=s<0?d.to:Math.max(d.to,s),d.typeOver&&(a=!0))}if(go&&l.length>1){let u=l.filter(d=>d.nodeName=="BR");if(u.length==2){let d=u[0],f=u[1];d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}}let c=null;i<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&_g(r)&&(c=ab(e))&&c.eq(je.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,ui(e),this.currentSelection.set(r),e.scrollToSelection()):(i>-1||o)&&(i>-1&&(e.docView.markDirty(i,s),bU(e)),this.handleDOMChange(i,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||ui(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++)n.push(e.addedNodes[u]);if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let o=e.previousSibling,i=e.nextSibling;if(er&&ws<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:d,nextSibling:f}=e.addedNodes[u];(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(o=d),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f)}let s=o&&o.parentNode==e.target?An(o)+1:0,a=r.localPosFromDOM(e.target,s,-1),l=i&&i.parentNode==e.target?An(i):e.target.childNodes.length,c=r.localPosFromDOM(e.target,l,1);return{from:a,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}let OE=new WeakMap,ME=!1;function bU(t){if(!OE.has(t)&&(OE.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=go,ME)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."),ME=!0}}function wU(t){let e;function n(l){l.preventDefault(),l.stopImmediatePropagation(),e=l.getTargetRanges()[0]}t.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",n,!0);let r=e.startContainer,o=e.startOffset,i=e.endContainer,s=e.endOffset,a=t.domAtPos(t.state.selection.anchor);return Ua(a.node,a.offset,i,s)&&([r,o,i,s]=[i,s,r,o]),{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}}function kU(t,e,n){let{node:r,fromOffset:o,toOffset:i,from:s,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),c,u=l.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:l.anchorOffset}],_g(l)||c.push({node:l.focusNode,offset:l.focusOffset})),Cn&&t.input.lastKeyCode===8)for(let y=i;y>o;y--){let v=r.childNodes[y-1],x=v.pmViewDesc;if(v.nodeName=="BR"&&!x){i=y;break}if(!x||x.size)break}let d=t.state.doc,f=t.someProp("domParser")||wc.fromSchema(t.state.schema),p=d.resolve(s),m=null,g=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:o,to:i,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:SU,context:p});if(c&&c[0].pos!=null){let y=c[0].pos,v=c[1]&&c[1].pos;v==null&&(v=y),m={anchor:y+s,head:v+s}}return{doc:g,sel:m,from:s,to:a}}function SU(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Fn&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||Fn&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const EU=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function _U(t,e,n,r,o){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let T=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,A=ab(t,T);if(A&&!t.state.selection.eq(A)){if(Cn&&Xr&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",D=>D(t,sa(13,"Enter"))))return;let B=t.state.tr.setSelection(A);T=="pointer"?B.setMeta("pointer",!0):T=="key"&&B.scrollIntoView(),i&&B.setMeta("composition",i),t.dispatch(B)}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(n);e=s.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,c=kU(t,e,n),u=t.state.doc,d=u.slice(c.from,c.to),f,p;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(f=t.state.selection.to,p="end"):(f=t.state.selection.from,p="start"),t.input.lastKeyCode=null;let m=OU(d.content,c.doc.content,c.from,f,p);if((Ec&&t.input.lastIOSEnter>Date.now()-225||Xr)&&o.some(T=>T.nodeType==1&&!EU.test(T.nodeName))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",T=>T(t,sa(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!m)if(r&&l instanceof Ce&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))m={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let T=RE(t,t.state.doc,c.sel);if(T&&!T.eq(t.state.selection)){let A=t.state.tr.setSelection(T);i&&A.setMeta("composition",i),t.dispatch(A)}}return}if(Cn&&t.cursorWrapper&&c.sel&&c.sel.anchor==t.cursorWrapper.deco.from&&c.sel.head==c.sel.anchor){let T=m.endB-m.start;c.sel={anchor:c.sel.anchor+T,head:c.sel.anchor+T}}t.input.domChangeCount++,t.state.selection.from<t.state.selection.to&&m.start==m.endB&&t.state.selection instanceof Ce&&(m.start>t.state.selection.from&&m.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?m.start=t.state.selection.from:m.endA<t.state.selection.to&&m.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(m.endB+=t.state.selection.to-m.endA,m.endA=t.state.selection.to)),er&&ws<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>c.from&&c.doc.textBetween(m.start-c.from-1,m.start-c.from+1)=="  "&&(m.start--,m.endA--,m.endB--);let g=c.doc.resolveNoCache(m.start-c.from),y=c.doc.resolveNoCache(m.endB-c.from),v=u.resolve(m.start),x=g.sameParent(y)&&g.parent.inlineContent&&v.end()>=m.endA,w;if((Ec&&t.input.lastIOSEnter>Date.now()-225&&(!x||o.some(T=>T.nodeName=="DIV"||T.nodeName=="P"))||!x&&g.pos<c.doc.content.size&&!g.sameParent(y)&&(w=je.findFrom(c.doc.resolve(g.pos+1),1,!0))&&w.head==y.pos)&&t.someProp("handleKeyDown",T=>T(t,sa(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&TU(u,m.start,m.endA,g,y)&&t.someProp("handleKeyDown",T=>T(t,sa(8,"Backspace")))){Xr&&Cn&&t.domObserver.suppressSelectionUpdates();return}Cn&&Xr&&m.endB==m.start&&(t.input.lastAndroidDelete=Date.now()),Xr&&!x&&g.start()!=y.start()&&y.parentOffset==0&&g.depth==y.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==m.endA&&(m.endB-=2,y=c.doc.resolveNoCache(m.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(T){return T(t,sa(13,"Enter"))})},20));let S=m.start,_=m.endA,k,E,C;if(x){if(g.pos==y.pos)er&&ws<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>ui(t),20)),k=t.state.tr.delete(S,_),E=u.resolve(m.start).marksAcross(u.resolve(m.endA));else if(m.endA==m.endB&&(C=CU(g.parent.content.cut(g.parentOffset,y.parentOffset),v.parent.content.cut(v.parentOffset,m.endA-v.start()))))k=t.state.tr,C.type=="add"?k.addMark(S,_,C.mark):k.removeMark(S,_,C.mark);else if(g.parent.child(g.index()).isText&&g.index()==y.index()-(y.textOffset?0:1)){let T=g.parent.textBetween(g.parentOffset,y.parentOffset);if(t.someProp("handleTextInput",A=>A(t,S,_,T)))return;k=t.state.tr.insertText(T,S,_)}}if(k||(k=t.state.tr.replace(S,_,c.doc.slice(m.start-c.from,m.endB-c.from))),c.sel){let T=RE(t,k.doc,c.sel);T&&!(Cn&&Xr&&t.composing&&T.empty&&(m.start!=m.endB||t.input.lastAndroidDelete<Date.now()-100)&&(T.head==S||T.head==k.mapping.map(_)-1)||er&&T.empty&&T.head==S)&&k.setSelection(T)}E&&k.ensureMarks(E),i&&k.setMeta("composition",i),t.dispatch(k.scrollIntoView())}function RE(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:lb(t,e.resolve(n.anchor),e.resolve(n.head))}function CU(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,o=n,i=r,s,a,l;for(let u=0;u<r.length;u++)o=r[u].removeFromSet(o);for(let u=0;u<n.length;u++)i=n[u].removeFromSet(i);if(o.length==1&&i.length==0)a=o[0],s="add",l=u=>u.mark(a.addToSet(u.marks));else if(o.length==0&&i.length==1)a=i[0],s="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<e.childCount;u++)c.push(l(e.child(u)));if(F.from(c).eq(t))return{mark:a,type:s}}function TU(t,e,n,r,o){if(!r.parent.isTextblock||n-e<=o.pos-r.pos||Gv(r,!0,!1)<o.pos)return!1;let i=t.resolve(e);if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=t.resolve(Gv(i,!0,!0));return!s.parent.isTextblock||s.pos>n||Gv(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function Gv(t,e,n){let r=t.depth,o=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n){let i=t.node(r).maybeChild(t.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function OU(t,e,n,r,o){let i=t.findDiffStart(e,n);if(i==null)return null;let{a:s,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(o=="end"){let l=Math.max(0,i-Math.min(s,a));r-=s+l-i}if(s<i&&t.size<e.size){let l=r<=i&&r>=s?i-r:0;i-=l,i&&i<e.size&&NE(e.textBetween(i-1,i+1))&&(i+=l?1:-1),a=i+(a-s),s=i}else if(a<i){let l=r<=i&&r>=a?i-r:0;i-=l,i&&i<t.size&&NE(t.textBetween(i-1,i+1))&&(i+=l?1:-1),s=i+(s-a),a=i}return{start:i,endA:s,endB:a}}function NE(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class MU{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new ZB,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(DE),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=AE(this),$E(this),this.nodeViews=IE(this),this.docView=pE(this.state.doc,PE(this),qv(this),this.dom,this),this.domObserver=new xU(this,(r,o,i,s)=>_U(this,r,o,i,s)),this.domObserver.start(),JB(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&q0(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(DE),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let o=this.state,i=!1,s=!1;e.storedMarks&&this.composing&&(dN(this),s=!0),this.state=e;let a=o.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=IE(this);NU(p,this.nodeViews)&&(this.nodeViews=p,i=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&q0(this),this.editable=AE(this),$E(this);let l=qv(this),c=PE(this),u=o.plugins!=e.plugins&&!o.doc.eq(e.doc)?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",d=i||!this.docView.matchesNode(e.doc,c,l);(d||!e.selection.eq(o.selection))&&(s=!0);let f=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&dB(this);if(s){this.domObserver.stop();let p=d&&(er||Cn)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&RU(o.selection,e.selection);if(d){let m=Cn?this.trackWrites=this.domSelectionRange().focusNode:null;(i||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=pE(e.doc,c,l,this.dom,this)),m&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&DB(this))?ui(this,p):(XR(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),!((r=this.dragging)===null||r===void 0)&&r.node&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():f&&fB(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof ye){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&aE(this,n.getBoundingClientRect(),e)}else aE(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,o=-1;if(this.state.doc.nodeAt(r.from)==r.node)o=r.from;else{let i=r.from+(this.state.doc.content.size-n.doc.content.size);(i>0&&this.state.doc.nodeAt(i))==r.node&&(o=i)}this.dragging=new pN(e.slice,e.move,o<0?void 0:ye.create(this.state.doc,o))}someProp(e,n){let r=this._props&&this._props[e],o;if(r!=null&&(o=n?n(r):r))return o;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[e];if(a!=null&&(o=n?n(a):a))return o}let i=this.state.plugins;if(i)for(let s=0;s<i.length;s++){let a=i[s].props[e];if(a!=null&&(o=n?n(a):a))return o}}hasFocus(){if(er){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&pB(this.dom),ui(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return yB(this,e)}coordsAtPos(e,n=1){return HR(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let o=this.docView.posFromDOM(e,n,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(e,n){return SB(this,n||this.state,e)}pasteHTML(e,n){return Xd(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Xd(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(XB(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],qv(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return eU(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return Fn&&this.root.nodeType===11&&oB(this.dom.ownerDocument)==this.dom?wU(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function PE(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[kt.node(0,t.state.doc.content.size,e)]}function $E(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:kt.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function AE(t){return!t.someProp("editable",e=>e(t.state)===!1)}function RU(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function IE(t){let e=Object.create(null);function n(r){for(let o in r)Object.prototype.hasOwnProperty.call(e,o)||(e[o]=r[o])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function NU(t,e){let n=0,r=0;for(let o in t){if(t[o]!=e[o])return!0;n++}for(let o in e)r++;return n!=r}function DE(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var PU=t=>{if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")};const $U=ki(PU);var yN=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},Pe=(t,e,n)=>(yN(t,e,"read from private field"),n?n.call(t):e.get(t)),Ko=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},pt=(t,e,n,r)=>(yN(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);function AU(t){return!!(t.prev&&t.next&&t.prev.text.full!==t.next.text.full)}function IU(t){return!!(t.prev&&t.next&&t.prev.range.cursor!==t.next.range.cursor)}function DU(t){return!!(!t.prev&&t.next)}function LU(t){return!!(t.prev&&!t.next)}function jU(t){return!!(t.prev&&t.next&&t.prev.range.from!==t.next.range.from)}function zU(t){return t==="invalid-exit-split"}var FU=["jump-backward-exit","jump-forward-exit"],BU=["jump-backward-change","jump-forward-change"];function UU(t){var e,n;return mo(FU,(e=t.exit)==null?void 0:e.exitReason)||mo(BU,(n=t.change)==null?void 0:n.changeReason)}function LE(t){return!!(t&&t.query.full.length>=t.suggester.matchOffset)}function jE(t){return Mn(t)&&t instanceof Ce}function Zn(t){const{match:e,changeReason:n,exitReason:r}=t;return{...e,changeReason:n,exitReason:r}}function VU(t,e){const{invalidPrefixCharacters:n,validPrefixCharacters:r}=e;return n?!new RegExp(Y0(n)).test(t):new RegExp(Y0(r)).test(t)}function HU(t){const{text:e,regexp:n,$pos:r,suggester:o}=t,i=r.start();let s;return Sg(e,n).forEach(a=>{const l=a.input.slice(Math.max(0,a.index-1),a.index);if(VU(l,o)){const c=a.index+i,u=a[0],d=a[1];if(!Se(u)||!Se(d))return;const f=c+u.length,p=Math.min(f,r.pos),m=p-c;c<r.pos&&f>=r.pos&&(s={range:{from:c,to:f,cursor:p},match:a,query:{partial:u.slice(d.length,m),full:u.slice(d.length)},text:{partial:u.slice(0,m),full:u},textAfter:r.doc.textBetween(f,r.end(),ss,ss),textBefore:r.doc.textBetween(i,c,ss,ss),suggester:o})}}),s}function xN(t){const{$pos:e,suggester:n}=t,{char:r,name:o,startOfLine:i,supportedCharacters:s,matchOffset:a,multiline:l,caseInsensitive:c,unicode:u}=n,d=QU({char:r,matchOffset:a,startOfLine:i,supportedCharacters:s,multiline:l,caseInsensitive:c,unicode:u}),f=e.doc.textBetween(e.before(),e.end(),ss,ss);return HU({suggester:n,text:f,regexp:d,$pos:e,char:r,name:o})}function bN(t){const{state:e,match:n}=t;try{return xN({$pos:e.doc.resolve(n.range.cursor),suggester:n.suggester})}catch{return}}function wN(t){const{prev:e,next:n,state:r}=t;return!n&&e.range.from>=r.doc.nodeSize?{exit:Zn({match:e,exitReason:"delete"})}:!n||!e.query.partial?{exit:Zn({match:e,exitReason:"invalid-exit-split"})}:e.range.to===n.range.cursor?{exit:Zn({match:n,exitReason:"exit-end"})}:e.query.partial?{exit:Zn({match:n,exitReason:"exit-split"})}:{}}function WU(t){const{prev:e,next:n,state:r}=t,o=pe(),i=bN({state:r,match:e}),{exit:s}=i&&i.query.full!==e.query.full?wN({prev:e,next:i,state:r}):o;return e.range.from<n.range.from?{exit:s??Zn({match:e,exitReason:"jump-forward-exit"}),change:Zn({match:n,changeReason:"jump-forward-change"})}:{exit:s??Zn({match:e,exitReason:"jump-backward-exit"}),change:Zn({match:n,changeReason:"jump-backward-change"})}}function KU(t){const{match:e,state:n,$pos:r}=t,{selection:o}=n,i=bN({match:e,state:n});return!i||i.text.full!==e.text.full?wN({prev:e,next:i,state:n}):!o.empty&&(o.from<=e.range.from||o.to>=e.range.to)?{exit:Zn({match:e,exitReason:"selection-outside"})}:r.pos>e.range.to?{exit:Zn({match:e,exitReason:"move-end"})}:r.pos<=e.range.from?{exit:Zn({match:e,exitReason:"move-start"})}:{}}function qU(t){const{prev:e,next:n,state:r,$pos:o}=t,i=pe();if(!e&&!n)return i;const s={prev:e,next:n};return jU(s)?WU({prev:s.prev,next:s.next,state:r}):DU(s)?{change:Zn({match:s.next,changeReason:"start"})}:LU(s)?KU({$pos:o,match:s.prev,state:r}):AU(s)?{change:Zn({match:s.next,changeReason:"change-character"})}:IU(s)?{change:Zn({match:s.next,changeReason:r.selection.empty?"move":"selection-inside"})}:i}function zE(t,e){for(let n=t.depth;n>0;n--){const r=t.node(n);if(e.includes(r.type.name))return!0}return!1}function G0(t,e){const{$from:n,$to:r}=t;return kN(t,e)?!0:nR(n.pos,r.pos).some(o=>GU(n.doc.resolve(o),e))}function kN(t,e){const{$from:n,$to:r}=t,o=new Set((n.marksAcross(r)??[]).map(i=>i.type.name));return e.some(i=>o.has(i))}function GU(t,e){const n=new Set(t.marks().map(r=>r.type.name));return e.some(r=>n.has(r))}function YU(t,e){const{$cursor:n}=e,{validMarks:r,validNodes:o,invalidMarks:i,invalidNodes:s}=t;return!r&&!o&&As(i)&&As(s)?!0:!(r&&!kN(e,r)||o&&!zE(n,o)||!r&&G0(e,i)||!o&&zE(n,s))}function FE(t){const{suggesters:e,$pos:n,selectionEmpty:r}=t;for(const o of e)if(!(o.emptySelectionsOnly&&!r))try{const i=xN({suggester:o,$pos:n});if(!i)continue;const s={$from:n.doc.resolve(i.range.from),$to:n.doc.resolve(i.range.to),$cursor:n};if(YU(o,s)&&o.isValidPosition(s,i))return i}catch{}}function Y0(t){return gz(t)?t.source:t}function ZU(t){return t?"^":""}function JU(t,e){return`(?:${Y0(t)}){${e},}`}function XU(t){return Se(t)?new RegExp($U(t)):t}function QU(t){const{char:e,matchOffset:n,startOfLine:r,supportedCharacters:o,captureChar:i=!0,caseInsensitive:s=!1,multiline:a=!1,unicode:l=!1}=t,c=`g${a?"m":""}${s?"i":""}${l?"u":""}`;let u=XU(e).source;return i&&(u=`(${u})`),new RegExp(`${ZU(r)}${u}${JU(o,n)}`,c)}var eV={appendTransaction:!1,priority:50,ignoredTag:"span",matchOffset:0,disableDecorations:!1,startOfLine:!1,suggestClassName:"suggest",suggestTag:"span",supportedCharacters:/\w+/,validPrefixCharacters:/^[\s\0]?$/,invalidPrefixCharacters:null,ignoredClassName:null,invalidMarks:[],invalidNodes:[],validMarks:null,validNodes:null,isValidPosition:()=>!0,checkNextValidSelection:null,emptySelectionsOnly:!1,caseInsensitive:!1,multiline:!1,unicode:!1,captureChar:!0},SN="__ignore_prosemirror_suggest_update__",Bp,Eu,Xt,Vi,El,ko,Vt,Hi,_l,EN=class{constructor(t){Ko(this,Bp,!1),Ko(this,Eu,!1),Ko(this,Xt,void 0),Ko(this,Vi,void 0),Ko(this,El,void 0),Ko(this,ko,pe()),Ko(this,Vt,Qe.empty),Ko(this,Hi,!1),Ko(this,_l,!1),this.setMarkRemoved=()=>{pt(this,Hi,!0)},this.findNextTextSelection=n=>{const r=n.$from.doc,o=Math.min(r.nodeSize-2,n.to+1),i=r.resolve(o),s=je.findFrom(i,1,!0);if(jE(s))return s},this.ignoreNextExit=()=>{pt(this,Eu,!0)},this.addIgnored=({from:n,name:r,specific:o=!1})=>{const i=Pe(this,Xt).find(u=>u.name===r);if(!i)throw new Error(`No suggester exists for the name provided: ${r}`);const s=Se(i.char)?i.char.length:1,a=n+s,l=i.ignoredClassName?{class:i.ignoredClassName}:{},c=kt.inline(n,a,{nodeName:i.ignoredTag,...l},{name:r,specific:o,char:i.char});pt(this,Vt,Pe(this,Vt).add(this.view.state.doc,[c]))},this.removeIgnored=({from:n,name:r})=>{const o=Pe(this,Xt).find(a=>a.name===r);if(!o)throw new Error(`No suggester exists for the name provided: ${r}`);const i=Se(o.char)?o.char.length:1,s=Pe(this,Vt).find(n,n+i)[0];!s||s.spec.name!==r||pt(this,Vt,Pe(this,Vt).remove([s]))},this.clearIgnored=n=>{if(!n){pt(this,Vt,Qe.empty);return}const o=Pe(this,Vt).find().filter(({spec:i})=>i.name===n);pt(this,Vt,Pe(this,Vt).remove(o))},this.findMatchAtPosition=(n,r)=>{const o=r?Pe(this,Xt).filter(i=>i.name===r):Pe(this,Xt);return FE({suggesters:o,$pos:n,docChanged:!1,selectionEmpty:!0})},this.setLastChangeFromAppend=()=>{pt(this,_l,!0)};const e=BE();pt(this,Xt,t.map(e)),pt(this,Xt,za(Pe(this,Xt),(n,r)=>r.priority-n.priority))}static create(t){return new EN(t)}get decorationSet(){return Pe(this,Vt)}get removed(){return Pe(this,Hi)}get match(){return Pe(this,Vi)?Pe(this,Vi):Pe(this,El)&&Pe(this,ko).exit?Pe(this,El):void 0}init(t){return this.view=t,this}createProps(t){const{name:e,char:n}=t.suggester;return{view:this.view,addIgnored:this.addIgnored,clearIgnored:this.clearIgnored,ignoreNextExit:this.ignoreNextExit,setMarkRemoved:this.setMarkRemoved,name:e,char:n,...t}}shouldRunExit(){return Pe(this,Eu)?(pt(this,Eu,!1),!1):!0}updateWithNextSelection(t){var e,n,r;const o=this.findNextTextSelection(t.selection);if(o)for(const i of Pe(this,Xt)){const s=(e=Pe(this,ko).change)==null?void 0:e.suggester.name,a=(n=Pe(this,ko).exit)==null?void 0:n.suggester.name;(r=i.checkNextValidSelection)==null||r.call(i,o.$from,t,{change:s,exit:a})}}changeHandler(t,e){const{change:n,exit:r}=Pe(this,ko),o=this.match;if(!n&&!r||!LE(o))return;const i=e===(r==null?void 0:r.suggester.appendTransaction)&&this.shouldRunExit(),s=e===(n==null?void 0:n.suggester.appendTransaction);if(!(!i&&!s)){if(n&&r&&UU({change:n,exit:r})){const a=this.createProps(r),l=this.createProps(n),c=r.range.from<n.range.from;i&&r.suggester.onChange(a,t),s&&n.suggester.onChange(l,t),i&&pt(this,Hi,!1);return}n&&s&&n.suggester.onChange(this.createProps(n),t),r&&i&&(r.suggester.onChange(this.createProps(r),t),pt(this,Hi,!1),zU(r.exitReason)&&pt(this,ko,pe()))}}mapIgnoredDecorations(t){const e=Pe(this,Vt).map(t.mapping,t.doc),r=e.find().filter(({from:o,to:i,spec:s})=>{const a=Se(s.char)?s.char.length:1;return i-o!==a});pt(this,Vt,e.remove(r))}shouldIgnoreMatch({range:t,suggester:{name:e}}){return Pe(this,Vt).find().some(({spec:o,from:i})=>i!==t.from?!1:o.specific?o.name===e:!0)}resetState(){pt(this,ko,pe()),pt(this,Vi,void 0),pt(this,Hi,!1),pt(this,_l,!1)}updateReasons(t){const{$pos:e,state:n}=t,r=Pe(this,Bp),o=Pe(this,Xt),i=n.selection.empty,s=jE(n.selection)?FE({suggesters:o,$pos:e,docChanged:r,selectionEmpty:i}):void 0;pt(this,Vi,s&&this.shouldIgnoreMatch(s)?void 0:s),pt(this,ko,qU({next:Pe(this,Vi),prev:Pe(this,El),state:n,$pos:e}))}addSuggester(t){const e=Pe(this,Xt).find(r=>r.name===t.name),n=BE();if(e)pt(this,Xt,Pe(this,Xt).map(r=>r===e?n(t):r));else{const r=[...Pe(this,Xt),n(t)];pt(this,Xt,za(r,(o,i)=>i.priority-o.priority))}return()=>this.removeSuggester(t.name)}removeSuggester(t){const e=Se(t)?t:t.name;pt(this,Xt,Pe(this,Xt).filter(n=>n.name!==e)),this.clearIgnored(e)}toJSON(){return this.match}apply(t){const{exit:e,change:n}=Pe(this,ko);if(Pe(this,_l)&&(pt(this,_l,!1),!(e!=null&&e.suggester.appendTransaction)&&!(n!=null&&n.suggester.appendTransaction)))return this;const{tr:r,state:o}=t,i=r.docChanged||r.selectionSet;return r.getMeta(SN)||!i&&!Pe(this,Hi)?this:(pt(this,Bp,r.docChanged),this.mapIgnoredDecorations(r),e&&this.resetState(),pt(this,El,Pe(this,Vi)),this.updateReasons({$pos:r.selection.$from,state:o}),this)}createDecorations(t){const e=this.match;if(!LE(e))return Pe(this,Vt);const{disableDecorations:n}=e.suggester;if(dt(n)?n(t,e):n)return Pe(this,Vt);const{range:o,suggester:i}=e,{name:s,suggestTag:a,suggestClassName:l}=i,{from:c,to:u}=o;return this.shouldIgnoreMatch(e)?Pe(this,Vt):Pe(this,Vt).add(t.doc,[kt.inline(c,u,{nodeName:a,class:s?`${l} suggest-${s}`:l},{name:s})])}},tV=EN;Bp=new WeakMap;Eu=new WeakMap;Xt=new WeakMap;Vi=new WeakMap;El=new WeakMap;ko=new WeakMap;Vt=new WeakMap;Hi=new WeakMap;_l=new WeakMap;function BE(){const t=new Set;return e=>{if(t.has(e.name))throw new Error(`A suggester already exists with the name '${e.name}'. The name provided must be unique.`);const n={...eV,...e};return t.add(e.name),n}}var _N=new Uc("suggest");function hb(t){return _N.getState(t)}function UE(t,e){return hb(t).addSuggester(e)}function VE(t){t.setMeta(SN,!0)}function nV(t,e){return hb(t).removeSuggester(e)}function rV(...t){const e=tV.create(t);return new Ti({key:_N,view:n=>(e.init(n),{update:r=>e.changeHandler(r.state.tr,!1)}),state:{init:()=>e,apply:(n,r,o,i)=>e.apply({tr:n,state:i})},appendTransaction:(n,r,o)=>{const i=o.tr;return e.updateWithNextSelection(i),e.changeHandler(i,!0),i.docChanged||i.steps.length>0||i.selectionSet||i.storedMarksSet?(e.setLastChangeFromAppend(),i):null},props:{decorations:n=>e.createDecorations(n)}})}function mb(t,e){const n=Object.getPrototypeOf(e);let r=t.selection,o=t.doc,i=t.storedMarks;const s=pe();for(const[a,l]of Object.entries(e))s[a]={value:l};return Object.create(n,{...s,storedMarks:{get(){return i}},selection:{get(){return r}},doc:{get(){return o}},tr:{get(){return r=t.selection,o=t.doc,i=t.storedMarks,t}}})}function ld(t){return({state:e,dispatch:n,view:r,tr:o})=>t(mb(o,e),n,r)}function HE(t){return e=>{var n;return ve(e.dispatch===void 0||e.dispatch===((n=e.view)==null?void 0:n.dispatch),{code:K.NON_CHAINABLE_COMMAND}),t(e)}}function oV(...t){return({state:e,dispatch:n,view:r,tr:o,...i})=>{for(const s of t)if(s({state:e,dispatch:n,view:r,tr:o,...i}))return!0;return!1}}var Qr={get isBrowser(){return!!(typeof window<"u"&&typeof window.document<"u"&&window.navigator&&window.navigator.userAgent)},get isJSDOM(){return Qr.isBrowser&&window.navigator.userAgent.includes("jsdom")},get isNode(){return typeof process<"u"&&process.versions!=null&&process.versions.node!=null},get isIos(){return Qr.isBrowser&&/iPod|iPhone|iPad/.test(navigator.platform)},get isMac(){return Qr.isBrowser&&/Mac|iPod|iPhone|iPad/.test(navigator.platform)},get isApple(){return Qr.isNode?process.platform==="darwin":Qr.isBrowser?/Mac|iPod|iPhone|iPad/.test(window.navigator.platform):!1},get isDevelopment(){return!1},get isTest(){return!1},get isProduction(){return!0}};function Li(t,e){var n;const r=RV(t);return((n=r==null?void 0:r.getComputedStyle(t))==null?void 0:n.getPropertyValue(e))??""}function Sn(t,e){return Object.assign(t.style,e)}function Z0(t){return Mn(t)&&mr(t.nodeType)&&Se(t.nodeName)}function Fo(t){return Z0(t)&&t.nodeType===1}function gb(t){const{types:e,node:n}=t;if(!n)return!1;const r=o=>o===n.type||o===n.type.name;return Gt(e)?e.some(r):r(e)}function iV(t,e){const{tr:n}=e;return t.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}function Og(t){const{predicate:e,selection:n}=t,r=TN(n)?n.selection.$from:xb(n)?n.$from:n;for(let o=r.depth;o>0;o--){const i=r.node(o),s=o>0?r.before(o):0,a=r.start(o),l=s+i.nodeSize;if(e(i,s))return{pos:s,depth:o,node:i,start:a,end:l}}}function sV(t){const{depth:e}=t,n=e>0?t.before(e):0,r=t.node(e),o=t.start(e),i=n+r.nodeSize;return{pos:n,start:o,node:r,end:i,depth:e}}function ef(t){const{types:e,selection:n}=t;return Og({predicate:r=>gb({types:e,node:r}),selection:n})}function aV(t){const{types:e,selection:n}=t;if(!(!Rg(n)||!gb({types:e,node:n.node})))return{pos:n.$from.pos,depth:n.$from.depth,start:n.$from.start(),end:n.$from.pos+n.node.nodeSize,node:n.node}}function vb(t){return xb(t)?t.empty:t.selection.empty}function lV(t){return t.docChanged||t.selectionSet}function cV(t){return!!tf(t)}function tf(t){const{state:e,type:n,attrs:r}=t,{selection:o,doc:i}=e,s=Se(n)?i.type.schema.nodes[n]:n;ve(s,{code:K.SCHEMA,message:`No node exists for ${n}`});const a=aV({selection:o,types:n})??Og({predicate:l=>l.type===s,selection:o});return!r||Gh(r)||!a||a.node.hasMarkup(s,{...a.node.attrs,...r})?a:void 0}function cm(...t){return e=>{if(!LS(t))return!1;const[n,...r]=t;let o=!1;const i=(...l)=>()=>{if(!LS(l))return!1;o=!0;const[,...c]=l;return cm(...l)({...e,next:i(...c)})},s=i(...r),a=n({...e,next:s});return o||a?a:s()}}function uV(t,e){const n=new Map,r=pe();for(const o of t)for(const[i,s]of qt(o)){const l=[...n.get(i)??[],s],c=cm(...l);n.set(i,l),r[i]=e(c)}return r}function dV(t){return uV(t,e=>(n,r,o)=>e({state:n,dispatch:r,view:o,tr:n.tr,next:()=>!1}))}function yb(t,e){const n=t.attrs??{};return Object.entries(e).every(([r,o])=>n[r]===o)}function fV(t){return MN(t,[ii,zt,nn,oo])}function Vc(t){return Mn(t)}function Hc(t,e){return Gt(e)?mo(e,t[bi]):e===t[bi]}function pV(t){return Mn(t)&&t instanceof I0}function hV(t,e){return Se(t)?Tt(e.nodes,t):t}function CN(t){return Mn(t)&&t instanceof Nf}function mV(t,e){return Se(t)?Tt(e.marks,t):t}function Mg(t){return Mn(t)&&t instanceof bs}function gV(t){return Mn(t)&&t instanceof F}function vV(t){return Mn(t)&&t instanceof qe}function TN(t){return Mn(t)&&t instanceof ha}function tl(t){return Mn(t)&&t instanceof Ce}function yV(t){return Mn(t)&&t instanceof jn}function xb(t){return Mn(t)&&t instanceof je}function xV(t){return Mn(t)&&t instanceof bc}function WE(t){const{trState:e,from:n,to:r,type:o,attrs:i={}}=t,{doc:s}=e,a=mV(o,s.type.schema);if(Object.keys(i).length===0)return s.rangeHasMark(n,r,a);let l=!1;return r>n&&s.nodesBetween(n,r,c=>l?!1:(l=(c.marks??[]).some(d=>d.type!==a?!1:yb(d,i)),!l)),l}function Rg(t){return Mn(t)&&t instanceof ye}function um(t){const{trState:e,type:n,attrs:r={},from:o,to:i}=t,{selection:s,doc:a,storedMarks:l}=e,c=Se(n)?a.type.schema.marks[n]:n;if(ve(c,{code:K.SCHEMA,message:`Mark type: ${n} does not exist on the current schema.`}),o&&i)try{return Math.max(o,i)<a.nodeSize&&WE({...t,from:o,to:i})}catch{return!1}return s.empty?(l??s.$from.marks()).some(d=>d.type!==n?!1:yb(d,r??{})):WE({...t,from:s.from,to:s.to})}function bb(t,e={}){const n=bV(t.type.schema);if(!n)return!1;const{ignoreAttributes:r,ignoreDocAttributes:o}=e;return r?ON(n,t):o?n.content.eq(t.content):n.eq(t)}function ON(t,e){if(t===e)return!0;const n=t.type===e.type&&qe.sameSet(t.marks,e.marks);function r(){if(t.content===e.content)return!0;if(t.content.size!==e.content.size)return!1;const o=[],i=[];t.content.forEach(s=>o.push(s)),e.content.forEach(s=>i.push(s));for(const[s,a]of o.entries()){const l=i[s];if(!l||!ON(a,l))return!1}return!0}return n&&r()}function bV(t){var e;return((e=t.nodes.doc)==null?void 0:e.createAndFill())??void 0}function Ng(t){for(const e of Object.values(t.nodes))if(e.name!=="doc"&&(e.isBlock||e.isTextblock))return e;ve(!1,{code:K.SCHEMA,message:"No default block node found for the provided schema."})}function wV(t){return t.type===Ng(t.type.schema)}function wb(t){return!!t&&t.type.isBlock&&!t.textContent&&!t.childCount}function wi(t,e,n){const r=t.parent.childAfter(t.parentOffset);if(!r.node)return;const o=Se(e)?e:e.name,i=r.node.marks.find(({type:d})=>d.name===o);let s=t.index(),a=t.start()+r.offset,l=s+1,c=a+r.node.nodeSize;if(!i)return n&&c<n.pos?wi(t.doc.resolve(c+1),e,n):void 0;for(;s>0&&i.isInSet(t.parent.child(s-1).marks);)s-=1,a-=t.parent.child(s).nodeSize;for(;l<t.parent.childCount&&i.isInSet(t.parent.child(l).marks);)c+=t.parent.child(l).nodeSize,l+=1;const u=t.doc.textBetween(a,c,WM,`
203
-
204
- `);return{from:a,to:c,text:u,mark:i}}function MN(t,e){return e.length===0||e.some(n=>t instanceof n)}function kV(t){return tR(t,({from:n,to:r,prevFrom:o,prevTo:i})=>`${n}_${r}_${o}_${i}`).filter((n,r,o)=>!o.some((i,s)=>r===s?!1:n.prevFrom>=i.prevFrom&&n.prevTo<=i.prevTo&&n.from>=i.from&&n.to<=i.to))}function SV(t,e=[]){const n=[],{steps:r,mapping:o}=t,i=o.invert();r.forEach((a,l)=>{if(!MN(a,e))return;const c=[],u=a.getMap(),d=o.slice(l);if(u.ranges.length===0&&fV(a)){const{from:f,to:p}=a;c.push({from:f,to:p})}else u.forEach((f,p)=>{c.push({from:f,to:p})});c.forEach(f=>{const p=d.map(f.from,-1),m=d.map(f.to);n.push({from:p,to:m,prevFrom:i.map(p,-1),prevTo:i.map(m)})})});const s=za(n,(a,l)=>a.from-l.from);return kV(s)}function EV(t){var e;return((e=t.content.firstChild)==null?void 0:e.textContent)??""}function _V(t,e){if(!tl(t.selection))return;let{from:n,to:r}=t.selection;const o=(s,a)=>EV(Ce.between(t.doc.resolve(s),t.doc.resolve(a)).content());for(let s=o(n-1,n);s&&!e.test(s);n--,s=o(n-1,n));for(let s=o(r,r+1);s&&!e.test(s);r++,s=o(r,r+1));if(n===r)return;const i=t.doc.textBetween(n,r,WM,`
205
-
206
- `);return{from:n,to:r,text:i}}function RN(t){return _V(t,/\W/)}function cd(t,e=0){const n=Gt(t)?t[e]:t;return JM(Se(n),`No match string found for match ${t}`),n??""}function CV(t){return tl(t)?t.$cursor:void 0}function TV(t,e){return Mg(t)?e?t.type===e.nodes.doc:t.type.name==="doc":!1}function OV(t){return Mn(t)&&mr(t.anchor)&&mr(t.head)}function Ir(t,e){const n=e.nodeSize-2,r=0;let o;const i=l=>kz({min:r,max:n,value:l});if(xb(t))return t;if(t==="all")return new jn(e);if(t==="start"?o=r:t==="end"?o=n:xV(t)?o=t.pos:o=t,mr(o))return o=i(o),Ce.near(e.resolve(o));if(OV(o)){const l=i(o.anchor),c=i(o.head);return Ce.between(e.resolve(l),e.resolve(c))}const s=i(o.from),a=i(o.to);return Ce.between(e.resolve(s),e.resolve(a))}var MV=3;function NN(t){const{content:e,schema:n,document:r,stringHandler:o,onError:i,attempts:s=0}=t,a=i&&s<=MV||s===0;if(ve(a,{code:K.INVALID_CONTENT,message:"The invalid content has been called recursively more than ${MAX_ATTEMPTS} times. The content is invalid and the error handler has not been able to recover properly."}),Se(e))return ve(o,{code:K.INVALID_CONTENT,message:`The string '${e}' was added to the editor, but no \`stringHandler\` was added. Please provide a valid string handler which transforms your content to a \`ProsemirrorNode\` to prevent this error.`}),o({document:r,content:e,schema:n});if(TN(e))return e.doc;if(Mg(e))return e;try{return n.nodeFromJSON(e)}catch(l){const c=DV({schema:n,error:l,json:e}),u=i==null?void 0:i(c);return ve(u,{code:K.INVALID_CONTENT,message:`An error occurred when processing the content. Please provide an \`onError\` handler to process the invalid content: ${JSON.stringify(c.invalidContent,null,2)}`}),NN({...t,content:u,attempts:s+1})}}function Pg(){const t=IR();if(t)return t;throw new Error(`Unable to retrieve the document from the global scope.
207
- It seems that you are running Remirror in a non-browser environment. Remirror need browser APIs to work.
208
- If you are using Jest (or other testing frameworks), make sure that you are using the JSDOM environment (https://jestjs.io/docs/29.0/configuration#testenvironment-string).
209
- If you are using Next.js (or other server-side rendering frameworks), please use dynamic import with \`ssr: false\` to load the editor component without rendering it on the server (https://nextjs.org/docs/advanced-features/dynamic-import#with-no-ssr).
210
- If you are using Node.js, you can install JSDOM and Remirror will try to use it automatically, or you can create a fake document and pass it to Remirror`)}function PN(t){var e;return(t==null?void 0:t.defaultView)??(typeof window<"u"?window:void 0)??((e=IR())==null?void 0:e.defaultView)}function RV(t){return PN(t==null?void 0:t.ownerDocument)}function NV(t){const e=PN(t)??Pg().defaultView;if(e)return e;throw new Error("Unable to retrieve the window from the global scope")}function PV(t,e=Pg()){const n=TV(t,t.type.schema)?t.content:F.from(t);return ro.fromSchema(t.type.schema).serializeFragment(n,{document:e})}function $V(t,e){return new(NV(e)).DOMParser().parseFromString(`<body>${t}</body>`,"text/html").body}function AV(t,e=Pg()){const n=e.createElement("div");return n.append(PV(t,e)),n.innerHTML}function J0(t){const{content:e,schema:n,document:r,fragment:o=!1,...i}=t,s=$V(e,r),a=wc.fromSchema(n);return o?a.parseSlice(s,{...KE,...i}).content:a.parse(s,{...KE,...i})}var KE={preserveWhitespace:!1};function $N(t,e){const n=qd(e.defaults());return J1({...t},n)}var IV={remove(t,e){let n=t;for(const r of e)r.invalidParentNode||(n=_z(r.path,n));return n}};function DV({json:t,schema:e,...n}){const r=new Set(qd(e.marks)),o=new Set(qd(e.nodes)),i=AN({json:t,path:[],validNodes:o,validMarks:r});return{json:t,invalidContent:i,transformers:IV,...n}}function AN(t){const{json:e,validMarks:n,validNodes:r,path:o=[]}=t,i={validMarks:n,validNodes:r},s=[],{type:a,marks:l,content:c}=e;let{invalidParentMark:u=!1,invalidParentNode:d=!1}=t;if(l){const f=[];for(const[p,m]of l.entries()){const g=Se(m)?m:m.type;n.has(g)||(f.unshift({name:g,path:[...o,"marks",`${p}`],type:"mark",invalidParentMark:u,invalidParentNode:d}),u=!0)}s.push(...f)}if(r.has(a)||(s.push({name:a,type:"node",path:o,invalidParentMark:u,invalidParentNode:d}),d=!0),c){const f=[];for(const[p,m]of c.entries())f.unshift(...AN({...i,json:m,path:[...o,"content",`${p}`],invalidParentMark:u,invalidParentNode:d}));s.unshift(...f)}return s}function LV(t){return!!(tl(t)&&t.$cursor&&t.$cursor.parentOffset>=t.$cursor.parent.content.size)}function X0(t){return!!(tl(t)&&t.$cursor&&t.$cursor.parentOffset<=0)}function qE(t){const e=je.atStart(t.$anchor.doc);return!!(X0(t)&&e.anchor===t.anchor)}function jV(t){return({dispatch:e,tr:n})=>{const{type:r,attrs:o=pe(),appendText:i,range:s}=t,a=s?Ce.between(n.doc.resolve(s.from),n.doc.resolve(s.to)):n.selection,{$from:l,from:c,to:u}=a;let d=l.depth===0?n.doc.type.allowsMarkType(r):!1;return n.doc.nodesBetween(c,u,f=>{if(d)return!1;if(f.inlineContent&&f.type.allowsMarkType(r)){d=!0;return}}),d?(e==null||e(n.addMark(c,u,r.create(o))&&i?n.insertText(i):n),!0):!1}}function zV({tr:t,dispatch:e}){const{$from:n,$to:r}=t.selection,o=n.blockRange(r),i=o&&Bc(o);return!mr(i)||!o?!1:(e==null||e(t.lift(o,i).scrollIntoView()),!0)}function IN(t,e={},n){return function(r){const{tr:o,dispatch:i,state:s}=r,a=Se(t)?Tt(s.schema.nodes,t):t,{from:l,to:c}=Ir(n??o.selection,o.doc),u=o.doc.resolve(l),d=o.doc.resolve(c),f=u.blockRange(d),p=f&&eb(f,a,e);return!p||!f?!1:(i==null||i(o.wrap(f,p).scrollIntoView()),!0)}}function FV(t,e={},n){return r=>{const{tr:o,state:i}=r,s=Se(t)?Tt(i.schema.nodes,t):t;return tf({state:o,type:s,attrs:e})?zV(r):IN(t,e,n)(r)}}function dm(t,e,n,r=!0){return function(o){const{tr:i,dispatch:s,state:a}=o,l=Se(t)?Tt(a.schema.nodes,t):t,{from:c,to:u}=Ir(n??i.selection,i.doc);let d=!1,f;return i.doc.nodesBetween(c,u,(p,m)=>{if(d)return!1;if(!p.isTextblock||p.hasMarkup(l,e))return;if(p.type===l){d=!0,f=p.attrs;return}const g=i.doc.resolve(m),y=g.index();d=g.parent.canReplaceWith(y,y+1,l),d&&(f=g.parent.attrs)}),d?(s==null||s(i.setBlockType(c,u,l,{...r?f:{},...e}).scrollIntoView()),!0):!1}}function DN(t){return e=>{const{tr:n,state:r}=e,{type:o,attrs:i,preserveAttrs:s=!0}=t,a=tf({state:n,type:o,attrs:i}),l=t.toggleType??Ng(r.schema);if(a)return dm(l,{...s?a.node.attrs:{},...i})(e);const c=tf({state:n,type:l,attrs:i});return dm(o,{...s?c==null?void 0:c.node.attrs:{},...i})(e)}}function BV(t=0){const e=navigator.userAgent.match(/Chrom(e|ium)\/(\d+)\./);return e?Number.parseInt(Tt(e,2),10)>=t:!1}function UV(t,e){let{head:n,empty:r,anchor:o}=t;for(const i of e.steps)n=i.getMap().map(n);r?e.setSelection(Ce.near(e.doc.resolve(n))):e.setSelection(Ce.between(e.doc.resolve(o),e.doc.resolve(n)))}function VV(t){const{attrs:e={},appendText:n="",content:r="",keepSelection:o=!1,range:i}=t;return({state:s,tr:a,dispatch:l})=>{var c;const u=s.schema,d=Ir(t.selection??i??a.selection,a.doc),f=d.$from.index(),{from:p,to:m,$from:g}=d,y=Se(t.type)?u.nodes[t.type]??u.marks[t.type]:t.type;if(ve(Se(t.type)?y:!0,{code:K.SCHEMA,message:`Schema contains no marks or nodes with name ${y}`}),pV(y)){if(!g.parent.canReplaceWith(f,f,y))return!1;a.replaceWith(p,m,y.create(e,r?u.text(r):void 0))}else ve(r,{message:"`replaceText` cannot be called without content when using a mark type"}),a.replaceWith(p,m,u.text(r,CN(y)?[y.create(e)]:void 0));return n&&a.insertText(n),o&&UV(s.selection,a),l&&(BV(60)&&((c=document.getSelection())==null||c.empty()),l(a)),!0}}function LN(t,e){const n=t.parent.childAfter(t.parentOffset);if(!n.node)return;const{marks:r,nodeSize:o}=n.node;if(r[0])return r[0].type;const s=t.start()+n.offset+o;return LN(t.doc.resolve(s+1))}function jN(t){return({dispatch:e,tr:n,state:r})=>{const{type:o,expand:i=!0,range:s}=t,a=Ir(t.selection??s??n.selection,n.doc);let{from:l,to:c,$from:u,$to:d}=a;const f=Se(o)?r.schema.marks[o]:o;f!==null&&ve(f,{code:K.SCHEMA,message:`Mark type: ${o} does not exist on the current schema.`});const p=f??LN(u);if(!p)return!1;const m=wi(u,p,d);return i&&m&&(l=Math.max(0,Math.min(l,m.from)),c=Math.min(Math.max(c,m.to),n.doc.nodeSize-2)),e==null||e(n.removeMark(l,mr(c)?c:l,CN(f)?f:void 0)),!0}}function fm(t){const{regexp:e,type:n,getAttributes:r,ignoreWhitespace:o=!1,beforeDispatch:i,updateCaptured:s,shouldSkip:a,invalidMarks:l}=t;let c;const u=new zr(e,(d,f,p,m)=>{const{tr:g,schema:y}=d;c||(c=Se(n)?y.marks[n]:n,ve(c,{code:K.SCHEMA,message:`Mark type: ${n} does not exist on the current schema.`}));let v=f[1],x=f[0];const w=HV({captureGroup:v,fullMatch:x,end:m,start:p,rule:u,state:d,ignoreWhitespace:o,invalidMarks:l,shouldSkip:a,updateCaptured:s});if(!w)return null;({start:p,end:m,captureGroup:v,fullMatch:x}=w);const S=dt(r)?r(f):r;let _=m,k=[];if(v){const E=x.search(/\S/),C=p+x.indexOf(v),T=C+v.length;k=g.storedMarks??[],T<m&&g.delete(T,m),C>p&&g.delete(p+E,C),_=p+E+v.length}return g.addMark(p,_,c.create(S)),g.setStoredMarks(k),i==null||i({tr:g,match:f,start:p,end:m}),g});return u}function HV({captureGroup:t,fullMatch:e,end:n,start:r,rule:o,ignoreWhitespace:i,shouldSkip:s,updateCaptured:a,state:l,invalidMarks:c}){var u;if(e==null)return null;const d=(a==null?void 0:a({captureGroup:t,fullMatch:e,start:r,end:n}))??{};t=d.captureGroup??t,e=d.fullMatch??e,r=d.start??r,n=d.end??n;const f=l.doc.resolve(r),p=l.doc.resolve(n);return c&&G0({$from:f,$to:p},c)||o.invalidMarks&&G0({$from:f,$to:p},o.invalidMarks)||i&&(t==null?void 0:t.trim())===""||s!=null&&s({state:l,captureGroup:t,fullMatch:e,start:r,end:n,ruleType:"mark"})||(u=o.shouldSkip)!=null&&u.call(o,{state:l,captureGroup:t,fullMatch:e,start:r,end:n,ruleType:"mark"})?null:{captureGroup:t,end:n,fullMatch:e,start:r}}var WV=function(){const e=Array.prototype.slice.call(arguments).filter(Boolean),n={},r=[];e.forEach(i=>{(i?i.split(" "):[]).forEach(a=>{if(a.startsWith("atm_")){const[,l]=a.split("_");n[l]=a}else r.push(a)})});const o=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&o.push(n[i]);return o.push(...r),o.join(" ")},KV=WV;const zN=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function qV(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const FN=(t,e,n)=>{let r=qV(t,n);if(!r)return!1;let o=BN(r);if(!o){let s=r.blockRange(),a=s&&Bc(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let i=o.nodeBefore;if(!i.type.spec.isolating&&HN(t,o,e))return!0;if(r.parent.content.size==0&&(_c(i,"end")||ye.isSelectable(i))){let s=tb(t.doc,r.before(),r.after(),J.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=t.tr.step(s);a.setSelection(_c(i,"end")?je.findFrom(a.doc.resolve(a.mapping.map(o.pos,-1)),-1):ye.create(a.doc,o.pos-i.nodeSize)),e(a.scrollIntoView())}return!0}}return i.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0):!1};function _c(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const GV=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=BN(r)}let s=i&&i.nodeBefore;return!s||!ye.isSelectable(s)?!1:(e&&e(t.tr.setSelection(ye.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function BN(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function YV(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const ZV=(t,e,n)=>{let r=YV(t,n);if(!r)return!1;let o=UN(r);if(!o)return!1;let i=o.nodeAfter;if(HN(t,o,e))return!0;if(r.parent.content.size==0&&(_c(i,"start")||ye.isSelectable(i))){let s=tb(t.doc,r.before(),r.after(),J.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=t.tr.step(s);a.setSelection(_c(i,"start")?je.findFrom(a.doc.resolve(a.mapping.map(o.pos)),1):ye.create(a.doc,a.mapping.map(o.pos))),e(a.scrollIntoView())}return!0}}return i.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0):!1},JV=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;i=UN(r)}let s=i&&i.nodeAfter;return!s||!ye.isSelectable(s)?!1:(e&&e(t.tr.setSelection(ye.create(t.doc,i.pos)).scrollIntoView()),!0)};function UN(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const XV=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
211
- `).scrollIntoView()),!0)};function kb(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const VN=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=kb(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(je.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},QV=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof jn||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=kb(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let s=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,a=t.tr.insert(s,i.createAndFill());a.setSelection(Ce.create(a.doc,s+1)),e(a.scrollIntoView())}return!0},eH=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(tc(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Bc(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)};function tH(t){return(e,n)=>{let{$from:r,$to:o}=e.selection;if(e.selection instanceof ye&&e.selection.node.isBlock)return!r.parentOffset||!tc(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.parent.isBlock)return!1;if(n){let i=o.parentOffset==o.parent.content.size,s=e.tr;(e.selection instanceof Ce||e.selection instanceof jn)&&s.deleteSelection();let a=r.depth==0?null:kb(r.node(-1).contentMatchAt(r.indexAfter(-1))),l=t&&t(o.parent,i),c=l?[l]:i&&a?[{type:a}]:void 0,u=tc(s.doc,s.mapping.map(r.pos),1,c);if(!c&&!u&&tc(s.doc,s.mapping.map(r.pos),1,a?[{type:a}]:void 0)&&(a&&(c=[{type:a}]),u=!0),u&&(s.split(s.mapping.map(r.pos),1,c),!i&&!r.parentOffset&&r.parent.type!=a)){let d=s.mapping.map(r.before()),f=s.doc.resolve(d);a&&r.node(-1).canReplaceWith(f.index(),f.index()+1,a)&&s.setNodeMarkup(s.mapping.map(r.before()),a)}n(s.scrollIntoView())}return!0}}const nH=tH(),rH=(t,e)=>{let{$from:n,to:r}=t.selection,o,i=n.sharedDepth(r);return i==0?!1:(o=n.before(i),e&&e(t.tr.setSelection(ye.create(t.doc,o))),!0)},oH=(t,e)=>(e&&e(t.tr.setSelection(new jn(t.doc))),!0);function iH(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(o.isTextblock||Pf(t.doc,e.pos))?!1:(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function HN(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,i,s;if(r.type.spec.isolating||o.type.spec.isolating)return!1;if(iH(t,e,n))return!0;let a=e.parent.canReplace(e.index(),e.index()+1);if(a&&(i=(s=r.contentMatchAt(r.childCount)).findWrapping(o.type))&&s.matchType(i[0]||o.type).validEnd){if(n){let d=e.pos+o.nodeSize,f=F.empty;for(let g=i.length-1;g>=0;g--)f=F.from(i[g].create(null,f));f=F.from(r.copy(f));let p=t.tr.step(new zt(e.pos-1,d,e.pos,d,new J(f,1,0),i.length,!0)),m=d+2*i.length;Pf(p.doc,m)&&p.join(m),n(p.scrollIntoView())}return!0}let l=je.findFrom(e,1),c=l&&l.$from.blockRange(l.$to),u=c&&Bc(c);if(u!=null&&u>=e.depth)return n&&n(t.tr.lift(c,u).scrollIntoView()),!0;if(a&&_c(o,"start",!0)&&_c(r,"end")){let d=r,f=[];for(;f.push(d),!d.isTextblock;)d=d.lastChild;let p=o,m=1;for(;!p.isTextblock;p=p.firstChild)m++;if(d.canReplace(d.childCount,d.childCount,p.content)){if(n){let g=F.empty;for(let v=f.length-1;v>=0;v--)g=F.from(f[v].copy(g));let y=t.tr.step(new zt(e.pos-f.length,e.pos+o.nodeSize,e.pos+m,e.pos+o.nodeSize-m,new J(g,f.length,0),0,!0));n(y.scrollIntoView())}return!0}}return!1}function WN(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(n&&n(e.tr.setSelection(Ce.create(e.doc,t<0?o.start(i):o.end(i)))),!0):!1}}const sH=WN(-1),aH=WN(1);function lH(t,e,n){for(let r=0;r<e.length;r++){let{$from:o,$to:i}=e[r],s=o.depth==0?t.inlineContent&&t.type.allowsMarkType(n):!1;if(t.nodesBetween(o.pos,i.pos,a=>{if(s)return!1;s=a.inlineContent&&a.type.allowsMarkType(n)}),s)return!0}return!1}function cH(t,e=null){return function(n,r){let{empty:o,$cursor:i,ranges:s}=n.selection;if(o&&!i||!lH(n.doc,s,t))return!1;if(r)if(i)t.isInSet(n.storedMarks||i.marks())?r(n.tr.removeStoredMark(t)):r(n.tr.addStoredMark(t.create(e)));else{let a=!1,l=n.tr;for(let c=0;!a&&c<s.length;c++){let{$from:u,$to:d}=s[c];a=n.doc.rangeHasMark(u.pos,d.pos,t)}for(let c=0;c<s.length;c++){let{$from:u,$to:d}=s[c];if(a)l.removeMark(u.pos,d.pos,t);else{let f=u.pos,p=d.pos,m=u.nodeAfter,g=d.nodeBefore,y=m&&m.isText?/^\s*/.exec(m.text)[0].length:0,v=g&&g.isText?/\s*$/.exec(g.text)[0].length:0;f+y<p&&(f+=y,p-=v),l.addMark(f,p,t.create(e))}}r(l.scrollIntoView())}return!0}}function $g(...t){return function(e,n,r){for(let o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}let Yv=$g(zN,FN,GV),GE=$g(zN,ZV,JV);const ni={Enter:$g(XV,QV,eH,nH),"Mod-Enter":VN,Backspace:Yv,"Mod-Backspace":Yv,"Shift-Backspace":Yv,Delete:GE,"Mod-Delete":GE,"Mod-a":oH},KN={"Ctrl-h":ni.Backspace,"Alt-Backspace":ni["Mod-Backspace"],"Ctrl-d":ni.Delete,"Ctrl-Alt-Backspace":ni["Mod-Delete"],"Alt-Delete":ni["Mod-Delete"],"Alt-d":ni["Mod-Delete"],"Ctrl-a":sH,"Ctrl-e":aH};for(let t in ni)KN[t]=ni[t];const uH=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform?os.platform()=="darwin":!1,Zv=uH?KN:ni;var Ds={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:"'"},pm={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},dH=typeof navigator<"u"&&/Mac/.test(navigator.platform),fH=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var hn=0;hn<10;hn++)Ds[48+hn]=Ds[96+hn]=String(hn);for(var hn=1;hn<=24;hn++)Ds[hn+111]="F"+hn;for(var hn=65;hn<=90;hn++)Ds[hn]=String.fromCharCode(hn+32),pm[hn]=String.fromCharCode(hn);for(var Jv in Ds)pm.hasOwnProperty(Jv)||(pm[Jv]=Ds[Jv]);function pH(t){var e=dH&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||fH&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?pm:Ds)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const hH=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function mH(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,o,i,s;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))i=!0;else if(/^mod$/i.test(l))hH?s=!0:o=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),o&&(n="Ctrl-"+n),s&&(n="Meta-"+n),i&&(n="Shift-"+n),n}function gH(t){let e=Object.create(null);for(let n in t)e[mH(n)]=t[n];return e}function Xv(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function qN(t){let e=gH(t);return function(n,r){let o=pH(r),i,s=e[Xv(o,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let a=e[Xv(o,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||o.charCodeAt(0)>127)&&(i=Ds[r.keyCode])&&i!=o){let a=e[Xv(i,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}function vH(t){const e=za(t,(i,s)=>(s.priority??at.Low)-(i.priority??at.Low)),n=[],r=[];for(const i of e)EH(i)?n.push(i):r.push(i);let o;return new Ti({key:yH,view:i=>(o=i,{}),props:{transformPasted:i=>{var s,a,l;const c=o.state.selection.$from,u=c.node().type.name,d=new Set(c.marks().map(f=>f.type.name));for(const f of n){if((s=f.ignoredNodes)!=null&&s.includes(u)||(a=f.ignoredMarks)!=null&&a.some(x=>d.has(x)))continue;const p=((l=i.content.firstChild)==null?void 0:l.textContent)??"",m=!o.state.selection.empty&&i.content.childCount===1&&p,g=Sg(p,f.regexp)[0];if(m&&g&&f.type==="mark"&&f.replaceSelection){const{from:x,to:w}=o.state.selection,S=o.state.doc.slice(x,w),_=S.content.textBetween(0,S.content.size);if(typeof f.replaceSelection!="boolean"?f.replaceSelection(_):f.replaceSelection){const k=[],{getAttributes:E,markType:C}=f,T=dt(E)?E(g,!0):E,A=C.create(T);return S.content.forEach(B=>{if(B.isText){const D=A.addToSet(B.marks);k.push(B.mark(D))}}),J.maxOpen(F.fromArray(k))}}const{nodes:y,transformed:v}=kH(i.content,f,o.state.schema);v&&(i=f.type==="node"&&f.nodeType.isBlock?new J(F.fromArray(y),0,0):new J(F.fromArray(y),i.openStart,i.openEnd))}return OH(i)},handleDOMEvents:{paste:(i,s)=>{var a,l;const c=s;if(!((l=(a=i.props).editable)!=null&&l.call(a,i.state)))return!1;const{clipboardData:u}=c;if(!u)return!1;const d=[...u.items].map(p=>p.getAsFile()).filter(p=>!!p);if(d.length===0)return!1;const{selection:f}=i.state;for(const{fileHandler:p,regexp:m}of r){const g=m?d.filter(y=>m.test(y.type)):d;if(g.length!==0&&p({event:c,files:g,selection:f,view:i,type:"paste"}))return c.preventDefault(),!0}return!1},drop:(i,s)=>{var a,l,c;const u=s;if(!((l=(a=i.props).editable)!=null&&l.call(a,i.state)))return!1;const{dataTransfer:d,clientX:f,clientY:p}=u;if(!d)return!1;const m=TH(u);if(m.length===0)return!1;const g=((c=i.posAtCoords({left:f,top:p}))==null?void 0:c.pos)??i.state.selection.anchor;for(const{fileHandler:y,regexp:v}of r){const x=v?m.filter(w=>v.test(w.type)):m;if(x.length!==0&&y({event:u,files:x,pos:g,view:i,type:"drop"}))return u.preventDefault(),!0}return!1}}}})}var yH=new Uc("pasteRule");function Qv(t,e){return function n(r){const{fragment:o,rule:i,nodes:s}=r,{regexp:a,ignoreWhitespace:l,ignoredMarks:c,ignoredNodes:u}=i;let d=!1;return o.forEach(f=>{if(u!=null&&u.includes(f.type.name)||_H(f)){s.push(f);return}if(!f.isText){const g=n({fragment:f.content,rule:i,nodes:[]});d||(d=g.transformed);const y=F.fromArray(g.nodes);f.type.validContent(y)?s.push(f.copy(y)):s.push(...g.nodes);return}if(f.marks.some(g=>CH(g)||(c==null?void 0:c.includes(g.type.name)))){s.push(f);return}const p=f.text??"";let m=0;for(const g of Sg(p,a)){const y=g[1],v=g[0];if(l&&(y==null?void 0:y.trim())===""||!v)return;const x=g.index,w=x+v.length;x>m&&s.push(f.cut(m,x));let S=f.cut(x,w);if(v&&y){const _=v.search(/\S/),k=x+v.indexOf(y),E=k+y.length;_&&s.push(f.cut(x,x+_)),S=f.cut(k,E)}t({nodes:s,rule:i,textNode:S,match:g,schema:e}),d=!0,m=w}p&&m<p.length&&s.push(f.cut(m))}),{nodes:s,transformed:d}}}function xH(t){const{nodes:e,rule:n,textNode:r,match:o,schema:i}=t,{transformMatch:s,getAttributes:a,markType:l}=n,c=dt(a)?a(o,!1):a,u=r.text??"",d=l.create(c),f=s==null?void 0:s(o);if(f==="")return;if(f===!1){e.push(i.text(u,r.marks));return}const p=d.addToSet(r.marks);e.push(i.text(f??u,p))}function bH(t){const{nodes:e,rule:n,textNode:r,match:o,schema:i}=t,{transformMatch:s}=n,a=s==null?void 0:s(o);if(a===""||a===!1)return;const l=a??r.text??"";e.push(i.text(l,r.marks))}function wH(t){const{nodes:e,rule:n,textNode:r,match:o}=t,{getAttributes:i,nodeType:s,getContent:a}=n,l=dt(i)?i(o,!1):i,c=(a?a(o):r)||void 0;e.push(s.createChecked(l,c))}function kH(t,e,n){const r=[];switch(e.type){case"mark":return Qv(xH,n)({fragment:t,nodes:r,rule:e});case"node":return Qv(wH,n)({fragment:t,nodes:r,rule:e});default:return Qv(bH,n)({fragment:t,nodes:r,rule:e})}}var SH=["mark","node","text"];function EH(t){return mo(SH,t.type)}function _H(t){var e;return t.type.spec.code||((e=t.type.spec.group)==null?void 0:e.split(" ").includes("code"))}function CH(t){var e;return t.type.name==="code"||((e=t.type.spec.group)==null?void 0:e.split(" ").includes("code"))}function TH(t){var e,n;const{dataTransfer:r}=t;return r?((e=r.files)==null?void 0:e.length)>0?[...r.files]:(n=r.items)!=null&&n.length?[...r.items].map(o=>o.getAsFile()).filter(o=>!!o):[]:[]}function OH(t){const e=J.maxOpen(t.content);return e.openStart<t.openStart||e.openEnd<t.openEnd?e:t}var MH=Object.defineProperty,RH=Object.getOwnPropertyDescriptor,ae=(t,e,n,r)=>{for(var o=r>1?void 0:r?RH(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&MH(e,n,o),o},GN=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},Q=(t,e,n)=>(GN(t,e,"read from private field"),n?n.call(t):e.get(t)),Ft=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},en=(t,e,n,r)=>(GN(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);function NH(t,e){return t===e}function YE(t){const{previousOptions:e,update:n,equals:r=NH}=t,o=pa({...e,...n}),i=pe(),s=qd(e);for(const l of s){const c=e[l],u=o[l];if(r(c,u)){i[l]={changed:!1};continue}i[l]={changed:!0,previousValue:c,value:u}}const a=l=>{const c=pe();for(const u of l){const d=i[u];d!=null&&d.changed&&(c[u]=d.value)}return c};return{changes:pa(i),options:o,pickChanged:a}}var PH={[K.DUPLICATE_HELPER_NAMES]:"helper method",[K.DUPLICATE_COMMAND_NAMES]:"command method"};function YN(t){const{name:e,set:n,code:r}=t,o=PH[r];ve(!n.has(e),{code:r,message:`There is a naming conflict for the name: ${e} used in this '${o}'. Please rename or remove from the editor to avoid runtime errors.`}),n.add(e)}function Q0(...t){return Gd(KV(...t).split(" ")).join(" ")}var ZE="__IGNORE__",$H="__ALL__",Wc=class{constructor(t,...[e]){this["~O"]={},this._mappedHandlers=pe(),this.populateMappedHandlers(),this._options=this._initialOptions=wz(t,this.constructor.defaultOptions,e??pe(),this.createDefaultHandlerOptions()),this._dynamicKeys=this.getDynamicKeys(),this.init()}get options(){return this._options}get dynamicKeys(){return this._dynamicKeys}get initialOptions(){return this._initialOptions}init(){}getDynamicKeys(){const t=[],{customHandlerKeys:e,handlerKeys:n,staticKeys:r}=this.constructor;for(const o of qd(this._options))r.includes(o)||n.includes(o)||e.includes(o)||t.push(o);return t}ensureAllKeysAreDynamic(t){}setOptions(t){var e;const n=this.getDynamicOptions();this.ensureAllKeysAreDynamic(t);const{changes:r,options:o,pickChanged:i}=YE({previousOptions:n,update:t});this.updateDynamicOptions(o),(e=this.onSetOptions)==null||e.call(this,{reason:"set",changes:r,options:o,pickChanged:i,initialOptions:this._initialOptions})}resetOptions(){var t;const e=this.getDynamicOptions(),{changes:n,options:r,pickChanged:o}=YE({previousOptions:e,update:this._initialOptions});this.updateDynamicOptions(r),(t=this.onSetOptions)==null||t.call(this,{reason:"reset",options:r,changes:n,pickChanged:o,initialOptions:this._initialOptions})}getDynamicOptions(){return J1(this._options,[...this.constructor.customHandlerKeys,...this.constructor.handlerKeys])}updateDynamicOptions(t){this._options={...this._options,...t}}populateMappedHandlers(){for(const t of this.constructor.handlerKeys)this._mappedHandlers[t]=[]}createDefaultHandlerOptions(){const t=pe();for(const e of this.constructor.handlerKeys)t[e]=(...n)=>{var r;const{handlerKeyOptions:o}=this.constructor,i=(r=o[e])==null?void 0:r.reducer;let s=i==null?void 0:i.getDefault(...n);for(const[,a]of this._mappedHandlers[e]){const l=a(...n);if(s=i?i.accumulator(s,l,...n):l,AH(o,s,e))return s}return s};return t}addHandler(t,e,n=at.Default){return this._mappedHandlers[t].push([n,e]),this.sortHandlers(t),()=>this._mappedHandlers[t]=this._mappedHandlers[t].filter(([,r])=>r!==e)}hasHandlers(t){return(this._mappedHandlers[t]??[]).length>0}sortHandlers(t){this._mappedHandlers[t]=za(this._mappedHandlers[t],([e],[n])=>n-e)}addCustomHandler(t,e){var n;return((n=this.onAddCustomHandler)==null?void 0:n.call(this,{[t]:e}))??eR}};Wc.defaultOptions={};Wc.staticKeys=[];Wc.handlerKeys=[];Wc.handlerKeyOptions={};Wc.customHandlerKeys=[];function AH(t,e,n){const{[$H]:r}=t,o=t[n];return!r&&!o?!1:!!(o&&o.earlyReturnValue!==ZE&&(dt(o.earlyReturnValue)?o.earlyReturnValue(e)===!0:e===o.earlyReturnValue)||r&&r.earlyReturnValue!==ZE&&(dt(r.earlyReturnValue)?r.earlyReturnValue(e)===!0:e===r.earlyReturnValue))}var Ag=class extends Wc{constructor(...t){super(IH,...t),this["~E"]={},this._extensions=tR(this.createExtensions(),e=>e.constructor),this.extensionMap=new Map;for(const e of this._extensions)this.extensionMap.set(e.constructor,e)}get priority(){return this.priorityOverride??this.options.priority??this.constructor.defaultPriority}get constructorName(){return`${ZM(this.name)}Extension`}get store(){return ve(this._store,{code:K.MANAGER_PHASE_ERROR,message:"An error occurred while attempting to access the 'extension.store' when the Manager has not yet set created the lifecycle methods."}),pa(this._store,{requireKeys:!0})}get extensions(){return this._extensions}replaceChildExtension(t,e){this.extensionMap.has(t)&&(this.extensionMap.set(t,e),this._extensions=this.extensions.map(n=>e.constructor===t?e:n))}createExtensions(){return[]}getExtension(t){const e=this.extensionMap.get(t);return ve(e,{code:K.INVALID_GET_EXTENSION,message:`'${t.name}' does not exist within the preset: '${this.name}'`}),e}isOfType(t){return this.constructor===t}setStore(t){this._store||(this._store=t)}clone(...t){return new this.constructor(...t)}setPriority(t){this.priorityOverride=t}};Ag.defaultPriority=at.Default;var St=class extends Ag{static get[bi](){return an.PlainExtensionConstructor}get[bi](){return an.PlainExtension}},If=class extends Ag{static get[bi](){return an.MarkExtensionConstructor}get[bi](){return an.MarkExtension}get type(){return Tt(this.store.schema.marks,this.name)}constructor(...t){super(...t)}};If.disableExtraAttributes=!1;var Fr=class extends Ag{static get[bi](){return an.NodeExtensionConstructor}get[bi](){return an.NodeExtension}get type(){return Tt(this.store.schema.nodes,this.name)}constructor(...t){super(...t)}};Fr.disableExtraAttributes=!1;var IH={priority:void 0,extraAttributes:{},disableExtraAttributes:!1,exclude:{}};function ZN(t){return Vc(t)&&Hc(t,[an.PlainExtension,an.MarkExtension,an.NodeExtension])}function DH(t){return Vc(t)&&Hc(t,[an.PlainExtensionConstructor,an.MarkExtensionConstructor,an.NodeExtensionConstructor])}function JN(t){return Vc(t)&&Hc(t,an.PlainExtension)}function Df(t){return Vc(t)&&Hc(t,an.NodeExtension)}function Ig(t){return Vc(t)&&Hc(t,an.MarkExtension)}function Ze(t){return e=>{const{defaultOptions:n,customHandlerKeys:r,handlerKeys:o,staticKeys:i,defaultPriority:s,handlerKeyOptions:a,...l}=t,c=e;n&&(c.defaultOptions=n),s&&(c.defaultPriority=s),a&&(c.handlerKeyOptions=a),c.staticKeys=i??[],c.handlerKeys=o??[],c.customHandlerKeys=r??[];for(const[u,d]of Object.entries(l))c[u]||(c[u]=d);return c}}var LH=class extends St{constructor(){super(...arguments),this.attributeList=[],this.attributeObject=pe(),this.updateAttributes=(t=!0)=>{this.transformAttributes(),t&&this.store.commands.forceUpdate("attributes")}}get name(){return"attributes"}onCreate(){this.transformAttributes(),this.store.setExtensionStore("updateAttributes",this.updateAttributes)}transformAttributes(){var t,e,n;if(this.attributeObject=pe(),(t=this.store.managerSettings.exclude)!=null&&t.attributes){this.store.setStoreKey("attributes",this.attributeObject);return}this.attributeList=[];for(const r of this.store.extensions){if((e=r.options.exclude)!=null&&e.attributes)continue;const o=(n=r.createAttributes)==null?void 0:n.call(r),i={...o,class:Q0(...r.classNames??[],o==null?void 0:o.class)};this.attributeList.unshift(i)}for(const r of this.attributeList)this.attributeObject={...this.attributeObject,...r,class:Q0(this.attributeObject.class,r.class)};this.store.setStoreKey("attributes",this.attributeObject)}};function At(t={}){return(e,n,r)=>{(e.decoratedHelpers??(e.decoratedHelpers={}))[n]=t}}function ue(t={}){return(e,n,r)=>{(e.decoratedCommands??(e.decoratedCommands={}))[n]=t}}function wr(t){return(e,n,r)=>{(e.decoratedKeybindings??(e.decoratedKeybindings={}))[n]=t}}var jH=class{constructor(t){this.promiseCreator=t,this.failureHandlers=[],this.successHandlers=[],this.validateHandlers=[],this.generateCommand=()=>e=>{let n=!0;const{view:r,tr:o,dispatch:i}=e;if(!r)return!1;for(const a of this.validateHandlers)if(!a({...e,dispatch:()=>{}})){n=!1;break}return!i||!n?n:(this.promiseCreator(e).then(a=>{this.runHandlers(this.successHandlers,{value:a,state:r.state,tr:r.state.tr,dispatch:r.dispatch,view:r})}).catch(a=>{this.runHandlers(this.failureHandlers,{error:a,state:r.state,tr:r.state.tr,dispatch:r.dispatch,view:r})}),i(o),!0)}}validate(t,e="push"){return this.validateHandlers[e](t),this}success(t,e="push"){return this.successHandlers[e](t),this}failure(t,e="push"){return this.failureHandlers[e](t),this}runHandlers(t,e){var n;for(const r of t)if(!r({...e,dispatch:()=>{}}))break;(n=e.dispatch)==null||n.call(e,e.tr)}};function nf(t){const{type:e,attrs:n,range:r,selection:o}=t;return i=>{const{dispatch:s,tr:a,state:l}=i,c=Se(e)?l.schema.marks[e]:e;if(ve(c,{code:K.SCHEMA,message:`Mark type: ${e} does not exist on the current schema.`}),r||o){const{from:u,to:d}=Ir(o??r??a.selection,a.doc);return um({trState:a,type:e,...r})?s==null||s(a.removeMark(u,d,c)):s==null||s(a.addMark(u,d,c.create(n))),!0}return ld(cH(c,n))(i)}}function zH(t,e,n){for(const{$from:r,$to:o}of n){let i=r.depth===0?e.type.allowsMarkType(t):!1;if(e.nodesBetween(r.pos,o.pos,s=>{if(i)return!1;i=s.inlineContent&&s.type.allowsMarkType(t)}),i)return!0}return!1}function FH(t,e,n){return({tr:r,dispatch:o,state:i})=>{const s=Ir(n??r.selection,r.doc),a=CV(s),l=Se(t)?i.schema.marks[t]:t;if(ve(l,{code:K.SCHEMA,message:`Mark type: ${t} does not exist on the current schema.`}),s.empty&&!a||!zH(l,r.doc,s.ranges))return!1;if(!o)return!0;if(a)return r.removeStoredMark(l),e&&r.addStoredMark(l.create(e)),o(r),!0;let c=!1;for(const{$from:u,$to:d}of s.ranges){if(c)break;c=r.doc.rangeHasMark(u.pos,d.pos,l)}for(const{$from:u,$to:d}of s.ranges)c&&r.removeMark(u.pos,d.pos,l),e&&r.addMark(u.pos,d.pos,l.create(e));return o(r),!0}}function BH(t,e={}){return({tr:n,dispatch:r,state:o})=>{const i=o.schema,s=n.selection,{from:a=s.from,to:l=a??s.to,marks:c={}}=e;if(!r)return!0;n.insertText(t,a,l);const u=Tt(n.steps,n.steps.length-1).getMap().map(l);for(const[d,f]of qt(c))n.addMark(a,u,Tt(i.marks,d).create(f));return r(n),!0}}var Fe=class extends St{constructor(){super(...arguments),this.decorated=new Map,this.forceUpdateTransaction=(t,...e)=>{const{forcedUpdates:n}=this.getCommandMeta(t);return this.setCommandMeta(t,{forcedUpdates:Gd([...n,...e])}),t}}get name(){return"commands"}get transaction(){const t=this.store.getState();this._transaction||(this._transaction=t.tr);const e=this._transaction.before.eq(t.doc),n=!As(this._transaction.steps);if(!e){const r=t.tr;if(n)for(const o of this._transaction.steps)r.step(o);this._transaction=r}return this._transaction}onCreate(){this.store.setStoreKey("getForcedUpdates",this.getForcedUpdates.bind(this))}onView(t){var e;const{extensions:n,helpers:r}=this.store,o=pe(),i=new Set;let s=pe();const a=c=>{var u;const d=pe(),f=()=>c??this.transaction;let p=[];const m=()=>p;for(const[y,v]of Object.entries(o))(u=s[y])!=null&&u.disableChaining||(d[y]=this.chainedFactory({chain:d,command:v.original,getTr:f,getChain:m}));const g=y=>{ve(y===f(),{message:"Chaining currently only supports `CommandFunction` methods which do not use the `state.tr` property. Instead you should use the provided `tr` property."})};return d.run=(y={})=>{const v=p;p=[];for(const x of v)if(!x(g)&&y.exitEarly)return;t.dispatch(f())},d.tr=()=>{const y=p;p=[];for(const v of y)v(g);return f()},d.enabled=()=>{for(const y of p)if(!y())return!1;return!0},d.new=y=>a(y),d};for(const c of n){const u=((e=c.createCommands)==null?void 0:e.call(c))??{},d=c.decoratedCommands??{},f={};s={...s,decoratedCommands:d};for(const[p,m]of Object.entries(d)){const g=Se(m.shortcut)&&m.shortcut.startsWith("_|")?{shortcut:r.getNamedShortcut(m.shortcut,c.options)}:void 0;this.updateDecorated(p,{...m,name:c.name,...g}),u[p]=c[p].bind(c),m.active&&(f[p]=()=>{var y;return((y=m.active)==null?void 0:y.call(m,c.options,this.store))??!1})}Gh(u)||this.addCommands({active:f,names:i,commands:o,extensionCommands:u})}const l=a();for(const[c,u]of Object.entries(l))a[c]=u;this.store.setStoreKey("commands",o),this.store.setStoreKey("chain",a),this.store.setExtensionStore("commands",o),this.store.setExtensionStore("chain",a)}onStateUpdate({state:t}){this._transaction=t.tr}createPlugin(){return{}}customDispatch(t){return t}insertText(t,e={}){return Se(t)?BH(t,e):this.store.createPlaceholderCommand({promise:t,placeholder:{type:"inline"},onSuccess:(n,r,o)=>this.insertText(n,{...e,...r})(o)}).generateCommand()}selectText(t,e={}){return({tr:n,dispatch:r})=>{const o=Ir(t,n.doc);return n.selection.anchor===o.anchor&&n.selection.head===o.head&&!e.forceUpdate?!1:(r==null||r(n.setSelection(o)),!0)}}selectMark(t){return e=>{const{tr:n}=e,r=wi(n.selection.$from,t);return r?this.store.commands.selectText.original({from:r.from,to:r.to})(e):!1}}delete(t){return({tr:e,dispatch:n})=>{const{from:r,to:o}=t??e.selection;return n==null||n(e.delete(r,o)),!0}}emptyUpdate(t){return({tr:e,dispatch:n})=>(n&&(t==null||t(),n(e)),!0)}forceUpdate(...t){return({tr:e,dispatch:n})=>(n==null||n(this.forceUpdateTransaction(e,...t)),!0)}updateNodeAttributes(t,e){return({tr:n,dispatch:r})=>(r==null||r(n.setNodeMarkup(t,void 0,e)),!0)}setContent(t,e){return n=>{const{tr:r,dispatch:o}=n,i=this.store.manager.createState({content:t,selection:e});return i?(o==null||o(r.replaceRangeWith(0,r.doc.nodeSize-2,i.doc)),!0):!1}}resetContent(){return t=>{const{tr:e,dispatch:n}=t,r=this.store.manager.createEmptyDoc();return r?this.setContent(r)(t):(n==null||n(e.delete(0,e.doc.nodeSize)),!0)}}emptySelection(){return({tr:t,dispatch:e})=>t.selection.empty?!1:(e==null||e(t.setSelection(Ce.near(t.selection.$anchor))),!0)}insertNewLine(){return({dispatch:t,tr:e})=>tl(e.selection)?(t==null||t(e.insertText(`
212
- `)),!0):!1}insertNode(t,e={}){return({dispatch:n,tr:r,state:o})=>{var i;const{attrs:s,range:a,selection:l,replaceEmptyParentBlock:c=!1}=e,{from:u,to:d,$from:f}=Ir(l??a??r.selection,r.doc);if(Mg(t)||gV(t)){const v=f.before(f.depth);return n==null||n(c&&u===d&&wb(f.parent)?r.replaceWith(v,v+f.parent.nodeSize,t):r.replaceWith(u,d,t)),!0}const p=Se(t)?o.schema.nodes[t]:t;ve(p,{code:K.SCHEMA,message:`The requested node type ${t} does not exist in the schema.`});const m=(i=e.marks)==null?void 0:i.map(v=>{if(v instanceof qe)return v;const x=Se(v)?o.schema.marks[v]:v;return ve(x,{code:K.SCHEMA,message:`The requested mark type ${v} does not exist in the schema.`}),x.create()}),g=p.createAndFill(s,Se(e.content)?o.schema.text(e.content):e.content,m);if(!g)return!1;const y=u!==d;return n==null||n(y?r.replaceRangeWith(u,d,g):r.insert(u,g)),!0}}focus(t){return e=>{const{dispatch:n,tr:r}=e,{view:o}=this.store;if(t===!1||o.hasFocus()&&(t===void 0||t===!0))return!1;if(t===void 0||t===!0){const{from:i=0,to:s=i}=r.selection;t={from:i,to:s}}return n&&this.delayedFocus(),this.selectText(t)(e)}}blur(t){return e=>{const{view:n}=this.store;return n.hasFocus()?(requestAnimationFrame(()=>{n.dom.blur()}),t?this.selectText(t)(e):!0):!1}}setBlockNodeType(t,e,n,r=!0){return dm(t,e,n,r)}toggleWrappingNode(t,e,n){return FV(t,e,n)}toggleBlockNodeItem(t){return DN(t)}wrapInNode(t,e,n){return IN(t,e,n)}applyMark(t,e,n){return FH(t,e,n)}toggleMark(t){return nf(t)}removeMark(t){return jN(t)}setMeta(t,e){return({tr:n})=>(n.setMeta(t,e),!0)}selectAll(){return this.selectText("all")}copy(){return t=>t.tr.selection.empty?!1:(t.dispatch&&document.execCommand("copy"),!0)}paste(){return this.store.createPlaceholderCommand({promise:async()=>{var t;return(t=navigator.clipboard)!=null&&t.readText?await navigator.clipboard.readText():""},placeholder:{type:"inline"},onSuccess:(t,e,n)=>this.insertNode(J0({content:t,schema:n.state.schema}),{selection:e})(n)}).generateCommand()}cut(){return t=>t.tr.selection.empty?!1:(t.dispatch&&document.execCommand("cut"),!0)}replaceText(t){return VV(t)}getAllCommandOptions(){const t={};for(const[e,n]of this.decorated)Gh(n)||(t[e]=n);return t}getCommandOptions(t){return this.decorated.get(t)}getCommandProp(){return{tr:this.transaction,dispatch:this.store.view.dispatch,state:this.store.view.state,view:this.store.view}}updateDecorated(t,e){if(!e){this.decorated.delete(t);return}const n=this.decorated.get(t)??{name:""};this.decorated.set(t,{...n,...e})}handleIosFocus(){Qr.isIos&&this.store.view.dom.focus()}delayedFocus(){this.handleIosFocus(),requestAnimationFrame(()=>{this.store.view.focus(),this.store.view.dispatch(this.transaction.scrollIntoView())})}getForcedUpdates(t){return this.getCommandMeta(t).forcedUpdates}getCommandMeta(t){const e=t.getMeta(this.pluginKey)??{};return{...UH,...e}}setCommandMeta(t,e){const n=this.getCommandMeta(t);t.setMeta(this.pluginKey,{...n,...e})}addCommands(t){const{extensionCommands:e,commands:n,names:r,active:o}=t;for(const[i,s]of qt(e))YN({name:i,set:r,code:K.DUPLICATE_COMMAND_NAMES}),ve(!VH.has(i),{code:K.DUPLICATE_COMMAND_NAMES,message:"The command name you chose is forbidden."}),n[i]=this.createUnchainedCommand(s,o[i])}unchainedFactory(t){return(...e)=>{const{shouldDispatch:n=!0,command:r}=t,{view:o}=this.store,{state:i}=o;let s;return n&&(s=o.dispatch),r(...e)({state:i,dispatch:s,view:o,tr:i.tr})}}createUnchainedCommand(t,e){const n=this.unchainedFactory({command:t});return n.enabled=this.unchainedFactory({command:t,shouldDispatch:!1}),n.isEnabled=n.enabled,n.original=t,n.active=e,n}chainedFactory(t){return(...e)=>{const{chain:n,command:r,getTr:o,getChain:i}=t,s=i(),{view:a}=this.store,{state:l}=a;return s.push(c=>r(...e)({state:l,dispatch:c,view:a,tr:o()})),n}}};ae([ue()],Fe.prototype,"customDispatch",1);ae([ue()],Fe.prototype,"insertText",1);ae([ue()],Fe.prototype,"selectText",1);ae([ue()],Fe.prototype,"selectMark",1);ae([ue()],Fe.prototype,"delete",1);ae([ue()],Fe.prototype,"emptyUpdate",1);ae([ue()],Fe.prototype,"forceUpdate",1);ae([ue()],Fe.prototype,"updateNodeAttributes",1);ae([ue()],Fe.prototype,"setContent",1);ae([ue()],Fe.prototype,"resetContent",1);ae([ue()],Fe.prototype,"emptySelection",1);ae([ue()],Fe.prototype,"insertNewLine",1);ae([ue()],Fe.prototype,"insertNode",1);ae([ue()],Fe.prototype,"focus",1);ae([ue()],Fe.prototype,"blur",1);ae([ue()],Fe.prototype,"setBlockNodeType",1);ae([ue()],Fe.prototype,"toggleWrappingNode",1);ae([ue()],Fe.prototype,"toggleBlockNodeItem",1);ae([ue()],Fe.prototype,"wrapInNode",1);ae([ue()],Fe.prototype,"applyMark",1);ae([ue()],Fe.prototype,"toggleMark",1);ae([ue()],Fe.prototype,"removeMark",1);ae([ue()],Fe.prototype,"setMeta",1);ae([ue({description:({t})=>t(Is.SELECT_ALL_DESCRIPTION),label:({t})=>t(Is.SELECT_ALL_LABEL),shortcut:q.SelectAll})],Fe.prototype,"selectAll",1);ae([ue({description:({t})=>t(Is.COPY_DESCRIPTION),label:({t})=>t(Is.COPY_LABEL),shortcut:q.Copy,icon:"fileCopyLine"})],Fe.prototype,"copy",1);ae([ue({description:({t})=>t(Is.PASTE_DESCRIPTION),label:({t})=>t(Is.PASTE_LABEL),shortcut:q.Paste,icon:"clipboardLine"})],Fe.prototype,"paste",1);ae([ue({description:({t})=>t(Is.CUT_DESCRIPTION),label:({t})=>t(Is.CUT_LABEL),shortcut:q.Cut,icon:"scissorsFill"})],Fe.prototype,"cut",1);ae([ue()],Fe.prototype,"replaceText",1);ae([At()],Fe.prototype,"getAllCommandOptions",1);ae([At()],Fe.prototype,"getCommandOptions",1);ae([At()],Fe.prototype,"getCommandProp",1);Fe=ae([Ze({defaultPriority:at.Highest,defaultOptions:{trackerClassName:"remirror-tracker-position",trackerNodeName:"span"},staticKeys:["trackerClassName","trackerNodeName"]})],Fe);var UH={forcedUpdates:[]},VH=new Set(["run","chain","original","raw","enabled","tr","new"]),vo=class extends St{constructor(){super(...arguments),this.placeholders=Qe.empty,this.placeholderWidgets=new Map,this.createPlaceholderCommand=t=>{const e=Zh(),{promise:n,placeholder:r,onFailure:o,onSuccess:i}=t;return new jH(n).validate(s=>this.addPlaceholder(e,r)(s)).success(s=>{const{state:a,tr:l,dispatch:c,view:u,value:d}=s,f=this.store.helpers.findPlaceholder(e);if(!f){const p=new Error("The placeholder has been removed");return(o==null?void 0:o({error:p,state:a,tr:l,dispatch:c,view:u}))??!1}return this.removePlaceholder(e)({state:a,tr:l,view:u,dispatch:()=>{}}),i(d,f,{state:a,tr:l,dispatch:c,view:u})}).failure(s=>(this.removePlaceholder(e)({...s,dispatch:()=>{}}),(o==null?void 0:o(s))??!1))}}get name(){return"decorations"}onCreate(){this.store.setExtensionStore("createPlaceholderCommand",this.createPlaceholderCommand)}createPlugin(){return{state:{init:()=>{},apply:t=>{var e,n,r,o,i,s;const{added:a,clearTrackers:l,removed:c,updated:u}=this.getMeta(t);if(l){this.placeholders=Qe.empty;for(const[,d]of this.placeholderWidgets)(n=(e=d.spec).onDestroy)==null||n.call(e,this.store.view,d.spec.element);this.placeholderWidgets.clear();return}this.placeholders=this.placeholders.map(t.mapping,t.doc,{onRemove:d=>{var f,p;const m=this.placeholderWidgets.get(d.id);m&&((p=(f=m.spec).onDestroy)==null||p.call(f,this.store.view,m.spec.element))}});for(const[,d]of this.placeholderWidgets)(o=(r=d.spec).onUpdate)==null||o.call(r,this.store.view,d.from,d.spec.element,d.spec.data);for(const d of a){if(d.type==="inline"){this.addInlinePlaceholder(d,t);continue}if(d.type==="node"){this.addNodePlaceholder(d,t);continue}if(d.type==="widget"){this.addWidgetPlaceholder(d,t);continue}}for(const{id:d,data:f}of u){const p=this.placeholderWidgets.get(d);if(!p)continue;const m=kt.widget(p.from,p.spec.element,{...p.spec,data:f});this.placeholders=this.placeholders.remove([p]).add(t.doc,[m]),this.placeholderWidgets.set(d,m)}for(const d of c){const f=this.placeholders.find(void 0,void 0,m=>m.id===d&&m.__type===vl),p=this.placeholderWidgets.get(d);p&&((s=(i=p.spec).onDestroy)==null||s.call(i,this.store.view,p.spec.element)),this.placeholders=this.placeholders.remove(f),this.placeholderWidgets.delete(d)}}},props:{decorations:t=>{let e=this.options.decorations(t);e=e.add(t.doc,this.placeholders.find());for(const n of this.store.extensions){if(!n.createDecorations)continue;const r=n.createDecorations(t).find();e=e.add(t.doc,r)}return e},handleDOMEvents:{blur:t=>(this.options.persistentSelectionClass&&t.dispatch(t.state.tr.setMeta(JE,!1)),!1),focus:t=>(this.options.persistentSelectionClass&&t.dispatch(t.state.tr.setMeta(JE,!0)),!1)}}}}updateDecorations(){return({tr:t,dispatch:e})=>(e==null||e(t),!0)}addPlaceholder(t,e,n){return({dispatch:r,tr:o})=>this.addPlaceholderTransaction(t,e,o,!r)?(r==null||r(n?o.deleteSelection():o),!0):!1}updatePlaceholder(t,e){return({dispatch:n,tr:r})=>this.updatePlaceholderTransaction({id:t,data:e,tr:r,checkOnly:!n})?(n==null||n(r),!0):!1}removePlaceholder(t){return({dispatch:e,tr:n})=>this.removePlaceholderTransaction({id:t,tr:n,checkOnly:!e})?(e==null||e(n),!0):!1}clearPlaceholders(){return({tr:t,dispatch:e})=>this.clearPlaceholdersTransaction({tr:t,checkOnly:!e})?(e==null||e(t),!0):!1}findPlaceholder(t){return this.findAllPlaceholders().get(t)}findAllPlaceholders(){const t=new Map,e=this.placeholders.find(void 0,void 0,n=>n.__type===vl);for(const n of e)t.set(n.spec.id,{from:n.from,to:n.to});return t}createDecorations(t){var e,n,r;const{persistentSelectionClass:o}=this.options;return!o||(e=this.store.view)!=null&&e.hasFocus()||(r=(n=this.store.helpers).isInteracting)!=null&&r.call(n)?Qe.empty:WH(t,Qe.empty,{class:Se(o)?o:"selection"})}onApplyState(){}addWidgetPlaceholder(t,e){const{pos:n,createElement:r,onDestroy:o,onUpdate:i,className:s,nodeName:a,id:l,type:c}=t,u=(r==null?void 0:r(this.store.view,n))??document.createElement(a);u.classList.add(s);const d=kt.widget(n,u,{id:l,__type:vl,type:c,element:u,onDestroy:o,onUpdate:i});this.placeholderWidgets.set(l,d),this.placeholders=this.placeholders.add(e.doc,[d])}addInlinePlaceholder(t,e){const{from:n=e.selection.from,to:r=e.selection.to,className:o,nodeName:i,id:s,type:a}=t;let l;if(n===r){const c=document.createElement(i);c.classList.add(o),l=kt.widget(n,c,{id:s,type:a,__type:vl,widget:c})}else l=kt.inline(n,r,{nodeName:i,class:o},{id:s,__type:vl});this.placeholders=this.placeholders.add(e.doc,[l])}addNodePlaceholder(t,e){const{pos:n,className:r,nodeName:o,id:i}=t,s=mr(n)?e.doc.resolve(n):e.selection.$from,a=mr(n)?s.nodeAfter?{pos:n,end:s.nodeAfter.nodeSize}:void 0:sV(s);if(!a)return;const l=kt.node(a.pos,a.end,{nodeName:o,class:r},{id:i,__type:vl});this.placeholders=this.placeholders.add(e.doc,[l])}withRequiredBase(t,e){const{placeholderNodeName:n,placeholderClassName:r}=this.options,{nodeName:o=n,className:i,...s}=e,a=(i?[r,i]:[r]).join(" ");return{nodeName:o,className:a,...s,id:t}}getMeta(t){const e=t.getMeta(this.pluginKey)??{};return{...HH,...e}}setMeta(t,e){const n=this.getMeta(t);t.setMeta(this.pluginKey,{...n,...e})}addPlaceholderTransaction(t,e,n,r=!1){if(this.findPlaceholder(t))return!1;if(r)return!0;const{added:i}=this.getMeta(n);return this.setMeta(n,{added:[...i,this.withRequiredBase(t,e)]}),!0}updatePlaceholderTransaction(t){const{id:e,tr:n,checkOnly:r=!1,data:o}=t;if(!this.findPlaceholder(e))return!1;if(r)return!0;const{updated:s}=this.getMeta(n);return this.setMeta(n,{updated:Gd([...s,{id:e,data:o}])}),!0}removePlaceholderTransaction(t){const{id:e,tr:n,checkOnly:r=!1}=t;if(!this.findPlaceholder(e))return!1;if(r)return!0;const{removed:i}=this.getMeta(n);return this.setMeta(n,{removed:Gd([...i,e])}),!0}clearPlaceholdersTransaction(t){const{tr:e,checkOnly:n=!1}=t;return this.getPluginState()===Qe.empty?!1:(n||this.setMeta(e,{clearTrackers:!0}),!0)}};ae([ue()],vo.prototype,"updateDecorations",1);ae([ue()],vo.prototype,"addPlaceholder",1);ae([ue()],vo.prototype,"updatePlaceholder",1);ae([ue()],vo.prototype,"removePlaceholder",1);ae([ue()],vo.prototype,"clearPlaceholders",1);ae([At()],vo.prototype,"findPlaceholder",1);ae([At()],vo.prototype,"findAllPlaceholders",1);vo=ae([Ze({defaultOptions:{persistentSelectionClass:void 0,placeholderClassName:"placeholder",placeholderNodeName:"span"},staticKeys:["placeholderClassName","placeholderNodeName"],handlerKeys:["decorations"],handlerKeyOptions:{decorations:{reducer:{accumulator:(t,e,n)=>t.add(n.doc,e.find()),getDefault:()=>Qe.empty}}},defaultPriority:at.Low})],vo);var HH={added:[],updated:[],clearTrackers:!1,removed:[]},vl="placeholderDecoration",JE="persistentSelectionFocus";function WH(t,e,n){const{selection:r,doc:o}=t;if(r.empty)return e;const{from:i,to:s}=r,a=Rg(r)?kt.node(i,s,n):kt.inline(i,s,n);return e.add(o,[a])}var hm=class extends St{get name(){return"docChanged"}onStateUpdate(t){const{firstUpdate:e,transactions:n,tr:r}=t;e||(n??[r]).some(o=>o==null?void 0:o.docChanged)&&this.options.docChanged(t)}};hm=ae([Ze({handlerKeys:["docChanged"],handlerKeyOptions:{docChanged:{earlyReturnValue:!1}},defaultPriority:at.Lowest})],hm);var Dr=class extends St{get name(){return"helpers"}onCreate(){var t;this.store.setStringHandler("text",this.textToProsemirrorNode.bind(this)),this.store.setStringHandler("html",J0);const e=pe(),n=pe(),r=pe(),o=new Set;for(const i of this.store.extensions){Df(i)&&(n[i.name]=a=>cV({state:this.store.getState(),type:i.type,attrs:a}),r[i.name]=a=>{var l;return(l=tf({state:this.store.getState(),type:i.type,attrs:a}))==null?void 0:l.node.attrs}),Ig(i)&&(n[i.name]=a=>um({trState:this.store.getState(),type:i.type,attrs:a}),r[i.name]=a=>{const l=wi(this.store.getState().selection.$from,i.type);if(!l||!a)return l==null?void 0:l.mark.attrs;if(yb(l.mark,a))return l.mark.attrs});const s=((t=i.createHelpers)==null?void 0:t.call(i))??{};for(const a of Object.keys(i.decoratedHelpers??{}))s[a]=i[a].bind(i);if(!Gh(s))for(const[a,l]of qt(s))YN({name:a,set:o,code:K.DUPLICATE_HELPER_NAMES}),e[a]=l}this.store.setStoreKey("attrs",r),this.store.setStoreKey("active",n),this.store.setStoreKey("helpers",e),this.store.setExtensionStore("attrs",r),this.store.setExtensionStore("active",n),this.store.setExtensionStore("helpers",e)}isSelectionEmpty(t=this.store.getState()){return vb(t)}isViewEditable(t=this.store.getState()){var e,n;return((n=(e=this.store.view.props).editable)==null?void 0:n.call(e,t))??!1}getStateJSON(t=this.store.getState()){return t.toJSON()}getJSON(t=this.store.getState()){return t.doc.toJSON()}getRemirrorJSON(t=this.store.getState()){return this.getJSON(t)}insertHtml(t,e){return n=>{const{state:r}=n,o=J0({content:t,schema:r.schema,fragment:!0});return this.store.commands.insertNode.original(o,e)(n)}}getText({lineBreakDivider:t=`
213
-
214
- `,state:e=this.store.getState()}={}){return e.doc.textBetween(0,e.doc.content.size,t,ss)}getTextBetween(t,e,n=this.store.getState().doc){return n.textBetween(t,e,`
215
-
216
- `,ss)}getHTML(t=this.store.getState()){return AV(t.doc,this.store.document)}textToProsemirrorNode(t){const e=`<pre>${t.content}</pre>`;return this.store.stringHandlers.html({...t,content:e})}};ae([At()],Dr.prototype,"isSelectionEmpty",1);ae([At()],Dr.prototype,"isViewEditable",1);ae([At()],Dr.prototype,"getStateJSON",1);ae([At()],Dr.prototype,"getJSON",1);ae([At()],Dr.prototype,"getRemirrorJSON",1);ae([ue()],Dr.prototype,"insertHtml",1);ae([At()],Dr.prototype,"getText",1);ae([At()],Dr.prototype,"getTextBetween",1);ae([At()],Dr.prototype,"getHTML",1);Dr=ae([Ze({})],Dr);var ex=class extends St{get name(){return"inputRules"}onCreate(){this.store.setExtensionStore("rebuildInputRules",this.rebuildInputRules.bind(this))}createExternalPlugins(){return[this.generateInputRulesPlugin()]}generateInputRulesPlugin(){var t,e;const n=[],r=this.store.markTags[Ie.ExcludeInputRules];for(const o of this.store.extensions)if(!((t=this.store.managerSettings.exclude)!=null&&t.inputRules||!o.createInputRules||(e=o.options.exclude)!=null&&e.inputRules))for(const i of o.createInputRules())i.shouldSkip=this.options.shouldSkipInputRule,i.invalidMarks=r,n.push(i);return QF({rules:n})}rebuildInputRules(){this.store.updateExtensionPlugins(this)}};ex=ae([Ze({defaultPriority:at.Default,handlerKeys:["shouldSkipInputRule"],handlerKeyOptions:{shouldSkipInputRule:{earlyReturnValue:!0}}})],ex);var eo=class extends St{constructor(){super(...arguments),this.extraKeyBindings=[],this.backwardMarkExitTracker=new Map,this.keydownHandler=null,this.onAddCustomHandler=({keymap:t})=>{var e,n;if(t)return this.extraKeyBindings=[...this.extraKeyBindings,t],(n=(e=this.store).rebuildKeymap)==null||n.call(e),()=>{var r,o;this.extraKeyBindings=this.extraKeyBindings.filter(i=>i!==t),(o=(r=this.store).rebuildKeymap)==null||o.call(r)}},this.rebuildKeymap=()=>{this.setupKeydownHandler()}}get name(){return"keymap"}get shortcutMap(){const{shortcuts:t}=this.options;return Se(t)?YH[t]:t}onCreate(){this.store.setExtensionStore("rebuildKeymap",this.rebuildKeymap)}createExternalPlugins(){var t;return(t=this.store.managerSettings.exclude)!=null&&t.keymap?[]:(this.setupKeydownHandler(),[new Ti({props:{handleKeyDown:(e,n)=>{var r;return(r=this.keydownHandler)==null?void 0:r.call(this,e,n)}}})])}setupKeydownHandler(){const t=this.generateKeymapBindings();this.keydownHandler=qN(t)}generateKeymapBindings(){var t;const e=[],n=this.shortcutMap,r=this.store.getExtension(Fe),o=a=>l=>Up({shortcut:l,map:n,store:this.store,options:a.options});for(const a of this.store.extensions){const l=a.decoratedKeybindings??{};if(!((t=a.options.exclude)!=null&&t.keymap)){a.createKeymap&&e.push(qH(a.createKeymap(o(a)),n));for(const[c,u]of qt(l)){if(u.isActive&&!u.isActive(a.options,this.store))continue;const d=a[c].bind(a),f=Up({shortcut:u.shortcut,map:n,options:a.options,store:this.store}),p=dt(u.priority)?u.priority(a.options,this.store):u.priority??at.Low,m=pe();for(const g of f)m[g]=d;e.push([p,m]),u.command&&r.updateDecorated(u.command,{shortcut:f})}}}const i=this.sortKeymaps([...this.extraKeyBindings,...e]);return dV(i)}arrowRightShortcut(t){const e=this.store.markTags[Ie.PreventExits],n=this.store.nodeTags[Ie.PreventExits];return this.exitMarkForwards(e,n)(t)}arrowLeftShortcut(t){const e=this.store.markTags[Ie.PreventExits],n=this.store.nodeTags[Ie.PreventExits];return cm(this.exitNodeBackwards(n),this.exitMarkBackwards(e,n))(t)}backspace(t){const e=this.store.markTags[Ie.PreventExits],n=this.store.nodeTags[Ie.PreventExits];return cm(this.exitNodeBackwards(n,!0),this.exitMarkBackwards(e,n,!0))(t)}createKeymap(){const{selectParentNodeOnEscape:t,undoInputRuleOnBackspace:e,excludeBaseKeymap:n}=this.options,r=pe();if(!n)for(const[o,i]of qt(Zv))r[o]=ld(i);return e&&Zv.Backspace&&(r.Backspace=ld($g(eB,Zv.Backspace))),t&&(r.Escape=ld(rH)),[at.Low,r]}getNamedShortcut(t,e={}){return t.startsWith("_|")?Up({shortcut:t,map:this.shortcutMap,store:this.store,options:e}):[t]}onSetOptions(t){var e,n;const{changes:r}=t;(r.excludeBaseKeymap.changed||r.selectParentNodeOnEscape.changed||r.undoInputRuleOnBackspace.changed)&&((n=(e=this.store).rebuildKeymap)==null||n.call(e))}sortKeymaps(t){return za(t.map(e=>Gt(e)?e:[at.Default,e]),(e,n)=>n[0]-e[0]).map(e=>e[1])}exitMarkForwards(t,e){return n=>{const{tr:r,dispatch:o}=n;if(!LV(r.selection)||ef({selection:r.selection,types:e}))return!1;const a=r.selection.$from.marks().filter(l=>!t.includes(l.type.name));if(As(a))return!1;if(!o)return!0;for(const l of a)r.removeStoredMark(l);return o(r.insertText(" ",r.selection.from)),!0}}exitNodeBackwards(t,e=!1){return n=>{const{tr:r}=n;if(!(e?qE:X0)(r.selection))return!1;const i=r.selection.$anchor.node();return!wb(i)||wV(i)||t.includes(i.type.name)?!1:this.store.commands.toggleBlockNodeItem.original({type:i.type})(n)}}exitMarkBackwards(t,e,n=!1){return r=>{const{tr:o,dispatch:i}=r;if(!(n?qE:X0)(o.selection)||this.backwardMarkExitTracker.has(o.selection.anchor))return this.backwardMarkExitTracker.clear(),!1;if(ef({selection:o.selection,types:e}))return!1;const l=[...o.storedMarks??[],...o.selection.$from.marks()].filter(c=>!t.includes(c.type.name));if(As(l))return!1;if(!i)return!0;for(const c of l)o.removeStoredMark(c);return this.backwardMarkExitTracker.set(o.selection.anchor,!0),i(o),!0}}};ae([wr({shortcut:"ArrowRight",isActive:t=>t.exitMarksOnArrowPress})],eo.prototype,"arrowRightShortcut",1);ae([wr({shortcut:"ArrowLeft",isActive:t=>t.exitMarksOnArrowPress})],eo.prototype,"arrowLeftShortcut",1);ae([wr({shortcut:"Backspace",isActive:t=>t.exitMarksOnArrowPress})],eo.prototype,"backspace",1);ae([At()],eo.prototype,"getNamedShortcut",1);eo=ae([Ze({defaultPriority:at.Low,defaultOptions:{shortcuts:"default",undoInputRuleOnBackspace:!0,selectParentNodeOnEscape:!1,excludeBaseKeymap:!1,exitMarksOnArrowPress:!0},customHandlerKeys:["keymap"]})],eo);function KH(t){return mo(wg(q),t)}function Up({shortcut:t,map:e,options:n,store:r}){return Se(t)?[tx(t,e)]:Gt(t)?t.map(o=>tx(o,e)):(t=t(n,r),Up({shortcut:t,map:e,options:n,store:r}))}function tx(t,e){return KH(t)?e[t]:t}function qH(t,e){const n={};let r,o;Gt(t)?[o,r]=t:r=t;for(const[i,s]of qt(r))n[tx(i,e)]=s;return kg(o)?n:[o,n]}var XN={[q.Copy]:"Mod-c",[q.Cut]:"Mod-x",[q.Paste]:"Mod-v",[q.PastePlain]:"Mod-Shift-v",[q.SelectAll]:"Mod-a",[q.Undo]:"Mod-z",[q.Redo]:Qr.isMac?"Shift-Mod-z":"Mod-y",[q.Bold]:"Mod-b",[q.Italic]:"Mod-i",[q.Underline]:"Mod-u",[q.Strike]:"Mod-d",[q.Code]:"Mod-`",[q.Paragraph]:"Mod-Shift-0",[q.H1]:"Mod-Shift-1",[q.H2]:"Mod-Shift-2",[q.H3]:"Mod-Shift-3",[q.H4]:"Mod-Shift-4",[q.H5]:"Mod-Shift-5",[q.H6]:"Mod-Shift-6",[q.TaskList]:"Mod-Shift-7",[q.BulletList]:"Mod-Shift-8",[q.OrderedList]:"Mod-Shift-9",[q.Quote]:"Mod->",[q.Divider]:"Mod-Shift-|",[q.Codeblock]:"Mod-Shift-~",[q.ClearFormatting]:"Mod-Shift-C",[q.Superscript]:"Mod-.",[q.Subscript]:"Mod-,",[q.LeftAlignment]:"Mod-Shift-L",[q.CenterAlignment]:"Mod-Shift-E",[q.RightAlignment]:"Mod-Shift-R",[q.JustifyAlignment]:"Mod-Shift-J",[q.InsertLink]:"Mod-k",[q.Find]:"Mod-f",[q.FindBackwards]:"Mod-Shift-f",[q.FindReplace]:"Mod-Shift-H",[q.AddFootnote]:"Mod-Alt-f",[q.AddComment]:"Mod-Alt-m",[q.ContextMenu]:"Mod-Shift-\\",[q.IncreaseFontSize]:"Mod-Shift-.",[q.DecreaseFontSize]:"Mod-Shift-,",[q.IncreaseIndent]:"Tab",[q.DecreaseIndent]:"Shift-Tab",[q.Shortcuts]:"Mod-/",[q.Format]:Qr.isMac?"Alt-Shift-f":"Shift-Ctrl-f"},GH={...XN,[q.Strike]:"Mod-Shift-S",[q.Code]:"Mod-Shift-M",[q.Paragraph]:"Mod-Alt-0",[q.H1]:"Mod-Alt-1",[q.H2]:"Mod-Alt-2",[q.H3]:"Mod-Alt-3",[q.H4]:"Mod-Alt-4",[q.H5]:"Mod-Alt-5",[q.H6]:"Mod-Alt-6",[q.OrderedList]:"Mod-Alt-7",[q.BulletList]:"Mod-Alt-8",[q.Quote]:"Mod-Alt-9",[q.ClearFormatting]:"Mod-\\",[q.IncreaseIndent]:"Mod-[",[q.DecreaseIndent]:"Mod-]"},YH={default:XN,googleDoc:GH},ZH=class extends St{get name(){return"nodeViews"}createPlugin(){const t=[],e=pe();for(const n of this.store.extensions){if(!n.createNodeViews)continue;const r=n.createNodeViews();t.unshift(dt(r)?{[n.name]:r}:r)}t.unshift(this.store.managerSettings.nodeViews??{});for(const n of t)Object.assign(e,n);return{props:{nodeViews:e}}}},JH=class extends St{get name(){return"pasteRules"}createExternalPlugins(){return[this.generatePasteRulesPlugin()]}generatePasteRulesPlugin(){var t,e;const n=[];for(const r of this.store.extensions){if((t=this.store.managerSettings.exclude)!=null&&t.pasteRules||!r.createPasteRules||(e=r.options.exclude)!=null&&e.pasteRules)continue;const o=r.createPasteRules(),i=Gt(o)?o:[o];n.push(...i)}return vH(n)}},nx=class extends St{constructor(){super(...arguments),this.plugins=[],this.managerPlugins=[],this.applyStateHandlers=[],this.initStateHandlers=[],this.appendTransactionHandlers=[],this.pluginKeys=pe(),this.stateGetters=new Map,this.getPluginStateCreator=t=>e=>t.getState(e??this.store.getState()),this.getStateByName=t=>{const e=this.stateGetters.get(t);return ve(e,{message:"No plugin exists for the requested extension name."}),e()}}get name(){return"plugins"}onCreate(){const{setStoreKey:t,setExtensionStore:e,managerSettings:n,extensions:r}=this.store;this.updateExtensionStore();const{plugins:o=[]}=n;this.updatePlugins(o,this.managerPlugins);for(const i of r)i.onApplyState&&this.applyStateHandlers.push(i.onApplyState.bind(i)),i.onInitState&&this.initStateHandlers.push(i.onInitState.bind(i)),i.onAppendTransaction&&this.appendTransactionHandlers.push(i.onAppendTransaction.bind(i)),this.extractExtensionPlugins(i);this.managerPlugins=o,this.store.setStoreKey("plugins",this.plugins),t("pluginKeys",this.pluginKeys),t("getPluginState",this.getStateByName),e("getPluginState",this.getStateByName)}createPlugin(){return{appendTransaction:(t,e,n)=>{const r=n.tr,o={previousState:e,tr:r,transactions:t,state:n};for(const i of this.appendTransactionHandlers)i(o);return this.options.appendTransaction(o),r.docChanged||r.steps.length>0||r.selectionSet||r.storedMarksSet?r:void 0},state:{init:(t,e)=>{for(const n of this.initStateHandlers)n(e)},apply:(t,e,n,r)=>{const o={previousState:n,state:r,tr:t};for(const i of this.applyStateHandlers)i(o);this.options.applyState(o)}}}}extractExtensionPlugins(t){var e,n;if(!(!t.createPlugin&&!t.createExternalPlugins||(e=this.store.managerSettings.exclude)!=null&&e.plugins||(n=t.options.exclude)!=null&&n.plugins)){if(t.createPlugin){const o=new Uc(t.name);this.pluginKeys[t.name]=o;const i=this.getPluginStateCreator(o);t.pluginKey=o,t.getPluginState=i,this.stateGetters.set(t.name,i),this.stateGetters.set(t.constructor,i);const s={...t.createPlugin(),key:o},a=new Ti(s);this.updatePlugins([a],t.plugin?[t.plugin]:void 0),t.plugin=a}if(t.createExternalPlugins){const o=t.createExternalPlugins();this.updatePlugins(o,t.externalPlugins),t.externalPlugins=o}}}updatePlugins(t,e){if(!e||As(e)){this.plugins=[...this.plugins,...t];return}if(t.length!==e.length){this.plugins=[...this.plugins.filter(r=>!e.includes(r)),...t];return}const n=new Map;for(const[r,o]of t.entries())n.set(Tt(e,r),o);this.plugins=this.plugins.map(r=>e.includes(r)?n.get(r):r)}updateExtensionStore(){const{setExtensionStore:t}=this.store;t("updatePlugins",this.updatePlugins.bind(this)),t("dispatchPluginUpdate",this.dispatchPluginUpdate.bind(this)),t("updateExtensionPlugins",this.updateExtensionPlugins.bind(this))}updateExtensionPlugins(t){const e=ZN(t)?t:DH(t)?this.store.manager.getExtension(t):this.store.extensions.find(n=>n.name===t);ve(e,{code:K.INVALID_MANAGER_EXTENSION,message:`The extension ${t} does not exist within the editor.`}),this.extractExtensionPlugins(e),this.store.setStoreKey("plugins",this.plugins),this.dispatchPluginUpdate()}dispatchPluginUpdate(){ve(this.store.phase>=qn.EditorView,{code:K.MANAGER_PHASE_ERROR,message:"`dispatchPluginUpdate` should only be called after the view has been added to the manager."});const{view:t,updateState:e}=this.store,n=t.state.reconfigure({plugins:this.plugins});e(n)}};nx=ae([Ze({defaultPriority:at.Highest,handlerKeys:["applyState","appendTransaction"]})],nx);var rx=class extends St{constructor(){super(...arguments),this.dynamicAttributes={marks:pe(),nodes:pe()}}get name(){return"schema"}onCreate(){const{managerSettings:t,tags:e,markNames:n,nodeNames:r,extensions:o}=this.store,{defaultBlockNode:i,disableExtraAttributes:s,nodeOverride:a,markOverride:l}=t,c=m=>!!(m&&e[Ie.Block].includes(m));if(t.schema){const{nodes:m,marks:g}=iW(t.schema);this.addSchema(t.schema,m,g);return}const u=c(i)?{doc:pe(),[i]:pe()}:pe(),d=pe(),f=XH({settings:t,gatheredSchemaAttributes:this.gatherExtraAttributes(o),nodeNames:r,markNames:n,tags:e});for(const m of o){f[m.name]={...f[m.name],...m.options.extraAttributes};const g=s===!0||m.options.disableExtraAttributes===!0||m.constructor.disableExtraAttributes===!0;if(Df(m)){const{spec:y,dynamic:v}=XE({createExtensionSpec:(x,w)=>m.createNodeSpec(x,w),extraAttributes:Tt(f,m.name),override:{...a,...m.options.nodeOverride},ignoreExtraAttributes:g,name:m.constructorName,tags:m.tags});m.spec=y,u[m.name]=y,Object.keys(v).length>0&&(this.dynamicAttributes.nodes[m.name]=v)}if(Ig(m)){const{spec:y,dynamic:v}=XE({createExtensionSpec:(x,w)=>m.createMarkSpec(x,w),extraAttributes:Tt(f,m.name),override:{...l,...m.options.markOverride},ignoreExtraAttributes:g,name:m.constructorName,tags:m.tags??[]});m.spec=y,d[m.name]=y,Object.keys(v).length>0&&(this.dynamicAttributes.marks[m.name]=v)}}const p=new Hz({nodes:u,marks:d,topNode:"doc"});this.addSchema(p,u,d)}createPlugin(){return{appendTransaction:(t,e,n)=>{const{tr:r}=n;return!t.some(i=>i.docChanged)||Object.keys(this.dynamicAttributes.nodes).length===0&&Object.keys(this.dynamicAttributes.marks).length===0?null:(r.doc.descendants((i,s)=>(this.checkAndUpdateDynamicNodes(i,s,r),this.checkAndUpdateDynamicMarks(i,s,r),!0)),r.steps.length>0?r:null)}}}addSchema(t,e,n){this.store.setStoreKey("nodes",e),this.store.setStoreKey("marks",n),this.store.setStoreKey("schema",t),this.store.setExtensionStore("schema",t),this.store.setStoreKey("defaultBlockNode",Ng(t).name);for(const r of Object.values(t.nodes))if(r.name!=="doc"&&(r.isBlock||r.isTextblock))break}checkAndUpdateDynamicNodes(t,e,n){for(const[r,o]of qt(this.dynamicAttributes.nodes))if(t.type.name===r)for(const[i,s]of qt(o)){if(!$s(t.attrs[i]))continue;const a={...t.attrs,[i]:s(t)};n.setNodeMarkup(e,void 0,a),VE(n)}}checkAndUpdateDynamicMarks(t,e,n){for(const[r,o]of qt(this.dynamicAttributes.marks)){const i=Tt(this.store.schema.marks,r),s=t.marks.find(a=>a.type.name===r);if(s)for(const[a,l]of qt(o)){if(!$s(s.attrs[a]))continue;const c=wi(n.doc.resolve(e),i);if(!c)continue;const{from:u,to:d}=c,f=i.create({...s.attrs,[a]:l(s)});n.removeMark(u,d,i).addMark(u,d,f),VE(n)}}}gatherExtraAttributes(t){const e=[];for(const n of t)n.createSchemaAttributes&&e.push(...n.createSchemaAttributes());return e}};rx=ae([Ze({defaultPriority:at.Highest})],rx);function XH(t){const{settings:e,gatheredSchemaAttributes:n,nodeNames:r,markNames:o,tags:i}=t,s=pe();if(e.disableExtraAttributes)return s;const a=[...n,...e.extraAttributes??[]];for(const l of a??[]){const c=eW({identifiers:l.identifiers,nodeNames:r,markNames:o,tags:i});for(const u of c){const d=s[u]??{};s[u]={...d,...l.attributes}}}return s}function QH(t){return el(t)&&Gt(t.tags)}function eW(t){const{identifiers:e,nodeNames:n,markNames:r,tags:o}=t;if(e==="nodes")return n;if(e==="marks")return r;if(e==="all")return[...n,...r];if(Gt(e))return e;ve(QH(e),{code:K.EXTENSION_EXTRA_ATTRIBUTES,message:"Invalid value passed as an identifier when creating `extraAttributes`."});const{tags:i=[],names:s=[],behavior:a="any",excludeNames:l,excludeTags:c,type:u}=e,d=new Set,f=u==="mark"?r:u==="node"?n:[...r,...n],p=g=>f.includes(g)&&!(l!=null&&l.includes(g));for(const g of s)p(g)&&d.add(g);const m=new Map;for(const g of i)if(!(c!=null&&c.includes(g)))for(const y of o[g]){if(!p(y))continue;if(a==="any"){d.add(y);continue}const v=m.get(y)??new Set;v.add(g),m.set(y,v)}for(const[g,y]of m)y.size===i.length&&d.add(g);return[...d]}function XE(t){var e;const{createExtensionSpec:n,extraAttributes:r,ignoreExtraAttributes:o,name:i,tags:s,override:a}=t,l=pe();function c(y,v){l[y]=v}let u=!1;function d(){u=!0}const f=tW(r,o,d,c),p=nW(r,o),m=rW(r,o),g=n({defaults:f,parse:p,dom:m},a);return ve(o||u,{code:K.EXTENSION_SPEC,message:`When creating a node specification you must call the 'defaults', and parse, and 'dom' methods. To avoid this error you can set the static property 'disableExtraAttributes' of '${i}' to 'true'.`}),g.group=[...((e=g.group)==null?void 0:e.split(" "))??[],...s].join(" ")||void 0,{spec:g,dynamic:l}}function Sb(t){return Se(t)||dt(t)?{default:t}:(ve(t,{message:`${XM(t)} is not supported`,code:K.EXTENSION_EXTRA_ATTRIBUTES}),t)}function tW(t,e,n,r){return()=>{n();const o=pe();if(e)return o;for(const[i,s]of qt(t)){let l=Sb(s).default;dt(l)&&(r(i,l),l=null),o[i]=l===void 0?{}:{default:l}}return o}}function nW(t,e){return n=>{const r=pe();if(e)return r;for(const[o,i]of qt(t)){const{parseDOM:s,...a}=Sb(i);if(Fo(n)){if($s(s)){r[o]=n.getAttribute(o)??a.default;continue}if(dt(s)){r[o]=s(n)??a.default;continue}r[o]=n.getAttribute(s)??a.default}}return r}}function rW(t,e){return n=>{const r=pe();if(e)return r;function o(i,s){if(i){if(Se(i)){r[s]=i;return}if(Gt(i)){const[a,l]=i;r[a]=l??n.attrs[s];return}for(const[a,l]of qt(i))r[a]=l}}for(const[i,s]of qt(t)){const{toDOM:a,parseDOM:l}=Sb(s);if($s(a)){const c=Se(l)?l:i;r[c]=n.attrs[i];continue}if(dt(a)){o(a(n.attrs,oW(n)),i);continue}o(a,i)}return r}}function oW(t){return Mg(t)?{node:t}:vV(t)?{mark:t}:{}}function iW(t){const e=pe(),n=pe();for(const[r,o]of Object.entries(t.nodes))e[r]=o.spec;for(const[r,o]of Object.entries(t.marks))n[r]=o.spec;return{nodes:e,marks:n}}var Cc=class extends St{constructor(){super(...arguments),this.onAddCustomHandler=({suggester:t})=>{var e;if(!(!t||(e=this.store.managerSettings.exclude)!=null&&e.suggesters))return UE(this.store.getState(),t)}}get name(){return"suggest"}onCreate(){this.store.setExtensionStore("addSuggester",t=>UE(this.store.getState(),t)),this.store.setExtensionStore("removeSuggester",t=>nV(this.store.getState(),t))}createExternalPlugins(){var t,e;const n=[];for(const r of this.store.extensions){if((t=this.store.managerSettings.exclude)!=null&&t.suggesters)break;if(!r.createSuggesters||(e=r.options.exclude)!=null&&e.suggesters)continue;const o=r.createSuggesters(),i=Gt(o)?o:[o];n.push(...i)}return[rV(...n)]}getSuggestState(t){return hb(t??this.store.getState())}getSuggestMethods(){const{addIgnored:t,clearIgnored:e,removeIgnored:n,ignoreNextExit:r,setMarkRemoved:o,findMatchAtPosition:i,findNextTextSelection:s,setLastChangeFromAppend:a}=this.getSuggestState();return{addIgnored:t,clearIgnored:e,removeIgnored:n,ignoreNextExit:r,setMarkRemoved:o,findMatchAtPosition:i,findNextTextSelection:s,setLastChangeFromAppend:a}}isSuggesterActive(t){var e;return mo(Gt(t)?t:[t],(e=this.getSuggestState().match)==null?void 0:e.suggester.name)}};ae([At()],Cc.prototype,"getSuggestState",1);ae([At()],Cc.prototype,"getSuggestMethods",1);ae([At()],Cc.prototype,"isSuggesterActive",1);Cc=ae([Ze({customHandlerKeys:["suggester"]})],Cc);var ox=class extends St{constructor(){super(...arguments),this.allTags=pe(),this.plainTags=pe(),this.markTags=pe(),this.nodeTags=pe()}get name(){return"tags"}onCreate(){this.resetTags();for(const t of this.store.extensions)this.updateTagForExtension(t);this.store.setStoreKey("tags",this.allTags),this.store.setExtensionStore("tags",this.allTags),this.store.setStoreKey("plainTags",this.plainTags),this.store.setExtensionStore("plainTags",this.plainTags),this.store.setStoreKey("markTags",this.markTags),this.store.setExtensionStore("markTags",this.markTags),this.store.setStoreKey("nodeTags",this.nodeTags),this.store.setExtensionStore("nodeTags",this.nodeTags)}resetTags(){const t=pe(),e=pe(),n=pe(),r=pe();for(const o of wg(Ie))t[o]=[],e[o]=[],n[o]=[],r[o]=[];this.allTags=t,this.plainTags=e,this.markTags=n,this.nodeTags=r}updateTagForExtension(t){var e,n;const r=new Set([...t.tags??[],...((e=t.createTags)==null?void 0:e.call(t))??[],...t.options.extraTags??[],...((n=this.store.managerSettings.extraTags)==null?void 0:n[t.name])??[]]);for(const o of r)ve(sW(o),{code:K.EXTENSION,message:`The tag provided by the extension: ${t.constructorName} is not supported by the editor. To add custom tags you can use the 'mutateTag' method.`}),this.allTags[o].push(t.name),JN(t)&&this.plainTags[o].push(t.name),Ig(t)&&this.markTags[o].push(t.name),Df(t)&&this.nodeTags[o].push(t.name);t.tags=[...r]}};ox=ae([Ze({defaultPriority:at.Highest})],ox);function sW(t){return mo(wg(Ie),t)}var aW=new Uc("remirrorFilePlaceholderPlugin");function lW(){const t=new Ti({key:aW,state:{init(){return{set:Qe.empty,payloads:new Map}},apply(e,{set:n,payloads:r}){n=n.map(e.mapping,e.doc);const o=e.getMeta(t);if(o)if(o.type===0){const i=document.createElement("placeholder"),s=kt.widget(o.pos,i,{id:o.id});n=n.add(e.doc,[s]),r.set(o.id,o.payload)}else o.type===1&&(n=n.remove(n.find(void 0,void 0,i=>i.id===o.id)),r.delete(o.id));return{set:n,payloads:r}}},props:{decorations(e){var n;return((n=t.getState(e))==null?void 0:n.set)??null}}});return t}var cW=class extends St{get name(){return"upload"}createExternalPlugins(){return[lW()]}};function uW(t={}){t={...{exitMarksOnArrowPress:eo.defaultOptions.exitMarksOnArrowPress,excludeBaseKeymap:eo.defaultOptions.excludeBaseKeymap,selectParentNodeOnEscape:eo.defaultOptions.selectParentNodeOnEscape,undoInputRuleOnBackspace:eo.defaultOptions.undoInputRuleOnBackspace,persistentSelectionClass:vo.defaultOptions.persistentSelectionClass},...t};const n=N0(t,["excludeBaseKeymap","selectParentNodeOnEscape","undoInputRuleOnBackspace"]),r=N0(t,["persistentSelectionClass"]);return[new ox,new rx,new LH,new nx,new ex,new JH,new ZH,new Cc,new Fe,new Dr,new eo(n),new hm,new cW,new vo(r)]}var QE=class extends St{get name(){return"meta"}onCreate(){if(this.store.setStoreKey("getCommandMeta",this.getCommandMeta.bind(this)),!!this.options.capture)for(const t of this.store.extensions)this.captureCommands(t),this.captureKeybindings(t)}createPlugin(){return{}}captureCommands(t){const e=t.decoratedCommands??{},n=t.createCommands;for(const r of Object.keys(e)){const o=t[r];t[r]=(...i)=>s=>{var a;const l=o(...i)(s);return s.dispatch&&l&&this.setCommandMeta(s.tr,{type:"command",chain:s.dispatch!==((a=s.view)==null?void 0:a.dispatch),name:r,extension:t.name,decorated:!0}),l}}n&&(t.createCommands=()=>{const r=n();for(const[o,i]of Object.entries(r))r[o]=(...s)=>a=>{var l;const c=i(...s)(a);return a.dispatch&&c&&this.setCommandMeta(a.tr,{type:"command",chain:a.dispatch!==((l=a.view)==null?void 0:l.dispatch),name:o,extension:t.name,decorated:!1}),c};return r})}captureKeybindings(t){}getCommandMeta(t){return t.getMeta(this.pluginKey)??[]}setCommandMeta(t,e){const n=this.getCommandMeta(t);t.setMeta(this.pluginKey,[...n,e])}};QE=ae([Ze({defaultOptions:{capture:Qr.isDevelopment},staticKeys:["capture"],defaultPriority:at.Highest})],QE);var Vp,_u,Hp,Cl,Wi,Wp,Kp,dW=class{constructor(t){Ft(this,Vp,Zh()),Ft(this,_u,void 0),Ft(this,Hp,void 0),Ft(this,Cl,!0),Ft(this,Wi,bg()),Ft(this,Wp,void 0),Ft(this,Kp,void 0),this.getState=()=>this.view.state??this.initialEditorState,this.getPreviousState=()=>this.previousState,this.dispatchTransaction=i=>{var s,a;ve(!this.manager.destroyed,{code:K.MANAGER_PHASE_ERROR,message:"A transaction was dispatched to a manager that has already been destroyed. Please check your set up, or open an issue."}),i=((a=(s=this.props).onDispatchTransaction)==null?void 0:a.call(s,i,this.getState()))??i;const l=this.getState(),{state:c,transactions:u}=l.applyTransaction(i);en(this,Hp,l),this.updateState({state:c,tr:i,transactions:u});const d=this.manager.store.getForcedUpdates(i);As(d)||this.updateViewProps(...d)},this.onChange=(i=pe())=>{var s,a;const l=this.eventListenerProps(i);Q(this,Cl)&&en(this,Cl,!1),(a=(s=this.props).onChange)==null||a.call(s,l)},this.onBlur=i=>{var s,a;const l=this.eventListenerProps();(a=(s=this.props).onBlur)==null||a.call(s,l,i),Q(this,Wi).emit("blur",l,i)},this.onFocus=i=>{var s,a;const l=this.eventListenerProps();(a=(s=this.props).onFocus)==null||a.call(s,l,i),Q(this,Wi).emit("focus",l,i)},this.setContent=(i,{triggerChange:s=!1}={})=>{const{doc:a}=this.manager.createState({content:i}),l=this.getState(),{state:c}=this.getState().applyTransaction(l.tr.replaceRangeWith(0,l.doc.nodeSize-2,a));if(s)return this.updateState({state:c,triggerChange:s});this.view.updateState(c)},this.clearContent=({triggerChange:i=!1}={})=>{this.setContent(this.manager.createEmptyDoc(),{triggerChange:i})},this.createStateFromContent=(i,s)=>this.manager.createState({content:i,selection:s}),this.focus=i=>{this.manager.store.commands.focus(i)},this.blur=i=>{this.manager.store.commands.blur(i)};const{getProps:e,initialEditorState:n,element:r}=t;if(en(this,_u,e),en(this,Kp,n),this.manager.attachFramework(this,this.updateListener.bind(this)),this.manager.view)return;const o=this.createView(n,r);this.manager.addView(o)}get addHandler(){return Q(this,Wp)??en(this,Wp,Q(this,Wi).on.bind(Q(this,Wi)))}get updatableViewProps(){return{attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0}}get firstRender(){return Q(this,Cl)}get props(){return Q(this,_u).call(this)}get previousState(){return this.previousStateOverride??Q(this,Hp)??this.initialEditorState}get manager(){return this.props.manager}get view(){return this.manager.view}get uid(){return Q(this,Vp)}get initialEditorState(){return Q(this,Kp)}updateListener(t){const{state:e,tr:n}=t;return Q(this,Wi).emit("updated",this.eventListenerProps({state:e,tr:n}))}update(t){const{getProps:e}=t;return en(this,_u,e),this}updateViewProps(...t){const e=N0(this.updatableViewProps,t);this.view.setProps({...this.view.props,...e})}getAttributes(t){var e;const{attributes:n,autoFocus:r,classNames:o=[],label:i,editable:s}=this.props,a=(e=this.manager.store)==null?void 0:e.attributes,l=dt(n)?n(this.eventListenerProps()):n;let c={};(r||mr(r))&&(c=t?{autoFocus:!0}:{autofocus:"true"});const u=Gd(Q0(t&&"Prosemirror","remirror-editor",a==null?void 0:a.class,...o).split(" ")).join(" "),d={role:"textbox",...c,"aria-multiline":"true",...s??!0?{}:{"aria-readonly":"true"},"aria-label":i??"",...a,class:u};return xz({...d,...l})}addFocusListeners(){this.view.dom.addEventListener("blur",this.onBlur),this.view.dom.addEventListener("focus",this.onFocus)}removeFocusListeners(){this.view.dom.removeEventListener("blur",this.onBlur),this.view.dom.removeEventListener("focus",this.onFocus)}destroy(){Q(this,Wi).emit("destroy"),this.view&&this.removeFocusListeners()}eventListenerProps(t=pe()){const{state:e,tr:n,transactions:r}=t;return{tr:n,transactions:r,internalUpdate:!n,view:this.view,firstRender:Q(this,Cl),state:e??this.getState(),createStateFromContent:this.createStateFromContent,previousState:this.previousState,helpers:this.manager.store.helpers}}get baseOutput(){return{manager:this.manager,...this.manager.store,addHandler:this.addHandler,focus:this.focus,blur:this.blur,uid:Q(this,Vp),view:this.view,getState:this.getState,getPreviousState:this.getPreviousState,getExtension:this.manager.getExtension.bind(this.manager),hasExtension:this.manager.hasExtension.bind(this.manager),clearContent:this.clearContent,setContent:this.setContent}}};Vp=new WeakMap;_u=new WeakMap;Hp=new WeakMap;Cl=new WeakMap;Wi=new WeakMap;Wp=new WeakMap;Kp=new WeakMap;function fW(t,e){const n=[],r=new WeakMap,o=[],i=new WeakMap;let s=[];const a={duplicateMap:i,parentExtensions:o,gatheredExtensions:s,settings:e};for(const d of t)QN(a,{extension:d});s=za(s,(d,f)=>f.priority-d.priority);const l=new WeakSet,c=new Set;for(const d of s){const f=d.constructor,p=d.name,m=i.get(f);ve(m,{message:`No entries were found for the ExtensionConstructor ${d.name}`,code:K.INTERNAL}),!(l.has(f)||c.has(p))&&(l.add(f),c.add(p),n.push(d),r.set(f,d),m.forEach(g=>g==null?void 0:g.replaceChildExtension(f,d)))}const u=[];for(const d of n)pW({extension:d,found:l,missing:u});return ve(As(u),{code:K.MISSING_REQUIRED_EXTENSION,message:u.map(({Constructor:d,extension:f})=>`The extension '${f.name}' requires '${d.name} in order to run correctly.`).join(`
217
- `)}),{extensions:n,extensionMap:r}}function QN(t,e){var n;const{gatheredExtensions:r,duplicateMap:o,parentExtensions:i,settings:s}=t,{extension:a,parentExtension:l}=e;let{names:c=[]}=e;ve(ZN(a),{code:K.INVALID_MANAGER_EXTENSION,message:`An invalid extension: ${a} was provided to the [[\`RemirrorManager\`]].`});const u=a.extensions;if(a.setPriority((n=s.priority)==null?void 0:n[a.name]),r.push(a),hW({duplicateMap:o,extension:a,parentExtension:l}),u.length!==0){if(c.includes(a.name)){`${c.join(" > ")}${a.name}`;return}c=[...c,a.name],i.push(a);for(const d of u)QN(t,{names:c,extension:d,parentExtension:a})}}function pW(t){const{extension:e,found:n,missing:r}=t;if(e.requiredExtensions)for(const o of e.requiredExtensions??[])n.has(o)||r.push({Constructor:o,extension:e})}function hW(t){const{duplicateMap:e,extension:n,parentExtension:r}=t,o=n.constructor,i=e.get(o),s=r?[r]:[];e.set(o,i?[...i,...s]:s)}function mW(t){var e,n,r,o;const{extension:i,nodeNames:s,markNames:a,plainNames:l,store:c,handlers:u}=t;i.setStore(c);const d=(e=i.onCreate)==null?void 0:e.bind(i),f=(n=i.onView)==null?void 0:n.bind(i),p=(r=i.onStateUpdate)==null?void 0:r.bind(i),m=(o=i.onDestroy)==null?void 0:o.bind(i);d&&u.create.push(d),f&&u.view.push(f),p&&u.update.push(p),m&&u.destroy.push(m),Ig(i)&&a.push(i.name),Df(i)&&i.name!=="doc"&&s.push(i.name),JN(i)&&l.push(i.name)}var Ki,Cu,Wr,Yo,Tu,rr,Js,Ou,Xs,Mu,Qs,Kr,Ru,qp=class{constructor(t,e={}){Ft(this,Ki,void 0),Ft(this,Cu,pe()),Ft(this,Wr,pe()),Ft(this,Yo,void 0),Ft(this,Tu,void 0),Ft(this,rr,qn.None),Ft(this,Js,void 0),Ft(this,Ou,!0),Ft(this,Xs,{create:[],view:[],update:[],destroy:[]}),Ft(this,Mu,[]),Ft(this,Qs,bg()),Ft(this,Kr,void 0),Ft(this,Ru,void 0),this.getState=()=>{var o;return Q(this,rr)>=qn.EditorView?this.view.state:(ve(Q(this,Kr),{code:K.MANAGER_PHASE_ERROR,message:"`getState` can only be called after the `Framework` or the `EditorView` has been added to the manager`. Check your plugins to make sure that the decorations callback uses the state argument."}),(o=Q(this,Kr))==null?void 0:o.initialEditorState)},this.updateState=o=>{const i=this.getState();this.view.updateState(o),this.onStateUpdate({previousState:i,state:o})};const{extensions:n,extensionMap:r}=fW(t,e);en(this,Js,e),en(this,Yo,pa(n)),en(this,Tu,r),en(this,Ki,this.createExtensionStore()),en(this,rr,qn.Create),this.setupLifecycleHandlers();for(const o of Q(this,Xs).create){const i=o();i&&Q(this,Mu).push(i)}}static create(t,e={}){return new qp([...rR(t),...uW(e.builtin)],e)}get[bi](){return an.Manager}get destroyed(){return Q(this,rr)===qn.Destroy}get mounted(){return Q(this,rr)>=qn.EditorView&&Q(this,rr)<qn.Destroy}get output(){var t;return(t=Q(this,Kr))==null?void 0:t.frameworkOutput}get frameworkAttached(){return!!Q(this,Kr)}get extensions(){return Q(this,Yo)}get stringHandlers(){return Q(this,Cu)}get store(){return pa(Q(this,Wr))}get extensionStore(){return pa(Q(this,Ki))}get tr(){return this.getExtension(Fe).transaction}get nodes(){return Q(this,Wr).nodes}get marks(){return Q(this,Wr).marks}get schema(){return Q(this,Wr).schema}get extensionTags(){return Q(this,Wr).tags}get view(){return Q(this,Wr).view}get settings(){return Q(this,Js)}get document(){return Q(this,Js).document??Pg()}setupLifecycleHandlers(){const t=Q(this,Ki),e=Q(this,Xs),n=[],r=[],o=[];t.nodeNames=n,t.markNames=r,t.plainNames=o;for(const i of Q(this,Yo))mW({extension:i,nodeNames:n,markNames:r,plainNames:o,handlers:e,store:t})}setStringHandler(t,e){Q(this,Cu)[t]=e}setStoreKey(t,e){Q(this,Wr)[t]=e}getStoreKey(t){const e=Q(this,Wr)[t];return ve(!$s(e),{code:K.MANAGER_PHASE_ERROR,message:"`getStoreKey` should not be called before the values are available."}),e}setExtensionStore(t,e){ve(Q(this,rr)<=qn.EditorView,{code:K.MANAGER_PHASE_ERROR,message:"`setExtensionStore` should only be called during the `onCreate` lifecycle hook. Make sure to only call it within the returned methods."}),Q(this,Ki)[t]=e}createExtensionStore(){const t=pe(),e=!0;let n,r;return Object.defineProperties(t,{extensions:{get:()=>Q(this,Yo),enumerable:e},phase:{get:()=>Q(this,rr),enumerable:e},view:{get:()=>this.view,enumerable:e},managerSettings:{get:()=>pa(Q(this,Js)),enumerable:e},getState:{value:this.getState,enumerable:e},updateState:{value:this.updateState,enumerable:e},isMounted:{value:()=>this.mounted,enumerable:e},getExtension:{value:this.getExtension.bind(this),enumerable:e},manager:{get:()=>this,enumerable:e},document:{get:()=>this.document,enumerable:e},stringHandlers:{get:()=>Q(this,Cu),enumerable:e},currentState:{get:()=>n??(n=this.getState()),set:o=>{n=o},enumerable:e},previousState:{get:()=>r,set:o=>{r=o},enumerable:e}}),t.getStoreKey=this.getStoreKey.bind(this),t.setStoreKey=this.setStoreKey.bind(this),t.setExtensionStore=this.setExtensionStore.bind(this),t.setStringHandler=this.setStringHandler.bind(this),t}addView(t){if(Q(this,rr)>=qn.EditorView)return this;en(this,Ou,!0),en(this,rr,qn.EditorView),Q(this,Wr).view=t;for(const e of Q(this,Xs).view){const n=e(t);n&&Q(this,Mu).push(n)}return this}attachFramework(t,e){var n;Q(this,Kr)!==t&&(Q(this,Kr)&&(Q(this,Kr).destroy(),(n=Q(this,Ru))==null||n.call(this)),en(this,Kr,t),en(this,Ru,this.addHandler("stateUpdate",e)))}createEmptyDoc(){var t;const e=(t=this.schema.nodes.doc)==null?void 0:t.createAndFill();return ve(e,{code:K.INVALID_CONTENT,message:"An empty node could not be created due to an invalid schema."}),e}createState(t={}){const{onError:e,defaultSelection:n="end"}=this.settings,{content:r=this.createEmptyDoc(),selection:o=n,stringHandler:i=this.settings.stringHandler}=t,{schema:s,plugins:a}=this.store,l=NN({stringHandler:Se(i)?this.stringHandlers[i]:i,document:this.document,content:r,onError:e,schema:s,selection:o});return ha.create({schema:s,doc:l,plugins:a,selection:Ir(o,l)})}addHandler(t,e){return Q(this,Qs).on(t,e)}onStateUpdate(t){const e=Q(this,Ou);Q(this,Ki).currentState=t.state,Q(this,Ki).previousState=t.previousState,e&&(en(this,rr,qn.Runtime),en(this,Ou,!1));const n={...t,firstUpdate:e};for(const r of Q(this,Xs).update)r(n);Q(this,Qs).emit("stateUpdate",n)}getExtension(t){const e=Q(this,Tu).get(t);return ve(e,{code:K.INVALID_MANAGER_EXTENSION,message:`'${t.name}' doesn't exist within this manager. Make sure it is properly added before attempting to use it.`}),e}hasExtension(t){return!!Q(this,Tu).get(t)}clone(){const t=Q(this,Yo).map(n=>n.clone(n.options)),e=qp.create(()=>t,Q(this,Js));return Q(this,Qs).emit("clone",e),e}recreate(t=[],e={}){const n=Q(this,Yo).map(o=>o.clone(o.initialOptions)),r=qp.create(()=>[...n,...t],e);return Q(this,Qs).emit("recreate",r),r}destroy(){var t,e,n,r,o,i;en(this,rr,qn.Destroy);for(const s of((t=this.view)==null?void 0:t.state.plugins)??[])(n=(e=s.getState(this.view.state))==null?void 0:e.destroy)==null||n.call(e);(r=Q(this,Kr))==null||r.destroy(),(o=Q(this,Ru))==null||o.call(this);for(const s of Q(this,Mu))s();for(const s of Q(this,Xs).destroy)s();(i=this.view)==null||i.destroy(),Q(this,Qs).emit("destroy")}includes(t){const e=[],n=[];for(const r of Q(this,Yo))e.push(r.name,r.constructorName),n.push(r.constructor);return t.every(r=>Se(r)?mo(e,r):mo(n,r))}},gW=qp;Ki=new WeakMap;Cu=new WeakMap;Wr=new WeakMap;Yo=new WeakMap;Tu=new WeakMap;rr=new WeakMap;Js=new WeakMap;Ou=new WeakMap;Xs=new WeakMap;Mu=new WeakMap;Qs=new WeakMap;Kr=new WeakMap;Ru=new WeakMap;function vW(t,e){return!Vc(t)||!Hc(t,an.Manager)?!1:e?t.includes(e):!0}var yW=Object.defineProperty,xW=Object.getOwnPropertyDescriptor,bW=(t,e,n,r)=>{for(var o=r>1?void 0:r?xW(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&yW(e,n,o),o},eP=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},de=(t,e,n)=>(eP(t,e,"read from private field"),n?n.call(t):e.get(t)),or=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},nr=(t,e,n,r)=>(eP(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Nu,wW=class{constructor(){this.portals=new Map,or(this,Nu,bg()),this.on=t=>de(this,Nu).on("update",t),this.once=t=>{const e=de(this,Nu).on("update",n=>{e(),t(n)});return e}}update(){de(this,Nu).emit("update",this.portals)}render({Component:t,container:e}){const n=this.portals.get(e);this.portals.set(e,{Component:t,key:(n==null?void 0:n.key)??Zh()}),this.update()}forceUpdate(){for(const[t,{Component:e}]of this.portals)this.portals.set(t,{Component:e,key:Zh()})}remove(t){this.portals.delete(t),this.update()}};Nu=new WeakMap;var kW=t=>{const{portals:e}=t;return oe.createElement(oe.Fragment,null,e.map(([n,{Component:r,key:o}])=>Vo.createPortal(oe.createElement(r,null),n,o)))};function SW(t){const[e,n]=h.useState(()=>Array.from(t.portals.entries()));return h.useEffect(()=>t.on(r=>{n(Array.from(r.entries()))}),[t]),h.useMemo(()=>e,[e])}var Et,Pu,ea,$u,Gp,Au,Tl,Iu,Yp,Zo,Nn,ix,tP=class{constructor({getPosition:t,node:e,portalContainer:n,view:r,ReactComponent:o,options:i}){or(this,Et,void 0),or(this,Pu,[]),or(this,ea,void 0),or(this,$u,void 0),or(this,Gp,void 0),or(this,Au,void 0),or(this,Tl,void 0),or(this,Iu,!1),or(this,Yp,void 0),or(this,Zo,void 0),or(this,Nn,void 0),or(this,ix,l=>{l&&(ve(de(this,Zo),{code:K.REACT_NODE_VIEW,message:`You have applied a ref to a node view provided for '${de(this,Et).type.name}' which doesn't support content.`}),l.append(de(this,Zo)))}),this.Component=()=>{const l=de(this,Gp);return ve(l,{code:K.REACT_NODE_VIEW,message:`The custom react node view provided for ${de(this,Et).type.name} doesn't have a valid ReactComponent`}),oe.createElement(l,{updateAttributes:this.updateAttributes,selected:this.selected,view:de(this,ea),getPosition:de(this,Au),node:de(this,Et),forwardRef:de(this,ix),decorations:de(this,Pu)})},this.updateAttributes=l=>{if(!de(this,ea).editable)return;const c=de(this,Au).call(this);if(c==null)return;const u=de(this,ea).state.tr.setNodeMarkup(c,void 0,{...de(this,Et).attrs,...l});de(this,ea).dispatch(u)},ve(dt(t),{message:"You are attempting to use a node view for a mark type. This is not supported yet. Please check your configuration."}),nr(this,Et,e),nr(this,ea,r),nr(this,$u,n),nr(this,Gp,o),nr(this,Au,t),nr(this,Tl,i),nr(this,Nn,this.createDom());const{contentDOM:s,wrapper:a}=this.createContentDom()??{};nr(this,Yp,s??void 0),nr(this,Zo,a),de(this,Zo)&&de(this,Nn).append(de(this,Zo)),this.setDomAttributes(de(this,Et),de(this,Nn)),this.Component.displayName=ZM(`${de(this,Et).type.name}NodeView`),this.renderComponent()}static create(t){const{portalContainer:e,ReactComponent:n,options:r}=t;return(o,i,s)=>new tP({options:r,node:o,view:i,getPosition:s,portalContainer:e,ReactComponent:n})}get selected(){return de(this,Iu)}get contentDOM(){return de(this,Yp)}get dom(){return de(this,Nn)}renderComponent(){de(this,$u).render({Component:this.Component,container:de(this,Nn)})}createDom(){const{defaultBlockNode:t,defaultInlineNode:e}=de(this,Tl),n=de(this,Et).isInline?document.createElement(e):document.createElement(t);return n.classList.add(`${DS(de(this,Et).type.name)}-node-view-wrapper`),n}createContentDom(){var t,e;if(de(this,Et).isLeaf)return;const n=(e=(t=de(this,Et).type.spec).toDOM)==null?void 0:e.call(t,de(this,Et));if(!n)return;const{contentDOM:r,dom:o}=ro.renderSpec(document,n);let i;if(Fo(o))return i=o,o===r&&(i=document.createElement("span"),i.classList.add(`${DS(de(this,Et).type.name)}-node-view-content-wrapper`),i.append(r)),Fo(r),{wrapper:i,contentDOM:r}}update(t,e){return gb({types:de(this,Et).type,node:t})?(de(this,Et)===t&&de(this,Pu)===e||(de(this,Et).sameMarkup(t)||this.setDomAttributes(t,de(this,Nn)),nr(this,Et,t),nr(this,Pu,e),this.renderComponent()),!0):!1}setDomAttributes(t,e){const{toDOM:n}=de(this,Et).type.spec;let r=t.attrs;if(n){const o=n(t);if(Se(o)||EW(o))return;el(o[1])&&(r=o[1])}for(const[o,i]of qt(r))e.setAttribute(o,i)}selectNode(){nr(this,Iu,!0),de(this,Nn)&&de(this,Nn).classList.add(PS),this.renderComponent()}deselectNode(){nr(this,Iu,!1),de(this,Nn)&&de(this,Nn).classList.remove(PS),this.renderComponent()}destroy(){de(this,$u).remove(de(this,Nn))}ignoreMutation(t){return t.type==="selection"?!de(this,Et).type.spec.selectable:de(this,Zo)?!de(this,Zo).contains(t.target):!0}stopEvent(t){var e;if(!de(this,Nn))return!1;if(dt(de(this,Tl).stopEvent))return de(this,Tl).stopEvent({event:t});const n=t.target;if(!(de(this,Nn).contains(n)&&!((e=this.contentDOM)!=null&&e.contains(n))))return!1;const o=t.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!o)return!0;const s=!!de(this,Et).type.spec.draggable,a=ye.isSelectable(de(this,Et)),l=t.type==="copy",c=t.type==="paste",u=t.type==="cut",d=t.type==="mousedown",f=t.type.startsWith("drag");return!s&&a&&f&&t.preventDefault(),!(f||o||l||c||u||d&&a)}},e_=tP;Et=new WeakMap;Pu=new WeakMap;ea=new WeakMap;$u=new WeakMap;Gp=new WeakMap;Au=new WeakMap;Tl=new WeakMap;Iu=new WeakMap;Yp=new WeakMap;Zo=new WeakMap;Nn=new WeakMap;ix=new WeakMap;function EW(t){return Z0(t)||el(t)&&Z0(t.dom)}var rf=class extends St{constructor(){super(...arguments),this.portalContainer=new wW}get name(){return"reactComponent"}onCreate(){this.store.setStoreKey("portalContainer",this.portalContainer)}createNodeViews(){const t=pe(),e=this.store.managerSettings.nodeViewComponents??{};for(const r of this.store.extensions)!r.ReactComponent||!Df(r)||r.reactComponentEnvironment==="ssr"||(t[r.name]=e_.create({options:this.options,ReactComponent:r.ReactComponent,portalContainer:this.portalContainer}));const n=qt({...this.options.nodeViewComponents,...e});for(const[r,o]of n)t[r]=e_.create({options:this.options,ReactComponent:o,portalContainer:this.portalContainer});return t}};rf=bW([Ze({defaultOptions:{defaultBlockNode:"div",defaultInlineNode:"span",defaultContentNode:"span",defaultEnvironment:"both",nodeViewComponents:{},stopEvent:null},staticKeys:["defaultBlockNode","defaultInlineNode","defaultContentNode","defaultEnvironment"]})],rf);function _W(t){const e=h.createContext(null),n=CW(e);return[o=>{const i=t(o);return oe.createElement(e.Provider,{value:i},o.children)},n,e]}function CW(t){return(e,n)=>{const r=h.useContext(t),o=TW(r);if(!r)throw new Error("`useContextHook` must be placed inside the `Provider` returned by the `createContextState` method");if(!e)return r;if(typeof e!="function")throw new TypeError("invalid arguments passed to `useContextHook`. This hook must be called with zero arguments, a getter function or a path string.");const i=e(r);if(!o||!n)return i;const s=e(o);return n(s,i)?s:i}}function TW(t){const e=h.useRef();return OW(()=>{e.current=t}),e.current}var OW=typeof document<"u"?h.useLayoutEffect:h.useEffect;function MW(t,e){return _W(n=>{const r=h.useRef(null),o=h.useRef(),i=e==null?void 0:e(n),[s,a]=h.useState(()=>t({get:t_(r),set:n_(o),previousContext:void 0,props:n,state:i})),l=[...Object.values(n),i];return h.useEffect(()=>{l.length!==0&&a(c=>t({get:t_(r),set:n_(o),previousContext:c,props:n,state:i}))},l),r.current=s,o.current=a,s})}function t_(t){return e=>{if(!t.current)throw new Error("`get` called outside of function scope. `get` can only be called within a function.");if(!e)return t.current;if(typeof e!="function")throw new TypeError("Invalid arguments passed to `useContextHook`. The hook must be called with zero arguments, a getter function or a path string.");return e(t.current)}}function n_(t){return e=>{if(!t.current)throw new Error("`set` called outside of function scope. `set` can only be called within a function.");t.current(n=>({...n,...typeof e=="function"?e(n):e}))}}var nP={},rP={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.errorMessages=t.ErrorType=void 0;var e;(function(n){n.MalformedUnicode="MALFORMED_UNICODE",n.MalformedHexadecimal="MALFORMED_HEXADECIMAL",n.CodePointLimit="CODE_POINT_LIMIT",n.OctalDeprecation="OCTAL_DEPRECATION",n.EndOfString="END_OF_STRING"})(e=t.ErrorType||(t.ErrorType={})),t.errorMessages=new Map([[e.MalformedUnicode,"malformed Unicode character escape sequence"],[e.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[e.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[e.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[e.EndOfString,"malformed escape sequence at end of string"]])})(rP);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.unraw=t.errorMessages=t.ErrorType=void 0;const e=rP;Object.defineProperty(t,"ErrorType",{enumerable:!0,get:function(){return e.ErrorType}}),Object.defineProperty(t,"errorMessages",{enumerable:!0,get:function(){return e.errorMessages}});function n(p){return!p.match(/[^a-f0-9]/i)?parseInt(p,16):NaN}function r(p,m,g){const y=n(p);if(Number.isNaN(y)||g!==void 0&&g!==p.length)throw new SyntaxError(e.errorMessages.get(m));return y}function o(p){const m=r(p,e.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(m)}function i(p,m){const g=r(p,e.ErrorType.MalformedUnicode,4);if(m!==void 0){const y=r(m,e.ErrorType.MalformedUnicode,4);return String.fromCharCode(g,y)}return String.fromCharCode(g)}function s(p){return p.charAt(0)==="{"&&p.charAt(p.length-1)==="}"}function a(p){if(!s(p))throw new SyntaxError(e.errorMessages.get(e.ErrorType.MalformedUnicode));const m=p.slice(1,-1),g=r(m,e.ErrorType.MalformedUnicode);try{return String.fromCodePoint(g)}catch(y){throw y instanceof RangeError?new SyntaxError(e.errorMessages.get(e.ErrorType.CodePointLimit)):y}}function l(p,m=!1){if(m)throw new SyntaxError(e.errorMessages.get(e.ErrorType.OctalDeprecation));const g=parseInt(p,8);return String.fromCharCode(g)}const c=new Map([["b","\b"],["f","\f"],["n",`
218
- `],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function u(p){return c.get(p)||p}const d=/\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;function f(p,m=!1){return p.replace(d,function(g,y,v,x,w,S,_,k,E){if(y!==void 0)return"\\";if(v!==void 0)return o(v);if(x!==void 0)return a(x);if(w!==void 0)return i(w,S);if(_!==void 0)return i(_);if(k==="0")return"\0";if(k!==void 0)return l(k,!m);if(E!==void 0)return u(E);throw new SyntaxError(e.errorMessages.get(e.ErrorType.EndOfString))})}t.unraw=f,t.default=f})(nP);const RW=ki(nP),Ta=t=>typeof t=="string",NW=t=>typeof t=="function",r_=new Map,oP="en";function Eb(t){return[...Array.isArray(t)?t:[t],oP]}function iP(t,e,n){const r=Eb(t);return mm(()=>gm("date",r,n),()=>new Intl.DateTimeFormat(r,n)).format(Ta(e)?new Date(e):e)}function sx(t,e,n){const r=Eb(t);return mm(()=>gm("number",r,n),()=>new Intl.NumberFormat(r,n)).format(e)}function o_(t,e,n,{offset:r=0,...o}){const i=Eb(t),s=e?mm(()=>gm("plural-ordinal",i),()=>new Intl.PluralRules(i,{type:"ordinal"})):mm(()=>gm("plural-cardinal",i),()=>new Intl.PluralRules(i,{type:"cardinal"}));return o[n]??o[s.select(n-r)]??o.other}function mm(t,e){const n=t();let r=r_.get(n);return r||(r=e(),r_.set(n,r)),r}function gm(t,e,n){const r=e.join("-");return`${t}-${r}-${JSON.stringify(n)}`}const sP=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g,PW=(t,e,n={})=>{const r=e||t,o=s=>typeof s=="object"?s:n[s]||{style:s},i=(s,a)=>{const l=Object.keys(n).length?o("number"):void 0,c=sx(r,s,l);return a.replace("#",c)};return{plural:(s,a)=>{const{offset:l=0}=a,c=o_(r,!1,s,a);return i(s-l,c)},selectordinal:(s,a)=>{const{offset:l=0}=a,c=o_(r,!0,s,a);return i(s-l,c)},select:$W,number:(s,a)=>sx(r,s,o(a)),date:(s,a)=>iP(r,s,o(a)),undefined:AW}},$W=(t,e)=>e[t]??e.other,AW=t=>t;function IW(t,e,n){return(r={},o)=>{const i=PW(e,n,o),s=l=>Array.isArray(l)?l.reduce((c,u)=>{if(Ta(u))return c+u;const[d,f,p]=u;let m={};p!=null&&typeof p=="object"?Object.entries(p).forEach(([v,x])=>{m[v]=s(x)}):m=p;const g=i[f],y=g(r[d],m);return y==null?c:c+y},""):l,a=s(t);return Ta(a)&&sP.test(a)?RW(a.trim()):Ta(a)?a.trim():a?String(a):""}}var DW=Object.defineProperty,LW=(t,e,n)=>e in t?DW(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,jW=(t,e,n)=>(LW(t,typeof e!="symbol"?e+"":e,n),n);class zW{constructor(){jW(this,"_events",{})}on(e,n){var r;return(r=this._events)[e]??(r[e]=[]),this._events[e].push(n),()=>this.removeListener(e,n)}removeListener(e,n){const r=this._getListeners(e);if(!r)return;const o=r.indexOf(n);~o&&r.splice(o,1)}emit(e,...n){const r=this._getListeners(e);r&&r.map(o=>o.apply(this,n))}_getListeners(e){const n=this._events[e];return Array.isArray(n)?n:!1}}var FW=Object.defineProperty,BW=(t,e,n)=>e in t?FW(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,yl=(t,e,n)=>(BW(t,typeof e!="symbol"?e+"":e,n),n);class UW extends zW{constructor(e){super(),yl(this,"_locale",""),yl(this,"_locales"),yl(this,"_localeData",{}),yl(this,"_messages",{}),yl(this,"_missing"),yl(this,"t",this._.bind(this)),e.missing!=null&&(this._missing=e.missing),e.messages!=null&&this.load(e.messages),e.localeData!=null&&this.loadLocaleData(e.localeData),(typeof e.locale=="string"||e.locales)&&this.activate(e.locale??oP,e.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}get localeData(){return this._localeData[this._locale]??{}}_loadLocaleData(e,n){const r=this._localeData[e];r?Object.assign(r,n):this._localeData[e]=n}loadLocaleData(e,n){n!=null?this._loadLocaleData(e,n):Object.keys(e).forEach(r=>this._loadLocaleData(r,e[r])),this.emit("change")}_load(e,n){const r=this._messages[e];r?Object.assign(r,n):this._messages[e]=n}load(e,n){typeof e=="string"&&typeof n=="object"?this._load(e,n):Object.entries(e).forEach(([r,o])=>this._load(r,o)),this.emit("change")}loadAndActivate({locale:e,locales:n,messages:r}){this._locale=e,this._locales=n||void 0,this._messages[this._locale]=r,this.emit("change")}activate(e,n){this._locale=e,this._locales=n,this.emit("change")}_(e,n,r){let o=r==null?void 0:r.message;Ta(e)||(n=e.values||n,o=e.message,e=e.id);const i=this.messages[e],s=i===void 0,a=this._missing;if(a&&s)return NW(a)?a(this._locale,e):a;s&&this.emit("missing",{id:e,locale:this._locale});let l=i||o||e;return Ta(l)&&sP.test(l)?JSON.parse(`"${l}"`):Ta(l)?l:IW(l,this._locale,this._locales)(n,r==null?void 0:r.formats)}date(e,n){return iP(this._locales||this._locale,e,n)}number(e,n){return sx(this._locales||this._locale,e,n)}}function VW(t={}){return new UW(t)}const Dg=VW();function Y(t,e){return e?"other":t==1?"one":"other"}function Oi(t,e){return e?"other":t==0||t==1?"one":"other"}function tr(t,e){var n=String(t).split("."),r=!n[1];return e?"other":t==1&&r?"one":"other"}function ot(t,e){return"other"}function Hs(t,e){return e?"other":t==1?"one":t==2?"two":"other"}const HW=ot,WW=Y,KW=Oi;function qW(t,e){return e?"other":t>=0&&t<=1?"one":"other"}const GW=Y;function YW(t,e){var n=String(t).split("."),r=Number(n[0])==t,o=r&&n[0].slice(-2);return e?"other":t==0?"zero":t==1?"one":t==2?"two":o>=3&&o<=10?"few":o>=11&&o<=99?"many":"other"}function ZW(t,e){var n=String(t).split("."),r=Number(n[0])==t,o=r&&n[0].slice(-2);return e?"other":t==0?"zero":t==1?"one":t==2?"two":o>=3&&o<=10?"few":o>=11&&o<=99?"many":"other"}function JW(t,e){return e?t==1||t==5||t==7||t==8||t==9||t==10?"one":t==2||t==3?"two":t==4?"few":t==6?"many":"other":t>=0&&t<=1?"one":"other"}const XW=Y,QW=tr;function eK(t,e){var n=String(t).split("."),r=n[0],o=r.slice(-1),i=r.slice(-2),s=r.slice(-3);return e?o==1||o==2||o==5||o==7||o==8||i==20||i==50||i==70||i==80?"one":o==3||o==4||s==100||s==200||s==300||s==400||s==500||s==600||s==700||s==800||s==900?"few":r==0||o==6||i==40||i==60||i==90?"many":"other":t==1?"one":"other"}function tK(t,e){var n=String(t).split("."),r=Number(n[0])==t,o=r&&n[0].slice(-1),i=r&&n[0].slice(-2);return e?(o==2||o==3)&&i!=12&&i!=13?"few":"other":o==1&&i!=11?"one":o>=2&&o<=4&&(i<12||i>14)?"few":r&&o==0||o>=5&&o<=9||i>=11&&i<=14?"many":"other"}const nK=Y,rK=Y,oK=Y,iK=Oi,sK=ot;function aK(t,e){return e?t==1||t==5||t==7||t==8||t==9||t==10?"one":t==2||t==3?"two":t==4?"few":t==6?"many":"other":t>=0&&t<=1?"one":"other"}const lK=ot;function cK(t,e){var n=String(t).split("."),r=Number(n[0])==t,o=r&&n[0].slice(-1),i=r&&n[0].slice(-2),s=r&&n[0].slice(-6);return e?"other":o==1&&i!=11&&i!=71&&i!=91?"one":o==2&&i!=12&&i!=72&&i!=92?"two":(o==3||o==4||o==9)&&(i<10||i>19)&&(i<70||i>79)&&(i<90||i>99)?"few":t!=0&&r&&s==0?"many":"other"}const uK=Y;function dK(t,e){var n=String(t).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=r.slice(-2),l=o.slice(-1),c=o.slice(-2);return e?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function fK(t,e){var n=String(t).split("."),r=!n[1];return e?t==1||t==3?"one":t==2?"two":t==4?"few":"other":t==1&&r?"one":"other"}const pK=Y;function hK(t,e){var n=String(t).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=o.slice(-1);return e?"other":i&&(r==1||r==2||r==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const mK=Y,gK=Y,vK=Y;function yK(t,e){var n=String(t).split("."),r=n[0],o=!n[1];return e?"other":t==1&&o?"one":r>=2&&r<=4&&o?"few":o?"other":"many"}function xK(t,e){return e?t==0||t==7||t==8||t==9?"zero":t==1?"one":t==2?"two":t==3||t==4?"few":t==5||t==6?"many":"other":t==0?"zero":t==1?"one":t==2?"two":t==3?"few":t==6?"many":"other"}function bK(t,e){var n=String(t).split("."),r=n[0],o=Number(n[0])==t;return e?"other":t==1||!o&&(r==0||r==1)?"one":"other"}const wK=tr;function kK(t,e){var n=String(t).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-2),a=o.slice(-2);return e?"other":i&&s==1||a==1?"one":i&&s==2||a==2?"two":i&&(s==3||s==4)||a==3||a==4?"few":"other"}const SK=Y,EK=ot,_K=Y,CK=Y;function TK(t,e){var n=String(t).split("."),r=!n[1],o=Number(n[0])==t,i=o&&n[0].slice(-1),s=o&&n[0].slice(-2);return e?i==1&&s!=11?"one":i==2&&s!=12?"two":i==3&&s!=13?"few":"other":t==1&&r?"one":"other"}const OK=Y,MK=Y,RK=tr,NK=Y;function PK(t,e){return e?"other":t>=0&&t<=1?"one":"other"}function $K(t,e){return e?"other":t>=0&&t<2?"one":"other"}const AK=tr;function IK(t,e){var n=String(t).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=o.slice(-1);return e?t==1?"one":"other":i&&(r==1||r==2||r==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const DK=Y;function LK(t,e){return e?t==1?"one":"other":t>=0&&t<2?"one":"other"}const jK=Y,zK=tr;function FK(t,e){var n=String(t).split("."),r=Number(n[0])==t;return e?t==1?"one":"other":t==1?"one":t==2?"two":r&&t>=3&&t<=6?"few":r&&t>=7&&t<=10?"many":"other"}function BK(t,e){var n=String(t).split("."),r=Number(n[0])==t;return e?t==1||t==11?"one":t==2||t==12?"two":t==3||t==13?"few":"other":t==1||t==11?"one":t==2||t==12?"two":r&&t>=3&&t<=10||r&&t>=13&&t<=19?"few":"other"}const UK=tr,VK=Y;function HK(t,e){return e?t==1?"one":t==2||t==3?"two":t==4?"few":t==6?"many":"other":t>=0&&t<=1?"one":"other"}const WK=Oi;function KK(t,e){var n=String(t).split("."),r=n[0],o=!n[1],i=r.slice(-1),s=r.slice(-2);return e?"other":o&&i==1?"one":o&&i==2?"two":o&&(s==0||s==20||s==40||s==60||s==80)?"few":o?"other":"many"}const qK=Y,GK=Y;function YK(t,e){var n=String(t).split("."),r=n[0],o=!n[1],i=Number(n[0])==t,s=i&&n[0].slice(-1);return e?"other":t==1&&o?"one":r==2&&o?"two":o&&(t<0||t>10)&&i&&s==0?"many":"other"}function ZK(t,e){return e?t==1?"one":t==2||t==3?"two":t==4?"few":t==6?"many":"other":t>=0&&t<=1?"one":"other"}function JK(t,e){var n=String(t).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=r.slice(-2),l=o.slice(-1),c=o.slice(-2);return e?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function XK(t,e){var n=String(t).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-2),a=o.slice(-2);return e?"other":i&&s==1||a==1?"one":i&&s==2||a==2?"two":i&&(s==3||s==4)||a==3||a==4?"few":"other"}function QK(t,e){return e?t==1||t==5?"one":"other":t==1?"one":"other"}function eq(t,e){return e?t==1?"one":"other":t>=0&&t<2?"one":"other"}const tq=tr,nq=ot,rq=ot,oq=ot,iq=tr;function sq(t,e){var n=String(t).split("."),r=n[0],o=Number(n[0])==t,i=r.slice(-1),s=r.slice(-2);return e?"other":o&&i==1&&s!=11||!o?"one":"other"}function aq(t,e){var n=String(t).split("."),r=!n[1];return e?t==11||t==8||t==80||t==800?"many":"other":t==1&&r?"one":"other"}const lq=Hs;function cq(t,e){var n=String(t).split("."),r=n[0],o=!n[1],i=Number(n[0])==t,s=i&&n[0].slice(-1);return e?"other":t==1&&o?"one":r==2&&o?"two":o&&(t<0||t>10)&&i&&s==0?"many":"other"}const uq=ot,dq=ot,fq=Y,pq=tr,hq=Y,mq=ot,gq=ot;function vq(t,e){var n=String(t).split("."),r=n[0],o=r.slice(-2);return e?r==1?"one":r==0||o>=2&&o<=20||o==40||o==60||o==80?"many":"other":t==1?"one":"other"}function yq(t,e){return e?"other":t>=0&&t<2?"one":"other"}const xq=Y,bq=Y,wq=ot,kq=ot;function Sq(t,e){var n=String(t).split("."),r=Number(n[0])==t,o=r&&n[0].slice(-1);return e?o==6||o==9||r&&o==0&&t!=0?"many":"other":t==1?"one":"other"}const Eq=Y,_q=Y,Cq=ot;function Tq(t,e){return e?"other":t>=0&&t<=1?"one":"other"}const Oq=ot,Mq=Y,Rq=Y;function Nq(t,e){return e?"other":t==0?"zero":t==1?"one":"other"}const Pq=Y;function $q(t,e){var n=String(t).split("."),r=Number(n[0])==t,o=r&&n[0].slice(-2),i=r&&n[0].slice(-3),s=r&&n[0].slice(-5),a=r&&n[0].slice(-6);return e?r&&t>=1&&t<=4||o>=1&&o<=4||o>=21&&o<=24||o>=41&&o<=44||o>=61&&o<=64||o>=81&&o<=84?"one":t==5||o==5?"many":"other":t==0?"zero":t==1?"one":o==2||o==22||o==42||o==62||o==82||r&&i==0&&(s>=1e3&&s<=2e4||s==4e4||s==6e4||s==8e4)||t!=0&&a==1e5?"two":o==3||o==23||o==43||o==63||o==83?"few":t!=1&&(o==1||o==21||o==41||o==61||o==81)?"many":"other"}const Aq=Y;function Iq(t,e){var n=String(t).split("."),r=n[0];return e?"other":t==0?"zero":(r==0||r==1)&&t!=0?"one":"other"}const Dq=Y,Lq=Y,jq=ot,zq=Oi;function Fq(t,e){return e&&t==1?"one":"other"}function Bq(t,e){var n=String(t).split("."),r=n[1]||"",o=Number(n[0])==t,i=o&&n[0].slice(-1),s=o&&n[0].slice(-2);return e?"other":i==1&&(s<11||s>19)?"one":i>=2&&i<=9&&(s<11||s>19)?"few":r!=0?"many":"other"}function Uq(t,e){var n=String(t).split("."),r=n[1]||"",o=r.length,i=Number(n[0])==t,s=i&&n[0].slice(-1),a=i&&n[0].slice(-2),l=r.slice(-2),c=r.slice(-1);return e?"other":i&&s==0||a>=11&&a<=19||o==2&&l>=11&&l<=19?"zero":s==1&&a!=11||o==2&&c==1&&l!=11||o!=2&&c==1?"one":"other"}const Vq=Y,Hq=Oi,Wq=Y;function Kq(t,e){var n=String(t).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=r.slice(-2),l=o.slice(-1),c=o.slice(-2);return e?s==1&&a!=11?"one":s==2&&a!=12?"two":(s==7||s==8)&&a!=17&&a!=18?"many":"other":i&&s==1&&a!=11||l==1&&c!=11?"one":"other"}const qq=Y,Gq=Y;function Yq(t,e){var n=String(t).split("."),r=!n[1],o=Number(n[0])==t,i=o&&n[0].slice(-2);return e?t==1?"one":"other":t==1&&r?"one":!r||t==0||i>=2&&i<=19?"few":"other"}function Zq(t,e){return e?t==1?"one":t==2||t==3?"two":t==4?"few":"other":t==1?"one":"other"}function Jq(t,e){return e&&t==1?"one":"other"}function Xq(t,e){var n=String(t).split("."),r=Number(n[0])==t,o=r&&n[0].slice(-2);return e?"other":t==1?"one":t==0||o>=2&&o<=10?"few":o>=11&&o<=19?"many":"other"}const Qq=ot,eG=Y,tG=Hs,nG=Y,rG=Y;function oG(t,e){var n=String(t).split("."),r=Number(n[0])==t;return e?r&&t>=1&&t<=4?"one":"other":t==1?"one":"other"}const iG=tr,sG=Y,aG=Y,lG=Y,cG=ot,uG=Y,dG=Oi,fG=Y,pG=Y,hG=Y;function mG(t,e){var n=String(t).split("."),r=Number(n[0])==t;return e?t==1||t==5||r&&t>=7&&t<=9?"one":t==2||t==3?"two":t==4?"few":t==6?"many":"other":t==1?"one":"other"}const gG=Y,vG=ot,yG=Oi,xG=Y;function bG(t,e){var n=String(t).split("."),r=n[0],o=!n[1],i=r.slice(-1),s=r.slice(-2);return e?"other":t==1&&o?"one":o&&i>=2&&i<=4&&(s<12||s>14)?"few":o&&r!=1&&(i==0||i==1)||o&&i>=5&&i<=9||o&&s>=12&&s<=14?"many":"other"}function wG(t,e){var n=String(t).split("."),r=n[1]||"",o=r.length,i=Number(n[0])==t,s=i&&n[0].slice(-1),a=i&&n[0].slice(-2),l=r.slice(-2),c=r.slice(-1);return e?"other":i&&s==0||a>=11&&a<=19||o==2&&l>=11&&l<=19?"zero":s==1&&a!=11||o==2&&c==1&&l!=11||o!=2&&c==1?"one":"other"}const kG=Y;function SG(t,e){var n=String(t).split("."),r=n[0];return e?"other":r==0||r==1?"one":"other"}const EG=tr,_G=Y;function CG(t,e){var n=String(t).split("."),r=!n[1],o=Number(n[0])==t,i=o&&n[0].slice(-2);return e?t==1?"one":"other":t==1&&r?"one":!r||t==0||i>=2&&i<=19?"few":"other"}const TG=Y,OG=ot;function MG(t,e){var n=String(t).split("."),r=n[0],o=!n[1],i=r.slice(-1),s=r.slice(-2);return e?"other":o&&i==1&&s!=11?"one":o&&i>=2&&i<=4&&(s<12||s>14)?"few":o&&i==0||o&&i>=5&&i<=9||o&&s>=11&&s<=14?"many":"other"}const RG=Y,NG=ot,PG=Y;function $G(t,e){var n=String(t).split("."),r=!n[1];return e?t==11||t==8||t==80||t==800?"many":"other":t==1&&r?"one":"other"}function AG(t,e){var n=String(t).split("."),r=!n[1];return e?t==11||t==8||t==80||t==800?"many":"other":t==1&&r?"one":"other"}const IG=Y,DG=Y,LG=Hs,jG=Y,zG=ot,FG=ot;function BG(t,e){var n=String(t).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=r.slice(-2),l=o.slice(-1),c=o.slice(-2);return e?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}function UG(t,e){var n=String(t).split("."),r=Number(n[0])==t;return e?"other":t>=0&&t<=1?"one":r&&t>=2&&t<=10?"few":"other"}function VG(t,e){var n=String(t).split("."),r=n[0],o=n[1]||"";return e?"other":t==0||t==1||r==0&&o==1?"one":"other"}function HG(t,e){var n=String(t).split("."),r=n[0],o=!n[1];return e?"other":t==1&&o?"one":r>=2&&r<=4&&o?"few":o?"other":"many"}function WG(t,e){var n=String(t).split("."),r=n[0],o=!n[1],i=r.slice(-2);return e?"other":o&&i==1?"one":o&&i==2?"two":o&&(i==3||i==4)||!o?"few":"other"}const KG=Hs,qG=Hs,GG=Hs,YG=Hs,ZG=Hs,JG=Y,XG=Y;function QG(t,e){var n=String(t).split("."),r=Number(n[0])==t,o=r&&n[0].slice(-1),i=r&&n[0].slice(-2);return e?t==1?"one":o==4&&i!=14?"many":"other":t==1?"one":"other"}function eY(t,e){var n=String(t).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=r.slice(-2),l=o.slice(-1),c=o.slice(-2);return e?"other":i&&s==1&&a!=11||l==1&&c!=11?"one":i&&s>=2&&s<=4&&(a<12||a>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"}const tY=Y,nY=Y,rY=Y,oY=ot;function iY(t,e){var n=String(t).split("."),r=!n[1],o=Number(n[0])==t,i=o&&n[0].slice(-1),s=o&&n[0].slice(-2);return e?(i==1||i==2)&&s!=11&&s!=12?"one":"other":t==1&&r?"one":"other"}const sY=tr,aY=Y,lY=Y,cY=Y,uY=Y,dY=ot,fY=Oi,pY=Y;function hY(t,e){var n=String(t).split("."),r=Number(n[0])==t,o=r&&n[0].slice(-1);return e?o==6||o==9||t==10?"few":"other":t==1?"one":"other"}function mY(t,e){var n=String(t).split("."),r=n[0],o=n[1]||"",i=!n[1],s=r.slice(-1),a=o.slice(-1);return e?t==1?"one":"other":i&&(r==1||r==2||r==3)||i&&s!=4&&s!=6&&s!=9||!i&&a!=4&&a!=6&&a!=9?"one":"other"}const gY=Y,vY=ot,yY=Y,xY=Y;function bY(t,e){var n=String(t).split("."),r=Number(n[0])==t;return e?"other":t==0||t==1||r&&t>=11&&t<=99?"one":"other"}const wY=Y;function kY(t,e){var n=String(t).split("."),r=n[0],o=!n[1],i=Number(n[0])==t,s=i&&n[0].slice(-1),a=i&&n[0].slice(-2),l=r.slice(-1),c=r.slice(-2);return e?s==3&&a!=13?"few":"other":o&&l==1&&c!=11?"one":o&&l>=2&&l<=4&&(c<12||c>14)?"few":o&&l==0||o&&l>=5&&l<=9||o&&c>=11&&c<=14?"many":"other"}const SY=tr,EY=Y,_Y=Y;function CY(t,e){return e&&t==1?"one":"other"}const TY=Y,OY=Y,MY=Oi,RY=Y,NY=ot,PY=Y,$Y=Y,AY=tr,IY=ot,DY=ot,LY=ot;function jY(t,e){return e?"other":t>=0&&t<=1?"one":"other"}const zY=Object.freeze(Object.defineProperty({__proto__:null,_in:HW,af:WW,ak:KW,am:qW,an:GW,ar:YW,ars:ZW,as:JW,asa:XW,ast:QW,az:eK,be:tK,bem:nK,bez:rK,bg:oK,bho:iK,bm:sK,bn:aK,bo:lK,br:cK,brx:uK,bs:dK,ca:fK,ce:pK,ceb:hK,cgg:mK,chr:gK,ckb:vK,cs:yK,cy:xK,da:bK,de:wK,dsb:kK,dv:SK,dz:EK,ee:_K,el:CK,en:TK,eo:OK,es:MK,et:RK,eu:NK,fa:PK,ff:$K,fi:AK,fil:IK,fo:DK,fr:LK,fur:jK,fy:zK,ga:FK,gd:BK,gl:UK,gsw:VK,gu:HK,guw:WK,gv:KK,ha:qK,haw:GK,he:YK,hi:ZK,hr:JK,hsb:XK,hu:QK,hy:eq,ia:tq,id:nq,ig:rq,ii:oq,io:iq,is:sq,it:aq,iu:lq,iw:cq,ja:uq,jbo:dq,jgo:fq,ji:pq,jmc:hq,jv:mq,jw:gq,ka:vq,kab:yq,kaj:xq,kcg:bq,kde:wq,kea:kq,kk:Sq,kkj:Eq,kl:_q,km:Cq,kn:Tq,ko:Oq,ks:Mq,ksb:Rq,ksh:Nq,ku:Pq,kw:$q,ky:Aq,lag:Iq,lb:Dq,lg:Lq,lkt:jq,ln:zq,lo:Fq,lt:Bq,lv:Uq,mas:Vq,mg:Hq,mgo:Wq,mk:Kq,ml:qq,mn:Gq,mo:Yq,mr:Zq,ms:Jq,mt:Xq,my:Qq,nah:eG,naq:tG,nb:nG,nd:rG,ne:oG,nl:iG,nn:sG,nnh:aG,no:lG,nqo:cG,nr:uG,nso:dG,ny:fG,nyn:pG,om:hG,or:mG,os:gG,osa:vG,pa:yG,pap:xG,pl:bG,prg:wG,ps:kG,pt:SG,pt_PT:EG,rm:_G,ro:CG,rof:TG,root:OG,ru:MG,rwk:RG,sah:NG,saq:PG,sc:$G,scn:AG,sd:IG,sdh:DG,se:LG,seh:jG,ses:zG,sg:FG,sh:BG,shi:UG,si:VG,sk:HG,sl:WG,sma:KG,smi:qG,smj:GG,smn:YG,sms:ZG,sn:JG,so:XG,sq:QG,sr:eY,ss:tY,ssy:nY,st:rY,su:oY,sv:iY,sw:sY,syr:aY,ta:lY,te:cY,teo:uY,th:dY,ti:fY,tig:pY,tk:hY,tl:mY,tn:gY,to:vY,tr:yY,ts:xY,tzm:bY,ug:wY,uk:kY,ur:SY,uz:EY,ve:_Y,vi:CY,vo:TY,vun:OY,wa:MY,wae:RY,wo:NY,xh:PY,xog:$Y,yi:AY,yo:IY,yue:DY,zh:LY,zu:jY},Symbol.toStringTag,{value:"Module"}));var FY=Object.defineProperty,BY=Object.getOwnPropertyDescriptor,UY=Object.getOwnPropertyNames,VY=Object.prototype.hasOwnProperty,i_=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of UY(e))!VY.call(t,o)&&o!==n&&FY(t,o,{get:()=>e[o],enumerable:!(r=BY(e,o))||r.enumerable});return t},HY=(t,e,n)=>(i_(t,e,"default"),n&&i_(n,e,"default")),WY=JSON.parse('{"extension.command.toggle-upper-case.label":[["case","select",{"upper":"Uppercase","lower":"Lowercase","capitalize":"Sentence case","smallCaps":"Small caps","other":"Text case"}]],"extension.table.column_count":[["count","plural",{"one":["#"," column"],"other":["#"," columns"]}]],"extension.table.row_count":[["count","plural",{"one":["#"," row"],"other":["#"," rows"]}]],"extension.command.toggle-columns.description":[["count","select",{"2":"Split the block into two columns","3":"Split the current block into three columns","4":"Split the current block into four columns","other":"Split the current block into multiple columns"}]],"extension.command.toggle-columns.label":[["count","select",{"2":"Two Column Block","3":"Three Column Block","4":"Four Column Block","other":"Multi Column Block"}]],"extension.command.set-text-direction.label":[["dir","select",{"ltr":"Left-To-Right","rtl":"Right-To-Left","other":"Reset Direction"}]],"extension.command.set-text-direction.description":[["dir","select",{"ltr":"Set the text direction from left to right","rtl":"Set the text direction from right to left","other":"Reset text direction"}]],"extension.command.toggle-heading.label":[["level","select",{"1":"Heading 1","2":"Heading 2","3":"Heading 3","4":"Heading 4","5":"Heading 5","6":"Heading 6","other":"Heading"}]],"extension.command.toggle-callout.description":[["type","select",{"info":"Create an information callout block","warning":"Create a warning callout block","error":"Create an error callout block","success":"Create a success callout block","other":"Create a callout block"}]],"extension.command.toggle-callout.label":[["type","select",{"info":"Information Callout","warning":"Warning Callout","error":"Error Callout","success":"Success Callout","other":"Callout"}]],"extension.command.toggle-code-block.description":"Add a code block","extension.command.add-annotation.label":"Add annotation","extension.command.toggle-blockquote.description":"Add blockquote formatting to the selected text","extension.command.toggle-bold.description":"Add bold formatting to the selected text","extension.command.toggle-code.description":"Add inline code formatting to the selected text","keyboard.shortcut.alt":"Alt","keyboard.shortcut.arrowDown":"Arrow Down","keyboard.shortcut.arrowLeft":"Arrow Left","keyboard.shortcut.arrowRight":"Arrow Right","keyboard.shortcut.arrowUp":"Arrow Up","keyboard.shortcut.backspace":"Backspace","ui.text-color.black":"Black","extension.command.toggle-blockquote.label":"Blockquote","ui.text-color.blue":"Blue","ui.text-color.blue.hue":["Blue ",["hue"]],"extension.command.toggle-bold.label":"Bold","extension.command.toggle-bullet-list.description":"Bulleted list","keyboard.shortcut.capsLock":"Caps Lock","extension.command.center-align.label":"Center align","extension.command.toggle-code.label":"Code","extension.command.toggle-code-block.label":"Codeblock","keyboard.shortcut.command":"Command","QcPNd6":"Image description","ogrUzJ":"Add a short description here.","yqdyzr":"Image","6/02F4":"Image source","X8H91v":"Image","zhQ7Zt":"Italic","ZL7E7l":"Underline","keyboard.shortcut.control":"Control","extension.command.convert-paragraph.description":"Convert current block into a paragraph block.","extension.command.convert-paragraph.label":"Convert Paragraph","extension.command.copy.label":"Copy","extension.command.copy.description":"Copy the selected text","extension.command.create-table.description":"Create a table with set number of rows and columns.","extension.command.create-table.label":"Create table","extension.command.cut.label":"Cut","extension.command.cut.description":"Cut the selected text","ui.text-color.cyan":"Cyan","ui.text-color.cyan.hue":["Cyan ",["hue"]],"extension.command.decrease-font-size.label":"Decrease","extension.command.decrease-indent.label":"Decrease indentation","extension.command.decrease-font-size.description":"Decrease the font size.","keyboard.shortcut.delete":"Delete","extension.command.insert-horizontal-rule.label":"Divider","keyboard.shortcut.end":"End","keyboard.shortcut.escape":"Enter","keyboard.shortcut.enter":"Enter","6PjrOF":"Add annotation","OTq5WC":"Center align","oeZ3ox":"Convert current block into a paragraph block.","m1khs+":"Convert Paragraph","w/1U+3":"Copy the selected text","kdodi0":"Copy","k0KR/u":"Create a table with set number of rows and columns.","zrwMyD":"Create table","D/nWxh":"Cut the selected text","jHPv5m":"Cut","5cNgRx":"Decrease the font size.","vyRNWx":"Decrease","Jgiol4":"Decrease indentation","1gJSHH":"Increase the font size","OQXJXz":"Increase","72TLhr":"Increase indentation","HFlfzJ":"Insert Emoji","RPq9fY":"Separate content with a diving horizontal line","OKQF+e":"Divider","zjYb9C":"Insert a new paragraph","4M4sXC":"Insert Paragraph","1Q+eVc":"Justify","ejWWtP":"Left align","wVqrpS":"Paste content into the editor","07v9aw":"Paste","zUYfou":"Redo the most recent action","9Nq9zr":"Redo","0uxaZe":"Remove annotation","iJWZAz":"Right align","g5WpPn":"Select all content within the editor","2+pZDT":"Select all","yChCR1":"Set text case","GMzAC/":"Set the font size for the selected text.","vzEyrv":"Font size","7VCkJ8":"Set the text color for the selected text.","qjWFaR":"Text color","LVWgFu":[["dir","select",{"ltr":"Set the text direction from left to right","rtl":"Set the text direction from right to left","other":"Reset text direction"}]],"WXwRy1":[["dir","select",{"ltr":"Left-To-Right","rtl":"Right-To-Left","other":"Reset Direction"}]],"G/o315":"Set the text highlight color for the selected text.","xtHg6d":"Text highlight","1p1W/p":"Add blockquote formatting to the selected text","6+rh6I":"Blockquote","0yB3LV":"Add bold formatting to the selected text","sFMo4Z":"Bold","SMKG/s":"Bulleted list","/BYCMi":[["type","select",{"info":"Create an information callout block","warning":"Create a warning callout block","error":"Create an error callout block","success":"Create a success callout block","other":"Create a callout block"}]],"V+3IBe":[["type","select",{"info":"Information Callout","warning":"Warning Callout","error":"Error Callout","success":"Success Callout","other":"Callout"}]],"hbIo4L":"Add a code block","7GkMcx":"Codeblock","2r4JYl":"Add inline code formatting to the selected text","Up8Tpe":"Code","ATHSPS":[["count","select",{"2":"Split the block into two columns","3":"Split the current block into three columns","4":"Split the current block into four columns","other":"Split the current block into multiple columns"}]],"7DC1VE":[["count","select",{"2":"Two Column Block","3":"Three Column Block","4":"Four Column Block","other":"Multi Column Block"}]],"hnrBeo":[["level","select",{"1":"Heading 1","2":"Heading 2","3":"Heading 3","4":"Heading 4","5":"Heading 5","6":"Heading 6","other":"Heading"}]],"NkZAcw":"Italicize the selected text","2fTW9e":"Italic","c759Ra":"Ordered list","uQwrZu":"Strikethrough the selected text","pT3qly":"Strikethrough","BHk+zu":"Subscript","18BVwM":"Superscript","tOIVCV":"Tasked list","4Janx3":"Underline the selected text","dCHt+D":"Underline","YYAprs":[["case","select",{"upper":"Uppercase","lower":"Lowercase","capitalize":"Sentence case","smallCaps":"Small caps","other":"Text case"}]],"tczyZL":"Show hidden whitespace characters in your editor.","0qAX23":"Toggle Whitespace","ezMADU":"Undo the most recent action","N3P7EC":"Undo","2nj/+s":"Update annotation","dWD7u4":[["count","plural",{"one":["#"," column"],"other":["#"," columns"]}]],"qXqgVT":[["count","plural",{"one":["#"," row"],"other":["#"," rows"]}]],"extension.command.set-font-size.label":"Font size","ui.text-color.grape":"Grape","ui.text-color.grape.hue":["Grape ",["hue"]],"ui.text-color.gray":"Gray","ui.text-color.gray.hue":["Gray ",["hue"]],"ui.text-color.green":"Green","ui.text-color.green.hue":["Green ",["hue"]],"keyboard.shortcut.home":"Home","extension.command.increase-font-size.label":"Increase","extension.command.increase-indent.label":"Increase indentation","extension.command.increase-font-size.description":"Increase the font size","ui.text-color.indigo":"Indigo","ui.text-color.indigo.hue":["Indigo ",["hue"]],"extension.command.insert-paragraph.description":"Insert a new paragraph","extension.command.insert-emoji.label":"Insert Emoji","extension.command.insert-paragraph.label":"Insert Paragraph","extension.command.toggle-italic.label":"Italic","extension.command.toggle-italic.description":"Italicize the selected text","extension.command.justify-align.label":"Justify","R7NlCw":"Alt","RbDiK5":"Arrow Down","Dgyd+E":"Arrow Left","8pdCk4":"Arrow Right","Gp/343":"Arrow Up","PFPV0A":"Backspace","0IRYvp":"Caps Lock","X7HX0D":"Command","zq0AdD":"Control","8SfToN":"Delete","Ys/uah":"End","3K5hww":"Enter","veQt1j":"Enter","ySv7i+":"Home","e6RUI1":"Page Down","EEJk31":"Page Up","7sbhAU":"Shift","Q4eplT":"Space","SUhVVC":"Tab","extension.command.left-align.label":"Left align","ui.text-color.lime":"Lime","ui.text-color.lime.hue":["Lime ",["hue"]],"react-components.mention-atom-component.zero-items":"No items available","ui.text-color.orange":"Orange","ui.text-color.orange.hue":["Orange ",["hue"]],"extension.command.toggle-ordered-list.label":"Ordered list","keyboard.shortcut.pageDown":"Page Down","keyboard.shortcut.pageUp":"Page Up","extension.command.paste.label":"Paste","extension.command.paste.description":"Paste content into the editor","ui.text-color.pink":"Pink","ui.text-color.pink.hue":["Pink ",["hue"]],"zvMfIA":"No items available","pEjhti":"Static Menu","ui.text-color.red":"Red","ui.text-color.red.hue":["Red ",["hue"]],"extension.command.redo.label":"Redo","extension.command.redo.description":"Redo the most recent action","extension.command.remove-annotation.label":"Remove annotation","extension.command.right-align.label":"Right align","extension.command.select-all.label":"Select all","extension.command.select-all.description":"Select all content within the editor","extension.command.insert-horizontal-rule.description":"Separate content with a diving horizontal line","extension.command.set-casing.label":"Set text case","extension.command.set-font-size.description":"Set the font size for the selected text.","extension.command.set-text-color.description":"Set the text color for the selected text.","extension.command.set-text-highlight.description":"Set the text highlight color for the selected text.","keyboard.shortcut.shift":"Shift","extension.command.toggle-whitespace.description":"Show hidden whitespace characters in your editor.","keyboard.shortcut.space":"Space","extension.command.toggle-strike.label":"Strikethrough","extension.command.toggle-strike.description":"Strikethrough the selected text","extension.command.toggle-subscript.label":"Subscript","extension.command.toggle-superscript.label":"Superscript","keyboard.shortcut.tab":"Tab","extension.command.toggle-task-list.description":"Tasked list","ui.text-color.teal":"Teal","ui.text-color.teal.hue":["Teal ",["hue"]],"extension.command.set-text-color.label":"Text color","extension.command.set-text-highlight.label":"Text highlight","extension.command.toggle-whitespace.label":"Toggle Whitespace","ui.text-color.transparent":"Transparent","slrB1c":"Black","6QML30":"Blue","xw+keN":["Blue ",["hue"]],"38RHqP":"Cyan","D89yPf":["Cyan ",["hue"]],"VjBLnd":"Grape","Rp40yv":["Grape ",["hue"]],"5Dm9D1":"Gray","HGjXjC":["Gray ",["hue"]],"b9fz+n":"Green","18jo3M":["Green ",["hue"]],"CFzqCV":"Indigo","aVlDku":["Indigo ",["hue"]],"04PfLc":"Lime","KRTK6Y":["Lime ",["hue"]],"pSnXFd":"Orange","ve/MJZ":["Orange ",["hue"]],"OvCgDa":"Pink","l7NqyT":["Pink ",["hue"]],"IT9k0j":"Red","AdyJ7/":["Red ",["hue"]],"3D2UWc":"Teal","Dcq0Y1":["Teal ",["hue"]],"bsi2ik":"Transparent","Tj3PRR":"Violet","xxMH5N":["Violet ",["hue"]],"Rum0ah":"White","4gaw/Q":"Yellow","hhauc3":["Yellow ",["hue"]],"extension.command.toggle-underline.label":"Underline","extension.command.toggle-underline.description":"Underline the selected text","extension.command.undo.label":"Undo","extension.command.undo.description":"Undo the most recent action","extension.command.update-annotation.label":"Update annotation","ui.text-color.violet":"Violet","ui.text-color.violet.hue":["Violet ",["hue"]],"ui.text-color.white":"White","ui.text-color.yellow":"Yellow","ui.text-color.yellow.hue":["Yellow ",["hue"]]}'),aP={};HY(aP,zY);Dg.loadLocaleData("en",{plurals:aP.en});Dg.load("en",WY);Dg.activate("en");var KY=Object.defineProperty,qY=Object.getOwnPropertyDescriptor,_b=(t,e,n,r)=>{for(var o=r>1?void 0:r?qY(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&KY(e,n,o),o},Tc=class extends Fr{get name(){return"doc"}createNodeSpec(t,e){const{docAttributes:n,content:r}=this.options,o=pe();if(el(n))for(const[i,s]of qt(n))o[i]={default:s};else for(const i of n)o[i]={default:null};return{attrs:o,content:r,...e}}setDocAttributes(t){return({tr:e,dispatch:n})=>{if(n){for(const[r,o]of Object.entries(t))e.step(new of(r,o));n(e)}return!0}}isDefaultDocNode({state:t=this.store.getState(),options:e}={}){return bb(t.doc,e)}};_b([ue()],Tc.prototype,"setDocAttributes",1);_b([At()],Tc.prototype,"isDefaultDocNode",1);Tc=_b([Ze({defaultOptions:{content:"block+",docAttributes:[]},defaultPriority:at.Medium,staticKeys:["content","docAttributes"],disableExtraAttributes:!0})],Tc);var lP="SetDocAttribute",cP="RevertSetDocAttribute",of=class extends Yt{constructor(t,e,n=lP){super(),this.stepType=n,this.key=t,this.value=e}static fromJSON(t,e){return new of(e.key,e.value,e.stepType)}apply(t){this.previous=t.attrs[this.key];const e={...t.attrs,[this.key]:this.value};return jt.ok(t.type.create(e,t.content,t.marks))}invert(){return new of(this.key,this.previous,cP)}map(){return this}toJSON(){return{stepType:this.stepType,key:this.key,value:this.value}}};try{Yt.jsonID(lP,of),Yt.jsonID(cP,of)}catch(t){if(!t.message.startsWith("Duplicate use of step JSON ID"))throw t}var GY=Object.defineProperty,YY=Object.getOwnPropertyDescriptor,uP=(t,e,n,r)=>{for(var o=r>1?void 0:r?YY(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&GY(e,n,o),o};function ZY(t,e,n,r){const o=t.docView.posFromDOM(e,n,r);return o===null||o<0?null:o}function JY(t,e){const n=e.target;if(n){const r=ZY(t,n,0);if(r!==null){const o=t.state.doc.resolve(r),i=o.node().isLeaf?0:1,s=o.start()-i;return{pos:r,inside:s}}}return t.posAtCoords({left:e.clientX,top:e.clientY})??void 0}var vm=class extends St{constructor(){super(...arguments),this.mousedown=!1,this.mouseover=!1,this.createMouseEventHandler=t=>(e,n)=>{const r=n,o=JY(e,r);if(!o)return!1;const i=[],s=[],{inside:a,pos:l}=o;if(a===-1)return!1;const c=e.state.doc.resolve(l),u=c.depth+1;for(const d of nR(u,1))i.push({node:d>c.depth&&c.nodeAfter?c.nodeAfter:c.node(d),pos:c.before(d)});for(const{type:d}of c.marksAcross(c)??[]){const f=wi(c,d);f&&s.push(f)}return t(r,{view:e,nodes:i,marks:s,getMark:d=>{const f=Se(d)?e.state.schema.marks[d]:d;return ve(f,{code:K.EXTENSION,message:`The mark ${d} being checked does not exist within the editor schema.`}),s.find(p=>p.mark.type===f)},getNode:d=>{var f;const p=Se(d)?e.state.schema.nodes[d]:d;ve(p,{code:K.EXTENSION,message:"The node being checked does not exist"});const m=i.find(({node:g})=>g.type===p);if(m)return{...m,isRoot:!!((f=i[0])!=null&&f.node.eq(m.node))}}})}}get name(){return"events"}onView(){var t,e;if(!((t=this.store.managerSettings.exclude)!=null&&t.clickHandler))for(const n of this.store.extensions){if(!n.createEventHandlers||(e=n.options.exclude)!=null&&e.clickHandler)continue;const r=n.createEventHandlers();for(const[o,i]of qt(r))this.addHandler(o,i)}}createPlugin(){const t=new WeakMap,e=(n,r,o,i,s,a,l,c)=>{const u=this.store.currentState,{schema:d,doc:f}=u,p=f.resolve(i),m=t.has(l),g=XY({$pos:p,handled:m,view:o,state:u});let y=!1;m||(y=n(l,g)||y);const v={...g,pos:i,direct:c,nodeWithPosition:{node:s,pos:a},getNode:x=>{const w=Se(x)?d.nodes[x]:x;return ve(w,{code:K.EXTENSION,message:"The node being checked does not exist"}),w===s.type?{node:s,pos:a}:void 0}};return t.set(l,!0),r(l,v)||y};return{props:{handleKeyPress:(n,r)=>this.options.keypress(r)||!1,handleKeyDown:(n,r)=>this.options.keydown(r)||!1,handleTextInput:(n,r,o,i)=>this.options.textInput({from:r,to:o,text:i})||!1,handleClickOn:(n,r,o,i,s,a)=>e(this.options.clickMark,this.options.click,n,r,o,i,s,a),handleDoubleClickOn:(n,r,o,i,s,a)=>e(this.options.doubleClickMark,this.options.doubleClick,n,r,o,i,s,a),handleTripleClickOn:(n,r,o,i,s,a)=>e(this.options.tripleClickMark,this.options.tripleClick,n,r,o,i,s,a),handleDOMEvents:{focus:(n,r)=>this.options.focus(r)||!1,blur:(n,r)=>this.options.blur(r)||!1,mousedown:(n,r)=>(this.startMouseover(),this.options.mousedown(r)||!1),mouseup:(n,r)=>(this.endMouseover(),this.options.mouseup(r)||!1),mouseleave:(n,r)=>(this.mouseover=!1,this.options.mouseleave(r)||!1),mouseenter:(n,r)=>(this.mouseover=!0,this.options.mouseenter(r)||!1),keyup:(n,r)=>this.options.keyup(r)||!1,mouseout:this.createMouseEventHandler((n,r)=>{const o={...r,hovering:!1};return this.options.hover(n,o)||!1}),mouseover:this.createMouseEventHandler((n,r)=>{const o={...r,hovering:!0};return this.options.hover(n,o)||!1}),contextmenu:this.createMouseEventHandler((n,r)=>this.options.contextmenu(n,r)||!1),scroll:(n,r)=>this.options.scroll(r)||!1,copy:(n,r)=>this.options.copy(r)||!1,cut:(n,r)=>this.options.cut(r)||!1,paste:(n,r)=>this.options.paste(r)||!1}},view:n=>{let r=n.editable;const o=this.options;return{update(i){const s=i.editable;s!==r&&(o.editable(s),r=s)}}}}}isInteracting(){return this.mousedown&&this.mouseover}startMouseover(){this.mouseover=!0,!this.mousedown&&(this.mousedown=!0,this.store.document.documentElement.addEventListener("mouseup",()=>{this.endMouseover()},{once:!0}))}endMouseover(){this.mousedown&&(this.mousedown=!1,this.store.commands.emptyUpdate())}};uP([At()],vm.prototype,"isInteracting",1);vm=uP([Ze({handlerKeys:["blur","focus","mousedown","mouseup","mouseenter","mouseleave","textInput","keypress","keyup","keydown","click","clickMark","doubleClick","doubleClickMark","tripleClick","tripleClickMark","contextmenu","hover","scroll","copy","cut","paste","editable"],handlerKeyOptions:{blur:{earlyReturnValue:!0},focus:{earlyReturnValue:!0},mousedown:{earlyReturnValue:!0},mouseleave:{earlyReturnValue:!0},mouseup:{earlyReturnValue:!0},click:{earlyReturnValue:!0},doubleClick:{earlyReturnValue:!0},tripleClick:{earlyReturnValue:!0},hover:{earlyReturnValue:!0},contextmenu:{earlyReturnValue:!0},scroll:{earlyReturnValue:!0},copy:{earlyReturnValue:!0},cut:{earlyReturnValue:!0},paste:{earlyReturnValue:!0}},defaultPriority:at.High})],vm);function XY(t){const{handled:e,view:n,$pos:r,state:o}=t,i={getMark:eR,markRanges:[],view:n,state:o};if(e)return i;for(const{type:s}of r.marksAcross(r)??[]){const a=wi(r,s);a&&i.markRanges.push(a)}return i.getMark=s=>{const a=Se(s)?o.schema.marks[s]:s;return ve(a,{code:K.EXTENSION,message:`The mark ${s} being checked does not exist within the editor schema.`}),i.markRanges.find(l=>l.mark.type===a)},i}class $t extends je{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return $t.valid(r)?new $t(r):je.near(r)}content(){return J.empty}eq(e){return e instanceof $t&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new $t(e.resolve(n.pos))}getBookmark(){return new Cb(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!QY(e)||!eZ(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let o=n.contentMatchAt(e.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&$t.valid(e))return e;let o=e.pos,i=null;for(let s=e.depth;;s--){let a=e.node(s);if(n>0?e.indexAfter(s)<a.childCount:e.index(s)>0){i=a.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;o+=n;let l=e.doc.resolve(o);if($t.valid(l))return l}for(;;){let s=n>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!ye.isSelectable(i)){e=e.doc.resolve(o+i.nodeSize*n),r=!1;continue e}break}i=s,o+=n;let a=e.doc.resolve(o);if($t.valid(a))return a}return null}}}$t.prototype.visible=!1;$t.findFrom=$t.findGapCursorFrom;je.jsonID("gapcursor",$t);class Cb{constructor(e){this.pos=e}map(e){return new Cb(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return $t.valid(n)?new $t(n):je.near(n)}}function QY(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function eZ(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function tZ(){return new Ti({props:{decorations:iZ,createSelectionBetween(t,e,n){return e.pos==n.pos&&$t.valid(n)?new $t(n):null},handleClick:rZ,handleKeyDown:nZ,handleDOMEvents:{beforeinput:oZ}}})}const nZ=qN({ArrowLeft:wp("horiz",-1),ArrowRight:wp("horiz",1),ArrowUp:wp("vert",-1),ArrowDown:wp("vert",1)});function wp(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,o,i){let s=r.selection,a=e>0?s.$to:s.$from,l=s.empty;if(s instanceof Ce){if(!i.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let c=$t.findGapCursorFrom(a,e,l);return c?(o&&o(r.tr.setSelection(new $t(c))),!0):!1}}function rZ(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!$t.valid(r))return!1;let o=t.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&ye.isSelectable(t.state.doc.nodeAt(o.inside))?!1:(t.dispatch(t.state.tr.setSelection(new $t(r))),!0)}function oZ(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof $t))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let o=F.empty;for(let s=r.length-1;s>=0;s--)o=F.from(r[s].createAndFill(null,o));let i=t.state.tr.replace(n.pos,n.pos,new J(o,0,0));return i.setSelection(Ce.near(i.doc.resolve(n.pos+1))),t.dispatch(i),!1}function iZ(t){if(!(t.selection instanceof $t))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Qe.create(t.doc,[kt.widget(t.selection.head,e,{key:"gapcursor"})])}var sZ=Object.defineProperty,aZ=Object.getOwnPropertyDescriptor,lZ=(t,e,n,r)=>{for(var o=r>1?void 0:r?aZ(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&sZ(e,n,o),o},ax=class extends St{get name(){return"gapCursor"}createExternalPlugins(){return[tZ()]}};ax=lZ([Ze({})],ax);var ym=200,ln=function(){};ln.prototype.append=function(e){return e.length?(e=ln.from(e),!this.length&&e||e.length<ym&&this.leafAppend(e)||this.length<ym&&e.leafPrepend(this)||this.appendInner(e)):this};ln.prototype.prepend=function(e){return e.length?ln.from(e).append(this):this};ln.prototype.appendInner=function(e){return new cZ(this,e)};ln.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?ln.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};ln.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};ln.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};ln.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(i,s){return o.push(e(i,s))},n,r),o};ln.from=function(e){return e instanceof ln?e:e&&e.length?new dP(e):ln.empty};var dP=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(o,i){return o==0&&i==this.length?this:new e(this.values.slice(o,i))},e.prototype.getInner=function(o){return this.values[o]},e.prototype.forEachInner=function(o,i,s,a){for(var l=i;l<s;l++)if(o(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(o,i,s,a){for(var l=i-1;l>=s;l--)if(o(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(o){if(this.length+o.length<=ym)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=ym)return new e(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(ln);ln.empty=new dP([]);var cZ=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,o,i,s){var a=this.left.length;if(o<a&&this.left.forEachInner(r,o,Math.min(i,a),s)===!1||i>a&&this.right.forEachInner(r,Math.max(o-a,0),Math.min(this.length,i)-a,s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,i,s){var a=this.left.length;if(o>a&&this.right.forEachInvertedInner(r,o-a,Math.max(i,a)-a,s+a)===!1||i<a&&this.left.forEachInvertedInner(r,Math.min(o,a),i,s)===!1)return!1},e.prototype.sliceInner=function(r,o){if(r==0&&o==this.length)return this;var i=this.left.length;return o<=i?this.left.slice(r,o):r>=i?this.right.slice(r-i,o-i):this.left.slice(r,i).append(this.right.slice(0,o-i))},e.prototype.leafAppend=function(r){var o=this.right.leafAppend(r);if(o)return new e(this.left,o)},e.prototype.leafPrepend=function(r){var o=this.left.leafPrepend(r);if(o)return new e(o,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(ln);const uZ=500;class to{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,i;n&&(o=this.remapping(r,this.items.length),i=o.maps.length);let s=e.tr,a,l,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){o||(o=this.remapping(r,f+1),i=o.maps.length),i--,u.push(d);return}if(o){u.push(new Eo(d.map));let p=d.step.map(o.slice(i)),m;p&&s.maybeStep(p).doc&&(m=s.mapping.maps[s.mapping.maps.length-1],c.push(new Eo(m,void 0,void 0,c.length+u.length))),i--,m&&o.appendMap(m,i)}else s.maybeStep(d.step);if(d.selection)return a=o?d.selection.map(o.slice(i)):d.selection,l=new to(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(e,n,r,o){let i=[],s=this.eventCount,a=this.items,l=!o&&a.length?a.get(a.length-1):null;for(let u=0;u<e.steps.length;u++){let d=e.steps[u].invert(e.docs[u]),f=new Eo(e.mapping.maps[u],d,n),p;(p=l&&l.merge(f))&&(f=p,u?i.pop():a=a.slice(0,a.length-1)),i.push(f),n&&(s++,n=void 0),o||(l=f)}let c=s-r.depth;return c>fZ&&(a=dZ(a,c),s-=c),new to(a.append(i),s)}remapping(e,n){let r=new ec;return this.items.forEach((o,i)=>{let s=o.mirrorOffset!=null&&i-o.mirrorOffset>=e?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new to(this.items.append(e.map(n=>new Eo(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),i=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--},o);let l=n;this.items.forEach(f=>{let p=i.getMirror(--l);if(p==null)return;s=Math.min(s,p);let m=i.maps[p];if(f.step){let g=e.steps[p].invert(e.docs[p]),y=f.selection&&f.selection.map(i.slice(l+1,p));y&&a++,r.push(new Eo(m,g,y))}else r.push(new Eo(m))},o);let c=[];for(let f=n;f<s;f++)c.push(new Eo(i.maps[f]));let u=this.items.slice(0,o).append(c).append(r),d=new to(u,a);return d.emptyItemCount()>uZ&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,o=[],i=0;return this.items.forEach((s,a)=>{if(a>=e)o.push(s),s.selection&&i++;else if(s.step){let l=s.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let u=s.selection&&s.selection.map(n.slice(r));u&&i++;let d=new Eo(c.invert(),l,u),f,p=o.length-1;(f=o.length&&o[p].merge(d))?o[p]=f:o.push(d)}}else s.map&&r--},this.items.length,0),new to(ln.from(o.reverse()),i)}}to.empty=new to(ln.empty,0);function dZ(t,e){let n;return t.forEach((r,o)=>{if(r.selection&&e--==0)return n=o,!1}),t.slice(n)}class Eo{constructor(e,n,r,o){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=o}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Eo(n.getMap().invert(),n,this.selection)}}}class Xi{constructor(e,n,r,o,i){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=i}}const fZ=20;function pZ(t,e,n,r){let o=n.getMeta($o),i;if(o)return o.historyState;n.getMeta(mZ)&&(t=new Xi(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta($o))return s.getMeta($o).redo?new Xi(t.done.addTransform(n,void 0,r,Zp(e)),t.undone,s_(n.mapping.maps[n.steps.length-1]),t.prevTime,t.prevComposition):new Xi(t.done,t.undone.addTransform(n,void 0,r,Zp(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!hZ(n,t.prevRanges)),c=s?ey(t.prevRanges,n.mapping):s_(n.mapping.maps[n.steps.length-1]);return new Xi(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,Zp(e)),to.empty,c,n.time,a??t.prevComposition)}else return(i=n.getMeta("rebased"))?new Xi(t.done.rebased(n,i),t.undone.rebased(n,i),ey(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Xi(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),ey(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function hZ(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,o)=>{for(let i=0;i<e.length;i+=2)r<=e[i+1]&&o>=e[i]&&(n=!0)}),n}function s_(t){let e=[];return t.forEach((n,r,o,i)=>e.push(o,i)),e}function ey(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),i=e.map(t[r+1],-1);o<=i&&n.push(o,i)}return n}function fP(t,e,n,r){let o=Zp(e),i=$o.get(e).spec.config,s=(r?t.undone:t.done).popEvent(e,o);if(!s)return;let a=s.selection.resolve(s.transform.doc),l=(r?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,o),c=new Xi(r?l:s.remaining,r?s.remaining:l,null,0,-1);n(s.transform.setSelection(a).setMeta($o,{redo:r,historyState:c}).scrollIntoView())}let ty=!1,a_=null;function Zp(t){let e=t.plugins;if(a_!=e){ty=!1,a_=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){ty=!0;break}}return ty}const $o=new Uc("history"),mZ=new Uc("closeHistory");function gZ(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Ti({key:$o,state:{init(){return new Xi(to.empty,to.empty,null,0,-1)},apply(e,n,r){return pZ(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,o=r=="historyUndo"?Jp:r=="historyRedo"?Du:null;return o?(n.preventDefault(),o(e.state,e.dispatch)):!1}}}})}const Jp=(t,e)=>{let n=$o.getState(t);return!n||n.done.eventCount==0?!1:(e&&fP(n,t,e,!1),!0)},Du=(t,e)=>{let n=$o.getState(t);return!n||n.undone.eventCount==0?!1:(e&&fP(n,t,e,!0),!0)};function lx(t){let e=$o.getState(t);return e?e.done.eventCount:0}function vZ(t){let e=$o.getState(t);return e?e.undone.eventCount:0}var yZ=Object.defineProperty,xZ=Object.getOwnPropertyDescriptor,nl=(t,e,n,r)=>{for(var o=r>1?void 0:r?xZ(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&yZ(e,n,o),o},Bo=class extends St{constructor(){super(...arguments),this.wrapMethod=(t,e)=>({state:n,dispatch:r,view:o})=>{const{getState:i,getDispatch:s}=this.options,a=dt(i)?i():n,l=dt(s)&&r?s():r,c=t(a,l,o);return e==null||e(c),c}}get name(){return"history"}createKeymap(){return{"Mod-y":Qr.isMac?()=>!1:this.wrapMethod(Du,this.options.onRedo),"Mod-z":this.wrapMethod(Jp,this.options.onUndo),"Shift-Mod-z":this.wrapMethod(Du,this.options.onRedo)}}undoShortcut(t){return this.wrapMethod(Jp,this.options.onUndo)(t)}redoShortcut(t){return this.wrapMethod(Du,this.options.onRedo)(t)}createExternalPlugins(){const{depth:t,newGroupDelay:e}=this.options;return[gZ({depth:t,newGroupDelay:e})]}undo(){return HE(this.wrapMethod(Jp,this.options.onUndo))}redo(){return HE(this.wrapMethod(Du,this.options.onRedo))}undoDepth(t=this.store.getState()){return lx(t)}redoDepth(t=this.store.getState()){return vZ(t)}};nl([wr({shortcut:q.Undo,command:"undo"})],Bo.prototype,"undoShortcut",1);nl([wr({shortcut:q.Redo,command:"redo"})],Bo.prototype,"redoShortcut",1);nl([ue({disableChaining:!0,description:({t})=>t(rm.UNDO_DESCRIPTION),label:({t})=>t(rm.UNDO_LABEL),icon:"arrowGoBackFill"})],Bo.prototype,"undo",1);nl([ue({disableChaining:!0,description:({t})=>t(rm.REDO_DESCRIPTION),label:({t})=>t(rm.REDO_LABEL),icon:"arrowGoForwardFill"})],Bo.prototype,"redo",1);nl([At()],Bo.prototype,"undoDepth",1);nl([At()],Bo.prototype,"redoDepth",1);Bo=nl([Ze({defaultOptions:{depth:100,newGroupDelay:500,getDispatch:void 0,getState:void 0},staticKeys:["depth","newGroupDelay"],handlerKeys:["onUndo","onRedo"]})],Bo);var bZ=Object.defineProperty,wZ=Object.getOwnPropertyDescriptor,Lg=(t,e,n,r)=>{for(var o=r>1?void 0:r?wZ(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&bZ(e,n,o),o},kZ={icon:"paragraph",label:({t})=>t(om.INSERT_LABEL),description:({t})=>t(om.INSERT_DESCRIPTION)},SZ={icon:"paragraph",label:({t})=>t(om.CONVERT_LABEL),description:({t})=>t(om.CONVERT_DESCRIPTION)},Ha=class extends Fr{get name(){return"paragraph"}createTags(){return[Ie.LastNodeCompatible,Ie.TextBlock,Ie.Block,Ie.FormattingNode]}createNodeSpec(t,e){return{content:"inline*",draggable:!1,...e,attrs:{...t.defaults()},parseDOM:[{tag:"p",getAttrs:n=>({...t.parse(n)})},...e.parseDOM??[]],toDOM:n=>["p",t.dom(n),0]}}convertParagraph(t={}){const{attrs:e,selection:n,preserveAttrs:r}=t;return this.store.commands.setBlockNodeType.original(this.type,e,n,r)}insertParagraph(t,e={}){const{selection:n,attrs:r}=e;return this.store.commands.insertNode.original(this.type,{content:t,selection:n,attrs:r})}shortcut(t){return this.convertParagraph()(t)}};Lg([ue(SZ)],Ha.prototype,"convertParagraph",1);Lg([ue(kZ)],Ha.prototype,"insertParagraph",1);Lg([wr({shortcut:q.Paragraph,command:"convertParagraph"})],Ha.prototype,"shortcut",1);Ha=Lg([Ze({defaultPriority:at.Medium})],Ha);function si(t,e,n){return Math.min(Math.max(t,n),e)}class EZ extends Error{constructor(e){super(`Failed to parse color: "${e}"`)}}var Lu=EZ;function Tb(t){if(typeof t!="string")throw new Lu(t);if(t.trim().toLowerCase()==="transparent")return[0,0,0,0];let e=t.trim();e=PZ.test(t)?TZ(t):t;const n=OZ.exec(e);if(n){const s=Array.from(n).slice(1);return[...s.slice(0,3).map(a=>parseInt(sf(a,2),16)),parseInt(sf(s[3]||"f",2),16)/255]}const r=MZ.exec(e);if(r){const s=Array.from(r).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,16)),parseInt(s[3]||"ff",16)/255]}const o=RZ.exec(e);if(o){const s=Array.from(o).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,10)),parseFloat(s[3]||"1")]}const i=NZ.exec(e);if(i){const[s,a,l,c]=Array.from(i).slice(1).map(parseFloat);if(si(0,100,a)!==a)throw new Lu(t);if(si(0,100,l)!==l)throw new Lu(t);return[...$Z(s,a,l),Number.isNaN(c)?1:c]}throw new Lu(t)}function _Z(t){let e=5381,n=t.length;for(;n;)e=e*33^t.charCodeAt(--n);return(e>>>0)%2341}const l_=t=>parseInt(t.replace(/_/g,""),36),CZ="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((t,e)=>{const n=l_(e.substring(0,3)),r=l_(e.substring(3)).toString(16);let o="";for(let i=0;i<6-r.length;i++)o+="0";return t[n]=`${o}${r}`,t},{});function TZ(t){const e=t.toLowerCase().trim(),n=CZ[_Z(e)];if(!n)throw new Lu(t);return`#${n}`}const sf=(t,e)=>Array.from(Array(e)).map(()=>t).join(""),OZ=new RegExp(`^#${sf("([a-f0-9])",3)}([a-f0-9])?$`,"i"),MZ=new RegExp(`^#${sf("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),RZ=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${sf(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),NZ=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,PZ=/^[a-z]+$/i,c_=t=>Math.round(t*255),$Z=(t,e,n)=>{let r=n/100;if(e===0)return[r,r,r].map(c_);const o=(t%360+360)%360/60,i=(1-Math.abs(2*r-1))*(e/100),s=i*(1-Math.abs(o%2-1));let a=0,l=0,c=0;o>=0&&o<1?(a=i,l=s):o>=1&&o<2?(a=s,l=i):o>=2&&o<3?(l=i,c=s):o>=3&&o<4?(l=s,c=i):o>=4&&o<5?(a=s,c=i):o>=5&&o<6&&(a=i,c=s);const u=r-i/2,d=a+u,f=l+u,p=c+u;return[d,f,p].map(c_)};function AZ(t){const[e,n,r,o]=Tb(t).map((d,f)=>f===3?d:d/255),i=Math.max(e,n,r),s=Math.min(e,n,r),a=(i+s)/2;if(i===s)return[0,0,a,o];const l=i-s,c=a>.5?l/(2-i-s):l/(i+s);return[60*(e===i?(n-r)/l+(n<r?6:0):n===i?(r-e)/l+2:(e-n)/l+4),c,a,o]}function IZ(t,e,n,r){return`hsla(${(t%360).toFixed()}, ${si(0,100,e*100).toFixed()}%, ${si(0,100,n*100).toFixed()}%, ${parseFloat(si(0,1,r).toFixed(3))})`}function lr(t,e){const[n,r,o,i]=AZ(t);return IZ(n,r,o-e,i)}function DZ(t){if(t==="transparent")return 0;function e(i){const s=i/255;return s<=.04045?s/12.92:Math.pow((s+.055)/1.055,2.4)}const[n,r,o]=Tb(t);return .2126*e(n)+.7152*e(r)+.0722*e(o)}function LZ(t,e,n,r){return`rgba(${si(0,255,t).toFixed()}, ${si(0,255,e).toFixed()}, ${si(0,255,n).toFixed()}, ${parseFloat(si(0,1,r).toFixed(3))})`}function Xp(t,e){return lr(t,-e)}function xm(t,e){const[n,r,o,i]=Tb(t);return LZ(n,r,o,i-e)}function jZ(t){return DZ(t)>.179}function oc(t){return jZ(t)?"#000":"#fff"}const zZ="remirror-editor-wrapper",FZ="remirror-button-active",BZ="remirror-button",UZ="remirror-composite",VZ="remirror-dialog",HZ="remirror-dialog-backdrop",WZ="remirror-form",KZ="remirror-form-message",qZ="remirror-form-label",GZ="remirror-form-group",YZ="remirror-group",ZZ="remirror-input",JZ="remirror-menu",XZ="remirror-menu-pane",QZ="remirror-menu-pane-active",eJ="remirror-menu-dropdown-label",tJ="remirror-menu-pane-icon",nJ="remirror-menu-pane-label",rJ="remirror-menu-pane-shortcut",oJ="remirror-menu-button-left",iJ="remirror-menu-button-right",sJ="remirror-menu-button-nested-left",aJ="remirror-menu-button-nested-right",lJ="remirror-menu-button",cJ="remirror-menu-bar",uJ="remirror-flex-column",dJ="remirror-flex-row",fJ="remirror-menu-item",pJ="remirror-menu-item-row",hJ="remirror-menu-item-column",mJ="remirror-menu-item-checkbox",gJ="remirror-menu-item-radio",vJ="remirror-menu-group",yJ="remirror-floating-popover",xJ="remirror-popover",bJ="remirror-animated-popover",wJ="remirror-role",kJ="remirror-separator",SJ="remirror-tab",EJ="remirror-tab-list",_J="remirror-tabbable",CJ="remirror-toolbar",TJ="remirror-tooltip",OJ="remirror-table-size-editor",MJ="remirror-table-size-editor-body",RJ="remirror-table-size-editor-cell",NJ="remirror-table-size-editor-cell-selected",PJ="remirror-table-size-editor-footer",$J="remirror-color-picker",AJ="remirror-color-picker-cell",IJ="remirror-color-picker-cell-selected";var DJ=Object.freeze({__proto__:null,ANIMATED_POPOVER:bJ,BUTTON:BZ,BUTTON_ACTIVE:FZ,COLOR_PICKER:$J,COLOR_PICKER_CELL:AJ,COLOR_PICKER_CELL_SELECTED:IJ,COMPOSITE:UZ,DIALOG:VZ,DIALOG_BACKDROP:HZ,EDITOR_WRAPPER:zZ,FLEX_COLUMN:uJ,FLEX_ROW:dJ,FLOATING_POPOVER:yJ,FORM:WZ,FORM_GROUP:GZ,FORM_LABEL:qZ,FORM_MESSAGE:KZ,GROUP:YZ,INPUT:ZZ,MENU:JZ,MENU_BAR:cJ,MENU_BUTTON:lJ,MENU_BUTTON_LEFT:oJ,MENU_BUTTON_NESTED_LEFT:sJ,MENU_BUTTON_NESTED_RIGHT:aJ,MENU_BUTTON_RIGHT:iJ,MENU_DROPDOWN_LABEL:eJ,MENU_GROUP:vJ,MENU_ITEM:fJ,MENU_ITEM_CHECKBOX:mJ,MENU_ITEM_COLUMN:hJ,MENU_ITEM_RADIO:gJ,MENU_ITEM_ROW:pJ,MENU_PANE:XZ,MENU_PANE_ACTIVE:QZ,MENU_PANE_ICON:tJ,MENU_PANE_LABEL:nJ,MENU_PANE_SHORTCUT:rJ,POPOVER:xJ,ROLE:wJ,SEPARATOR:kJ,TAB:SJ,TABBABLE:_J,TABLE_SIZE_EDITOR:OJ,TABLE_SIZE_EDITOR_BODY:MJ,TABLE_SIZE_EDITOR_CELL:RJ,TABLE_SIZE_EDITOR_CELL_SELECTED:NJ,TABLE_SIZE_EDITOR_FOOTER:PJ,TAB_LIST:EJ,TOOLBAR:CJ,TOOLTIP:TJ});const LJ="remirror-image-loader";var jJ=Object.freeze({__proto__:null,IMAGE_LOADER:LJ});const zJ="remirror-list-item-with-custom-mark",FJ="remirror-ul-list-content",BJ="remirror-editor",UJ="remirror-list-item-marker-container",VJ="remirror-list-item-checkbox",HJ="remirror-collapsible-list-item-closed",WJ="remirror-collapsible-list-item-button",KJ="remirror-list-spine";var Ls=Object.freeze({__proto__:null,COLLAPSIBLE_LIST_ITEM_BUTTON:WJ,COLLAPSIBLE_LIST_ITEM_CLOSED:HJ,EDITOR:BJ,LIST_ITEM_CHECKBOX:VJ,LIST_ITEM_MARKER_CONTAINER:UJ,LIST_ITEM_WITH_CUSTOM_MARKER:zJ,LIST_SPINE:KJ,UL_LIST_CONTENT:FJ});const qJ="remirror-is-empty";var GJ=Object.freeze({__proto__:null,IS_EMPTY:qJ});const YJ="remirror-editor",ZJ="remirror-positioner",JJ="remirror-positioner-widget";var XJ=Object.freeze({__proto__:null,EDITOR:YJ,POSITIONER:ZJ,POSITIONER_WIDGET:JJ});const qr={gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]},ai="#000000",Ob="#ffffff",QJ="#252103",Mb=xm(ai,.75),jg="#7963d2",Rb="#bcd263",eX="#fff",tX="#fff",Nb=qr.gray[1],u_="rgba(10,31,68,0.08)",d_="rgba(10,31,68,0.10)",f_="rgba(10,31,68,0.12)",nX=Xp(xm(ai,.1),.13),Pb={background:Ob,border:Mb,foreground:ai,muted:Nb,primary:jg,secondary:Rb,primaryText:eX,secondaryText:tX,text:QJ,faded:nX},rX={...Pb,background:lr(Ob,.15),border:lr(Mb,.15),foreground:lr(ai,.15),muted:lr(Nb,.15),primary:lr(jg,.15),secondary:lr(Rb,.15),get text(){return oc(this.background)},get primaryText(){return oc(this.primary)},get secondaryText(){return oc(this.secondary)}},oX={...Pb,background:lr(Ob,.075),border:lr(Mb,.075),foreground:lr(ai,.075),muted:lr(Nb,.075),primary:lr(jg,.075),secondary:lr(Rb,.075),get text(){return oc(this.background)},get primaryText(){return oc(this.primary)},get secondaryText(){return oc(this.secondary)}};({...Pb,backdrop:xm(ai,.1),outline:xm(jg,.6),table:(Xp(ai,.8),Xp(ai,.4),qr.gray[3],qr.blue[7],qr.blue[1],qr.blue[5],qr.blue[7],Xp(ai,.4),qr.blue[5],qr.red[7],qr.red[1],qr.red[5])},`${u_}`,`${d_}`,`${f_}`);var iX=Object.defineProperty,sX=Object.getOwnPropertyDescriptor,$b=(t,e,n,r)=>{for(var o=r>1?void 0:r?sX(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&iX(e,n,o),o},pP=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},Ut=(t,e,n)=>(pP(t,e,"read from private field"),n?n.call(t):e.get(t)),qo=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},ji=(t,e,n,r)=>(pP(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),ju,zu,Ol,Fu,Qp,Bu,Uu,Vu,Hu,eh=class{constructor(t){qo(this,ju,bg()),qo(this,zu,[]),qo(this,Ol,new Map),qo(this,Fu,[]),qo(this,Qp,!1),qo(this,Bu,void 0),qo(this,Uu,void 0),qo(this,Vu,void 0),qo(this,Hu,void 0),this.addListener=(e,n)=>Ut(this,ju).on(e,n),ji(this,Bu,t),ji(this,Uu,t.getActive),ji(this,Hu,t.getPosition),ji(this,Vu,t.getID),this.hasChanged=t.hasChanged,this.events=t.events??["state","scroll"]}static create(t){return new eh(t)}static fromPositioner(t,e){return eh.create({...t.basePositioner,...e})}get basePositioner(){return{getActive:Ut(this,Uu),getPosition:Ut(this,Hu),hasChanged:this.hasChanged,events:this.events,getID:Ut(this,Vu)}}onActiveChanged(t){this.recentUpdate=t;const e=Ut(this,Uu).call(this,t);ji(this,zu,e),ji(this,Ol,new Map),ji(this,Qp,!1),ji(this,Fu,[]);const n=[];for(const[r,o]of e.entries()){const i=this.getID(o,r);Ut(this,Fu).push(i),n.push({setElement:s=>this.addProps({...t,data:o,element:s},r),id:i,data:o})}Ut(this,ju).emit("update",n)}getID(t,e){var n;return((n=Ut(this,Vu))==null?void 0:n.call(this,t,e))??e.toString()}addProps(t,e){if(Ut(this,Qp)||(Ut(this,Ol).set(e,t),Ut(this,Ol).size<Ut(this,zu).length))return;const n=[];for(const r of Ut(this,zu).keys()){const o=Ut(this,Ol).get(r);ve(o,{code:K.INTERNAL,message:"Something went wrong when retrieving the parameters"});const i=Ut(this,Fu)[r];if(!i)return;n.push({position:Ut(this,Hu).call(this,o),element:o.element,id:i})}Ut(this,ju).emit("done",n)}clone(t){return eh.create({...Ut(this,Bu),...dt(t)?t(Ut(this,Bu)):t})}active(t){const e=dt(t)?t:()=>t;return this.clone(n=>({getActive:r=>n.getActive(r).filter(e)}))}},uo=eh;ju=new WeakMap;zu=new WeakMap;Ol=new WeakMap;Fu=new WeakMap;Qp=new WeakMap;Bu=new WeakMap;Uu=new WeakMap;Vu=new WeakMap;Hu=new WeakMap;uo.EMPTY=[];function aX(t,e=vP){const{key:n}=(t==null?void 0:t.getMeta(gP))??{};return n===e}function hP(t){const{tr:e,state:n,previousState:r}=t;return!r||e&&aX(e)?!0:e?lV(e):!n.doc.eq(r.doc)||!n.selection.eq(r.selection)}function mP(t,e,n={}){const r=e.getBoundingClientRect(),{accountForPadding:o=!1}=n;let i=0,s=0,a=0,l=0;if(Fo(e)&&o){const u=Number.parseFloat(Li(e,"padding-left").replace("px","")),d=Number.parseFloat(Li(e,"padding-right").replace("px","")),f=Number.parseFloat(Li(e,"padding-top").replace("px","")),p=Number.parseFloat(Li(e,"padding-bottom").replace("px","")),m=Number.parseFloat(Li(e,"border-left").replace("px","")),g=Number.parseFloat(Li(e,"border-right").replace("px","")),y=Number.parseFloat(Li(e,"border-top").replace("px","")),v=Number.parseFloat(Li(e,"border-bottom").replace("px","")),x=e.offsetWidth-e.clientWidth,w=e.offsetHeight-e.clientHeight;i+=u+m+(e.dir==="rtl"?x:0),s+=d+g+(e.dir==="rtl"?0:x),a+=f+y,l+=p+v+w}const c=new DOMRect(r.left+i,r.top+a,r.width-s,r.height-l);for(const[u,d]of[[t.top,t.left],[t.top,t.right],[t.bottom,t.left],[t.bottom,t.right]])if(jS(u,c.top,c.bottom)&&jS(d,c.left,c.right))return!0;return!1}var lX="remirror-positioner-widget",gP="positionerUpdate",vP="__all_positioners__",yP={y:-999999,x:-999999,width:0,height:0},p_={...yP,left:-999999,top:-999999,bottom:-999999,right:-999999},cX={...yP,rect:{...p_,toJSON:()=>p_},visible:!1},uX=uo.create({hasChanged:hP,getActive(t){const{state:e}=t;if(!vb(e)||e.selection.$anchor.depth>2)return uo.EMPTY;const n=Og({predicate:r=>r.type.isBlock,selection:e});return n?[n]:uo.EMPTY},getPosition(t){const{view:e,data:n}=t,r=e.nodeDOM(n.pos);if(!Fo(r))return cX;const o=r.getBoundingClientRect(),i=e.dom.getBoundingClientRect(),s=o.height,a=o.width,l=e.dom.scrollLeft+o.left-i.left,c=e.dom.scrollTop+o.top-i.top,u=mP(o,e.dom);return{y:c,x:l,height:s,width:a,rect:o,visible:u}}}),xP=uX.clone(({getActive:t})=>({getActive:e=>{const[n]=t(e);return n&&wb(n.node)&&n.node.type===Ng(e.state.schema)?[n]:uo.EMPTY}}));xP.clone(({getPosition:t})=>({getPosition:e=>({...t(e),width:1})}));xP.clone(({getPosition:t})=>({getPosition:e=>{const{width:n,x:r,y:o,height:i}=t(e);return{...t(e),width:1,x:n+r,rect:new DOMRect(n+r,o,1,i)}}}));function Ab(t){return uo.create({hasChanged:hP,getActive:e=>{const{state:n,view:r}=e;if(!t(n)||!tl(n.selection))return uo.EMPTY;try{const{head:o,anchor:i}=n.selection;return[{from:r.coordsAtPos(i),to:r.coordsAtPos(o)}]}catch{return uo.EMPTY}},getPosition(e){const{element:n,data:r,view:o}=e,{from:i,to:s}=r,a=n.offsetParent??o.dom,l=a.getBoundingClientRect(),c=Math.abs(s.bottom-i.top),u=c>i.bottom-i.top,d=Math.min(i.left,s.left),f=Math.min(i.top,s.top),p=a.scrollLeft+(u?s.left-l.left:d-l.left),m=a.scrollTop+f-l.top,g=u?1:Math.abs(i.left-s.right),y=new DOMRect(u?s.left:d,f,g,c),v=mP(y,o.dom);return{rect:y,y:m,x:p,height:c,width:g,visible:v}}})}var dX=Ab(t=>!t.selection.empty);Ab(t=>t.selection.empty);Ab(()=>!0);dX.clone(()=>({getActive:t=>{const{state:e,view:n}=t;if(!e.selection.empty)return uo.EMPTY;const r=RN(e);if(!r)return uo.EMPTY;try{return[{from:n.coordsAtPos(r.from),to:n.coordsAtPos(r.to)}]}catch{return uo.EMPTY}}}));var af=class extends St{constructor(){super(...arguments),this.positioners=[],this.onAddCustomHandler=({positioner:t})=>{if(t)return this.positioners=[...this.positioners,t],this.store.commands.forceUpdate(),()=>{this.positioners=this.positioners.filter(e=>e!==t)}}}get name(){return"positioner"}createAttributes(){return{class:XJ.EDITOR}}init(){this.onScroll=dz(this.options.scrollDebounce,this.onScroll.bind(this))}createEventHandlers(){return{scroll:()=>(this.onScroll(),!1),hover:(t,e)=>(this.positioner(this.getBaseProps("hover",{hover:e})),!1),contextmenu:(t,e)=>(this.positioner(this.getBaseProps("contextmenu",{contextmenu:e})),!1)}}onStateUpdate(t){this.positioner({...t,previousState:t.firstUpdate?void 0:t.previousState,event:"state",helpers:this.store.helpers})}createDecorations(t){if(this.element??(this.element=this.createElement()),!this.element.hasChildNodes())return Qe.empty;const e=kt.widget(0,this.element,{key:"positioner-widget",side:-1,stopEvent:()=>!0});return Qe.create(t.doc,[e])}forceUpdatePositioners(t=vP){return({tr:e,dispatch:n})=>(n==null||n(e.setMeta(gP,{key:t})),!0)}getPositionerWidget(){return this.element??(this.element=this.createElement())}createElement(){const t=document.createElement("span");return t.dataset.id=lX,t.setAttribute("role","presentation"),t}triggerPositioner(t,e){t.hasChanged(e)&&t.onActiveChanged({...e,view:this.store.view})}positioner(t){for(const e of this.positioners)e.events.includes(t.event)&&this.triggerPositioner(e,t)}getBaseProps(t,e){const n=this.store.getState(),r=this.store.previousState;return{helpers:this.store.helpers,event:t,firstUpdate:!1,previousState:r,state:n,...e}}onScroll(){this.positioner(this.getBaseProps("scroll",{scroll:{scrollTop:this.store.view.dom.scrollTop}}))}};$b([ue()],af.prototype,"forceUpdatePositioners",1);$b([At()],af.prototype,"getPositionerWidget",1);af=$b([Ze({defaultOptions:{scrollDebounce:100},customHandlerKeys:["positioner"],staticKeys:["scrollDebounce"]})],af);var fX=Object.defineProperty,pX=Object.getOwnPropertyDescriptor,hX=(t,e,n,r)=>{for(var o=r>1?void 0:r?pX(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&fX(e,n,o),o},cx=class extends Fr{get name(){return"text"}createTags(){return[Ie.InlineNode]}createNodeSpec(){return{}}};cx=hX([Ze({disableExtraAttributes:!0,defaultPriority:at.Medium})],cx);var mX={...Tc.defaultOptions,...Ha.defaultOptions,...Bo.defaultOptions,excludeExtensions:[]};function gX(t={}){t={...mX,...t};const{content:e,depth:n,getDispatch:r,getState:o,newGroupDelay:i,excludeExtensions:s}=t,a={};for(const c of s??[])a[c]=!0;const l=[];if(!a.history){const c=new Bo({depth:n,getDispatch:r,getState:o,newGroupDelay:i});l.push(c)}return a.doc||l.push(new Tc({content:e})),a.text||l.push(new cx),a.paragraph||l.push(new Ha),a.positioner||l.push(new af),a.gapCursor||l.push(new ax),a.events||l.push(new vm),l}var vX=Object.defineProperty,yX=Object.getOwnPropertyDescriptor,xX=(t,e,n,r)=>{for(var o=r>1?void 0:r?yX(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&vX(e,n,o),o},Wa=class extends St{get name(){return"placeholder"}createAttributes(){return{"aria-placeholder":this.options.placeholder}}createPlugin(){return{state:{init:(t,e)=>({...this.options,empty:bb(e.doc,{ignoreAttributes:!0})}),apply:(t,e,n,r)=>bX({pluginState:e,tr:t,extension:this,state:r})},props:{decorations:t=>wX({state:t,extension:this})}}}onSetOptions(t){const{changes:e}=t;e.placeholder.changed&&this.store.phase>=qn.EditorView&&this.store.updateAttributes()}};Wa=xX([Ze({defaultOptions:{emptyNodeClass:GJ.IS_EMPTY,placeholder:""}})],Wa);function bX(t){const{pluginState:e,extension:n,tr:r,state:o}=t;return r.docChanged?{...n.options,empty:bb(o.doc)}:e}function wX(t){const{extension:e,state:n}=t,{empty:r}=e.pluginKey.getState(n),{emptyNodeClass:o,placeholder:i}=e.options;if(!r)return null;const s=[];return n.doc.descendants((a,l)=>{const c=kt.node(l,l+a.nodeSize,{class:o,"data-placeholder":i});s.push(c)}),Qe.create(n.doc,s)}var kX=Object.defineProperty,SX=Object.getOwnPropertyDescriptor,EX=(t,e,n,r)=>{for(var o=r>1?void 0:r?SX(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&kX(e,n,o),o},_X={...Wa.defaultOptions,...rf.defaultOptions},CX=[...Wa.staticKeys,...rf.staticKeys],lf=class extends St{get name(){return"react"}onSetOptions(t){const{pickChanged:e}=t;this.getExtension(Wa).setOptions(e(["placeholder"]))}createExtensions(){const{emptyNodeClass:t,placeholder:e,defaultBlockNode:n,defaultContentNode:r,defaultEnvironment:o,defaultInlineNode:i,nodeViewComponents:s}=this.options;return[new Wa({emptyNodeClass:t,placeholder:e,priority:at.Low}),new rf({defaultBlockNode:n,defaultContentNode:r,defaultEnvironment:o,defaultInlineNode:i,nodeViewComponents:s})]}};lf=EX([Ze({defaultOptions:_X,staticKeys:CX})],lf);var bP={};Object.defineProperty(bP,"__esModule",{value:!0});function TX(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===2)return m_(t[0],t[1])||null;var n=t.slice(1).reduce(function(r,o){return m_(r,o)},t[0]);return n||null}var fu=bP.default=TX,h_=new WeakMap;function m_(t,e){if(t&&e){var n=h_.get(t)||new WeakMap;h_.set(t,n);var r=n.get(e)||function(o){g_(t,o),g_(e,o)};return n.set(e,r),r}return t||e}function g_(t,e){typeof t=="function"?t(e):t.current=e}var wP=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},ny=(t,e,n)=>(wP(t,e,"read from private field"),n?n.call(t):e.get(t)),OX=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},MX=(t,e,n,r)=>(wP(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);function RX(){const[,t]=h.useState(pe());return h.useCallback(()=>{t(pe())},[])}var kP=h.createContext(null);function Kc(t){const e=h.useContext(kP),n=h.useRef(RX());ve(e,{code:K.REACT_PROVIDER_CONTEXT});const{addHandler:r}=e;return h.useEffect(()=>{let o=t;if(o){if(el(o)){const{autoUpdate:i}=o;o=i?()=>n.current():void 0}if(dt(o))return r("updated",o)}},[r,t]),e}function NX(t=!0){return Kc({autoUpdate:t}).active}function PX(t=!1){return Kc(t?{autoUpdate:!0}:void 0).attrs}function Ib(){return Kc().chain.new()}function $X(t,e=void 0,n){const{getExtension:r}=Kc(),o=h.useMemo(()=>r(t),[t,r]);let i;if(dt(e)?i=n?[o,...n]:[o,e]:i=e?[o,...Object.values(e)]:[],h.useEffect(()=>{dt(e)||!e||o.setOptions(e)},i),h.useEffect(()=>{if(dt(e))return e({addHandler:o.addHandler.bind(o),addCustomHandler:o.addCustomHandler.bind(o),extension:o})},i),!e)return o}function AX(t,e,n){const r=h.useCallback(({addHandler:o})=>o(e,n),[n,e]);return $X(t,r)}function IX(t){AX(hm,"docChanged",t)}function DX(t=!1){return Kc(t?{autoUpdate:!0}:void 0).helpers}var[LX,Qoe]=MW(({props:t})=>{const e=t.locale??"en",n=t.i18n??Dg,r=t.supportedLocales??[e],o=n._.bind(n);return{locale:e,i18n:n,supportedLocales:r,t:o}});function v_(t,e={}){const{core:n,react:r,...o}=e;return vW(t)?t:gW.create(()=>[...rR(t),new lf(r),...gX(n)],o)}function jX(t,e={}){const n=h.useRef(t),r=h.useRef(e),[o,i]=h.useState(()=>v_(t,e));return n.current=t,r.current=e,h.useEffect(()=>o.addHandler("destroy",()=>{i(()=>v_(n.current,r.current))}),[o]),o}var zX=typeof fu=="object"&&fu.__esModule&&fu.default?fu.default:fu,Ml,FX=class extends dW{constructor(t){if(super(t),OX(this,Ml,void 0),this.rootPropsConfig={called:!1,count:0},this.getRootProps=e=>this.internalGetRootProps(e,null),this.internalGetRootProps=(e,n)=>{this.rootPropsConfig.called=!0;const{refKey:r="ref",ref:o,...i}=e??pe();return{[r]:zX(o,this.onRef),key:this.uid,...i,children:n}},this.onRef=e=>{e&&(this.rootPropsConfig.count+=1,ve(this.rootPropsConfig.count<=1,{code:K.REACT_GET_ROOT_PROPS,message:`Called ${this.rootPropsConfig.count} times`}),MX(this,Ml,e),this.onRefLoad())},this.manager.view){this.manager.view.setProps({state:this.manager.view.state,dispatchTransaction:this.dispatchTransaction,attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0});return}this.manager.getExtension(Wa).setOptions({placeholder:this.props.placeholder??""})}get name(){return"react"}update(t){return super.update(t),this}createView(t){return new MU(null,{state:t,dispatchTransaction:this.dispatchTransaction,attributes:()=>this.getAttributes(),editable:()=>this.props.editable??!0,plugins:[]})}updateState({state:t,...e}){const{triggerChange:n=!0,tr:r,transactions:o}=e;if(this.props.state){const{onChange:i}=this.props;ve(i,{code:K.REACT_CONTROLLED,message:"You are required to provide the `onChange` handler when creating a controlled editor."}),ve(n,{code:K.REACT_CONTROLLED,message:"Controlled editors do not support `clearContent` or `setContent` where `triggerChange` is `true`. Update the `state` prop instead."}),this.previousStateOverride||(this.previousStateOverride=this.getState()),this.onChange({state:t,tr:r,transactions:o});return}!r&&!o&&(t=t.apply(t.tr.setMeta($S,{}))),this.view.updateState(t),n&&(o==null?void 0:o.length)!==0&&this.onChange({state:t,tr:r,transactions:o}),this.manager.onStateUpdate({previousState:this.previousState,state:t,tr:r,transactions:o})}updateControlledState(t,e){this.previousStateOverride=e,t=t.apply(t.tr.setMeta($S,{})),this.view.updateState(t),this.manager.onStateUpdate({previousState:this.previousState,state:t}),this.previousStateOverride=void 0}addProsemirrorViewToDom(t,e){this.props.insertPosition==="start"?t.insertBefore(e,t.firstChild):t.append(e)}onRefLoad(){ve(ny(this,Ml),{code:K.REACT_EDITOR_VIEW,message:"Something went wrong when initializing the text editor. Please check your setup."});const{autoFocus:t}=this.props;this.addProsemirrorViewToDom(ny(this,Ml),this.view.dom),t&&this.focus(t),this.onChange(),this.addFocusListeners()}onUpdate(){this.view&&ny(this,Ml)&&this.view.setProps({...this.view.props,editable:()=>this.props.editable??!0})}get frameworkOutput(){return{...this.baseOutput,getRootProps:this.getRootProps,portalContainer:this.manager.store.portalContainer}}resetRender(){this.rootPropsConfig.called=!1,this.rootPropsConfig.count=0}};Ml=new WeakMap;var SP=typeof document<"u"?h.useLayoutEffect:h.useEffect;function BX(t){const e=h.useRef();return SP(()=>{e.current=t}),e.current}function UX(t){const{manager:e,state:n}=t,{placeholder:r,editable:o}=t;h.useRef(!0).current&&!$s(r)&&e.getExtension(lf).setOptions({placeholder:r}),h.useEffect(()=>{r!=null&&e.getExtension(lf).setOptions({placeholder:r})},[r,e]);const[s]=h.useState(()=>{if(n)return n;const l=e.createEmptyDoc(),[c,u]=Gt(t.initialContent)?t.initialContent:[t.initialContent??l];return e.createState({content:c,selection:u})}),a=VX({initialEditorState:s,getProps:()=>t});return h.useEffect(()=>()=>{a.destroy()},[a]),h.useEffect(()=>{a.onUpdate()},[o,a]),HX(a),a.frameworkOutput}function VX(t){const e=h.useRef(t);e.current=t;const n=h.useMemo(()=>new FX(e.current),[]);return n.update(t),n}function HX(t){const{state:e}=t.props,n=h.useRef(!!e),r=BX(e);SP(()=>{const o=e?n.current===!0:n.current===!1;ve(o,{code:K.REACT_CONTROLLED,message:n.current?"You have attempted to switch from a controlled to an uncontrolled editor. Once you set up an editor as a controlled editor it must always provide a `state` prop.":"You have provided a `state` prop to an uncontrolled editor. In order to set up your editor as controlled you must provide the `state` prop from the very first render."}),!(!e||e===r)&&t.updateControlledState(e,r??void 0)},[e,r,t])}function WX(t={}){const{content:e,document:n,selection:r,extensions:o,...i}=t,s=jX(o??(()=>[]),i),[a,l]=h.useState(()=>s.createState({selection:r,content:e??s.createEmptyDoc()})),c=h.useCallback(({state:d})=>{l(d)},[]),u=h.useCallback(()=>s.output,[s]);return h.useMemo(()=>({state:a,setState:l,manager:s,onChange:c,getContext:u}),[u,s,c,a])}var KX=({onChange:t})=>{const{getJSON:e}=DX();return IX(h.useCallback(({state:n})=>{const r=e(n);t(r)},[t,e])),null},ux=()=>oe.createElement("div",{className:DJ.EDITOR_WRAPPER,...Kc().getRootProps()}),qX=t=>(t.hook(),null);function GX(t){const{children:e,autoRender:n,i18n:r,locale:o,supportedLocales:i,hooks:s=[],...a}=t,l=UX(a),c=SW(l.portalContainer),u=n==="start"||n===!0||!e&&$s(n),d=n==="end";return oe.createElement(LX,{i18n:r,locale:o,supportedLocales:i},oe.createElement(kP.Provider,{value:l},oe.createElement(kW,{portals:c}),s.map((f,p)=>oe.createElement(qX,{hook:f,key:p})),u&&oe.createElement(ux,null),e,d&&oe.createElement(ux,null)))}function YX(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(t)&&s.startIndex==0){if(o.index(s.depth-1)==0)return!1;let u=n.doc.resolve(s.start-2);l=new Fa(u,u,s.depth),s.endIndex<s.parent.childCount&&(s=new Fa(o,n.doc.resolve(i.end(s.depth)),s.depth)),a=!0}let c=eb(l,t,e,s);return c?(r&&r(ZX(n.tr,s,c,a,t).scrollIntoView()),!0):!1}}function ZX(t,e,n,r,o){let i=F.empty;for(let u=n.length-1;u>=0;u--)i=F.from(n[u].type.create(n[u].attrs,i));t.step(new zt(e.start-(r?2:0),e.end,e.start,e.end,new J(i,0,0),n.length,!0));let s=0;for(let u=0;u<n.length;u++)n[u].type==o&&(s=u+1);let a=n.length-s,l=e.start+n.length-(r?2:0),c=e.parent;for(let u=e.startIndex,d=e.endIndex,f=!0;u<d;u++,f=!1)!f&&tc(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=c.child(u).nodeSize;return t}function JX(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,s=>s.childCount>0&&s.firstChild.type==t);return i?n?r.node(i.depth-1).type==t?XX(e,n,t,i):QX(e,n,i):!0:!1}}function XX(t,e,n,r){let o=t.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new zt(i-1,s,i,s,new J(F.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Fa(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));const a=Bc(r);if(a==null)return!1;o.lift(r,a);let l=o.mapping.map(i,-1)-1;return Pf(o.doc,l)&&o.join(l),e(o.scrollIntoView()),!0}function QX(t,e,n){let r=t.tr,o=n.parent;for(let p=n.end,m=n.endIndex-1,g=n.startIndex;m>g;m--)p-=o.child(m).nodeSize,r.delete(p-1,p+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?F.empty:F.from(o))))return!1;let d=i.pos,f=d+s.nodeSize;return r.step(new zt(d-(a?1:0),f+(l?1:0),d+1,f-1,new J((a?F.empty:F.from(o.copy(F.empty))).append(l?F.empty:F.from(o.copy(F.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}var eQ=Object.defineProperty,tQ=Object.getOwnPropertyDescriptor,Br=(t,e,n,r)=>{for(var o=r>1?void 0:r?tQ(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&eQ(e,n,o),o};function dx(t){var e;return!!((e=t.spec.group)!=null&&e.includes(Ie.ListContainerNode))}function nQ(t){var e;return!!((e=t.spec.group)!=null&&e.includes(Ie.ListItemNode))}function js(t){return dx(t.type)}function Es(t){return nQ(t.type)}function Db(t,e){return n=>{const{dispatch:r,tr:o}=n,i=mb(o,n.state),{$from:s,$to:a}=o.selection,l=s.blockRange(a);if(!l)return!1;const c=Og({predicate:u=>dx(u.type),selection:o.selection});if(c&&l.depth-c.depth<=1&&l.startIndex===0){if(c.node.type===t)return CP(e)(n);if(dx(c.node.type))return t.validContent(c.node.content)?(r==null||r(o.setNodeMarkup(c.pos,t)),!0):rQ(o,c,t,e)?(r==null||r(o.scrollIntoView()),!0):!1}return YX(t)(i,r)}}function EP(t,e=["checked"]){return function({tr:n,dispatch:r,state:o}){var i,s;const a=hV(t,o.schema),{$from:l,$to:c}=n.selection;if(Rg(n.selection)&&n.selection.node.isBlock||l.depth<2||!l.sameParent(c))return!1;const u=l.node(-1);if(u.type!==a)return!1;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(r){const g=l.index(-1)>0;let y=F.empty;for(let w=l.depth-(g?1:2);w>=l.depth-3;w--)y=F.from(l.node(w).copy(y));const v=((i=a.contentMatch.defaultType)==null?void 0:i.createAndFill())||void 0;y=y.append(F.from(a.createAndFill(null,v)||void 0));const x=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3;n.replace(l.before(g?void 0:-1),l.after(-x),new J(y,g?3:2,2)),n.setSelection(n.selection.constructor.near(n.doc.resolve(l.pos+(g?3:2)))),r(n.scrollIntoView())}return!0}if(u.attrs.closed&&l.sameParent(c)&&c.pos===c.end()){if(r){const g=l.after(-1),y=((s=a.contentMatch.defaultType)==null?void 0:s.createAndFill())||void 0,v=a.createAndFill(null,y);v&&(n.insert(g,v),n.setSelection(Ce.near(n.doc.resolve(g+1)))),n.delete(l.pos,c.pos),r(n.scrollIntoView())}return!0}const d=Object.fromEntries(Object.entries(u.attrs).filter(([g])=>!e.includes(g))),f=c.pos===l.end()?u.contentMatchAt(0).defaultType:null,p={...l.node().attrs};n.delete(l.pos,c.pos);const m=f?[{type:a,attrs:d},{type:f,attrs:p}]:[{type:a,attrs:d}];return tc(n.doc,l.pos,2)?(r&&r(n.split(l.pos,2,m).scrollIntoView()),!0):!1}}function rQ(t,e,n,r){const o=e.node,i=t.doc.resolve(e.start),s=i.node(-1),a=i.index(-1);if(!s||!s.canReplace(a,a+1,F.from(n.create())))return!1;const l=[];for(let p=0;p<o.childCount;p++){const m=o.child(p);if(!r.validContent(m.content))return!1;const g=r.createChecked(null,m.content);l.push(g)}const c=n.createChecked(null,l),u=e.pos,d=u+o.nodeSize,f=t.selection.from;return t.replaceRangeWith(u,d,c),t.setSelection(t.selection.constructor.near(t.doc.resolve(f))),!0}function oQ({listType:t,itemType:e,tr:n,range:r}){var o;const i=r.parent,s=n.doc.slice(r.start,r.end);if(i.type===t&&((o=s.content.firstChild)==null?void 0:o.type)===e)return!1;const a=[];for(let c=0;c<s.content.childCount;c++){const u=s.content.child(c);if(!e.validContent(u.content))return!1;const d=e.createChecked(null,u.content);a.push(d)}const l=t.createChecked(null,a);return n.replaceRange(r.start,r.end,new J(F.from(l),0,0)),!0}function Oc({listType:t,itemType:e,tr:n}){const r=bm(n.selection);if(!r)return!1;const o=r.startIndex===0,{from:i,to:s}=n.selection;return oQ({listType:t,itemType:e,tr:n,range:r})?(n.setSelection(Ce.between(n.doc.resolve(o?i:i+2),n.doc.resolve(o?s:s+2))),n.scrollIntoView(),!0):!1}function iQ(t,e,n){const r=t.tr,o=n.parent,i=r.mapping.maps.length;for(let m=n.end,g=n.endIndex-1,y=n.startIndex;g>y;g--)m-=o.child(g).nodeSize,r.delete(m-1,m+1);const s=r.doc.resolve(n.start),a=s.nodeAfter;if(!a||r.mapping.slice(i).map(n.end)!==n.start+a.nodeSize)return!1;const l=n.startIndex===0,c=n.endIndex===o.childCount,u=s.node(-1),d=s.index(-1);if(!u.canReplace(d+(l?0:1),d+1,a.content.append(c?F.empty:F.from(o))))return!1;const f=s.pos,p=f+a.nodeSize;return r.step(new zt(f-(l?1:0),p+(c?1:0),f+1,p-1,new J((l?F.empty:F.from(o.copy(F.empty))).append(c?F.empty:F.from(o.copy(F.empty))),l?0:1,c?0:1),l?0:1)),e(r.scrollIntoView()),!0}function _P(t,e){const n=e||t.selection.$from;let r=[],o,i,s,a;for(let c=n.depth;c>=0;c--){if(i=n.node(c),o=n.index(c),s=i.maybeChild(o-1),a=i.maybeChild(o),s&&a&&s.type.name===a.type.name&&js(s)){const u=n.before(c+1);r.push(u)}if(o=n.indexAfter(c),s=i.maybeChild(o-1),a=i.maybeChild(o),s&&a&&s.type.name===a.type.name&&js(s)){const u=n.after(c+1);r.push(u)}}r=[...new Set(r)].sort((c,u)=>u-c);let l=!1;for(const c of r)Pf(t.doc,c)&&(t.join(c),l=!0);return l}function CP(t){return e=>{const{dispatch:n,tr:r}=e,o=mb(r,e.state),i=sQ(t,r.selection);return i?(n&&iQ(o,n,i),!0):!1}}function sQ(t,e){const{$from:n,$to:r}=e;return n.blockRange(r,i=>{var s;return((s=i.firstChild)==null?void 0:s.type)===t})}function bm(t){const{$from:e,$to:n}=t;return e.blockRange(n,js)}function aQ(t){const e=t.selection.$from,n=e.blockRange();if(!n||!Es(n.parent)||n.startIndex!==0)return!1;const r=e.node(n.depth-2),o=e.index(n.depth),i=e.index(n.depth-1),s=e.index(n.depth-2),a=r.maybeChild(s-1),l=a==null?void 0:a.lastChild;if(o!==0||i!==0)return!1;if(a&&js(a)&&l&&Es(l))return Oc({listType:a.type,itemType:l.type,tr:t});if(Es(r)){const c=r,u=e.node(n.depth-3);if(js(u))return Oc({listType:u.type,itemType:c.type,tr:t})}return!1}function y_({view:t}){if(!t)return!1;{const e=t.state.selection.$cursor;if(!e||e.parentOffset>0)return!1;const n=e.blockRange();if(!n||!Es(n.parent)||n.startIndex!==0)return!1}{const e=t.state.tr;aQ(e)&&t.dispatch(e)}{const e=t.state.selection.$cursor;if(!e||e.parentOffset>0)return!1;const n=e.blockRange();if(!n||!Es(n.parent)||n.startIndex!==0)return!1;const r=e.index(n.depth),o=e.index(n.depth-1),i=e.index(n.depth-2),s=n.depth-2>=1&&Es(e.node(n.depth-2));r===0&&o===0&&i<=1&&s&&JX(n.parent.type)(t.state,t.dispatch)}return FN(t.state,t.dispatch,t),!0}function TP({node:t,mark:e,updateDOM:n,updateMark:r}){const o=document.createElement("label");o.contentEditable="false",o.classList.add(Ls.LIST_ITEM_MARKER_CONTAINER),o.append(e);const i=document.createElement("div"),s=document.createElement("li");s.classList.add(Ls.LIST_ITEM_WITH_CUSTOM_MARKER),s.append(o),s.append(i);const a=l=>l.type!==t.type?!1:(t=l,n(t,s),r(t,e),!0);return a(t),{dom:s,contentDOM:i,update:a}}function lQ(t,e){const n=t.node(e.depth-1),r=t.node(e.depth-2);return!Es(n)||!js(r)?!1:{parentItem:n,parentList:r}}function cQ(t,e){const n=e.parent,r=e.parent.child(e.endIndex-1),o=e.end,i=e.$to.end(e.depth);return o<i?(t.step(new zt(o-1,i,o,i,new J(F.from(r.type.create(null,n.copy())),1,0),1,!0)),new Fa(t.doc.resolve(e.$from.pos),t.doc.resolve(i),e.depth)):e}function uQ(t,e){const n=e.parent,r=e.parent.child(e.endIndex-1),o=e.end,i=e.$to.end(e.depth-1);return o+1<i?(t.step(new zt(o-1,i,o+1,i,new J(F.from(n.type.create(null,r.type.create(null))),2,0),0,!0)),new Fa(t.selection.$from,t.selection.$to,e.depth)):e}function dQ(t,e,n,r){return Oc({listType:n.type,itemType:r.type,tr:t})?new Fa(t.selection.$from,t.selection.$to,e.depth):e}function fQ(t){let e=bm(t.selection);if(!e)return!1;const n=lQ(t.selection.$from,e);if(!n)return!1;const{parentItem:r,parentList:o}=n;e=cQ(t,e),e=uQ(t,e),e=dQ(t,e,o,r);const i=Bc(e);return typeof i!="number"||(t.lift(e,i),e=bm(t.selection),e&&_P(t,t.doc.resolve(e.end-2))),!0}var pQ=({tr:t,dispatch:e})=>fQ(t)?(e==null||e(t.scrollIntoView()),!0):!1;function hQ(t,e,n){let r,o,i,s;const a=e.doc;if(n.startIndex>=1){r=t.child(n.startIndex-1),o=t,s=a.resolve(n.start).start(n.depth),i=s+1;for(let l=0;l<n.startIndex-1;l++)i+=o.child(l).nodeSize}else{const l=e.index(n.depth-1);if(l>=1){const c=e.node(n.depth-1),u=e.start(n.depth-1);if(o=c.child(l-1),!js(o))return!1;s=u+1;for(let d=0;d<l-1;d++)s+=c.child(d).nodeSize;if(r=o.child(o.childCount-1),i=s+o.nodeSize-r.nodeSize-1,!Es(r))return!1}else return!1}return{previousItem:r,previousList:o,previousItemStart:i,previousListStart:s}}function mQ(t,e,n){let r,o;const i=n.start,s=e.depth>=n.depth+2?e.end(n.depth+2):n.end-1,a=n.end;return s+1>=a?(r=t.slice(i,a),o=null):(r=t.slice(i,s),o=t.slice(s+1,a-1)),{selectedSlice:r,unselectedSlice:o}}function gQ(t){const{$from:e,$to:n}=t.selection,r=bm(t.selection);if(!r)return!1;const o=t.doc.resolve(r.start).node();if(!js(o))return!1;const i=hQ(o,e,r);if(!i)return!1;const{previousItem:s,previousList:a,previousItemStart:l}=i,{selectedSlice:c,unselectedSlice:u}=mQ(t.doc,n,r),d=s.content.append(F.fromArray([o.copy(c.content)])).append(u?u.content:F.empty);t.deleteRange(r.start,r.end);const f=l+s.nodeSize-2,p=s.copy(d);return p.check(),t.replaceRangeWith(l-1,f+1,p),t.setSelection(a===o?Ce.between(t.doc.resolve(e.pos),t.doc.resolve(n.pos)):Ce.between(t.doc.resolve(e.pos-2),t.doc.resolve(n.pos-2))),!0}var vQ=({tr:t,dispatch:e})=>gQ(t)?(e==null||e(t.scrollIntoView()),!0):!1,OP=class extends St{get name(){return"listItemShared"}createKeymap(){const t={Tab:vQ,"Shift-Tab":pQ,Backspace:y_,"Mod-Backspace":y_};if(Qr.isMac){const e={"Ctrl-h":t.Backspace,"Alt-Backspace":t["Mod-Backspace"]};return{...t,...e}}return t}createPlugin(){return{appendTransaction:(t,e,n)=>{const r=n.tr;return _P(r)?r:null}}}},Mc=class extends Fr{get name(){return"listItem"}createTags(){return[Ie.ListItemNode]}createNodeSpec(t,e){return{content:"paragraph block*",defining:!0,draggable:!1,...e,attrs:{...t.defaults(),closed:{default:!1},nested:{default:!1}},parseDOM:[{tag:"li",getAttrs:t.parse,priority:at.Lowest},...e.parseDOM??[]],toDOM:n=>["li",t.dom(n),0]}}createNodeViews(){return this.options.enableCollapsible?(t,e,n)=>{const r=document.createElement("div");return r.classList.add(Ls.COLLAPSIBLE_LIST_ITEM_BUTTON),r.contentEditable="false",r.addEventListener("click",()=>{if(r.classList.contains("disabled"))return;const o=n(),i=ye.create(e.state.doc,o);return e.dispatch(e.state.tr.setSelection(i)),this.store.commands.toggleListItemClosed(),!0}),TP({mark:r,node:t,updateDOM:yQ,updateMark:xQ})}:{}}createKeymap(){return{Enter:EP(this.type)}}createExtensions(){return[new OP]}toggleListItemClosed(t){return({state:{tr:e,selection:n},dispatch:r})=>{if(!Rg(n)||n.node.type.name!==this.name)return!1;const{node:o,from:i}=n;return t=hz(t)?t:!o.attrs.closed,r==null||r(e.setNodeMarkup(i,void 0,{...o.attrs,closed:t})),!0}}liftListItemOutOfList(t){return CP(t??this.type)}};Br([ue()],Mc.prototype,"toggleListItemClosed",1);Br([ue()],Mc.prototype,"liftListItemOutOfList",1);Mc=Br([Ze({defaultOptions:{enableCollapsible:!1},staticKeys:["enableCollapsible"]})],Mc);function yQ(t,e){t.attrs.closed?e.classList.add(Ls.COLLAPSIBLE_LIST_ITEM_CLOSED):e.classList.remove(Ls.COLLAPSIBLE_LIST_ITEM_CLOSED)}function xQ(t,e){t.childCount<=1?e.classList.add("disabled"):e.classList.remove("disabled")}var cf=class extends Fr{get name(){return"bulletList"}createTags(){return[Ie.Block,Ie.ListContainerNode]}createNodeSpec(t,e){return{content:"listItem+",...e,attrs:t.defaults(),parseDOM:[{tag:"ul",getAttrs:t.parse},...e.parseDOM??[]],toDOM:n=>["ul",t.dom(n),0]}}createNodeViews(){return this.options.enableSpine?(t,e,n)=>{var r;const o=document.createElement("div");o.style.position="relative";const i=n(),s=e.state.doc.resolve(i+1),a=s.node(s.depth-1);if(!(((r=a==null?void 0:a.type)==null?void 0:r.name)!=="listItem")){const u=document.createElement("div");u.contentEditable="false",u.classList.add(Ls.LIST_SPINE),u.addEventListener("click",d=>{const f=n(),p=e.state.doc.resolve(f+1),m=p.start(p.depth-1),g=ye.create(e.state.doc,m-1);e.dispatch(e.state.tr.setSelection(g)),this.store.commands.toggleListItemClosed(),d.preventDefault(),d.stopPropagation()}),o.append(u)}const c=document.createElement("ul");return c.classList.add(Ls.UL_LIST_CONTENT),o.append(c),{dom:o,contentDOM:c}}:{}}createExtensions(){return[new Mc({priority:at.Low,enableCollapsible:this.options.enableSpine})]}toggleBulletList(){return Db(this.type,Tt(this.store.schema.nodes,"listItem"))}listShortcut(t){return this.toggleBulletList()(t)}createInputRules(){const t=/^\s*([*+-])\s$/;return[ob(t,this.type),new zr(t,(e,n,r,o)=>{const i=e.tr;return i.deleteRange(r,o),Oc({listType:this.type,itemType:Tt(this.store.schema.nodes,"listItem"),tr:i})?i:null})]}};Br([ue({icon:"listUnordered",label:({t})=>t(rb.BULLET_LIST_LABEL)})],cf.prototype,"toggleBulletList",1);Br([wr({shortcut:q.BulletList,command:"toggleBulletList"})],cf.prototype,"listShortcut",1);cf=Br([Ze({defaultOptions:{enableSpine:!1},staticKeys:["enableSpine"]})],cf);var uf=class extends Fr{get name(){return"orderedList"}createTags(){return[Ie.Block,Ie.ListContainerNode]}createNodeSpec(t,e){return{content:"listItem+",...e,attrs:{...t.defaults(),order:{default:1}},parseDOM:[{tag:"ol",getAttrs:n=>Fo(n)?{...t.parse(n),order:+(n.getAttribute("start")??1)}:{}},...e.parseDOM??[]],toDOM:n=>{const r=t.dom(n);return n.attrs.order===1?["ol",r,0]:["ol",{...r,start:n.attrs.order},0]}}}createExtensions(){return[new Mc({priority:at.Low})]}toggleOrderedList(){return Db(this.type,Tt(this.store.schema.nodes,"listItem"))}listShortcut(t){return this.toggleOrderedList()(t)}createInputRules(){const t=/^(\d+)\.\s$/;return[ob(t,this.type,e=>({order:+Tt(e,1)}),(e,n)=>n.childCount+n.attrs.order===+Tt(e,1)),new zr(t,(e,n,r,o)=>{const i=e.tr;if(i.deleteRange(r,o),!Oc({listType:this.type,itemType:Tt(this.store.schema.nodes,"listItem"),tr:i}))return null;const a=+Tt(n,1);if(a!==1){const l=ef({selection:i.selection,types:this.type});l&&i.setNodeMarkup(l.pos,void 0,{order:a})}return i})]}};Br([ue({icon:"listOrdered",label:({t})=>t(rb.ORDERED_LIST_LABEL)})],uf.prototype,"toggleOrderedList",1);Br([wr({shortcut:q.OrderedList,command:"toggleOrderedList"})],uf.prototype,"listShortcut",1);uf=Br([Ze({})],uf);var MP=class extends Fr{get name(){return"taskListItem"}createTags(){return[Ie.ListItemNode]}createNodeSpec(t,e){return{content:"paragraph block*",defining:!0,draggable:!1,...e,attrs:{...t.defaults(),checked:{default:!1}},parseDOM:[{tag:"li[data-task-list-item]",getAttrs:n=>{let r=!1;return Fo(n)&&n.getAttribute("data-checked")!==null&&(r=!0),{checked:r,...t.parse(n)}},priority:at.Medium},...e.parseDOM??[]],toDOM:n=>["li",{...t.dom(n),"data-task-list-item":"","data-checked":n.attrs.checked?"":void 0},0]}}createNodeViews(){return(t,e,n)=>{const r=document.createElement("input");return r.type="checkbox",r.classList.add(Ls.LIST_ITEM_CHECKBOX),r.contentEditable="false",r.addEventListener("click",o=>{e.editable||o.preventDefault()}),r.addEventListener("change",()=>{const o=n(),i=e.state.doc.resolve(o+1);this.store.commands.toggleCheckboxChecked({$pos:i})}),r.checked=t.attrs.checked,TP({node:t,mark:r,updateDOM:bQ,updateMark:wQ})}}createKeymap(){return{Enter:EP(this.type)}}createExtensions(){return[new OP]}toggleCheckboxChecked(t){let e,n;return typeof t=="boolean"?e=t:t&&(e=t.checked,n=t.$pos),({tr:r,dispatch:o})=>{const i=ef({selection:n??r.selection.$from,types:this.type});if(!i)return!1;const{node:s,pos:a}=i,l={...s.attrs,checked:e??!s.attrs.checked};return o==null||o(r.setNodeMarkup(a,void 0,l)),!0}}createInputRules(){const t=/^\s*(\[( ?|x|X)]\s)$/;return[ob(t,this.type,e=>({checked:["x","X"].includes(cd(e,2))})),new zr(t,(e,n,r,o)=>{const i=e.tr;if(i.deleteRange(r,o),!Oc({listType:Tt(this.store.schema.nodes,"taskList"),itemType:this.type,tr:i}))return null;const a=["x","X"].includes(cd(n,2));if(a){const l=ef({selection:i.selection,types:this.type});l&&i.setNodeMarkup(l.pos,void 0,{checked:a})}return i})]}};Br([ue()],MP.prototype,"toggleCheckboxChecked",1);function bQ(t,e){t.attrs.checked?e.setAttribute("data-checked",""):e.removeAttribute("data-checked"),e.setAttribute("data-task-list-item","")}function wQ(t,e){e.checked=!!t.attrs.checked}var RP=class extends Fr{get name(){return"taskList"}createTags(){return[Ie.Block,Ie.ListContainerNode]}createNodeSpec(t,e){return{content:"taskListItem+",...e,attrs:t.defaults(),parseDOM:[{tag:"ul[data-task-list]",getAttrs:t.parse,priority:at.Medium},...e.parseDOM??[]],toDOM:n=>["ul",{...t.dom(n),"data-task-list":""},0]}}createExtensions(){return[new MP({})]}toggleTaskList(){return Db(this.type,Tt(this.store.schema.nodes,"taskListItem"))}listShortcut(t){return this.toggleTaskList()(t)}};Br([ue({icon:"checkboxMultipleLine",label:({t})=>t(rb.TASK_LIST_LABEL)})],RP.prototype,"toggleTaskList",1);Br([wr({shortcut:q.TaskList,command:"toggleTaskList"})],RP.prototype,"listShortcut",1);const ry="rovingFocusGroup.onEntryFocus",kQ={bubbles:!1,cancelable:!0},Lb="RovingFocusGroup",[fx,NP,SQ]=dg(Lb),[EQ,PP]=Lr(Lb,[SQ]),[_Q,CQ]=EQ(Lb),TQ=h.forwardRef((t,e)=>h.createElement(fx.Provider,{scope:t.__scopeRovingFocusGroup},h.createElement(fx.Slot,{scope:t.__scopeRovingFocusGroup},h.createElement(OQ,z({},t,{ref:e}))))),OQ=h.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...u}=t,d=h.useRef(null),f=We(e,d),p=_f(i),[m=null,g]=Ao({prop:s,defaultProp:a,onChange:l}),[y,v]=h.useState(!1),x=rn(c),w=NP(n),S=h.useRef(!1),[_,k]=h.useState(0);return h.useEffect(()=>{const E=d.current;if(E)return E.addEventListener(ry,x),()=>E.removeEventListener(ry,x)},[x]),h.createElement(_Q,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:m,onItemFocus:h.useCallback(E=>g(E),[g]),onItemShiftTab:h.useCallback(()=>v(!0),[]),onFocusableItemAdd:h.useCallback(()=>k(E=>E+1),[]),onFocusableItemRemove:h.useCallback(()=>k(E=>E-1),[])},h.createElement(Re.div,z({tabIndex:y||_===0?-1:0,"data-orientation":r},u,{ref:f,style:{outline:"none",...t.style},onMouseDown:se(t.onMouseDown,()=>{S.current=!0}),onFocus:se(t.onFocus,E=>{const C=!S.current;if(E.target===E.currentTarget&&C&&!y){const T=new CustomEvent(ry,kQ);if(E.currentTarget.dispatchEvent(T),!T.defaultPrevented){const A=w().filter(G=>G.focusable),B=A.find(G=>G.active),D=A.find(G=>G.id===m),U=[B,D,...A].filter(Boolean).map(G=>G.ref.current);$P(U)}}S.current=!1}),onBlur:se(t.onBlur,()=>v(!1))})))}),MQ="RovingFocusGroupItem",RQ=h.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=t,a=ao(),l=i||a,c=CQ(MQ,n),u=c.currentTabStopId===l,d=NP(n),{onFocusableItemAdd:f,onFocusableItemRemove:p}=c;return h.useEffect(()=>{if(r)return f(),()=>p()},[r,f,p]),h.createElement(fx.ItemSlot,{scope:n,id:l,focusable:r,active:o},h.createElement(Re.span,z({tabIndex:u?0:-1,"data-orientation":c.orientation},s,{ref:e,onMouseDown:se(t.onMouseDown,m=>{r?c.onItemFocus(l):m.preventDefault()}),onFocus:se(t.onFocus,()=>c.onItemFocus(l)),onKeyDown:se(t.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){c.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const g=$Q(m,c.orientation,c.dir);if(g!==void 0){m.preventDefault();let v=d().filter(x=>x.focusable).map(x=>x.ref.current);if(g==="last")v.reverse();else if(g==="prev"||g==="next"){g==="prev"&&v.reverse();const x=v.indexOf(m.currentTarget);v=c.loop?AQ(v,x+1):v.slice(x+1)}setTimeout(()=>$P(v))}})})))}),NQ={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function PQ(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function $Q(t,e,n){const r=PQ(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return NQ[r]}function $P(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function AQ(t,e){return t.map((n,r)=>t[(e+r)%t.length])}const IQ=TQ,DQ=RQ,px=["Enter"," "],LQ=["ArrowDown","PageUp","Home"],AP=["ArrowUp","PageDown","End"],jQ=[...LQ,...AP],zQ={ltr:[...px,"ArrowRight"],rtl:[...px,"ArrowLeft"]},FQ={ltr:["ArrowLeft"],rtl:["ArrowRight"]},zg="Menu",[df,BQ,UQ]=dg(zg),[rl,IP]=Lr(zg,[UQ,jc,PP]),jb=jc(),DP=PP(),[VQ,ol]=rl(zg),[HQ,Lf]=rl(zg),WQ=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=t,a=jb(e),[l,c]=h.useState(null),u=h.useRef(!1),d=rn(i),f=_f(o);return h.useEffect(()=>{const p=()=>{u.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>u.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),h.createElement(R1,a,h.createElement(VQ,{scope:e,open:n,onOpenChange:d,content:l,onContentChange:c},h.createElement(HQ,{scope:e,onClose:h.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:s},r)))},LP=h.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=jb(n);return h.createElement(N1,z({},o,r,{ref:e}))}),jP="MenuPortal",[KQ,zP]=rl(jP,{forceMount:void 0}),qQ=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:o}=t,i=ol(jP,e);return h.createElement(KQ,{scope:e,forceMount:n},h.createElement(Wn,{present:n||i.open},h.createElement(sg,{asChild:!0,container:o},r)))},fo="MenuContent",[GQ,zb]=rl(fo),YQ=h.forwardRef((t,e)=>{const n=zP(fo,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,i=ol(fo,t.__scopeMenu),s=Lf(fo,t.__scopeMenu);return h.createElement(df.Provider,{scope:t.__scopeMenu},h.createElement(Wn,{present:r||i.open},h.createElement(df.Slot,{scope:t.__scopeMenu},s.modal?h.createElement(ZQ,z({},o,{ref:e})):h.createElement(JQ,z({},o,{ref:e})))))}),ZQ=h.forwardRef((t,e)=>{const n=ol(fo,t.__scopeMenu),r=h.useRef(null),o=We(e,r);return h.useEffect(()=>{const i=r.current;if(i)return ag(i)},[]),h.createElement(Fb,z({},t,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:se(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),JQ=h.forwardRef((t,e)=>{const n=ol(fo,t.__scopeMenu);return h.createElement(Fb,z({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),Fb=h.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...g}=t,y=ol(fo,n),v=Lf(fo,n),x=jb(n),w=DP(n),S=BQ(n),[_,k]=h.useState(null),E=h.useRef(null),C=We(e,E,y.onContentChange),T=h.useRef(0),A=h.useRef(""),B=h.useRef(0),D=h.useRef(null),Z=h.useRef("right"),U=h.useRef(0),G=m?cg:h.Fragment,R=m?{as:mi,allowPinchZoom:!0}:void 0,N=P=>{var I,H;const le=A.current+P,Le=S().filter(tt=>!tt.disabled),Ee=document.activeElement,Je=(I=Le.find(tt=>tt.ref.current===Ee))===null||I===void 0?void 0:I.textValue,Ae=Le.map(tt=>tt.textValue),ne=pee(Ae,le,Je),et=(H=Le.find(tt=>tt.textValue===ne))===null||H===void 0?void 0:H.ref.current;(function tt(nt){A.current=nt,window.clearTimeout(T.current),nt!==""&&(T.current=window.setTimeout(()=>tt(""),1e3))})(le),et&&setTimeout(()=>et.focus())};h.useEffect(()=>()=>window.clearTimeout(T.current),[]),ng();const O=h.useCallback(P=>{var I,H;return Z.current===((I=D.current)===null||I===void 0?void 0:I.side)&&mee(P,(H=D.current)===null||H===void 0?void 0:H.area)},[]);return h.createElement(GQ,{scope:n,searchRef:A,onItemEnter:h.useCallback(P=>{O(P)&&P.preventDefault()},[O]),onItemLeave:h.useCallback(P=>{var I;O(P)||((I=E.current)===null||I===void 0||I.focus(),k(null))},[O]),onTriggerLeave:h.useCallback(P=>{O(P)&&P.preventDefault()},[O]),pointerGraceTimerRef:B,onPointerGraceIntentChange:h.useCallback(P=>{D.current=P},[])},h.createElement(G,R,h.createElement(rg,{asChild:!0,trapped:o,onMountAutoFocus:se(i,P=>{var I;P.preventDefault(),(I=E.current)===null||I===void 0||I.focus()}),onUnmountAutoFocus:s},h.createElement(tg,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p},h.createElement(IQ,z({asChild:!0},w,{dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:_,onCurrentTabStopIdChange:k,onEntryFocus:se(l,P=>{v.isUsingKeyboardRef.current||P.preventDefault()})}),h.createElement(P1,z({role:"menu","aria-orientation":"vertical","data-state":HP(y.open),"data-radix-menu-content":"",dir:v.dir},x,g,{ref:C,style:{outline:"none",...g.style},onKeyDown:se(g.onKeyDown,P=>{const H=P.target.closest("[data-radix-menu-content]")===P.currentTarget,le=P.ctrlKey||P.altKey||P.metaKey,Le=P.key.length===1;H&&(P.key==="Tab"&&P.preventDefault(),!le&&Le&&N(P.key));const Ee=E.current;if(P.target!==Ee||!jQ.includes(P.key))return;P.preventDefault();const Ae=S().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);AP.includes(P.key)&&Ae.reverse(),dee(Ae)}),onBlur:se(t.onBlur,P=>{P.currentTarget.contains(P.target)||(window.clearTimeout(T.current),A.current="")}),onPointerMove:se(t.onPointerMove,ff(P=>{const I=P.target,H=U.current!==P.clientX;if(P.currentTarget.contains(I)&&H){const le=P.clientX>U.current?"right":"left";Z.current=le,U.current=P.clientX}}))})))))))}),XQ=h.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return h.createElement(Re.div,z({},r,{ref:e}))}),hx="MenuItem",x_="menu.itemSelect",Bb=h.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...o}=t,i=h.useRef(null),s=Lf(hx,t.__scopeMenu),a=zb(hx,t.__scopeMenu),l=We(e,i),c=h.useRef(!1),u=()=>{const d=i.current;if(!n&&d){const f=new CustomEvent(x_,{bubbles:!0,cancelable:!0});d.addEventListener(x_,p=>r==null?void 0:r(p),{once:!0}),vO(d,f),f.defaultPrevented?c.current=!1:s.onClose()}};return h.createElement(FP,z({},o,{ref:l,disabled:n,onClick:se(t.onClick,u),onPointerDown:d=>{var f;(f=t.onPointerDown)===null||f===void 0||f.call(t,d),c.current=!0},onPointerUp:se(t.onPointerUp,d=>{var f;c.current||(f=d.currentTarget)===null||f===void 0||f.click()}),onKeyDown:se(t.onKeyDown,d=>{const f=a.searchRef.current!=="";n||f&&d.key===" "||px.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})}))}),FP=h.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=t,s=zb(hx,n),a=DP(n),l=h.useRef(null),c=We(e,l),[u,d]=h.useState(!1),[f,p]=h.useState("");return h.useEffect(()=>{const m=l.current;if(m){var g;p(((g=m.textContent)!==null&&g!==void 0?g:"").trim())}},[i.children]),h.createElement(df.ItemSlot,{scope:n,disabled:r,textValue:o??f},h.createElement(DQ,z({asChild:!0},a,{focusable:!r}),h.createElement(Re.div,z({role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},i,{ref:c,onPointerMove:se(t.onPointerMove,ff(m=>{r?s.onItemLeave(m):(s.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus())})),onPointerLeave:se(t.onPointerLeave,ff(m=>s.onItemLeave(m))),onFocus:se(t.onFocus,()=>d(!0)),onBlur:se(t.onBlur,()=>d(!1))}))))}),QQ=h.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...o}=t;return h.createElement(UP,{scope:t.__scopeMenu,checked:n},h.createElement(Bb,z({role:"menuitemcheckbox","aria-checked":wm(n)?"mixed":n},o,{ref:e,"data-state":Ub(n),onSelect:se(o.onSelect,()=>r==null?void 0:r(wm(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),eee="MenuRadioGroup",[eie,tee]=rl(eee,{value:void 0,onValueChange:()=>{}}),nee="MenuRadioItem",ree=h.forwardRef((t,e)=>{const{value:n,...r}=t,o=tee(nee,t.__scopeMenu),i=n===o.value;return h.createElement(UP,{scope:t.__scopeMenu,checked:i},h.createElement(Bb,z({role:"menuitemradio","aria-checked":i},r,{ref:e,"data-state":Ub(i),onSelect:se(r.onSelect,()=>{var s;return(s=o.onValueChange)===null||s===void 0?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})))}),BP="MenuItemIndicator",[UP,oee]=rl(BP,{checked:!1}),iee=h.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...o}=t,i=oee(BP,n);return h.createElement(Wn,{present:r||wm(i.checked)||i.checked===!0},h.createElement(Re.span,z({},o,{ref:e,"data-state":Ub(i.checked)})))}),see=h.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return h.createElement(Re.div,z({role:"separator","aria-orientation":"horizontal"},r,{ref:e}))}),aee="MenuSub",[tie,VP]=rl(aee),kp="MenuSubTrigger",lee=h.forwardRef((t,e)=>{const n=ol(kp,t.__scopeMenu),r=Lf(kp,t.__scopeMenu),o=VP(kp,t.__scopeMenu),i=zb(kp,t.__scopeMenu),s=h.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,c={__scopeMenu:t.__scopeMenu},u=h.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return h.useEffect(()=>u,[u]),h.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),h.createElement(LP,z({asChild:!0},c),h.createElement(FP,z({id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":HP(n.open)},t,{ref:Gm(e,o.onTriggerChange),onClick:d=>{var f;(f=t.onClick)===null||f===void 0||f.call(t,d),!(t.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:se(t.onPointerMove,ff(d=>{i.onItemEnter(d),!d.defaultPrevented&&!t.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:se(t.onPointerLeave,ff(d=>{var f;u();const p=(f=n.content)===null||f===void 0?void 0:f.getBoundingClientRect();if(p){var m;const g=(m=n.content)===null||m===void 0?void 0:m.dataset.side,y=g==="right",v=y?-5:5,x=p[y?"left":"right"],w=p[y?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+v,y:d.clientY},{x,y:p.top},{x:w,y:p.top},{x:w,y:p.bottom},{x,y:p.bottom}],side:g}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:se(t.onKeyDown,d=>{const f=i.searchRef.current!=="";if(!(t.disabled||f&&d.key===" ")&&zQ[r.dir].includes(d.key)){var p;n.onOpenChange(!0),(p=n.content)===null||p===void 0||p.focus(),d.preventDefault()}})})))}),cee="MenuSubContent",uee=h.forwardRef((t,e)=>{const n=zP(fo,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,i=ol(fo,t.__scopeMenu),s=Lf(fo,t.__scopeMenu),a=VP(cee,t.__scopeMenu),l=h.useRef(null),c=We(e,l);return h.createElement(df.Provider,{scope:t.__scopeMenu},h.createElement(Wn,{present:r||i.open},h.createElement(df.Slot,{scope:t.__scopeMenu},h.createElement(Fb,z({id:a.contentId,"aria-labelledby":a.triggerId},o,{ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;s.isUsingKeyboardRef.current&&((d=l.current)===null||d===void 0||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:se(t.onFocusOutside,u=>{u.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:se(t.onEscapeKeyDown,u=>{s.onClose(),u.preventDefault()}),onKeyDown:se(t.onKeyDown,u=>{const d=u.currentTarget.contains(u.target),f=FQ[s.dir].includes(u.key);if(d&&f){var p;i.onOpenChange(!1),(p=a.trigger)===null||p===void 0||p.focus(),u.preventDefault()}})})))))});function HP(t){return t?"open":"closed"}function wm(t){return t==="indeterminate"}function Ub(t){return wm(t)?"indeterminate":t?"checked":"unchecked"}function dee(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function fee(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function pee(t,e,n){const o=e.length>1&&Array.from(e).every(c=>c===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let s=fee(t,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function hee(t,e){const{x:n,y:r}=t;let o=!1;for(let i=0,s=e.length-1;i<e.length;s=i++){const a=e[i].x,l=e[i].y,c=e[s].x,u=e[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(o=!o)}return o}function mee(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return hee(n,e)}function ff(t){return e=>e.pointerType==="mouse"?t(e):void 0}const gee=WQ,vee=LP,yee=qQ,xee=YQ,bee=XQ,wee=Bb,kee=QQ,See=ree,Eee=iee,_ee=see,Cee=lee,Tee=uee,WP="DropdownMenu",[Oee,nie]=Lr(WP,[IP]),Ur=IP(),[Mee,KP]=Oee(WP),Ree=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=t,l=Ur(e),c=h.useRef(null),[u=!1,d]=Ao({prop:o,defaultProp:i,onChange:s});return h.createElement(Mee,{scope:e,triggerId:ao(),triggerRef:c,contentId:ao(),open:u,onOpenChange:d,onOpenToggle:h.useCallback(()=>d(f=>!f),[d]),modal:a},h.createElement(gee,z({},l,{open:u,onOpenChange:d,dir:r,modal:a}),n))},Nee="DropdownMenuTrigger",Pee=h.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=t,i=KP(Nee,n),s=Ur(n);return h.createElement(vee,z({asChild:!0},s),h.createElement(Re.button,z({type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r},o,{ref:Gm(e,i.triggerRef),onPointerDown:se(t.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:se(t.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})))}),$ee=t=>{const{__scopeDropdownMenu:e,...n}=t,r=Ur(e);return h.createElement(yee,z({},r,n))},Aee="DropdownMenuContent",Iee=h.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=KP(Aee,n),i=Ur(n),s=h.useRef(!1);return h.createElement(xee,z({id:o.contentId,"aria-labelledby":o.triggerId},i,r,{ref:e,onCloseAutoFocus:se(t.onCloseAutoFocus,a=>{var l;s.current||(l=o.triggerRef.current)===null||l===void 0||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:se(t.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!o.modal||u)&&(s.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),Dee=h.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Ur(n);return h.createElement(bee,z({},o,r,{ref:e}))}),Lee=h.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Ur(n);return h.createElement(wee,z({},o,r,{ref:e}))}),jee=h.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Ur(n);return h.createElement(kee,z({},o,r,{ref:e}))}),zee=h.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Ur(n);return h.createElement(See,z({},o,r,{ref:e}))}),Fee=h.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Ur(n);return h.createElement(Eee,z({},o,r,{ref:e}))}),Bee=h.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Ur(n);return h.createElement(_ee,z({},o,r,{ref:e}))}),Uee=h.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Ur(n);return h.createElement(Cee,z({},o,r,{ref:e}))}),Vee=h.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Ur(n);return h.createElement(Tee,z({},o,r,{ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),Hee=Ree,Wee=Pee,Kee=$ee,qP=Iee,GP=Dee,YP=Lee,ZP=jee,JP=zee,XP=Fee,QP=Bee,e$=Uee,t$=Vee,qee=Hee,Gee=Wee,Yee=h.forwardRef(({className:t,inset:e,children:n,...r},o)=>b.jsxs(e$,{ref:o,className:ze("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",e&&"pl-8",t),...r,children:[n,b.jsx(B5,{className:"w-4 h-4 ml-auto"})]}));Yee.displayName=e$.displayName;const Zee=h.forwardRef(({className:t,...e},n)=>b.jsx(t$,{ref:n,className:ze("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",t),...e}));Zee.displayName=t$.displayName;const n$=h.forwardRef(({className:t,sideOffset:e=4,container:n,...r},o)=>b.jsx(Kee,{container:n,children:b.jsx(qP,{ref:o,sideOffset:e,className:ze("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",t),...r})}));n$.displayName=qP.displayName;const qi=h.forwardRef(({className:t,inset:e,...n},r)=>b.jsx(YP,{ref:r,className:ze("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",e&&"pl-8",t),...n}));qi.displayName=YP.displayName;const Jee=h.forwardRef(({className:t,children:e,checked:n,...r},o)=>b.jsxs(ZP,{ref:o,className:ze("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",t),checked:n,...r,children:[b.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b.jsx(XP,{children:b.jsx(y1,{className:"w-4 h-4"})})}),e]}));Jee.displayName=ZP.displayName;const Xee=h.forwardRef(({className:t,children:e,...n},r)=>b.jsxs(JP,{ref:r,className:ze("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",t),...n,children:[b.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b.jsx(XP,{children:b.jsx(U5,{className:"w-2 h-2 fill-current"})})}),e]}));Xee.displayName=JP.displayName;const Qee=h.forwardRef(({className:t,inset:e,...n},r)=>b.jsx(GP,{ref:r,className:ze("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));Qee.displayName=GP.displayName;const ete=h.forwardRef(({className:t,...e},n)=>b.jsx(QP,{ref:n,className:ze("-mx-1 my-1 h-px bg-muted",t),...e}));ete.displayName=QP.displayName;function km(t){"@babel/helpers - typeof";return km=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},km(t)}function Ka(t){if(t===null||t===!0||t===!1)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function cn(t,e){if(e.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+e.length+" present")}function kr(t){cn(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||km(t)==="object"&&e==="[object Date]"?new Date(t.getTime()):typeof t=="number"||e==="[object Number]"?new Date(t):((typeof t=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function tte(t,e){cn(2,arguments);var n=kr(t).getTime(),r=Ka(e);return new Date(n+r)}var nte={};function Fg(){return nte}function rte(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}function b_(t){cn(1,arguments);var e=kr(t);return e.setHours(0,0,0,0),e}function ote(t){return cn(1,arguments),t instanceof Date||km(t)==="object"&&Object.prototype.toString.call(t)==="[object Date]"}function ite(t){if(cn(1,arguments),!ote(t)&&typeof t!="number")return!1;var e=kr(t);return!isNaN(Number(e))}function ste(t){cn(1,arguments);var e=kr(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function ate(t){cn(1,arguments);var e=kr(t);return e.setDate(1),e.setHours(0,0,0,0),e}function lte(t,e){cn(2,arguments);var n=Ka(e);return tte(t,-n)}var cte=864e5;function ute(t){cn(1,arguments);var e=kr(t),n=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var r=e.getTime(),o=n-r;return Math.floor(o/cte)+1}function Sm(t){cn(1,arguments);var e=1,n=kr(t),r=n.getUTCDay(),o=(r<e?7:0)+r-e;return n.setUTCDate(n.getUTCDate()-o),n.setUTCHours(0,0,0,0),n}function r$(t){cn(1,arguments);var e=kr(t),n=e.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=Sm(r),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var s=Sm(i);return e.getTime()>=o.getTime()?n+1:e.getTime()>=s.getTime()?n:n-1}function dte(t){cn(1,arguments);var e=r$(t),n=new Date(0);n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0);var r=Sm(n);return r}var fte=6048e5;function pte(t){cn(1,arguments);var e=kr(t),n=Sm(e).getTime()-dte(e).getTime();return Math.round(n/fte)+1}function Em(t,e){var n,r,o,i,s,a,l,c;cn(1,arguments);var u=Fg(),d=Ka((n=(r=(o=(i=e==null?void 0:e.weekStartsOn)!==null&&i!==void 0?i:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.weekStartsOn)!==null&&o!==void 0?o:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=kr(t),p=f.getUTCDay(),m=(p<d?7:0)+p-d;return f.setUTCDate(f.getUTCDate()-m),f.setUTCHours(0,0,0,0),f}function o$(t,e){var n,r,o,i,s,a,l,c;cn(1,arguments);var u=kr(t),d=u.getUTCFullYear(),f=Fg(),p=Ka((n=(r=(o=(i=e==null?void 0:e.firstWeekContainsDate)!==null&&i!==void 0?i:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.firstWeekContainsDate)!==null&&o!==void 0?o:f.firstWeekContainsDate)!==null&&r!==void 0?r:(l=f.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(p>=1&&p<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var m=new Date(0);m.setUTCFullYear(d+1,0,p),m.setUTCHours(0,0,0,0);var g=Em(m,e),y=new Date(0);y.setUTCFullYear(d,0,p),y.setUTCHours(0,0,0,0);var v=Em(y,e);return u.getTime()>=g.getTime()?d+1:u.getTime()>=v.getTime()?d:d-1}function hte(t,e){var n,r,o,i,s,a,l,c;cn(1,arguments);var u=Fg(),d=Ka((n=(r=(o=(i=e==null?void 0:e.firstWeekContainsDate)!==null&&i!==void 0?i:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.firstWeekContainsDate)!==null&&o!==void 0?o:u.firstWeekContainsDate)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1),f=o$(t,e),p=new Date(0);p.setUTCFullYear(f,0,d),p.setUTCHours(0,0,0,0);var m=Em(p,e);return m}var mte=6048e5;function gte(t,e){cn(1,arguments);var n=kr(t),r=Em(n,e).getTime()-hte(n,e).getTime();return Math.round(r/mte)+1}function it(t,e){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length<e;)r="0"+r;return n+r}var vte={y:function(e,n){var r=e.getUTCFullYear(),o=r>0?r:1-r;return it(n==="yy"?o%100:o,n.length)},M:function(e,n){var r=e.getUTCMonth();return n==="M"?String(r+1):it(r+1,2)},d:function(e,n){return it(e.getUTCDate(),n.length)},a:function(e,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(e,n){return it(e.getUTCHours()%12||12,n.length)},H:function(e,n){return it(e.getUTCHours(),n.length)},m:function(e,n){return it(e.getUTCMinutes(),n.length)},s:function(e,n){return it(e.getUTCSeconds(),n.length)},S:function(e,n){var r=n.length,o=e.getUTCMilliseconds(),i=Math.floor(o*Math.pow(10,r-3));return it(i,n.length)}};const zi=vte;var xl={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},yte={G:function(e,n,r){var o=e.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return r.era(o,{width:"abbreviated"});case"GGGGG":return r.era(o,{width:"narrow"});case"GGGG":default:return r.era(o,{width:"wide"})}},y:function(e,n,r){if(n==="yo"){var o=e.getUTCFullYear(),i=o>0?o:1-o;return r.ordinalNumber(i,{unit:"year"})}return zi.y(e,n)},Y:function(e,n,r,o){var i=o$(e,o),s=i>0?i:1-i;if(n==="YY"){var a=s%100;return it(a,2)}return n==="Yo"?r.ordinalNumber(s,{unit:"year"}):it(s,n.length)},R:function(e,n){var r=r$(e);return it(r,n.length)},u:function(e,n){var r=e.getUTCFullYear();return it(r,n.length)},Q:function(e,n,r){var o=Math.ceil((e.getUTCMonth()+1)/3);switch(n){case"Q":return String(o);case"QQ":return it(o,2);case"Qo":return r.ordinalNumber(o,{unit:"quarter"});case"QQQ":return r.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(o,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(o,{width:"wide",context:"formatting"})}},q:function(e,n,r){var o=Math.ceil((e.getUTCMonth()+1)/3);switch(n){case"q":return String(o);case"qq":return it(o,2);case"qo":return r.ordinalNumber(o,{unit:"quarter"});case"qqq":return r.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(o,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(o,{width:"wide",context:"standalone"})}},M:function(e,n,r){var o=e.getUTCMonth();switch(n){case"M":case"MM":return zi.M(e,n);case"Mo":return r.ordinalNumber(o+1,{unit:"month"});case"MMM":return r.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(o,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(o,{width:"wide",context:"formatting"})}},L:function(e,n,r){var o=e.getUTCMonth();switch(n){case"L":return String(o+1);case"LL":return it(o+1,2);case"Lo":return r.ordinalNumber(o+1,{unit:"month"});case"LLL":return r.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(o,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(o,{width:"wide",context:"standalone"})}},w:function(e,n,r,o){var i=gte(e,o);return n==="wo"?r.ordinalNumber(i,{unit:"week"}):it(i,n.length)},I:function(e,n,r){var o=pte(e);return n==="Io"?r.ordinalNumber(o,{unit:"week"}):it(o,n.length)},d:function(e,n,r){return n==="do"?r.ordinalNumber(e.getUTCDate(),{unit:"date"}):zi.d(e,n)},D:function(e,n,r){var o=ute(e);return n==="Do"?r.ordinalNumber(o,{unit:"dayOfYear"}):it(o,n.length)},E:function(e,n,r){var o=e.getUTCDay();switch(n){case"E":case"EE":case"EEE":return r.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(o,{width:"short",context:"formatting"});case"EEEE":default:return r.day(o,{width:"wide",context:"formatting"})}},e:function(e,n,r,o){var i=e.getUTCDay(),s=(i-o.weekStartsOn+8)%7||7;switch(n){case"e":return String(s);case"ee":return it(s,2);case"eo":return r.ordinalNumber(s,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(e,n,r,o){var i=e.getUTCDay(),s=(i-o.weekStartsOn+8)%7||7;switch(n){case"c":return String(s);case"cc":return it(s,n.length);case"co":return r.ordinalNumber(s,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(e,n,r){var o=e.getUTCDay(),i=o===0?7:o;switch(n){case"i":return String(i);case"ii":return it(i,n.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(o,{width:"short",context:"formatting"});case"iiii":default:return r.day(o,{width:"wide",context:"formatting"})}},a:function(e,n,r){var o=e.getUTCHours(),i=o/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,n,r){var o=e.getUTCHours(),i;switch(o===12?i=xl.noon:o===0?i=xl.midnight:i=o/12>=1?"pm":"am",n){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,n,r){var o=e.getUTCHours(),i;switch(o>=17?i=xl.evening:o>=12?i=xl.afternoon:o>=4?i=xl.morning:i=xl.night,n){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,n,r){if(n==="ho"){var o=e.getUTCHours()%12;return o===0&&(o=12),r.ordinalNumber(o,{unit:"hour"})}return zi.h(e,n)},H:function(e,n,r){return n==="Ho"?r.ordinalNumber(e.getUTCHours(),{unit:"hour"}):zi.H(e,n)},K:function(e,n,r){var o=e.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(o,{unit:"hour"}):it(o,n.length)},k:function(e,n,r){var o=e.getUTCHours();return o===0&&(o=24),n==="ko"?r.ordinalNumber(o,{unit:"hour"}):it(o,n.length)},m:function(e,n,r){return n==="mo"?r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):zi.m(e,n)},s:function(e,n,r){return n==="so"?r.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):zi.s(e,n)},S:function(e,n){return zi.S(e,n)},X:function(e,n,r,o){var i=o._originalDate||e,s=i.getTimezoneOffset();if(s===0)return"Z";switch(n){case"X":return k_(s);case"XXXX":case"XX":return ta(s);case"XXXXX":case"XXX":default:return ta(s,":")}},x:function(e,n,r,o){var i=o._originalDate||e,s=i.getTimezoneOffset();switch(n){case"x":return k_(s);case"xxxx":case"xx":return ta(s);case"xxxxx":case"xxx":default:return ta(s,":")}},O:function(e,n,r,o){var i=o._originalDate||e,s=i.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+w_(s,":");case"OOOO":default:return"GMT"+ta(s,":")}},z:function(e,n,r,o){var i=o._originalDate||e,s=i.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+w_(s,":");case"zzzz":default:return"GMT"+ta(s,":")}},t:function(e,n,r,o){var i=o._originalDate||e,s=Math.floor(i.getTime()/1e3);return it(s,n.length)},T:function(e,n,r,o){var i=o._originalDate||e,s=i.getTime();return it(s,n.length)}};function w_(t,e){var n=t>0?"-":"+",r=Math.abs(t),o=Math.floor(r/60),i=r%60;if(i===0)return n+String(o);var s=e||"";return n+String(o)+s+it(i,2)}function k_(t,e){if(t%60===0){var n=t>0?"-":"+";return n+it(Math.abs(t)/60,2)}return ta(t,e)}function ta(t,e){var n=e||"",r=t>0?"-":"+",o=Math.abs(t),i=it(Math.floor(o/60),2),s=it(o%60,2);return r+i+n+s}var S_=function(e,n){switch(e){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},i$=function(e,n){switch(e){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},xte=function(e,n){var r=e.match(/(P+)(p+)?/)||[],o=r[1],i=r[2];if(!i)return S_(e,n);var s;switch(o){case"P":s=n.dateTime({width:"short"});break;case"PP":s=n.dateTime({width:"medium"});break;case"PPP":s=n.dateTime({width:"long"});break;case"PPPP":default:s=n.dateTime({width:"full"});break}return s.replace("{{date}}",S_(o,n)).replace("{{time}}",i$(i,n))},bte={p:i$,P:xte},wte=["D","DD"],kte=["YY","YYYY"];function Ste(t){return wte.indexOf(t)!==-1}function Ete(t){return kte.indexOf(t)!==-1}function E_(t,e,n){if(t==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var _te={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Cte=function(e,n,r){var o,i=_te[e];return typeof i=="string"?o=i:n===1?o=i.one:o=i.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+o:o+" ago":o};const Tte=Cte;function oy(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth,r=t.formats[n]||t.formats[t.defaultWidth];return r}}var Ote={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Mte={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Rte={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Nte={date:oy({formats:Ote,defaultWidth:"full"}),time:oy({formats:Mte,defaultWidth:"full"}),dateTime:oy({formats:Rte,defaultWidth:"full"})};const Pte=Nte;var $te={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ate=function(e,n,r,o){return $te[e]};const Ite=Ate;function pu(t){return function(e,n){var r=n!=null&&n.context?String(n.context):"standalone",o;if(r==="formatting"&&t.formattingValues){var i=t.defaultFormattingWidth||t.defaultWidth,s=n!=null&&n.width?String(n.width):i;o=t.formattingValues[s]||t.formattingValues[i]}else{var a=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;o=t.values[l]||t.values[a]}var c=t.argumentCallback?t.argumentCallback(e):e;return o[c]}}var Dte={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Lte={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},jte={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},zte={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Fte={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Bte={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Ute=function(e,n){var r=Number(e),o=r%100;if(o>20||o<10)switch(o%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},Vte={ordinalNumber:Ute,era:pu({values:Dte,defaultWidth:"wide"}),quarter:pu({values:Lte,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:pu({values:jte,defaultWidth:"wide"}),day:pu({values:zte,defaultWidth:"wide"}),dayPeriod:pu({values:Fte,defaultWidth:"wide",formattingValues:Bte,defaultFormattingWidth:"wide"})};const Hte=Vte;function hu(t){return function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,o=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(o);if(!i)return null;var s=i[0],a=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?Kte(a,function(d){return d.test(s)}):Wte(a,function(d){return d.test(s)}),c;c=t.valueCallback?t.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;var u=e.slice(s.length);return{value:c,rest:u}}}function Wte(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}function Kte(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return n}function qte(t){return function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.match(t.matchPattern);if(!r)return null;var o=r[0],i=e.match(t.parsePattern);if(!i)return null;var s=t.valueCallback?t.valueCallback(i[0]):i[0];s=n.valueCallback?n.valueCallback(s):s;var a=e.slice(o.length);return{value:s,rest:a}}}var Gte=/^(\d+)(th|st|nd|rd)?/i,Yte=/\d+/i,Zte={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Jte={any:[/^b/i,/^(a|c)/i]},Xte={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Qte={any:[/1/i,/2/i,/3/i,/4/i]},ene={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},tne={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},nne={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},rne={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},one={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},ine={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},sne={ordinalNumber:qte({matchPattern:Gte,parsePattern:Yte,valueCallback:function(e){return parseInt(e,10)}}),era:hu({matchPatterns:Zte,defaultMatchWidth:"wide",parsePatterns:Jte,defaultParseWidth:"any"}),quarter:hu({matchPatterns:Xte,defaultMatchWidth:"wide",parsePatterns:Qte,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:hu({matchPatterns:ene,defaultMatchWidth:"wide",parsePatterns:tne,defaultParseWidth:"any"}),day:hu({matchPatterns:nne,defaultMatchWidth:"wide",parsePatterns:rne,defaultParseWidth:"any"}),dayPeriod:hu({matchPatterns:one,defaultMatchWidth:"any",parsePatterns:ine,defaultParseWidth:"any"})};const ane=sne;var lne={code:"en-US",formatDistance:Tte,formatLong:Pte,formatRelative:Ite,localize:Hte,match:ane,options:{weekStartsOn:0,firstWeekContainsDate:1}};const s$=lne;var cne=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,une=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,dne=/^'([^]*?)'?$/,fne=/''/g,pne=/[a-zA-Z]/;function il(t,e,n){var r,o,i,s,a,l,c,u,d,f,p,m,g,y,v,x,w,S;cn(2,arguments);var _=String(e),k=Fg(),E=(r=(o=n==null?void 0:n.locale)!==null&&o!==void 0?o:k.locale)!==null&&r!==void 0?r:s$,C=Ka((i=(s=(a=(l=n==null?void 0:n.firstWeekContainsDate)!==null&&l!==void 0?l:n==null||(c=n.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&a!==void 0?a:k.firstWeekContainsDate)!==null&&s!==void 0?s:(d=k.locale)===null||d===void 0||(f=d.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(C>=1&&C<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var T=Ka((p=(m=(g=(y=n==null?void 0:n.weekStartsOn)!==null&&y!==void 0?y:n==null||(v=n.locale)===null||v===void 0||(x=v.options)===null||x===void 0?void 0:x.weekStartsOn)!==null&&g!==void 0?g:k.weekStartsOn)!==null&&m!==void 0?m:(w=k.locale)===null||w===void 0||(S=w.options)===null||S===void 0?void 0:S.weekStartsOn)!==null&&p!==void 0?p:0);if(!(T>=0&&T<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!E.localize)throw new RangeError("locale must contain localize property");if(!E.formatLong)throw new RangeError("locale must contain formatLong property");var A=kr(t);if(!ite(A))throw new RangeError("Invalid time value");var B=rte(A),D=lte(A,B),Z={firstWeekContainsDate:C,weekStartsOn:T,locale:E,_originalDate:A},U=_.match(une).map(function(G){var R=G[0];if(R==="p"||R==="P"){var N=bte[R];return N(G,E.formatLong)}return G}).join("").match(cne).map(function(G){if(G==="''")return"'";var R=G[0];if(R==="'")return hne(G);var N=yte[R];if(N)return!(n!=null&&n.useAdditionalWeekYearTokens)&&Ete(G)&&E_(G,e,String(t)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&Ste(G)&&E_(G,e,String(t)),N(D,G,E.localize,Z);if(R.match(pne))throw new RangeError("Format string contains an unescaped latin alphabet character `"+R+"`");return G}).join("");return U}function hne(t){var e=t.match(dne);return e?e[1].replace(fne,"'"):t}var It=function(){return It=Object.assign||function(e){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},It.apply(this,arguments)};var a$={exports:{}},mu={};/**
219
- * @license React
220
- * react-jsx-runtime.production.min.js
221
- *
222
- * Copyright (c) Facebook, Inc. and its affiliates.
223
- *
224
- * This source code is licensed under the MIT license found in the
225
- * LICENSE file in the root directory of this source tree.
226
- */var __;function mne(){if(__)return mu;__=1;var t=oe,e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var u,d={},f=null,p=null;c!==void 0&&(f=""+c),l.key!==void 0&&(f=""+l.key),l.ref!==void 0&&(p=l.ref);for(u in l)r.call(l,u)&&!i.hasOwnProperty(u)&&(d[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)d[u]===void 0&&(d[u]=l[u]);return{$$typeof:e,type:a,key:f,ref:p,props:d,_owner:o.current}}return mu.Fragment=n,mu.jsx=s,mu.jsxs=s,mu}a$.exports=mne();var l$=a$.exports;function gne(t){return t.mode==="multiple"}function vne(t){return t.mode==="range"}function yne(t){return t.mode==="single"}var xne={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function bne(t,e){return il(t,"LLLL y",e)}function wne(t,e){return il(t,"d",e)}function kne(t,e){return il(t,"LLLL",e)}function Sne(t){return"".concat(t)}function Ene(t,e){return il(t,"cccccc",e)}function _ne(t,e){return il(t,"yyyy",e)}var Cne=Object.freeze({__proto__:null,formatCaption:bne,formatDay:wne,formatMonthCaption:kne,formatWeekNumber:Sne,formatWeekdayName:Ene,formatYearCaption:_ne}),Tne=function(t,e,n){return il(t,"do MMMM (EEEE)",n)},One=function(){return"Month: "},Mne=function(){return"Go to next month"},Rne=function(){return"Go to previous month"},Nne=function(t,e){return il(t,"cccc",e)},Pne=function(t){return"Week n. ".concat(t)},$ne=function(){return"Year: "},Ane=Object.freeze({__proto__:null,labelDay:Tne,labelMonthDropdown:One,labelNext:Mne,labelPrevious:Rne,labelWeekNumber:Pne,labelWeekday:Nne,labelYearDropdown:$ne});function Ine(){var t="buttons",e=xne,n=s$,r={},o={},i=1,s={},a=new Date;return{captionLayout:t,classNames:e,formatters:Cne,labels:Ane,locale:n,modifiersClassNames:r,modifiers:o,numberOfMonths:i,styles:s,today:a,mode:"default"}}function Dne(t){var e=t.fromYear,n=t.toYear,r=t.fromMonth,o=t.toMonth,i=t.fromDate,s=t.toDate;return r?i=ate(r):e&&(i=new Date(e,0,1)),o?s=ste(o):n&&(s=new Date(n,11,31)),{fromDate:i?b_(i):void 0,toDate:s?b_(s):void 0}}var c$=h.createContext(void 0);function Lne(t){var e,n=t.initialProps,r=Ine(),o=Dne(n),i=o.fromDate,s=o.toDate,a=(e=n.captionLayout)!==null&&e!==void 0?e:r.captionLayout;a!=="buttons"&&(!i||!s)&&(a="buttons");var l;(yne(n)||gne(n)||vne(n))&&(l=n.onSelect);var c=It(It(It({},r),n),{captionLayout:a,classNames:It(It({},r.classNames),n.classNames),components:It({},n.components),formatters:It(It({},r.formatters),n.formatters),fromDate:i,labels:It(It({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:It(It({},r.modifiers),n.modifiers),modifiersClassNames:It(It({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:It(It({},r.styles),n.styles),toDate:s});return l$.jsx(c$.Provider,{value:c,children:t.children})}function jne(){var t=h.useContext(c$);if(!t)throw new Error("useDayPicker must be used within a DayPickerProvider.");return t}h.createContext(void 0);h.forwardRef(function(t,e){var n=jne(),r=n.classNames,o=n.styles,i=[r.button_reset,r.button];t.className&&i.push(t.className);var s=i.join(" "),a=It(It({},o.button_reset),o.button);return t.style&&Object.assign(a,t.style),l$.jsx("button",It({},t,{ref:e,type:"button",className:s,style:a}))});h.createContext(void 0);h.createContext(void 0);var Uo;(function(t){t.Outside="outside",t.Disabled="disabled",t.Selected="selected",t.Hidden="hidden",t.Today="today",t.RangeStart="range_start",t.RangeEnd="range_end",t.RangeMiddle="range_middle"})(Uo||(Uo={}));Uo.Selected;Uo.Disabled;Uo.Hidden;Uo.Today;Uo.RangeEnd;Uo.RangeMiddle;Uo.RangeStart;Uo.Outside;h.createContext(void 0);h.createContext(void 0);h.createContext(void 0);var zne=Object.defineProperty,Fne=Object.getOwnPropertyDescriptor,jf=(t,e,n,r)=>{for(var o=r>1?void 0:r?Fne(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&zne(e,n,o),o},Bne={icon:"bold",label:({t})=>t(eE.LABEL),description:({t})=>t(eE.DESCRIPTION)},qa=class extends If{get name(){return"bold"}createTags(){return[Ie.FormattingMark,Ie.FontStyle]}createMarkSpec(t,e){return{...e,attrs:t.defaults(),parseDOM:[{tag:"strong",getAttrs:t.parse},{tag:"b",getAttrs:n=>Fo(n)&&n.style.fontWeight!=="normal"?t.parse(n):!1},{style:"font-weight",getAttrs:n=>Se(n)&&/^(bold(er)?|[5-9]\d{2,})$/.test(n)?null:!1},...e.parseDOM??[]],toDOM:n=>{const{weight:r}=this.options;return r?["strong",{"font-weight":r.toString()},0]:["strong",t.dom(n),0]}}}createInputRules(){return[fm({regexp:/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/,type:this.type,ignoreWhitespace:!0})]}toggleBold(t){return nf({type:this.type,selection:t})}setBold(t){return({tr:e,dispatch:n})=>{const{from:r,to:o}=Ir(t??e.selection,e.doc);return n==null||n(e.addMark(r,o,this.type.create())),!0}}removeBold(t){return({tr:e,dispatch:n})=>{const{from:r,to:o}=Ir(t??e.selection,e.doc);return e.doc.rangeHasMark(r,o,this.type)?(n==null||n(e.removeMark(r,o,this.type)),!0):!1}}shortcut(t){return this.toggleBold()(t)}};jf([ue(Bne)],qa.prototype,"toggleBold",1);jf([ue()],qa.prototype,"setBold",1);jf([ue()],qa.prototype,"removeBold",1);jf([wr({shortcut:q.Bold,command:"toggleBold"})],qa.prototype,"shortcut",1);qa=jf([Ze({defaultOptions:{weight:void 0},staticKeys:["weight"]})],qa);var Une=Object.defineProperty,Vne=Object.getOwnPropertyDescriptor,Vb=(t,e,n,r)=>{for(var o=r>1?void 0:r?Vne(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&Une(e,n,o),o},Hne={icon:"italic",label:({t})=>t(tE.LABEL),description:({t})=>t(tE.DESCRIPTION)},pf=class extends If{get name(){return"italic"}createTags(){return[Ie.FontStyle,Ie.FormattingMark]}createMarkSpec(t,e){return{...e,attrs:t.defaults(),parseDOM:[{tag:"i",getAttrs:t.parse},{tag:"em",getAttrs:t.parse},{style:"font-style=italic"},...e.parseDOM??[]],toDOM:n=>["em",t.dom(n),0]}}createKeymap(){return{"Mod-i":nf({type:this.type})}}createInputRules(){return[fm({regexp:/(?:^|[^*])\*([^*]+)\*$/,type:this.type,ignoreWhitespace:!0,updateCaptured:({fullMatch:t,start:e})=>t.startsWith("*")?{}:{fullMatch:t.slice(1),start:e+1}}),fm({regexp:/(?:^|\W)_([^_]+)_$/,type:this.type,ignoreWhitespace:!0,updateCaptured:({fullMatch:t,start:e})=>t.startsWith("_")?{}:{fullMatch:t.slice(1),start:e+1}})]}createPasteRules(){return[{type:"mark",markType:this.type,regexp:/(?:^|\W)_([^_]+)_/g},{type:"mark",markType:this.type,regexp:/\*([^*]+)\*/g}]}toggleItalic(t){return nf({type:this.type,selection:t})}shortcut(t){return this.toggleItalic()(t)}};Vb([ue(Hne)],pf.prototype,"toggleItalic",1);Vb([wr({shortcut:q.Italic,command:"toggleItalic"})],pf.prototype,"shortcut",1);pf=Vb([Ze({})],pf);var Wne=Object.defineProperty,Kne=Object.getOwnPropertyDescriptor,Hb=(t,e,n,r)=>{for(var o=r>1?void 0:r?Kne(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&Wne(e,n,o),o},qne={icon:"strikethrough",label:({t})=>t(nE.LABEL),description:({t})=>t(nE.DESCRIPTION)},hf=class extends If{get name(){return"strike"}createTags(){return[Ie.FontStyle,Ie.FormattingMark]}createMarkSpec(t,e){return{...e,attrs:t.defaults(),parseDOM:[{tag:"s",getAttrs:t.parse},{tag:"del",getAttrs:t.parse},{tag:"strike",getAttrs:t.parse},{style:"text-decoration",getAttrs:n=>n==="line-through"?{}:!1},...e.parseDOM??[]],toDOM:n=>["s",t.dom(n),0]}}toggleStrike(){return nf({type:this.type})}shortcut(t){return this.toggleStrike()(t)}createInputRules(){return[fm({regexp:/~([^~]+)~$/,type:this.type,ignoreWhitespace:!0})]}createPasteRules(){return[{regexp:/~([^~]+)~/g,type:"mark",markType:this.type}]}};Hb([ue(qne)],hf.prototype,"toggleStrike",1);Hb([wr({shortcut:q.Strike,command:"toggleStrike"})],hf.prototype,"shortcut",1);hf=Hb([Ze({})],hf);var u$=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},Xe=(t,e,n)=>(u$(t,e,"read from private field"),n?n.call(t):e.get(t)),Rl=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Gi=(t,e,n,r)=>(u$(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Gne='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="22" height="22" fill="rgba(0, 0, 0, 0.65)" stroke="rgba(255, 255, 255, 0.5)" transform="rotate(90)" xmlns:v="https://vecta.io/nano"><path fill-rule="evenodd" d="M14 0a2 2 0 0 0-2 2v10H2a2 2 0 1 0 0 4h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"/></svg>',Yne='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="22" height="22" fill="rgba(0, 0, 0, 0.65)" stroke="rgba(255, 255, 255, 0.5)" transform="matrix(0 1 1 0 0 0)" xmlns:v="https://vecta.io/nano"><path fill-rule="evenodd" d="M14 0a2 2 0 0 0-2 2v10H2a2 2 0 1 0 0 4h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"/></svg>',Zne=encodeURIComponent(Gne),Jne=encodeURIComponent(Yne),Kn,Xne=class{constructor(t){Rl(this,Kn,void 0);const e=document.createElement("div"),n=document.createElement("div");this.dom=e,Gi(this,Kn,n),this.type=t,this.createHandle(t)}createHandle(t){switch(Sn(this.dom,{position:"absolute",pointerEvents:"auto",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"100"}),Sn(Xe(this,Kn),{opacity:"0",transition:"opacity 300ms ease-in 0s"}),Xe(this,Kn).dataset.dragging="",t){case 0:Sn(this.dom,{right:"0px",top:"0px",height:"100%",width:"15px",cursor:"col-resize"}),Sn(Xe(this,Kn),{width:" 4px",height:"36px",maxHeight:"50%",boxSizing:"content-box",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 1:Sn(this.dom,{left:"0px",top:"0px",height:"100%",width:"15px",cursor:"col-resize"}),Sn(Xe(this,Kn),{width:" 4px",height:"36px",maxHeight:"50%",boxSizing:"content-box",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 2:Sn(this.dom,{bottom:"0px",width:"100%",height:"14px",cursor:"row-resize"}),Sn(Xe(this,Kn),{width:" 42px",height:"4px",boxSizing:"content-box",maxWidth:"50%",background:"rgba(0, 0, 0, 0.65)",border:"1px solid rgba(255, 255, 255, 0.5)",borderRadius:"6px"});break;case 3:Sn(this.dom,{right:"-1px",bottom:"-2px",width:"30px",height:"30px",cursor:"nwse-resize",zIndex:"101"}),Sn(Xe(this,Kn),{height:"22px",width:"22px",backgroundRepeat:"no-repeat",backgroundImage:`url("data:image/svg+xml,${Jne}") `});break;case 4:Sn(this.dom,{left:"-1px",bottom:"-2px",width:"30px",height:"30px",cursor:"nesw-resize",zIndex:"101"}),Sn(Xe(this,Kn),{height:"22px",width:"22px",backgroundRepeat:"no-repeat",backgroundImage:`url("data:image/svg+xml,${Zne}") `});break}this.dom.append(Xe(this,Kn))}setHandleVisibility(t){const e=t||!!Xe(this,Kn).dataset.dragging;Xe(this,Kn).style.opacity=e?"1":"0"}dataSetDragging(t){Xe(this,Kn).dataset.dragging=t?"true":""}};Kn=new WeakMap;var Sp=50,d$=(t=>(t[t.Fixed=0]="Fixed",t[t.Flexible=1]="Flexible",t))(d$||{}),na,ra,oa,Jo,ia,Qne=class{constructor({node:t,view:e,getPos:n,aspectRatio:r=0,options:o,initialSize:i}){Rl(this,na,void 0),Rl(this,ra,void 0),Rl(this,oa,[]),Rl(this,Jo,void 0),Rl(this,ia,void 0);const s=this.createWrapper(t,i),a=this.createElement({node:t,view:e,getPos:n,options:o}),c=(r===1?[0,1,2,3,4]:[0,1]).map(f=>new Xne(f));for(const f of c){const p=m=>{this.startResizing(m,e,n,f)};f.dom.addEventListener("mousedown",p),Xe(this,oa).push(()=>f.dom.removeEventListener("mousedown",p)),s.append(f.dom)}const u=()=>{c.forEach(f=>f.setHandleVisibility(!0))},d=()=>{c.forEach(f=>f.setHandleVisibility(!1))};s.addEventListener("mouseover",u),s.addEventListener("mouseout",d),Xe(this,oa).push(()=>s.removeEventListener("mouseover",u),()=>s.removeEventListener("mouseout",d)),s.append(a),this.dom=s,Gi(this,ra,t),Gi(this,na,a),this.aspectRatio=r}createWrapper(t,e){const n=document.createElement("div");return n.classList.add("remirror-resizable-view"),n.style.position="relative",e?Sn(n,{width:C_(e.width),aspectRatio:`${e.width} / ${e.height}`}):Sn(n,{width:C_(t.attrs.width),aspectRatio:`${t.attrs.width} / ${t.attrs.height}`}),Sn(n,{maxWidth:"100%",minWidth:`${Sp}px`,verticalAlign:"bottom",display:"inline-block",lineHeight:"0",transition:"width 0.15s ease-out, height 0.15s ease-out"}),n}startResizing(t,e,n,r){var o,i;t.preventDefault(),r.dataSetDragging(!0),Xe(this,na).style.pointerEvents="none";const s=t.pageX,a=t.pageY,l=((o=Xe(this,na))==null?void 0:o.getBoundingClientRect().width)||0,c=((i=Xe(this,na))==null?void 0:i.getBoundingClientRect().height)||0,u=P0(100,!1,f=>{const p=f.pageX,m=f.pageY,g=p-s,y=m-a;let v=null,x=null;if(this.aspectRatio===0&&l&&c)switch(r.type){case 0:case 3:v=l+g,x=c/l*v;break;case 1:case 4:v=l-g,x=c/l*v;break;case 2:x=c+y,v=l/c*x;break}else if(this.aspectRatio===1)switch(r.type){case 0:v=l+g;break;case 1:v=l-g;break;case 2:x=c+y;break;case 3:v=l+g,x=c+y;break;case 4:v=l-g,x=c+y;break}typeof v=="number"&&v<Sp&&(this.aspectRatio===0&&l&&c?(v=Sp,x=c/l*v):this.aspectRatio===1&&(v=Sp)),v&&(Gi(this,Jo,Math.round(v)),this.dom.style.width=`${Xe(this,Jo)}px`),x&&Gi(this,ia,Math.round(x)),(v||x)&&(this.dom.style.aspectRatio=`${Xe(this,Jo)} / ${Xe(this,ia)}`)}),d=f=>{f.preventDefault(),r.dataSetDragging(!1),r.setHandleVisibility(!1),Xe(this,na).style.pointerEvents="auto",document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",d);const p=n(),m=e.state.tr.setNodeMarkup(p,void 0,{...Xe(this,ra).attrs,width:Xe(this,Jo),height:Xe(this,ia)});e.dispatch(m)};document.addEventListener("mousemove",u),document.addEventListener("mouseup",d),Xe(this,oa).push(()=>document.removeEventListener("mousemove",u)),Xe(this,oa).push(()=>document.removeEventListener("mouseup",d))}update(t){return t.type!==Xe(this,ra).type||this.aspectRatio===0&&t.attrs.width&&t.attrs.width!==Xe(this,Jo)||this.aspectRatio===1&&t.attrs.width&&t.attrs.height&&t.attrs.width!==Xe(this,Jo)&&t.attrs.height!==Xe(this,ia)||!ere(Xe(this,ra),t,["width","height"])?!1:(Gi(this,ra,t),Gi(this,Jo,t.attrs.width),Gi(this,ia,t.attrs.height),!0)}destroy(){Xe(this,oa).forEach(t=>t())}};na=new WeakMap;ra=new WeakMap;oa=new WeakMap;Jo=new WeakMap;ia=new WeakMap;function ere(t,e,n){return t===e||tre(t,e,n)&&t.content.eq(e.content)}function tre(t,e,n){const r=t.attrs,o=e.attrs,i={};for(const a of n)i[a]=null;t.attrs={...r,...i},e.attrs={...o,...i};const s=t.sameMarkup(e);return t.attrs=r,e.attrs=o,s}function C_(t){return typeof t=="number"?`${t}px`:t||void 0}var nre=Object.defineProperty,rre=Object.getOwnPropertyDescriptor,Wb=(t,e,n,r)=>{for(var o=r>1?void 0:r?rre(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&nre(e,n,o),o},ore=class extends Qne{constructor(t,e,n){super({node:t,view:e,getPos:n,aspectRatio:d$.Fixed})}createElement({node:t}){const e=document.createElement("img");return e.setAttribute("src",t.attrs.src),Sn(e,{width:"100%",minWidth:"50px",objectFit:"contain"}),e}},mf=class extends Fr{get name(){return"image"}createTags(){return[Ie.InlineNode,Ie.Media]}createNodeSpec(t,e){const{preferPastedTextContent:n}=this.options;return{inline:!0,draggable:!0,selectable:!1,...e,attrs:{...t.defaults(),alt:{default:""},crop:{default:null},height:{default:null},width:{default:null},rotate:{default:null},src:{default:null},title:{default:""},fileName:{default:null},resizable:{default:!1}},parseDOM:[{tag:"img[src]",getAttrs:r=>{var o;if(Fo(r)){const i=sre({element:r,parse:t.parse});return n&&((o=i.src)!=null&&o.startsWith("file:///"))?!1:i}return{}}},...e.parseDOM??[]],toDOM:r=>{const o=$N(r.attrs,t);return["img",{...t.dom(r),...o}]}}}insertImage(t,e){return({tr:n,dispatch:r})=>{const{from:o,to:i}=Ir(e??n.selection,n.doc),s=this.type.create(t);return r==null||r(n.replaceRangeWith(o,i,s)),!0}}uploadImage(t,e){const{updatePlaceholder:n,destroyPlaceholder:r,createPlaceholder:o}=this.options;return i=>{const{tr:s}=i;let a=s.selection.from;return this.store.createPlaceholderCommand({promise:t,placeholder:{type:"widget",get pos(){return a},createElement:(l,c)=>{const u=o(l,c);return e==null||e(u),u},onUpdate:(l,c,u,d)=>{n(l,c,u,d)},onDestroy:(l,c)=>{r(l,c)}},onSuccess:(l,c,u)=>this.insertImage(l,c)(u)}).validate(({tr:l,dispatch:c})=>{const u=TR(l.doc,a,this.type);return u==null?!1:(a=u,l.selection.empty||c==null||c(l.deleteSelection()),!0)},"unshift").generateCommand()(i)}}fileUploadFileHandler(t,e,n){var r;const{preferPastedTextContent:o,uploadHandler:i}=this.options;if(o&&cre(e)&&((r=e.clipboardData)!=null&&r.getData("text/plain")))return!1;const{commands:s,chain:a}=this.store,l=t.map((u,d)=>({file:u,progress:f=>{s.updatePlaceholder(c[d],f)}})),c=i(l);mr(n)&&a.selectText(n);for(const u of c)a.uploadImage(u);return a.run(),!0}createPasteRules(){return[{type:"file",regexp:/image/i,fileHandler:t=>{const e=t.type==="drop"?t.pos:void 0;return this.fileUploadFileHandler(t.files,t.event,e)}}]}createNodeViews(){return this.options.enableResizing?(t,e,n)=>new ore(t,e,n):{}}};Wb([ue()],mf.prototype,"insertImage",1);Wb([ue()],mf.prototype,"uploadImage",1);mf=Wb([Ze({defaultOptions:{createPlaceholder:are,updatePlaceholder:()=>{},destroyPlaceholder:()=>{},uploadHandler:lre,enableResizing:!1,preferPastedTextContent:!0}})],mf);function ire(t){let{width:e,height:n}=t.style;return e=e||t.getAttribute("width")||"",n=n||t.getAttribute("height")||"",{width:e,height:n}}function sre({element:t,parse:e}){const{width:n,height:r}=ire(t);return{...e(t),alt:t.getAttribute("alt")??"",height:Number.parseInt(r||"0",10)||null,src:t.getAttribute("src")??null,title:t.getAttribute("title")??"",width:Number.parseInt(n||"0",10)||null,fileName:t.getAttribute("data-file-name")??null}}function are(t,e){const n=document.createElement("div");return n.classList.add(jJ.IMAGE_LOADER),n}function lre(t){ve(t.length>0,{code:K.EXTENSION,message:"The upload handler was applied for the image extension without any valid files"});let e=0;const n=[];for(const{file:r,progress:o}of t)n.push(()=>new Promise(i=>{const s=new FileReader;s.addEventListener("load",a=>{var l;e+=1,o(e/t.length),i({src:(l=a.target)==null?void 0:l.result,fileName:r.name})},{once:!0}),s.readAsDataURL(r)}));return n}function cre(t){return t.clipboardData!==void 0}function ure(t={}){return new Ti({view(e){return new dre(e,t)}})}class dre{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(o=>{let i=s=>{this[o](s)};return e.dom.addEventListener(o,i),{name:o,handler:i}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let a=e.nodeBefore,l=e.nodeAfter;if(a||l){let c=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(c){let u=c.getBoundingClientRect(),d=a?u.bottom:u.top;a&&l&&(d=(d+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:u.left,right:u.right,top:d-this.width/2,bottom:d+this.width/2}}}}if(!r){let a=this.editorView.coordsAtPos(this.cursorPos);r={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}let o=this.editorView.dom.offsetParent;this.element||(this.element=o.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 i,s;if(!o||o==document.body&&getComputedStyle(o).position=="static")i=-pageXOffset,s=-pageYOffset;else{let a=o.getBoundingClientRect();i=a.left-o.scrollLeft,s=a.top-o.scrollTop}this.element.style.left=r.left-i+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),o=r&&r.type.spec.disableDropCursor,i=typeof o=="function"?o(this.editorView,n,e):o;if(n&&!i){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=OR(this.editorView.state.doc,s,this.editorView.dragging.slice);a!=null&&(s=a)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}var fre=Object.defineProperty,pre=Object.getOwnPropertyDescriptor,hre=(t,e,n,r)=>{for(var o=r>1?void 0:r?pre(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&fre(e,n,o),o},mx=class extends St{get name(){return"dropCursor"}createExternalPlugins(){const{color:t,width:e}=this.options;return[ure({color:t,width:e})]}};mx=hre([Ze({defaultOptions:{color:"black",width:1}})],mx);var mre=Object.defineProperty,gre=Object.getOwnPropertyDescriptor,f$=(t,e,n,r)=>{for(var o=r>1?void 0:r?gre(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&mre(e,n,o),o},{LABEL:vre}=IF,yre={icon:({attrs:t})=>`h${(t==null?void 0:t.level)??"1"}`,label:({t,attrs:e})=>t({...vre,values:{level:e==null?void 0:e.level}})},xre=[q.H1,q.H2,q.H3,q.H4,q.H5,q.H6],_m=class extends Fr{get name(){return"heading"}createTags(){return[Ie.Block,Ie.TextBlock,Ie.FormattingNode]}createNodeSpec(t,e){return{content:"inline*",defining:!0,draggable:!1,...e,attrs:{...t.defaults(),level:{default:this.options.defaultLevel}},parseDOM:[...this.options.levels.map(n=>({tag:`h${n}`,getAttrs:r=>({...t.parse(r),level:n})})),...e.parseDOM??[]],toDOM:n=>this.options.levels.includes(n.attrs.level)?[`h${n.attrs.level}`,t.dom(n),0]:[`h${this.options.defaultLevel}`,t.dom(n),0]}}toggleHeading(t={}){return DN({type:this.type,toggleType:"paragraph",attrs:t})}createKeymap(t){const e=this.store.getExtension(Fe),n=pe(),r=[];for(const o of this.options.levels){const i=xre[o-1]??q.H1;n[i]=dm(this.type,{level:o}),r.push({attrs:{level:o},shortcut:t(i)[0]})}return e.updateDecorated("toggleHeading",{shortcut:r}),n}createInputRules(){return this.options.levels.map(t=>tB(new RegExp(`^(#{1,${t}})\\s$`),this.type,()=>({level:t})))}createPasteRules(){return this.options.levels.map(t=>({type:"node",nodeType:this.type,regexp:new RegExp(`^#{${t}}\\s([\\s\\w]+)$`),getAttributes:()=>({level:t}),startOfTextBlock:!0}))}};f$([ue(yre)],_m.prototype,"toggleHeading",1);_m=f$([Ze({defaultOptions:{levels:[1,2,3,4,5,6],defaultLevel:1},staticKeys:["defaultLevel","levels"]})],_m);var p$={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(typeof self<"u"?self:q$,function(){return function(n){function r(i){if(o[i])return o[i].exports;var s=o[i]={i,l:!1,exports:{}};return n[i].call(s.exports,s,s.exports,r),s.l=!0,s.exports}var o={};return r.m=n,r.c=o,r.d=function(i,s,a){r.o(i,s)||Object.defineProperty(i,s,{configurable:!1,enumerable:!0,get:a})},r.n=function(i){var s=i&&i.__esModule?function(){return i.default}:function(){return i};return r.d(s,"a",s),s},r.o=function(i,s){return Object.prototype.hasOwnProperty.call(i,s)},r.p="",r(r.s=0)}([function(n,r,o){function i(){throw new TypeError("The given URL is not a string. Please verify your string|array.")}function s(c){typeof c!="string"&&i();for(var u=0,d=0,f=0,p=c.length,m=0;p--&&++m&&!(u&&-1<a.indexOf(c[m]));)c[m]==="."&&(++u,d=m);for(u=m,m=d;m--;)if(l.indexOf(c[m])!==-1){f=m+1;break}return 2>f?"":c.slice(f,u)}var a=["/",":","?","#"],l=[".","/","@"];n.exports=function(c){if(typeof c=="string")return s(c);if(Array.isArray(c)){var u=[],d,f=0;for(d=c.length;f<d;f++)u.push(s(c[f]));return u}i()}}])})})(p$);var bre=p$.exports;const wre=ki(bre);var kre=Object.defineProperty,Sre=Object.getOwnPropertyDescriptor,zf=(t,e,n,r)=>{for(var o=r>1?void 0:r?Sre(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&kre(e,n,o),o},Ere=["com","de","net","org","uk","cn","ga","nl","cf","ml","tk","ru","br","gq","xyz","fr","eu","info","co","au","ca","it","in","ch","pl","es","online","us","top","be","jp","biz","se","at","dk","cz","za","me","ir","icu","shop","kr","site","mx","hu","io","cc","club","no","cyou"],T_="updateLink",_re=/(?:(?:(?:https?|ftp):)?\/\/)?(?:\S+(?::\S*)?@)?(?:(?:[\da-z\u00A1-\uFFFF][\w\u00A1-\uFFFF-]{0,62})?[\da-z\u00A1-\uFFFF]\.)*(?:(?:\d(?!\.)|[a-z\u00A1-\uFFFF])(?:[\da-z\u00A1-\uFFFF][\w\u00A1-\uFFFF-]{0,62})?[\da-z\u00A1-\uFFFF]\.)+[a-z\u00A1-\uFFFF]{2,}(?::\d{2,5})?(?:[#/?]\S*)?/gi,Ga=class extends If{constructor(){super(...arguments),this._autoLinkRegexNonGlobal=void 0}get name(){return"link"}createTags(){return[Ie.Link,Ie.ExcludeInputRules]}createMarkSpec(t,e){const n="data-link-auto",r=o=>{const{defaultTarget:i,supportedTargets:s}=this.options,a=i?[...s,i]:s;return o&&mo(a,o)?{target:o}:void 0};return{inclusive:!1,excludes:"_",...e,attrs:{...t.defaults(),href:{},target:{default:this.options.defaultTarget},auto:{default:!1}},parseDOM:[{tag:"a[href]",getAttrs:o=>{if(!Fo(o))return!1;const i=o.getAttribute("href"),s=o.textContent,a=this.options.autoLink&&(o.hasAttribute(n)||i===s||(i==null?void 0:i.replace(`${this.options.defaultProtocol}//`,""))===s);return{...t.parse(o),href:i,auto:a,...r(o.getAttribute("target"))}}},...e.parseDOM??[]],toDOM:o=>{const{auto:i,target:s,...a}=$N(o.attrs,t),l=o.attrs.auto?{[n]:""}:{};return["a",{...t.dom(o),...a,rel:"noopener noreferrer nofollow",...l,...r(o.attrs.target)},0]}}}onCreate(){const{autoLinkRegex:t}=this.options;this._autoLinkRegexNonGlobal=new RegExp(`^${t.source}$`,t.flags.replace("g",""))}shortcut({tr:t}){let e="",{from:n,to:r,empty:o,$from:i}=t.selection,s=!1;const a=wi(i,this.type);if(o){const l=a??RN(t);if(!l)return!1;({text:e,from:n,to:r}=l),s=!0}return n===r?!1:(s||(e=t.doc.textBetween(n,r)),this.options.onActivateLink(e),this.options.onShortcut({activeLink:a?{attrs:a.mark.attrs,from:a.from,to:a.to}:void 0,selectedText:e,from:n,to:r}),!0)}updateLink(t,e){return n=>{const{tr:r}=n;return!(tl(r.selection)&&!vb(r.selection)||yV(r.selection)||um({trState:r,type:this.type}))&&!e?!1:(r.setMeta(this.name,{command:T_,attrs:t,range:e}),jV({type:this.type,attrs:t,range:e})(n))}}selectLink(){return this.store.commands.selectMark.original(this.type)}removeLink(t){return e=>{const{tr:n}=e;return um({trState:n,type:this.type,...t})?jN({type:this.type,expand:!0,range:t})(e):!1}}createPasteRules(){return[{type:"mark",regexp:this.options.autoLinkRegex,markType:this.type,getAttributes:(t,e)=>({href:this.buildHref(cd(t)),auto:!e}),transformMatch:t=>{const e=cd(t);return!e||!this.isValidUrl(e)?!1:e}}]}createEventHandlers(){return{clickMark:(t,e)=>{const n=e.getMark(this.type);if(!n)return;const r=n.mark.attrs,o={...r,...n};if(this.options.onClick(t,o))return!0;if(!this.store.view.editable)return;let i=!1;if(this.options.openLinkOnClick){i=!0;const s=r.href;window.open(s,"_blank")}return this.options.selectTextOnClick&&(i=!0,this.store.commands.selectText(n)),i}}}createPlugin(){return{appendTransaction:(t,e,n)=>{if(t.filter(p=>!!p.getMeta(this.name)).forEach(p=>{const m=p.getMeta(this.name);if(m.command===T_){const{range:g,attrs:y}=m,{selection:v,doc:x}=n,w={range:g,selection:v,doc:x,attrs:y},{from:S,to:_}=g??v;this.options.onUpdateLink(x.textBetween(S,_),w)}}),!this.options.autoLink||lx(e)-lx(n)===1||!t.some(p=>p.docChanged))return;const s=iV(t,e),a=SV(s,[zt,nn]),{mapping:l}=s,{tr:c,doc:u}=n,{updateLink:d,removeLink:f}=this.store.chain(c);if(a.forEach(({prevFrom:p,prevTo:m,from:g,to:y})=>{const v=[],x=y-g===2,w=this.getLinkMarksInRange(e.doc,p,m,!0).filter(S=>S.mark.type===this.type).map(({from:S,to:_,text:k})=>({mappedFrom:l.map(S),mappedTo:l.map(_),text:k,from:S,to:_}));w.forEach(({mappedFrom:S,mappedTo:_,from:k,to:E},C)=>this.getLinkMarksInRange(u,S,_,!0).filter(T=>T.mark.type===this.type).forEach(T=>{const A=e.doc.textBetween(k,E,void 0," "),B=u.textBetween(T.from,T.to+1,void 0," ").trim(),D=this.isValidUrl(A);this.isValidUrl(B)||(D&&(f({from:T.from,to:T.to}).tr(),w.splice(C,1)),!x&&g===y&&this.findAutoLinks(B).map(U=>this.addLinkProperties({...U,from:S+U.start,to:S+U.end})).forEach(({attrs:U,range:G,text:R})=>{d(U,G).tr(),v.push({attrs:U,range:G,text:R})}))})),this.findTextBlocksInRange(u,{from:g,to:y}).forEach(({text:S,positionStart:_})=>{this.findAutoLinks(S).map(k=>this.addLinkProperties({...k,from:_+k.start+1,to:_+k.end+1})).filter(({range:k})=>{const E=g>=k.from&&g<=k.to,C=y>=k.from&&y<=k.to;return E||C||x}).filter(({range:k})=>this.getLinkMarksInRange(c.doc,k.from,k.to,!1).length===0).filter(({range:{from:k},text:E})=>!w.some(({text:C,mappedFrom:T})=>T===k&&C===E)).forEach(({attrs:k,text:E,range:C})=>{d(k,C).tr(),v.push({attrs:k,range:C,text:E})})}),window.requestAnimationFrame(()=>{v.forEach(({attrs:S,range:_,text:k})=>{const{doc:E,selection:C}=c;this.options.onUpdateLink(k,{attrs:S,doc:E,range:_,selection:C})})})}),c.steps.length!==0)return c}}}buildHref(t){return this.options.extractHref({url:t,defaultProtocol:this.options.defaultProtocol})}getLinkMarksInRange(t,e,n,r){const o=[];if(e===n){const i=Math.max(e-1,0),s=t.resolve(i),a=wi(s,this.type);(a==null?void 0:a.mark.attrs.auto)===r&&o.push(a)}else t.nodesBetween(e,n,(i,s)=>{const l=(i.marks??[]).find(({type:c,attrs:u})=>c===this.type&&u.auto===r);l&&o.push({from:s,to:s+i.nodeSize,mark:l,text:i.textContent})});return o}findTextBlocksInRange(t,e){const n=[];return t.nodesBetween(e.from,e.to,(r,o)=>{!r.isTextblock||!r.type.allowsMarkType(this.type)||n.push({node:r,pos:o})}),n.map(r=>({text:t.textBetween(r.pos,r.pos+r.node.nodeSize,void 0," "),positionStart:r.pos}))}addLinkProperties({from:t,to:e,href:n,...r}){return{...r,range:{from:t,to:e},attrs:{href:n,auto:!0}}}findAutoLinks(t){if(this.options.findAutoLinks)return this.options.findAutoLinks(t,this.options.defaultProtocol);const e=[];for(const n of Sg(t,this.options.autoLinkRegex)){const r=cd(n);if(!r)continue;const o=this.buildHref(r);!this.isValidTLD(o)&&!o.startsWith("tel:")||e.push({text:r,href:o,start:n.index,end:n.index+r.length})}return e}isValidUrl(t){var e;return this.options.isValidUrl?this.options.isValidUrl(t,this.options.defaultProtocol):this.isValidTLD(this.buildHref(t))&&!!((e=this._autoLinkRegexNonGlobal)!=null&&e.test(t))}isValidTLD(t){const{autoLinkAllowedTLDs:e}=this.options;if(e.length===0)return!0;const n=wre(t);if(n==="")return!0;const r=Sz(n.split("."));return e.includes(r)}};zf([wr({shortcut:q.InsertLink})],Ga.prototype,"shortcut",1);zf([ue()],Ga.prototype,"updateLink",1);zf([ue()],Ga.prototype,"selectLink",1);zf([ue()],Ga.prototype,"removeLink",1);Ga=zf([Ze({defaultOptions:{autoLink:!1,defaultProtocol:"",selectTextOnClick:!1,openLinkOnClick:!1,autoLinkRegex:_re,autoLinkAllowedTLDs:Ere,findAutoLinks:void 0,isValidUrl:void 0,defaultTarget:null,supportedTargets:[],extractHref:Cre},staticKeys:["autoLinkRegex"],handlerKeyOptions:{onClick:{earlyReturnValue:!0}},handlerKeys:["onActivateLink","onShortcut","onUpdateLink","onClick"],defaultPriority:at.Medium})],Ga);function Cre({url:t,defaultProtocol:e}){const n=/^((?:https?|ftp)?:)\/\//.test(t);return!n&&t.includes("@")?`mailto:${t}`:n?t:`${e}//${t}`}var Tre=Object.defineProperty,Ore=Object.getOwnPropertyDescriptor,h$=(t,e,n,r)=>{for(var o=r>1?void 0:r?Ore(e,n):e,i=t.length-1,s;i>=0;i--)(s=t[i])&&(o=(r?s(e,n,o):s(o))||o);return r&&o&&Tre(e,n,o),o},Cm=class extends Fr{get name(){return"hardBreak"}createTags(){return[Ie.InlineNode]}createNodeSpec(t,e){return{inline:!0,selectable:!1,atom:!0,leafText:()=>`
227
- `,...e,attrs:t.defaults(),parseDOM:[{tag:"br",getAttrs:t.parse},...e.parseDOM??[]],toDOM:n=>["br",t.dom(n)]}}createKeymap(){const t=oV(ld(VN),()=>(this.store.commands.insertHardBreak(),!0));return{"Mod-Enter":t,"Shift-Enter":t}}insertHardBreak(){return t=>{const{tr:e,dispatch:n}=t;return n==null||n(e.replaceSelectionWith(this.type.create()).scrollIntoView()),!0}}};h$([ue()],Cm.prototype,"insertHardBreak",1);Cm=h$([Ze({defaultPriority:at.Low})],Cm);const Mre=[new qa,new pf,new hf,new mf({enableResizing:!1}),new mx,new _m({levels:[1,2,3,4,5,6],defaultLevel:1}),new cf,new uf,new Ga({autoLink:!0}),new Cm];function Rre(t){const{manager:e,state:n}=WX({extensions:()=>Mre.slice(),content:t,selection:"start"});return{manager:e,state:n}}function Nre({state:t,manager:e,options:n,onChange:r,debug:o}){const i=n&&Object.entries(n).some(([,c])=>c),[s,a]=h.useState(i),l=Ln("p-4 border rounded-md outline-none appearance-none border-input bg-background",{"rounded-t-none border-t-0":s});return b.jsx("div",{className:"text-base val-rich-text-editor",children:b.jsx(GX,{manager:e,initialContent:t,classNames:[l],children:b.jsxs(Lne,{initialProps:{mode:"default"},children:[b.jsx(Pre,{hasOptions:i,options:n,debug:o,onShowToolbar:c=>{a(c)}}),b.jsx(ux,{}),r&&b.jsx(KX,{onChange:r})]})})})}const Pre=({options:t,hasOptions:e,onShowToolbar:n,debug:r})=>{var l,c,u,d,f,p;const o=Ib(),i=NX(),s=e||i.heading()||i.image()||i.link()||i.bulletList()||i.orderedList()||i.bold()||i.italic()||i.strike();h.useEffect(()=>{n(s)},[s]);const a=h.useRef(null);return b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"h-0",ref:a}),b.jsxs("div",{className:Ln("sticky top-0 flex flex-col py-2 z-[40] border divide-y rounded-md rounded-b-none border-input bg-background",{hidden:!s}),children:[b.jsxs("div",{className:"flex flex-row items-center justify-start px-4 py-1 gap-x-3",children:[((t==null?void 0:t.headings)||i.heading())&&b.jsxs(qee,{children:[b.jsx(Gee,{asChild:!0,className:"pr-4",children:b.jsxs("button",{children:[i.heading({level:1})&&b.jsx(Ck,{size:22}),i.heading({level:2})&&b.jsx(Tk,{size:22}),i.heading({level:3})&&b.jsx(Ok,{size:22}),i.heading({level:4})&&b.jsx(Mk,{size:22}),i.heading({level:5})&&b.jsx(Rk,{size:22}),i.heading({level:6})&&b.jsx(Nk,{size:22}),!i.heading()&&"Normal"]})}),b.jsxs(n$,{container:a.current,children:[b.jsx(qi,{onClick:()=>{o.setBlockNodeType("paragraph").focus().run()},children:"Normal"}),((l=t==null?void 0:t.headings)==null?void 0:l.includes("h1"))&&b.jsx(qi,{onClick:()=>{o.setBlockNodeType("heading",{level:1}).focus().run()},children:b.jsx(Ck,{size:16})}),((c=t==null?void 0:t.headings)==null?void 0:c.includes("h2"))&&b.jsx(qi,{onClick:()=>{o.setBlockNodeType("heading",{level:2}).focus().run()},children:b.jsx(Tk,{size:16})}),((u=t==null?void 0:t.headings)==null?void 0:u.includes("h3"))&&b.jsx(qi,{onClick:()=>{o.setBlockNodeType("heading",{level:3}).focus().run()},children:b.jsx(Ok,{size:16})}),((d=t==null?void 0:t.headings)==null?void 0:d.includes("h4"))&&b.jsx(qi,{onClick:()=>{o.setBlockNodeType("heading",{level:4}).focus().run()},children:b.jsx(Mk,{size:16})}),((f=t==null?void 0:t.headings)==null?void 0:f.includes("h5"))&&b.jsx(qi,{onClick:()=>{o.setBlockNodeType("heading",{level:5}).focus().run()},children:b.jsx(Rk,{size:16})}),((p=t==null?void 0:t.headings)==null?void 0:p.includes("h5"))&&b.jsx(qi,{onClick:()=>{o.setBlockNodeType("heading",{level:6}).focus().run()},children:b.jsx(Nk,{size:16})})]})]}),b.jsx(bl,{icon:b.jsx(z5,{size:18}),stroke:3,mark:"bold",isOption:t==null?void 0:t.bold,isActive:i.bold(),onToggle:m=>m.toggleBold().focus().run()}),b.jsx(bl,{icon:b.jsx(sL,{size:18}),stroke:3,mark:"strike",isOption:t==null?void 0:t.lineThrough,isActive:i.strike(),onToggle:m=>m.toggleStrike().focus().run()}),b.jsx(bl,{icon:b.jsx(q5,{size:18}),stroke:3,mark:"italic",isOption:t==null?void 0:t.italic,isActive:i.italic(),onToggle:m=>m.toggleItalic().focus().run()}),b.jsx(bl,{icon:b.jsx(Z5,{size:18}),stroke:3,mark:"bulletList",isOption:t==null?void 0:t.ul,isActive:i.bulletList(),onToggle:m=>m.toggleBulletList().focus().run()}),b.jsx(bl,{icon:b.jsx(Y5,{size:18}),stroke:3,mark:"list",isOption:t==null?void 0:t.ol,isActive:i.orderedList(),onToggle:m=>m.toggleOrderedList().focus().run()}),b.jsx(bl,{icon:b.jsx(G5,{size:18}),stroke:3,mark:"link",isOption:t==null?void 0:t.ol,isActive:i.link(),onToggle:m=>m.selectMark("link").updateLink({href:""}).focus().run()}),((t==null?void 0:t.img)||i.image())&&b.jsxs("label",{className:"cursor-pointer",htmlFor:"val-toolbar-image-select",children:[b.jsx("input",{hidden:!0,id:"val-toolbar-image-select",accept:"image/*",type:"file",onChange:m=>{MM(m).then(g=>{o.insertImage({src:g.src,width:g.width,height:g.height,fileName:RM(g.src,g.filename??null,{width:g.width,height:g.height,sha256:g.sha256,mimeType:g.mimeType})??void 0}).focus().run()})}}),b.jsx(K5,{size:18,className:`${i.image()&&"stroke-[3px]"}`})]}),r&&b.jsx("button",{onMouseDown:m=>m.preventDefault(),onClick:()=>o.insertHardBreak().run(),children:"Br"})]}),b.jsx($re,{})]})]})};function $re(){const t=Ib(),[e,n]=h.useState(),r=PX().link();return h.useEffect(()=>{const i=typeof r=="object"&&"href"in r&&typeof r.href=="string"?r.href:void 0;n(i)},[r==null?void 0:r.href]),r!==void 0?b.jsxs("div",{className:"flex items-center justify-start px-4 pt-1 gap-x-2",children:[b.jsx("input",{className:"bg-transparent text-accent",onChange:i=>{n(i.target.value)},defaultValue:e,placeholder:"https://"}),b.jsx("button",{className:"p-2",title:"Update",disabled:e===void 0,onClick:()=>{e!==void 0&&t.selectMark("link").updateLink({href:e}).focus().run()},children:b.jsx(y1,{size:14})}),b.jsx("button",{className:"p-2",title:"Remove",onClick:()=>{t.removeLink().focus().run()},children:b.jsx(lL,{size:13})})]}):null}function bl({stroke:t,mark:e,isOption:n,isActive:r,onToggle:o,icon:i}){const s=Ib();return!n&&!r?null:b.jsx("button",{className:Ln({"text-accent":r,"stroke-[2px]":r&&t===2,"stroke-[3px]":r&&t===3}),onClick:a=>{a.preventDefault(),o(n?s:s.selectMark(e))},children:i})}function m$({path:t,disabled:e,source:n,schema:r,registerPatchCallback:o,onSubmit:i}){return(typeof n=="string"||n===null)&&(r==null?void 0:r.type)==="string"?b.jsx(Fre,{path:t,defaultValue:n,disabled:e,schema:r,registerPatchCallback:o,onSubmit:i}):(typeof n=="number"||n===null)&&(r==null?void 0:r.type)==="number"?b.jsx(M_,{defaultValue:n,disabled:e,registerPatchCallback:o,onSubmit:i}):(typeof n=="number"||typeof n=="string"||n===null)&&(r==null?void 0:r.type)==="keyOf"?b.jsx(O_,{defaultValue:n,disabled:e,registerPatchCallback:o,onSubmit:i,selector:r.selector}):(typeof n=="number"||n===null)&&(r==null?void 0:r.type)==="number"?b.jsx(M_,{defaultValue:n,disabled:e,registerPatchCallback:o,onSubmit:i}):(typeof n=="number"||typeof n=="string"||n===null)&&(r==null?void 0:r.type)==="keyOf"?b.jsx(O_,{defaultValue:n,disabled:e,registerPatchCallback:o,onSubmit:i,selector:r.selector}):(typeof n=="object"||n===null)&&(r==null?void 0:r.type)==="richtext"?b.jsx(zre,{schema:r,onSubmit:i,defaultValue:n}):(typeof n=="object"||n===null)&&(r==null?void 0:r.type)==="image"?b.jsx(Lre,{path:t,registerPatchCallback:o,onSubmit:i,defaultValue:n}):(typeof n=="object"||n===null)&&(r==null?void 0:r.type)==="file"?b.jsx(Dre,{path:t,registerPatchCallback:o,onSubmit:i,defaultValue:n}):b.jsxs("div",{children:["Unsupported schema: ",r.type," (source type: ",typeof n," source:"," ",JSON.stringify(n),")"]})}function Tm(t,e,n,r){const o=RM(e,n,r);return!o||!r?[]:[{value:{[gn]:`/public/${o}`,[sn]:"file",metadata:r},op:"replace",path:t},{value:e,op:"file",path:t,filePath:`/public/${o}`}]}function g$(t,e){const n=t+"/metadata";return[{value:e,op:"replace",path:n}]}const Are=new TextEncoder;function Ire(t){return new Promise((e,n)=>{var i;const r=(i=t.currentTarget.files)==null?void 0:i[0],o=new FileReader;o.addEventListener("load",()=>{const s=o.result;if(typeof s=="string"){const a=yt.getSHA256Hash(Are.encode(s)),l=hg(s);e({src:s,filename:r==null?void 0:r.name,sha256:a,mimeType:l,fileExt:l&&mg(l)})}else n(s?{message:"Unexpected file result type",result:s}:{message:"Empty result"})}),r&&o.readAsDataURL(r)})}function Dre({path:t,defaultValue:e,onSubmit:n,registerPatchCallback:r}){var f,p;const[o,i]=h.useState(null),[s,a]=h.useState(!1),[l,c]=h.useState(),[u,d]=h.useState();return h.useEffect(()=>{const m=e&&yt.convertFileSource(e).url;d(m)},[e]),h.useEffect(()=>{r&&r(async m=>Tm(m,(o==null?void 0:o.src)??null,(o==null?void 0:o.filename)??null,l))},[o,e]),b.jsxs(Ws,{children:[b.jsxs("div",{className:"w-fit",children:[b.jsx("div",{className:"flex flex-col justify-start p-2 border border-b-0 rounded-sm rounded-b-none gap-y-4 bg-background text-foreground border-input",children:o||u?b.jsxs("div",{className:"relative flex flex-col justify-center items-center min-h-[100px] min-w-[200px]",children:[b.jsx("div",{children:b.jsx(W5,{})}),b.jsx("div",{children:o==null?void 0:o.filename})]}):b.jsx("div",{children:"Select file below"})},t),b.jsxs("div",{className:"p-4 border border-t-0 rounded-b-sm bg-background border-input",children:[b.jsx("label",{htmlFor:`img_input:${t}`,className:"block px-1 py-2 text-sm text-center rounded-md cursor-pointer bg-primary text-background",children:"Update"}),b.jsx("input",{hidden:!0,id:`img_input:${t}`,type:"file",onChange:m=>{Ire(m).then(g=>{i({src:g.src,filename:g.filename}),g.mimeType?c({sha256:g.sha256,mimeType:g.mimeType}):c(void 0)}).catch(g=>{console.error(g.message),i(null),c(void 0)})}})]})]}),n&&b.jsx(sl,{loading:s,enabled:!!o||((f=e==null?void 0:e.metadata)==null?void 0:f.mimeType)!==(l==null?void 0:l.mimeType)||((p=e==null?void 0:e.metadata)==null?void 0:p.sha256)!==(l==null?void 0:l.sha256),onClick:()=>{o?(a(!0),n(m=>Promise.resolve(Tm(m,o.src,o.filename??null,l))).finally(()=>{a(!1),i(null),c(void 0)})):l&&(a(!0),n(m=>Promise.resolve(g$(m,l))).finally(()=>{a(!1),i(null),c(void 0)}))}})]})}function Lre({path:t,defaultValue:e,onSubmit:n,registerPatchCallback:r}){var m,g,y,v,x,w,S,_,k,E,C,T;const[o,i]=h.useState(null),[s,a]=h.useState(!1),[l,c]=h.useState(),[u,d]=h.useState(),[f,p]=h.useState();return h.useEffect(()=>{p(e&&yt.convertFileSource(e).url)},[e]),h.useEffect(()=>{r&&r(async A=>Tm(A,(o==null?void 0:o.src)??null,(o==null?void 0:o.filename)??null,l))},[o,e]),h.useEffect(()=>{var A;if(u)if(l){const B={...l,hotspot:u};c(B)}else e!=null&&e.metadata?c({...e.metadata,hotspot:u}):console.error("Neither image metadata nor value is set");else(A=e==null?void 0:e.metadata)!=null&&A.hotspot&&d(e.metadata.hotspot)},[u,e]),b.jsxs(Ws,{children:[b.jsxs("div",{className:"w-fit",children:[b.jsx("div",{className:"flex flex-col justify-start p-2 border border-b-0 rounded-sm rounded-b-none gap-y-4 bg-background text-foreground border-input",children:o||f?b.jsxs("div",{className:"relative",children:[u&&b.jsx("div",{className:"rounded-full h-[12px] w-[12px] bg-background mix-blend-difference border-accent border-2 absolute pointer-events-none",style:{top:`${u.y*100}%`,left:`${u.x*100}%`}}),b.jsx("img",{src:(o==null?void 0:o.src)||f,draggable:!1,className:"object-contain w-full max-h-[500px]",style:{cursor:"crosshair"},onClick:A=>{const{width:B,height:D,left:Z,top:U}=A.currentTarget.getBoundingClientRect(),G=(A.clientX-6-Z)/B,R=(A.clientY-6-U)/D;d({x:G,y:R,width:1,height:1})}})]}):b.jsx("div",{children:"Select image below"})},t),b.jsxs("div",{className:"p-4 border border-t-0 rounded-b-sm bg-background border-input",children:[b.jsx("label",{htmlFor:`img_input:${t}`,className:"block px-1 py-2 text-sm text-center rounded-md cursor-pointer bg-primary text-background",children:"Update"}),b.jsx("input",{hidden:!0,id:`img_input:${t}`,type:"file",onChange:A=>{MM(A).then(B=>{i({src:B.src,filename:B.filename}),B.width&&B.height&&B.mimeType?c({sha256:B.sha256,width:B.width,height:B.height,mimeType:B.mimeType,hotspot:u}):(c(void 0),d(void 0))}).catch(B=>{console.error(B.message),i(null),d(void 0),c(void 0)})}})]})]}),n&&b.jsx(sl,{loading:s,enabled:!!o||((g=(m=e==null?void 0:e.metadata)==null?void 0:m.hotspot)==null?void 0:g.height)!==(u==null?void 0:u.height)||((v=(y=e==null?void 0:e.metadata)==null?void 0:y.hotspot)==null?void 0:v.width)!==(u==null?void 0:u.width)||((w=(x=e==null?void 0:e.metadata)==null?void 0:x.hotspot)==null?void 0:w.x)!==(u==null?void 0:u.x)||((_=(S=e==null?void 0:e.metadata)==null?void 0:S.hotspot)==null?void 0:_.y)!==(u==null?void 0:u.y)||((k=e==null?void 0:e.metadata)==null?void 0:k.width)!==(l==null?void 0:l.width)||((E=e==null?void 0:e.metadata)==null?void 0:E.height)!==(l==null?void 0:l.height)||((C=e==null?void 0:e.metadata)==null?void 0:C.mimeType)!==(l==null?void 0:l.mimeType)||((T=e==null?void 0:e.metadata)==null?void 0:T.sha256)!==(l==null?void 0:l.sha256),onClick:()=>{o?(a(!0),n(A=>Promise.resolve(Tm(A,o.src,o.filename??null,l))).finally(()=>{a(!1),i(null),c(void 0)})):l&&(a(!0),n(A=>Promise.resolve(g$(A,l))).finally(()=>{a(!1),i(null),c(void 0)}))}})]})}function jre(t,e){const{templateStrings:n,exprs:r,files:o}=e?D8(e):{[sn]:"richtext",templateStrings:[""],exprs:[],files:{}};return[{op:"replace",path:t,value:{templateStrings:n,exprs:r,[sn]:"richtext"}},...Object.entries(o).map(([i,s])=>({op:"file",path:t,filePath:i,value:s}))]}function zre({defaultValue:t,schema:e,onSubmit:n}){const[r,o]=h.useState(!1),[i,s]=h.useState(!1),[a,l]=h.useState();h.useEffect(()=>{o(!0),l(void 0)},[t]);const{state:c,manager:u}=Rre(t&&K8(gM(t)));return b.jsxs(Ws,{children:[b.jsx(Nre,{options:e.options,onChange:d=>{o(!0),l(d)},state:c,manager:u}),n&&b.jsx(sl,{loading:i,enabled:r,onClick:()=>{if(a){s(!0);const d=W8.safeParse(a);d.success?n(async f=>jre(f,d.data)).finally(()=>{s(!1),o(!1)}):(s(!1),alert(`Could not parse Rich Text
228
- `+JSON.stringify(d.error,null,2)))}}})]})}function O_({disabled:t,defaultValue:e,registerPatchCallback:n,onSubmit:r,selector:o}){const i=Coe(o),a=(p=>Array.isArray(p.moduleSource)?{type:"number",values:Object.keys(p.moduleSource).map(m=>parseInt(m))}:{type:"string",values:Object.keys(p.moduleSource??["ERROR fetching source"])})(i),[l,c]=h.useState(e||a.values[0]),[u,d]=h.useState(!1);h.useEffect(()=>{d(t)},[t]);const f=p=>{if(a.type==="number"){if(p==="")throw new Error("Value cannot be empty");if(Number.isNaN(Number(p)))throw new Error("Value was not a number: "+JSON.stringify(p));return Number(p)}return p};return h.useEffect(()=>{n&&n(async p=>[{op:"replace",path:p,value:l}])},[l]),b.jsxs(Ws,{children:[b.jsxs(UM,{defaultValue:l.toString(),disabled:u,onValueChange:p=>{c(f(p))},children:[b.jsx(G1,{children:b.jsx(VM,{placeholder:"Select a value"})}),b.jsx(Y1,{children:a.values.map(p=>b.jsx(Z1,{value:p.toString(),children:p.toString()},p))})]}),r&&b.jsx(sl,{loading:u,enabled:e!==l,onClick:()=>{d(!0),r(async p=>[{op:"replace",path:p,value:l}]).finally(()=>{d(!1)})}})]})}function M_({disabled:t,defaultValue:e,registerPatchCallback:n,onSubmit:r}){const[o,i]=h.useState(e||0),[s,a]=h.useState(!1);h.useEffect(()=>{a(t)},[t]);const l=h.useRef(null);return h.useEffect(()=>{n&&n(async c=>{var u;return[{op:"replace",path:c,value:Number((u=l.current)==null?void 0:u.value)||0}]})},[]),b.jsxs(Ws,{children:[b.jsx(W1,{ref:l,disabled:s,defaultValue:o??0,onChange:c=>i(Number(c.target.value)),type:"number"}),r&&b.jsx(sl,{loading:s,enabled:e!==o,onClick:()=>{a(!0),r(async c=>{var u;return[{op:"replace",path:c,value:Number((u=l.current)==null?void 0:u.value)||0}]}).finally(()=>{a(!1)})}})]})}function Fre({disabled:t,defaultValue:e,path:n,schema:r,registerPatchCallback:o,onSubmit:i}){const[s,a]=h.useState(e||""),[l,c]=h.useState(!1);h.useEffect(()=>{c(t)},[t]);const u=h.useRef(null);h.useEffect(()=>{o&&o(async p=>{var m;return[{op:"replace",path:p,value:((m=u.current)==null?void 0:m.value)||""}]})},[]);const f=new pO(r.options?{...r.options,regexp:r.options.regexp?new RegExp(r.options.regexp.source,r.options.regexp.flags):void 0}:void 0).validate(n,s);return b.jsxs(Ws,{children:[b.jsx(W1,{ref:u,disabled:l,defaultValue:s??"",onChange:p=>a(p.target.value)}),i&&b.jsx(sl,{validationErrors:f&&f[n],loading:l,enabled:e!==s&&!f,onClick:()=>{c(!0),i(async p=>{var m;return[{op:"replace",path:p,value:((m=u.current)==null?void 0:m.value)||""}]}).finally(()=>{c(!1)})}})]})}function Bre({errors:t}){return b.jsx("div",{className:"flex flex-col p-2 text-sm rounded-md gap-y-1 text-destructive-foreground bg-destructive",children:t.map((e,n)=>b.jsx("div",{children:e.message},n))})}function Ws({children:t,className:e}){return b.jsx("div",{className:Ln("relative max-w-lg px-4 pt-4",e),children:t})}function sl({loading:t,enabled:e,validationErrors:n,onClick:r}){const{session:o}=x1(),i=o.status==="success"&&o.data.mode==="proxy";return b.jsx("div",{className:"sticky bottom-0 m-4 mt-2 ml-0",children:b.jsxs("div",{className:"flex justify-start w-full gap-2 text-sm",children:[b.jsx(vc,{disabled:t||!e,onClick:r,children:t?i?"Staging...":"Saving...":i?"Stage":"Save"})," ",n?b.jsx(Bre,{errors:n||[]}):b.jsx("span",{})]})})}const Kb=h.forwardRef(({className:t,...e},n)=>b.jsx("div",{ref:n,className:ze("rounded-lg border bg-card text-card-foreground shadow-sm",t),...e}));Kb.displayName="Card";const Ure=h.forwardRef(({className:t,...e},n)=>b.jsx("div",{ref:n,className:ze("flex flex-col space-y-1.5 p-6",t),...e}));Ure.displayName="CardHeader";const Vre=h.forwardRef(({className:t,...e},n)=>b.jsx("h3",{ref:n,className:ze("text-2xl font-semibold leading-none tracking-tight",t),...e}));Vre.displayName="CardTitle";const Hre=h.forwardRef(({className:t,...e},n)=>b.jsx("p",{ref:n,className:ze("text-sm text-muted-foreground",t),...e}));Hre.displayName="CardDescription";const Wre=h.forwardRef(({className:t,...e},n)=>b.jsx("div",{ref:n,className:ze("p-6 pt-0",t),...e}));Wre.displayName="CardContent";const Kre=h.forwardRef(({className:t,...e},n)=>b.jsx("div",{ref:n,className:ze("flex items-center p-6 pt-0",t),...e}));Kre.displayName="CardFooter";const v$=h.forwardRef(({className:t,...e},n)=>b.jsx(S1,{className:ze("peer inline-flex h-[22px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent 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-accent data-[state=unchecked]:bg-primary",t),...e,ref:n,children:b.jsx(_4,{className:ze("pointer-events-none block h-[18px] w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));v$.displayName=S1.displayName;const y$="Dialog",[x$,rie]=Lr(y$),[qre,yo]=x$(y$),Gre=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=t,a=h.useRef(null),l=h.useRef(null),[c=!1,u]=Ao({prop:r,defaultProp:o,onChange:i});return h.createElement(qre,{scope:e,triggerRef:a,contentRef:l,contentId:ao(),titleId:ao(),descriptionId:ao(),open:c,onOpenChange:u,onOpenToggle:h.useCallback(()=>u(d=>!d),[u]),modal:s},n)},Yre="DialogTrigger",Zre=h.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=yo(Yre,n),i=We(e,o.triggerRef);return h.createElement(Re.button,z({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":qb(o.open)},r,{ref:i,onClick:se(t.onClick,o.onOpenToggle)}))}),b$="DialogPortal",[Jre,w$]=x$(b$,{forceMount:void 0}),Xre=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:o}=t,i=yo(b$,e);return h.createElement(Jre,{scope:e,forceMount:n},h.Children.map(r,s=>h.createElement(Wn,{present:n||i.open},h.createElement(sg,{asChild:!0,container:o},s))))},gx="DialogOverlay",Qre=h.forwardRef((t,e)=>{const n=w$(gx,t.__scopeDialog),{forceMount:r=n.forceMount,...o}=t,i=yo(gx,t.__scopeDialog);return i.modal?h.createElement(Wn,{present:r||i.open},h.createElement(eoe,z({},o,{ref:e}))):null}),eoe=h.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=yo(gx,n);return h.createElement(cg,{as:mi,allowPinchZoom:!0,shards:[o.contentRef]},h.createElement(Re.div,z({"data-state":qb(o.open)},r,{ref:e,style:{pointerEvents:"auto",...r.style}})))}),gf="DialogContent",toe=h.forwardRef((t,e)=>{const n=w$(gf,t.__scopeDialog),{forceMount:r=n.forceMount,...o}=t,i=yo(gf,t.__scopeDialog);return h.createElement(Wn,{present:r||i.open},i.modal?h.createElement(noe,z({},o,{ref:e})):h.createElement(roe,z({},o,{ref:e})))}),noe=h.forwardRef((t,e)=>{const n=yo(gf,t.__scopeDialog),r=h.useRef(null),o=We(e,n.contentRef,r);return h.useEffect(()=>{const i=r.current;if(i)return ag(i)},[]),h.createElement(k$,z({},t,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:se(t.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:se(t.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:se(t.onFocusOutside,i=>i.preventDefault())}))}),roe=h.forwardRef((t,e)=>{const n=yo(gf,t.__scopeDialog),r=h.useRef(!1),o=h.useRef(!1);return h.createElement(k$,z({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=t.onCloseAutoFocus)===null||s===void 0||s.call(t,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var s,a;(s=t.onInteractOutside)===null||s===void 0||s.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),k$=h.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=t,a=yo(gf,n),l=h.useRef(null),c=We(e,l);return ng(),h.createElement(h.Fragment,null,h.createElement(rg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},h.createElement(tg,z({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":qb(a.open)},s,{ref:c,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),ooe="DialogTitle",ioe=h.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=yo(ooe,n);return h.createElement(Re.h2,z({id:o.titleId},r,{ref:e}))}),soe="DialogDescription",aoe=h.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=yo(soe,n);return h.createElement(Re.p,z({id:o.descriptionId},r,{ref:e}))}),loe="DialogClose",coe=h.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=yo(loe,n);return h.createElement(Re.button,z({type:"button"},r,{ref:e,onClick:se(t.onClick,()=>o.onOpenChange(!1))}))});function qb(t){return t?"open":"closed"}const uoe=Gre,doe=Zre,foe=Xre,S$=Qre,E$=toe,_$=ioe,C$=aoe,T$=coe,poe=uoe,hoe=doe,moe=foe,R_=T$,O$=h.forwardRef(({className:t,...e},n)=>b.jsx(S$,{ref:n,className:ze("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e}));O$.displayName=S$.displayName;const M$=h.forwardRef(({className:t,children:e,...n},r)=>b.jsxs(moe,{children:[b.jsx(O$,{}),b.jsxs(E$,{ref:r,className:ze("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background 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%] sm:rounded-lg md:w-full",t),...n,children:[e,b.jsxs(T$,{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:[b.jsx(Oh,{className:"w-4 h-4"}),b.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));M$.displayName=E$.displayName;const R$=({className:t,...e})=>b.jsx("div",{className:ze("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});R$.displayName="DialogHeader";const N$=({className:t,...e})=>b.jsx("div",{className:ze("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});N$.displayName="DialogFooter";const P$=h.forwardRef(({className:t,...e},n)=>b.jsx(_$,{ref:n,className:ze("text-lg font-semibold leading-none tracking-tight",t),...e}));P$.displayName=_$.displayName;const goe=h.forwardRef(({className:t,...e},n)=>b.jsx(C$,{ref:n,className:ze("text-sm text-muted-foreground",t),...e}));goe.displayName=C$.displayName;function Gb({path:t,source:e,schema:n,setSelectedPath:r,field:o,initOnSubmit:i,top:s}){if(n.opt)return b.jsx(woe,{path:t,source:e,schema:n,field:o,initOnSubmit:i,setSelectedPath:r});if(e===null)return b.jsx(I$,{source:e,schema:n,path:t,setSelectedPath:r,initOnSubmit:i});if(n.type==="object")return typeof e!="object"||Wl(e)?b.jsxs("div",{children:["ERROR: expected object, but found ",typeof e]}):b.jsx($$,{source:e,path:t,schema:n,initOnSubmit:i,setSelectedPath:r,top:s});if(n.type==="array")return typeof e!="object"||!Wl(e)?b.jsxs("div",{children:["ERROR: expected array, but found ",typeof e]}):b.jsxs("div",{children:[o?b.jsx("div",{className:"text-left",children:o}):b.jsx("div",{className:"truncate max-w-[300px] text-left",title:t,dir:"rtl",children:b.jsx(ka,{children:t})}),b.jsx(A$,{source:e,path:t,schema:n,initOnSubmit:i,setSelectedPath:r})]});if(n.type==="record")return typeof e!="object"?b.jsxs("div",{children:["ERROR: expected object for ",n.type,", but found ",typeof e]}):Wl(e)?b.jsxs("div",{children:["ERROR: did not expect array for ",n.type]}):b.jsxs("div",{children:[o?b.jsx("div",{className:"text-left",children:o}):b.jsx("div",{className:"truncate max-w-[300px] text-left",title:t,dir:"rtl",children:b.jsx(ka,{children:t})}),b.jsx(yoe,{source:e,path:t,schema:n,setSelectedPath:r})]});if((n==null?void 0:n.type)==="union"){if(n.key&&typeof e=="object"&&!Wl(e))return b.jsx(voe,{field:o,tag:n.key,source:e,path:t,schema:n,initOnSubmit:i,setSelectedPath:r,top:s})}else if((n==null?void 0:n.type)==="literal")return b.jsx(b.Fragment,{});return b.jsxs("div",{className:"py-2 gap-y-4",children:[o?b.jsx("div",{className:"text-left",children:o}):b.jsx("div",{className:"truncate max-w-[300px] text-left",title:t,dir:"rtl",children:b.jsx(ka,{children:t})}),b.jsx(m$,{path:t,disabled:!1,source:e,schema:n,onSubmit:i(t)})]})}function voe({tag:t,field:e,path:n,source:r,schema:o,setSelectedPath:i,initOnSubmit:s,top:a}){const[l,c]=h.useState(null),[u,d]=h.useState(null),f=o.items.flatMap(g=>{if(g.type==="object"&&g.items[t]){const y=g.items[t];if(y.type==="literal")return[y.value]}return[]});h.useEffect(()=>{if(l){const g=r[t],y=o.items.find(v=>{if(v.type==="object"&&v.items[t]){const x=v.items[t];return x.type==="literal"?x.value===l:!1}});g&&typeof g=="string"&&y?d({source:r,schema:y}):y?d({schema:y}):(console.error("Could not find source or schema of key",l,r,o),d(null))}else{const g=r==null?void 0:r[t];g&&typeof g=="string"&&c(g)}},[l,r,t,o,f]),f.length!==o.items.length&&console.warn("Not all items have tag:",t);const p=!1,m=s(n);return b.jsxs(Ws,{className:Ln("flex flex-col gap-y-4",{"border-l-2 border-border pl-6":!a}),children:[e?b.jsx("div",{className:"text-left",children:e}):b.jsx("div",{className:"truncate max-w-[300px] text-left",title:n,dir:"rtl",children:b.jsx(ka,{children:n})}),b.jsxs(UM,{value:l??void 0,disabled:p,onValueChange:g=>{c(g)},children:[b.jsx(G1,{children:b.jsx(VM,{placeholder:"Select type"})}),b.jsx(Y1,{children:f.map(g=>b.jsx(Z1,{value:g.toString(),children:g.toString()},g))})]}),b.jsx(sl,{loading:p,enabled:!1,onClick:()=>m(async()=>[])}),u&&b.jsx(Gb,{path:n,source:u.source??null,schema:u.schema,setSelectedPath:i,initOnSubmit:s,top:a})]},n)}function $$({path:t,source:e,schema:n,setSelectedPath:r,initOnSubmit:o,top:i}){return b.jsx("div",{className:Ln("flex flex-col gap-y-1",{"border-l-2 border-border pl-6":!i}),children:Object.entries(n.items).map(([s,a])=>{const l=Rc(t,s);return b.jsx(Gb,{path:l,source:(e==null?void 0:e[s])??null,schema:a,setSelectedPath:r,field:s,initOnSubmit:o},l)})},t)}function yoe({path:t,source:e,schema:n,setSelectedPath:r}){const o=k1();return b.jsx("div",{className:"flex flex-col gap-4 p-2",children:Object.entries(e).map(([i,s])=>{const a=Rc(t,i);return b.jsx("button",{onClick:()=>{r(a),o(a)},children:b.jsx(xoe,{recordKey:i,path:a,source:s,schema:n.item})},a)})},t)}const vx=170;function xoe({recordKey:t,path:e,source:n,schema:r}){const o=oe.useRef(null),[i,s]=h.useState(!1);return h.useEffect(()=>{o.current&&o.current.getBoundingClientRect().height>=vx&&s(!0)},[]),b.jsxs(Kb,{ref:o,className:"relative px-4 pt-2 pb-4 overflow-hidden border gap-y-2",style:{maxHeight:vx},children:[b.jsx("div",{className:"pb-4 font-serif text-left text-accent",children:t}),b.jsx("div",{className:"text-xs",children:b.jsx(Yb,{path:e,source:n,schema:r})}),i&&b.jsx("div",{className:"absolute bottom-0 left-0 w-full h-[20px] bg-gradient-to-b from-transparent to-background"})]},e)}function A$({path:t,source:e,schema:n,setSelectedPath:r,initOnSubmit:o}){const i=o(t),[s,a]=h.useState(),l=s!==e.length,[,c]=yt.splitModuleIdAndModulePath(t);return h.useEffect(()=>{a(e.length)},[n,e]),b.jsxs(Ws,{className:"flex flex-col gap-4 p-2 pb-8",children:[b.jsx("button",{disabled:l,onClick:()=>{a(e.length+1),i(async()=>{const u=[];return e===null&&u.push({op:"replace",path:yt.createPatchJSONPath(c),value:[]}),u.push({op:"add",path:yt.createPatchJSONPath(Rc(c,e.length)),value:Om(n.item)}),u})},children:l?b.jsx(DO,{className:"animate-spin"}):b.jsx(oL,{})}),e.map((u,d)=>{const f=Rc(t,d),p=o(f);return b.jsx(boe,{index:d,path:f,source:u,loading:l,schema:n.item,onDelete:()=>{a(e.length-1),p(async m=>[{op:"remove",path:m}])},setSelectedPath:r},f)})]},t)}const N_=vx;function boe({index:t,path:e,source:n,schema:r,loading:o,setSelectedPath:i,onDelete:s}){const a=k1(),l=oe.useRef(null),[c,u]=h.useState(!1);return h.useEffect(()=>{l.current&&l.current.getBoundingClientRect().height>=N_&&u(!0)},[]),b.jsxs(Kb,{ref:l,className:"relative px-4 pt-2 pb-4 overflow-hidden border gap-y-2",style:{maxHeight:N_},children:[b.jsx("button",{className:"block",disabled:o,onClick:s,children:o?b.jsx(DO,{className:"animate-spin"}):b.jsx(LO,{})}),b.jsxs("button",{className:"block",disabled:o,onClick:()=>{i(e),a(e)},children:[b.jsx("div",{className:"pb-4 font-serif text-left uppercase text-accent",children:t+1<10?`0${t+1}`:t+1}),b.jsx("div",{className:"text-xs",children:b.jsx(Yb,{path:e,source:n,schema:r})}),c&&b.jsx("div",{className:"absolute bottom-0 left-0 w-full h-[20px] bg-gradient-to-b from-transparent to-background"})]})]})}function Rc(t,e){const n=yt.createValPathOfItem(t,e);if(!n)throw Error(`Could not create val path: ${t} of ${e==null?void 0:e.toString()}`);return n}function Yb({path:t,source:e,schema:n}){var s;const[r,o]=h.useState(null),i=(s=_oe())==null?void 0:s.hoverElem;if(n.type==="object")return b.jsx("div",{className:"grid grid-cols-[min-content_1fr] gap-2 text-left",children:Object.entries(n.items).map(([a])=>b.jsxs(h.Fragment,{children:[b.jsxs("span",{className:"text-muted",children:[a,":"]}),b.jsx("span",{children:b.jsx(Yb,{source:(e==null?void 0:e[a])??null,schema:n.items[a],path:Rc(t,a)})})]},Rc(t,a)))},t);if(n.type==="array")return e===null?b.jsx("span",{className:"text-accent",children:"Empty"},t):Array.isArray(e)?b.jsxs("span",{children:[b.jsx("span",{className:"text-accent",children:e.length}),b.jsx("span",{children:e.length===1?" item":" items"})]},t):b.jsx("span",{className:"px-2 bg-destructive text-destructive-foreground",children:"Unknown length"},t);if(n.type==="richtext")return e===null?b.jsx("span",{className:"text-accent",children:"Empty"},t):typeof e!="object"?b.jsxs("div",{className:"p-4 text-destructive-foreground bg-destructive",children:["ERROR: ",typeof e," not an object"]},t):!(sn in e)||e[sn]!=="richtext"?b.jsx("div",{className:"p-4 text-destructive-foreground bg-destructive",children:"ERROR: object is not richtext"},t):b.jsx(Eoe,{children:gM(e)},t);if(n.type==="string")return e===null?b.jsx("span",{className:"text-accent",children:"Empty"},t):b.jsx("span",{children:e});if(n.type==="image"){if(e===null)return b.jsx("span",{className:"text-accent",children:"Empty"},t);if(typeof e!="object")return b.jsx("div",{className:"p-4 text-destructive-foreground bg-destructive",children:"ERROR: not an object"},t);if(!(gn in e)||typeof e[gn]!="string")return b.jsx("div",{className:"p-4 text-destructive-foreground bg-destructive",children:"ERROR: object is not an image"},t);const a=yt.convertFileSource(e).url;return b.jsxs("span",{onMouseOver:l=>{o({x:l.clientX,y:l.clientY})},onMouseLeave:()=>{o(null)},className:"relative flex items-center justify-start gap-1",children:[b.jsx("a",{href:a,className:"overflow-hidden underline truncate ",children:e[gn]}),r&&i&&Vo.createPortal(b.jsx("img",{className:"absolute z-[5] max-w-[10vw]",style:{left:r.x+10,top:r.y+10},src:a}),i)]},t)}else{if(n.type==="boolean")return e===null?b.jsx("span",{className:"text-accent",children:"Empty"},t):b.jsx("span",{className:"text-accent",children:e?"true":"false"},t);if(n.type==="number")return e===null?b.jsx("span",{className:"text-accent",children:"Empty"},t):b.jsx("span",{className:"text-accent",children:e.toString()});if(n.type==="keyOf")return e===null?b.jsx("span",{className:"text-accent",children:"Empty"},t):b.jsx("span",{className:"text-accent",children:e.toString()},t)}return b.jsxs("div",{children:["TODO: ",n.type]},t)}function woe({path:t,source:e,schema:n,setSelectedPath:r,initOnSubmit:o,field:i}){const[s,a]=h.useState(e!==null),{editMode:l}=x1(),c=o(t),[u,d]=h.useState(!1);return b.jsxs("div",{className:"flex flex-col gap-y-2",children:[b.jsxs("div",{className:"relative flex items-center justify-start gap-x-4",children:[l==="full"&&!s&&b.jsx(v$,{disabled:u,checked:s,onClick:()=>{a(f=>!f)}}),l==="full"&&s&&b.jsxs(poe,{children:[b.jsx(hoe,{children:b.jsx(LO,{})}),b.jsx(M$,{children:b.jsxs(R$,{children:[b.jsx(P$,{children:"About to delete. Are you sure?"}),b.jsxs(N$,{className:"sm:justify-start",children:[b.jsx(R_,{asChild:!0,children:b.jsx(vc,{type:"button",variant:"secondary",onClick:async()=>{d(!0),a(!1);const[,f]=yt.splitModuleIdAndModulePath(t);c(async()=>[{op:"replace",path:yt.createPatchJSONPath(f),value:null}]).catch(p=>{console.error(p),a(!0)}).finally(()=>{d(!1)})},children:"Yes"})}),b.jsx(R_,{asChild:!0,children:b.jsx(vc,{type:"button",children:"Cancel"})})]})]})})]}),b.jsx("div",{className:"truncate max-w-[300px] text-left",title:t,dir:"rtl",children:i||b.jsx(ka,{children:t})})]}),s&&b.jsx(I$,{source:e===null?Om(n):e,schema:n,path:t,setSelectedPath:r,initOnSubmit:f=>async p=>{const[,m]=yt.splitModuleIdAndModulePath(t),[,g]=yt.splitModuleIdAndModulePath(f),y=await p(yt.createPatchJSONPath(g));c(async()=>e===null?[{op:"replace",path:yt.createPatchJSONPath(m),value:Om(n)}].concat(y):y)}})]},t)}function Om(t){if(t.type==="object")return Object.fromEntries(Object.keys(t.items).map(n=>[n,Om(t.items[n])]));if(t.type==="array")return[];if(t.type==="record")return{};if(t.type==="richtext")return{[sn]:"richtext",templateStrings:[""],exprs:[]};if(t.type==="string")return null;if(t.type==="boolean")return null;if(t.type==="number")return null;if(t.type==="keyOf")return null;if(t.type==="file")return null;if(t.type==="image")return null;if(t.type==="literal")return null;if(t.type==="union")return null;throw Error("Unexpected schema type: "+JSON.stringify(t))}function I$({source:t,path:e,schema:n,setSelectedPath:r,initOnSubmit:o}){if(n.type==="array"){if(typeof t=="object"&&(t===null||Wl(t)))return b.jsx(A$,{initOnSubmit:o,source:t===null?[]:t,path:e,schema:n,setSelectedPath:r})}else if(n.type==="object"){if(typeof t=="object"&&(t===null||!Wl(t)))return b.jsx($$,{source:t,path:e,schema:n,setSelectedPath:r,initOnSubmit:o})}else if(n.type==="richtext"||n.type==="string"||n.type==="image"||n.type==="number"||n.type==="keyOf")return b.jsx(m$,{path:e,disabled:!1,source:t,schema:n,onSubmit:o(e)},e);return b.jsxs("div",{className:"p-4 bg-destructive text-destructive-foreground",children:["ERROR: unexpected source type ",typeof t," for schema type"," ",n.type]})}function Wl(t){return Array.isArray(t)}function koe(t){const e={};return t.forEach(n=>{const r=n.split("/").filter(o=>o!=="");if(r.length===1)e[""]||(e[""]=[]),e[""].push(r[0]);else if(r.length>1){const o=r.slice(0,r.length-1).join("/"),i=r.slice(-1)[0];e[o]||(e[o]=[]),e[o].push(i)}}),e}function Soe({selectedPath:t,paths:e,setSelectedModuleId:n}){const r=koe(e),o=t&&yt.splitModuleIdAndModulePath(t)[0];return b.jsx("div",{className:"flex flex-col w-full py-2 text-xs",children:Object.entries(r).map(([i,s])=>b.jsxs("div",{className:"px-4 py-2",children:[i&&b.jsx("div",{className:"font-bold truncate max-w-[300px] text-left",title:i,children:b.jsx(ka,{children:i})}),b.jsx("div",{className:Ln({"flex flex-col py-2 justify-start items-start":!!i}),children:s.map(a=>{const l=`/${i}/${a}`;return b.jsx("button",{className:Ln("block px-2 py-1 rounded-full",{"bg-accent text-accent-foreground":o===l}),onClick:()=>{n(l)},children:a},l)})})]},`/${i}`))})}const P_={tags:{h1:"font-bold",h2:"font-bold",h3:"font-bold",h4:"font-bold",h5:"font-bold",h6:"font-bold",p:""},classes:{bold:"font-bold",italic:"italic",lineThrough:"line-through"}};function Eoe({children:t}){const e=t;function n(i,s){const a=P_.tags[i];return a&&s?[s,a].join(" "):a||s}function r(i,s){const a=P_.classes[i];return a&&s?[s,a].join(" "):a||s}function o(i,s){var c,u;if(typeof i=="string")return i;if(i.tag==="p")return b.jsx("p",{className:n("p"),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="img")return b.jsx("img",{className:n("img"),src:i.src},s);if(i.tag==="ul")return b.jsx("ul",{className:n("ul"),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="ol")return b.jsx("ol",{className:n("ol"),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="li")return b.jsx("li",{className:n("li"),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="span")return b.jsx("span",{className:i.classes.map(d=>{switch(d){case"bold":return r("bold");case"line-through":return r("lineThrough");case"italic":return r("italic")}}).join(" "),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="h1")return b.jsx("h1",{className:n("h1"),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="h2")return b.jsx("h2",{className:n("h2"),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="h3")return b.jsx("h3",{className:n("h3"),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="h4")return b.jsx("h4",{className:n("h4"),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="h5")return b.jsx("h5",{className:n("h5"),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="h6")return b.jsx("h6",{className:n("h6"),children:i.children.map((d,f)=>o(d,f))},s);if(i.tag==="br")return b.jsx("br",{},s);if(i.tag==="a")return b.jsx("a",{href:i.href,children:i.children.map((d,f)=>o(d,f))},s);console.error("Unknown tag",i.tag);const l=i.tag;return l!=null&&l.tag?oe.createElement(l.tag,{key:s,className:(c=l.class)==null?void 0:c.join(" "),children:(u=l.children)==null?void 0:u.map(o)}):null}return b.jsx("span",{"data-val-path":e.valPath,children:e.children.map((i,s)=>o(i,s))})}const D$=oe.createContext({hoverElem:null}),_oe=()=>oe.useContext(D$),L$=oe.createContext(null),Coe=t=>{var a,l;const e=oe.useContext(L$),[n,r]=yt.splitModuleIdAndModulePath(t),o=(a=e==null?void 0:e[n])==null?void 0:a.source,i=(l=e==null?void 0:e[n])==null?void 0:l.schema;if(!o||!i)throw Error("Could not find module: "+n);const s=yt.resolvePath(r,o,i);return{moduleId:n,moduleSource:s.source,moduleSchema:s.schema}},Toe=({api:t})=>{var A,B;const{"*":e}=n4(),[n,r]=h.useState(null),[o,i]=h.useState(null),[s,a]=h.useState(),[l]=s?yt.splitModuleIdAndModulePath(s):[void 0,void 0],c=l&&((A=n==null?void 0:n[l])==null?void 0:A.source),u=l&&((B=n==null?void 0:n[l])==null?void 0:B.schema),d=Object.entries(n||{}).flatMap(([D,Z])=>Z.errors?Z.errors.fatal?Z.errors.fatal.map(U=>({id:D,...U})):[]:[]),f=Object.entries(n||{}).flatMap(([,D])=>D.errors&&D.errors.validation?[D.errors.validation]:[]);if(d&&d.length>0){const D=d.length===1?d[0].message:`Multiple errors detected:
229
- ${d.map((U,G)=>`${G+1}. [${U.id}]: ${U.message}`).join(`
230
- `)}
231
-
232
- Showing stack trace of: 1. ${d[0].message}`,Z=new Error(D);throw Z.stack=d[0].stack,Z}f&&f.length>0&&console.warn("Val encountered validation errors:",f),h.useEffect(()=>{a(e?`/${e}`:s)},[e]);const[p,m]=h.useState(null);h.useEffect(()=>{try{new WebSocket(`${window.location.origin.replace("http://","ws://")}/_next/webpack-hmr`).addEventListener("message",Z=>{let U;try{U=JSON.parse(Z.data)}catch{console.error("Failed to parse HMR")}typeof(U==null?void 0:U.hash)=="string"&&(U==null?void 0:U.action)==="built"&&m(U.hash)})}catch(D){console.warn("Failed to initialize HMR",D)}},[]),h.useEffect(()=>{console.log("(Re)-fetching modules"),t.getTree({patch:!0,includeSchema:!0,includeSource:!0}).then(D=>{xa.isOk(D)?r(D.value.modules):(i("Could not load modules: "+D.error.message),console.error(D.error))})},[p]);const g=I7(t),y=k1(),[v,x]=v4(),{patches:w,setPatchResetId:S}=Ij(g,t),_=oe.useRef(null),k=h.useCallback(D=>async Z=>{const[U,G]=yt.splitModuleIdAndModulePath(D),R=await Z(yt.createPatchJSONPath(G));return t.postPatches(U,R).then(N=>{if(xa.isErr(N))throw N.error;if(!p)return S(O=>O+1),t.getTree({treePath:U,patch:!0,includeSchema:!0,includeSource:!0}).then(O=>{xa.isOk(O)?r(P=>({...P,...O.value.modules})):(i("Could not load modules: "+O.error.message),console.error(O.error))})}).catch(N=>{console.error(N)})},[]),[E,C]=h.useState(!1),T=Object.entries(n||{}).flatMap(([D,Z])=>Z!=null&&Z.schema&&(Z!=null&&Z.source)?[D]:Z!=null&&Z.errors?[D]:[]);return b.jsx(zO.Provider,{value:{theme:v,setTheme:x,editMode:"full",session:g,setEditMode:()=>{},setWindowSize:()=>{}},children:b.jsxs("div",{id:"val-fullscreen-container",className:"relative w-full h-[100] overflow-hidden font-serif antialiased bg-background text-primary","data-mode":v,children:[E&&b.jsx("div",{className:"fixed z-5 top-[16px] left-[16px] w-[calc(100%-32px-50px-16px)] h-[calc(100svh-32px)]",children:b.jsx(f8,{patches:w,api:t,onCancel:()=>{C(!1)},onCommit:()=>{S(D=>D+1)}})}),b.jsxs(Nj,{children:[b.jsx(z2,{}),b.jsx("div",{className:"fixed -translate-y-1/2 right-4 top-1/2 z-overlay",children:b.jsx(Aj,{direction:"vertical",api:t,patches:w,onClickPatches:()=>C(D=>!D)})})]}),b.jsx("div",{id:"val-fullscreen-hover",ref:_}),b.jsx(D$.Provider,{value:{hoverElem:_==null?void 0:_.current},children:b.jsx("div",{className:"text-primary",children:b.jsxs(td,{children:[b.jsx("div",{className:"px-4 h-[50px] flex items-center justify-center",children:b.jsx(jO,{})}),b.jsx(ed,{className:"px-4",children:n?b.jsx(Soe,{selectedPath:s,paths:T,setSelectedModuleId:D=>{y(D)}}):!o&&b.jsx("div",{className:"py-4",children:"Loading..."})}),b.jsxs("div",{className:"flex items-center justify-start h-[50px] gap-2 font-serif text-xs",children:[b.jsx("button",{onClick:()=>{history.back()},children:b.jsx(F5,{})}),b.jsx("div",{className:"truncate max-w-[300px] text-left",dir:"rtl",title:s,children:b.jsx(ka,{children:s||"/"})})]}),b.jsxs("div",{className:"p-4",children:[o&&b.jsxs("div",{className:"max-w-xl p-4 text-lg bg-destructive text-destructive-foreground",children:["ERROR: ",o]}),g.status==="success"&&g.data.mode==="unauthorized"&&b.jsx("div",{className:"max-w-xl p-4 text-lg bg-destructive text-destructive-foreground",children:"Not authorized"}),g.status==="success"&&g.data.mode!=="unauthorized"&&n&&s&&l&&c!==void 0&&u!==void 0&&b.jsx(L$.Provider,{value:n,children:b.jsx(Ooe,{path:s,source:c,schema:u,setSelectedPath:a,initOnSubmit:k})})]})]})})})]})})};function Ooe({path:t,source:e,schema:n,setSelectedPath:r,initOnSubmit:o}){const[,i]=yt.splitModuleIdAndModulePath(t),s=yt.resolvePath(i,e,n);if(!s)throw Error("Could not resolve module: "+t);return b.jsx(Gb,{path:t,source:s.source,schema:s.schema,setSelectedPath:r,initOnSubmit:o,top:!0})}const Moe=h.createContext(null),iy={didCatch:!1,error:null};class Roe extends h.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=iy}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(e!==null){for(var n,r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:i,reason:"imperative-api"}),this.setState(iy)}}componentDidCatch(e,n){var r,o;(r=(o=this.props).onError)===null||r===void 0||r.call(o,e,n)}componentDidUpdate(e,n){const{didCatch:r}=this.state,{resetKeys:o}=this.props;if(r&&n.error!==null&&Noe(e.resetKeys,o)){var i,s;(i=(s=this.props).onReset)===null||i===void 0||i.call(s,{next:o,prev:e.resetKeys,reason:"keys"}),this.setState(iy)}}render(){const{children:e,fallbackRender:n,FallbackComponent:r,fallback:o}=this.props,{didCatch:i,error:s}=this.state;let a=e;if(i){const l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")a=n(l);else if(r)a=h.createElement(r,l);else if(o===null||h.isValidElement(o))a=o;else throw s}return h.createElement(Moe.Provider,{value:{didCatch:i,error:s,resetErrorBoundary:this.resetErrorBoundary}},a)}}function Noe(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return t.length!==e.length||t.some((n,r)=>!Object.is(n,e[r]))}/**
233
- * React Router DOM v6.21.2
234
- *
235
- * Copyright (c) Remix Software Inc.
236
- *
237
- * This source code is licensed under the MIT license found in the
238
- * LICENSE.md file in the root directory of this source tree.
239
- *
240
- * @license MIT
241
- */function Mm(){return Mm=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Mm.apply(this,arguments)}function Poe(t,e){return UL({basename:e==null?void 0:e.basename,future:Mm({},e==null?void 0:e.future,{v7_prependBasename:!0}),history:uL({window:e==null?void 0:e.window}),hydrationData:(e==null?void 0:e.hydrationData)||$oe(),routes:t,mapRouteProperties:g4,window:e==null?void 0:e.window}).initialize()}function $oe(){var t;let e=(t=window)==null?void 0:t.__staticRouterHydrationData;return e&&e.errors&&(e=Mm({},e,{errors:Aoe(e.errors)})),e}function Aoe(t){if(!t)return null;let e=Object.entries(t),n={};for(let[r,o]of e)if(o&&o.__type==="RouteErrorResponse")n[r]=new b1(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let i=window[o.__subType];if(typeof i=="function")try{let s=new i(o.message);s.stack="",n[r]=s}catch{}}if(n[r]==null){let i=new Error(o.message);i.stack="",n[r]=i}}else n[r]=o;return n}const Ioe=h.createContext({isTransitioning:!1}),Doe=h.createContext(new Map),Loe="startTransition",$_=K_[Loe],joe="flushSync",A_=fD[joe];function zoe(t){$_?$_(t):t()}function gu(t){A_?A_(t):t()}class Foe{constructor(){this.status="pending",this.promise=new Promise((e,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function Boe(t){let{fallbackElement:e,router:n,future:r}=t,[o,i]=h.useState(n.state),[s,a]=h.useState(),[l,c]=h.useState({isTransitioning:!1}),[u,d]=h.useState(),[f,p]=h.useState(),[m,g]=h.useState(),y=h.useRef(new Map),{v7_startTransition:v}=r||{},x=h.useCallback(E=>{v?zoe(E):E()},[v]),w=h.useCallback((E,C)=>{let{deletedFetchers:T,unstable_flushSync:A,unstable_viewTransitionOpts:B}=C;T.forEach(Z=>y.current.delete(Z)),E.fetchers.forEach((Z,U)=>{Z.data!==void 0&&y.current.set(U,Z.data)});let D=n.window==null||typeof n.window.document.startViewTransition!="function";if(!B||D){A?gu(()=>i(E)):x(()=>i(E));return}if(A){gu(()=>{f&&(u&&u.resolve(),f.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:B.currentLocation,nextLocation:B.nextLocation})});let Z=n.window.document.startViewTransition(()=>{gu(()=>i(E))});Z.finished.finally(()=>{gu(()=>{d(void 0),p(void 0),a(void 0),c({isTransitioning:!1})})}),gu(()=>p(Z));return}f?(u&&u.resolve(),f.skipTransition(),g({state:E,currentLocation:B.currentLocation,nextLocation:B.nextLocation})):(a(E),c({isTransitioning:!0,flushSync:!1,currentLocation:B.currentLocation,nextLocation:B.nextLocation}))},[n.window,f,u,y,x]);h.useLayoutEffect(()=>n.subscribe(w),[n,w]),h.useEffect(()=>{l.isTransitioning&&!l.flushSync&&d(new Foe)},[l]),h.useEffect(()=>{if(u&&s&&n.window){let E=s,C=u.promise,T=n.window.document.startViewTransition(async()=>{x(()=>i(E)),await C});T.finished.finally(()=>{d(void 0),p(void 0),a(void 0),c({isTransitioning:!1})}),p(T)}},[x,s,u,n.window]),h.useEffect(()=>{u&&s&&o.location.key===s.location.key&&u.resolve()},[u,f,o.location,s]),h.useEffect(()=>{!l.isTransitioning&&m&&(a(m.state),c({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),g(void 0))},[l.isTransitioning,m]),h.useEffect(()=>{},[]);let S=h.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:E=>n.navigate(E),push:(E,C,T)=>n.navigate(E,{state:C,preventScrollReset:T==null?void 0:T.preventScrollReset}),replace:(E,C,T)=>n.navigate(E,{replace:!0,state:C,preventScrollReset:T==null?void 0:T.preventScrollReset})}),[n]),_=n.basename||"/",k=h.useMemo(()=>({router:n,navigator:S,static:!1,basename:_}),[n,S,_]);return h.createElement(h.Fragment,null,h.createElement(Jm.Provider,{value:k},h.createElement(XO.Provider,{value:o},h.createElement(Doe.Provider,{value:y.current},h.createElement(Ioe.Provider,{value:l},h.createElement(m4,{basename:_,location:o.location,navigationType:o.historyAction,navigator:S,future:{v7_relativeSplatPath:n.future.v7_relativeSplatPath}},o.initialized||n.future.v7_partialHydration?h.createElement(Uoe,{routes:n.routes,future:n.future,state:o}):e))))),null)}function Uoe(t){let{routes:e,future:n,state:r}=t;return r4(e,void 0,r,n)}var I_;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(I_||(I_={}));var D_;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(D_||(D_={}));function Voe({error:t,resetErrorBoundary:e}){return console.error(t),b.jsx("div",{className:"absolute top-0 left-0 flex items-center justify-center w-screen h-screen bg-card-foreground",children:b.jsx("div",{className:"w-full h-full p-10",children:b.jsxs("div",{className:"w-full h-full p-10 bg-card text-primary",children:[b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsxs("div",{className:"flex items-center gap-[0.5em] text-lg font-bold text-center py-2",children:[b.jsx(jO,{})," encountered an error"]}),b.jsx("button",{onClick:e,children:b.jsx(Oh,{})})]}),b.jsx("div",{className:"text-4xl font-normal ",children:"Message:"}),b.jsx("pre",{children:t.message}),t.stack&&b.jsx(S0,{type:"single",className:"font-serif",collapsible:!0,defaultValue:"error",children:b.jsxs(sM,{value:"error",children:[b.jsx(aM,{children:"Stack trace:"}),b.jsx(Vh,{className:"p-4 bg-popover text-popover-foreground",children:t.stack&&b.jsx("pre",{children:t.stack})})]})})]})})})}function Hoe(){const t=Poe([{path:"/*",element:b.jsx(Roe,{fallbackRender:Voe,children:b.jsx(Toe,{api:new M3("/api/val")})})}],{basename:"/val"});return b.jsx(Boe,{router:t})}sy.createRoot(document.getElementById("val-app")).render(oe.createElement(oe.StrictMode,null,oe.createElement(Hoe,null)));