@kdrgny/justjson 1.2.0 → 1.4.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,612 +0,0 @@
1
- var Qk=t=>{throw TypeError(t)};var e2=(t,e,n)=>e.has(t)||Qk("Cannot "+n);var En=(t,e,n)=>(e2(t,e,"read from private field"),n?n.call(t):e.get(t)),t2=(t,e,n)=>e.has(t)?Qk("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),R0=(t,e,n,r)=>(e2(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);function PN(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 s=Object.getOwnPropertyDescriptor(r,o);s&&Object.defineProperty(t,o,s.get?s:{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 s of o)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();function xy(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var O0={exports:{}},au={},I0={exports:{}},qe={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var n2;function jN(){if(n2)return qe;n2=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),i=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.iterator;function m(j){return j===null||typeof j!="object"?null:(j=p&&j[p]||j["@@iterator"],typeof j=="function"?j:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,b={};function k(j,B,ne){this.props=j,this.context=B,this.refs=b,this.updater=ne||y}k.prototype.isReactComponent={},k.prototype.setState=function(j,B){if(typeof j!="object"&&typeof j!="function"&&j!=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,j,B,"setState")},k.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function E(){}E.prototype=k.prototype;function _(j,B,ne){this.props=j,this.context=B,this.refs=b,this.updater=ne||y}var T=_.prototype=new E;T.constructor=_,v(T,k.prototype),T.isPureReactComponent=!0;var A=Array.isArray,N=Object.prototype.hasOwnProperty,D={current:null},I={key:!0,ref:!0,__self:!0,__source:!0};function P(j,B,ne){var fe,ue={},he=null,Ae=null;if(B!=null)for(fe in B.ref!==void 0&&(Ae=B.ref),B.key!==void 0&&(he=""+B.key),B)N.call(B,fe)&&!I.hasOwnProperty(fe)&&(ue[fe]=B[fe]);var X=arguments.length-2;if(X===1)ue.children=ne;else if(1<X){for(var ce=Array(X),pe=0;pe<X;pe++)ce[pe]=arguments[pe+2];ue.children=ce}if(j&&j.defaultProps)for(fe in X=j.defaultProps,X)ue[fe]===void 0&&(ue[fe]=X[fe]);return{$$typeof:t,type:j,key:he,ref:Ae,props:ue,_owner:D.current}}function O(j,B){return{$$typeof:t,type:j.type,key:B,ref:j.ref,props:j.props,_owner:j._owner}}function U(j){return typeof j=="object"&&j!==null&&j.$$typeof===t}function J(j){var B={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(ne){return B[ne]})}var K=/\/+/g;function q(j,B){return typeof j=="object"&&j!==null&&j.key!=null?J(""+j.key):B.toString(36)}function Z(j,B,ne,fe,ue){var he=typeof j;(he==="undefined"||he==="boolean")&&(j=null);var Ae=!1;if(j===null)Ae=!0;else switch(he){case"string":case"number":Ae=!0;break;case"object":switch(j.$$typeof){case t:case e:Ae=!0}}if(Ae)return Ae=j,ue=ue(Ae),j=fe===""?"."+q(Ae,0):fe,A(ue)?(ne="",j!=null&&(ne=j.replace(K,"$&/")+"/"),Z(ue,B,ne,"",function(pe){return pe})):ue!=null&&(U(ue)&&(ue=O(ue,ne+(!ue.key||Ae&&Ae.key===ue.key?"":(""+ue.key).replace(K,"$&/")+"/")+j)),B.push(ue)),1;if(Ae=0,fe=fe===""?".":fe+":",A(j))for(var X=0;X<j.length;X++){he=j[X];var ce=fe+q(he,X);Ae+=Z(he,B,ne,ce,ue)}else if(ce=m(j),typeof ce=="function")for(j=ce.call(j),X=0;!(he=j.next()).done;)he=he.value,ce=fe+q(he,X++),Ae+=Z(he,B,ne,ce,ue);else if(he==="object")throw B=String(j),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.");return Ae}function Q(j,B,ne){if(j==null)return j;var fe=[],ue=0;return Z(j,fe,"","",function(he){return B.call(ne,he,ue++)}),fe}function G(j){if(j._status===-1){var B=j._result;B=B(),B.then(function(ne){(j._status===0||j._status===-1)&&(j._status=1,j._result=ne)},function(ne){(j._status===0||j._status===-1)&&(j._status=2,j._result=ne)}),j._status===-1&&(j._status=0,j._result=B)}if(j._status===1)return j._result.default;throw j._result}var Y={current:null},W={transition:null},ee={ReactCurrentDispatcher:Y,ReactCurrentBatchConfig:W,ReactCurrentOwner:D};function z(){throw Error("act(...) is not supported in production builds of React.")}return qe.Children={map:Q,forEach:function(j,B,ne){Q(j,function(){B.apply(this,arguments)},ne)},count:function(j){var B=0;return Q(j,function(){B++}),B},toArray:function(j){return Q(j,function(B){return B})||[]},only:function(j){if(!U(j))throw Error("React.Children.only expected to receive a single React element child.");return j}},qe.Component=k,qe.Fragment=n,qe.Profiler=o,qe.PureComponent=_,qe.StrictMode=r,qe.Suspense=u,qe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ee,qe.act=z,qe.cloneElement=function(j,B,ne){if(j==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+j+".");var fe=v({},j.props),ue=j.key,he=j.ref,Ae=j._owner;if(B!=null){if(B.ref!==void 0&&(he=B.ref,Ae=D.current),B.key!==void 0&&(ue=""+B.key),j.type&&j.type.defaultProps)var X=j.type.defaultProps;for(ce in B)N.call(B,ce)&&!I.hasOwnProperty(ce)&&(fe[ce]=B[ce]===void 0&&X!==void 0?X[ce]:B[ce])}var ce=arguments.length-2;if(ce===1)fe.children=ne;else if(1<ce){X=Array(ce);for(var pe=0;pe<ce;pe++)X[pe]=arguments[pe+2];fe.children=X}return{$$typeof:t,type:j.type,key:ue,ref:he,props:fe,_owner:Ae}},qe.createContext=function(j){return j={$$typeof:i,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},j.Provider={$$typeof:s,_context:j},j.Consumer=j},qe.createElement=P,qe.createFactory=function(j){var B=P.bind(null,j);return B.type=j,B},qe.createRef=function(){return{current:null}},qe.forwardRef=function(j){return{$$typeof:l,render:j}},qe.isValidElement=U,qe.lazy=function(j){return{$$typeof:f,_payload:{_status:-1,_result:j},_init:G}},qe.memo=function(j,B){return{$$typeof:d,type:j,compare:B===void 0?null:B}},qe.startTransition=function(j){var B=W.transition;W.transition={};try{j()}finally{W.transition=B}},qe.unstable_act=z,qe.useCallback=function(j,B){return Y.current.useCallback(j,B)},qe.useContext=function(j){return Y.current.useContext(j)},qe.useDebugValue=function(){},qe.useDeferredValue=function(j){return Y.current.useDeferredValue(j)},qe.useEffect=function(j,B){return Y.current.useEffect(j,B)},qe.useId=function(){return Y.current.useId()},qe.useImperativeHandle=function(j,B,ne){return Y.current.useImperativeHandle(j,B,ne)},qe.useInsertionEffect=function(j,B){return Y.current.useInsertionEffect(j,B)},qe.useLayoutEffect=function(j,B){return Y.current.useLayoutEffect(j,B)},qe.useMemo=function(j,B){return Y.current.useMemo(j,B)},qe.useReducer=function(j,B,ne){return Y.current.useReducer(j,B,ne)},qe.useRef=function(j){return Y.current.useRef(j)},qe.useState=function(j){return Y.current.useState(j)},qe.useSyncExternalStore=function(j,B,ne){return Y.current.useSyncExternalStore(j,B,ne)},qe.useTransition=function(){return Y.current.useTransition()},qe.version="18.3.1",qe}var r2;function gc(){return r2||(r2=1,I0.exports=jN()),I0.exports}/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var o2;function LN(){if(o2)return au;o2=1;var t=gc(),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,s={key:!0,ref:!0,__self:!0,__source:!0};function i(l,u,d){var f,p={},m=null,y=null;d!==void 0&&(m=""+d),u.key!==void 0&&(m=""+u.key),u.ref!==void 0&&(y=u.ref);for(f in u)r.call(u,f)&&!s.hasOwnProperty(f)&&(p[f]=u[f]);if(l&&l.defaultProps)for(f in u=l.defaultProps,u)p[f]===void 0&&(p[f]=u[f]);return{$$typeof:e,type:l,key:m,ref:y,props:p,_owner:o.current}}return au.Fragment=n,au.jsx=i,au.jsxs=i,au}var s2;function zN(){return s2||(s2=1,O0.exports=LN()),O0.exports}var x=zN(),C=gc();const te=xy(C),gl=PN({__proto__:null,default:te},[C]);var Kd={},P0={exports:{}},Gn={},j0={exports:{}},L0={};/**
18
- * @license React
19
- * scheduler.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var i2;function FN(){return i2||(i2=1,(function(t){function e(W,ee){var z=W.length;W.push(ee);e:for(;0<z;){var j=z-1>>>1,B=W[j];if(0<o(B,ee))W[j]=ee,W[z]=B,z=j;else break e}}function n(W){return W.length===0?null:W[0]}function r(W){if(W.length===0)return null;var ee=W[0],z=W.pop();if(z!==ee){W[0]=z;e:for(var j=0,B=W.length,ne=B>>>1;j<ne;){var fe=2*(j+1)-1,ue=W[fe],he=fe+1,Ae=W[he];if(0>o(ue,z))he<B&&0>o(Ae,ue)?(W[j]=Ae,W[he]=z,j=he):(W[j]=ue,W[fe]=z,j=fe);else if(he<B&&0>o(Ae,z))W[j]=Ae,W[he]=z,j=he;else break e}}return ee}function o(W,ee){var z=W.sortIndex-ee.sortIndex;return z!==0?z:W.id-ee.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var i=Date,l=i.now();t.unstable_now=function(){return i.now()-l}}var u=[],d=[],f=1,p=null,m=3,y=!1,v=!1,b=!1,k=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(W){for(var ee=n(d);ee!==null;){if(ee.callback===null)r(d);else if(ee.startTime<=W)r(d),ee.sortIndex=ee.expirationTime,e(u,ee);else break;ee=n(d)}}function A(W){if(b=!1,T(W),!v)if(n(u)!==null)v=!0,G(N);else{var ee=n(d);ee!==null&&Y(A,ee.startTime-W)}}function N(W,ee){v=!1,b&&(b=!1,E(P),P=-1),y=!0;var z=m;try{for(T(ee),p=n(u);p!==null&&(!(p.expirationTime>ee)||W&&!J());){var j=p.callback;if(typeof j=="function"){p.callback=null,m=p.priorityLevel;var B=j(p.expirationTime<=ee);ee=t.unstable_now(),typeof B=="function"?p.callback=B:p===n(u)&&r(u),T(ee)}else r(u);p=n(u)}if(p!==null)var ne=!0;else{var fe=n(d);fe!==null&&Y(A,fe.startTime-ee),ne=!1}return ne}finally{p=null,m=z,y=!1}}var D=!1,I=null,P=-1,O=5,U=-1;function J(){return!(t.unstable_now()-U<O)}function K(){if(I!==null){var W=t.unstable_now();U=W;var ee=!0;try{ee=I(!0,W)}finally{ee?q():(D=!1,I=null)}}else D=!1}var q;if(typeof _=="function")q=function(){_(K)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,Q=Z.port2;Z.port1.onmessage=K,q=function(){Q.postMessage(null)}}else q=function(){k(K,0)};function G(W){I=W,D||(D=!0,q())}function Y(W,ee){P=k(function(){W(t.unstable_now())},ee)}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(W){W.callback=null},t.unstable_continueExecution=function(){v||y||(v=!0,G(N))},t.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<W?Math.floor(1e3/W):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_getFirstCallbackNode=function(){return n(u)},t.unstable_next=function(W){switch(m){case 1:case 2:case 3:var ee=3;break;default:ee=m}var z=m;m=ee;try{return W()}finally{m=z}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(W,ee){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var z=m;m=W;try{return ee()}finally{m=z}},t.unstable_scheduleCallback=function(W,ee,z){var j=t.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?j+z:j):z=j,W){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=z+B,W={id:f++,callback:ee,priorityLevel:W,startTime:z,expirationTime:B,sortIndex:-1},z>j?(W.sortIndex=z,e(d,W),n(u)===null&&W===n(d)&&(b?(E(P),P=-1):b=!0,Y(A,z-j))):(W.sortIndex=B,e(u,W),v||y||(v=!0,G(N))),W},t.unstable_shouldYield=J,t.unstable_wrapCallback=function(W){var ee=m;return function(){var z=m;m=ee;try{return W.apply(this,arguments)}finally{m=z}}}})(L0)),L0}var a2;function $N(){return a2||(a2=1,j0.exports=FN()),j0.exports}/**
26
- * @license React
27
- * react-dom.production.min.js
28
- *
29
- * Copyright (c) Facebook, Inc. and its affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var l2;function BN(){if(l2)return Gn;l2=1;var t=gc(),e=$N();function n(a){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+a,h=1;h<arguments.length;h++)c+="&args[]="+encodeURIComponent(arguments[h]);return"Minified React error #"+a+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,o={};function s(a,c){i(a,c),i(a+"Capture",c)}function i(a,c){for(o[a]=c,a=0;a<c.length;a++)r.add(c[a])}var l=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,f={},p={};function m(a){return u.call(p,a)?!0:u.call(f,a)?!1:d.test(a)?p[a]=!0:(f[a]=!0,!1)}function y(a,c,h,g){if(h!==null&&h.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return g?!1:h!==null?!h.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function v(a,c,h,g){if(c===null||typeof c>"u"||y(a,c,h,g))return!0;if(g)return!1;if(h!==null)switch(h.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function b(a,c,h,g,w,S,M){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=g,this.attributeNamespace=w,this.mustUseProperty=h,this.propertyName=a,this.type=c,this.sanitizeURL=S,this.removeEmptyString=M}var k={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){k[a]=new b(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var c=a[0];k[c]=new b(c,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){k[a]=new b(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){k[a]=new b(a,2,!1,a,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){k[a]=new b(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){k[a]=new b(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){k[a]=new b(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){k[a]=new b(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){k[a]=new b(a,5,!1,a.toLowerCase(),null,!1,!1)});var E=/[\-:]([a-z])/g;function _(a){return a[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var c=a.replace(E,_);k[c]=new b(c,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var c=a.replace(E,_);k[c]=new b(c,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var c=a.replace(E,_);k[c]=new b(c,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){k[a]=new b(a,1,!1,a.toLowerCase(),null,!1,!1)}),k.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){k[a]=new b(a,1,!1,a.toLowerCase(),null,!0,!0)});function T(a,c,h,g){var w=k.hasOwnProperty(c)?k[c]:null;(w!==null?w.type!==0:g||!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(v(c,h,w,g)&&(h=null),g||w===null?m(c)&&(h===null?a.removeAttribute(c):a.setAttribute(c,""+h)):w.mustUseProperty?a[w.propertyName]=h===null?w.type===3?!1:"":h:(c=w.attributeName,g=w.attributeNamespace,h===null?a.removeAttribute(c):(w=w.type,h=w===3||w===4&&h===!0?"":""+h,g?a.setAttributeNS(g,c,h):a.setAttribute(c,h))))}var A=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,N=Symbol.for("react.element"),D=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),P=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),U=Symbol.for("react.provider"),J=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),q=Symbol.for("react.suspense"),Z=Symbol.for("react.suspense_list"),Q=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),Y=Symbol.for("react.offscreen"),W=Symbol.iterator;function ee(a){return a===null||typeof a!="object"?null:(a=W&&a[W]||a["@@iterator"],typeof a=="function"?a:null)}var z=Object.assign,j;function B(a){if(j===void 0)try{throw Error()}catch(h){var c=h.stack.trim().match(/\n( *(at )?)/);j=c&&c[1]||""}return`
34
- `+j+a}var ne=!1;function fe(a,c){if(!a||ne)return"";ne=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(H){var g=H}Reflect.construct(a,[],c)}else{try{c.call()}catch(H){g=H}a.call(c.prototype)}else{try{throw Error()}catch(H){g=H}a()}}catch(H){if(H&&g&&typeof H.stack=="string"){for(var w=H.stack.split(`
35
- `),S=g.stack.split(`
36
- `),M=w.length-1,R=S.length-1;1<=M&&0<=R&&w[M]!==S[R];)R--;for(;1<=M&&0<=R;M--,R--)if(w[M]!==S[R]){if(M!==1||R!==1)do if(M--,R--,0>R||w[M]!==S[R]){var L=`
37
- `+w[M].replace(" at new "," at ");return a.displayName&&L.includes("<anonymous>")&&(L=L.replace("<anonymous>",a.displayName)),L}while(1<=M&&0<=R);break}}}finally{ne=!1,Error.prepareStackTrace=h}return(a=a?a.displayName||a.name:"")?B(a):""}function ue(a){switch(a.tag){case 5:return B(a.type);case 16:return B("Lazy");case 13:return B("Suspense");case 19:return B("SuspenseList");case 0:case 2:case 15:return a=fe(a.type,!1),a;case 11:return a=fe(a.type.render,!1),a;case 1:return a=fe(a.type,!0),a;default:return""}}function he(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case I:return"Fragment";case D:return"Portal";case O:return"Profiler";case P:return"StrictMode";case q:return"Suspense";case Z:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case J:return(a.displayName||"Context")+".Consumer";case U:return(a._context.displayName||"Context")+".Provider";case K:var c=a.render;return a=a.displayName,a||(a=c.displayName||c.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case Q:return c=a.displayName||null,c!==null?c:he(a.type)||"Memo";case G:c=a._payload,a=a._init;try{return he(a(c))}catch{}}return null}function Ae(a){var c=a.type;switch(a.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=c.render,a=a.displayName||a.name||"",c.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return he(c);case 8:return c===P?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function X(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function ce(a){var c=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function pe(a){var c=ce(a)?"checked":"value",h=Object.getOwnPropertyDescriptor(a.constructor.prototype,c),g=""+a[c];if(!a.hasOwnProperty(c)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var w=h.get,S=h.set;return Object.defineProperty(a,c,{configurable:!0,get:function(){return w.call(this)},set:function(M){g=""+M,S.call(this,M)}}),Object.defineProperty(a,c,{enumerable:h.enumerable}),{getValue:function(){return g},setValue:function(M){g=""+M},stopTracking:function(){a._valueTracker=null,delete a[c]}}}}function Le(a){a._valueTracker||(a._valueTracker=pe(a))}function Ne(a){if(!a)return!1;var c=a._valueTracker;if(!c)return!0;var h=c.getValue(),g="";return a&&(g=ce(a)?a.checked?"true":"false":a.value),a=g,a!==h?(c.setValue(a),!0):!1}function $e(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function Ze(a,c){var h=c.checked;return z({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:h??a._wrapperState.initialChecked})}function Mt(a,c){var h=c.defaultValue==null?"":c.defaultValue,g=c.checked!=null?c.checked:c.defaultChecked;h=X(c.value!=null?c.value:h),a._wrapperState={initialChecked:g,initialValue:h,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function Pt(a,c){c=c.checked,c!=null&&T(a,"checked",c,!1)}function Ht(a,c){Pt(a,c);var h=X(c.value),g=c.type;if(h!=null)g==="number"?(h===0&&a.value===""||a.value!=h)&&(a.value=""+h):a.value!==""+h&&(a.value=""+h);else if(g==="submit"||g==="reset"){a.removeAttribute("value");return}c.hasOwnProperty("value")?Ut(a,c.type,h):c.hasOwnProperty("defaultValue")&&Ut(a,c.type,X(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(a.defaultChecked=!!c.defaultChecked)}function zn(a,c,h){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var g=c.type;if(!(g!=="submit"&&g!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+a._wrapperState.initialValue,h||c===a.value||(a.value=c),a.defaultValue=c}h=a.name,h!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,h!==""&&(a.name=h)}function Ut(a,c,h){(c!=="number"||$e(a.ownerDocument)!==a)&&(h==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+h&&(a.defaultValue=""+h))}var en=Array.isArray;function An(a,c,h,g){if(a=a.options,c){c={};for(var w=0;w<h.length;w++)c["$"+h[w]]=!0;for(h=0;h<a.length;h++)w=c.hasOwnProperty("$"+a[h].value),a[h].selected!==w&&(a[h].selected=w),w&&g&&(a[h].defaultSelected=!0)}else{for(h=""+X(h),c=null,w=0;w<a.length;w++){if(a[w].value===h){a[w].selected=!0,g&&(a[w].defaultSelected=!0);return}c!==null||a[w].disabled||(c=a[w])}c!==null&&(c.selected=!0)}}function ht(a,c){if(c.dangerouslySetInnerHTML!=null)throw Error(n(91));return z({},c,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function hr(a,c){var h=c.value;if(h==null){if(h=c.children,c=c.defaultValue,h!=null){if(c!=null)throw Error(n(92));if(en(h)){if(1<h.length)throw Error(n(93));h=h[0]}c=h}c==null&&(c=""),h=c}a._wrapperState={initialValue:X(h)}}function gi(a,c){var h=X(c.value),g=X(c.defaultValue);h!=null&&(h=""+h,h!==a.value&&(a.value=h),c.defaultValue==null&&a.defaultValue!==h&&(a.defaultValue=h)),g!=null&&(a.defaultValue=""+g)}function ha(a){var c=a.textContent;c===a._wrapperState.initialValue&&c!==""&&c!==null&&(a.value=c)}function To(a){switch(a){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function pr(a,c){return a==null||a==="http://www.w3.org/1999/xhtml"?To(c):a==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var Fn,mr=(function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,h,g,w){MSApp.execUnsafeLocalFunction(function(){return a(c,h,g,w)})}:a})(function(a,c){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=c;else{for(Fn=Fn||document.createElement("div"),Fn.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=Fn.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;c.firstChild;)a.appendChild(c.firstChild)}});function Nn(a,c){if(c){var h=a.firstChild;if(h&&h===a.lastChild&&h.nodeType===3){h.nodeValue=c;return}}a.textContent=c}var hn={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},Rr=["Webkit","ms","Moz","O"];Object.keys(hn).forEach(function(a){Rr.forEach(function(c){c=c+a.charAt(0).toUpperCase()+a.substring(1),hn[c]=hn[a]})});function pa(a,c,h){return c==null||typeof c=="boolean"||c===""?"":h||typeof c!="number"||c===0||hn.hasOwnProperty(a)&&hn[a]?(""+c).trim():c+"px"}function ma(a,c){a=a.style;for(var h in c)if(c.hasOwnProperty(h)){var g=h.indexOf("--")===0,w=pa(h,c[h],g);h==="float"&&(h="cssFloat"),g?a.setProperty(h,w):a[h]=w}}var ds=z({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 Mo(a,c){if(c){if(ds[a]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(n(137,a));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(n(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(n(61))}if(c.style!=null&&typeof c.style!="object")throw Error(n(62))}}function yi(a,c){if(a.indexOf("-")===-1)return typeof c.is=="string";switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Zr=null;function $n(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var xi=null,Yr=null,mt=null;function Wt(a){if(a=ql(a)){if(typeof xi!="function")throw Error(n(280));var c=a.stateNode;c&&(c=ld(c),xi(a.stateNode,a.type,c))}}function Te(a){Yr?mt?mt.push(a):mt=[a]:Yr=a}function st(){if(Yr){var a=Yr,c=mt;if(mt=Yr=null,Wt(a),c)for(a=0;a<c.length;a++)Wt(c[a])}}function et(a,c){return a(c)}function it(){}var qt=!1;function pt(a,c,h){if(qt)return a(c,h);qt=!0;try{return et(a,c,h)}finally{qt=!1,(Yr!==null||mt!==null)&&(it(),st())}}function Ge(a,c){var h=a.stateNode;if(h===null)return null;var g=ld(h);if(g===null)return null;h=g[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(a=a.type,g=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!g;break e;default:a=!1}if(a)return null;if(h&&typeof h!="function")throw Error(n(231,c,typeof h));return h}var pn=!1;if(l)try{var dt={};Object.defineProperty(dt,"passive",{get:function(){pn=!0}}),window.addEventListener("test",dt,dt),window.removeEventListener("test",dt,dt)}catch{pn=!1}function Et(a,c,h,g,w,S,M,R,L){var H=Array.prototype.slice.call(arguments,3);try{c.apply(h,H)}catch(se){this.onError(se)}}var Bn=!1,tn=null,Vn=!1,Ao=null,Tl={onError:function(a){Bn=!0,tn=a}};function HM(a,c,h,g,w,S,M,R,L){Bn=!1,tn=null,Et.apply(Tl,arguments)}function UM(a,c,h,g,w,S,M,R,L){if(HM.apply(this,arguments),Bn){if(Bn){var H=tn;Bn=!1,tn=null}else throw Error(n(198));Vn||(Vn=!0,Ao=H)}}function vi(a){var c=a,h=a;if(a.alternate)for(;c.return;)c=c.return;else{a=c;do c=a,(c.flags&4098)!==0&&(h=c.return),a=c.return;while(a)}return c.tag===3?h:null}function wv(a){if(a.tag===13){var c=a.memoizedState;if(c===null&&(a=a.alternate,a!==null&&(c=a.memoizedState)),c!==null)return c.dehydrated}return null}function Cv(a){if(vi(a)!==a)throw Error(n(188))}function WM(a){var c=a.alternate;if(!c){if(c=vi(a),c===null)throw Error(n(188));return c!==a?null:a}for(var h=a,g=c;;){var w=h.return;if(w===null)break;var S=w.alternate;if(S===null){if(g=w.return,g!==null){h=g;continue}break}if(w.child===S.child){for(S=w.child;S;){if(S===h)return Cv(w),a;if(S===g)return Cv(w),c;S=S.sibling}throw Error(n(188))}if(h.return!==g.return)h=w,g=S;else{for(var M=!1,R=w.child;R;){if(R===h){M=!0,h=w,g=S;break}if(R===g){M=!0,g=w,h=S;break}R=R.sibling}if(!M){for(R=S.child;R;){if(R===h){M=!0,h=S,g=w;break}if(R===g){M=!0,g=S,h=w;break}R=R.sibling}if(!M)throw Error(n(189))}}if(h.alternate!==g)throw Error(n(190))}if(h.tag!==3)throw Error(n(188));return h.stateNode.current===h?a:c}function Sv(a){return a=WM(a),a!==null?Ev(a):null}function Ev(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var c=Ev(a);if(c!==null)return c;a=a.sibling}return null}var _v=e.unstable_scheduleCallback,Tv=e.unstable_cancelCallback,qM=e.unstable_shouldYield,KM=e.unstable_requestPaint,Ot=e.unstable_now,GM=e.unstable_getCurrentPriorityLevel,Xp=e.unstable_ImmediatePriority,Mv=e.unstable_UserBlockingPriority,Vc=e.unstable_NormalPriority,JM=e.unstable_LowPriority,Av=e.unstable_IdlePriority,Hc=null,Xr=null;function ZM(a){if(Xr&&typeof Xr.onCommitFiberRoot=="function")try{Xr.onCommitFiberRoot(Hc,a,void 0,(a.current.flags&128)===128)}catch{}}var Or=Math.clz32?Math.clz32:QM,YM=Math.log,XM=Math.LN2;function QM(a){return a>>>=0,a===0?32:31-(YM(a)/XM|0)|0}var Uc=64,Wc=4194304;function Ml(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function qc(a,c){var h=a.pendingLanes;if(h===0)return 0;var g=0,w=a.suspendedLanes,S=a.pingedLanes,M=h&268435455;if(M!==0){var R=M&~w;R!==0?g=Ml(R):(S&=M,S!==0&&(g=Ml(S)))}else M=h&~w,M!==0?g=Ml(M):S!==0&&(g=Ml(S));if(g===0)return 0;if(c!==0&&c!==g&&(c&w)===0&&(w=g&-g,S=c&-c,w>=S||w===16&&(S&4194240)!==0))return c;if((g&4)!==0&&(g|=h&16),c=a.entangledLanes,c!==0)for(a=a.entanglements,c&=g;0<c;)h=31-Or(c),w=1<<h,g|=a[h],c&=~w;return g}function eA(a,c){switch(a){case 1:case 2:case 4:return c+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function tA(a,c){for(var h=a.suspendedLanes,g=a.pingedLanes,w=a.expirationTimes,S=a.pendingLanes;0<S;){var M=31-Or(S),R=1<<M,L=w[M];L===-1?((R&h)===0||(R&g)!==0)&&(w[M]=eA(R,c)):L<=c&&(a.expiredLanes|=R),S&=~R}}function Qp(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function Nv(){var a=Uc;return Uc<<=1,(Uc&4194240)===0&&(Uc=64),a}function em(a){for(var c=[],h=0;31>h;h++)c.push(a);return c}function Al(a,c,h){a.pendingLanes|=c,c!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,c=31-Or(c),a[c]=h}function nA(a,c){var h=a.pendingLanes&~c;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=c,a.mutableReadLanes&=c,a.entangledLanes&=c,c=a.entanglements;var g=a.eventTimes;for(a=a.expirationTimes;0<h;){var w=31-Or(h),S=1<<w;c[w]=0,g[w]=-1,a[w]=-1,h&=~S}}function tm(a,c){var h=a.entangledLanes|=c;for(a=a.entanglements;h;){var g=31-Or(h),w=1<<g;w&c|a[g]&c&&(a[g]|=c),h&=~w}}var ut=0;function Dv(a){return a&=-a,1<a?4<a?(a&268435455)!==0?16:536870912:4:1}var Rv,nm,Ov,Iv,Pv,rm=!1,Kc=[],fs=null,hs=null,ps=null,Nl=new Map,Dl=new Map,ms=[],rA="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 jv(a,c){switch(a){case"focusin":case"focusout":fs=null;break;case"dragenter":case"dragleave":hs=null;break;case"mouseover":case"mouseout":ps=null;break;case"pointerover":case"pointerout":Nl.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":Dl.delete(c.pointerId)}}function Rl(a,c,h,g,w,S){return a===null||a.nativeEvent!==S?(a={blockedOn:c,domEventName:h,eventSystemFlags:g,nativeEvent:S,targetContainers:[w]},c!==null&&(c=ql(c),c!==null&&nm(c)),a):(a.eventSystemFlags|=g,c=a.targetContainers,w!==null&&c.indexOf(w)===-1&&c.push(w),a)}function oA(a,c,h,g,w){switch(c){case"focusin":return fs=Rl(fs,a,c,h,g,w),!0;case"dragenter":return hs=Rl(hs,a,c,h,g,w),!0;case"mouseover":return ps=Rl(ps,a,c,h,g,w),!0;case"pointerover":var S=w.pointerId;return Nl.set(S,Rl(Nl.get(S)||null,a,c,h,g,w)),!0;case"gotpointercapture":return S=w.pointerId,Dl.set(S,Rl(Dl.get(S)||null,a,c,h,g,w)),!0}return!1}function Lv(a){var c=bi(a.target);if(c!==null){var h=vi(c);if(h!==null){if(c=h.tag,c===13){if(c=wv(h),c!==null){a.blockedOn=c,Pv(a.priority,function(){Ov(h)});return}}else if(c===3&&h.stateNode.current.memoizedState.isDehydrated){a.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Gc(a){if(a.blockedOn!==null)return!1;for(var c=a.targetContainers;0<c.length;){var h=sm(a.domEventName,a.eventSystemFlags,c[0],a.nativeEvent);if(h===null){h=a.nativeEvent;var g=new h.constructor(h.type,h);Zr=g,h.target.dispatchEvent(g),Zr=null}else return c=ql(h),c!==null&&nm(c),a.blockedOn=h,!1;c.shift()}return!0}function zv(a,c,h){Gc(a)&&h.delete(c)}function sA(){rm=!1,fs!==null&&Gc(fs)&&(fs=null),hs!==null&&Gc(hs)&&(hs=null),ps!==null&&Gc(ps)&&(ps=null),Nl.forEach(zv),Dl.forEach(zv)}function Ol(a,c){a.blockedOn===c&&(a.blockedOn=null,rm||(rm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,sA)))}function Il(a){function c(w){return Ol(w,a)}if(0<Kc.length){Ol(Kc[0],a);for(var h=1;h<Kc.length;h++){var g=Kc[h];g.blockedOn===a&&(g.blockedOn=null)}}for(fs!==null&&Ol(fs,a),hs!==null&&Ol(hs,a),ps!==null&&Ol(ps,a),Nl.forEach(c),Dl.forEach(c),h=0;h<ms.length;h++)g=ms[h],g.blockedOn===a&&(g.blockedOn=null);for(;0<ms.length&&(h=ms[0],h.blockedOn===null);)Lv(h),h.blockedOn===null&&ms.shift()}var ga=A.ReactCurrentBatchConfig,Jc=!0;function iA(a,c,h,g){var w=ut,S=ga.transition;ga.transition=null;try{ut=1,om(a,c,h,g)}finally{ut=w,ga.transition=S}}function aA(a,c,h,g){var w=ut,S=ga.transition;ga.transition=null;try{ut=4,om(a,c,h,g)}finally{ut=w,ga.transition=S}}function om(a,c,h,g){if(Jc){var w=sm(a,c,h,g);if(w===null)wm(a,c,g,Zc,h),jv(a,g);else if(oA(w,a,c,h,g))g.stopPropagation();else if(jv(a,g),c&4&&-1<rA.indexOf(a)){for(;w!==null;){var S=ql(w);if(S!==null&&Rv(S),S=sm(a,c,h,g),S===null&&wm(a,c,g,Zc,h),S===w)break;w=S}w!==null&&g.stopPropagation()}else wm(a,c,g,null,h)}}var Zc=null;function sm(a,c,h,g){if(Zc=null,a=$n(g),a=bi(a),a!==null)if(c=vi(a),c===null)a=null;else if(h=c.tag,h===13){if(a=wv(c),a!==null)return a;a=null}else if(h===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;a=null}else c!==a&&(a=null);return Zc=a,null}function Fv(a){switch(a){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(GM()){case Xp:return 1;case Mv:return 4;case Vc:case JM:return 16;case Av:return 536870912;default:return 16}default:return 16}}var gs=null,im=null,Yc=null;function $v(){if(Yc)return Yc;var a,c=im,h=c.length,g,w="value"in gs?gs.value:gs.textContent,S=w.length;for(a=0;a<h&&c[a]===w[a];a++);var M=h-a;for(g=1;g<=M&&c[h-g]===w[S-g];g++);return Yc=w.slice(a,1<g?1-g:void 0)}function Xc(a){var c=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&c===13&&(a=13)):a=c,a===10&&(a=13),32<=a||a===13?a:0}function Qc(){return!0}function Bv(){return!1}function tr(a){function c(h,g,w,S,M){this._reactName=h,this._targetInst=w,this.type=g,this.nativeEvent=S,this.target=M,this.currentTarget=null;for(var R in a)a.hasOwnProperty(R)&&(h=a[R],this[R]=h?h(S):S[R]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?Qc:Bv,this.isPropagationStopped=Bv,this}return z(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=Qc)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=Qc)},persist:function(){},isPersistent:Qc}),c}var ya={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},am=tr(ya),Pl=z({},ya,{view:0,detail:0}),lA=tr(Pl),lm,um,jl,ed=z({},Pl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:dm,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==jl&&(jl&&a.type==="mousemove"?(lm=a.screenX-jl.screenX,um=a.screenY-jl.screenY):um=lm=0,jl=a),lm)},movementY:function(a){return"movementY"in a?a.movementY:um}}),Vv=tr(ed),uA=z({},ed,{dataTransfer:0}),cA=tr(uA),dA=z({},Pl,{relatedTarget:0}),cm=tr(dA),fA=z({},ya,{animationName:0,elapsedTime:0,pseudoElement:0}),hA=tr(fA),pA=z({},ya,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),mA=tr(pA),gA=z({},ya,{data:0}),Hv=tr(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"},xA={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"},vA={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function bA(a){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(a):(a=vA[a])?!!c[a]:!1}function dm(){return bA}var kA=z({},Pl,{key:function(a){if(a.key){var c=yA[a.key]||a.key;if(c!=="Unidentified")return c}return a.type==="keypress"?(a=Xc(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?xA[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:dm,charCode:function(a){return a.type==="keypress"?Xc(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Xc(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),wA=tr(kA),CA=z({},ed,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Uv=tr(CA),SA=z({},Pl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:dm}),EA=tr(SA),_A=z({},ya,{propertyName:0,elapsedTime:0,pseudoElement:0}),TA=tr(_A),MA=z({},ed,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),AA=tr(MA),NA=[9,13,27,32],fm=l&&"CompositionEvent"in window,Ll=null;l&&"documentMode"in document&&(Ll=document.documentMode);var DA=l&&"TextEvent"in window&&!Ll,Wv=l&&(!fm||Ll&&8<Ll&&11>=Ll),qv=" ",Kv=!1;function Gv(a,c){switch(a){case"keyup":return NA.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Jv(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var xa=!1;function RA(a,c){switch(a){case"compositionend":return Jv(c);case"keypress":return c.which!==32?null:(Kv=!0,qv);case"textInput":return a=c.data,a===qv&&Kv?null:a;default:return null}}function OA(a,c){if(xa)return a==="compositionend"||!fm&&Gv(a,c)?(a=$v(),Yc=im=gs=null,xa=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return Wv&&c.locale!=="ko"?null:c.data;default:return null}}var IA={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 Zv(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c==="input"?!!IA[a.type]:c==="textarea"}function Yv(a,c,h,g){Te(g),c=sd(c,"onChange"),0<c.length&&(h=new am("onChange","change",null,h,g),a.push({event:h,listeners:c}))}var zl=null,Fl=null;function PA(a){mb(a,0)}function td(a){var c=Ca(a);if(Ne(c))return a}function jA(a,c){if(a==="change")return c}var Xv=!1;if(l){var hm;if(l){var pm="oninput"in document;if(!pm){var Qv=document.createElement("div");Qv.setAttribute("oninput","return;"),pm=typeof Qv.oninput=="function"}hm=pm}else hm=!1;Xv=hm&&(!document.documentMode||9<document.documentMode)}function eb(){zl&&(zl.detachEvent("onpropertychange",tb),Fl=zl=null)}function tb(a){if(a.propertyName==="value"&&td(Fl)){var c=[];Yv(c,Fl,a,$n(a)),pt(PA,c)}}function LA(a,c,h){a==="focusin"?(eb(),zl=c,Fl=h,zl.attachEvent("onpropertychange",tb)):a==="focusout"&&eb()}function zA(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return td(Fl)}function FA(a,c){if(a==="click")return td(c)}function $A(a,c){if(a==="input"||a==="change")return td(c)}function BA(a,c){return a===c&&(a!==0||1/a===1/c)||a!==a&&c!==c}var Ir=typeof Object.is=="function"?Object.is:BA;function $l(a,c){if(Ir(a,c))return!0;if(typeof a!="object"||a===null||typeof c!="object"||c===null)return!1;var h=Object.keys(a),g=Object.keys(c);if(h.length!==g.length)return!1;for(g=0;g<h.length;g++){var w=h[g];if(!u.call(c,w)||!Ir(a[w],c[w]))return!1}return!0}function nb(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function rb(a,c){var h=nb(a);a=0;for(var g;h;){if(h.nodeType===3){if(g=a+h.textContent.length,a<=c&&g>=c)return{node:h,offset:c-a};a=g}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=nb(h)}}function ob(a,c){return a&&c?a===c?!0:a&&a.nodeType===3?!1:c&&c.nodeType===3?ob(a,c.parentNode):"contains"in a?a.contains(c):a.compareDocumentPosition?!!(a.compareDocumentPosition(c)&16):!1:!1}function sb(){for(var a=window,c=$e();c instanceof a.HTMLIFrameElement;){try{var h=typeof c.contentWindow.location.href=="string"}catch{h=!1}if(h)a=c.contentWindow;else break;c=$e(a.document)}return c}function mm(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c&&(c==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||c==="textarea"||a.contentEditable==="true")}function VA(a){var c=sb(),h=a.focusedElem,g=a.selectionRange;if(c!==h&&h&&h.ownerDocument&&ob(h.ownerDocument.documentElement,h)){if(g!==null&&mm(h)){if(c=g.start,a=g.end,a===void 0&&(a=c),"selectionStart"in h)h.selectionStart=c,h.selectionEnd=Math.min(a,h.value.length);else if(a=(c=h.ownerDocument||document)&&c.defaultView||window,a.getSelection){a=a.getSelection();var w=h.textContent.length,S=Math.min(g.start,w);g=g.end===void 0?S:Math.min(g.end,w),!a.extend&&S>g&&(w=g,g=S,S=w),w=rb(h,S);var M=rb(h,g);w&&M&&(a.rangeCount!==1||a.anchorNode!==w.node||a.anchorOffset!==w.offset||a.focusNode!==M.node||a.focusOffset!==M.offset)&&(c=c.createRange(),c.setStart(w.node,w.offset),a.removeAllRanges(),S>g?(a.addRange(c),a.extend(M.node,M.offset)):(c.setEnd(M.node,M.offset),a.addRange(c)))}}for(c=[],a=h;a=a.parentNode;)a.nodeType===1&&c.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<c.length;h++)a=c[h],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var HA=l&&"documentMode"in document&&11>=document.documentMode,va=null,gm=null,Bl=null,ym=!1;function ib(a,c,h){var g=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;ym||va==null||va!==$e(g)||(g=va,"selectionStart"in g&&mm(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Bl&&$l(Bl,g)||(Bl=g,g=sd(gm,"onSelect"),0<g.length&&(c=new am("onSelect","select",null,c,h),a.push({event:c,listeners:g}),c.target=va)))}function nd(a,c){var h={};return h[a.toLowerCase()]=c.toLowerCase(),h["Webkit"+a]="webkit"+c,h["Moz"+a]="moz"+c,h}var ba={animationend:nd("Animation","AnimationEnd"),animationiteration:nd("Animation","AnimationIteration"),animationstart:nd("Animation","AnimationStart"),transitionend:nd("Transition","TransitionEnd")},xm={},ab={};l&&(ab=document.createElement("div").style,"AnimationEvent"in window||(delete ba.animationend.animation,delete ba.animationiteration.animation,delete ba.animationstart.animation),"TransitionEvent"in window||delete ba.transitionend.transition);function rd(a){if(xm[a])return xm[a];if(!ba[a])return a;var c=ba[a],h;for(h in c)if(c.hasOwnProperty(h)&&h in ab)return xm[a]=c[h];return a}var lb=rd("animationend"),ub=rd("animationiteration"),cb=rd("animationstart"),db=rd("transitionend"),fb=new Map,hb="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 ys(a,c){fb.set(a,c),s(c,[a])}for(var vm=0;vm<hb.length;vm++){var bm=hb[vm],UA=bm.toLowerCase(),WA=bm[0].toUpperCase()+bm.slice(1);ys(UA,"on"+WA)}ys(lb,"onAnimationEnd"),ys(ub,"onAnimationIteration"),ys(cb,"onAnimationStart"),ys("dblclick","onDoubleClick"),ys("focusin","onFocus"),ys("focusout","onBlur"),ys(db,"onTransitionEnd"),i("onMouseEnter",["mouseout","mouseover"]),i("onMouseLeave",["mouseout","mouseover"]),i("onPointerEnter",["pointerout","pointerover"]),i("onPointerLeave",["pointerout","pointerover"]),s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),s("onBeforeInput",["compositionend","keypress","textInput","paste"]),s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Vl="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(" "),qA=new Set("cancel close invalid load scroll toggle".split(" ").concat(Vl));function pb(a,c,h){var g=a.type||"unknown-event";a.currentTarget=h,UM(g,c,void 0,a),a.currentTarget=null}function mb(a,c){c=(c&4)!==0;for(var h=0;h<a.length;h++){var g=a[h],w=g.event;g=g.listeners;e:{var S=void 0;if(c)for(var M=g.length-1;0<=M;M--){var R=g[M],L=R.instance,H=R.currentTarget;if(R=R.listener,L!==S&&w.isPropagationStopped())break e;pb(w,R,H),S=L}else for(M=0;M<g.length;M++){if(R=g[M],L=R.instance,H=R.currentTarget,R=R.listener,L!==S&&w.isPropagationStopped())break e;pb(w,R,H),S=L}}}if(Vn)throw a=Ao,Vn=!1,Ao=null,a}function vt(a,c){var h=c[Mm];h===void 0&&(h=c[Mm]=new Set);var g=a+"__bubble";h.has(g)||(gb(c,a,2,!1),h.add(g))}function km(a,c,h){var g=0;c&&(g|=4),gb(h,a,g,c)}var od="_reactListening"+Math.random().toString(36).slice(2);function Hl(a){if(!a[od]){a[od]=!0,r.forEach(function(h){h!=="selectionchange"&&(qA.has(h)||km(h,!1,a),km(h,!0,a))});var c=a.nodeType===9?a:a.ownerDocument;c===null||c[od]||(c[od]=!0,km("selectionchange",!1,c))}}function gb(a,c,h,g){switch(Fv(c)){case 1:var w=iA;break;case 4:w=aA;break;default:w=om}h=w.bind(null,c,h,a),w=void 0,!pn||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(w=!0),g?w!==void 0?a.addEventListener(c,h,{capture:!0,passive:w}):a.addEventListener(c,h,!0):w!==void 0?a.addEventListener(c,h,{passive:w}):a.addEventListener(c,h,!1)}function wm(a,c,h,g,w){var S=g;if((c&1)===0&&(c&2)===0&&g!==null)e:for(;;){if(g===null)return;var M=g.tag;if(M===3||M===4){var R=g.stateNode.containerInfo;if(R===w||R.nodeType===8&&R.parentNode===w)break;if(M===4)for(M=g.return;M!==null;){var L=M.tag;if((L===3||L===4)&&(L=M.stateNode.containerInfo,L===w||L.nodeType===8&&L.parentNode===w))return;M=M.return}for(;R!==null;){if(M=bi(R),M===null)return;if(L=M.tag,L===5||L===6){g=S=M;continue e}R=R.parentNode}}g=g.return}pt(function(){var H=S,se=$n(h),ie=[];e:{var oe=fb.get(a);if(oe!==void 0){var me=am,ke=a;switch(a){case"keypress":if(Xc(h)===0)break e;case"keydown":case"keyup":me=wA;break;case"focusin":ke="focus",me=cm;break;case"focusout":ke="blur",me=cm;break;case"beforeblur":case"afterblur":me=cm;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=Vv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=cA;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=EA;break;case lb:case ub:case cb:me=hA;break;case db:me=TA;break;case"scroll":me=lA;break;case"wheel":me=AA;break;case"copy":case"cut":case"paste":me=mA;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=Uv}var we=(c&4)!==0,It=!we&&a==="scroll",$=we?oe!==null?oe+"Capture":null:oe;we=[];for(var F=H,V;F!==null;){V=F;var de=V.stateNode;if(V.tag===5&&de!==null&&(V=de,$!==null&&(de=Ge(F,$),de!=null&&we.push(Ul(F,de,V)))),It)break;F=F.return}0<we.length&&(oe=new me(oe,ke,null,h,se),ie.push({event:oe,listeners:we}))}}if((c&7)===0){e:{if(oe=a==="mouseover"||a==="pointerover",me=a==="mouseout"||a==="pointerout",oe&&h!==Zr&&(ke=h.relatedTarget||h.fromElement)&&(bi(ke)||ke[No]))break e;if((me||oe)&&(oe=se.window===se?se:(oe=se.ownerDocument)?oe.defaultView||oe.parentWindow:window,me?(ke=h.relatedTarget||h.toElement,me=H,ke=ke?bi(ke):null,ke!==null&&(It=vi(ke),ke!==It||ke.tag!==5&&ke.tag!==6)&&(ke=null)):(me=null,ke=H),me!==ke)){if(we=Vv,de="onMouseLeave",$="onMouseEnter",F="mouse",(a==="pointerout"||a==="pointerover")&&(we=Uv,de="onPointerLeave",$="onPointerEnter",F="pointer"),It=me==null?oe:Ca(me),V=ke==null?oe:Ca(ke),oe=new we(de,F+"leave",me,h,se),oe.target=It,oe.relatedTarget=V,de=null,bi(se)===H&&(we=new we($,F+"enter",ke,h,se),we.target=V,we.relatedTarget=It,de=we),It=de,me&&ke)t:{for(we=me,$=ke,F=0,V=we;V;V=ka(V))F++;for(V=0,de=$;de;de=ka(de))V++;for(;0<F-V;)we=ka(we),F--;for(;0<V-F;)$=ka($),V--;for(;F--;){if(we===$||$!==null&&we===$.alternate)break t;we=ka(we),$=ka($)}we=null}else we=null;me!==null&&yb(ie,oe,me,we,!1),ke!==null&&It!==null&&yb(ie,It,ke,we,!0)}}e:{if(oe=H?Ca(H):window,me=oe.nodeName&&oe.nodeName.toLowerCase(),me==="select"||me==="input"&&oe.type==="file")var Se=jA;else if(Zv(oe))if(Xv)Se=$A;else{Se=zA;var Ie=LA}else(me=oe.nodeName)&&me.toLowerCase()==="input"&&(oe.type==="checkbox"||oe.type==="radio")&&(Se=FA);if(Se&&(Se=Se(a,H))){Yv(ie,Se,h,se);break e}Ie&&Ie(a,oe,H),a==="focusout"&&(Ie=oe._wrapperState)&&Ie.controlled&&oe.type==="number"&&Ut(oe,"number",oe.value)}switch(Ie=H?Ca(H):window,a){case"focusin":(Zv(Ie)||Ie.contentEditable==="true")&&(va=Ie,gm=H,Bl=null);break;case"focusout":Bl=gm=va=null;break;case"mousedown":ym=!0;break;case"contextmenu":case"mouseup":case"dragend":ym=!1,ib(ie,h,se);break;case"selectionchange":if(HA)break;case"keydown":case"keyup":ib(ie,h,se)}var Pe;if(fm)e:{switch(a){case"compositionstart":var Fe="onCompositionStart";break e;case"compositionend":Fe="onCompositionEnd";break e;case"compositionupdate":Fe="onCompositionUpdate";break e}Fe=void 0}else xa?Gv(a,h)&&(Fe="onCompositionEnd"):a==="keydown"&&h.keyCode===229&&(Fe="onCompositionStart");Fe&&(Wv&&h.locale!=="ko"&&(xa||Fe!=="onCompositionStart"?Fe==="onCompositionEnd"&&xa&&(Pe=$v()):(gs=se,im="value"in gs?gs.value:gs.textContent,xa=!0)),Ie=sd(H,Fe),0<Ie.length&&(Fe=new Hv(Fe,a,null,h,se),ie.push({event:Fe,listeners:Ie}),Pe?Fe.data=Pe:(Pe=Jv(h),Pe!==null&&(Fe.data=Pe)))),(Pe=DA?RA(a,h):OA(a,h))&&(H=sd(H,"onBeforeInput"),0<H.length&&(se=new Hv("onBeforeInput","beforeinput",null,h,se),ie.push({event:se,listeners:H}),se.data=Pe))}mb(ie,c)})}function Ul(a,c,h){return{instance:a,listener:c,currentTarget:h}}function sd(a,c){for(var h=c+"Capture",g=[];a!==null;){var w=a,S=w.stateNode;w.tag===5&&S!==null&&(w=S,S=Ge(a,h),S!=null&&g.unshift(Ul(a,S,w)),S=Ge(a,c),S!=null&&g.push(Ul(a,S,w))),a=a.return}return g}function ka(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function yb(a,c,h,g,w){for(var S=c._reactName,M=[];h!==null&&h!==g;){var R=h,L=R.alternate,H=R.stateNode;if(L!==null&&L===g)break;R.tag===5&&H!==null&&(R=H,w?(L=Ge(h,S),L!=null&&M.unshift(Ul(h,L,R))):w||(L=Ge(h,S),L!=null&&M.push(Ul(h,L,R)))),h=h.return}M.length!==0&&a.push({event:c,listeners:M})}var KA=/\r\n?/g,GA=/\u0000|\uFFFD/g;function xb(a){return(typeof a=="string"?a:""+a).replace(KA,`
38
- `).replace(GA,"")}function id(a,c,h){if(c=xb(c),xb(a)!==c&&h)throw Error(n(425))}function ad(){}var Cm=null,Sm=null;function Em(a,c){return a==="textarea"||a==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var _m=typeof setTimeout=="function"?setTimeout:void 0,JA=typeof clearTimeout=="function"?clearTimeout:void 0,vb=typeof Promise=="function"?Promise:void 0,ZA=typeof queueMicrotask=="function"?queueMicrotask:typeof vb<"u"?function(a){return vb.resolve(null).then(a).catch(YA)}:_m;function YA(a){setTimeout(function(){throw a})}function Tm(a,c){var h=c,g=0;do{var w=h.nextSibling;if(a.removeChild(h),w&&w.nodeType===8)if(h=w.data,h==="/$"){if(g===0){a.removeChild(w),Il(c);return}g--}else h!=="$"&&h!=="$?"&&h!=="$!"||g++;h=w}while(h);Il(c)}function xs(a){for(;a!=null;a=a.nextSibling){var c=a.nodeType;if(c===1||c===3)break;if(c===8){if(c=a.data,c==="$"||c==="$!"||c==="$?")break;if(c==="/$")return null}}return a}function bb(a){a=a.previousSibling;for(var c=0;a;){if(a.nodeType===8){var h=a.data;if(h==="$"||h==="$!"||h==="$?"){if(c===0)return a;c--}else h==="/$"&&c++}a=a.previousSibling}return null}var wa=Math.random().toString(36).slice(2),Qr="__reactFiber$"+wa,Wl="__reactProps$"+wa,No="__reactContainer$"+wa,Mm="__reactEvents$"+wa,XA="__reactListeners$"+wa,QA="__reactHandles$"+wa;function bi(a){var c=a[Qr];if(c)return c;for(var h=a.parentNode;h;){if(c=h[No]||h[Qr]){if(h=c.alternate,c.child!==null||h!==null&&h.child!==null)for(a=bb(a);a!==null;){if(h=a[Qr])return h;a=bb(a)}return c}a=h,h=a.parentNode}return null}function ql(a){return a=a[Qr]||a[No],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function Ca(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(n(33))}function ld(a){return a[Wl]||null}var Am=[],Sa=-1;function vs(a){return{current:a}}function bt(a){0>Sa||(a.current=Am[Sa],Am[Sa]=null,Sa--)}function gt(a,c){Sa++,Am[Sa]=a.current,a.current=c}var bs={},kn=vs(bs),Hn=vs(!1),ki=bs;function Ea(a,c){var h=a.type.contextTypes;if(!h)return bs;var g=a.stateNode;if(g&&g.__reactInternalMemoizedUnmaskedChildContext===c)return g.__reactInternalMemoizedMaskedChildContext;var w={},S;for(S in h)w[S]=c[S];return g&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=c,a.__reactInternalMemoizedMaskedChildContext=w),w}function Un(a){return a=a.childContextTypes,a!=null}function ud(){bt(Hn),bt(kn)}function kb(a,c,h){if(kn.current!==bs)throw Error(n(168));gt(kn,c),gt(Hn,h)}function wb(a,c,h){var g=a.stateNode;if(c=c.childContextTypes,typeof g.getChildContext!="function")return h;g=g.getChildContext();for(var w in g)if(!(w in c))throw Error(n(108,Ae(a)||"Unknown",w));return z({},h,g)}function cd(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||bs,ki=kn.current,gt(kn,a),gt(Hn,Hn.current),!0}function Cb(a,c,h){var g=a.stateNode;if(!g)throw Error(n(169));h?(a=wb(a,c,ki),g.__reactInternalMemoizedMergedChildContext=a,bt(Hn),bt(kn),gt(kn,a)):bt(Hn),gt(Hn,h)}var Do=null,dd=!1,Nm=!1;function Sb(a){Do===null?Do=[a]:Do.push(a)}function eN(a){dd=!0,Sb(a)}function ks(){if(!Nm&&Do!==null){Nm=!0;var a=0,c=ut;try{var h=Do;for(ut=1;a<h.length;a++){var g=h[a];do g=g(!0);while(g!==null)}Do=null,dd=!1}catch(w){throw Do!==null&&(Do=Do.slice(a+1)),_v(Xp,ks),w}finally{ut=c,Nm=!1}}return null}var _a=[],Ta=0,fd=null,hd=0,gr=[],yr=0,wi=null,Ro=1,Oo="";function Ci(a,c){_a[Ta++]=hd,_a[Ta++]=fd,fd=a,hd=c}function Eb(a,c,h){gr[yr++]=Ro,gr[yr++]=Oo,gr[yr++]=wi,wi=a;var g=Ro;a=Oo;var w=32-Or(g)-1;g&=~(1<<w),h+=1;var S=32-Or(c)+w;if(30<S){var M=w-w%5;S=(g&(1<<M)-1).toString(32),g>>=M,w-=M,Ro=1<<32-Or(c)+w|h<<w|g,Oo=S+a}else Ro=1<<S|h<<w|g,Oo=a}function Dm(a){a.return!==null&&(Ci(a,1),Eb(a,1,0))}function Rm(a){for(;a===fd;)fd=_a[--Ta],_a[Ta]=null,hd=_a[--Ta],_a[Ta]=null;for(;a===wi;)wi=gr[--yr],gr[yr]=null,Oo=gr[--yr],gr[yr]=null,Ro=gr[--yr],gr[yr]=null}var nr=null,rr=null,St=!1,Pr=null;function _b(a,c){var h=kr(5,null,null,0);h.elementType="DELETED",h.stateNode=c,h.return=a,c=a.deletions,c===null?(a.deletions=[h],a.flags|=16):c.push(h)}function Tb(a,c){switch(a.tag){case 5:var h=a.type;return c=c.nodeType!==1||h.toLowerCase()!==c.nodeName.toLowerCase()?null:c,c!==null?(a.stateNode=c,nr=a,rr=xs(c.firstChild),!0):!1;case 6:return c=a.pendingProps===""||c.nodeType!==3?null:c,c!==null?(a.stateNode=c,nr=a,rr=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(h=wi!==null?{id:Ro,overflow:Oo}:null,a.memoizedState={dehydrated:c,treeContext:h,retryLane:1073741824},h=kr(18,null,null,0),h.stateNode=c,h.return=a,a.child=h,nr=a,rr=null,!0):!1;default:return!1}}function Om(a){return(a.mode&1)!==0&&(a.flags&128)===0}function Im(a){if(St){var c=rr;if(c){var h=c;if(!Tb(a,c)){if(Om(a))throw Error(n(418));c=xs(h.nextSibling);var g=nr;c&&Tb(a,c)?_b(g,h):(a.flags=a.flags&-4097|2,St=!1,nr=a)}}else{if(Om(a))throw Error(n(418));a.flags=a.flags&-4097|2,St=!1,nr=a}}}function Mb(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;nr=a}function pd(a){if(a!==nr)return!1;if(!St)return Mb(a),St=!0,!1;var c;if((c=a.tag!==3)&&!(c=a.tag!==5)&&(c=a.type,c=c!=="head"&&c!=="body"&&!Em(a.type,a.memoizedProps)),c&&(c=rr)){if(Om(a))throw Ab(),Error(n(418));for(;c;)_b(a,c),c=xs(c.nextSibling)}if(Mb(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));e:{for(a=a.nextSibling,c=0;a;){if(a.nodeType===8){var h=a.data;if(h==="/$"){if(c===0){rr=xs(a.nextSibling);break e}c--}else h!=="$"&&h!=="$!"&&h!=="$?"||c++}a=a.nextSibling}rr=null}}else rr=nr?xs(a.stateNode.nextSibling):null;return!0}function Ab(){for(var a=rr;a;)a=xs(a.nextSibling)}function Ma(){rr=nr=null,St=!1}function Pm(a){Pr===null?Pr=[a]:Pr.push(a)}var tN=A.ReactCurrentBatchConfig;function Kl(a,c,h){if(a=h.ref,a!==null&&typeof a!="function"&&typeof a!="object"){if(h._owner){if(h=h._owner,h){if(h.tag!==1)throw Error(n(309));var g=h.stateNode}if(!g)throw Error(n(147,a));var w=g,S=""+a;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===S?c.ref:(c=function(M){var R=w.refs;M===null?delete R[S]:R[S]=M},c._stringRef=S,c)}if(typeof a!="string")throw Error(n(284));if(!h._owner)throw Error(n(290,a))}return a}function md(a,c){throw a=Object.prototype.toString.call(c),Error(n(31,a==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":a))}function Nb(a){var c=a._init;return c(a._payload)}function Db(a){function c($,F){if(a){var V=$.deletions;V===null?($.deletions=[F],$.flags|=16):V.push(F)}}function h($,F){if(!a)return null;for(;F!==null;)c($,F),F=F.sibling;return null}function g($,F){for($=new Map;F!==null;)F.key!==null?$.set(F.key,F):$.set(F.index,F),F=F.sibling;return $}function w($,F){return $=As($,F),$.index=0,$.sibling=null,$}function S($,F,V){return $.index=V,a?(V=$.alternate,V!==null?(V=V.index,V<F?($.flags|=2,F):V):($.flags|=2,F)):($.flags|=1048576,F)}function M($){return a&&$.alternate===null&&($.flags|=2),$}function R($,F,V,de){return F===null||F.tag!==6?(F=_0(V,$.mode,de),F.return=$,F):(F=w(F,V),F.return=$,F)}function L($,F,V,de){var Se=V.type;return Se===I?se($,F,V.props.children,de,V.key):F!==null&&(F.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===G&&Nb(Se)===F.type)?(de=w(F,V.props),de.ref=Kl($,F,V),de.return=$,de):(de=Fd(V.type,V.key,V.props,null,$.mode,de),de.ref=Kl($,F,V),de.return=$,de)}function H($,F,V,de){return F===null||F.tag!==4||F.stateNode.containerInfo!==V.containerInfo||F.stateNode.implementation!==V.implementation?(F=T0(V,$.mode,de),F.return=$,F):(F=w(F,V.children||[]),F.return=$,F)}function se($,F,V,de,Se){return F===null||F.tag!==7?(F=Di(V,$.mode,de,Se),F.return=$,F):(F=w(F,V),F.return=$,F)}function ie($,F,V){if(typeof F=="string"&&F!==""||typeof F=="number")return F=_0(""+F,$.mode,V),F.return=$,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case N:return V=Fd(F.type,F.key,F.props,null,$.mode,V),V.ref=Kl($,null,F),V.return=$,V;case D:return F=T0(F,$.mode,V),F.return=$,F;case G:var de=F._init;return ie($,de(F._payload),V)}if(en(F)||ee(F))return F=Di(F,$.mode,V,null),F.return=$,F;md($,F)}return null}function oe($,F,V,de){var Se=F!==null?F.key:null;if(typeof V=="string"&&V!==""||typeof V=="number")return Se!==null?null:R($,F,""+V,de);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case N:return V.key===Se?L($,F,V,de):null;case D:return V.key===Se?H($,F,V,de):null;case G:return Se=V._init,oe($,F,Se(V._payload),de)}if(en(V)||ee(V))return Se!==null?null:se($,F,V,de,null);md($,V)}return null}function me($,F,V,de,Se){if(typeof de=="string"&&de!==""||typeof de=="number")return $=$.get(V)||null,R(F,$,""+de,Se);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case N:return $=$.get(de.key===null?V:de.key)||null,L(F,$,de,Se);case D:return $=$.get(de.key===null?V:de.key)||null,H(F,$,de,Se);case G:var Ie=de._init;return me($,F,V,Ie(de._payload),Se)}if(en(de)||ee(de))return $=$.get(V)||null,se(F,$,de,Se,null);md(F,de)}return null}function ke($,F,V,de){for(var Se=null,Ie=null,Pe=F,Fe=F=0,on=null;Pe!==null&&Fe<V.length;Fe++){Pe.index>Fe?(on=Pe,Pe=null):on=Pe.sibling;var tt=oe($,Pe,V[Fe],de);if(tt===null){Pe===null&&(Pe=on);break}a&&Pe&&tt.alternate===null&&c($,Pe),F=S(tt,F,Fe),Ie===null?Se=tt:Ie.sibling=tt,Ie=tt,Pe=on}if(Fe===V.length)return h($,Pe),St&&Ci($,Fe),Se;if(Pe===null){for(;Fe<V.length;Fe++)Pe=ie($,V[Fe],de),Pe!==null&&(F=S(Pe,F,Fe),Ie===null?Se=Pe:Ie.sibling=Pe,Ie=Pe);return St&&Ci($,Fe),Se}for(Pe=g($,Pe);Fe<V.length;Fe++)on=me(Pe,$,Fe,V[Fe],de),on!==null&&(a&&on.alternate!==null&&Pe.delete(on.key===null?Fe:on.key),F=S(on,F,Fe),Ie===null?Se=on:Ie.sibling=on,Ie=on);return a&&Pe.forEach(function(Ns){return c($,Ns)}),St&&Ci($,Fe),Se}function we($,F,V,de){var Se=ee(V);if(typeof Se!="function")throw Error(n(150));if(V=Se.call(V),V==null)throw Error(n(151));for(var Ie=Se=null,Pe=F,Fe=F=0,on=null,tt=V.next();Pe!==null&&!tt.done;Fe++,tt=V.next()){Pe.index>Fe?(on=Pe,Pe=null):on=Pe.sibling;var Ns=oe($,Pe,tt.value,de);if(Ns===null){Pe===null&&(Pe=on);break}a&&Pe&&Ns.alternate===null&&c($,Pe),F=S(Ns,F,Fe),Ie===null?Se=Ns:Ie.sibling=Ns,Ie=Ns,Pe=on}if(tt.done)return h($,Pe),St&&Ci($,Fe),Se;if(Pe===null){for(;!tt.done;Fe++,tt=V.next())tt=ie($,tt.value,de),tt!==null&&(F=S(tt,F,Fe),Ie===null?Se=tt:Ie.sibling=tt,Ie=tt);return St&&Ci($,Fe),Se}for(Pe=g($,Pe);!tt.done;Fe++,tt=V.next())tt=me(Pe,$,Fe,tt.value,de),tt!==null&&(a&&tt.alternate!==null&&Pe.delete(tt.key===null?Fe:tt.key),F=S(tt,F,Fe),Ie===null?Se=tt:Ie.sibling=tt,Ie=tt);return a&&Pe.forEach(function(IN){return c($,IN)}),St&&Ci($,Fe),Se}function It($,F,V,de){if(typeof V=="object"&&V!==null&&V.type===I&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case N:e:{for(var Se=V.key,Ie=F;Ie!==null;){if(Ie.key===Se){if(Se=V.type,Se===I){if(Ie.tag===7){h($,Ie.sibling),F=w(Ie,V.props.children),F.return=$,$=F;break e}}else if(Ie.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===G&&Nb(Se)===Ie.type){h($,Ie.sibling),F=w(Ie,V.props),F.ref=Kl($,Ie,V),F.return=$,$=F;break e}h($,Ie);break}else c($,Ie);Ie=Ie.sibling}V.type===I?(F=Di(V.props.children,$.mode,de,V.key),F.return=$,$=F):(de=Fd(V.type,V.key,V.props,null,$.mode,de),de.ref=Kl($,F,V),de.return=$,$=de)}return M($);case D:e:{for(Ie=V.key;F!==null;){if(F.key===Ie)if(F.tag===4&&F.stateNode.containerInfo===V.containerInfo&&F.stateNode.implementation===V.implementation){h($,F.sibling),F=w(F,V.children||[]),F.return=$,$=F;break e}else{h($,F);break}else c($,F);F=F.sibling}F=T0(V,$.mode,de),F.return=$,$=F}return M($);case G:return Ie=V._init,It($,F,Ie(V._payload),de)}if(en(V))return ke($,F,V,de);if(ee(V))return we($,F,V,de);md($,V)}return typeof V=="string"&&V!==""||typeof V=="number"?(V=""+V,F!==null&&F.tag===6?(h($,F.sibling),F=w(F,V),F.return=$,$=F):(h($,F),F=_0(V,$.mode,de),F.return=$,$=F),M($)):h($,F)}return It}var Aa=Db(!0),Rb=Db(!1),gd=vs(null),yd=null,Na=null,jm=null;function Lm(){jm=Na=yd=null}function zm(a){var c=gd.current;bt(gd),a._currentValue=c}function Fm(a,c,h){for(;a!==null;){var g=a.alternate;if((a.childLanes&c)!==c?(a.childLanes|=c,g!==null&&(g.childLanes|=c)):g!==null&&(g.childLanes&c)!==c&&(g.childLanes|=c),a===h)break;a=a.return}}function Da(a,c){yd=a,jm=Na=null,a=a.dependencies,a!==null&&a.firstContext!==null&&((a.lanes&c)!==0&&(Wn=!0),a.firstContext=null)}function xr(a){var c=a._currentValue;if(jm!==a)if(a={context:a,memoizedValue:c,next:null},Na===null){if(yd===null)throw Error(n(308));Na=a,yd.dependencies={lanes:0,firstContext:a}}else Na=Na.next=a;return c}var Si=null;function $m(a){Si===null?Si=[a]:Si.push(a)}function Ob(a,c,h,g){var w=c.interleaved;return w===null?(h.next=h,$m(c)):(h.next=w.next,w.next=h),c.interleaved=h,Io(a,g)}function Io(a,c){a.lanes|=c;var h=a.alternate;for(h!==null&&(h.lanes|=c),h=a,a=a.return;a!==null;)a.childLanes|=c,h=a.alternate,h!==null&&(h.childLanes|=c),h=a,a=a.return;return h.tag===3?h.stateNode:null}var ws=!1;function Bm(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ib(a,c){a=a.updateQueue,c.updateQueue===a&&(c.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function Po(a,c){return{eventTime:a,lane:c,tag:0,payload:null,callback:null,next:null}}function Cs(a,c,h){var g=a.updateQueue;if(g===null)return null;if(g=g.shared,(Ye&2)!==0){var w=g.pending;return w===null?c.next=c:(c.next=w.next,w.next=c),g.pending=c,Io(a,h)}return w=g.interleaved,w===null?(c.next=c,$m(g)):(c.next=w.next,w.next=c),g.interleaved=c,Io(a,h)}function xd(a,c,h){if(c=c.updateQueue,c!==null&&(c=c.shared,(h&4194240)!==0)){var g=c.lanes;g&=a.pendingLanes,h|=g,c.lanes=h,tm(a,h)}}function Pb(a,c){var h=a.updateQueue,g=a.alternate;if(g!==null&&(g=g.updateQueue,h===g)){var w=null,S=null;if(h=h.firstBaseUpdate,h!==null){do{var M={eventTime:h.eventTime,lane:h.lane,tag:h.tag,payload:h.payload,callback:h.callback,next:null};S===null?w=S=M:S=S.next=M,h=h.next}while(h!==null);S===null?w=S=c:S=S.next=c}else w=S=c;h={baseState:g.baseState,firstBaseUpdate:w,lastBaseUpdate:S,shared:g.shared,effects:g.effects},a.updateQueue=h;return}a=h.lastBaseUpdate,a===null?h.firstBaseUpdate=c:a.next=c,h.lastBaseUpdate=c}function vd(a,c,h,g){var w=a.updateQueue;ws=!1;var S=w.firstBaseUpdate,M=w.lastBaseUpdate,R=w.shared.pending;if(R!==null){w.shared.pending=null;var L=R,H=L.next;L.next=null,M===null?S=H:M.next=H,M=L;var se=a.alternate;se!==null&&(se=se.updateQueue,R=se.lastBaseUpdate,R!==M&&(R===null?se.firstBaseUpdate=H:R.next=H,se.lastBaseUpdate=L))}if(S!==null){var ie=w.baseState;M=0,se=H=L=null,R=S;do{var oe=R.lane,me=R.eventTime;if((g&oe)===oe){se!==null&&(se=se.next={eventTime:me,lane:0,tag:R.tag,payload:R.payload,callback:R.callback,next:null});e:{var ke=a,we=R;switch(oe=c,me=h,we.tag){case 1:if(ke=we.payload,typeof ke=="function"){ie=ke.call(me,ie,oe);break e}ie=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=we.payload,oe=typeof ke=="function"?ke.call(me,ie,oe):ke,oe==null)break e;ie=z({},ie,oe);break e;case 2:ws=!0}}R.callback!==null&&R.lane!==0&&(a.flags|=64,oe=w.effects,oe===null?w.effects=[R]:oe.push(R))}else me={eventTime:me,lane:oe,tag:R.tag,payload:R.payload,callback:R.callback,next:null},se===null?(H=se=me,L=ie):se=se.next=me,M|=oe;if(R=R.next,R===null){if(R=w.shared.pending,R===null)break;oe=R,R=oe.next,oe.next=null,w.lastBaseUpdate=oe,w.shared.pending=null}}while(!0);if(se===null&&(L=ie),w.baseState=L,w.firstBaseUpdate=H,w.lastBaseUpdate=se,c=w.shared.interleaved,c!==null){w=c;do M|=w.lane,w=w.next;while(w!==c)}else S===null&&(w.shared.lanes=0);Ti|=M,a.lanes=M,a.memoizedState=ie}}function jb(a,c,h){if(a=c.effects,c.effects=null,a!==null)for(c=0;c<a.length;c++){var g=a[c],w=g.callback;if(w!==null){if(g.callback=null,g=h,typeof w!="function")throw Error(n(191,w));w.call(g)}}}var Gl={},eo=vs(Gl),Jl=vs(Gl),Zl=vs(Gl);function Ei(a){if(a===Gl)throw Error(n(174));return a}function Vm(a,c){switch(gt(Zl,c),gt(Jl,a),gt(eo,Gl),a=c.nodeType,a){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:pr(null,"");break;default:a=a===8?c.parentNode:c,c=a.namespaceURI||null,a=a.tagName,c=pr(c,a)}bt(eo),gt(eo,c)}function Ra(){bt(eo),bt(Jl),bt(Zl)}function Lb(a){Ei(Zl.current);var c=Ei(eo.current),h=pr(c,a.type);c!==h&&(gt(Jl,a),gt(eo,h))}function Hm(a){Jl.current===a&&(bt(eo),bt(Jl))}var _t=vs(0);function bd(a){for(var c=a;c!==null;){if(c.tag===13){var h=c.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||h.data==="$?"||h.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var Um=[];function Wm(){for(var a=0;a<Um.length;a++)Um[a]._workInProgressVersionPrimary=null;Um.length=0}var kd=A.ReactCurrentDispatcher,qm=A.ReactCurrentBatchConfig,_i=0,Tt=null,Kt=null,nn=null,wd=!1,Yl=!1,Xl=0,nN=0;function wn(){throw Error(n(321))}function Km(a,c){if(c===null)return!1;for(var h=0;h<c.length&&h<a.length;h++)if(!Ir(a[h],c[h]))return!1;return!0}function Gm(a,c,h,g,w,S){if(_i=S,Tt=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,kd.current=a===null||a.memoizedState===null?iN:aN,a=h(g,w),Yl){S=0;do{if(Yl=!1,Xl=0,25<=S)throw Error(n(301));S+=1,nn=Kt=null,c.updateQueue=null,kd.current=lN,a=h(g,w)}while(Yl)}if(kd.current=Ed,c=Kt!==null&&Kt.next!==null,_i=0,nn=Kt=Tt=null,wd=!1,c)throw Error(n(300));return a}function Jm(){var a=Xl!==0;return Xl=0,a}function to(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return nn===null?Tt.memoizedState=nn=a:nn=nn.next=a,nn}function vr(){if(Kt===null){var a=Tt.alternate;a=a!==null?a.memoizedState:null}else a=Kt.next;var c=nn===null?Tt.memoizedState:nn.next;if(c!==null)nn=c,Kt=a;else{if(a===null)throw Error(n(310));Kt=a,a={memoizedState:Kt.memoizedState,baseState:Kt.baseState,baseQueue:Kt.baseQueue,queue:Kt.queue,next:null},nn===null?Tt.memoizedState=nn=a:nn=nn.next=a}return nn}function Ql(a,c){return typeof c=="function"?c(a):c}function Zm(a){var c=vr(),h=c.queue;if(h===null)throw Error(n(311));h.lastRenderedReducer=a;var g=Kt,w=g.baseQueue,S=h.pending;if(S!==null){if(w!==null){var M=w.next;w.next=S.next,S.next=M}g.baseQueue=w=S,h.pending=null}if(w!==null){S=w.next,g=g.baseState;var R=M=null,L=null,H=S;do{var se=H.lane;if((_i&se)===se)L!==null&&(L=L.next={lane:0,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null}),g=H.hasEagerState?H.eagerState:a(g,H.action);else{var ie={lane:se,action:H.action,hasEagerState:H.hasEagerState,eagerState:H.eagerState,next:null};L===null?(R=L=ie,M=g):L=L.next=ie,Tt.lanes|=se,Ti|=se}H=H.next}while(H!==null&&H!==S);L===null?M=g:L.next=R,Ir(g,c.memoizedState)||(Wn=!0),c.memoizedState=g,c.baseState=M,c.baseQueue=L,h.lastRenderedState=g}if(a=h.interleaved,a!==null){w=a;do S=w.lane,Tt.lanes|=S,Ti|=S,w=w.next;while(w!==a)}else w===null&&(h.lanes=0);return[c.memoizedState,h.dispatch]}function Ym(a){var c=vr(),h=c.queue;if(h===null)throw Error(n(311));h.lastRenderedReducer=a;var g=h.dispatch,w=h.pending,S=c.memoizedState;if(w!==null){h.pending=null;var M=w=w.next;do S=a(S,M.action),M=M.next;while(M!==w);Ir(S,c.memoizedState)||(Wn=!0),c.memoizedState=S,c.baseQueue===null&&(c.baseState=S),h.lastRenderedState=S}return[S,g]}function zb(){}function Fb(a,c){var h=Tt,g=vr(),w=c(),S=!Ir(g.memoizedState,w);if(S&&(g.memoizedState=w,Wn=!0),g=g.queue,Xm(Vb.bind(null,h,g,a),[a]),g.getSnapshot!==c||S||nn!==null&&nn.memoizedState.tag&1){if(h.flags|=2048,eu(9,Bb.bind(null,h,g,w,c),void 0,null),rn===null)throw Error(n(349));(_i&30)!==0||$b(h,c,w)}return w}function $b(a,c,h){a.flags|=16384,a={getSnapshot:c,value:h},c=Tt.updateQueue,c===null?(c={lastEffect:null,stores:null},Tt.updateQueue=c,c.stores=[a]):(h=c.stores,h===null?c.stores=[a]:h.push(a))}function Bb(a,c,h,g){c.value=h,c.getSnapshot=g,Hb(c)&&Ub(a)}function Vb(a,c,h){return h(function(){Hb(c)&&Ub(a)})}function Hb(a){var c=a.getSnapshot;a=a.value;try{var h=c();return!Ir(a,h)}catch{return!0}}function Ub(a){var c=Io(a,1);c!==null&&Fr(c,a,1,-1)}function Wb(a){var c=to();return typeof a=="function"&&(a=a()),c.memoizedState=c.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ql,lastRenderedState:a},c.queue=a,a=a.dispatch=sN.bind(null,Tt,a),[c.memoizedState,a]}function eu(a,c,h,g){return a={tag:a,create:c,destroy:h,deps:g,next:null},c=Tt.updateQueue,c===null?(c={lastEffect:null,stores:null},Tt.updateQueue=c,c.lastEffect=a.next=a):(h=c.lastEffect,h===null?c.lastEffect=a.next=a:(g=h.next,h.next=a,a.next=g,c.lastEffect=a)),a}function qb(){return vr().memoizedState}function Cd(a,c,h,g){var w=to();Tt.flags|=a,w.memoizedState=eu(1|c,h,void 0,g===void 0?null:g)}function Sd(a,c,h,g){var w=vr();g=g===void 0?null:g;var S=void 0;if(Kt!==null){var M=Kt.memoizedState;if(S=M.destroy,g!==null&&Km(g,M.deps)){w.memoizedState=eu(c,h,S,g);return}}Tt.flags|=a,w.memoizedState=eu(1|c,h,S,g)}function Kb(a,c){return Cd(8390656,8,a,c)}function Xm(a,c){return Sd(2048,8,a,c)}function Gb(a,c){return Sd(4,2,a,c)}function Jb(a,c){return Sd(4,4,a,c)}function Zb(a,c){if(typeof c=="function")return a=a(),c(a),function(){c(null)};if(c!=null)return a=a(),c.current=a,function(){c.current=null}}function Yb(a,c,h){return h=h!=null?h.concat([a]):null,Sd(4,4,Zb.bind(null,c,a),h)}function Qm(){}function Xb(a,c){var h=vr();c=c===void 0?null:c;var g=h.memoizedState;return g!==null&&c!==null&&Km(c,g[1])?g[0]:(h.memoizedState=[a,c],a)}function Qb(a,c){var h=vr();c=c===void 0?null:c;var g=h.memoizedState;return g!==null&&c!==null&&Km(c,g[1])?g[0]:(a=a(),h.memoizedState=[a,c],a)}function ek(a,c,h){return(_i&21)===0?(a.baseState&&(a.baseState=!1,Wn=!0),a.memoizedState=h):(Ir(h,c)||(h=Nv(),Tt.lanes|=h,Ti|=h,a.baseState=!0),c)}function rN(a,c){var h=ut;ut=h!==0&&4>h?h:4,a(!0);var g=qm.transition;qm.transition={};try{a(!1),c()}finally{ut=h,qm.transition=g}}function tk(){return vr().memoizedState}function oN(a,c,h){var g=Ts(a);if(h={lane:g,action:h,hasEagerState:!1,eagerState:null,next:null},nk(a))rk(c,h);else if(h=Ob(a,c,h,g),h!==null){var w=Rn();Fr(h,a,g,w),ok(h,c,g)}}function sN(a,c,h){var g=Ts(a),w={lane:g,action:h,hasEagerState:!1,eagerState:null,next:null};if(nk(a))rk(c,w);else{var S=a.alternate;if(a.lanes===0&&(S===null||S.lanes===0)&&(S=c.lastRenderedReducer,S!==null))try{var M=c.lastRenderedState,R=S(M,h);if(w.hasEagerState=!0,w.eagerState=R,Ir(R,M)){var L=c.interleaved;L===null?(w.next=w,$m(c)):(w.next=L.next,L.next=w),c.interleaved=w;return}}catch{}finally{}h=Ob(a,c,w,g),h!==null&&(w=Rn(),Fr(h,a,g,w),ok(h,c,g))}}function nk(a){var c=a.alternate;return a===Tt||c!==null&&c===Tt}function rk(a,c){Yl=wd=!0;var h=a.pending;h===null?c.next=c:(c.next=h.next,h.next=c),a.pending=c}function ok(a,c,h){if((h&4194240)!==0){var g=c.lanes;g&=a.pendingLanes,h|=g,c.lanes=h,tm(a,h)}}var Ed={readContext:xr,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},iN={readContext:xr,useCallback:function(a,c){return to().memoizedState=[a,c===void 0?null:c],a},useContext:xr,useEffect:Kb,useImperativeHandle:function(a,c,h){return h=h!=null?h.concat([a]):null,Cd(4194308,4,Zb.bind(null,c,a),h)},useLayoutEffect:function(a,c){return Cd(4194308,4,a,c)},useInsertionEffect:function(a,c){return Cd(4,2,a,c)},useMemo:function(a,c){var h=to();return c=c===void 0?null:c,a=a(),h.memoizedState=[a,c],a},useReducer:function(a,c,h){var g=to();return c=h!==void 0?h(c):c,g.memoizedState=g.baseState=c,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:c},g.queue=a,a=a.dispatch=oN.bind(null,Tt,a),[g.memoizedState,a]},useRef:function(a){var c=to();return a={current:a},c.memoizedState=a},useState:Wb,useDebugValue:Qm,useDeferredValue:function(a){return to().memoizedState=a},useTransition:function(){var a=Wb(!1),c=a[0];return a=rN.bind(null,a[1]),to().memoizedState=a,[c,a]},useMutableSource:function(){},useSyncExternalStore:function(a,c,h){var g=Tt,w=to();if(St){if(h===void 0)throw Error(n(407));h=h()}else{if(h=c(),rn===null)throw Error(n(349));(_i&30)!==0||$b(g,c,h)}w.memoizedState=h;var S={value:h,getSnapshot:c};return w.queue=S,Kb(Vb.bind(null,g,S,a),[a]),g.flags|=2048,eu(9,Bb.bind(null,g,S,h,c),void 0,null),h},useId:function(){var a=to(),c=rn.identifierPrefix;if(St){var h=Oo,g=Ro;h=(g&~(1<<32-Or(g)-1)).toString(32)+h,c=":"+c+"R"+h,h=Xl++,0<h&&(c+="H"+h.toString(32)),c+=":"}else h=nN++,c=":"+c+"r"+h.toString(32)+":";return a.memoizedState=c},unstable_isNewReconciler:!1},aN={readContext:xr,useCallback:Xb,useContext:xr,useEffect:Xm,useImperativeHandle:Yb,useInsertionEffect:Gb,useLayoutEffect:Jb,useMemo:Qb,useReducer:Zm,useRef:qb,useState:function(){return Zm(Ql)},useDebugValue:Qm,useDeferredValue:function(a){var c=vr();return ek(c,Kt.memoizedState,a)},useTransition:function(){var a=Zm(Ql)[0],c=vr().memoizedState;return[a,c]},useMutableSource:zb,useSyncExternalStore:Fb,useId:tk,unstable_isNewReconciler:!1},lN={readContext:xr,useCallback:Xb,useContext:xr,useEffect:Xm,useImperativeHandle:Yb,useInsertionEffect:Gb,useLayoutEffect:Jb,useMemo:Qb,useReducer:Ym,useRef:qb,useState:function(){return Ym(Ql)},useDebugValue:Qm,useDeferredValue:function(a){var c=vr();return Kt===null?c.memoizedState=a:ek(c,Kt.memoizedState,a)},useTransition:function(){var a=Ym(Ql)[0],c=vr().memoizedState;return[a,c]},useMutableSource:zb,useSyncExternalStore:Fb,useId:tk,unstable_isNewReconciler:!1};function jr(a,c){if(a&&a.defaultProps){c=z({},c),a=a.defaultProps;for(var h in a)c[h]===void 0&&(c[h]=a[h]);return c}return c}function e0(a,c,h,g){c=a.memoizedState,h=h(g,c),h=h==null?c:z({},c,h),a.memoizedState=h,a.lanes===0&&(a.updateQueue.baseState=h)}var _d={isMounted:function(a){return(a=a._reactInternals)?vi(a)===a:!1},enqueueSetState:function(a,c,h){a=a._reactInternals;var g=Rn(),w=Ts(a),S=Po(g,w);S.payload=c,h!=null&&(S.callback=h),c=Cs(a,S,w),c!==null&&(Fr(c,a,w,g),xd(c,a,w))},enqueueReplaceState:function(a,c,h){a=a._reactInternals;var g=Rn(),w=Ts(a),S=Po(g,w);S.tag=1,S.payload=c,h!=null&&(S.callback=h),c=Cs(a,S,w),c!==null&&(Fr(c,a,w,g),xd(c,a,w))},enqueueForceUpdate:function(a,c){a=a._reactInternals;var h=Rn(),g=Ts(a),w=Po(h,g);w.tag=2,c!=null&&(w.callback=c),c=Cs(a,w,g),c!==null&&(Fr(c,a,g,h),xd(c,a,g))}};function sk(a,c,h,g,w,S,M){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(g,S,M):c.prototype&&c.prototype.isPureReactComponent?!$l(h,g)||!$l(w,S):!0}function ik(a,c,h){var g=!1,w=bs,S=c.contextType;return typeof S=="object"&&S!==null?S=xr(S):(w=Un(c)?ki:kn.current,g=c.contextTypes,S=(g=g!=null)?Ea(a,w):bs),c=new c(h,S),a.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=_d,a.stateNode=c,c._reactInternals=a,g&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=w,a.__reactInternalMemoizedMaskedChildContext=S),c}function ak(a,c,h,g){a=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(h,g),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(h,g),c.state!==a&&_d.enqueueReplaceState(c,c.state,null)}function t0(a,c,h,g){var w=a.stateNode;w.props=h,w.state=a.memoizedState,w.refs={},Bm(a);var S=c.contextType;typeof S=="object"&&S!==null?w.context=xr(S):(S=Un(c)?ki:kn.current,w.context=Ea(a,S)),w.state=a.memoizedState,S=c.getDerivedStateFromProps,typeof S=="function"&&(e0(a,c,S,h),w.state=a.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(c=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),c!==w.state&&_d.enqueueReplaceState(w,w.state,null),vd(a,h,w,g),w.state=a.memoizedState),typeof w.componentDidMount=="function"&&(a.flags|=4194308)}function Oa(a,c){try{var h="",g=c;do h+=ue(g),g=g.return;while(g);var w=h}catch(S){w=`
39
- Error generating stack: `+S.message+`
40
- `+S.stack}return{value:a,source:c,stack:w,digest:null}}function n0(a,c,h){return{value:a,source:null,stack:h??null,digest:c??null}}function r0(a,c){try{console.error(c.value)}catch(h){setTimeout(function(){throw h})}}var uN=typeof WeakMap=="function"?WeakMap:Map;function lk(a,c,h){h=Po(-1,h),h.tag=3,h.payload={element:null};var g=c.value;return h.callback=function(){Od||(Od=!0,x0=g),r0(a,c)},h}function uk(a,c,h){h=Po(-1,h),h.tag=3;var g=a.type.getDerivedStateFromError;if(typeof g=="function"){var w=c.value;h.payload=function(){return g(w)},h.callback=function(){r0(a,c)}}var S=a.stateNode;return S!==null&&typeof S.componentDidCatch=="function"&&(h.callback=function(){r0(a,c),typeof g!="function"&&(Es===null?Es=new Set([this]):Es.add(this));var M=c.stack;this.componentDidCatch(c.value,{componentStack:M!==null?M:""})}),h}function ck(a,c,h){var g=a.pingCache;if(g===null){g=a.pingCache=new uN;var w=new Set;g.set(c,w)}else w=g.get(c),w===void 0&&(w=new Set,g.set(c,w));w.has(h)||(w.add(h),a=CN.bind(null,a,c,h),c.then(a,a))}function dk(a){do{var c;if((c=a.tag===13)&&(c=a.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return a;a=a.return}while(a!==null);return null}function fk(a,c,h,g,w){return(a.mode&1)===0?(a===c?a.flags|=65536:(a.flags|=128,h.flags|=131072,h.flags&=-52805,h.tag===1&&(h.alternate===null?h.tag=17:(c=Po(-1,1),c.tag=2,Cs(h,c,1))),h.lanes|=1),a):(a.flags|=65536,a.lanes=w,a)}var cN=A.ReactCurrentOwner,Wn=!1;function Dn(a,c,h,g){c.child=a===null?Rb(c,null,h,g):Aa(c,a.child,h,g)}function hk(a,c,h,g,w){h=h.render;var S=c.ref;return Da(c,w),g=Gm(a,c,h,g,S,w),h=Jm(),a!==null&&!Wn?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~w,jo(a,c,w)):(St&&h&&Dm(c),c.flags|=1,Dn(a,c,g,w),c.child)}function pk(a,c,h,g,w){if(a===null){var S=h.type;return typeof S=="function"&&!E0(S)&&S.defaultProps===void 0&&h.compare===null&&h.defaultProps===void 0?(c.tag=15,c.type=S,mk(a,c,S,g,w)):(a=Fd(h.type,null,g,c,c.mode,w),a.ref=c.ref,a.return=c,c.child=a)}if(S=a.child,(a.lanes&w)===0){var M=S.memoizedProps;if(h=h.compare,h=h!==null?h:$l,h(M,g)&&a.ref===c.ref)return jo(a,c,w)}return c.flags|=1,a=As(S,g),a.ref=c.ref,a.return=c,c.child=a}function mk(a,c,h,g,w){if(a!==null){var S=a.memoizedProps;if($l(S,g)&&a.ref===c.ref)if(Wn=!1,c.pendingProps=g=S,(a.lanes&w)!==0)(a.flags&131072)!==0&&(Wn=!0);else return c.lanes=a.lanes,jo(a,c,w)}return o0(a,c,h,g,w)}function gk(a,c,h){var g=c.pendingProps,w=g.children,S=a!==null?a.memoizedState:null;if(g.mode==="hidden")if((c.mode&1)===0)c.memoizedState={baseLanes:0,cachePool:null,transitions:null},gt(Pa,or),or|=h;else{if((h&1073741824)===0)return a=S!==null?S.baseLanes|h:h,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:a,cachePool:null,transitions:null},c.updateQueue=null,gt(Pa,or),or|=a,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},g=S!==null?S.baseLanes:h,gt(Pa,or),or|=g}else S!==null?(g=S.baseLanes|h,c.memoizedState=null):g=h,gt(Pa,or),or|=g;return Dn(a,c,w,h),c.child}function yk(a,c){var h=c.ref;(a===null&&h!==null||a!==null&&a.ref!==h)&&(c.flags|=512,c.flags|=2097152)}function o0(a,c,h,g,w){var S=Un(h)?ki:kn.current;return S=Ea(c,S),Da(c,w),h=Gm(a,c,h,g,S,w),g=Jm(),a!==null&&!Wn?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~w,jo(a,c,w)):(St&&g&&Dm(c),c.flags|=1,Dn(a,c,h,w),c.child)}function xk(a,c,h,g,w){if(Un(h)){var S=!0;cd(c)}else S=!1;if(Da(c,w),c.stateNode===null)Md(a,c),ik(c,h,g),t0(c,h,g,w),g=!0;else if(a===null){var M=c.stateNode,R=c.memoizedProps;M.props=R;var L=M.context,H=h.contextType;typeof H=="object"&&H!==null?H=xr(H):(H=Un(h)?ki:kn.current,H=Ea(c,H));var se=h.getDerivedStateFromProps,ie=typeof se=="function"||typeof M.getSnapshotBeforeUpdate=="function";ie||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(R!==g||L!==H)&&ak(c,M,g,H),ws=!1;var oe=c.memoizedState;M.state=oe,vd(c,g,M,w),L=c.memoizedState,R!==g||oe!==L||Hn.current||ws?(typeof se=="function"&&(e0(c,h,se,g),L=c.memoizedState),(R=ws||sk(c,h,R,g,oe,L,H))?(ie||typeof M.UNSAFE_componentWillMount!="function"&&typeof M.componentWillMount!="function"||(typeof M.componentWillMount=="function"&&M.componentWillMount(),typeof M.UNSAFE_componentWillMount=="function"&&M.UNSAFE_componentWillMount()),typeof M.componentDidMount=="function"&&(c.flags|=4194308)):(typeof M.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=g,c.memoizedState=L),M.props=g,M.state=L,M.context=H,g=R):(typeof M.componentDidMount=="function"&&(c.flags|=4194308),g=!1)}else{M=c.stateNode,Ib(a,c),R=c.memoizedProps,H=c.type===c.elementType?R:jr(c.type,R),M.props=H,ie=c.pendingProps,oe=M.context,L=h.contextType,typeof L=="object"&&L!==null?L=xr(L):(L=Un(h)?ki:kn.current,L=Ea(c,L));var me=h.getDerivedStateFromProps;(se=typeof me=="function"||typeof M.getSnapshotBeforeUpdate=="function")||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(R!==ie||oe!==L)&&ak(c,M,g,L),ws=!1,oe=c.memoizedState,M.state=oe,vd(c,g,M,w);var ke=c.memoizedState;R!==ie||oe!==ke||Hn.current||ws?(typeof me=="function"&&(e0(c,h,me,g),ke=c.memoizedState),(H=ws||sk(c,h,H,g,oe,ke,L)||!1)?(se||typeof M.UNSAFE_componentWillUpdate!="function"&&typeof M.componentWillUpdate!="function"||(typeof M.componentWillUpdate=="function"&&M.componentWillUpdate(g,ke,L),typeof M.UNSAFE_componentWillUpdate=="function"&&M.UNSAFE_componentWillUpdate(g,ke,L)),typeof M.componentDidUpdate=="function"&&(c.flags|=4),typeof M.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof M.componentDidUpdate!="function"||R===a.memoizedProps&&oe===a.memoizedState||(c.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||R===a.memoizedProps&&oe===a.memoizedState||(c.flags|=1024),c.memoizedProps=g,c.memoizedState=ke),M.props=g,M.state=ke,M.context=L,g=H):(typeof M.componentDidUpdate!="function"||R===a.memoizedProps&&oe===a.memoizedState||(c.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||R===a.memoizedProps&&oe===a.memoizedState||(c.flags|=1024),g=!1)}return s0(a,c,h,g,S,w)}function s0(a,c,h,g,w,S){yk(a,c);var M=(c.flags&128)!==0;if(!g&&!M)return w&&Cb(c,h,!1),jo(a,c,S);g=c.stateNode,cN.current=c;var R=M&&typeof h.getDerivedStateFromError!="function"?null:g.render();return c.flags|=1,a!==null&&M?(c.child=Aa(c,a.child,null,S),c.child=Aa(c,null,R,S)):Dn(a,c,R,S),c.memoizedState=g.state,w&&Cb(c,h,!0),c.child}function vk(a){var c=a.stateNode;c.pendingContext?kb(a,c.pendingContext,c.pendingContext!==c.context):c.context&&kb(a,c.context,!1),Vm(a,c.containerInfo)}function bk(a,c,h,g,w){return Ma(),Pm(w),c.flags|=256,Dn(a,c,h,g),c.child}var i0={dehydrated:null,treeContext:null,retryLane:0};function a0(a){return{baseLanes:a,cachePool:null,transitions:null}}function kk(a,c,h){var g=c.pendingProps,w=_t.current,S=!1,M=(c.flags&128)!==0,R;if((R=M)||(R=a!==null&&a.memoizedState===null?!1:(w&2)!==0),R?(S=!0,c.flags&=-129):(a===null||a.memoizedState!==null)&&(w|=1),gt(_t,w&1),a===null)return Im(c),a=c.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?((c.mode&1)===0?c.lanes=1:a.data==="$!"?c.lanes=8:c.lanes=1073741824,null):(M=g.children,a=g.fallback,S?(g=c.mode,S=c.child,M={mode:"hidden",children:M},(g&1)===0&&S!==null?(S.childLanes=0,S.pendingProps=M):S=$d(M,g,0,null),a=Di(a,g,h,null),S.return=c,a.return=c,S.sibling=a,c.child=S,c.child.memoizedState=a0(h),c.memoizedState=i0,a):l0(c,M));if(w=a.memoizedState,w!==null&&(R=w.dehydrated,R!==null))return dN(a,c,M,g,R,w,h);if(S){S=g.fallback,M=c.mode,w=a.child,R=w.sibling;var L={mode:"hidden",children:g.children};return(M&1)===0&&c.child!==w?(g=c.child,g.childLanes=0,g.pendingProps=L,c.deletions=null):(g=As(w,L),g.subtreeFlags=w.subtreeFlags&14680064),R!==null?S=As(R,S):(S=Di(S,M,h,null),S.flags|=2),S.return=c,g.return=c,g.sibling=S,c.child=g,g=S,S=c.child,M=a.child.memoizedState,M=M===null?a0(h):{baseLanes:M.baseLanes|h,cachePool:null,transitions:M.transitions},S.memoizedState=M,S.childLanes=a.childLanes&~h,c.memoizedState=i0,g}return S=a.child,a=S.sibling,g=As(S,{mode:"visible",children:g.children}),(c.mode&1)===0&&(g.lanes=h),g.return=c,g.sibling=null,a!==null&&(h=c.deletions,h===null?(c.deletions=[a],c.flags|=16):h.push(a)),c.child=g,c.memoizedState=null,g}function l0(a,c){return c=$d({mode:"visible",children:c},a.mode,0,null),c.return=a,a.child=c}function Td(a,c,h,g){return g!==null&&Pm(g),Aa(c,a.child,null,h),a=l0(c,c.pendingProps.children),a.flags|=2,c.memoizedState=null,a}function dN(a,c,h,g,w,S,M){if(h)return c.flags&256?(c.flags&=-257,g=n0(Error(n(422))),Td(a,c,M,g)):c.memoizedState!==null?(c.child=a.child,c.flags|=128,null):(S=g.fallback,w=c.mode,g=$d({mode:"visible",children:g.children},w,0,null),S=Di(S,w,M,null),S.flags|=2,g.return=c,S.return=c,g.sibling=S,c.child=g,(c.mode&1)!==0&&Aa(c,a.child,null,M),c.child.memoizedState=a0(M),c.memoizedState=i0,S);if((c.mode&1)===0)return Td(a,c,M,null);if(w.data==="$!"){if(g=w.nextSibling&&w.nextSibling.dataset,g)var R=g.dgst;return g=R,S=Error(n(419)),g=n0(S,g,void 0),Td(a,c,M,g)}if(R=(M&a.childLanes)!==0,Wn||R){if(g=rn,g!==null){switch(M&-M){case 4:w=2;break;case 16:w=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:w=32;break;case 536870912:w=268435456;break;default:w=0}w=(w&(g.suspendedLanes|M))!==0?0:w,w!==0&&w!==S.retryLane&&(S.retryLane=w,Io(a,w),Fr(g,a,w,-1))}return S0(),g=n0(Error(n(421))),Td(a,c,M,g)}return w.data==="$?"?(c.flags|=128,c.child=a.child,c=SN.bind(null,a),w._reactRetry=c,null):(a=S.treeContext,rr=xs(w.nextSibling),nr=c,St=!0,Pr=null,a!==null&&(gr[yr++]=Ro,gr[yr++]=Oo,gr[yr++]=wi,Ro=a.id,Oo=a.overflow,wi=c),c=l0(c,g.children),c.flags|=4096,c)}function wk(a,c,h){a.lanes|=c;var g=a.alternate;g!==null&&(g.lanes|=c),Fm(a.return,c,h)}function u0(a,c,h,g,w){var S=a.memoizedState;S===null?a.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:g,tail:h,tailMode:w}:(S.isBackwards=c,S.rendering=null,S.renderingStartTime=0,S.last=g,S.tail=h,S.tailMode=w)}function Ck(a,c,h){var g=c.pendingProps,w=g.revealOrder,S=g.tail;if(Dn(a,c,g.children,h),g=_t.current,(g&2)!==0)g=g&1|2,c.flags|=128;else{if(a!==null&&(a.flags&128)!==0)e:for(a=c.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&wk(a,h,c);else if(a.tag===19)wk(a,h,c);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===c)break e;for(;a.sibling===null;){if(a.return===null||a.return===c)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}g&=1}if(gt(_t,g),(c.mode&1)===0)c.memoizedState=null;else switch(w){case"forwards":for(h=c.child,w=null;h!==null;)a=h.alternate,a!==null&&bd(a)===null&&(w=h),h=h.sibling;h=w,h===null?(w=c.child,c.child=null):(w=h.sibling,h.sibling=null),u0(c,!1,w,h,S);break;case"backwards":for(h=null,w=c.child,c.child=null;w!==null;){if(a=w.alternate,a!==null&&bd(a)===null){c.child=w;break}a=w.sibling,w.sibling=h,h=w,w=a}u0(c,!0,h,null,S);break;case"together":u0(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function Md(a,c){(c.mode&1)===0&&a!==null&&(a.alternate=null,c.alternate=null,c.flags|=2)}function jo(a,c,h){if(a!==null&&(c.dependencies=a.dependencies),Ti|=c.lanes,(h&c.childLanes)===0)return null;if(a!==null&&c.child!==a.child)throw Error(n(153));if(c.child!==null){for(a=c.child,h=As(a,a.pendingProps),c.child=h,h.return=c;a.sibling!==null;)a=a.sibling,h=h.sibling=As(a,a.pendingProps),h.return=c;h.sibling=null}return c.child}function fN(a,c,h){switch(c.tag){case 3:vk(c),Ma();break;case 5:Lb(c);break;case 1:Un(c.type)&&cd(c);break;case 4:Vm(c,c.stateNode.containerInfo);break;case 10:var g=c.type._context,w=c.memoizedProps.value;gt(gd,g._currentValue),g._currentValue=w;break;case 13:if(g=c.memoizedState,g!==null)return g.dehydrated!==null?(gt(_t,_t.current&1),c.flags|=128,null):(h&c.child.childLanes)!==0?kk(a,c,h):(gt(_t,_t.current&1),a=jo(a,c,h),a!==null?a.sibling:null);gt(_t,_t.current&1);break;case 19:if(g=(h&c.childLanes)!==0,(a.flags&128)!==0){if(g)return Ck(a,c,h);c.flags|=128}if(w=c.memoizedState,w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),gt(_t,_t.current),g)break;return null;case 22:case 23:return c.lanes=0,gk(a,c,h)}return jo(a,c,h)}var Sk,c0,Ek,_k;Sk=function(a,c){for(var h=c.child;h!==null;){if(h.tag===5||h.tag===6)a.appendChild(h.stateNode);else if(h.tag!==4&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===c)break;for(;h.sibling===null;){if(h.return===null||h.return===c)return;h=h.return}h.sibling.return=h.return,h=h.sibling}},c0=function(){},Ek=function(a,c,h,g){var w=a.memoizedProps;if(w!==g){a=c.stateNode,Ei(eo.current);var S=null;switch(h){case"input":w=Ze(a,w),g=Ze(a,g),S=[];break;case"select":w=z({},w,{value:void 0}),g=z({},g,{value:void 0}),S=[];break;case"textarea":w=ht(a,w),g=ht(a,g),S=[];break;default:typeof w.onClick!="function"&&typeof g.onClick=="function"&&(a.onclick=ad)}Mo(h,g);var M;h=null;for(H in w)if(!g.hasOwnProperty(H)&&w.hasOwnProperty(H)&&w[H]!=null)if(H==="style"){var R=w[H];for(M in R)R.hasOwnProperty(M)&&(h||(h={}),h[M]="")}else H!=="dangerouslySetInnerHTML"&&H!=="children"&&H!=="suppressContentEditableWarning"&&H!=="suppressHydrationWarning"&&H!=="autoFocus"&&(o.hasOwnProperty(H)?S||(S=[]):(S=S||[]).push(H,null));for(H in g){var L=g[H];if(R=w!=null?w[H]:void 0,g.hasOwnProperty(H)&&L!==R&&(L!=null||R!=null))if(H==="style")if(R){for(M in R)!R.hasOwnProperty(M)||L&&L.hasOwnProperty(M)||(h||(h={}),h[M]="");for(M in L)L.hasOwnProperty(M)&&R[M]!==L[M]&&(h||(h={}),h[M]=L[M])}else h||(S||(S=[]),S.push(H,h)),h=L;else H==="dangerouslySetInnerHTML"?(L=L?L.__html:void 0,R=R?R.__html:void 0,L!=null&&R!==L&&(S=S||[]).push(H,L)):H==="children"?typeof L!="string"&&typeof L!="number"||(S=S||[]).push(H,""+L):H!=="suppressContentEditableWarning"&&H!=="suppressHydrationWarning"&&(o.hasOwnProperty(H)?(L!=null&&H==="onScroll"&&vt("scroll",a),S||R===L||(S=[])):(S=S||[]).push(H,L))}h&&(S=S||[]).push("style",h);var H=S;(c.updateQueue=H)&&(c.flags|=4)}},_k=function(a,c,h,g){h!==g&&(c.flags|=4)};function tu(a,c){if(!St)switch(a.tailMode){case"hidden":c=a.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?a.tail=null:h.sibling=null;break;case"collapsed":h=a.tail;for(var g=null;h!==null;)h.alternate!==null&&(g=h),h=h.sibling;g===null?c||a.tail===null?a.tail=null:a.tail.sibling=null:g.sibling=null}}function Cn(a){var c=a.alternate!==null&&a.alternate.child===a.child,h=0,g=0;if(c)for(var w=a.child;w!==null;)h|=w.lanes|w.childLanes,g|=w.subtreeFlags&14680064,g|=w.flags&14680064,w.return=a,w=w.sibling;else for(w=a.child;w!==null;)h|=w.lanes|w.childLanes,g|=w.subtreeFlags,g|=w.flags,w.return=a,w=w.sibling;return a.subtreeFlags|=g,a.childLanes=h,c}function hN(a,c,h){var g=c.pendingProps;switch(Rm(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Cn(c),null;case 1:return Un(c.type)&&ud(),Cn(c),null;case 3:return g=c.stateNode,Ra(),bt(Hn),bt(kn),Wm(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(a===null||a.child===null)&&(pd(c)?c.flags|=4:a===null||a.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,Pr!==null&&(k0(Pr),Pr=null))),c0(a,c),Cn(c),null;case 5:Hm(c);var w=Ei(Zl.current);if(h=c.type,a!==null&&c.stateNode!=null)Ek(a,c,h,g,w),a.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!g){if(c.stateNode===null)throw Error(n(166));return Cn(c),null}if(a=Ei(eo.current),pd(c)){g=c.stateNode,h=c.type;var S=c.memoizedProps;switch(g[Qr]=c,g[Wl]=S,a=(c.mode&1)!==0,h){case"dialog":vt("cancel",g),vt("close",g);break;case"iframe":case"object":case"embed":vt("load",g);break;case"video":case"audio":for(w=0;w<Vl.length;w++)vt(Vl[w],g);break;case"source":vt("error",g);break;case"img":case"image":case"link":vt("error",g),vt("load",g);break;case"details":vt("toggle",g);break;case"input":Mt(g,S),vt("invalid",g);break;case"select":g._wrapperState={wasMultiple:!!S.multiple},vt("invalid",g);break;case"textarea":hr(g,S),vt("invalid",g)}Mo(h,S),w=null;for(var M in S)if(S.hasOwnProperty(M)){var R=S[M];M==="children"?typeof R=="string"?g.textContent!==R&&(S.suppressHydrationWarning!==!0&&id(g.textContent,R,a),w=["children",R]):typeof R=="number"&&g.textContent!==""+R&&(S.suppressHydrationWarning!==!0&&id(g.textContent,R,a),w=["children",""+R]):o.hasOwnProperty(M)&&R!=null&&M==="onScroll"&&vt("scroll",g)}switch(h){case"input":Le(g),zn(g,S,!0);break;case"textarea":Le(g),ha(g);break;case"select":case"option":break;default:typeof S.onClick=="function"&&(g.onclick=ad)}g=w,c.updateQueue=g,g!==null&&(c.flags|=4)}else{M=w.nodeType===9?w:w.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=To(h)),a==="http://www.w3.org/1999/xhtml"?h==="script"?(a=M.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof g.is=="string"?a=M.createElement(h,{is:g.is}):(a=M.createElement(h),h==="select"&&(M=a,g.multiple?M.multiple=!0:g.size&&(M.size=g.size))):a=M.createElementNS(a,h),a[Qr]=c,a[Wl]=g,Sk(a,c,!1,!1),c.stateNode=a;e:{switch(M=yi(h,g),h){case"dialog":vt("cancel",a),vt("close",a),w=g;break;case"iframe":case"object":case"embed":vt("load",a),w=g;break;case"video":case"audio":for(w=0;w<Vl.length;w++)vt(Vl[w],a);w=g;break;case"source":vt("error",a),w=g;break;case"img":case"image":case"link":vt("error",a),vt("load",a),w=g;break;case"details":vt("toggle",a),w=g;break;case"input":Mt(a,g),w=Ze(a,g),vt("invalid",a);break;case"option":w=g;break;case"select":a._wrapperState={wasMultiple:!!g.multiple},w=z({},g,{value:void 0}),vt("invalid",a);break;case"textarea":hr(a,g),w=ht(a,g),vt("invalid",a);break;default:w=g}Mo(h,w),R=w;for(S in R)if(R.hasOwnProperty(S)){var L=R[S];S==="style"?ma(a,L):S==="dangerouslySetInnerHTML"?(L=L?L.__html:void 0,L!=null&&mr(a,L)):S==="children"?typeof L=="string"?(h!=="textarea"||L!=="")&&Nn(a,L):typeof L=="number"&&Nn(a,""+L):S!=="suppressContentEditableWarning"&&S!=="suppressHydrationWarning"&&S!=="autoFocus"&&(o.hasOwnProperty(S)?L!=null&&S==="onScroll"&&vt("scroll",a):L!=null&&T(a,S,L,M))}switch(h){case"input":Le(a),zn(a,g,!1);break;case"textarea":Le(a),ha(a);break;case"option":g.value!=null&&a.setAttribute("value",""+X(g.value));break;case"select":a.multiple=!!g.multiple,S=g.value,S!=null?An(a,!!g.multiple,S,!1):g.defaultValue!=null&&An(a,!!g.multiple,g.defaultValue,!0);break;default:typeof w.onClick=="function"&&(a.onclick=ad)}switch(h){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}}g&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return Cn(c),null;case 6:if(a&&c.stateNode!=null)_k(a,c,a.memoizedProps,g);else{if(typeof g!="string"&&c.stateNode===null)throw Error(n(166));if(h=Ei(Zl.current),Ei(eo.current),pd(c)){if(g=c.stateNode,h=c.memoizedProps,g[Qr]=c,(S=g.nodeValue!==h)&&(a=nr,a!==null))switch(a.tag){case 3:id(g.nodeValue,h,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&id(g.nodeValue,h,(a.mode&1)!==0)}S&&(c.flags|=4)}else g=(h.nodeType===9?h:h.ownerDocument).createTextNode(g),g[Qr]=c,c.stateNode=g}return Cn(c),null;case 13:if(bt(_t),g=c.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(St&&rr!==null&&(c.mode&1)!==0&&(c.flags&128)===0)Ab(),Ma(),c.flags|=98560,S=!1;else if(S=pd(c),g!==null&&g.dehydrated!==null){if(a===null){if(!S)throw Error(n(318));if(S=c.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(n(317));S[Qr]=c}else Ma(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Cn(c),S=!1}else Pr!==null&&(k0(Pr),Pr=null),S=!0;if(!S)return c.flags&65536?c:null}return(c.flags&128)!==0?(c.lanes=h,c):(g=g!==null,g!==(a!==null&&a.memoizedState!==null)&&g&&(c.child.flags|=8192,(c.mode&1)!==0&&(a===null||(_t.current&1)!==0?Gt===0&&(Gt=3):S0())),c.updateQueue!==null&&(c.flags|=4),Cn(c),null);case 4:return Ra(),c0(a,c),a===null&&Hl(c.stateNode.containerInfo),Cn(c),null;case 10:return zm(c.type._context),Cn(c),null;case 17:return Un(c.type)&&ud(),Cn(c),null;case 19:if(bt(_t),S=c.memoizedState,S===null)return Cn(c),null;if(g=(c.flags&128)!==0,M=S.rendering,M===null)if(g)tu(S,!1);else{if(Gt!==0||a!==null&&(a.flags&128)!==0)for(a=c.child;a!==null;){if(M=bd(a),M!==null){for(c.flags|=128,tu(S,!1),g=M.updateQueue,g!==null&&(c.updateQueue=g,c.flags|=4),c.subtreeFlags=0,g=h,h=c.child;h!==null;)S=h,a=g,S.flags&=14680066,M=S.alternate,M===null?(S.childLanes=0,S.lanes=a,S.child=null,S.subtreeFlags=0,S.memoizedProps=null,S.memoizedState=null,S.updateQueue=null,S.dependencies=null,S.stateNode=null):(S.childLanes=M.childLanes,S.lanes=M.lanes,S.child=M.child,S.subtreeFlags=0,S.deletions=null,S.memoizedProps=M.memoizedProps,S.memoizedState=M.memoizedState,S.updateQueue=M.updateQueue,S.type=M.type,a=M.dependencies,S.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),h=h.sibling;return gt(_t,_t.current&1|2),c.child}a=a.sibling}S.tail!==null&&Ot()>ja&&(c.flags|=128,g=!0,tu(S,!1),c.lanes=4194304)}else{if(!g)if(a=bd(M),a!==null){if(c.flags|=128,g=!0,h=a.updateQueue,h!==null&&(c.updateQueue=h,c.flags|=4),tu(S,!0),S.tail===null&&S.tailMode==="hidden"&&!M.alternate&&!St)return Cn(c),null}else 2*Ot()-S.renderingStartTime>ja&&h!==1073741824&&(c.flags|=128,g=!0,tu(S,!1),c.lanes=4194304);S.isBackwards?(M.sibling=c.child,c.child=M):(h=S.last,h!==null?h.sibling=M:c.child=M,S.last=M)}return S.tail!==null?(c=S.tail,S.rendering=c,S.tail=c.sibling,S.renderingStartTime=Ot(),c.sibling=null,h=_t.current,gt(_t,g?h&1|2:h&1),c):(Cn(c),null);case 22:case 23:return C0(),g=c.memoizedState!==null,a!==null&&a.memoizedState!==null!==g&&(c.flags|=8192),g&&(c.mode&1)!==0?(or&1073741824)!==0&&(Cn(c),c.subtreeFlags&6&&(c.flags|=8192)):Cn(c),null;case 24:return null;case 25:return null}throw Error(n(156,c.tag))}function pN(a,c){switch(Rm(c),c.tag){case 1:return Un(c.type)&&ud(),a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 3:return Ra(),bt(Hn),bt(kn),Wm(),a=c.flags,(a&65536)!==0&&(a&128)===0?(c.flags=a&-65537|128,c):null;case 5:return Hm(c),null;case 13:if(bt(_t),a=c.memoizedState,a!==null&&a.dehydrated!==null){if(c.alternate===null)throw Error(n(340));Ma()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 19:return bt(_t),null;case 4:return Ra(),null;case 10:return zm(c.type._context),null;case 22:case 23:return C0(),null;case 24:return null;default:return null}}var Ad=!1,Sn=!1,mN=typeof WeakSet=="function"?WeakSet:Set,ve=null;function Ia(a,c){var h=a.ref;if(h!==null)if(typeof h=="function")try{h(null)}catch(g){At(a,c,g)}else h.current=null}function d0(a,c,h){try{h()}catch(g){At(a,c,g)}}var Tk=!1;function gN(a,c){if(Cm=Jc,a=sb(),mm(a)){if("selectionStart"in a)var h={start:a.selectionStart,end:a.selectionEnd};else e:{h=(h=a.ownerDocument)&&h.defaultView||window;var g=h.getSelection&&h.getSelection();if(g&&g.rangeCount!==0){h=g.anchorNode;var w=g.anchorOffset,S=g.focusNode;g=g.focusOffset;try{h.nodeType,S.nodeType}catch{h=null;break e}var M=0,R=-1,L=-1,H=0,se=0,ie=a,oe=null;t:for(;;){for(var me;ie!==h||w!==0&&ie.nodeType!==3||(R=M+w),ie!==S||g!==0&&ie.nodeType!==3||(L=M+g),ie.nodeType===3&&(M+=ie.nodeValue.length),(me=ie.firstChild)!==null;)oe=ie,ie=me;for(;;){if(ie===a)break t;if(oe===h&&++H===w&&(R=M),oe===S&&++se===g&&(L=M),(me=ie.nextSibling)!==null)break;ie=oe,oe=ie.parentNode}ie=me}h=R===-1||L===-1?null:{start:R,end:L}}else h=null}h=h||{start:0,end:0}}else h=null;for(Sm={focusedElem:a,selectionRange:h},Jc=!1,ve=c;ve!==null;)if(c=ve,a=c.child,(c.subtreeFlags&1028)!==0&&a!==null)a.return=c,ve=a;else for(;ve!==null;){c=ve;try{var ke=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(ke!==null){var we=ke.memoizedProps,It=ke.memoizedState,$=c.stateNode,F=$.getSnapshotBeforeUpdate(c.elementType===c.type?we:jr(c.type,we),It);$.__reactInternalSnapshotBeforeUpdate=F}break;case 3:var V=c.stateNode.containerInfo;V.nodeType===1?V.textContent="":V.nodeType===9&&V.documentElement&&V.removeChild(V.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(de){At(c,c.return,de)}if(a=c.sibling,a!==null){a.return=c.return,ve=a;break}ve=c.return}return ke=Tk,Tk=!1,ke}function nu(a,c,h){var g=c.updateQueue;if(g=g!==null?g.lastEffect:null,g!==null){var w=g=g.next;do{if((w.tag&a)===a){var S=w.destroy;w.destroy=void 0,S!==void 0&&d0(c,h,S)}w=w.next}while(w!==g)}}function Nd(a,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var h=c=c.next;do{if((h.tag&a)===a){var g=h.create;h.destroy=g()}h=h.next}while(h!==c)}}function f0(a){var c=a.ref;if(c!==null){var h=a.stateNode;switch(a.tag){case 5:a=h;break;default:a=h}typeof c=="function"?c(a):c.current=a}}function Mk(a){var c=a.alternate;c!==null&&(a.alternate=null,Mk(c)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(c=a.stateNode,c!==null&&(delete c[Qr],delete c[Wl],delete c[Mm],delete c[XA],delete c[QA])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function Ak(a){return a.tag===5||a.tag===3||a.tag===4}function Nk(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Ak(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function h0(a,c,h){var g=a.tag;if(g===5||g===6)a=a.stateNode,c?h.nodeType===8?h.parentNode.insertBefore(a,c):h.insertBefore(a,c):(h.nodeType===8?(c=h.parentNode,c.insertBefore(a,h)):(c=h,c.appendChild(a)),h=h._reactRootContainer,h!=null||c.onclick!==null||(c.onclick=ad));else if(g!==4&&(a=a.child,a!==null))for(h0(a,c,h),a=a.sibling;a!==null;)h0(a,c,h),a=a.sibling}function p0(a,c,h){var g=a.tag;if(g===5||g===6)a=a.stateNode,c?h.insertBefore(a,c):h.appendChild(a);else if(g!==4&&(a=a.child,a!==null))for(p0(a,c,h),a=a.sibling;a!==null;)p0(a,c,h),a=a.sibling}var mn=null,Lr=!1;function Ss(a,c,h){for(h=h.child;h!==null;)Dk(a,c,h),h=h.sibling}function Dk(a,c,h){if(Xr&&typeof Xr.onCommitFiberUnmount=="function")try{Xr.onCommitFiberUnmount(Hc,h)}catch{}switch(h.tag){case 5:Sn||Ia(h,c);case 6:var g=mn,w=Lr;mn=null,Ss(a,c,h),mn=g,Lr=w,mn!==null&&(Lr?(a=mn,h=h.stateNode,a.nodeType===8?a.parentNode.removeChild(h):a.removeChild(h)):mn.removeChild(h.stateNode));break;case 18:mn!==null&&(Lr?(a=mn,h=h.stateNode,a.nodeType===8?Tm(a.parentNode,h):a.nodeType===1&&Tm(a,h),Il(a)):Tm(mn,h.stateNode));break;case 4:g=mn,w=Lr,mn=h.stateNode.containerInfo,Lr=!0,Ss(a,c,h),mn=g,Lr=w;break;case 0:case 11:case 14:case 15:if(!Sn&&(g=h.updateQueue,g!==null&&(g=g.lastEffect,g!==null))){w=g=g.next;do{var S=w,M=S.destroy;S=S.tag,M!==void 0&&((S&2)!==0||(S&4)!==0)&&d0(h,c,M),w=w.next}while(w!==g)}Ss(a,c,h);break;case 1:if(!Sn&&(Ia(h,c),g=h.stateNode,typeof g.componentWillUnmount=="function"))try{g.props=h.memoizedProps,g.state=h.memoizedState,g.componentWillUnmount()}catch(R){At(h,c,R)}Ss(a,c,h);break;case 21:Ss(a,c,h);break;case 22:h.mode&1?(Sn=(g=Sn)||h.memoizedState!==null,Ss(a,c,h),Sn=g):Ss(a,c,h);break;default:Ss(a,c,h)}}function Rk(a){var c=a.updateQueue;if(c!==null){a.updateQueue=null;var h=a.stateNode;h===null&&(h=a.stateNode=new mN),c.forEach(function(g){var w=EN.bind(null,a,g);h.has(g)||(h.add(g),g.then(w,w))})}}function zr(a,c){var h=c.deletions;if(h!==null)for(var g=0;g<h.length;g++){var w=h[g];try{var S=a,M=c,R=M;e:for(;R!==null;){switch(R.tag){case 5:mn=R.stateNode,Lr=!1;break e;case 3:mn=R.stateNode.containerInfo,Lr=!0;break e;case 4:mn=R.stateNode.containerInfo,Lr=!0;break e}R=R.return}if(mn===null)throw Error(n(160));Dk(S,M,w),mn=null,Lr=!1;var L=w.alternate;L!==null&&(L.return=null),w.return=null}catch(H){At(w,c,H)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)Ok(c,a),c=c.sibling}function Ok(a,c){var h=a.alternate,g=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(zr(c,a),no(a),g&4){try{nu(3,a,a.return),Nd(3,a)}catch(we){At(a,a.return,we)}try{nu(5,a,a.return)}catch(we){At(a,a.return,we)}}break;case 1:zr(c,a),no(a),g&512&&h!==null&&Ia(h,h.return);break;case 5:if(zr(c,a),no(a),g&512&&h!==null&&Ia(h,h.return),a.flags&32){var w=a.stateNode;try{Nn(w,"")}catch(we){At(a,a.return,we)}}if(g&4&&(w=a.stateNode,w!=null)){var S=a.memoizedProps,M=h!==null?h.memoizedProps:S,R=a.type,L=a.updateQueue;if(a.updateQueue=null,L!==null)try{R==="input"&&S.type==="radio"&&S.name!=null&&Pt(w,S),yi(R,M);var H=yi(R,S);for(M=0;M<L.length;M+=2){var se=L[M],ie=L[M+1];se==="style"?ma(w,ie):se==="dangerouslySetInnerHTML"?mr(w,ie):se==="children"?Nn(w,ie):T(w,se,ie,H)}switch(R){case"input":Ht(w,S);break;case"textarea":gi(w,S);break;case"select":var oe=w._wrapperState.wasMultiple;w._wrapperState.wasMultiple=!!S.multiple;var me=S.value;me!=null?An(w,!!S.multiple,me,!1):oe!==!!S.multiple&&(S.defaultValue!=null?An(w,!!S.multiple,S.defaultValue,!0):An(w,!!S.multiple,S.multiple?[]:"",!1))}w[Wl]=S}catch(we){At(a,a.return,we)}}break;case 6:if(zr(c,a),no(a),g&4){if(a.stateNode===null)throw Error(n(162));w=a.stateNode,S=a.memoizedProps;try{w.nodeValue=S}catch(we){At(a,a.return,we)}}break;case 3:if(zr(c,a),no(a),g&4&&h!==null&&h.memoizedState.isDehydrated)try{Il(c.containerInfo)}catch(we){At(a,a.return,we)}break;case 4:zr(c,a),no(a);break;case 13:zr(c,a),no(a),w=a.child,w.flags&8192&&(S=w.memoizedState!==null,w.stateNode.isHidden=S,!S||w.alternate!==null&&w.alternate.memoizedState!==null||(y0=Ot())),g&4&&Rk(a);break;case 22:if(se=h!==null&&h.memoizedState!==null,a.mode&1?(Sn=(H=Sn)||se,zr(c,a),Sn=H):zr(c,a),no(a),g&8192){if(H=a.memoizedState!==null,(a.stateNode.isHidden=H)&&!se&&(a.mode&1)!==0)for(ve=a,se=a.child;se!==null;){for(ie=ve=se;ve!==null;){switch(oe=ve,me=oe.child,oe.tag){case 0:case 11:case 14:case 15:nu(4,oe,oe.return);break;case 1:Ia(oe,oe.return);var ke=oe.stateNode;if(typeof ke.componentWillUnmount=="function"){g=oe,h=oe.return;try{c=g,ke.props=c.memoizedProps,ke.state=c.memoizedState,ke.componentWillUnmount()}catch(we){At(g,h,we)}}break;case 5:Ia(oe,oe.return);break;case 22:if(oe.memoizedState!==null){jk(ie);continue}}me!==null?(me.return=oe,ve=me):jk(ie)}se=se.sibling}e:for(se=null,ie=a;;){if(ie.tag===5){if(se===null){se=ie;try{w=ie.stateNode,H?(S=w.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none"):(R=ie.stateNode,L=ie.memoizedProps.style,M=L!=null&&L.hasOwnProperty("display")?L.display:null,R.style.display=pa("display",M))}catch(we){At(a,a.return,we)}}}else if(ie.tag===6){if(se===null)try{ie.stateNode.nodeValue=H?"":ie.memoizedProps}catch(we){At(a,a.return,we)}}else if((ie.tag!==22&&ie.tag!==23||ie.memoizedState===null||ie===a)&&ie.child!==null){ie.child.return=ie,ie=ie.child;continue}if(ie===a)break e;for(;ie.sibling===null;){if(ie.return===null||ie.return===a)break e;se===ie&&(se=null),ie=ie.return}se===ie&&(se=null),ie.sibling.return=ie.return,ie=ie.sibling}}break;case 19:zr(c,a),no(a),g&4&&Rk(a);break;case 21:break;default:zr(c,a),no(a)}}function no(a){var c=a.flags;if(c&2){try{e:{for(var h=a.return;h!==null;){if(Ak(h)){var g=h;break e}h=h.return}throw Error(n(160))}switch(g.tag){case 5:var w=g.stateNode;g.flags&32&&(Nn(w,""),g.flags&=-33);var S=Nk(a);p0(a,S,w);break;case 3:case 4:var M=g.stateNode.containerInfo,R=Nk(a);h0(a,R,M);break;default:throw Error(n(161))}}catch(L){At(a,a.return,L)}a.flags&=-3}c&4096&&(a.flags&=-4097)}function yN(a,c,h){ve=a,Ik(a)}function Ik(a,c,h){for(var g=(a.mode&1)!==0;ve!==null;){var w=ve,S=w.child;if(w.tag===22&&g){var M=w.memoizedState!==null||Ad;if(!M){var R=w.alternate,L=R!==null&&R.memoizedState!==null||Sn;R=Ad;var H=Sn;if(Ad=M,(Sn=L)&&!H)for(ve=w;ve!==null;)M=ve,L=M.child,M.tag===22&&M.memoizedState!==null?Lk(w):L!==null?(L.return=M,ve=L):Lk(w);for(;S!==null;)ve=S,Ik(S),S=S.sibling;ve=w,Ad=R,Sn=H}Pk(a)}else(w.subtreeFlags&8772)!==0&&S!==null?(S.return=w,ve=S):Pk(a)}}function Pk(a){for(;ve!==null;){var c=ve;if((c.flags&8772)!==0){var h=c.alternate;try{if((c.flags&8772)!==0)switch(c.tag){case 0:case 11:case 15:Sn||Nd(5,c);break;case 1:var g=c.stateNode;if(c.flags&4&&!Sn)if(h===null)g.componentDidMount();else{var w=c.elementType===c.type?h.memoizedProps:jr(c.type,h.memoizedProps);g.componentDidUpdate(w,h.memoizedState,g.__reactInternalSnapshotBeforeUpdate)}var S=c.updateQueue;S!==null&&jb(c,S,g);break;case 3:var M=c.updateQueue;if(M!==null){if(h=null,c.child!==null)switch(c.child.tag){case 5:h=c.child.stateNode;break;case 1:h=c.child.stateNode}jb(c,M,h)}break;case 5:var R=c.stateNode;if(h===null&&c.flags&4){h=R;var L=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":L.autoFocus&&h.focus();break;case"img":L.src&&(h.src=L.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var H=c.alternate;if(H!==null){var se=H.memoizedState;if(se!==null){var ie=se.dehydrated;ie!==null&&Il(ie)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Sn||c.flags&512&&f0(c)}catch(oe){At(c,c.return,oe)}}if(c===a){ve=null;break}if(h=c.sibling,h!==null){h.return=c.return,ve=h;break}ve=c.return}}function jk(a){for(;ve!==null;){var c=ve;if(c===a){ve=null;break}var h=c.sibling;if(h!==null){h.return=c.return,ve=h;break}ve=c.return}}function Lk(a){for(;ve!==null;){var c=ve;try{switch(c.tag){case 0:case 11:case 15:var h=c.return;try{Nd(4,c)}catch(L){At(c,h,L)}break;case 1:var g=c.stateNode;if(typeof g.componentDidMount=="function"){var w=c.return;try{g.componentDidMount()}catch(L){At(c,w,L)}}var S=c.return;try{f0(c)}catch(L){At(c,S,L)}break;case 5:var M=c.return;try{f0(c)}catch(L){At(c,M,L)}}}catch(L){At(c,c.return,L)}if(c===a){ve=null;break}var R=c.sibling;if(R!==null){R.return=c.return,ve=R;break}ve=c.return}}var xN=Math.ceil,Dd=A.ReactCurrentDispatcher,m0=A.ReactCurrentOwner,br=A.ReactCurrentBatchConfig,Ye=0,rn=null,jt=null,gn=0,or=0,Pa=vs(0),Gt=0,ru=null,Ti=0,Rd=0,g0=0,ou=null,qn=null,y0=0,ja=1/0,Lo=null,Od=!1,x0=null,Es=null,Id=!1,_s=null,Pd=0,su=0,v0=null,jd=-1,Ld=0;function Rn(){return(Ye&6)!==0?Ot():jd!==-1?jd:jd=Ot()}function Ts(a){return(a.mode&1)===0?1:(Ye&2)!==0&&gn!==0?gn&-gn:tN.transition!==null?(Ld===0&&(Ld=Nv()),Ld):(a=ut,a!==0||(a=window.event,a=a===void 0?16:Fv(a.type)),a)}function Fr(a,c,h,g){if(50<su)throw su=0,v0=null,Error(n(185));Al(a,h,g),((Ye&2)===0||a!==rn)&&(a===rn&&((Ye&2)===0&&(Rd|=h),Gt===4&&Ms(a,gn)),Kn(a,g),h===1&&Ye===0&&(c.mode&1)===0&&(ja=Ot()+500,dd&&ks()))}function Kn(a,c){var h=a.callbackNode;tA(a,c);var g=qc(a,a===rn?gn:0);if(g===0)h!==null&&Tv(h),a.callbackNode=null,a.callbackPriority=0;else if(c=g&-g,a.callbackPriority!==c){if(h!=null&&Tv(h),c===1)a.tag===0?eN(Fk.bind(null,a)):Sb(Fk.bind(null,a)),ZA(function(){(Ye&6)===0&&ks()}),h=null;else{switch(Dv(g)){case 1:h=Xp;break;case 4:h=Mv;break;case 16:h=Vc;break;case 536870912:h=Av;break;default:h=Vc}h=Kk(h,zk.bind(null,a))}a.callbackPriority=c,a.callbackNode=h}}function zk(a,c){if(jd=-1,Ld=0,(Ye&6)!==0)throw Error(n(327));var h=a.callbackNode;if(La()&&a.callbackNode!==h)return null;var g=qc(a,a===rn?gn:0);if(g===0)return null;if((g&30)!==0||(g&a.expiredLanes)!==0||c)c=zd(a,g);else{c=g;var w=Ye;Ye|=2;var S=Bk();(rn!==a||gn!==c)&&(Lo=null,ja=Ot()+500,Ai(a,c));do try{kN();break}catch(R){$k(a,R)}while(!0);Lm(),Dd.current=S,Ye=w,jt!==null?c=0:(rn=null,gn=0,c=Gt)}if(c!==0){if(c===2&&(w=Qp(a),w!==0&&(g=w,c=b0(a,w))),c===1)throw h=ru,Ai(a,0),Ms(a,g),Kn(a,Ot()),h;if(c===6)Ms(a,g);else{if(w=a.current.alternate,(g&30)===0&&!vN(w)&&(c=zd(a,g),c===2&&(S=Qp(a),S!==0&&(g=S,c=b0(a,S))),c===1))throw h=ru,Ai(a,0),Ms(a,g),Kn(a,Ot()),h;switch(a.finishedWork=w,a.finishedLanes=g,c){case 0:case 1:throw Error(n(345));case 2:Ni(a,qn,Lo);break;case 3:if(Ms(a,g),(g&130023424)===g&&(c=y0+500-Ot(),10<c)){if(qc(a,0)!==0)break;if(w=a.suspendedLanes,(w&g)!==g){Rn(),a.pingedLanes|=a.suspendedLanes&w;break}a.timeoutHandle=_m(Ni.bind(null,a,qn,Lo),c);break}Ni(a,qn,Lo);break;case 4:if(Ms(a,g),(g&4194240)===g)break;for(c=a.eventTimes,w=-1;0<g;){var M=31-Or(g);S=1<<M,M=c[M],M>w&&(w=M),g&=~S}if(g=w,g=Ot()-g,g=(120>g?120:480>g?480:1080>g?1080:1920>g?1920:3e3>g?3e3:4320>g?4320:1960*xN(g/1960))-g,10<g){a.timeoutHandle=_m(Ni.bind(null,a,qn,Lo),g);break}Ni(a,qn,Lo);break;case 5:Ni(a,qn,Lo);break;default:throw Error(n(329))}}}return Kn(a,Ot()),a.callbackNode===h?zk.bind(null,a):null}function b0(a,c){var h=ou;return a.current.memoizedState.isDehydrated&&(Ai(a,c).flags|=256),a=zd(a,c),a!==2&&(c=qn,qn=h,c!==null&&k0(c)),a}function k0(a){qn===null?qn=a:qn.push.apply(qn,a)}function vN(a){for(var c=a;;){if(c.flags&16384){var h=c.updateQueue;if(h!==null&&(h=h.stores,h!==null))for(var g=0;g<h.length;g++){var w=h[g],S=w.getSnapshot;w=w.value;try{if(!Ir(S(),w))return!1}catch{return!1}}}if(h=c.child,c.subtreeFlags&16384&&h!==null)h.return=c,c=h;else{if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Ms(a,c){for(c&=~g0,c&=~Rd,a.suspendedLanes|=c,a.pingedLanes&=~c,a=a.expirationTimes;0<c;){var h=31-Or(c),g=1<<h;a[h]=-1,c&=~g}}function Fk(a){if((Ye&6)!==0)throw Error(n(327));La();var c=qc(a,0);if((c&1)===0)return Kn(a,Ot()),null;var h=zd(a,c);if(a.tag!==0&&h===2){var g=Qp(a);g!==0&&(c=g,h=b0(a,g))}if(h===1)throw h=ru,Ai(a,0),Ms(a,c),Kn(a,Ot()),h;if(h===6)throw Error(n(345));return a.finishedWork=a.current.alternate,a.finishedLanes=c,Ni(a,qn,Lo),Kn(a,Ot()),null}function w0(a,c){var h=Ye;Ye|=1;try{return a(c)}finally{Ye=h,Ye===0&&(ja=Ot()+500,dd&&ks())}}function Mi(a){_s!==null&&_s.tag===0&&(Ye&6)===0&&La();var c=Ye;Ye|=1;var h=br.transition,g=ut;try{if(br.transition=null,ut=1,a)return a()}finally{ut=g,br.transition=h,Ye=c,(Ye&6)===0&&ks()}}function C0(){or=Pa.current,bt(Pa)}function Ai(a,c){a.finishedWork=null,a.finishedLanes=0;var h=a.timeoutHandle;if(h!==-1&&(a.timeoutHandle=-1,JA(h)),jt!==null)for(h=jt.return;h!==null;){var g=h;switch(Rm(g),g.tag){case 1:g=g.type.childContextTypes,g!=null&&ud();break;case 3:Ra(),bt(Hn),bt(kn),Wm();break;case 5:Hm(g);break;case 4:Ra();break;case 13:bt(_t);break;case 19:bt(_t);break;case 10:zm(g.type._context);break;case 22:case 23:C0()}h=h.return}if(rn=a,jt=a=As(a.current,null),gn=or=c,Gt=0,ru=null,g0=Rd=Ti=0,qn=ou=null,Si!==null){for(c=0;c<Si.length;c++)if(h=Si[c],g=h.interleaved,g!==null){h.interleaved=null;var w=g.next,S=h.pending;if(S!==null){var M=S.next;S.next=w,g.next=M}h.pending=g}Si=null}return a}function $k(a,c){do{var h=jt;try{if(Lm(),kd.current=Ed,wd){for(var g=Tt.memoizedState;g!==null;){var w=g.queue;w!==null&&(w.pending=null),g=g.next}wd=!1}if(_i=0,nn=Kt=Tt=null,Yl=!1,Xl=0,m0.current=null,h===null||h.return===null){Gt=1,ru=c,jt=null;break}e:{var S=a,M=h.return,R=h,L=c;if(c=gn,R.flags|=32768,L!==null&&typeof L=="object"&&typeof L.then=="function"){var H=L,se=R,ie=se.tag;if((se.mode&1)===0&&(ie===0||ie===11||ie===15)){var oe=se.alternate;oe?(se.updateQueue=oe.updateQueue,se.memoizedState=oe.memoizedState,se.lanes=oe.lanes):(se.updateQueue=null,se.memoizedState=null)}var me=dk(M);if(me!==null){me.flags&=-257,fk(me,M,R,S,c),me.mode&1&&ck(S,H,c),c=me,L=H;var ke=c.updateQueue;if(ke===null){var we=new Set;we.add(L),c.updateQueue=we}else ke.add(L);break e}else{if((c&1)===0){ck(S,H,c),S0();break e}L=Error(n(426))}}else if(St&&R.mode&1){var It=dk(M);if(It!==null){(It.flags&65536)===0&&(It.flags|=256),fk(It,M,R,S,c),Pm(Oa(L,R));break e}}S=L=Oa(L,R),Gt!==4&&(Gt=2),ou===null?ou=[S]:ou.push(S),S=M;do{switch(S.tag){case 3:S.flags|=65536,c&=-c,S.lanes|=c;var $=lk(S,L,c);Pb(S,$);break e;case 1:R=L;var F=S.type,V=S.stateNode;if((S.flags&128)===0&&(typeof F.getDerivedStateFromError=="function"||V!==null&&typeof V.componentDidCatch=="function"&&(Es===null||!Es.has(V)))){S.flags|=65536,c&=-c,S.lanes|=c;var de=uk(S,R,c);Pb(S,de);break e}}S=S.return}while(S!==null)}Hk(h)}catch(Se){c=Se,jt===h&&h!==null&&(jt=h=h.return);continue}break}while(!0)}function Bk(){var a=Dd.current;return Dd.current=Ed,a===null?Ed:a}function S0(){(Gt===0||Gt===3||Gt===2)&&(Gt=4),rn===null||(Ti&268435455)===0&&(Rd&268435455)===0||Ms(rn,gn)}function zd(a,c){var h=Ye;Ye|=2;var g=Bk();(rn!==a||gn!==c)&&(Lo=null,Ai(a,c));do try{bN();break}catch(w){$k(a,w)}while(!0);if(Lm(),Ye=h,Dd.current=g,jt!==null)throw Error(n(261));return rn=null,gn=0,Gt}function bN(){for(;jt!==null;)Vk(jt)}function kN(){for(;jt!==null&&!qM();)Vk(jt)}function Vk(a){var c=qk(a.alternate,a,or);a.memoizedProps=a.pendingProps,c===null?Hk(a):jt=c,m0.current=null}function Hk(a){var c=a;do{var h=c.alternate;if(a=c.return,(c.flags&32768)===0){if(h=hN(h,c,or),h!==null){jt=h;return}}else{if(h=pN(h,c),h!==null){h.flags&=32767,jt=h;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{Gt=6,jt=null;return}}if(c=c.sibling,c!==null){jt=c;return}jt=c=a}while(c!==null);Gt===0&&(Gt=5)}function Ni(a,c,h){var g=ut,w=br.transition;try{br.transition=null,ut=1,wN(a,c,h,g)}finally{br.transition=w,ut=g}return null}function wN(a,c,h,g){do La();while(_s!==null);if((Ye&6)!==0)throw Error(n(327));h=a.finishedWork;var w=a.finishedLanes;if(h===null)return null;if(a.finishedWork=null,a.finishedLanes=0,h===a.current)throw Error(n(177));a.callbackNode=null,a.callbackPriority=0;var S=h.lanes|h.childLanes;if(nA(a,S),a===rn&&(jt=rn=null,gn=0),(h.subtreeFlags&2064)===0&&(h.flags&2064)===0||Id||(Id=!0,Kk(Vc,function(){return La(),null})),S=(h.flags&15990)!==0,(h.subtreeFlags&15990)!==0||S){S=br.transition,br.transition=null;var M=ut;ut=1;var R=Ye;Ye|=4,m0.current=null,gN(a,h),Ok(h,a),VA(Sm),Jc=!!Cm,Sm=Cm=null,a.current=h,yN(h),KM(),Ye=R,ut=M,br.transition=S}else a.current=h;if(Id&&(Id=!1,_s=a,Pd=w),S=a.pendingLanes,S===0&&(Es=null),ZM(h.stateNode),Kn(a,Ot()),c!==null)for(g=a.onRecoverableError,h=0;h<c.length;h++)w=c[h],g(w.value,{componentStack:w.stack,digest:w.digest});if(Od)throw Od=!1,a=x0,x0=null,a;return(Pd&1)!==0&&a.tag!==0&&La(),S=a.pendingLanes,(S&1)!==0?a===v0?su++:(su=0,v0=a):su=0,ks(),null}function La(){if(_s!==null){var a=Dv(Pd),c=br.transition,h=ut;try{if(br.transition=null,ut=16>a?16:a,_s===null)var g=!1;else{if(a=_s,_s=null,Pd=0,(Ye&6)!==0)throw Error(n(331));var w=Ye;for(Ye|=4,ve=a.current;ve!==null;){var S=ve,M=S.child;if((ve.flags&16)!==0){var R=S.deletions;if(R!==null){for(var L=0;L<R.length;L++){var H=R[L];for(ve=H;ve!==null;){var se=ve;switch(se.tag){case 0:case 11:case 15:nu(8,se,S)}var ie=se.child;if(ie!==null)ie.return=se,ve=ie;else for(;ve!==null;){se=ve;var oe=se.sibling,me=se.return;if(Mk(se),se===H){ve=null;break}if(oe!==null){oe.return=me,ve=oe;break}ve=me}}}var ke=S.alternate;if(ke!==null){var we=ke.child;if(we!==null){ke.child=null;do{var It=we.sibling;we.sibling=null,we=It}while(we!==null)}}ve=S}}if((S.subtreeFlags&2064)!==0&&M!==null)M.return=S,ve=M;else e:for(;ve!==null;){if(S=ve,(S.flags&2048)!==0)switch(S.tag){case 0:case 11:case 15:nu(9,S,S.return)}var $=S.sibling;if($!==null){$.return=S.return,ve=$;break e}ve=S.return}}var F=a.current;for(ve=F;ve!==null;){M=ve;var V=M.child;if((M.subtreeFlags&2064)!==0&&V!==null)V.return=M,ve=V;else e:for(M=F;ve!==null;){if(R=ve,(R.flags&2048)!==0)try{switch(R.tag){case 0:case 11:case 15:Nd(9,R)}}catch(Se){At(R,R.return,Se)}if(R===M){ve=null;break e}var de=R.sibling;if(de!==null){de.return=R.return,ve=de;break e}ve=R.return}}if(Ye=w,ks(),Xr&&typeof Xr.onPostCommitFiberRoot=="function")try{Xr.onPostCommitFiberRoot(Hc,a)}catch{}g=!0}return g}finally{ut=h,br.transition=c}}return!1}function Uk(a,c,h){c=Oa(h,c),c=lk(a,c,1),a=Cs(a,c,1),c=Rn(),a!==null&&(Al(a,1,c),Kn(a,c))}function At(a,c,h){if(a.tag===3)Uk(a,a,h);else for(;c!==null;){if(c.tag===3){Uk(c,a,h);break}else if(c.tag===1){var g=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Es===null||!Es.has(g))){a=Oa(h,a),a=uk(c,a,1),c=Cs(c,a,1),a=Rn(),c!==null&&(Al(c,1,a),Kn(c,a));break}}c=c.return}}function CN(a,c,h){var g=a.pingCache;g!==null&&g.delete(c),c=Rn(),a.pingedLanes|=a.suspendedLanes&h,rn===a&&(gn&h)===h&&(Gt===4||Gt===3&&(gn&130023424)===gn&&500>Ot()-y0?Ai(a,0):g0|=h),Kn(a,c)}function Wk(a,c){c===0&&((a.mode&1)===0?c=1:(c=Wc,Wc<<=1,(Wc&130023424)===0&&(Wc=4194304)));var h=Rn();a=Io(a,c),a!==null&&(Al(a,c,h),Kn(a,h))}function SN(a){var c=a.memoizedState,h=0;c!==null&&(h=c.retryLane),Wk(a,h)}function EN(a,c){var h=0;switch(a.tag){case 13:var g=a.stateNode,w=a.memoizedState;w!==null&&(h=w.retryLane);break;case 19:g=a.stateNode;break;default:throw Error(n(314))}g!==null&&g.delete(c),Wk(a,h)}var qk;qk=function(a,c,h){if(a!==null)if(a.memoizedProps!==c.pendingProps||Hn.current)Wn=!0;else{if((a.lanes&h)===0&&(c.flags&128)===0)return Wn=!1,fN(a,c,h);Wn=(a.flags&131072)!==0}else Wn=!1,St&&(c.flags&1048576)!==0&&Eb(c,hd,c.index);switch(c.lanes=0,c.tag){case 2:var g=c.type;Md(a,c),a=c.pendingProps;var w=Ea(c,kn.current);Da(c,h),w=Gm(null,c,g,a,w,h);var S=Jm();return c.flags|=1,typeof w=="object"&&w!==null&&typeof w.render=="function"&&w.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,Un(g)?(S=!0,cd(c)):S=!1,c.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,Bm(c),w.updater=_d,c.stateNode=w,w._reactInternals=c,t0(c,g,a,h),c=s0(null,c,g,!0,S,h)):(c.tag=0,St&&S&&Dm(c),Dn(null,c,w,h),c=c.child),c;case 16:g=c.elementType;e:{switch(Md(a,c),a=c.pendingProps,w=g._init,g=w(g._payload),c.type=g,w=c.tag=TN(g),a=jr(g,a),w){case 0:c=o0(null,c,g,a,h);break e;case 1:c=xk(null,c,g,a,h);break e;case 11:c=hk(null,c,g,a,h);break e;case 14:c=pk(null,c,g,jr(g.type,a),h);break e}throw Error(n(306,g,""))}return c;case 0:return g=c.type,w=c.pendingProps,w=c.elementType===g?w:jr(g,w),o0(a,c,g,w,h);case 1:return g=c.type,w=c.pendingProps,w=c.elementType===g?w:jr(g,w),xk(a,c,g,w,h);case 3:e:{if(vk(c),a===null)throw Error(n(387));g=c.pendingProps,S=c.memoizedState,w=S.element,Ib(a,c),vd(c,g,null,h);var M=c.memoizedState;if(g=M.element,S.isDehydrated)if(S={element:g,isDehydrated:!1,cache:M.cache,pendingSuspenseBoundaries:M.pendingSuspenseBoundaries,transitions:M.transitions},c.updateQueue.baseState=S,c.memoizedState=S,c.flags&256){w=Oa(Error(n(423)),c),c=bk(a,c,g,h,w);break e}else if(g!==w){w=Oa(Error(n(424)),c),c=bk(a,c,g,h,w);break e}else for(rr=xs(c.stateNode.containerInfo.firstChild),nr=c,St=!0,Pr=null,h=Rb(c,null,g,h),c.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(Ma(),g===w){c=jo(a,c,h);break e}Dn(a,c,g,h)}c=c.child}return c;case 5:return Lb(c),a===null&&Im(c),g=c.type,w=c.pendingProps,S=a!==null?a.memoizedProps:null,M=w.children,Em(g,w)?M=null:S!==null&&Em(g,S)&&(c.flags|=32),yk(a,c),Dn(a,c,M,h),c.child;case 6:return a===null&&Im(c),null;case 13:return kk(a,c,h);case 4:return Vm(c,c.stateNode.containerInfo),g=c.pendingProps,a===null?c.child=Aa(c,null,g,h):Dn(a,c,g,h),c.child;case 11:return g=c.type,w=c.pendingProps,w=c.elementType===g?w:jr(g,w),hk(a,c,g,w,h);case 7:return Dn(a,c,c.pendingProps,h),c.child;case 8:return Dn(a,c,c.pendingProps.children,h),c.child;case 12:return Dn(a,c,c.pendingProps.children,h),c.child;case 10:e:{if(g=c.type._context,w=c.pendingProps,S=c.memoizedProps,M=w.value,gt(gd,g._currentValue),g._currentValue=M,S!==null)if(Ir(S.value,M)){if(S.children===w.children&&!Hn.current){c=jo(a,c,h);break e}}else for(S=c.child,S!==null&&(S.return=c);S!==null;){var R=S.dependencies;if(R!==null){M=S.child;for(var L=R.firstContext;L!==null;){if(L.context===g){if(S.tag===1){L=Po(-1,h&-h),L.tag=2;var H=S.updateQueue;if(H!==null){H=H.shared;var se=H.pending;se===null?L.next=L:(L.next=se.next,se.next=L),H.pending=L}}S.lanes|=h,L=S.alternate,L!==null&&(L.lanes|=h),Fm(S.return,h,c),R.lanes|=h;break}L=L.next}}else if(S.tag===10)M=S.type===c.type?null:S.child;else if(S.tag===18){if(M=S.return,M===null)throw Error(n(341));M.lanes|=h,R=M.alternate,R!==null&&(R.lanes|=h),Fm(M,h,c),M=S.sibling}else M=S.child;if(M!==null)M.return=S;else for(M=S;M!==null;){if(M===c){M=null;break}if(S=M.sibling,S!==null){S.return=M.return,M=S;break}M=M.return}S=M}Dn(a,c,w.children,h),c=c.child}return c;case 9:return w=c.type,g=c.pendingProps.children,Da(c,h),w=xr(w),g=g(w),c.flags|=1,Dn(a,c,g,h),c.child;case 14:return g=c.type,w=jr(g,c.pendingProps),w=jr(g.type,w),pk(a,c,g,w,h);case 15:return mk(a,c,c.type,c.pendingProps,h);case 17:return g=c.type,w=c.pendingProps,w=c.elementType===g?w:jr(g,w),Md(a,c),c.tag=1,Un(g)?(a=!0,cd(c)):a=!1,Da(c,h),ik(c,g,w),t0(c,g,w,h),s0(null,c,g,!0,a,h);case 19:return Ck(a,c,h);case 22:return gk(a,c,h)}throw Error(n(156,c.tag))};function Kk(a,c){return _v(a,c)}function _N(a,c,h,g){this.tag=a,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function kr(a,c,h,g){return new _N(a,c,h,g)}function E0(a){return a=a.prototype,!(!a||!a.isReactComponent)}function TN(a){if(typeof a=="function")return E0(a)?1:0;if(a!=null){if(a=a.$$typeof,a===K)return 11;if(a===Q)return 14}return 2}function As(a,c){var h=a.alternate;return h===null?(h=kr(a.tag,c,a.key,a.mode),h.elementType=a.elementType,h.type=a.type,h.stateNode=a.stateNode,h.alternate=a,a.alternate=h):(h.pendingProps=c,h.type=a.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=a.flags&14680064,h.childLanes=a.childLanes,h.lanes=a.lanes,h.child=a.child,h.memoizedProps=a.memoizedProps,h.memoizedState=a.memoizedState,h.updateQueue=a.updateQueue,c=a.dependencies,h.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},h.sibling=a.sibling,h.index=a.index,h.ref=a.ref,h}function Fd(a,c,h,g,w,S){var M=2;if(g=a,typeof a=="function")E0(a)&&(M=1);else if(typeof a=="string")M=5;else e:switch(a){case I:return Di(h.children,w,S,c);case P:M=8,w|=8;break;case O:return a=kr(12,h,c,w|2),a.elementType=O,a.lanes=S,a;case q:return a=kr(13,h,c,w),a.elementType=q,a.lanes=S,a;case Z:return a=kr(19,h,c,w),a.elementType=Z,a.lanes=S,a;case Y:return $d(h,w,S,c);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case U:M=10;break e;case J:M=9;break e;case K:M=11;break e;case Q:M=14;break e;case G:M=16,g=null;break e}throw Error(n(130,a==null?a:typeof a,""))}return c=kr(M,h,c,w),c.elementType=a,c.type=g,c.lanes=S,c}function Di(a,c,h,g){return a=kr(7,a,g,c),a.lanes=h,a}function $d(a,c,h,g){return a=kr(22,a,g,c),a.elementType=Y,a.lanes=h,a.stateNode={isHidden:!1},a}function _0(a,c,h){return a=kr(6,a,null,c),a.lanes=h,a}function T0(a,c,h){return c=kr(4,a.children!==null?a.children:[],a.key,c),c.lanes=h,c.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},c}function MN(a,c,h,g,w){this.tag=c,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=em(0),this.expirationTimes=em(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=em(0),this.identifierPrefix=g,this.onRecoverableError=w,this.mutableSourceEagerHydrationData=null}function M0(a,c,h,g,w,S,M,R,L){return a=new MN(a,c,h,R,L),c===1?(c=1,S===!0&&(c|=8)):c=0,S=kr(3,null,null,c),a.current=S,S.stateNode=a,S.memoizedState={element:g,isDehydrated:h,cache:null,transitions:null,pendingSuspenseBoundaries:null},Bm(S),a}function AN(a,c,h){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:D,key:g==null?null:""+g,children:a,containerInfo:c,implementation:h}}function Gk(a){if(!a)return bs;a=a._reactInternals;e:{if(vi(a)!==a||a.tag!==1)throw Error(n(170));var c=a;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(Un(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(n(171))}if(a.tag===1){var h=a.type;if(Un(h))return wb(a,h,c)}return c}function Jk(a,c,h,g,w,S,M,R,L){return a=M0(h,g,!0,a,w,S,M,R,L),a.context=Gk(null),h=a.current,g=Rn(),w=Ts(h),S=Po(g,w),S.callback=c??null,Cs(h,S,w),a.current.lanes=w,Al(a,w,g),Kn(a,g),a}function Bd(a,c,h,g){var w=c.current,S=Rn(),M=Ts(w);return h=Gk(h),c.context===null?c.context=h:c.pendingContext=h,c=Po(S,M),c.payload={element:a},g=g===void 0?null:g,g!==null&&(c.callback=g),a=Cs(w,c,M),a!==null&&(Fr(a,w,M,S),xd(a,w,M)),M}function Vd(a){if(a=a.current,!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function Zk(a,c){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var h=a.retryLane;a.retryLane=h!==0&&h<c?h:c}}function A0(a,c){Zk(a,c),(a=a.alternate)&&Zk(a,c)}function NN(){return null}var Yk=typeof reportError=="function"?reportError:function(a){console.error(a)};function N0(a){this._internalRoot=a}Hd.prototype.render=N0.prototype.render=function(a){var c=this._internalRoot;if(c===null)throw Error(n(409));Bd(a,c,null,null)},Hd.prototype.unmount=N0.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var c=a.containerInfo;Mi(function(){Bd(null,a,null,null)}),c[No]=null}};function Hd(a){this._internalRoot=a}Hd.prototype.unstable_scheduleHydration=function(a){if(a){var c=Iv();a={blockedOn:null,target:a,priority:c};for(var h=0;h<ms.length&&c!==0&&c<ms[h].priority;h++);ms.splice(h,0,a),h===0&&Lv(a)}};function D0(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function Ud(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function Xk(){}function DN(a,c,h,g,w){if(w){if(typeof g=="function"){var S=g;g=function(){var H=Vd(M);S.call(H)}}var M=Jk(c,g,a,0,null,!1,!1,"",Xk);return a._reactRootContainer=M,a[No]=M.current,Hl(a.nodeType===8?a.parentNode:a),Mi(),M}for(;w=a.lastChild;)a.removeChild(w);if(typeof g=="function"){var R=g;g=function(){var H=Vd(L);R.call(H)}}var L=M0(a,0,!1,null,null,!1,!1,"",Xk);return a._reactRootContainer=L,a[No]=L.current,Hl(a.nodeType===8?a.parentNode:a),Mi(function(){Bd(c,L,h,g)}),L}function Wd(a,c,h,g,w){var S=h._reactRootContainer;if(S){var M=S;if(typeof w=="function"){var R=w;w=function(){var L=Vd(M);R.call(L)}}Bd(c,M,a,w)}else M=DN(h,c,a,w,g);return Vd(M)}Rv=function(a){switch(a.tag){case 3:var c=a.stateNode;if(c.current.memoizedState.isDehydrated){var h=Ml(c.pendingLanes);h!==0&&(tm(c,h|1),Kn(c,Ot()),(Ye&6)===0&&(ja=Ot()+500,ks()))}break;case 13:Mi(function(){var g=Io(a,1);if(g!==null){var w=Rn();Fr(g,a,1,w)}}),A0(a,1)}},nm=function(a){if(a.tag===13){var c=Io(a,134217728);if(c!==null){var h=Rn();Fr(c,a,134217728,h)}A0(a,134217728)}},Ov=function(a){if(a.tag===13){var c=Ts(a),h=Io(a,c);if(h!==null){var g=Rn();Fr(h,a,c,g)}A0(a,c)}},Iv=function(){return ut},Pv=function(a,c){var h=ut;try{return ut=a,c()}finally{ut=h}},xi=function(a,c,h){switch(c){case"input":if(Ht(a,h),c=h.name,h.type==="radio"&&c!=null){for(h=a;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<h.length;c++){var g=h[c];if(g!==a&&g.form===a.form){var w=ld(g);if(!w)throw Error(n(90));Ne(g),Ht(g,w)}}}break;case"textarea":gi(a,h);break;case"select":c=h.value,c!=null&&An(a,!!h.multiple,c,!1)}},et=w0,it=Mi;var RN={usingClientEntryPoint:!1,Events:[ql,Ca,ld,Te,st,w0]},iu={findFiberByHostInstance:bi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ON={bundleType:iu.bundleType,version:iu.version,rendererPackageName:iu.rendererPackageName,rendererConfig:iu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:A.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=Sv(a),a===null?null:a.stateNode},findFiberByHostInstance:iu.findFiberByHostInstance||NN,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var qd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qd.isDisabled&&qd.supportsFiber)try{Hc=qd.inject(ON),Xr=qd}catch{}}return Gn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=RN,Gn.createPortal=function(a,c){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!D0(c))throw Error(n(200));return AN(a,c,null,h)},Gn.createRoot=function(a,c){if(!D0(a))throw Error(n(299));var h=!1,g="",w=Yk;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(g=c.identifierPrefix),c.onRecoverableError!==void 0&&(w=c.onRecoverableError)),c=M0(a,1,!1,null,null,h,!1,g,w),a[No]=c.current,Hl(a.nodeType===8?a.parentNode:a),new N0(c)},Gn.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var c=a._reactInternals;if(c===void 0)throw typeof a.render=="function"?Error(n(188)):(a=Object.keys(a).join(","),Error(n(268,a)));return a=Sv(c),a=a===null?null:a.stateNode,a},Gn.flushSync=function(a){return Mi(a)},Gn.hydrate=function(a,c,h){if(!Ud(c))throw Error(n(200));return Wd(null,a,c,!0,h)},Gn.hydrateRoot=function(a,c,h){if(!D0(a))throw Error(n(405));var g=h!=null&&h.hydratedSources||null,w=!1,S="",M=Yk;if(h!=null&&(h.unstable_strictMode===!0&&(w=!0),h.identifierPrefix!==void 0&&(S=h.identifierPrefix),h.onRecoverableError!==void 0&&(M=h.onRecoverableError)),c=Jk(c,null,a,1,h??null,w,!1,S,M),a[No]=c.current,Hl(a),g)for(a=0;a<g.length;a++)h=g[a],w=h._getVersion,w=w(h._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[h,w]:c.mutableSourceEagerHydrationData.push(h,w);return new Hd(c)},Gn.render=function(a,c,h){if(!Ud(c))throw Error(n(200));return Wd(null,a,c,!1,h)},Gn.unmountComponentAtNode=function(a){if(!Ud(a))throw Error(n(40));return a._reactRootContainer?(Mi(function(){Wd(null,null,a,!1,function(){a._reactRootContainer=null,a[No]=null})}),!0):!1},Gn.unstable_batchedUpdates=w0,Gn.unstable_renderSubtreeIntoContainer=function(a,c,h,g){if(!Ud(h))throw Error(n(200));if(a==null||a._reactInternals===void 0)throw Error(n(38));return Wd(a,c,h,!1,g)},Gn.version="18.3.1-next-f1338f8080-20240426",Gn}var u2;function PS(){if(u2)return P0.exports;u2=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),P0.exports=BN(),P0.exports}var c2;function VN(){if(c2)return Kd;c2=1;var t=PS();return Kd.createRoot=t.createRoot,Kd.hydrateRoot=t.hydrateRoot,Kd}var HN=VN();function jS(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=jS(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function LS(){for(var t,e,n=0,r="",o=arguments.length;n<o;n++)(t=arguments[n])&&(e=jS(t))&&(r&&(r+=" "),r+=e);return r}const d2=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,f2=LS,zS=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return f2(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=e,i=Object.keys(o).map(d=>{const f=n==null?void 0:n[d],p=s==null?void 0:s[d];if(f===null)return null;const m=d2(f)||d2(p);return o[d][m]}),l=n&&Object.entries(n).reduce((d,f)=>{let[p,m]=f;return m===void 0||(d[p]=m),d},{}),u=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((d,f)=>{let{class:p,className:m,...y}=f;return Object.entries(y).every(v=>{let[b,k]=v;return Array.isArray(k)?k.includes({...s,...l}[b]):{...s,...l}[b]===k})?[...d,p,m]:d},[]);return f2(t,i,u,n==null?void 0:n.class,n==null?void 0:n.className)};var Vr=PS();const FS=xy(Vr);var UN=Object.defineProperty,vy=(t,e)=>UN(t,"name",{value:e,configurable:!0});function Qg(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}vy(Qg,"setRef");function $S(...t){return e=>{let n=!1;const r=t.map(o=>{const s=Qg(o,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Qg(t[o],null)}}}}vy($S,"composeRefs");function rt(...t){return C.useCallback($S(...t),t)}vy(rt,"useComposedRefs");var WN=Object.defineProperty,Kr=(t,e)=>WN(t,"name",{value:e,configurable:!0});function xo(t){const e=C.forwardRef((n,r)=>{let{children:o,...s}=n,i=null,l=!1;const u=[];e1(o)&&typeof Gd=="function"&&(o=Gd(o._payload)),C.Children.forEach(o,m=>{var y;if(qS(m)){l=!0;const v=m;let b="child"in v.props?v.props.child:v.props.children;e1(b)&&typeof Gd=="function"&&(b=Gd(b._payload)),i=qN(v,b),u.push((y=i==null?void 0:i.props)==null?void 0:y.children)}else u.push(m)}),i?i=C.cloneElement(i,void 0,u):!l&&C.Children.count(o)===1&&C.isValidElement(o)&&(i=o);const d=i?WS(i):void 0,f=rt(r,d);if(!i){if(o||o===0)throw new Error(l?JN(t):GN(t));return o}const p=US(s,i.props??{});return i.type!==C.Fragment&&(p.ref=r?f:d),C.cloneElement(i,p)});return e.displayName=`${t}.Slot`,e}Kr(xo,"createSlot");var BS=xo("Slot"),VS=Symbol.for("radix.slottable");function HS(t){const e=Kr(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=VS,e}Kr(HS,"createSlottable");var qN=Kr((t,e)=>{if("child"in t.props){const n=t.props.child;return C.isValidElement(n)?C.cloneElement(n,void 0,t.props.children(n.props.children)):null}return C.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function US(t,e){const n={...e};for(const r in e){const o=t[r],s=e[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...l)=>{const u=s(...l);return o(...l),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...t,...n}}Kr(US,"mergeProps");function WS(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}Kr(WS,"getElementRef");function qS(t){return C.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===VS}Kr(qS,"isSlottable");var KN=Symbol.for("react.lazy");function e1(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===KN&&"_payload"in t&&KS(t._payload)}Kr(e1,"isLazyComponent");function KS(t){return typeof t=="object"&&t!==null&&"then"in t}Kr(KS,"isPromiseLike");var GN=Kr(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),JN=Kr(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Gd=gl[" use ".trim().toString()],ZN=Object.defineProperty,YN=(t,e)=>ZN(t,"name",{value:e,configurable:!0}),XN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ot=XN.reduce((t,e)=>{const n=xo(`Primitive.${e}`),r=C.forwardRef((o,s)=>{const{asChild:i,...l}=o,u=i?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(u,{...l,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function by(t,e){t&&Vr.flushSync(()=>t.dispatchEvent(e))}YN(by,"dispatchDiscreteCustomEvent");var QN=Object.defineProperty,e5=(t,e)=>QN(t,"name",{value:e,configurable:!0}),GS=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),t5=C.forwardRef(e5(function(e,n){return x.jsx(ot.span,{...e,ref:n,style:{...GS,...e.style}})},"VisuallyHidden")),n5=t5,r5=Object.defineProperty,_r=(t,e)=>r5(t,"name",{value:e,configurable:!0});function o5(t,e){const n=C.createContext(e);n.displayName=t+"Context";const r=_r(s=>{const{children:i,...l}=s,u=C.useMemo(()=>l,Object.values(l));return x.jsx(n.Provider,{value:u,children:i})},"Provider");r.displayName=t+"Provider";function o(s,i={}){const{optional:l=!1}=i,u=C.useContext(n);if(u)return u;if(e!==void 0)return e;if(!l)throw new Error(`\`${s}\` must be used within \`${t}\``)}return _r(o,"useContext"),[r,o]}_r(o5,"createContext");function wo(t,e=[]){let n=[];function r(s,i){const l=C.createContext(i);l.displayName=s+"Context";const u=n.length;n=[...n,i];const d=_r(p=>{var E;const{scope:m,children:y,...v}=p,b=((E=m==null?void 0:m[t])==null?void 0:E[u])||l,k=C.useMemo(()=>v,Object.values(v));return x.jsx(b.Provider,{value:k,children:y})},"Provider");d.displayName=s+"Provider";function f(p,m,y={}){var E;const{optional:v=!1}=y,b=((E=m==null?void 0:m[t])==null?void 0:E[u])||l,k=C.useContext(b);if(k)return k;if(i!==void 0)return i;if(!v)throw new Error(`\`${p}\` must be used within \`${s}\``)}return _r(f,"useContext"),[d,f]}_r(r,"createContext");const o=_r(()=>{const s=n.map(i=>C.createContext(i));return _r(function(l){const u=(l==null?void 0:l[t])||s;return C.useMemo(()=>({[`__scope${t}`]:{...l,[t]:u}}),[l,u])},"useScope")},"createScope");return o.scopeName=t,[r,JS(o,...e)]}_r(wo,"createContextScope");function JS(...t){const e=t[0];if(t.length===1)return e;const n=_r(()=>{const r=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return _r(function(s){const i=r.reduce((l,{useScope:u,scopeName:d})=>{const p=u(s)[`__scope${d}`];return{...l,...p}},{});return C.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}_r(JS,"composeContextScopes");var s5=Object.defineProperty,un=(t,e)=>s5(t,"name",{value:e,configurable:!0});function tp(t){const e=t+"CollectionProvider",[n,r]=wo(e),[o,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),i=un(b=>{const{scope:k,children:E}=b,_=C.useRef(null),T=C.useRef(new Map).current;return x.jsx(o,{scope:k,itemMap:T,collectionRef:_,children:E})},"CollectionProvider");i.displayName=e;const l=t+"CollectionSlot",u=xo(l),d=C.forwardRef((b,k)=>{const{scope:E,children:_}=b,T=s(l,E),A=rt(k,T.collectionRef);return x.jsx(u,{ref:A,children:_})});d.displayName=l;const f=t+"CollectionItemSlot",p="data-radix-collection-item",m=xo(f),y=C.forwardRef((b,k)=>{const{scope:E,children:_,...T}=b,A=C.useRef(null),N=rt(k,A),D=s(f,E);return C.useEffect(()=>(D.itemMap.set(A,{ref:A,...T}),()=>void D.itemMap.delete(A))),x.jsx(m,{[p]:"",ref:N,children:_})});y.displayName=f;function v(b){const k=s(t+"CollectionConsumer",b);return C.useCallback(()=>{const _=k.collectionRef.current;if(!_)return[];const T=Array.from(_.querySelectorAll(`[${p}]`));return Array.from(k.itemMap.values()).sort((D,I)=>T.indexOf(D.ref.current)-T.indexOf(I.ref.current))},[k.collectionRef,k.itemMap])}return un(v,"useCollection"),[{Provider:i,Slot:d,ItemSlot:y},v,r]}un(tp,"createCollection");var h2=new WeakMap,Lt,sr,z0=(sr=class extends Map{constructor(n){super(n);t2(this,Lt);R0(this,Lt,[...super.keys()]),h2.set(this,!0)}set(n,r){return h2.get(this)&&(this.has(n)?En(this,Lt)[En(this,Lt).indexOf(n)]=n:En(this,Lt).push(n)),super.set(n,r),this}insert(n,r,o){const s=this.has(r),i=En(this,Lt).length,l=ky(n);let u=l>=0?l:i+l;const d=u<0||u>=i?-1:u;if(d===this.size||s&&d===this.size-1||d===-1)return this.set(r,o),this;const f=this.size+(s?0:1);l<0&&u++;const p=[...En(this,Lt)];let m,y=!1;for(let v=u;v<f;v++)if(u===v){let b=p[v];p[v]===r&&(b=p[v+1]),s&&this.delete(r),m=this.get(b),this.set(r,o)}else{!y&&p[v-1]===r&&(y=!0);const b=p[y?v:v-1],k=m;m=this.get(b),this.delete(b),this.set(b,k)}return this}with(n,r,o){const s=new sr(this);return s.insert(n,r,o),s}before(n){const r=En(this,Lt).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,o){const s=En(this,Lt).indexOf(n);return s===-1?this:this.insert(s,r,o)}after(n){let r=En(this,Lt).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,o){const s=En(this,Lt).indexOf(n);return s===-1?this:this.insert(s+1,r,o)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return R0(this,Lt,[]),super.clear()}delete(n){const r=super.delete(n);return r&&En(this,Lt).splice(En(this,Lt).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=Tf(En(this,Lt),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=Tf(En(this,Lt),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return En(this,Lt).indexOf(n)}keyAt(n){return Tf(En(this,Lt),n)}from(n,r){const o=this.indexOf(n);if(o===-1)return;let s=o+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(n,r){const o=this.indexOf(n);if(o===-1)return;let s=o+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return s;o++}}findIndex(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return o;o++}return-1}filter(n,r){const o=[];let s=0;for(const i of this)Reflect.apply(n,r,[i,s,this])&&o.push(i),s++;return new sr(o)}map(n,r){const o=[];let s=0;for(const i of this)o.push([i[0],Reflect.apply(n,r,[i,s,this])]),s++;return new sr(o)}reduce(...n){const[r,o]=n;let s=0,i=o??this.at(0);for(const l of this)s===0&&n.length===1?i=l:i=Reflect.apply(r,this,[i,l,s,this]),s++;return i}reduceRight(...n){const[r,o]=n;let s=o??this.at(-1);for(let i=this.size-1;i>=0;i--){const l=this.at(i);i===this.size-1&&n.length===1?s=l:s=Reflect.apply(r,this,[s,l,i,this])}return s}toSorted(n){const r=[...this.entries()].sort(n);return new sr(r)}toReversed(){const n=new sr;for(let r=this.size-1;r>=0;r--){const o=this.keyAt(r),s=this.get(o);n.set(o,s)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new sr(r)}slice(n,r){const o=new sr;let s=this.size-1;if(n===void 0)return o;n<0&&(n=n+this.size),r!==void 0&&r>0&&(s=r-1);for(let i=n;i<=s;i++){const l=this.keyAt(i),u=this.get(l);o.set(l,u)}return o}every(n,r){let o=0;for(const s of this){if(!Reflect.apply(n,r,[s,o,this]))return!1;o++}return!0}some(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return!0;o++}return!1}},Lt=new WeakMap,un(sr,"OrderedDict"),sr);function Tf(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const n=ZS(t,e);return n===-1?void 0:t[n]}un(Tf,"at");function ZS(t,e){const n=t.length,r=ky(e),o=r>=0?r:n+r;return o<0||o>=n?-1:o}un(ZS,"toSafeIndex");function ky(t){return t!==t||t===0?0:Math.trunc(t)}un(ky,"toSafeInteger");function i5(t){const e=t+"CollectionProvider",[n,r]=wo(e),[o,s]=n(e,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new z0,setItemMap:un(()=>{},"setItemMap")}),i=un(({state:T,...A})=>T?x.jsx(u,{...A,state:T}):x.jsx(l,{...A}),"CollectionProvider");i.displayName=e;const l=un(T=>{const A=k();return x.jsx(u,{...T,state:A})},"CollectionInit");l.displayName=e+"Init";const u=un(T=>{const{scope:A,children:N,state:D}=T,I=C.useRef(null),[P,O]=C.useState(null),U=rt(I,O),[J,K]=D;return C.useEffect(()=>{if(!P)return;const q=QS(()=>{});return q.observe(P,{childList:!0,subtree:!0}),()=>{q.disconnect()}},[P]),x.jsx(o,{scope:A,itemMap:J,setItemMap:K,collectionRef:U,collectionRefObject:I,collectionElement:P,children:N})},"CollectionProviderImpl");u.displayName=e+"Impl";const d=t+"CollectionSlot",f=xo(d),p=C.forwardRef((T,A)=>{const{scope:N,children:D}=T,I=s(d,N),P=rt(A,I.collectionRef);return x.jsx(f,{ref:P,children:D})});p.displayName=d;const m=t+"CollectionItemSlot",y="data-radix-collection-item",v=xo(m),b=C.forwardRef((T,A)=>{const{scope:N,children:D,...I}=T,P=C.useRef(null),[O,U]=C.useState(null),J=rt(A,P,U),K=s(m,N),{setItemMap:q}=K,Z=C.useRef(I);YS(Z.current,I)||(Z.current=I);const Q=Z.current;return C.useEffect(()=>{const G=Q;return q(Y=>O?Y.has(O)?Y.set(O,{...G,element:O}).toSorted(t1):(Y.set(O,{...G,element:O}),Y.toSorted(t1)):Y),()=>{q(Y=>!O||!Y.has(O)?Y:(Y.delete(O),new z0(Y)))}},[O,Q,q]),x.jsx(v,{[y]:"",ref:J,children:D})});b.displayName=m;function k(){return C.useState(new z0)}un(k,"useInitCollection");function E(T){const{itemMap:A}=s(t+"CollectionConsumer",T);return A}return un(E,"useCollection"),[{Provider:i,Slot:p,ItemSlot:b},{createCollectionScope:r,useCollection:E,useInitCollection:k}]}un(i5,"createCollection");function YS(t,e){if(t===e)return!0;if(typeof t!="object"||typeof e!="object"||t==null||e==null)return!1;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(e,o)||t[o]!==e[o])return!1;return!0}un(YS,"shallowEqual");function XS(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}un(XS,"isElementPreceding");function t1(t,e){return!t[1].element||!e[1].element?0:XS(t[1].element,e[1].element)?-1:1}un(t1,"sortByDocumentPosition");function QS(t){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){t();return}})}un(QS,"getChildListObserver");var a5=Object.defineProperty,yl=(t,e)=>a5(t,"name",{value:e,configurable:!0}),e3=!!(typeof window<"u"&&window.document&&window.document.createElement);function Re(t,e,{checkForDefaultPrevented:n=!0}={}){return yl(function(o){if(t==null||t(o),n===!1||!o||!o.defaultPrevented)return e==null?void 0:e(o)},"handleEvent")}yl(Re,"composeEventHandlers");function l5(t){var e;if(!e3)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}yl(l5,"getOwnerWindow");function n1(t){if(!e3)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}yl(n1,"getOwnerDocument");function t3(t,e=!1){const{activeElement:n}=n1(t);if(!(n!=null&&n.nodeName))return null;if(n3(n)&&n.contentDocument)return t3(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const o=n1(n).getElementById(r);if(o)return o}}return n}yl(t3,"getActiveElement");function n3(t){return t.tagName==="IFRAME"}yl(n3,"isFrame");var Rt=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{},u5=Object.defineProperty,c5=(t,e)=>u5(t,"name",{value:e,configurable:!0}),p2=gl[" useEffectEvent ".trim().toString()],m2=gl[" useInsertionEffect ".trim().toString()];function r3(t){if(typeof p2=="function")return p2(t);const e=C.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof m2=="function"?m2(()=>{e.current=t}):Rt(()=>{e.current=t}),C.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}c5(r3,"useEffectEvent");var d5=Object.defineProperty,yc=(t,e)=>d5(t,"name",{value:e,configurable:!0}),f5=gl[" useInsertionEffect ".trim().toString()]||Rt;function Ki({prop:t,defaultProp:e,onChange:n=yc(()=>{},"onChange"),caller:r}){const[o,s,i]=o3({defaultProp:e,onChange:n}),l=t!==void 0,u=l?t:o,d=C.useCallback(f=>{var p;if(l){const m=s3(f)?f(t):f;m!==t&&((p=i.current)==null||p.call(i,m))}else s(f)},[l,t,s,i]);return[u,d]}yc(Ki,"useControllableState");function o3({defaultProp:t,onChange:e}){const[n,r]=C.useState(t),o=C.useRef(n),s=C.useRef(e);return f5(()=>{s.current=e},[e]),C.useEffect(()=>{var i;o.current!==n&&((i=s.current)==null||i.call(s,n),o.current=n)},[n,o]),[n,r,s]}yc(o3,"useUncontrolledState");function s3(t){return typeof t=="function"}yc(s3,"isFunction");var g2=Symbol("RADIX:SYNC_STATE");function h5(t,e,n,r){const{prop:o,defaultProp:s,onChange:i,caller:l}=e,u=o!==void 0,d=r3(i),f=[{...n,state:s}];r&&f.push(r);const[p,m]=C.useReducer((k,E)=>{if(E.type===g2)return{...k,state:E.state};const _=t(k,E);return u&&!Object.is(_.state,k.state)&&d(_.state),_},...f),y=p.state,v=C.useRef(y);C.useEffect(()=>{v.current!==y&&(v.current=y,u||d(y))},[y,v,u]);const b=C.useMemo(()=>o!==void 0?{...p,state:o}:p,[p,o]);return C.useEffect(()=>{u&&!Object.is(o,p.state)&&m({type:g2,state:o})},[o,p.state,u]),[b,m]}yc(h5,"useControllableStateReducer");var p5=Object.defineProperty,ts=(t,e)=>p5(t,"name",{value:e,configurable:!0});function i3(t,e){return C.useReducer((n,r)=>e[n][r]??n,t)}ts(i3,"useStateMachine");var is=ts(t=>{const{present:e,children:n}=t,r=a3(e),o=typeof n=="function"?n({present:r.isPresent}):C.Children.only(n),s=l3(r.ref,u3(o));return typeof n=="function"||r.isPresent?C.cloneElement(o,{ref:s}):null},"Presence");function a3(t){const[e,n]=C.useState(),r=C.useRef(null),o=C.useRef(t),s=C.useRef("none"),i=C.useRef(void 0),l=t?"mounted":"unmounted",[u,d]=i3(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{u==="mounted"?(s.current=i.current??Ha(r.current),i.current=void 0):s.current="none"},[u]),Rt(()=>{const f=r.current,p=o.current;if(p!==t){const y=s.current,v=Ha(f);t?(i.current=v,d("MOUNT")):v==="none"||(f==null?void 0:f.display)==="none"?d("UNMOUNT"):d(p&&y!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,d]),Rt(()=>{if(e){let f;const p=e.ownerDocument.defaultView??window,m=ts(v=>{const k=Ha(r.current).includes(CSS.escape(v.animationName));if(v.target===e&&k&&(d("ANIMATION_END"),!o.current)){const E=e.style.animationFillMode;e.style.animationFillMode="forwards",f=p.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=E)})}},"handleAnimationEnd"),y=ts(v=>{v.target===e&&(s.current=Ha(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",y),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{p.clearTimeout(f),e.removeEventListener("animationstart",y),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:C.useCallback(f=>{if(f){const p=getComputedStyle(f);r.current=p,i.current=Ha(p)}else r.current=null;n(f)},[])}}ts(a3,"usePresence");function r1(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}ts(r1,"setRef");function l3(...t){const e=C.useRef(t);return e.current=t,C.useCallback(n=>{const r=e.current;let o=!1;const s=r.map(i=>{const l=r1(i,n);return!o&&typeof l=="function"&&(o=!0),l});if(o)return()=>{for(let i=0;i<s.length;i++){const l=s[i];typeof l=="function"?l():r1(r[i],null)}}},[])}ts(l3,"useStableComposedRefs");function Ha(t){return(t==null?void 0:t.animationName)||"none"}ts(Ha,"getAnimationName");function u3(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}ts(u3,"getElementRef");var m5=Object.defineProperty,g5=(t,e)=>m5(t,"name",{value:e,configurable:!0}),y5=gl[" useId ".trim().toString()]||(()=>{}),x5=0;function go(t){const[e,n]=C.useState(y5());return Rt(()=>{t||n(r=>r??String(x5++))},[t]),t||(e?`radix-${e}`:"")}g5(go,"useId");var v5=Object.defineProperty,b5=(t,e)=>v5(t,"name",{value:e,configurable:!0}),k5=C.createContext(void 0);function np(t){const e=C.useContext(k5);return t||e||"ltr"}b5(np,"useDirection");var w5=Object.defineProperty,C5=(t,e)=>w5(t,"name",{value:e,configurable:!0});function Nr(t){const e=C.useRef(t);return C.useEffect(()=>{e.current=t}),C.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}C5(Nr,"useCallbackRef");var S5=Object.defineProperty,ln=(t,e)=>S5(t,"name",{value:e,configurable:!0}),o1="dismissableLayer.update",E5="dismissableLayer.pointerDownOutside",_5="dismissableLayer.focusOutside",y2,c3=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),rp=C.forwardRef(ln(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:l,onInteractOutside:u,onDismiss:d,...f}=e,p=C.useContext(c3),[m,y]=C.useState(null),v=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=C.useState({}),k=rt(n,y),E=Array.from(p.layers),[_]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),T=_?E.indexOf(_):-1,A=m?E.indexOf(m):-1,N=p.layersWithOutsidePointerEventsDisabled.size>0,D=A>=T,I=C.useRef(!1),P=f3(K=>{i==null||i(K),u==null||u(K),K.defaultPrevented||d==null||d()},{ownerDocument:v,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:I,dismissableSurfaces:p.dismissableSurfaces,shouldHandlePointerDownOutside:C.useCallback(K=>{if(!(K instanceof Node))return!1;const q=[...p.branches].some(Z=>Z.contains(K));return D&&!q},[p.branches,D])}),O=h3(K=>{if(o&&I.current)return;const q=K.target;[...p.branches].some(Q=>Q.contains(q))||(l==null||l(K),u==null||u(K),K.defaultPrevented||d==null||d())},v),U=m?A===E.length-1:!1,J=Nr(K=>{K.key==="Escape"&&(s==null||s(K),!K.defaultPrevented&&d&&(K.preventDefault(),d()))});return C.useEffect(()=>{if(U)return v.addEventListener("keydown",J,{capture:!0}),()=>v.removeEventListener("keydown",J,{capture:!0})},[v,U,J]),C.useEffect(()=>{if(m)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(y2=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(m)),p.layers.add(m),s1(),()=>{r&&(p.layersWithOutsidePointerEventsDisabled.delete(m),p.layersWithOutsidePointerEventsDisabled.size===0&&(v.body.style.pointerEvents=y2))}},[m,v,r,p]),C.useEffect(()=>()=>{m&&(p.layers.delete(m),p.layersWithOutsidePointerEventsDisabled.delete(m),s1())},[m,p]),C.useEffect(()=>{const K=ln(()=>b({}),"handleUpdate");return document.addEventListener(o1,K),()=>document.removeEventListener(o1,K)},[]),x.jsx(ot.div,{...f,ref:k,style:{pointerEvents:N?D?"auto":"none":void 0,...e.style},onFocusCapture:Re(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Re(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Re(e.onPointerDownCapture,P.onPointerDownCapture)})},"DismissableLayer"));function d3(){const t=C.useContext(c3),[e,n]=C.useState(null);return C.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}ln(d3,"useDismissableLayerSurface");var T5=ln(()=>!0,"IS_TRUE");function f3(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:s,shouldHandlePointerDownOutside:i=T5}=e,l=Nr(t),u=C.useRef(!1),d=C.useRef(!1),f=C.useRef(new Map),p=C.useRef(()=>{});return C.useEffect(()=>{function m(){d.current=!1,o.current=!1,f.current.clear()}ln(m,"resetOutsideInteraction");function y(){return Array.from(f.current.values()).some(Boolean)}ln(y,"isOutsideInteractionIntercepted");function v(T){if(!d.current)return;const A=T.target;A instanceof Node&&[...s].some(D=>D.contains(A))||f.current.set(T.type,!0),T.type==="click"&&window.setTimeout(()=>{d.current&&p.current()},0)}ln(v,"handleInteractionCapture");function b(T){d.current&&f.current.set(T.type,!1)}ln(b,"handleInteractionBubble");const k=ln(T=>{if(T.target&&!u.current){let A=function(){n.removeEventListener("click",p.current);const D=y();m(),D||wy(E5,l,N,{discrete:!0})};if(ln(A,"handleAndDispatchPointerDownOutsideEvent"),!i(T.target)){n.removeEventListener("click",p.current),m(),u.current=!1;return}const N={originalEvent:T};d.current=!0,o.current=r&&T.button===0,f.current.clear(),!r||T.button!==0?A():(n.removeEventListener("click",p.current),p.current=A,n.addEventListener("click",p.current,{once:!0}))}else n.removeEventListener("click",p.current),m();u.current=!1},"handlePointerDown"),E=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const T of E)n.addEventListener(T,v,!0),n.addEventListener(T,b);const _=window.setTimeout(()=>{n.addEventListener("pointerdown",k)},0);return()=>{window.clearTimeout(_),n.removeEventListener("pointerdown",k),n.removeEventListener("click",p.current);for(const T of E)n.removeEventListener(T,v,!0),n.removeEventListener(T,b)}},[n,l,r,o,s,i]),{onPointerDownCapture:ln(()=>u.current=!0,"onPointerDownCapture")}}ln(f3,"usePointerDownOutside");function h3(t,e=globalThis==null?void 0:globalThis.document){const n=Nr(t),r=C.useRef(!1);return C.useEffect(()=>{const o=ln(s=>{s.target&&!r.current&&wy(_5,n,{originalEvent:s},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,n]),{onFocusCapture:ln(()=>r.current=!0,"onFocusCapture"),onBlurCapture:ln(()=>r.current=!1,"onBlurCapture")}}ln(h3,"useFocusOutside");function s1(){const t=new CustomEvent(o1);document.dispatchEvent(t)}ln(s1,"dispatchUpdate");function wy(t,e,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?by(o,s):o.dispatchEvent(s)}ln(wy,"handleAndDispatchCustomEvent");var M5=Object.defineProperty,On=(t,e)=>M5(t,"name",{value:e,configurable:!0}),F0="focusScope.autoFocusOnMount",$0="focusScope.autoFocusOnUnmount",x2={bubbles:!1,cancelable:!0},Cy=C.forwardRef(On(function(e,n){const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...l}=e,[u,d]=C.useState(null),f=Nr(s),p=Nr(i),m=C.useRef(null),y=rt(n,d),v=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(o){let k=function(A){if(v.paused||!u)return;const N=A.target;u.contains(N)?m.current=N:Uo(m.current,{select:!0})},E=function(A){if(v.paused||!u)return;const N=A.relatedTarget;N!==null&&(u.contains(N)||Uo(m.current,{select:!0}))},_=function(A){if(document.activeElement===document.body)for(const D of A)D.removedNodes.length>0&&Uo(u)};On(k,"handleFocusIn"),On(E,"handleFocusOut"),On(_,"handleMutations"),document.addEventListener("focusin",k),document.addEventListener("focusout",E);const T=new MutationObserver(_);return u&&T.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",k),document.removeEventListener("focusout",E),T.disconnect()}}},[o,u,v.paused]),C.useEffect(()=>{if(u){v2.add(v);const k=document.activeElement;if(!u.contains(k)){const _=new CustomEvent(F0,x2);u.addEventListener(F0,f),u.dispatchEvent(_),_.defaultPrevented||(p3(v3(Sy(u)),{select:!0}),document.activeElement===k&&Uo(u))}return()=>{u.removeEventListener(F0,f),setTimeout(()=>{const _=new CustomEvent($0,x2);u.addEventListener($0,p),u.dispatchEvent(_),_.defaultPrevented||Uo(k??document.body,{select:!0}),u.removeEventListener($0,p),v2.remove(v)},0)}}},[u,f,p,v]);const b=C.useCallback(k=>{if(!r&&!o||v.paused)return;const E=k.key==="Tab"&&!k.altKey&&!k.ctrlKey&&!k.metaKey,_=document.activeElement;if(E&&_){const T=k.currentTarget,[A,N]=m3(T);A&&N?!k.shiftKey&&_===N?(k.preventDefault(),r&&Uo(A,{select:!0})):k.shiftKey&&_===A&&(k.preventDefault(),r&&Uo(N,{select:!0})):_===T&&k.preventDefault()}},[r,o,v.paused]);return x.jsx(ot.div,{tabIndex:-1,...l,ref:y,onKeyDown:b})},"FocusScope"));function p3(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Uo(r,{select:e}),document.activeElement!==n)return}On(p3,"focusFirst");function m3(t){const e=Sy(t),n=i1(e,t),r=i1(e.reverse(),t);return[n,r]}On(m3,"getTabbableEdges");function Sy(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:On(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},"acceptNode")});for(;n.nextNode();)e.push(n.currentNode);return e}On(Sy,"getTabbableCandidates");function i1(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):g3(r,{upTo:e})))return r}On(i1,"findVisible");function g3(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}On(g3,"isHidden");function y3(t){return t instanceof HTMLInputElement&&"select"in t}On(y3,"isSelectableInput");function Uo(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&y3(t)&&e&&t.select()}}On(Uo,"focus");var v2=x3();function x3(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=a1(t,e),t.unshift(e)},remove(e){var n;t=a1(t,e),(n=t[0])==null||n.resume()}}}On(x3,"createFocusScopesStack");function a1(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}On(a1,"arrayRemove");function v3(t){return t.filter(e=>e.tagName!=="A")}On(v3,"removeLinks");var A5=Object.defineProperty,N5=(t,e)=>A5(t,"name",{value:e,configurable:!0}),op=C.forwardRef(N5(function(e,n){var u;const{container:r,...o}=e,[s,i]=C.useState(!1);Rt(()=>i(!0),[]);const l=r||s&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return l?Vr.createPortal(x.jsx(ot.div,{...o,ref:n}),l):null},"Portal")),D5=Object.defineProperty,Ey=(t,e)=>D5(t,"name",{value:e,configurable:!0}),Jd=0,ro=null;function R5(t){return xc(),t.children}Ey(R5,"FocusGuards");function xc(){C.useEffect(()=>{ro||(ro={start:l1(),end:l1()});const{start:t,end:e}=ro;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),Jd++,()=>{Jd===1&&(ro==null||ro.start.remove(),ro==null||ro.end.remove(),ro=null),Jd=Math.max(0,Jd-1)}},[])}Ey(xc,"useFocusGuards");function l1(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}Ey(l1,"createFocusGuard");var co=function(){return co=Object.assign||function(e){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},co.apply(this,arguments)};function b3(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 O5(t,e,n){if(n||arguments.length===2)for(var r=0,o=e.length,s;r<o;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}var Mf="right-scroll-bar-position",Af="width-before-scroll-bar",I5="with-scroll-bars-hidden",P5="--removed-body-scroll-bar-size";function B0(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function j5(t,e){var n=C.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 L5=typeof window<"u"?C.useLayoutEffect:C.useEffect,b2=new WeakMap;function z5(t,e){var n=j5(null,function(r){return t.forEach(function(o){return B0(o,r)})});return L5(function(){var r=b2.get(n);if(r){var o=new Set(r),s=new Set(t),i=n.current;o.forEach(function(l){s.has(l)||B0(l,null)}),s.forEach(function(l){o.has(l)||B0(l,i)})}b2.set(n,t)},[t]),n}function F5(t){return t}function $5(t,e){e===void 0&&(e=F5);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(s){var i=e(s,r);return n.push(i),function(){n=n.filter(function(l){return l!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(l){return s(l)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var l=n;n=[],l.forEach(s),i=n}var u=function(){var f=i;i=[],f.forEach(s)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(f){i.push(f),d()},filter:function(f){return i=i.filter(f),n}}}};return o}function B5(t){t===void 0&&(t={});var e=$5(null);return e.options=co({async:!0,ssr:!1},t),e}var k3=function(t){var e=t.sideCar,n=b3(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 C.createElement(r,co({},n))};k3.isSideCarExport=!0;function V5(t,e){return t.useMedium(e),k3}var w3=B5(),V0=function(){},sp=C.forwardRef(function(t,e){var n=C.useRef(null),r=C.useState({onScrollCapture:V0,onWheelCapture:V0,onTouchMoveCapture:V0}),o=r[0],s=r[1],i=t.forwardProps,l=t.children,u=t.className,d=t.removeScrollBar,f=t.enabled,p=t.shards,m=t.sideCar,y=t.noRelative,v=t.noIsolation,b=t.inert,k=t.allowPinchZoom,E=t.as,_=E===void 0?"div":E,T=t.gapMode,A=b3(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=m,D=z5([n,e]),I=co(co({},A),o);return C.createElement(C.Fragment,null,f&&C.createElement(N,{sideCar:w3,removeScrollBar:d,shards:p,noRelative:y,noIsolation:v,inert:b,setCallbacks:s,allowPinchZoom:!!k,lockRef:n,gapMode:T}),i?C.cloneElement(C.Children.only(l),co(co({},I),{ref:D})):C.createElement(_,co({},I,{className:u,ref:D}),l))});sp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};sp.classNames={fullWidth:Af,zeroRight:Mf};var H5=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function U5(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=H5();return e&&t.setAttribute("nonce",e),t}function W5(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function q5(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var K5=function(){var t=0,e=null;return{add:function(n){t==0&&(e=U5())&&(W5(e,n),q5(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},G5=function(){var t=K5();return function(e,n){C.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},C3=function(){var t=G5(),e=function(n){var r=n.styles,o=n.dynamic;return t(r,o),null};return e},J5={left:0,top:0,right:0,gap:0},H0=function(t){return parseInt(t||"",10)||0},Z5=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[H0(n),H0(r),H0(o)]},Y5=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return J5;var e=Z5(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])}},X5=C3(),Ga="data-scroll-locked",Q5=function(t,e,n,r){var o=t.left,s=t.top,i=t.right,l=t.gap;return n===void 0&&(n="margin"),`
41
- .`.concat(I5,` {
42
- overflow: hidden `).concat(r,`;
43
- padding-right: `).concat(l,"px ").concat(r,`;
44
- }
45
- body[`).concat(Ga,`] {
46
- overflow: hidden `).concat(r,`;
47
- overscroll-behavior: contain;
48
- `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
49
- padding-left: `.concat(o,`px;
50
- padding-top: `).concat(s,`px;
51
- padding-right: `).concat(i,`px;
52
- margin-left:0;
53
- margin-top:0;
54
- margin-right: `).concat(l,"px ").concat(r,`;
55
- `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
56
- }
57
-
58
- .`).concat(Mf,` {
59
- right: `).concat(l,"px ").concat(r,`;
60
- }
61
-
62
- .`).concat(Af,` {
63
- margin-right: `).concat(l,"px ").concat(r,`;
64
- }
65
-
66
- .`).concat(Mf," .").concat(Mf,` {
67
- right: 0 `).concat(r,`;
68
- }
69
-
70
- .`).concat(Af," .").concat(Af,` {
71
- margin-right: 0 `).concat(r,`;
72
- }
73
-
74
- body[`).concat(Ga,`] {
75
- `).concat(P5,": ").concat(l,`px;
76
- }
77
- `)},k2=function(){var t=parseInt(document.body.getAttribute(Ga)||"0",10);return isFinite(t)?t:0},eD=function(){C.useEffect(function(){return document.body.setAttribute(Ga,(k2()+1).toString()),function(){var t=k2()-1;t<=0?document.body.removeAttribute(Ga):document.body.setAttribute(Ga,t.toString())}},[])},tD=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,o=r===void 0?"margin":r;eD();var s=C.useMemo(function(){return Y5(o)},[o]);return C.createElement(X5,{styles:Q5(s,!e,o,n?"":"!important")})},u1=!1;if(typeof window<"u")try{var Zd=Object.defineProperty({},"passive",{get:function(){return u1=!0,!0}});window.addEventListener("test",Zd,Zd),window.removeEventListener("test",Zd,Zd)}catch{u1=!1}var za=u1?{passive:!1}:!1,nD=function(t){return t.tagName==="TEXTAREA"},S3=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!nD(t)&&n[e]==="visible")},rD=function(t){return S3(t,"overflowY")},oD=function(t){return S3(t,"overflowX")},w2=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=E3(t,r);if(o){var s=_3(t,r),i=s[1],l=s[2];if(i>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},sD=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},iD=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},E3=function(t,e){return t==="v"?rD(e):oD(e)},_3=function(t,e){return t==="v"?sD(e):iD(e)},aD=function(t,e){return t==="h"&&e==="rtl"?-1:1},lD=function(t,e,n,r,o){var s=aD(t,window.getComputedStyle(e).direction),i=s*r,l=n.target,u=e.contains(l),d=!1,f=i>0,p=0,m=0;do{if(!l)break;var y=_3(t,l),v=y[0],b=y[1],k=y[2],E=b-k-s*v;(v||E)&&E3(t,l)&&(p+=E,m+=v);var _=l.parentNode;l=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!u&&l!==document.body||u&&(e.contains(l)||e===l));return(f&&Math.abs(p)<1||!f&&Math.abs(m)<1)&&(d=!0),d},Yd=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},C2=function(t){return[t.deltaX,t.deltaY]},S2=function(t){return t&&"current"in t?t.current:t},uD=function(t,e){return t[0]===e[0]&&t[1]===e[1]},cD=function(t){return`
78
- .block-interactivity-`.concat(t,` {pointer-events: none;}
79
- .allow-interactivity-`).concat(t,` {pointer-events: all;}
80
- `)},dD=0,Fa=[];function fD(t){var e=C.useRef([]),n=C.useRef([0,0]),r=C.useRef(),o=C.useState(dD++)[0],s=C.useState(C3)[0],i=C.useRef(t);C.useEffect(function(){i.current=t},[t]),C.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var b=O5([t.lockRef.current],(t.shards||[]).map(S2),!0).filter(Boolean);return b.forEach(function(k){return k.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),b.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var l=C.useCallback(function(b,k){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!i.current.allowPinchZoom;var E=Yd(b),_=n.current,T="deltaX"in b?b.deltaX:_[0]-E[0],A="deltaY"in b?b.deltaY:_[1]-E[1],N,D=b.target,I=Math.abs(T)>Math.abs(A)?"h":"v";if("touches"in b&&I==="h"&&D.type==="range")return!1;var P=window.getSelection(),O=P&&P.anchorNode,U=O?O===D||O.contains(D):!1;if(U)return!1;var J=w2(I,D);if(!J)return!0;if(J?N=I:(N=I==="v"?"h":"v",J=w2(I,D)),!J)return!1;if(!r.current&&"changedTouches"in b&&(T||A)&&(r.current=N),!N)return!0;var K=r.current||N;return lD(K,k,b,K==="h"?T:A)},[]),u=C.useCallback(function(b){var k=b;if(!(!Fa.length||Fa[Fa.length-1]!==s)){var E="deltaY"in k?C2(k):Yd(k),_=e.current.filter(function(N){return N.name===k.type&&(N.target===k.target||k.target===N.shadowParent)&&uD(N.delta,E)})[0];if(_&&_.should){k.cancelable&&k.preventDefault();return}if(!_){var T=(i.current.shards||[]).map(S2).filter(Boolean).filter(function(N){return N.contains(k.target)}),A=T.length>0?l(k,T[0]):!i.current.noIsolation;A&&k.cancelable&&k.preventDefault()}}},[]),d=C.useCallback(function(b,k,E,_){var T={name:b,delta:k,target:E,should:_,shadowParent:hD(E)};e.current.push(T),setTimeout(function(){e.current=e.current.filter(function(A){return A!==T})},1)},[]),f=C.useCallback(function(b){n.current=Yd(b),r.current=void 0},[]),p=C.useCallback(function(b){d(b.type,C2(b),b.target,l(b,t.lockRef.current))},[]),m=C.useCallback(function(b){d(b.type,Yd(b),b.target,l(b,t.lockRef.current))},[]);C.useEffect(function(){return Fa.push(s),t.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",u,za),document.addEventListener("touchmove",u,za),document.addEventListener("touchstart",f,za),function(){Fa=Fa.filter(function(b){return b!==s}),document.removeEventListener("wheel",u,za),document.removeEventListener("touchmove",u,za),document.removeEventListener("touchstart",f,za)}},[]);var y=t.removeScrollBar,v=t.inert;return C.createElement(C.Fragment,null,v?C.createElement(s,{styles:cD(o)}):null,y?C.createElement(tD,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function hD(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const pD=V5(w3,fD);var ip=C.forwardRef(function(t,e){return C.createElement(sp,co({},t,{ref:e,sideCar:pD}))});ip.classNames=sp.classNames;var mD=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},$a=new WeakMap,Xd=new WeakMap,Qd={},U0=0,T3=function(t){return t&&(t.host||T3(t.parentNode))},gD=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=T3(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})},yD=function(t,e,n,r){var o=gD(e,Array.isArray(t)?t:[t]);Qd[n]||(Qd[n]=new WeakMap);var s=Qd[n],i=[],l=new Set,u=new Set(o),d=function(p){!p||l.has(p)||(l.add(p),d(p.parentNode))};o.forEach(d);var f=function(p){!p||u.has(p)||Array.prototype.forEach.call(p.children,function(m){if(l.has(m))f(m);else try{var y=m.getAttribute(r),v=y!==null&&y!=="false",b=($a.get(m)||0)+1,k=(s.get(m)||0)+1;$a.set(m,b),s.set(m,k),i.push(m),b===1&&v&&Xd.set(m,!0),k===1&&m.setAttribute(n,"true"),v||m.setAttribute(r,"true")}catch(E){console.error("aria-hidden: cannot operate on ",m,E)}})};return f(e),l.clear(),U0++,function(){i.forEach(function(p){var m=$a.get(p)-1,y=s.get(p)-1;$a.set(p,m),s.set(p,y),m||(Xd.has(p)||p.removeAttribute(r),Xd.delete(p)),y||p.removeAttribute(n)}),U0--,U0||($a=new WeakMap,$a=new WeakMap,Xd=new WeakMap,Qd={})}},_y=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),o=mD(t);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),yD(r,o,n,"aria-hidden")):function(){return null}},xD=Object.defineProperty,dr=(t,e)=>xD(t,"name",{value:e,configurable:!0}),Ty="Dialog",[M3,TX]=wo(Ty),[vD,Gr]=M3(Ty),bD=dr(t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=t,l=C.useRef(null),u=C.useRef(null),[d,f]=Ki({prop:r,defaultProp:o??!1,onChange:s,caller:Ty}),[p,m]=C.useState(0),[y,v]=C.useState(0);return x.jsx(vD,{scope:e,triggerRef:l,contentRef:u,contentId:go(),titleId:go(),descriptionId:go(),titlePresent:p>0,descriptionPresent:y>0,setTitleCount:m,setDescriptionCount:v,open:d,onOpenChange:f,onOpenToggle:C.useCallback(()=>f(b=>!b),[f]),modal:i,children:n})},"Dialog"),kD="DialogTrigger",wD=C.forwardRef(dr(function(e,n){const{__scopeDialog:r,...o}=e,s=Gr(kD,r),i=rt(n,s.triggerRef);return x.jsx(ot.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":ap(s.open),...o,ref:i,onClick:Re(e.onClick,s.onOpenToggle)})},"DialogTrigger")),A3="DialogPortal",[CD,N3]=M3(A3,{forceMount:void 0}),SD=dr(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:o}=t,s=Gr(A3,e);return x.jsx(CD,{scope:e,forceMount:n,children:C.Children.map(r,i=>x.jsx(is,{present:n||s.open,children:x.jsx(op,{asChild:!0,container:o,children:i})}))})},"DialogPortal"),c1="DialogOverlay",ED=C.forwardRef(dr(function(e,n){const r=N3(c1,e.__scopeDialog),{forceMount:o=r.forceMount,...s}=e,i=Gr(c1,e.__scopeDialog);return i.modal?x.jsx(is,{present:o||i.open,children:x.jsx(TD,{...s,ref:n})}):null},"DialogOverlay")),_D=xo("DialogOverlay.RemoveScroll"),TD=C.forwardRef(dr(function(e,n){const{__scopeDialog:r,...o}=e,s=Gr(c1,r),i=d3(),l=rt(n,i);return x.jsx(ip,{as:_D,allowPinchZoom:!0,shards:[s.contentRef],children:x.jsx(ot.div,{"data-state":ap(s.open),...o,ref:l,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),$u="DialogContent",MD=C.forwardRef(dr(function(e,n){const r=N3($u,e.__scopeDialog),{forceMount:o=r.forceMount,...s}=e,i=Gr($u,e.__scopeDialog);return x.jsx(is,{present:o||i.open,children:i.modal?x.jsx(AD,{...s,ref:n}):x.jsx(ND,{...s,ref:n})})},"DialogContent")),AD=C.forwardRef(dr(function(e,n){const r=Gr($u,e.__scopeDialog),o=C.useRef(null),s=rt(n,r.contentRef,o);return C.useEffect(()=>{const i=o.current;if(i)return _y(i)},[]),x.jsx(D3,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Re(e.onCloseAutoFocus,i=>{var l;i.preventDefault(),(l=r.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Re(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&i.preventDefault()}),onFocusOutside:Re(e.onFocusOutside,i=>i.preventDefault())})},"DialogContentModal")),ND=C.forwardRef(dr(function(e,n){const r=Gr($u,e.__scopeDialog),o=C.useRef(!1),s=C.useRef(!1);return x.jsx(D3,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,i),i.defaultPrevented||(o.current||(u=r.triggerRef.current)==null||u.focus(),i.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:i=>{var d,f;(d=e.onInteractOutside)==null||d.call(e,i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=i.target;((f=r.triggerRef.current)==null?void 0:f.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})},"DialogContentNonModal")),D3=C.forwardRef(dr(function(e,n){const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,...l}=e,u=Gr($u,r);return xc(),x.jsx(x.Fragment,{children:x.jsx(Cy,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:i,children:x.jsx(rp,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionPresent?u.descriptionId:void 0,"aria-labelledby":u.titlePresent?u.titleId:void 0,"data-state":ap(u.open),...l,ref:n,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1)})})})},"DialogContentImpl")),DD="DialogTitle",RD=C.forwardRef(dr(function(e,n){const{__scopeDialog:r,...o}=e,s=Gr(DD,r),{setTitleCount:i}=s;return Rt(()=>(i(l=>l+1),()=>i(l=>l-1)),[i]),x.jsx(ot.h2,{id:s.titleId,...o,ref:n})},"DialogTitle")),OD="DialogDescription",ID=C.forwardRef(dr(function(e,n){const{__scopeDialog:r,...o}=e,s=Gr(OD,r),{setDescriptionCount:i}=s;return Rt(()=>(i(l=>l+1),()=>i(l=>l-1)),[i]),x.jsx(ot.p,{id:s.descriptionId,...o,ref:n})},"DialogDescription")),PD="DialogClose",My=C.forwardRef(dr(function(e,n){const{__scopeDialog:r,...o}=e,s=Gr(PD,r);return x.jsx(ot.button,{type:"button",...o,ref:n,onClick:Re(e.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function ap(t){return t?"open":"closed"}dr(ap,"getState");var jD=Object.defineProperty,LD=(t,e)=>jD(t,"name",{value:e,configurable:!0});function R3(t){const[e,n]=C.useState(void 0);return Rt(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,l;if("borderBoxSize"in s){const u=s.borderBoxSize,d=Array.isArray(u)?u[0]:u;i=d.inlineSize,l=d.blockSize}else i=t.offsetWidth,l=t.offsetHeight;n({width:i,height:l})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}LD(R3,"useSize");const zD=["top","right","bottom","left"],ni=Math.min,Jo=Math.max,Ff=Math.round,ef=Math.floor,Zo=t=>({x:t,y:t}),FD={left:"right",right:"left",bottom:"top",top:"bottom"};function O3(t,e,n){return Jo(t,ni(e,n))}function ns(t,e){return typeof t=="function"?t(e):t}function ri(t){return t.split("-")[0]}function xl(t){return t.split("-")[1]}function Ay(t){return t==="x"?"y":"x"}function Ny(t){return t==="y"?"height":"width"}function fo(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Dy(t){return Ay(fo(t))}function $D(t,e,n){n===void 0&&(n=!1);const r=xl(t),o=Dy(t),s=Ny(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(i=$f(i)),[i,$f(i)]}function BD(t){const e=$f(t);return[d1(t),e,d1(e)]}function d1(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const E2=["left","right"],_2=["right","left"],VD=["top","bottom"],HD=["bottom","top"];function UD(t,e,n){switch(t){case"top":case"bottom":return n?e?_2:E2:e?E2:_2;case"left":case"right":return e?VD:HD;default:return[]}}function WD(t,e,n,r){const o=xl(t);let s=UD(ri(t),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),e&&(s=s.concat(s.map(d1)))),s}function $f(t){const e=ri(t);return FD[e]+t.slice(e.length)}function qD(t){var e,n,r,o;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(r=t.bottom)!=null?r:0,left:(o=t.left)!=null?o:0}}function I3(t){return typeof t!="number"?qD(t):{top:t,right:t,bottom:t,left:t}}function Bf(t){const{x:e,y:n,width:r,height:o}=t;return{width:r,height:o,top:n,left:e,right:e+r,bottom:n+o,x:e,y:n}}function T2(t,e,n){let{reference:r,floating:o}=t;const s=fo(e),i=Dy(e),l=Ny(i),u=ri(e),d=s==="y",f=r.x+r.width/2-o.width/2,p=r.y+r.height/2-o.height/2,m=r[l]/2-o[l]/2;let y;switch(u){case"top":y={x:f,y:r.y-o.height};break;case"bottom":y={x:f,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:p};break;case"left":y={x:r.x-o.width,y:p};break;default:y={x:r.x,y:r.y}}const v=xl(e);return v&&(y[i]+=m*(v==="end"?1:-1)*(n&&d?-1:1)),y}async function KD(t,e){var n;e===void 0&&(e={});const{x:r,y:o,platform:s,rects:i,elements:l,strategy:u}=t,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:m=!1,padding:y=0}=ns(e,t),v=I3(y),k=l[m?p==="floating"?"reference":"floating":p],E=Bf(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(k)))==null||n?k:k.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:f,strategy:u})),_=p==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),A=await(s.isElement==null?void 0:s.isElement(T))&&await(s.getScale==null?void 0:s.getScale(T))||{x:1,y:1},N=Bf(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:_,offsetParent:T,strategy:u}):_);return{top:(E.top-N.top+v.top)/A.y,bottom:(N.bottom-E.bottom+v.bottom)/A.y,left:(E.left-N.left+v.left)/A.x,right:(N.right-E.right+v.right)/A.x}}const GD=50,JD=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,l=i.detectOverflow?i:{...i,detectOverflow:KD},u=await(i.isRTL==null?void 0:i.isRTL(e));let d=await i.getElementRects({reference:t,floating:e,strategy:o}),{x:f,y:p}=T2(d,r,u),m=r,y=0;const v={};for(let b=0;b<s.length;b++){const k=s[b];if(!k)continue;const{name:E,fn:_}=k,{x:T,y:A,data:N,reset:D}=await _({x:f,y:p,initialPlacement:r,placement:m,strategy:o,middlewareData:v,rects:d,platform:l,elements:{reference:t,floating:e}});f=T??f,p=A??p,v[E]={...v[E],...N},D&&y<GD&&(y++,typeof D=="object"&&(D.placement&&(m=D.placement),D.rects&&(d=D.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:o}):D.rects),{x:f,y:p}=T2(d,m,u)),b=-1)}return{x:f,y:p,placement:m,strategy:o,middlewareData:v}},ZD=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:o,rects:s,platform:i,elements:l,middlewareData:u}=e,{element:d,padding:f=0}=ns(t,e)||{};if(d==null)return{};const p=I3(f),m={x:n,y:r},y=Dy(o),v=Ny(y),b=await i.getDimensions(d),k=y==="y",E=k?"top":"left",_=k?"bottom":"right",T=k?"clientHeight":"clientWidth",A=s.reference[v]+s.reference[y]-m[y]-s.floating[v],N=m[y]-s.reference[y],D=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let I=D?D[T]:0;(!I||!await(i.isElement==null?void 0:i.isElement(D)))&&(I=l.floating[T]||s.floating[v]);const P=A/2-N/2,O=I/2-b[v]/2-1,U=ni(p[E],O),J=ni(p[_],O),K=I-b[v]-J,q=I/2-b[v]/2+P,Z=O3(U,q,K),Q=!u.arrow&&xl(o)!=null&&q!==Z&&s.reference[v]/2-(q<U?U:J)-b[v]/2<0,G=Q?q<U?q-U:q-K:0;return{[y]:m[y]+G,data:{[y]:Z,centerOffset:q-Z-G,...Q&&{alignmentOffset:G}},reset:Q}}}),YD=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:l,platform:u,elements:d}=e,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:b=!0,...k}=ns(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const E=ri(o),_=fo(l),T=ri(l)===l,A=await(u.isRTL==null?void 0:u.isRTL(d.floating)),N=m||(T||!b?[$f(l)]:BD(l)),D=v!=="none";!m&&D&&N.push(...WD(l,b,v,A));const I=[l,...N],P=await u.detectOverflow(e,k),O=[];let U=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&O.push(P[E]),p){const Z=$D(o,i,A);O.push(P[Z[0]],P[Z[1]])}if(U=[...U,{placement:o,overflows:O}],!O.every(Z=>Z<=0)){var J,K;const Z=(((J=s.flip)==null?void 0:J.index)||0)+1,Q=I[Z];if(Q&&(!(p==="alignment"?_!==fo(Q):!1)||U.every(W=>fo(W.placement)===_?W.overflows[0]>0:!0)))return{data:{index:Z,overflows:U},reset:{placement:Q}};let G=(K=U.filter(Y=>Y.overflows[0]<=0).sort((Y,W)=>Y.overflows[1]-W.overflows[1])[0])==null?void 0:K.placement;if(!G)switch(y){case"bestFit":{var q;const Y=(q=U.filter(W=>{if(D){const ee=fo(W.placement);return ee===_||ee==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(ee=>ee>0).reduce((ee,z)=>ee+z,0)]).sort((W,ee)=>W[1]-ee[1])[0])==null?void 0:q[0];Y&&(G=Y);break}case"initialPlacement":G=l;break}if(o!==G)return{reset:{placement:G}}}return{}}}};function M2(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function A2(t){return zD.some(e=>t[e]>=0)}const XD=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:o="referenceHidden",...s}=ns(t,e);switch(o){case"referenceHidden":{const i=await r.detectOverflow(e,{...s,elementContext:"reference"}),l=M2(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:A2(l)}}}case"escaped":{const i=await r.detectOverflow(e,{...s,altBoundary:!0}),l=M2(i,n.floating);return{data:{escapedOffsets:l,escaped:A2(l)}}}default:return{}}}}},P3=new Set(["left","top"]);async function QD(t,e){const{placement:n,platform:r,elements:o}=t,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=ri(n),l=xl(n),u=fo(n)==="y",d=P3.has(i)?-1:1,f=s&&u?-1:1,p=ns(e,t);let{mainAxis:m,crossAxis:y,alignmentAxis:v}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof v=="number"&&(y=l==="end"?v*-1:v),u?{x:y*f,y:m*d}:{x:m*d,y:y*f}}const e8=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:o,y:s,placement:i,middlewareData:l}=e,u=await QD(e,t);return i===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:s+u.y,data:{...u,placement:i}}}}},t8=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:o,platform:s}=e,{mainAxis:i=!0,crossAxis:l=!1,limiter:u={fn:_=>{let{x:T,y:A}=_;return{x:T,y:A}}},...d}=ns(t,e),f={x:n,y:r},p=await s.detectOverflow(e,d),m=fo(o),y=Ay(m);let v=f[y],b=f[m];const k=(_,T)=>O3(T+p[_==="y"?"top":"left"],T,T-p[_==="y"?"bottom":"right"]);i&&(v=k(y,v)),l&&(b=k(m,b));const E=u.fn({...e,[y]:v,[m]:b});return{...E,data:{x:E.x-n,y:E.y-r,enabled:{[y]:i,[m]:l}}}}}},n8=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,r;const{x:o,y:s,placement:i,rects:l,middlewareData:u}=e,{offset:d=0,mainAxis:f=!0,crossAxis:p=!0}=ns(t,e),m={x:o,y:s},y=fo(i),v=Ay(y);let b=m[v],k=m[y];const E=ns(d,e),_=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:(n=E.mainAxis)!=null?n:0,crossAxis:(r=E.crossAxis)!=null?r:0};if(f){const N=v==="y"?"height":"width",D=l.reference[v]-l.floating[N]+_.mainAxis,I=l.reference[v]+l.reference[N]-_.mainAxis;b<D?b=D:b>I&&(b=I)}if(p){var T,A;const N=v==="y"?"width":"height",D=P3.has(ri(i)),I=l.reference[y]-l.floating[N]+(D&&((T=u.offset)==null?void 0:T[y])||0)+(D?0:_.crossAxis),P=l.reference[y]+l.reference[N]+(D?0:((A=u.offset)==null?void 0:A[y])||0)-(D?_.crossAxis:0);k<I?k=I:k>P&&(k=P)}return{[v]:b,[y]:k}}}},r8=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:o,elements:s}=e,{apply:i=()=>{},...l}=ns(t,e),u=await o.detectOverflow(e,l),d=ri(n),f=xl(n),p=fo(n)==="y",{width:m,height:y}=r.floating;let v,b;d==="top"||d==="bottom"?(v=d,b=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(b=d,v=f==="end"?"top":"bottom");const k=y-u.top-u.bottom,E=m-u.left-u.right,_=ni(y-u[v],k),T=ni(m-u[b],E),A=e.middlewareData.shift,N=!A;let D=_,I=T;A!=null&&A.enabled.x&&(I=E),A!=null&&A.enabled.y&&(D=k),N&&!f&&(p?I=m-2*Jo(u.left,u.right):D=y-2*Jo(u.top,u.bottom)),await i({...e,availableWidth:I,availableHeight:D});const P=await o.getDimensions(s.floating);return m!==P.width||y!==P.height?{reset:{rects:!0}}:{}}}};function lp(){return typeof window<"u"}function vl(t){return j3(t)?(t.nodeName||"").toLowerCase():"#document"}function Yn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function as(t){var e;return(e=(j3(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function j3(t){return lp()?t instanceof Node||t instanceof Yn(t).Node:!1}function vo(t){return lp()?t instanceof Element||t instanceof Yn(t).Element:!1}function ci(t){return lp()?t instanceof HTMLElement||t instanceof Yn(t).HTMLElement:!1}function N2(t){return!lp()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Yn(t).ShadowRoot}function up(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=bo(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&o!=="inline"&&o!=="contents"}function o8(t){return/^(table|td|th)$/.test(vl(t))}function cp(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const s8=/transform|translate|scale|rotate|perspective|filter/,i8=/paint|layout|strict|content/,Ri=t=>!!t&&t!=="none";let W0;function Ry(t){const e=vo(t)?bo(t):t;return Ri(e.transform)||Ri(e.translate)||Ri(e.scale)||Ri(e.rotate)||Ri(e.perspective)||!Oy()&&(Ri(e.backdropFilter)||Ri(e.filter))||s8.test(e.willChange||"")||i8.test(e.contain||"")}function a8(t){let e=Gi(t);for(;ci(e)&&!Bu(e);){if(Ry(e))return e;if(cp(e))return null;e=Gi(e)}return null}function Oy(){return W0==null&&(W0=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),W0}function Bu(t){return/^(html|body|#document)$/.test(vl(t))}function bo(t){return Yn(t).getComputedStyle(t)}function dp(t){return vo(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Gi(t){if(vl(t)==="html")return t;const e=t.assignedSlot||t.parentNode||N2(t)&&t.host||as(t);return N2(e)?e.host:e}function L3(t){const e=Gi(t);return Bu(e)?(t.ownerDocument||t).body:ci(e)&&up(e)?e:L3(e)}function Vu(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const o=L3(t),s=o===((r=t.ownerDocument)==null?void 0:r.body),i=Yn(o);if(s){const l=f1(i);return e.concat(i,i.visualViewport||[],up(o)?o:[],l&&n?Vu(l):[])}else return e.concat(o,Vu(o,[],n))}function f1(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function z3(t){const e=bo(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=ci(t),s=o?t.offsetWidth:n,i=o?t.offsetHeight:r,l=Ff(n)!==s||Ff(r)!==i;return l&&(n=s,r=i),{width:n,height:r,$:l}}function Iy(t){return vo(t)?t:t.contextElement}function Ja(t){const e=Iy(t);if(!ci(e))return Zo(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:s}=z3(e);let i=(s?Ff(n.width):n.width)/r,l=(s?Ff(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const l8=Zo(0);function F3(t){const e=Yn(t);return!Oy()||!e.visualViewport?l8:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function u8(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===Yn(t)}function Ji(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),s=Iy(t);let i=Zo(1);e&&(r?vo(r)&&(i=Ja(r)):i=Ja(t));const l=u8(s,n,r)?F3(s):Zo(0);let u=(o.left+l.x)/i.x,d=(o.top+l.y)/i.y,f=o.width/i.x,p=o.height/i.y;if(s&&r){const m=Yn(s),y=vo(r)?Yn(r):r;let v=m,b=f1(v);for(;b&&y!==v;){const k=Ja(b),E=b.getBoundingClientRect(),_=bo(b),T=E.left+(b.clientLeft+parseFloat(_.paddingLeft))*k.x,A=E.top+(b.clientTop+parseFloat(_.paddingTop))*k.y;u*=k.x,d*=k.y,f*=k.x,p*=k.y,u+=T,d+=A,v=Yn(b),b=f1(v)}}return Bf({width:f,height:p,x:u,y:d})}function fp(t,e){const n=dp(t).scrollLeft;return e?e.left+n:Ji(as(t)).left+n}function $3(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-fp(t,n),o=n.top+e.scrollTop;return{x:r,y:o}}function c8(t){let{elements:e,rect:n,offsetParent:r,strategy:o}=t;const s=o==="fixed",i=as(r),l=e?cp(e.floating):!1;if(r===i||l&&s)return n;let u={scrollLeft:0,scrollTop:0},d=Zo(1);const f=Zo(0),p=ci(r);if((p||!s)&&((vl(r)!=="body"||up(i))&&(u=dp(r)),p)){const y=Ji(r);d=Ja(r),f.x=y.x+r.clientLeft,f.y=y.y+r.clientTop}const m=i&&!p&&!s?$3(i,u):Zo(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+f.x+m.x,y:n.y*d.y-u.scrollTop*d.y+f.y+m.y}}function d8(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function f8(t){const e=dp(t),n=t.ownerDocument.body,r=Jo(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=Jo(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-e.scrollLeft+fp(t);const i=-e.scrollTop;return bo(n).direction==="rtl"&&(s+=Jo(t.clientWidth,n.clientWidth)-r),{width:r,height:o,x:s,y:i}}const h8=25;function p8(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",o=Yn(t),s=as(t),i=o.visualViewport;let l=s.clientWidth,u=s.clientHeight,d=0,f=0;if(i){const m=!Oy()||e==="fixed";r?m||(d=-i.offsetLeft,f=-i.offsetTop):(l=i.width,u=i.height,m&&(d=i.offsetLeft,f=i.offsetTop))}if(fp(s)<=0){const m=s.ownerDocument,y=m.body,v=getComputedStyle(y),b=m.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,k=Math.abs(s.clientWidth-y.clientWidth-b),E=getComputedStyle(s).scrollbarGutter==="stable both-edges"?k/2:k;E<=h8&&(l-=E)}return{width:l,height:u,x:d,y:f}}function m8(t,e){const n=Ji(t,!0,e==="fixed"),r=n.top+t.clientTop,o=n.left+t.clientLeft,s=Ja(t),i=t.clientWidth*s.x,l=t.clientHeight*s.y,u=o*s.x,d=r*s.y;return{width:i,height:l,x:u,y:d}}function D2(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=p8(t,n,e);else if(e==="document")r=f8(as(t));else if(vo(e))r=m8(e,n);else{const o=F3(t);r={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return Bf(r)}function g8(t,e){const n=e.get(t);if(n)return n;let r=Vu(t,[],!1).filter(l=>vo(l)&&vl(l)!=="body"),o=null;const s=bo(t).position==="fixed";let i=s?Gi(t):t;for(;vo(i)&&!Bu(i);){const l=bo(i),u=Ry(i),d=o?o.position:s?"fixed":"";!u&&(d==="fixed"||d==="absolute"&&l.position==="static")?r=r.filter(p=>p!==i):o=l,i=Gi(i)}return e.set(t,r),r}function y8(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const i=[...n==="clippingAncestors"?cp(e)?[]:g8(e,this._c):[].concat(n),r],l=D2(e,i[0],o);let u=l.top,d=l.right,f=l.bottom,p=l.left;for(let m=1;m<i.length;m++){const y=D2(e,i[m],o);u=Jo(y.top,u),d=ni(y.right,d),f=ni(y.bottom,f),p=Jo(y.left,p)}return{width:d-p,height:f-u,x:p,y:u}}function x8(t){const{width:e,height:n}=z3(t);return{width:e,height:n}}function v8(t,e,n){const r=ci(e),o=as(e),s=n==="fixed",i=Ji(t,!0,s,e);let l={scrollLeft:0,scrollTop:0};const u=Zo(0);if((r||!s)&&((vl(e)!=="body"||up(o))&&(l=dp(e)),r)){const m=Ji(e,!0,s,e);u.x=m.x+e.clientLeft,u.y=m.y+e.clientTop}!r&&o&&(u.x=fp(o));const d=o&&!r&&!s?$3(o,l):Zo(0),f=i.left+l.scrollLeft-u.x-d.x,p=i.top+l.scrollTop-u.y-d.y;return{x:f,y:p,width:i.width,height:i.height}}function q0(t){return bo(t).position==="static"}function R2(t,e){if(!ci(t)||bo(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return as(t)===n&&(n=n.ownerDocument.body),n}function B3(t,e){const n=Yn(t);if(cp(t))return n;if(!ci(t)){let o=Gi(t);for(;o&&!Bu(o);){if(vo(o)&&!q0(o))return o;o=Gi(o)}return n}let r=R2(t,e);for(;r&&o8(r)&&q0(r);)r=R2(r,e);return r&&Bu(r)&&q0(r)&&!Ry(r)?n:r||a8(t)||n}const b8=async function(t){const e=this.getOffsetParent||B3,n=this.getDimensions,r=await n(t.floating);return{reference:v8(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function k8(t){return bo(t).direction==="rtl"}const w8={convertOffsetParentRelativeRectToViewportRelativeRect:c8,getDocumentElement:as,getClippingRect:y8,getOffsetParent:B3,getElementRects:b8,getClientRects:d8,getDimensions:x8,getScale:Ja,isElement:vo,isRTL:k8};function V3(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function C8(t,e,n){let r=null,o;const s=as(t);function i(){var f;clearTimeout(o),(f=r)==null||f.disconnect(),r=null}function l(f,p){f===void 0&&(f=!1),p===void 0&&(p=1),i();const m=t.getBoundingClientRect(),{left:y,top:v,width:b,height:k}=m;if(f||e(),!b||!k)return;const E=ef(v),_=ef(s.clientWidth-(y+b)),T=ef(s.clientHeight-(v+k)),A=ef(y),D={rootMargin:-E+"px "+-_+"px "+-T+"px "+-A+"px",threshold:Jo(0,ni(1,p))||1};let I=!0;function P(O){const U=O[0].intersectionRatio;if(!V3(m,t.getBoundingClientRect()))return l();if(U!==p){if(!I)return l();U?l(!1,U):o=setTimeout(()=>{l(!1,1e-7)},1e3)}I=!1}try{r=new IntersectionObserver(P,{...D,root:s.ownerDocument})}catch{r=new IntersectionObserver(P,D)}r.observe(t)}const u=Yn(t),d=()=>l(n);return u.addEventListener("resize",d),l(!0),()=>{u.removeEventListener("resize",d),i()}}function S8(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=Iy(t),f=o||s?[...d?Vu(d):[],...e?Vu(e):[]]:[];f.forEach(E=>{o&&E.addEventListener("scroll",n),s&&E.addEventListener("resize",n)});const p=d&&l?C8(d,n,s):null;let m=-1,y=null;i&&(y=new ResizeObserver(E=>{let[_]=E;_&&_.target===d&&y&&e&&(y.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var T;(T=y)==null||T.observe(e)})),n()}),d&&!u&&y.observe(d),e&&y.observe(e));let v,b=u?Ji(t):null;u&&k();function k(){const E=Ji(t);b&&!V3(b,E)&&n(),b=E,v=requestAnimationFrame(k)}return n(),()=>{var E;f.forEach(_=>{o&&_.removeEventListener("scroll",n),s&&_.removeEventListener("resize",n)}),p==null||p(),(E=y)==null||E.disconnect(),y=null,u&&cancelAnimationFrame(v)}}const E8=e8,_8=t8,T8=YD,M8=r8,A8=XD,O2=ZD,N8=n8,D8=(t,e,n)=>{const r=new Map,o=n??{},s={...w8,...o.platform,_c:r};return JD(t,e,{...o,platform:s})};var R8=typeof document<"u",O8=function(){},Nf=R8?C.useLayoutEffect:O8;function Vf(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(!Vf(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 s=o[r];if(!(s==="_owner"&&t.$$typeof)&&!Vf(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function H3(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function I2(t,e){const n=H3(t);return Math.round(e*n)/n}function K0(t){const e=C.useRef(t);return Nf(()=>{e.current=t}),e}function I8(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:l=!0,whileElementsMounted:u,open:d}=t,[f,p]=C.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,y]=C.useState(r);Vf(m,r)||y(r);const[v,b]=C.useState(null),[k,E]=C.useState(null),_=C.useCallback(W=>{W!==D.current&&(D.current=W,b(W))},[]),T=C.useCallback(W=>{W!==I.current&&(I.current=W,E(W))},[]),A=s||v,N=i||k,D=C.useRef(null),I=C.useRef(null),P=C.useRef(f),O=u!=null,U=K0(u),J=K0(o),K=K0(d),q=C.useCallback(()=>{if(!D.current||!I.current)return;const W={placement:e,strategy:n,middleware:m};J.current&&(W.platform=J.current),D8(D.current,I.current,W).then(ee=>{const z={...ee,isPositioned:K.current!==!1};Z.current&&!Vf(P.current,z)&&(P.current=z,Vr.flushSync(()=>{p(z)}))})},[m,e,n,J,K]);Nf(()=>{d===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,p(W=>({...W,isPositioned:!1})))},[d]);const Z=C.useRef(!1);Nf(()=>(Z.current=!0,()=>{Z.current=!1}),[]),Nf(()=>{if(A&&(D.current=A),N&&(I.current=N),A&&N){if(U.current)return U.current(A,N,q);q()}},[A,N,q,U,O]);const Q=C.useMemo(()=>({reference:D,floating:I,setReference:_,setFloating:T}),[_,T]),G=C.useMemo(()=>({reference:A,floating:N}),[A,N]),Y=C.useMemo(()=>{const W={position:n,left:0,top:0};if(!G.floating)return W;const ee=I2(G.floating,f.x),z=I2(G.floating,f.y);return l?{...W,transform:"translate("+ee+"px, "+z+"px)",...H3(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ee,top:z}},[n,l,G.floating,f.x,f.y]);return C.useMemo(()=>({...f,update:q,refs:Q,elements:G,floatingStyles:Y}),[f,q,Q,G,Y])}const P8=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?O2({element:r.current,padding:o}).fn(n):{}:r?O2({element:r,padding:o}).fn(n):{}}}},j8=(t,e)=>{const n=E8(t);return{name:n.name,fn:n.fn,options:[t,e]}},L8=(t,e)=>{const n=_8(t);return{name:n.name,fn:n.fn,options:[t,e]}},z8=(t,e)=>({fn:N8(t).fn,options:[t,e]}),F8=(t,e)=>{const n=T8(t);return{name:n.name,fn:n.fn,options:[t,e]}},$8=(t,e)=>{const n=M8(t);return{name:n.name,fn:n.fn,options:[t,e]}},B8=(t,e)=>{const n=A8(t);return{name:n.name,fn:n.fn,options:[t,e]}},V8=(t,e)=>{const n=P8(t);return{name:n.name,fn:n.fn,options:[t,e]}};var H8=Object.defineProperty,U8=(t,e)=>H8(t,"name",{value:e,configurable:!0}),W8=C.forwardRef(U8(function(e,n){const{children:r,width:o=10,height:s=5,...i}=e;return x.jsx(ot.svg,{...i,ref:n,width:o,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:x.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),q8=W8,K8=Object.defineProperty,Yo=(t,e)=>K8(t,"name",{value:e,configurable:!0}),U3="Popper",[W3,bl]=wo(U3),[G8,q3]=W3(U3),J8=Yo(t=>{const{__scopePopper:e,children:n}=t,[r,o]=C.useState(null),[s,i]=C.useState(void 0);return x.jsx(G8,{scope:e,anchor:r,onAnchorChange:o,placementState:s,setPlacementState:i,children:n})},"Popper"),Z8="PopperAnchor",Y8=C.forwardRef(Yo(function(e,n){const{__scopePopper:r,virtualRef:o,...s}=e,i=q3(Z8,r),l=C.useRef(null),u=i.onAnchorChange,d=C.useCallback(b=>{l.current=b,b&&u(b)},[u]),f=rt(n,d),p=C.useRef(null);C.useEffect(()=>{if(!o)return;const b=p.current;p.current=o.current,b!==p.current&&u(p.current)});const m=i.placementState&&hp(i.placementState),y=m==null?void 0:m[0],v=m==null?void 0:m[1];return o?null:x.jsx(ot.div,{"data-radix-popper-side":y,"data-radix-popper-align":v,...s,ref:f})},"PopperAnchor")),K3="PopperContent",[X8,Q8]=W3(K3),eR=C.forwardRef(Yo(function(e,n){var ce,pe,Le,Ne,$e,Ze,Mt;const{__scopePopper:r,side:o="bottom",sideOffset:s=0,align:i="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:y=!1,updatePositionStrategy:v="optimized",onPlaced:b,...k}=e,E=q3(K3,r),[_,T]=C.useState(null),A=rt(n,T),[N,D]=C.useState(null),I=R3(N),P=(I==null?void 0:I.width)??0,O=(I==null?void 0:I.height)??0,U=o+(i!=="center"?"-"+i:""),J=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},K=Array.isArray(f)?f:[f],q=K.length>0,Z={padding:J,boundary:K.filter(G3),altBoundary:q},{refs:Q,floatingStyles:G,placement:Y,isPositioned:W,middlewareData:ee}=I8({strategy:"fixed",placement:U,whileElementsMounted:Yo((...Pt)=>S8(...Pt,{animationFrame:v==="always"}),"whileElementsMounted"),elements:{reference:E.anchor},middleware:[j8({mainAxis:s+O,alignmentAxis:l}),d&&L8({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?z8():void 0,...Z}),d&&F8({...Z}),$8({...Z,apply:Yo(({elements:Pt,rects:Ht,availableWidth:zn,availableHeight:Ut})=>{const{width:en,height:An}=Ht.reference,ht=Pt.floating.style;ht.setProperty("--radix-popper-available-width",`${zn}px`),ht.setProperty("--radix-popper-available-height",`${Ut}px`),ht.setProperty("--radix-popper-anchor-width",`${en}px`),ht.setProperty("--radix-popper-anchor-height",`${An}px`)},"apply")}),N&&V8({element:N,padding:u}),oR({arrowWidth:P,arrowHeight:O}),y&&B8({strategy:"referenceHidden",...Z,boundary:q?Z.boundary:void 0})]}),z=E.setPlacementState;Rt(()=>(z(Y),()=>{z(void 0)}),[Y,z]);const[j,B]=hp(Y),ne=Nr(b);Rt(()=>{W&&(ne==null||ne())},[W,ne]);const fe=(ce=ee.arrow)==null?void 0:ce.x,ue=(pe=ee.arrow)==null?void 0:pe.y,he=((Le=ee.arrow)==null?void 0:Le.centerOffset)!==0,[Ae,X]=C.useState();return Rt(()=>{_&&X(window.getComputedStyle(_).zIndex)},[_]),x.jsx("div",{ref:Q.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:W?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ae,"--radix-popper-transform-origin":[(Ne=ee.transformOrigin)==null?void 0:Ne.x,($e=ee.transformOrigin)==null?void 0:$e.y].join(" "),...((Ze=ee.hide)==null?void 0:Ze.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:x.jsx(X8,{scope:r,placedSide:j,placedAlign:B,onArrowChange:D,arrowX:fe,arrowY:ue,shouldHideArrow:he,children:x.jsx(ot.div,{"data-side":j,"data-align":B,...k,ref:A,style:{...k.style,animation:W?(Mt=k.style)==null?void 0:Mt.animation:"none"}})})})},"PopperContent")),tR="PopperArrow",nR={top:"bottom",right:"left",bottom:"top",left:"right"},rR=C.forwardRef(Yo(function(e,n){const{__scopePopper:r,...o}=e,s=Q8(tR,r),i=nR[s.placedSide];return x.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:x.jsx(q8,{...o,ref:n,style:{...o.style,display:"block"}})})},"PopperArrow"));function G3(t){return t!==null}Yo(G3,"isNotNull");var oR=Yo(t=>({name:"transformOrigin",options:t,fn(e){var k,E,_;const{placement:n,rects:r,middlewareData:o}=e,i=((k=o.arrow)==null?void 0:k.centerOffset)!==0,l=i?0:t.arrowWidth,u=i?0:t.arrowHeight,[d,f]=hp(n),p={start:"0%",center:"50%",end:"100%"}[f],m=(((E=o.arrow)==null?void 0:E.x)??0)+l/2,y=(((_=o.arrow)==null?void 0:_.y)??0)+u/2;let v="",b="";return d==="bottom"?(v=i?p:`${m}px`,b=`${-u}px`):d==="top"?(v=i?p:`${m}px`,b=`${r.floating.height+u}px`):d==="right"?(v=`${-u}px`,b=i?p:`${y}px`):d==="left"&&(v=`${r.floating.width+u}px`,b=i?p:`${y}px`),{data:{x:v,y:b}}}}),"transformOrigin");function hp(t){const[e,n="center"]=t.split("-");return[e,n]}Yo(hp,"getSideAndAlignFromPlacement");var Py=J8,jy=Y8,Ly=eR,sR=rR,iR=Object.defineProperty,zy=(t,e)=>iR(t,"name",{value:e,configurable:!0}),G0=!1;function J3(){const[t,e]=C.useState(G0);return C.useEffect(()=>{G0||(G0=!0,e(!0))},[]),t}zy(J3,"useIsHydrated");var Z3=gl[" useSyncExternalStore ".trim().toString()];function Y3(){return()=>{}}zy(Y3,"subscribe");function X3(){return Z3(Y3,()=>!0,()=>!1)}zy(X3,"useIsHydratedModern");var aR=typeof Z3=="function"?X3:J3,lR=Object.defineProperty,ia=(t,e)=>lR(t,"name",{value:e,configurable:!0}),J0="rovingFocusGroup.onEntryFocus",uR={bubbles:!1,cancelable:!0},pp="RovingFocusGroup",[h1,Q3,cR]=tp(pp),[dR,eE]=wo(pp,[cR]),[fR,hR]=dR(pp),pR=C.forwardRef(ia(function(e,n){return x.jsx(h1.Provider,{scope:e.__scopeRovingFocusGroup,children:x.jsx(h1.Slot,{scope:e.__scopeRovingFocusGroup,children:x.jsx(mR,{...e,ref:n})})})},"RovingFocusGroup")),mR=C.forwardRef(ia(function(e,n){const{__scopeRovingFocusGroup:r,orientation:o,loop:s=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:p=!1,...m}=e,y=C.useRef(null),v=rt(n,y),b=np(i),[k,E]=Ki({prop:l,defaultProp:u??null,onChange:d,caller:pp}),[_,T]=C.useState(!1),A=Nr(f),N=Q3(r),D=C.useRef(!1),[I,P]=C.useState(0);return C.useEffect(()=>{const O=y.current;if(O)return O.addEventListener(J0,A),()=>O.removeEventListener(J0,A)},[A]),x.jsx(fR,{scope:r,orientation:o,dir:b,loop:s,currentTabStopId:k,onItemFocus:C.useCallback(O=>E(O),[E]),onItemShiftTab:C.useCallback(()=>T(!0),[]),onFocusableItemAdd:C.useCallback(()=>P(O=>O+1),[]),onFocusableItemRemove:C.useCallback(()=>P(O=>O-1),[]),children:x.jsx(ot.div,{tabIndex:_||I===0?-1:0,"data-orientation":o,...m,ref:v,style:{outline:"none",...e.style},onMouseDown:Re(e.onMouseDown,()=>{D.current=!0}),onFocus:Re(e.onFocus,O=>{const U=!D.current;if(O.target===O.currentTarget&&U&&!_){const J=new CustomEvent(J0,uR);if(O.currentTarget.dispatchEvent(J),!J.defaultPrevented){const K=N().filter(Y=>Y.focusable),q=K.find(Y=>Y.active),Z=K.find(Y=>Y.id===k),G=[q,Z,...K].filter(Boolean).map(Y=>Y.ref.current);Fy(G,p)}}D.current=!1}),onBlur:Re(e.onBlur,()=>T(!1))})})},"RovingFocusGroupImpl")),gR="RovingFocusGroupItem",yR=C.forwardRef(ia(function(e,n){const{__scopeRovingFocusGroup:r,focusable:o=!0,active:s=!1,tabStopId:i,children:l,...u}=e,d=go(),f=i||d,p=hR(gR,r),m=p.currentTabStopId===f,y=Q3(r),{onFocusableItemAdd:v,onFocusableItemRemove:b,currentTabStopId:k}=p,E=aR();return Rt(()=>{if(!(!E||!o))return v(),()=>b()},[E,o,v,b]),C.useEffect(()=>{if(!(E||!o))return v(),()=>b()},[E,o,v,b]),x.jsx(h1.ItemSlot,{scope:r,id:f,focusable:o,active:s,children:x.jsx(ot.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...u,ref:n,onMouseDown:Re(e.onMouseDown,_=>{o?p.onItemFocus(f):_.preventDefault()}),onFocus:Re(e.onFocus,()=>p.onItemFocus(f)),onKeyDown:Re(e.onKeyDown,_=>{if(_.key==="Tab"&&_.shiftKey){p.onItemShiftTab();return}if(_.target!==_.currentTarget)return;const T=nE(_,p.orientation,p.dir);if(T!==void 0){if(_.metaKey||_.ctrlKey||_.altKey||_.shiftKey)return;_.preventDefault();let N=y().filter(D=>D.focusable).map(D=>D.ref.current);if(T==="last")N.reverse();else if(T==="prev"||T==="next"){T==="prev"&&N.reverse();const D=N.indexOf(_.currentTarget);N=p.loop?rE(N,D+1):N.slice(D+1)}setTimeout(()=>Fy(N))}}),children:typeof l=="function"?l({isCurrentTabStop:m,hasTabStop:k!=null}):l})})},"RovingFocusGroupItem")),xR={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function tE(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}ia(tE,"getDirectionAwareKey");function nE(t,e,n){const r=tE(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return xR[r]}ia(nE,"getFocusIntent");function Fy(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}ia(Fy,"focusFirst");function rE(t,e){return t.map((n,r)=>t[(e+r)%t.length])}ia(rE,"wrapArray");var vR=pR,bR=yR,kR=Object.defineProperty,ct=(t,e)=>kR(t,"name",{value:e,configurable:!0}),wR=["Enter"," "],CR=["ArrowDown","PageUp","Home"],oE=["ArrowUp","PageDown","End"],SR=[...CR,...oE],mp="Menu",[p1,ER,_R]=tp(mp),[aa,sE]=wo(mp,[_R,bl,eE]),$y=bl(),iE=eE(),[TR,vc]=aa(mp),[MR,By]=aa(mp),AR=ct(t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=t,l=$y(e),[u,d]=C.useState(null),f=C.useRef(!1),p=Nr(s),m=np(o);return C.useEffect(()=>{const y=ct(()=>{f.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},"handleKeyDown"),v=ct(()=>f.current=!1,"handlePointer");return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),C.useEffect(()=>{if(!n)return;const y=ct(()=>p(!1),"handleBlur");return window.addEventListener("blur",y),()=>window.removeEventListener("blur",y)},[n,p]),x.jsx(Py,{...l,children:x.jsx(TR,{scope:e,open:n,onOpenChange:p,content:u,onContentChange:d,children:x.jsx(MR,{scope:e,onClose:C.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:m,modal:i,children:r})})})},"Menu"),NR=C.forwardRef(ct(function(e,n){const{__scopeMenu:r,...o}=e,s=$y(r);return x.jsx(jy,{...s,...o,ref:n})},"MenuAnchor")),aE="MenuPortal",[DR,RR]=aa(aE,{forceMount:void 0}),OR=ct(t=>{const{__scopeMenu:e,forceMount:n,children:r,container:o}=t,s=vc(aE,e);return x.jsx(DR,{scope:e,forceMount:n,children:x.jsx(is,{present:n||s.open,children:x.jsx(op,{asChild:!0,container:o,children:r})})})},"MenuPortal"),Ks="MenuContent",[IR,lE]=aa(Ks),PR=C.forwardRef(ct(function(e,n){const r=RR(Ks,e.__scopeMenu),{forceMount:o=r.forceMount,...s}=e,i=vc(Ks,e.__scopeMenu),l=By(Ks,e.__scopeMenu);return x.jsx(p1.Provider,{scope:e.__scopeMenu,children:x.jsx(is,{present:o||i.open,children:x.jsx(p1.Slot,{scope:e.__scopeMenu,children:l.modal?x.jsx(jR,{...s,ref:n}):x.jsx(LR,{...s,ref:n})})})})},"MenuContent")),jR=C.forwardRef(ct(function(e,n){const r=vc(Ks,e.__scopeMenu),o=C.useRef(null),s=rt(n,o);return C.useEffect(()=>{const i=o.current;if(i)return _y(i)},[]),x.jsx(uE,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Re(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),LR=C.forwardRef(ct(function(e,n){const r=vc(Ks,e.__scopeMenu);return x.jsx(uE,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),zR=xo("MenuContent.ScrollLock"),uE=C.forwardRef(ct(function(e,n){const{__scopeMenu:r,loop:o=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEntryFocus:d,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:m,onInteractOutside:y,onDismiss:v,disableOutsideScroll:b,...k}=e,E=vc(Ks,r),_=By(Ks,r),T=$y(r),A=iE(r),N=ER(r),[D,I]=C.useState(null),P=C.useRef(null),O=rt(n,P,E.onContentChange),U=C.useRef(0),J=C.useRef(""),K=C.useRef(0),q=C.useRef(null),Z=C.useRef("right"),Q=C.useRef(0),G=b?ip:C.Fragment,Y=b?{as:zR,allowPinchZoom:!0}:void 0,W=ct(z=>{var X,ce;const j=J.current+z,B=N().filter(pe=>!pe.disabled),ne=document.activeElement,fe=(X=B.find(pe=>pe.ref.current===ne))==null?void 0:X.textValue,ue=B.map(pe=>pe.textValue),he=mE(ue,j,fe),Ae=(ce=B.find(pe=>pe.textValue===he))==null?void 0:ce.ref.current;ct((function pe(Le){J.current=Le,window.clearTimeout(U.current),Le!==""&&(U.current=window.setTimeout(()=>pe(""),1e3))}),"updateSearch")(j),Ae&&setTimeout(()=>Ae.focus())},"handleTypeaheadSearch");C.useEffect(()=>()=>window.clearTimeout(U.current),[]),xc();const ee=C.useCallback(z=>{var B,ne;return Z.current===((B=q.current)==null?void 0:B.side)&&yE(z,(ne=q.current)==null?void 0:ne.area)},[]);return x.jsx(IR,{scope:r,searchRef:J,onItemEnter:C.useCallback(z=>{ee(z)&&z.preventDefault()},[ee]),onItemLeave:C.useCallback(z=>{var j;ee(z)||((j=P.current)==null||j.focus(),I(null))},[ee]),onTriggerLeave:C.useCallback(z=>{ee(z)&&z.preventDefault()},[ee]),pointerGraceTimerRef:K,onPointerGraceIntentChange:C.useCallback(z=>{q.current=z},[]),children:x.jsx(G,{...Y,children:x.jsx(Cy,{asChild:!0,trapped:s,onMountAutoFocus:Re(i,z=>{var j;z.preventDefault(),(j=P.current)==null||j.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:x.jsx(rp,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:m,onInteractOutside:y,onDismiss:v,children:x.jsx(vR,{asChild:!0,...A,dir:_.dir,orientation:"vertical",loop:o,currentTabStopId:D,onCurrentTabStopIdChange:I,onEntryFocus:Re(d,z=>{_.isUsingKeyboardRef.current||z.preventDefault()}),preventScrollOnEntryFocus:!0,children:x.jsx(Ly,{role:"menu","aria-orientation":"vertical","data-state":fE(E.open),"data-radix-menu-content":"",dir:_.dir,...T,...k,ref:O,style:{outline:"none",...k.style},onKeyDown:Re(k.onKeyDown,z=>{const B=z.target.closest("[data-radix-menu-content]")===z.currentTarget,ne=z.ctrlKey||z.altKey||z.metaKey,fe=z.key.length===1;B&&(z.key==="Tab"&&z.preventDefault(),!ne&&fe&&W(z.key));const ue=P.current;if(z.target!==ue||!SR.includes(z.key))return;z.preventDefault();const Ae=N().filter(X=>!X.disabled).map(X=>X.ref.current);oE.includes(z.key)&&Ae.reverse(),hE(Ae)}),onBlur:Re(e.onBlur,z=>{z.currentTarget.contains(z.target)||(window.clearTimeout(U.current),J.current="")}),onPointerMove:Re(e.onPointerMove,Hf(z=>{const j=z.target,B=Q.current!==z.clientX;if(z.currentTarget.contains(j)&&B){const ne=z.clientX>Q.current?"right":"left";Z.current=ne,Q.current=z.clientX}}))})})})})})})},"MenuContentImpl")),FR=C.forwardRef(ct(function(e,n){const{__scopeMenu:r,...o}=e;return x.jsx(ot.div,{...o,ref:n})},"MenuLabel")),m1="MenuItem",P2="menu.itemSelect",cE=C.forwardRef(ct(function(e,n){const{disabled:r=!1,onSelect:o,...s}=e,i=C.useRef(null),l=By(m1,e.__scopeMenu),u=lE(m1,e.__scopeMenu),d=rt(n,i),f=C.useRef(!1),p=ct(()=>{const m=i.current;if(!r&&m){const y=new CustomEvent(P2,{bubbles:!0,cancelable:!0});m.addEventListener(P2,v=>o==null?void 0:o(v),{once:!0}),by(m,y),y.defaultPrevented?f.current=!1:l.onClose()}},"handleSelect");return x.jsx($R,{...s,ref:d,disabled:r,onClick:Re(e.onClick,p),onPointerDown:m=>{var y;(y=e.onPointerDown)==null||y.call(e,m),f.current=!0},onPointerUp:Re(e.onPointerUp,m=>{var y;f.current||(y=m.currentTarget)==null||y.click()}),onKeyDown:Re(e.onKeyDown,m=>{r||m.target!==m.currentTarget||u.searchRef.current!==""&&m.key===" "||wR.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})},"MenuItem")),$R=C.forwardRef(ct(function(e,n){const{__scopeMenu:r,disabled:o=!1,textValue:s,...i}=e,l=lE(m1,r),u=iE(r),d=C.useRef(null),f=rt(n,d),[p,m]=C.useState(!1),[y,v]=C.useState("");return C.useEffect(()=>{const b=d.current;b&&v((b.textContent??"").trim())},[i.children]),x.jsx(p1.ItemSlot,{scope:r,disabled:o,textValue:s??y,children:x.jsx(bR,{asChild:!0,...u,focusable:!o,children:x.jsx(ot.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...i,ref:f,onPointerMove:Re(e.onPointerMove,Hf(b=>{o?l.onItemLeave(b):(l.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Re(e.onPointerLeave,Hf(b=>l.onItemLeave(b))),onFocus:Re(e.onFocus,()=>m(!0)),onBlur:Re(e.onBlur,()=>m(!1))})})})},"MenuItemImpl")),BR=C.forwardRef(ct(function(e,n){const{checked:r=!1,onCheckedChange:o,...s}=e;return x.jsx(HR,{scope:e.__scopeMenu,checked:r,children:x.jsx(cE,{role:"menuitemcheckbox","aria-checked":Hu(r)?"mixed":r,...s,ref:n,"data-state":Vy(r),onSelect:Re(s.onSelect,()=>o==null?void 0:o(Hu(r)?!0:!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),VR="MenuRadioGroup",[MX,AX]=aa(VR,{value:void 0,onValueChange:ct(()=>{},"onValueChange")}),dE="MenuItemIndicator",[HR,UR]=aa(dE,{checked:!1}),WR=C.forwardRef(ct(function(e,n){const{__scopeMenu:r,forceMount:o,...s}=e,i=UR(dE,r);return x.jsx(is,{present:o||Hu(i.checked)||i.checked===!0,children:x.jsx(ot.span,{...s,ref:n,"data-state":Vy(i.checked)})})},"MenuItemIndicator")),qR=C.forwardRef(ct(function(e,n){const{__scopeMenu:r,...o}=e;return x.jsx(ot.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})},"MenuSeparator")),KR="MenuSub",[NX,DX]=aa(KR);function fE(t){return t?"open":"closed"}ct(fE,"getOpenState");function Hu(t){return t==="indeterminate"}ct(Hu,"isIndeterminate");function Vy(t){return Hu(t)?"indeterminate":t?"checked":"unchecked"}ct(Vy,"getCheckedState");function hE(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}ct(hE,"focusFirst");function pE(t,e){return t.map((n,r)=>t[(e+r)%t.length])}ct(pE,"wrapArray");function mE(t,e,n){const o=e.length>1&&Array.from(e).every(d=>d===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let i=pE(t,Math.max(s,0));o.length===1&&(i=i.filter(d=>d!==n));const u=i.find(d=>d.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}ct(mE,"getNextMatch");function gE(t,e){const{x:n,y:r}=t;let o=!1;for(let s=0,i=e.length-1;s<e.length;i=s++){const l=e[s],u=e[i],d=l.x,f=l.y,p=u.x,m=u.y;f>r!=m>r&&n<(p-d)*(r-f)/(m-f)+d&&(o=!o)}return o}ct(gE,"isPointInPolygon");function yE(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return gE(n,e)}ct(yE,"isPointerInGraceArea");function Hf(t){return e=>e.pointerType==="mouse"?t(e):void 0}ct(Hf,"whenMouse");var GR=AR,JR=NR,ZR=OR,YR=PR,XR=FR,QR=cE,eO=BR,tO=WR,nO=qR,rO=Object.defineProperty,ls=(t,e)=>rO(t,"name",{value:e,configurable:!0}),Hy="DropdownMenu",[oO,RX]=wo(Hy,[sE]),us=sE(),[sO,xE]=oO(Hy),iO=ls(t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:l=!0}=t,u=us(e),d=C.useRef(null),[f,p]=Ki({prop:o,defaultProp:s??!1,onChange:i,caller:Hy});return x.jsx(sO,{scope:e,triggerId:go(),triggerRef:d,contentId:go(),open:f,onOpenChange:p,onOpenToggle:C.useCallback(()=>p(m=>!m),[p]),modal:l,children:x.jsx(GR,{...u,open:f,onOpenChange:p,dir:r,modal:l,children:n})})},"DropdownMenu"),aO="DropdownMenuTrigger",lO=C.forwardRef(ls(function(e,n){const{__scopeDropdownMenu:r,disabled:o=!1,...s}=e,i=xE(aO,r),l=us(r),u=rt(n,i.triggerRef);return x.jsx(JR,{asChild:!0,...l,children:x.jsx(ot.button,{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":o?"":void 0,disabled:o,...s,ref:u,onPointerDown:Re(e.onPointerDown,d=>{!o&&d.button===0&&d.ctrlKey===!1&&(i.onOpenToggle(),i.open||d.preventDefault())}),onKeyDown:Re(e.onKeyDown,d=>{o||(["Enter"," "].includes(d.key)&&i.onOpenToggle(),d.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(d.key)&&d.preventDefault())})})})},"DropdownMenuTrigger")),uO=ls(t=>{const{__scopeDropdownMenu:e,...n}=t,r=us(e);return x.jsx(ZR,{...r,...n})},"DropdownMenuPortal"),cO="DropdownMenuContent",dO=C.forwardRef(ls(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=xE(cO,r),i=us(r),l=C.useRef(!1);return x.jsx(YR,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...o,ref:n,onCloseAutoFocus:Re(e.onCloseAutoFocus,u=>{var d;l.current||(d=s.triggerRef.current)==null||d.focus(),l.current=!1,u.preventDefault()}),onInteractOutside:Re(e.onInteractOutside,u=>{const d=u.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0,p=d.button===2||f;(!s.modal||p)&&(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),fO=C.forwardRef(ls(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=us(r);return x.jsx(XR,{...s,...o,ref:n})},"DropdownMenuLabel")),hO=C.forwardRef(ls(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=us(r);return x.jsx(QR,{...s,...o,ref:n})},"DropdownMenuItem")),pO=C.forwardRef(ls(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=us(r);return x.jsx(eO,{...s,...o,ref:n})},"DropdownMenuCheckboxItem")),mO=C.forwardRef(ls(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=us(r);return x.jsx(tO,{...s,...o,ref:n})},"DropdownMenuItemIndicator")),gO=C.forwardRef(ls(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=us(r);return x.jsx(nO,{...s,...o,ref:n})},"DropdownMenuSeparator")),yO=iO,xO=lO,vO=uO,bO=dO,kO=fO,wO=hO,CO=pO,SO=mO,EO=gO,_O=Object.defineProperty,TO=(t,e)=>_O(t,"name",{value:e,configurable:!0}),MO=C.forwardRef(TO(function(e,n){return x.jsx(ot.label,{...e,ref:n,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}})},"Label")),AO=MO,NO=Object.defineProperty,DO=(t,e)=>NO(t,"name",{value:e,configurable:!0});function vE(t){const e=C.useRef({value:t,previous:t});return C.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}DO(vE,"usePrevious");var RO=Object.defineProperty,OO=(t,e)=>RO(t,"name",{value:e,configurable:!0});function g1(t,[e,n]){return Math.min(n,Math.max(e,t))}OO(g1,"clamp");var IO=Object.defineProperty,Xe=(t,e)=>IO(t,"name",{value:e,configurable:!0}),PO=[" ","Enter","ArrowUp","ArrowDown"],jO=[" ","Enter"],el="Select",[gp,yp,LO]=tp(el),[la,OX]=wo(el,[LO,bl]),Uy=bl(),[zO,di]=la(el),[FO,$O]=la(el);function bE(t){const{__scopeSelect:e,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:l,onValueChange:u,dir:d,name:f,autoComplete:p,disabled:m,required:y,form:v,internal_do_not_use_render:b}=t,k=Uy(e),[E,_]=C.useState(null),[T,A]=C.useState(null),[N,D]=C.useState(!1),I=np(d),[P,O]=Ki({prop:r,defaultProp:o??!1,onChange:s,caller:el}),[U,J]=Ki({prop:i,defaultProp:l,onChange:u,caller:el}),K=C.useRef(null),q=C.useRef(U);C.useEffect(()=>{const B=v?E==null?void 0:E.ownerDocument.getElementById(v):E==null?void 0:E.form;if(B instanceof HTMLFormElement){const ne=Xe(()=>J(q.current),"reset");return B.addEventListener("reset",ne),()=>B.removeEventListener("reset",ne)}},[v,E,J]);const Z=E?!!v||!!E.closest("form"):!0,[Q,G]=C.useState(new Set),Y=go(),W=Array.from(Q).map(B=>B.props.value).join(";"),ee=C.useCallback(B=>{G(ne=>new Set(ne).add(B))},[]),z=C.useCallback(B=>{G(ne=>{const fe=new Set(ne);return fe.delete(B),fe})},[]),j={required:y,trigger:E,onTriggerChange:_,valueNode:T,onValueNodeChange:A,valueNodeHasChildren:N,onValueNodeHasChildrenChange:D,contentId:Y,value:U,onValueChange:J,open:P,onOpenChange:O,dir:I,triggerPointerDownPosRef:K,disabled:m,name:f,autoComplete:p,form:v,nativeOptions:Q,nativeSelectKey:W,isFormControl:Z};return x.jsx(Py,{...k,children:x.jsx(zO,{scope:e,...j,children:x.jsx(gp.Provider,{scope:e,children:x.jsx(FO,{scope:e,onNativeOptionAdd:ee,onNativeOptionRemove:z,children:SE(b)?b(j):n})})})})}Xe(bE,"SelectProvider");var BO=Xe(t=>{const{__scopeSelect:e,children:n,...r}=t;return x.jsx(bE,{__scopeSelect:e,...r,internal_do_not_use_render:({isFormControl:o})=>x.jsxs(x.Fragment,{children:[n,o?x.jsx(hI,{__scopeSelect:e}):null]})})},"Select"),VO="SelectTrigger",HO=C.forwardRef(Xe(function(e,n){const{__scopeSelect:r,disabled:o=!1,...s}=e,i=Uy(r),l=di(VO,r),u=l.disabled||o,d=rt(n,l.onTriggerChange),f=yp(r),p=C.useRef("touch"),[m,y,v]=qy(k=>{const E=f().filter(A=>!A.disabled),_=E.find(A=>A.value===l.value),T=Ky(E,k,_);T!==void 0&&l.onValueChange(T.value)}),b=Xe(k=>{u||(l.onOpenChange(!0),v()),k&&(l.triggerPointerDownPosRef.current={x:Math.round(k.pageX),y:Math.round(k.pageY)})},"handleOpen");return x.jsx(jy,{asChild:!0,...i,children:x.jsx(ot.button,{type:"button",role:"combobox","aria-controls":l.open?l.contentId:void 0,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":bc(l.value)?"":void 0,...s,ref:d,onClick:Re(s.onClick,k=>{k.currentTarget.focus(),p.current!=="mouse"&&b(k)}),onPointerDown:Re(s.onPointerDown,k=>{p.current=k.pointerType;const E=k.target;E.hasPointerCapture(k.pointerId)&&E.releasePointerCapture(k.pointerId),k.button===0&&k.ctrlKey===!1&&k.pointerType==="mouse"&&(b(k),k.preventDefault())}),onKeyDown:Re(s.onKeyDown,k=>{const E=m.current!=="";!(k.ctrlKey||k.altKey||k.metaKey)&&k.key.length===1&&y(k.key),!(E&&k.key===" ")&&PO.includes(k.key)&&(b(),k.preventDefault())})})})},"SelectTrigger")),UO="SelectValue",WO=C.forwardRef(Xe(function(e,n){const{__scopeSelect:r,className:o,style:s,children:i,placeholder:l="",...u}=e,d=di(UO,r),{onValueNodeHasChildrenChange:f}=d,p=i!==void 0,m=rt(n,d.onValueNodeChange);Rt(()=>{f(p)},[f,p]);const y=bc(d.value);return x.jsx(ot.span,{...u,asChild:y?!1:u.asChild,ref:m,style:{pointerEvents:"none"},children:x.jsx(C.Fragment,{children:y?l:i},y?"placeholder":"value")})},"SelectValue")),qO=C.forwardRef(Xe(function(e,n){const{__scopeSelect:r,children:o,...s}=e;return x.jsx(ot.span,{"aria-hidden":!0,...s,ref:n,children:o||"▼"})},"SelectIcon")),KO="SelectPortal",[GO,JO]=la(KO,{forceMount:void 0}),ZO=Xe(t=>{const{__scopeSelect:e,forceMount:n,...r}=t;return x.jsx(GO,{scope:t.__scopeSelect,forceMount:n,children:x.jsx(op,{asChild:!0,...r})})},"SelectPortal"),Zi="SelectContent",YO=C.forwardRef(Xe(function(e,n){const r=JO(Zi,e.__scopeSelect),{forceMount:o=r.forceMount,...s}=e,i=di(Zi,e.__scopeSelect),[l,u]=C.useState();return Rt(()=>{u(new DocumentFragment)},[]),x.jsx(is,{present:o||i.open,children:({present:d})=>d?x.jsx(eI,{...s,ref:n}):x.jsx(XO,{...s,fragment:l})})},"SelectContent")),XO=C.forwardRef(Xe(function(e,n){const{__scopeSelect:r,children:o,fragment:s}=e;return s?Vr.createPortal(x.jsx(kE,{scope:r,children:x.jsx(gp.Slot,{scope:r,children:x.jsx("div",{ref:n,children:o})})}),s):null},"SelectContentFragment")),$r=10,[kE,ua]=la(Zi),QO=xo("SelectContent.RemoveScroll"),eI=C.forwardRef(Xe(function(e,n){const{__scopeSelect:r}=e,{position:o="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:l,side:u,sideOffset:d,align:f,alignOffset:p,arrowPadding:m,collisionBoundary:y,collisionPadding:v,sticky:b,hideWhenDetached:k,avoidCollisions:E,..._}=e,T=di(Zi,r),[A,N]=C.useState(null),[D,I]=C.useState(null),P=rt(n,N),[O,U]=C.useState(null),[J,K]=C.useState(null),q=yp(r),[Z,Q]=C.useState(!1),G=C.useRef(!1);C.useEffect(()=>{if(A)return _y(A)},[A]),xc();const Y=C.useCallback(X=>{const[ce,...pe]=q().map($e=>$e.ref.current),[Le]=pe.slice(-1),Ne=document.activeElement;for(const $e of X)if($e===Ne||($e==null||$e.scrollIntoView({block:"nearest"}),$e===ce&&D&&(D.scrollTop=0),$e===Le&&D&&(D.scrollTop=D.scrollHeight),$e==null||$e.focus(),document.activeElement!==Ne))return},[q,D]),W=C.useCallback(()=>Y([O,A]),[Y,O,A]);C.useEffect(()=>{Z&&W()},[Z,W]);const{onOpenChange:ee,triggerPointerDownPosRef:z}=T;C.useEffect(()=>{if(A){let X={x:0,y:0};const ce=Xe(Le=>{var Ne,$e;X={x:Math.abs(Math.round(Le.pageX)-(((Ne=z.current)==null?void 0:Ne.x)??0)),y:Math.abs(Math.round(Le.pageY)-((($e=z.current)==null?void 0:$e.y)??0))}},"handlePointerMove"),pe=Xe(Le=>{X.x<=10&&X.y<=10?Le.preventDefault():Le.composedPath().includes(A)||ee(!1),document.removeEventListener("pointermove",ce),z.current=null},"handlePointerUp");return z.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",pe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",pe,{capture:!0})}}},[A,ee,z]),C.useEffect(()=>{const X=Xe(()=>ee(!1),"close");return window.addEventListener("blur",X),window.addEventListener("resize",X),()=>{window.removeEventListener("blur",X),window.removeEventListener("resize",X)}},[ee]);const[j,B]=qy(X=>{const ce=q().filter(Ne=>!Ne.disabled),pe=ce.find(Ne=>Ne.ref.current===document.activeElement),Le=Ky(ce,X,pe);Le&&setTimeout(()=>{var Ne;return(Ne=Le.ref.current)==null?void 0:Ne.focus()})}),ne=C.useCallback((X,ce,pe)=>{const Le=!G.current&&!pe;(T.value!==void 0&&T.value===ce||Le)&&(U(X),Le&&(G.current=!0))},[T.value]),fe=C.useCallback(()=>A==null?void 0:A.focus(),[A]),ue=C.useCallback((X,ce,pe)=>{const Le=!G.current&&!pe;(T.value!==void 0&&T.value===ce||Le)&&K(X)},[T.value]),he=o==="popper"?j2:tI,Ae=he===j2?{side:u,sideOffset:d,align:f,alignOffset:p,arrowPadding:m,collisionBoundary:y,collisionPadding:v,sticky:b,hideWhenDetached:k,avoidCollisions:E}:{};return x.jsx(kE,{scope:r,content:A,viewport:D,onViewportChange:I,itemRefCallback:ne,selectedItem:O,onItemLeave:fe,itemTextRefCallback:ue,focusSelectedItem:W,selectedItemText:J,position:o,isPositioned:Z,searchRef:j,children:x.jsx(ip,{as:QO,allowPinchZoom:!0,children:x.jsx(Cy,{asChild:!0,trapped:T.open,onMountAutoFocus:X=>{X.preventDefault()},onUnmountAutoFocus:Re(s,X=>{var ce;(ce=T.trigger)==null||ce.focus({preventScroll:!0}),X.preventDefault()}),children:x.jsx(rp,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:X=>X.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:x.jsx(he,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:X=>X.preventDefault(),..._,...Ae,onPlaced:()=>Q(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",..._.style},onKeyDown:Re(_.onKeyDown,X=>{const ce=X.ctrlKey||X.altKey||X.metaKey;if(X.key==="Tab"&&X.preventDefault(),!ce&&X.key.length===1&&B(X.key),["ArrowUp","ArrowDown","Home","End"].includes(X.key)){let Le=q().filter(Ne=>!Ne.disabled).map(Ne=>Ne.ref.current);if(["ArrowUp","End"].includes(X.key)&&(Le=Le.slice().reverse()),["ArrowUp","ArrowDown"].includes(X.key)){const Ne=X.target,$e=Le.indexOf(Ne);Le=Le.slice($e+1)}setTimeout(()=>Y(Le)),X.preventDefault()}})})})})})})},"SelectContentImpl")),tI=C.forwardRef(Xe(function(e,n){const{__scopeSelect:r,onPlaced:o,...s}=e,i=di(Zi,r),l=ua(Zi,r),[u,d]=C.useState(null),[f,p]=C.useState(null),m=rt(n,p),y=yp(r),v=C.useRef(!1),b=C.useRef(!0),{viewport:k,selectedItem:E,selectedItemText:_,focusSelectedItem:T}=l,A=C.useCallback(()=>{if(i.trigger&&i.valueNode&&u&&f&&k&&E&&_){const P=i.trigger.getBoundingClientRect(),O=f.getBoundingClientRect(),U=i.valueNode.getBoundingClientRect(),J=_.getBoundingClientRect();if(i.dir!=="rtl"){const Ne=J.left-O.left,$e=U.left-Ne,Ze=P.left-$e,Mt=P.width+Ze,Pt=Math.max(Mt,O.width),Ht=window.innerWidth-$r,zn=g1($e,[$r,Math.max($r,Ht-Pt)]);u.style.minWidth=Mt+"px",u.style.left=zn+"px"}else{const Ne=O.right-J.right,$e=window.innerWidth-U.right-Ne,Ze=window.innerWidth-P.right-$e,Mt=P.width+Ze,Pt=Math.max(Mt,O.width),Ht=window.innerWidth-$r,zn=g1($e,[$r,Math.max($r,Ht-Pt)]);u.style.minWidth=Mt+"px",u.style.right=zn+"px"}const K=y(),q=window.innerHeight-$r*2,Z=k.scrollHeight,Q=window.getComputedStyle(f),G=parseInt(Q.borderTopWidth,10),Y=parseInt(Q.paddingTop,10),W=parseInt(Q.borderBottomWidth,10),ee=parseInt(Q.paddingBottom,10),z=G+Y+Z+ee+W,j=Math.min(E.offsetHeight*5,z),B=window.getComputedStyle(k),ne=parseInt(B.paddingTop,10),fe=parseInt(B.paddingBottom,10),ue=P.top+P.height/2-$r,he=q-ue,Ae=E.offsetHeight/2,X=E.offsetTop+Ae,ce=G+Y+X,pe=z-ce;if(ce<=ue){const Ne=K.length>0&&E===K[K.length-1].ref.current;u.style.bottom="0px";const $e=f.clientHeight-k.offsetTop-k.offsetHeight,Ze=Math.max(he,Ae+(Ne?fe:0)+$e+W),Mt=ce+Ze;u.style.height=Mt+"px"}else{const Ne=K.length>0&&E===K[0].ref.current;u.style.top="0px";const Ze=Math.max(ue,G+k.offsetTop+(Ne?ne:0)+Ae)+pe;u.style.height=Ze+"px",k.scrollTop=ce-ue+k.offsetTop}u.style.margin=`${$r}px 0`,u.style.minHeight=j+"px",u.style.maxHeight=q+"px",o==null||o(),requestAnimationFrame(()=>v.current=!0)}},[y,i.trigger,i.valueNode,u,f,k,E,_,i.dir,o]);Rt(()=>A(),[A]);const[N,D]=C.useState();Rt(()=>{f&&D(window.getComputedStyle(f).zIndex)},[f]);const I=C.useCallback(P=>{P&&b.current===!0&&(A(),T==null||T(),b.current=!1)},[A,T]);return x.jsx(nI,{scope:r,contentWrapper:u,shouldExpandOnScrollRef:v,onScrollButtonChange:I,children:x.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:x.jsx(ot.div,{...s,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})},"SelectItemAlignedPosition")),j2=C.forwardRef(Xe(function(e,n){const{__scopeSelect:r,align:o="start",collisionPadding:s=$r,...i}=e,l=Uy(r);return x.jsx(Ly,{...l,...i,ref:n,align:o,collisionPadding:s,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)"}})},"SelectPopperPosition")),[nI,Wy]=la(Zi,{}),L2="SelectViewport",rI=C.forwardRef(Xe(function(e,n){const{__scopeSelect:r,nonce:o,...s}=e,i=ua(L2,r),l=Wy(L2,r),u=rt(n,i.onViewportChange),d=C.useRef(0);return x.jsxs(x.Fragment,{children:[x.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),x.jsx(gp.Slot,{scope:r,children:x.jsx(ot.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Re(s.onScroll,f=>{const p=f.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:y}=l;if(y!=null&&y.current&&m){const v=Math.abs(d.current-p.scrollTop);if(v>0){const b=window.innerHeight-$r*2,k=parseFloat(m.style.minHeight),E=parseFloat(m.style.height),_=Math.max(k,E);if(_<b){const T=_+v,A=Math.min(b,T),N=T-A;m.style.height=A+"px",m.style.bottom==="0px"&&(p.scrollTop=N>0?N:0,m.style.justifyContent="flex-end")}}}d.current=p.scrollTop})})})]})},"SelectViewport")),oI="SelectGroup",[IX,PX]=la(oI),y1="SelectItem",[sI,wE]=la(y1),iI=C.forwardRef(Xe(function(e,n){const{__scopeSelect:r,value:o,disabled:s=!1,textValue:i,...l}=e,u=di(y1,r),d=ua(y1,r),f=u.value===o,[p,m]=C.useState(i??""),[y,v]=C.useState(!1),b=Nr(A=>{var N;return(N=d.itemRefCallback)==null?void 0:N.call(d,A,o,s)}),k=rt(n,b),E=go(),_=C.useRef("touch"),T=Xe(()=>{s||(u.onValueChange(o),u.onOpenChange(!1))},"handleSelect");return x.jsx(sI,{scope:r,value:o,disabled:s,textId:E,isSelected:f,onItemTextChange:C.useCallback(A=>{m(N=>N||((A==null?void 0:A.textContent)??"").trim())},[]),children:x.jsx(gp.ItemSlot,{scope:r,value:o,disabled:s,textValue:p,children:x.jsx(ot.div,{role:"option","aria-labelledby":E,"data-highlighted":y?"":void 0,"aria-selected":f&&y,"data-state":f?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...l,ref:k,onFocus:Re(l.onFocus,()=>v(!0)),onBlur:Re(l.onBlur,()=>v(!1)),onClick:Re(l.onClick,()=>{_.current!=="mouse"&&T()}),onPointerUp:Re(l.onPointerUp,()=>{_.current==="mouse"&&T()}),onPointerDown:Re(l.onPointerDown,A=>{_.current=A.pointerType}),onPointerMove:Re(l.onPointerMove,A=>{var N;_.current=A.pointerType,s?(N=d.onItemLeave)==null||N.call(d):_.current==="mouse"&&A.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Re(l.onPointerLeave,A=>{var N;A.currentTarget===document.activeElement&&((N=d.onItemLeave)==null||N.call(d))}),onKeyDown:Re(l.onKeyDown,A=>{var D;s||A.target!==A.currentTarget||((D=d.searchRef)==null?void 0:D.current)!==""&&A.key===" "||(jO.includes(A.key)&&T(),A.key===" "&&A.preventDefault())})})})})},"SelectItem")),tf="SelectItemText",aI=C.forwardRef(Xe(function(e,n){const{__scopeSelect:r,className:o,style:s,...i}=e,l=di(tf,r),u=ua(tf,r),d=wE(tf,r),f=$O(tf,r),[p,m]=C.useState(null),y=Nr(T=>{var A;return(A=u.itemTextRefCallback)==null?void 0:A.call(u,T,d.value,d.disabled)}),v=rt(n,m,d.onItemTextChange,y),b=p==null?void 0:p.textContent,k=C.useMemo(()=>x.jsx("option",{value:d.value,disabled:d.disabled,children:b},d.value),[d.disabled,d.value,b]),{onNativeOptionAdd:E,onNativeOptionRemove:_}=f;return Rt(()=>(E(k),()=>_(k)),[E,_,k]),x.jsxs(x.Fragment,{children:[x.jsx(ot.span,{id:d.textId,...i,ref:v}),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren&&!bc(l.value)?Vr.createPortal(i.children,l.valueNode):null]})},"SelectItemText")),lI="SelectItemIndicator",uI=C.forwardRef(Xe(function(e,n){const{__scopeSelect:r,...o}=e;return wE(lI,r).isSelected?x.jsx(ot.span,{"aria-hidden":!0,...o,ref:n}):null},"SelectItemIndicator")),z2="SelectScrollUpButton",cI=C.forwardRef(Xe(function(e,n){const r=ua(z2,e.__scopeSelect),o=Wy(z2,e.__scopeSelect),[s,i]=C.useState(!1),l=rt(n,o.onScrollButtonChange);return Rt(()=>{if(r.viewport&&r.isPositioned){let u=function(){const f=d.scrollTop>0;i(f)};Xe(u,"handleScroll");const d=r.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),s?x.jsx(CE,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=r;u&&d&&(u.scrollTop=u.scrollTop-d.offsetHeight)}}):null},"SelectScrollUpButton")),F2="SelectScrollDownButton",dI=C.forwardRef(Xe(function(e,n){const r=ua(F2,e.__scopeSelect),o=Wy(F2,e.__scopeSelect),[s,i]=C.useState(!1),l=rt(n,o.onScrollButtonChange);return Rt(()=>{if(r.viewport&&r.isPositioned){let u=function(){const f=d.scrollHeight-d.clientHeight,p=Math.ceil(d.scrollTop)<f;i(p)};Xe(u,"handleScroll");const d=r.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),s?x.jsx(CE,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=r;u&&d&&(u.scrollTop=u.scrollTop+d.offsetHeight)}}):null},"SelectScrollDownButton")),CE=C.forwardRef(Xe(function(e,n){const{__scopeSelect:r,onAutoScroll:o,...s}=e,i=ua("SelectScrollButton",r),l=C.useRef(null),u=yp(r),d=C.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return C.useEffect(()=>()=>d(),[d]),Rt(()=>{var p;const f=u().find(m=>m.ref.current===document.activeElement);(p=f==null?void 0:f.ref.current)==null||p.scrollIntoView({block:"nearest"})},[u]),x.jsx(ot.div,{"aria-hidden":!0,...s,ref:n,style:{flexShrink:0,...s.style},onPointerDown:Re(s.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(o,50))}),onPointerMove:Re(s.onPointerMove,()=>{var f;(f=i.onItemLeave)==null||f.call(i),l.current===null&&(l.current=window.setInterval(o,50))}),onPointerLeave:Re(s.onPointerLeave,()=>{d()})})},"SelectScrollButtonImpl")),fI="SelectBubbleInput",hI=C.forwardRef(Xe(function({__scopeSelect:e,...n},r){const o=di(fI,e),{value:s,onValueChange:i,required:l,disabled:u,name:d,autoComplete:f,form:p}=o,{nativeOptions:m,nativeSelectKey:y}=o,v=C.useRef(null),b=rt(r,v),k=s??"",E=vE(k),_=Array.from(m).some(T=>(T.props.value??"")==="");return C.useEffect(()=>{const T=v.current;if(!T)return;const A=window.HTMLSelectElement.prototype,D=Object.getOwnPropertyDescriptor(A,"value").set;if(E!==k&&D){const I=new Event("change",{bubbles:!0});D.call(T,k),T.dispatchEvent(I)}},[E,k]),x.jsxs(ot.select,{"aria-hidden":!0,required:l,tabIndex:-1,name:d,autoComplete:f,disabled:u,form:p,onChange:T=>i(T.target.value),...n,style:{...GS,...n.style},ref:b,defaultValue:k,children:[bc(s)&&!_?x.jsx("option",{value:""}):null,Array.from(m)]},y)},"SelectBubbleInput"));function SE(t){return typeof t=="function"}Xe(SE,"isFunction");function bc(t){return t===""||t===void 0}Xe(bc,"shouldShowPlaceholder");function qy(t){const e=Nr(t),n=C.useRef(""),r=C.useRef(0),o=C.useCallback(i=>{const l=n.current+i;e(l),Xe((function u(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>u(""),1e3))}),"updateSearch")(l)},[e]),s=C.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return C.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}Xe(qy,"useTypeaheadSearch");function Ky(t,e,n){const o=e.length>1&&Array.from(e).every(d=>d===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let i=EE(t,Math.max(s,0));o.length===1&&(i=i.filter(d=>d!==n));const u=i.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}Xe(Ky,"findNextItem");function EE(t,e){return t.map((n,r)=>t[(e+r)%t.length])}Xe(EE,"wrapArray");var pI=Object.defineProperty,Xt=(t,e)=>pI(t,"name",{value:e,configurable:!0}),[Gy,jX]=wo("Tooltip",[bl]),xp=bl(),mI="TooltipProvider",gI=700,x1="tooltip.open",[yI,Jy]=Gy(mI),xI=Xt(t=>{const{__scopeTooltip:e,delayDuration:n=gI,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=t,i=C.useRef(!0),l=C.useRef(!1),u=C.useRef(0);return C.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),x.jsx(yI,{scope:e,isOpenDelayedRef:i,delayDuration:n,onOpen:C.useCallback(()=>{r<=0||(window.clearTimeout(u.current),i.current=!1)},[r]),onClose:C.useCallback(()=>{r<=0||(window.clearTimeout(u.current),u.current=window.setTimeout(()=>i.current=!0,r))},[r]),isPointerInTransitRef:l,onPointerInTransitChange:C.useCallback(d=>{l.current=d},[]),disableHoverableContent:o,children:s})},"TooltipProvider"),v1="Tooltip",[vI,kc]=Gy(v1),bI=Xt(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:l}=t,u=Jy(v1,t.__scopeTooltip),d=xp(e),[f,p]=C.useState(null),[m,y]=C.useState(void 0),v=go(),b=C.useRef(0),k=i??u.disableHoverableContent,E=l??u.delayDuration,_=C.useRef(!1),[T,A]=Ki({prop:r,defaultProp:o??!1,onChange:Xt(U=>{U?(u.onOpen(),document.dispatchEvent(new CustomEvent(x1))):u.onClose(),s==null||s(U)},"onChange"),caller:v1}),N=C.useMemo(()=>T?_.current?"delayed-open":"instant-open":"closed",[T]),D=C.useCallback(()=>{window.clearTimeout(b.current),b.current=0,_.current=!1,A(!0)},[A]),I=C.useCallback(()=>{window.clearTimeout(b.current),b.current=0,A(!1)},[A]),P=C.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{_.current=!0,A(!0),b.current=0},E)},[E,A]);C.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]);const O=m??v;return x.jsx(Py,{...d,children:x.jsx(vI,{scope:e,contentId:O,setContentId:y,open:T,stateAttribute:N,trigger:f,onTriggerChange:p,onTriggerEnter:C.useCallback(()=>{u.isOpenDelayedRef.current?P():D()},[u.isOpenDelayedRef,P,D]),onTriggerLeave:C.useCallback(()=>{k?I():(window.clearTimeout(b.current),b.current=0)},[I,k]),onOpen:D,onClose:I,disableHoverableContent:k,children:n})})},"Tooltip"),$2="TooltipTrigger",kI=C.forwardRef(Xt(function(e,n){const{__scopeTooltip:r,...o}=e,s=kc($2,r),i=Jy($2,r),l=xp(r),u=C.useRef(null),d=rt(n,u,s.onTriggerChange),f=C.useRef(!1),p=C.useRef(!1),m=C.useCallback(()=>f.current=!1,[]);return C.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),x.jsx(jy,{asChild:!0,...l,children:x.jsx(ot.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...o,ref:d,onPointerMove:Re(e.onPointerMove,y=>{y.pointerType!=="touch"&&!p.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),p.current=!0)}),onPointerLeave:Re(e.onPointerLeave,()=>{s.onTriggerLeave(),p.current=!1}),onPointerDown:Re(e.onPointerDown,()=>{s.open&&s.onClose(),f.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:Re(e.onFocus,()=>{f.current||s.onOpen()}),onBlur:Re(e.onBlur,s.onClose),onClick:Re(e.onClick,s.onClose)})})},"TooltipTrigger")),_E="TooltipPortal",[wI,CI]=Gy(_E,{forceMount:void 0}),SI=Xt(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:o}=t,s=kc(_E,e);return x.jsx(wI,{scope:e,forceMount:n,children:x.jsx(is,{present:n||s.open,children:x.jsx(op,{asChild:!0,container:o,children:r})})})},"TooltipPortal"),Uu="TooltipContent",EI=C.forwardRef(Xt(function(e,n){const r=CI(Uu,e.__scopeTooltip),{forceMount:o=r.forceMount,side:s="top",...i}=e,l=kc(Uu,e.__scopeTooltip);return x.jsx(is,{present:o||l.open,children:l.disableHoverableContent?x.jsx(TE,{side:s,...i,ref:n}):x.jsx(_I,{side:s,...i,ref:n})})},"TooltipContent")),_I=C.forwardRef(Xt(function(e,n){const r=kc(Uu,e.__scopeTooltip),o=Jy(Uu,e.__scopeTooltip),s=C.useRef(null),i=rt(n,s),[l,u]=C.useState(null),{trigger:d,onClose:f}=r,p=s.current,{onPointerInTransitChange:m}=o,y=C.useCallback(()=>{u(null),m(!1)},[m]),v=C.useCallback((b,k)=>{const E=b.currentTarget,_={x:b.clientX,y:b.clientY},T=ME(_,E.getBoundingClientRect()),A=AE(_,T),N=NE(k.getBoundingClientRect()),D=RE([...A,...N]);u(D),m(!0)},[m]);return C.useEffect(()=>()=>y(),[y]),C.useEffect(()=>{if(d&&p){const b=Xt(E=>v(E,p),"handleTriggerLeave"),k=Xt(E=>v(E,d),"handleContentLeave");return d.addEventListener("pointerleave",b),p.addEventListener("pointerleave",k),()=>{d.removeEventListener("pointerleave",b),p.removeEventListener("pointerleave",k)}}},[d,p,v,y]),C.useEffect(()=>{if(l){const b=Xt(k=>{const E=k.target,_={x:k.clientX,y:k.clientY},T=(d==null?void 0:d.contains(E))||(p==null?void 0:p.contains(E)),A=!DE(_,l);T?y():A&&(y(),f())},"handleTrackPointerGrace");return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[d,p,l,f,y]),x.jsx(TE,{...e,ref:i})},"TooltipContentHoverable")),TI=HS("TooltipContent"),TE=C.forwardRef(Xt(function(e,n){const{__scopeTooltip:r,children:o,"aria-label":s,id:i,onEscapeKeyDown:l,onPointerDownOutside:u,...d}=e,f=kc(Uu,r),p=xp(r),{onClose:m}=f;C.useEffect(()=>(document.addEventListener(x1,m),()=>document.removeEventListener(x1,m)),[m]),C.useEffect(()=>{if(f.trigger){const v=Xt(b=>{b.target instanceof Node&&b.target.contains(f.trigger)&&m()},"handleScroll");return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[f.trigger,m]);const{setContentId:y}=f;return Rt(()=>(y(i),()=>{y(void 0)}),[i,y]),x.jsx(rp,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:v=>v.preventDefault(),onDismiss:m,children:x.jsxs(Ly,{"data-state":f.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:f.contentId,...p,...d,ref:n,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[x.jsx(TI,{children:o}),s?x.jsx(n5,{id:f.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl")),MI=C.forwardRef(Xt(function(e,n){const{__scopeTooltip:r,...o}=e,s=xp(r);return x.jsx(sR,{...s,...o,ref:n})},"TooltipArrow"));function ME(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),o=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}Xt(ME,"getExitSideFromRect");function AE(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}Xt(AE,"getPaddedExitPoints");function NE(t){const{top:e,right:n,bottom:r,left:o}=t;return[{x:o,y:e},{x:n,y:e},{x:n,y:r},{x:o,y:r}]}Xt(NE,"getPointsFromRect");function DE(t,e){const{x:n,y:r}=t;let o=!1;for(let s=0,i=e.length-1;s<e.length;i=s++){const l=e[s],u=e[i],d=l.x,f=l.y,p=u.x,m=u.y;f>r!=m>r&&n<(p-d)*(r-f)/(m-f)+d&&(o=!o)}return o}Xt(DE,"isPointInPolygon");function RE(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),OE(e)}Xt(RE,"getHull");function OE(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const o=t[r];for(;e.length>=2;){const s=e[e.length-1],i=e[e.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))e.pop();else break}e.push(o)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const o=t[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}Xt(OE,"getHullPresorted");var AI=xI,NI=bI,DI=kI,RI=SI,OI=EI,II=MI;const PI=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r<t.length;r++)n[r]=t[r];for(let r=0;r<e.length;r++)n[t.length+r]=e[r];return n},jI=(t,e)=>({classGroupId:t,validator:e}),IE=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Uf="-",B2=[],LI="arbitrary..",zI=t=>{const e=$I(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return FI(i);const l=i.split(Uf),u=l[0]===""&&l.length>1?1:0;return PE(l,u,e)},getConflictingClassGroupIds:(i,l)=>{if(l){const u=r[i],d=n[i];return u?d?PI(d,u):u:d||B2}return n[i]||B2}}},PE=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const o=t[e],s=n.nextPart.get(o);if(s){const d=PE(t,e+1,s);if(d)return d}const i=n.validators;if(i===null)return;const l=e===0?t.join(Uf):t.slice(e).join(Uf),u=i.length;for(let d=0;d<u;d++){const f=i[d];if(f.validator(l))return f.classGroupId}},FI=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?LI+r:void 0})(),$I=t=>{const{theme:e,classGroups:n}=t;return BI(n,e)},BI=(t,e)=>{const n=IE();for(const r in t){const o=t[r];Zy(o,n,r,e)}return n},Zy=(t,e,n,r)=>{const o=t.length;for(let s=0;s<o;s++){const i=t[s];VI(i,e,n,r)}},VI=(t,e,n,r)=>{if(typeof t=="string"){HI(t,e,n);return}if(typeof t=="function"){UI(t,e,n,r);return}WI(t,e,n,r)},HI=(t,e,n)=>{const r=t===""?e:jE(e,t);r.classGroupId=n},UI=(t,e,n,r)=>{if(qI(t)){Zy(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(jI(n,t))},WI=(t,e,n,r)=>{const o=Object.entries(t),s=o.length;for(let i=0;i<s;i++){const[l,u]=o[i];Zy(u,jE(e,l),n,r)}},jE=(t,e)=>{let n=t;const r=e.split(Uf),o=r.length;for(let s=0;s<o;s++){const i=r[s];let l=n.nextPart.get(i);l||(l=IE(),n.nextPart.set(i,l)),n=l}return n},qI=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,KI=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const o=(s,i)=>{n[s]=i,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(s){let i=n[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return o(s,i),i},set(s,i){s in n?n[s]=i:o(s,i)}}},b1="!",V2=":",GI=[],H2=(t,e,n,r,o)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),JI=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=o=>{const s=[];let i=0,l=0,u=0,d;const f=o.length;for(let b=0;b<f;b++){const k=o[b];if(i===0&&l===0){if(k===V2){s.push(o.slice(u,b)),u=b+1;continue}if(k==="/"){d=b;continue}}k==="["?i++:k==="]"?i--:k==="("?l++:k===")"&&l--}const p=s.length===0?o:o.slice(u);let m=p,y=!1;p.endsWith(b1)?(m=p.slice(0,-1),y=!0):p.startsWith(b1)&&(m=p.slice(1),y=!0);const v=d&&d>u?d-u:void 0;return H2(s,y,m,v)};if(e){const o=e+V2,s=r;r=i=>i.startsWith(o)?s(i.slice(o.length)):H2(GI,!1,i,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},ZI=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let s=0;s<n.length;s++){const i=n[s],l=i[0]==="[",u=e.has(i);l||u?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(i)):o.push(i)}return o.length>0&&(o.sort(),r.push(...o)),r}},YI=t=>({cache:KI(t.cacheSize),parseClassName:JI(t),sortModifiers:ZI(t),postfixLookupClassGroupIds:XI(t),...zI(t)}),XI=t=>{const e=Object.create(null),n=t.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)e[n[r]]=!0;return e},QI=/\s+/,eP=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s,postfixLookupClassGroupIds:i}=e,l=[],u=t.trim().split(QI);let d="";for(let f=u.length-1;f>=0;f-=1){const p=u[f],{isExternal:m,modifiers:y,hasImportantModifier:v,baseClassName:b,maybePostfixModifierPosition:k}=n(p);if(m){d=p+(d.length>0?" "+d:d);continue}let E=!!k,_;if(E){const I=b.substring(0,k);_=r(I);const P=_&&i[_]?r(b):void 0;P&&P!==_&&(_=P,E=!1)}else _=r(b);if(!_){if(!E){d=p+(d.length>0?" "+d:d);continue}if(_=r(b),!_){d=p+(d.length>0?" "+d:d);continue}E=!1}const T=y.length===0?"":y.length===1?y[0]:s(y).join(":"),A=v?T+b1:T,N=A+_;if(l.indexOf(N)>-1)continue;l.push(N);const D=o(_,E);for(let I=0;I<D.length;++I){const P=D[I];l.push(A+P)}d=p+(d.length>0?" "+d:d)}return d},tP=(...t)=>{let e=0,n,r,o="";for(;e<t.length;)(n=t[e++])&&(r=LE(n))&&(o&&(o+=" "),o+=r);return o},LE=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=LE(t[r]))&&(n&&(n+=" "),n+=e);return n},nP=(t,...e)=>{let n,r,o,s;const i=u=>{const d=e.reduce((f,p)=>p(f),t());return n=YI(d),r=n.cache.get,o=n.cache.set,s=l,l(u)},l=u=>{const d=r(u);if(d)return d;const f=eP(u,n);return o(u,f),f};return s=i,(...u)=>s(tP(...u))},rP=[],Jt=t=>{const e=n=>n[t]||rP;return e.isThemeGetter=!0,e},zE=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,FE=/^\((?:(\w[\w-]*):)?(.+)\)$/i,oP=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,sP=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,iP=/\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$/,aP=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,lP=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,uP=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ds=t=>oP.test(t),We=t=>!!t&&!Number.isNaN(Number(t)),oo=t=>!!t&&Number.isInteger(Number(t)),Z0=t=>t.endsWith("%")&&We(t.slice(0,-1)),zo=t=>sP.test(t),$E=()=>!0,cP=t=>iP.test(t)&&!aP.test(t),Yy=()=>!1,dP=t=>lP.test(t),fP=t=>uP.test(t),hP=t=>!xe(t)&&!be(t),pP=t=>t.startsWith("@container")&&(t[10]==="/"&&t[11]!==void 0||t[11]==="s"&&t[16]!==void 0&&t.startsWith("-size/",10)||t[11]==="n"&&t[18]!==void 0&&t.startsWith("-normal/",10)),mP=t=>fi(t,HE,Yy),xe=t=>zE.test(t),Oi=t=>fi(t,UE,cP),U2=t=>fi(t,CP,We),gP=t=>fi(t,qE,$E),yP=t=>fi(t,WE,Yy),W2=t=>fi(t,BE,Yy),xP=t=>fi(t,VE,fP),nf=t=>fi(t,KE,dP),be=t=>FE.test(t),lu=t=>ca(t,UE),vP=t=>ca(t,WE),q2=t=>ca(t,BE),bP=t=>ca(t,HE),kP=t=>ca(t,VE),rf=t=>ca(t,KE,!0),wP=t=>ca(t,qE,!0),fi=(t,e,n)=>{const r=zE.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},ca=(t,e,n=!1)=>{const r=FE.exec(t);return r?r[1]?e(r[1]):n:!1},BE=t=>t==="position"||t==="percentage",VE=t=>t==="image"||t==="url",HE=t=>t==="length"||t==="size"||t==="bg-size",UE=t=>t==="length",CP=t=>t==="number",WE=t=>t==="family-name",qE=t=>t==="number"||t==="weight",KE=t=>t==="shadow",SP=()=>{const t=Jt("color"),e=Jt("font"),n=Jt("text"),r=Jt("font-weight"),o=Jt("tracking"),s=Jt("leading"),i=Jt("breakpoint"),l=Jt("container"),u=Jt("spacing"),d=Jt("radius"),f=Jt("shadow"),p=Jt("inset-shadow"),m=Jt("text-shadow"),y=Jt("drop-shadow"),v=Jt("blur"),b=Jt("perspective"),k=Jt("aspect"),E=Jt("ease"),_=Jt("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],N=()=>[...A(),be,xe],D=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],P=()=>[be,xe,u],O=()=>[Ds,"full","auto",...P()],U=()=>[oo,"none","subgrid",be,xe],J=()=>["auto",{span:["full",oo,be,xe]},oo,be,xe],K=()=>[oo,"auto",be,xe],q=()=>["auto","min","max","fr",be,xe],Z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Q=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...P()],Y=()=>[Ds,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],W=()=>[Ds,"screen","full","dvw","lvw","svw","min","max","fit",...P()],ee=()=>[Ds,"screen","full","lh","dvh","lvh","svh","min","max","fit",...P()],z=()=>[t,be,xe],j=()=>[...A(),q2,W2,{position:[be,xe]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ne=()=>["auto","cover","contain",bP,mP,{size:[be,xe]}],fe=()=>[Z0,lu,Oi],ue=()=>["","none","full",d,be,xe],he=()=>["",We,lu,Oi],Ae=()=>["solid","dashed","dotted","double"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ce=()=>[We,Z0,q2,W2],pe=()=>["","none",v,be,xe],Le=()=>["none",We,be,xe],Ne=()=>["none",We,be,xe],$e=()=>[We,be,xe],Ze=()=>[Ds,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[zo],breakpoint:[zo],color:[$E],container:[zo],"drop-shadow":[zo],ease:["in","out","in-out"],font:[hP],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[zo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[zo],shadow:[zo],spacing:["px",We],text:[zo],"text-shadow":[zo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ds,xe,be,k]}],container:["container"],"container-type":[{"@container":["","normal","size",be,xe]}],"container-named":[pP],columns:[{columns:[We,xe,be,l]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:N()}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{"inset-s":O(),start:O()}],end:[{"inset-e":O(),end:O()}],"inset-bs":[{"inset-bs":O()}],"inset-be":[{"inset-be":O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[oo,"auto",be,xe]}],basis:[{basis:[Ds,"full","auto",l,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[We,Ds,"auto","initial","none",xe]}],grow:[{grow:["",We,be,xe]}],shrink:[{shrink:["",We,be,xe]}],order:[{order:[oo,"first","last","none",be,xe]}],"grid-cols":[{"grid-cols":U()}],"col-start-end":[{col:J()}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":U()}],"row-start-end":[{row:J()}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":q()}],"auto-rows":[{"auto-rows":q()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...Z(),"normal"]}],"justify-items":[{"justify-items":[...Q(),"normal"]}],"justify-self":[{"justify-self":["auto",...Q()]}],"align-content":[{content:["normal",...Z()]}],"align-items":[{items:[...Q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Q(),{baseline:["","last"]}]}],"place-content":[{"place-content":Z()}],"place-items":[{"place-items":[...Q(),"baseline"]}],"place-self":[{"place-self":["auto",...Q()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pbs:[{pbs:P()}],pbe:[{pbe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mbs:[{mbs:G()}],mbe:[{mbe:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],"inline-size":[{inline:["auto",...W()]}],"min-inline-size":[{"min-inline":["auto",...W()]}],"max-inline-size":[{"max-inline":["none",...W()]}],"block-size":[{block:["auto",...ee()]}],"min-block-size":[{"min-block":["auto",...ee()]}],"max-block-size":[{"max-block":["none",...ee()]}],w:[{w:[l,"screen",...Y()]}],"min-w":[{"min-w":[l,"screen","none",...Y()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh",...Y()]}],"font-size":[{text:["base",n,lu,Oi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,wP,gP]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Z0,xe]}],"font-family":[{font:[vP,yP,e]}],"font-features":[{"font-features":[xe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,be,xe]}],"line-clamp":[{"line-clamp":[We,"none",be,U2]}],leading:[{leading:[s,...P()]}],"list-image":[{"list-image":["none",be,xe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",be,xe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[We,"from-font","auto",be,Oi]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[We,"auto",be,xe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"tab-size":[{tab:[oo,be,xe]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",be,xe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",be,xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:ne()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},oo,be,xe],radial:["",be,xe],conic:[oo,be,xe]},kP,xP]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:fe()}],"gradient-via-pos":[{via:fe()}],"gradient-to-pos":[{to:fe()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:ue()}],"rounded-s":[{"rounded-s":ue()}],"rounded-e":[{"rounded-e":ue()}],"rounded-t":[{"rounded-t":ue()}],"rounded-r":[{"rounded-r":ue()}],"rounded-b":[{"rounded-b":ue()}],"rounded-l":[{"rounded-l":ue()}],"rounded-ss":[{"rounded-ss":ue()}],"rounded-se":[{"rounded-se":ue()}],"rounded-ee":[{"rounded-ee":ue()}],"rounded-es":[{"rounded-es":ue()}],"rounded-tl":[{"rounded-tl":ue()}],"rounded-tr":[{"rounded-tr":ue()}],"rounded-br":[{"rounded-br":ue()}],"rounded-bl":[{"rounded-bl":ue()}],"border-w":[{border:he()}],"border-w-x":[{"border-x":he()}],"border-w-y":[{"border-y":he()}],"border-w-s":[{"border-s":he()}],"border-w-e":[{"border-e":he()}],"border-w-bs":[{"border-bs":he()}],"border-w-be":[{"border-be":he()}],"border-w-t":[{"border-t":he()}],"border-w-r":[{"border-r":he()}],"border-w-b":[{"border-b":he()}],"border-w-l":[{"border-l":he()}],"divide-x":[{"divide-x":he()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":he()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ae(),"hidden","none"]}],"divide-style":[{divide:[...Ae(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-bs":[{"border-bs":z()}],"border-color-be":[{"border-be":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...Ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[We,be,xe]}],"outline-w":[{outline:["",We,lu,Oi]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",f,rf,nf]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",p,rf,nf]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:he()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[We,Oi]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":he()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",m,rf,nf]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[We,be,xe]}],"mix-blend":[{"mix-blend":[...X(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":X()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[We]}],"mask-image-linear-from-pos":[{"mask-linear-from":ce()}],"mask-image-linear-to-pos":[{"mask-linear-to":ce()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":ce()}],"mask-image-t-to-pos":[{"mask-t-to":ce()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":ce()}],"mask-image-r-to-pos":[{"mask-r-to":ce()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":ce()}],"mask-image-b-to-pos":[{"mask-b-to":ce()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":ce()}],"mask-image-l-to-pos":[{"mask-l-to":ce()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":ce()}],"mask-image-x-to-pos":[{"mask-x-to":ce()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":ce()}],"mask-image-y-to-pos":[{"mask-y-to":ce()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[be,xe]}],"mask-image-radial-from-pos":[{"mask-radial-from":ce()}],"mask-image-radial-to-pos":[{"mask-radial-to":ce()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[We]}],"mask-image-conic-from-pos":[{"mask-conic-from":ce()}],"mask-image-conic-to-pos":[{"mask-conic-to":ce()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:ne()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",be,xe]}],filter:[{filter:["","none",be,xe]}],blur:[{blur:pe()}],brightness:[{brightness:[We,be,xe]}],contrast:[{contrast:[We,be,xe]}],"drop-shadow":[{"drop-shadow":["","none",y,rf,nf]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",We,be,xe]}],"hue-rotate":[{"hue-rotate":[We,be,xe]}],invert:[{invert:["",We,be,xe]}],saturate:[{saturate:[We,be,xe]}],sepia:[{sepia:["",We,be,xe]}],"backdrop-filter":[{"backdrop-filter":["","none",be,xe]}],"backdrop-blur":[{"backdrop-blur":pe()}],"backdrop-brightness":[{"backdrop-brightness":[We,be,xe]}],"backdrop-contrast":[{"backdrop-contrast":[We,be,xe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",We,be,xe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[We,be,xe]}],"backdrop-invert":[{"backdrop-invert":["",We,be,xe]}],"backdrop-opacity":[{"backdrop-opacity":[We,be,xe]}],"backdrop-saturate":[{"backdrop-saturate":[We,be,xe]}],"backdrop-sepia":[{"backdrop-sepia":["",We,be,xe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",be,xe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[We,"initial",be,xe]}],ease:[{ease:["linear","initial",E,be,xe]}],delay:[{delay:[We,be,xe]}],animate:[{animate:["none",_,be,xe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,be,xe]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:Le()}],"rotate-x":[{"rotate-x":Le()}],"rotate-y":[{"rotate-y":Le()}],"rotate-z":[{"rotate-z":Le()}],scale:[{scale:Ne()}],"scale-x":[{"scale-x":Ne()}],"scale-y":[{"scale-y":Ne()}],"scale-z":[{"scale-z":Ne()}],"scale-3d":["scale-3d"],skew:[{skew:$e()}],"skew-x":[{"skew-x":$e()}],"skew-y":[{"skew-y":$e()}],transform:[{transform:[be,xe,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ze()}],"translate-x":[{"translate-x":Ze()}],"translate-y":[{"translate-y":Ze()}],"translate-z":[{"translate-z":Ze()}],"translate-none":["translate-none"],zoom:[{zoom:[oo,be,xe]}],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",be,xe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":z()}],"scrollbar-track-color":[{"scrollbar-track":z()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mbs":[{"scroll-mbs":P()}],"scroll-mbe":[{"scroll-mbe":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pbs":[{"scroll-pbs":P()}],"scroll-pbe":[{"scroll-pbe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",be,xe]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[We,lu,Oi,U2]}],stroke:[{stroke:["none",...z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},EP=nP(SP);function De(...t){return EP(LS(t))}const _P=zS("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function Yi({className:t,variant:e="default",asChild:n=!1,...r}){const o=n?BS:"span";return x.jsx(o,{"data-slot":"badge","data-variant":e,className:De(_P({variant:e}),t),...r})}const Xy=zS("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}}),ze=C.forwardRef(({className:t,variant:e="default",size:n="default",asChild:r=!1,...o},s)=>{const i=r?BS:"button";return x.jsx(i,{ref:s,"data-slot":"button","data-variant":e,"data-size":n,className:De(Xy({variant:e,size:n,className:t})),...o})});ze.displayName="Button";/**
81
- * @license lucide-react v1.27.0 - ISC
82
- *
83
- * This source code is licensed under the ISC license.
84
- * See the LICENSE file in the root directory of this source tree.
85
- */const GE=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
86
- * @license lucide-react v1.27.0 - ISC
87
- *
88
- * This source code is licensed under the ISC license.
89
- * See the LICENSE file in the root directory of this source tree.
90
- */const TP=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
91
- * @license lucide-react v1.27.0 - ISC
92
- *
93
- * This source code is licensed under the ISC license.
94
- * See the LICENSE file in the root directory of this source tree.
95
- */const MP=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
96
- * @license lucide-react v1.27.0 - ISC
97
- *
98
- * This source code is licensed under the ISC license.
99
- * See the LICENSE file in the root directory of this source tree.
100
- */const K2=t=>{const e=MP(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
101
- * @license lucide-react v1.27.0 - ISC
102
- *
103
- * This source code is licensed under the ISC license.
104
- * See the LICENSE file in the root directory of this source tree.
105
- */var Y0={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"};/**
106
- * @license lucide-react v1.27.0 - ISC
107
- *
108
- * This source code is licensed under the ISC license.
109
- * See the LICENSE file in the root directory of this source tree.
110
- */const AP=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},NP=C.createContext({}),DP=()=>C.useContext(NP),RP=C.forwardRef(({color:t,size:e,strokeWidth:n,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...l},u)=>{const{size:d=24,strokeWidth:f=2,absoluteStrokeWidth:p=!1,color:m="currentColor",className:y=""}=DP()??{},v=r??p?Number(n??f)*24/Number(e??d):n??f;return C.createElement("svg",{ref:u,...Y0,width:e??d??Y0.width,height:e??d??Y0.height,stroke:t??m,strokeWidth:v,className:GE("lucide",y,o),...!s&&!AP(l)&&{"aria-hidden":"true"},...l},[...i.map(([b,k])=>C.createElement(b,k)),...Array.isArray(s)?s:[s]])});/**
111
- * @license lucide-react v1.27.0 - ISC
112
- *
113
- * This source code is licensed under the ISC license.
114
- * See the LICENSE file in the root directory of this source tree.
115
- */const _e=(t,e)=>{const n=C.forwardRef(({className:r,...o},s)=>C.createElement(RP,{ref:s,iconNode:e,className:GE(`lucide-${TP(K2(t))}`,`lucide-${t}`,r),...o}));return n.displayName=K2(t),n};/**
116
- * @license lucide-react v1.27.0 - ISC
117
- *
118
- * This source code is licensed under the ISC license.
119
- * See the LICENSE file in the root directory of this source tree.
120
- */const OP=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]],IP=_e("bold",OP);/**
121
- * @license lucide-react v1.27.0 - ISC
122
- *
123
- * This source code is licensed under the ISC license.
124
- * See the LICENSE file in the root directory of this source tree.
125
- */const PP=[["path",{d:"M12 5v16",key:"1f6ucr"}],["path",{d:"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z",key:"1fyvmf"}]],jP=_e("book-open",PP);/**
126
- * @license lucide-react v1.27.0 - ISC
127
- *
128
- * This source code is licensed under the ISC license.
129
- * See the LICENSE file in the root directory of this source tree.
130
- */const LP=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],vp=_e("boxes",LP);/**
131
- * @license lucide-react v1.27.0 - ISC
132
- *
133
- * This source code is licensed under the ISC license.
134
- * See the LICENSE file in the root directory of this source tree.
135
- */const zP=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],kl=_e("braces",zP);/**
136
- * @license lucide-react v1.27.0 - ISC
137
- *
138
- * This source code is licensed under the ISC license.
139
- * See the LICENSE file in the root directory of this source tree.
140
- */const FP=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],$P=_e("calendar-days",FP);/**
141
- * @license lucide-react v1.27.0 - ISC
142
- *
143
- * This source code is licensed under the ISC license.
144
- * See the LICENSE file in the root directory of this source tree.
145
- */const BP=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],VP=_e("calendar",BP);/**
146
- * @license lucide-react v1.27.0 - ISC
147
- *
148
- * This source code is licensed under the ISC license.
149
- * See the LICENSE file in the root directory of this source tree.
150
- */const HP=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Qy=_e("check",HP);/**
151
- * @license lucide-react v1.27.0 - ISC
152
- *
153
- * This source code is licensed under the ISC license.
154
- * See the LICENSE file in the root directory of this source tree.
155
- */const UP=[["path",{d:"M17 21a1 1 0 0 0 1-1v-5.35c0-.457.316-.844.727-1.041a4 4 0 0 0-2.134-7.589 5 5 0 0 0-9.186 0 4 4 0 0 0-2.134 7.588c.411.198.727.585.727 1.041V20a1 1 0 0 0 1 1Z",key:"1qvrer"}],["path",{d:"M6 17h12",key:"1jwigz"}]],WP=_e("chef-hat",UP);/**
156
- * @license lucide-react v1.27.0 - ISC
157
- *
158
- * This source code is licensed under the ISC license.
159
- * See the LICENSE file in the root directory of this source tree.
160
- */const qP=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ex=_e("chevron-down",qP);/**
161
- * @license lucide-react v1.27.0 - ISC
162
- *
163
- * This source code is licensed under the ISC license.
164
- * See the LICENSE file in the root directory of this source tree.
165
- */const KP=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],tx=_e("chevron-right",KP);/**
166
- * @license lucide-react v1.27.0 - ISC
167
- *
168
- * This source code is licensed under the ISC license.
169
- * See the LICENSE file in the root directory of this source tree.
170
- */const GP=[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]],JP=_e("chevrons-down-up",GP);/**
171
- * @license lucide-react v1.27.0 - ISC
172
- *
173
- * This source code is licensed under the ISC license.
174
- * See the LICENSE file in the root directory of this source tree.
175
- */const ZP=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],YP=_e("chevron-up",ZP);/**
176
- * @license lucide-react v1.27.0 - ISC
177
- *
178
- * This source code is licensed under the ISC license.
179
- * See the LICENSE file in the root directory of this source tree.
180
- */const XP=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],JE=_e("chevrons-up-down",XP);/**
181
- * @license lucide-react v1.27.0 - ISC
182
- *
183
- * This source code is licensed under the ISC license.
184
- * See the LICENSE file in the root directory of this source tree.
185
- */const QP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],nx=_e("circle-alert",QP);/**
186
- * @license lucide-react v1.27.0 - ISC
187
- *
188
- * This source code is licensed under the ISC license.
189
- * See the LICENSE file in the root directory of this source tree.
190
- */const ej=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],tj=_e("circle-check",ej);/**
191
- * @license lucide-react v1.27.0 - ISC
192
- *
193
- * This source code is licensed under the ISC license.
194
- * See the LICENSE file in the root directory of this source tree.
195
- */const nj=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],rj=_e("code",nj);/**
196
- * @license lucide-react v1.27.0 - ISC
197
- *
198
- * This source code is licensed under the ISC license.
199
- * See the LICENSE file in the root directory of this source tree.
200
- */const oj=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],sj=_e("copy",oj);/**
201
- * @license lucide-react v1.27.0 - ISC
202
- *
203
- * This source code is licensed under the ISC license.
204
- * See the LICENSE file in the root directory of this source tree.
205
- */const ij=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],aj=_e("download",ij);/**
206
- * @license lucide-react v1.27.0 - ISC
207
- *
208
- * This source code is licensed under the ISC license.
209
- * See the LICENSE file in the root directory of this source tree.
210
- */const lj=[["path",{d:"M14 22h4a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v6",key:"14cnrg"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M5 14a1 1 0 0 0-1 1v2a1 1 0 0 1-1 1 1 1 0 0 1 1 1v2a1 1 0 0 0 1 1",key:"sr0ebq"}],["path",{d:"M9 22a1 1 0 0 0 1-1v-2a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-2a1 1 0 0 0-1-1",key:"w793db"}]],uj=_e("file-braces-corner",lj);/**
211
- * @license lucide-react v1.27.0 - ISC
212
- *
213
- * This source code is licensed under the ISC license.
214
- * See the LICENSE file in the root directory of this source tree.
215
- */const cj=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],dj=_e("file-braces",cj);/**
216
- * @license lucide-react v1.27.0 - ISC
217
- *
218
- * This source code is licensed under the ISC license.
219
- * See the LICENSE file in the root directory of this source tree.
220
- */const fj=[["path",{d:"M15 8a1 1 0 0 1-1-1V2a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8z",key:"1ckgky"}],["path",{d:"M20 8v12a2 2 0 0 1-2 2h-4.182",key:"1726p0"}],["path",{d:"m3.305 19.53.923-.382",key:"ao1pio"}],["path",{d:"M4 10.592V4a2 2 0 0 1 2-2h8",key:"1foop0"}],["path",{d:"m4.228 16.852-.924-.383",key:"1fv9zy"}],["path",{d:"m5.852 15.228-.383-.923",key:"1a9hc2"}],["path",{d:"m5.852 20.772-.383.924",key:"1sh9ke"}],["path",{d:"m8.148 15.228.383-.923",key:"4yu6lf"}],["path",{d:"m8.53 21.696-.382-.924",key:"18b0s9"}],["path",{d:"m9.773 16.852.922-.383",key:"ti6xop"}],["path",{d:"m9.773 19.148.922.383",key:"rws47d"}],["circle",{cx:"7",cy:"18",r:"3",key:"lvkj7j"}]],hj=_e("file-cog",fj);/**
221
- * @license lucide-react v1.27.0 - ISC
222
- *
223
- * This source code is licensed under the ISC license.
224
- * See the LICENSE file in the root directory of this source tree.
225
- */const pj=[["path",{d:"M11 21a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1",key:"likhh7"}],["path",{d:"M16 16a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1",key:"17ky3x"}],["path",{d:"M21 6a2 2 0 0 0-.586-1.414l-2-2A2 2 0 0 0 17 2h-3a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1z",key:"1hyeo0"}]],mj=_e("file-stack",pj);/**
226
- * @license lucide-react v1.27.0 - ISC
227
- *
228
- * This source code is licensed under the ISC license.
229
- * See the LICENSE file in the root directory of this source tree.
230
- */const gj=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],ZE=_e("file-text",gj);/**
231
- * @license lucide-react v1.27.0 - ISC
232
- *
233
- * This source code is licensed under the ISC license.
234
- * See the LICENSE file in the root directory of this source tree.
235
- */const yj=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],YE=_e("folder-git-2",yj);/**
236
- * @license lucide-react v1.27.0 - ISC
237
- *
238
- * This source code is licensed under the ISC license.
239
- * See the LICENSE file in the root directory of this source tree.
240
- */const xj=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],rx=_e("grip-vertical",xj);/**
241
- * @license lucide-react v1.27.0 - ISC
242
- *
243
- * This source code is licensed under the ISC license.
244
- * See the LICENSE file in the root directory of this source tree.
245
- */const vj=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],bj=_e("hash",vj);/**
246
- * @license lucide-react v1.27.0 - ISC
247
- *
248
- * This source code is licensed under the ISC license.
249
- * See the LICENSE file in the root directory of this source tree.
250
- */const kj=[["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"}]],wj=_e("heading-2",kj);/**
251
- * @license lucide-react v1.27.0 - ISC
252
- *
253
- * This source code is licensed under the ISC license.
254
- * See the LICENSE file in the root directory of this source tree.
255
- */const Cj=[["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"}]],Sj=_e("heading-3",Cj);/**
256
- * @license lucide-react v1.27.0 - ISC
257
- *
258
- * This source code is licensed under the ISC license.
259
- * See the LICENSE file in the root directory of this source tree.
260
- */const Ej=[["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"}]],XE=_e("image",Ej);/**
261
- * @license lucide-react v1.27.0 - ISC
262
- *
263
- * This source code is licensed under the ISC license.
264
- * See the LICENSE file in the root directory of this source tree.
265
- */const _j=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Tj=_e("info",_j);/**
266
- * @license lucide-react v1.27.0 - ISC
267
- *
268
- * This source code is licensed under the ISC license.
269
- * See the LICENSE file in the root directory of this source tree.
270
- */const Mj=[["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"}]],Aj=_e("italic",Mj);/**
271
- * @license lucide-react v1.27.0 - ISC
272
- *
273
- * This source code is licensed under the ISC license.
274
- * See the LICENSE file in the root directory of this source tree.
275
- */const Nj=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],Dj=_e("key-round",Nj);/**
276
- * @license lucide-react v1.27.0 - ISC
277
- *
278
- * This source code is licensed under the ISC license.
279
- * See the LICENSE file in the root directory of this source tree.
280
- */const Rj=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],Oj=_e("layout-grid",Rj);/**
281
- * @license lucide-react v1.27.0 - ISC
282
- *
283
- * This source code is licensed under the ISC license.
284
- * See the LICENSE file in the root directory of this source tree.
285
- */const Ij=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],QE=_e("link-2",Ij);/**
286
- * @license lucide-react v1.27.0 - ISC
287
- *
288
- * This source code is licensed under the ISC license.
289
- * See the LICENSE file in the root directory of this source tree.
290
- */const Pj=[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]],jj=_e("list-ordered",Pj);/**
291
- * @license lucide-react v1.27.0 - ISC
292
- *
293
- * This source code is licensed under the ISC license.
294
- * See the LICENSE file in the root directory of this source tree.
295
- */const Lj=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],e_=_e("list",Lj);/**
296
- * @license lucide-react v1.27.0 - ISC
297
- *
298
- * This source code is licensed under the ISC license.
299
- * See the LICENSE file in the root directory of this source tree.
300
- */const zj=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Xi=_e("loader-circle",zj);/**
301
- * @license lucide-react v1.27.0 - ISC
302
- *
303
- * This source code is licensed under the ISC license.
304
- * See the LICENSE file in the root directory of this source tree.
305
- */const Fj=[["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2",key:"39pd36"}],["rect",{width:"8",height:"4",x:"10",y:"6",rx:"1",key:"aywv1n"}]],$j=_e("newspaper",Fj);/**
306
- * @license lucide-react v1.27.0 - ISC
307
- *
308
- * This source code is licensed under the ISC license.
309
- * See the LICENSE file in the root directory of this source tree.
310
- */const Bj=[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Vj=_e("octagon-x",Bj);/**
311
- * @license lucide-react v1.27.0 - ISC
312
- *
313
- * This source code is licensed under the ISC license.
314
- * See the LICENSE file in the root directory of this source tree.
315
- */const Hj=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],Uj=_e("pen-line",Hj);/**
316
- * @license lucide-react v1.27.0 - ISC
317
- *
318
- * This source code is licensed under the ISC license.
319
- * See the LICENSE file in the root directory of this source tree.
320
- */const Wj=[["path",{d:"M13 7 8.7 2.7a2.41 2.41 0 0 0-3.4 0L2.7 5.3a2.41 2.41 0 0 0 0 3.4L7 13",key:"orapub"}],["path",{d:"m8 6 2-2",key:"115y1s"}],["path",{d:"m18 16 2-2",key:"ee94s4"}],["path",{d:"m17 11 4.3 4.3c.94.94.94 2.46 0 3.4l-2.6 2.6c-.94.94-2.46.94-3.4 0L11 17",key:"cfq27r"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],t_=_e("pencil-ruler",Wj);/**
321
- * @license lucide-react v1.27.0 - ISC
322
- *
323
- * This source code is licensed under the ISC license.
324
- * See the LICENSE file in the root directory of this source tree.
325
- */const qj=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Qi=_e("plus",qj);/**
326
- * @license lucide-react v1.27.0 - ISC
327
- *
328
- * This source code is licensed under the ISC license.
329
- * See the LICENSE file in the root directory of this source tree.
330
- */const Kj=[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]],Gj=_e("quote",Kj);/**
331
- * @license lucide-react v1.27.0 - ISC
332
- *
333
- * This source code is licensed under the ISC license.
334
- * See the LICENSE file in the root directory of this source tree.
335
- */const Jj=[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]],Zj=_e("redo-2",Jj);/**
336
- * @license lucide-react v1.27.0 - ISC
337
- *
338
- * This source code is licensed under the ISC license.
339
- * See the LICENSE file in the root directory of this source tree.
340
- */const Yj=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Xj=_e("refresh-cw",Yj);/**
341
- * @license lucide-react v1.27.0 - ISC
342
- *
343
- * This source code is licensed under the ISC license.
344
- * See the LICENSE file in the root directory of this source tree.
345
- */const Qj=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],e9=_e("rotate-ccw-clock",Qj);/**
346
- * @license lucide-react v1.27.0 - ISC
347
- *
348
- * This source code is licensed under the ISC license.
349
- * See the LICENSE file in the root directory of this source tree.
350
- */const t9=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],n9=_e("rotate-ccw",t9);/**
351
- * @license lucide-react v1.27.0 - ISC
352
- *
353
- * This source code is licensed under the ISC license.
354
- * See the LICENSE file in the root directory of this source tree.
355
- */const r9=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]],o9=_e("rows-3",r9);/**
356
- * @license lucide-react v1.27.0 - ISC
357
- *
358
- * This source code is licensed under the ISC license.
359
- * See the LICENSE file in the root directory of this source tree.
360
- */const s9=[["path",{d:"m13.5 8.5-5 5",key:"1cs55j"}],["path",{d:"m8.5 8.5 5 5",key:"a8mexj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],i9=_e("search-x",s9);/**
361
- * @license lucide-react v1.27.0 - ISC
362
- *
363
- * This source code is licensed under the ISC license.
364
- * See the LICENSE file in the root directory of this source tree.
365
- */const a9=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],l9=_e("search",a9);/**
366
- * @license lucide-react v1.27.0 - ISC
367
- *
368
- * This source code is licensed under the ISC license.
369
- * See the LICENSE file in the root directory of this source tree.
370
- */const u9=[["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}],["path",{d:"M3.103 6.034h17.794",key:"awc11p"}],["path",{d:"M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z",key:"o988cm"}]],c9=_e("shopping-bag",u9);/**
371
- * @license lucide-react v1.27.0 - ISC
372
- *
373
- * This source code is licensed under the ISC license.
374
- * See the LICENSE file in the root directory of this source tree.
375
- */const d9=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Wu=_e("sparkles",d9);/**
376
- * @license lucide-react v1.27.0 - ISC
377
- *
378
- * This source code is licensed under the ISC license.
379
- * See the LICENSE file in the root directory of this source tree.
380
- */const f9=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],h9=_e("toggle-left",f9);/**
381
- * @license lucide-react v1.27.0 - ISC
382
- *
383
- * This source code is licensed under the ISC license.
384
- * See the LICENSE file in the root directory of this source tree.
385
- */const p9=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],n_=_e("trash-2",p9);/**
386
- * @license lucide-react v1.27.0 - ISC
387
- *
388
- * This source code is licensed under the ISC license.
389
- * See the LICENSE file in the root directory of this source tree.
390
- */const m9=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],ox=_e("triangle-alert",m9);/**
391
- * @license lucide-react v1.27.0 - ISC
392
- *
393
- * This source code is licensed under the ISC license.
394
- * See the LICENSE file in the root directory of this source tree.
395
- */const g9=[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]],y9=_e("type",g9);/**
396
- * @license lucide-react v1.27.0 - ISC
397
- *
398
- * This source code is licensed under the ISC license.
399
- * See the LICENSE file in the root directory of this source tree.
400
- */const x9=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],v9=_e("undo-2",x9);/**
401
- * @license lucide-react v1.27.0 - ISC
402
- *
403
- * This source code is licensed under the ISC license.
404
- * See the LICENSE file in the root directory of this source tree.
405
- */const b9=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],r_=_e("upload",b9);/**
406
- * @license lucide-react v1.27.0 - ISC
407
- *
408
- * This source code is licensed under the ISC license.
409
- * See the LICENSE file in the root directory of this source tree.
410
- */const k9=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],w9=_e("user",k9);/**
411
- * @license lucide-react v1.27.0 - ISC
412
- *
413
- * This source code is licensed under the ISC license.
414
- * See the LICENSE file in the root directory of this source tree.
415
- */const C9=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],bp=_e("x",C9);function wc({...t}){return x.jsx(bD,{"data-slot":"dialog",...t})}function S9({...t}){return x.jsx(wD,{"data-slot":"dialog-trigger",...t})}function E9({...t}){return x.jsx(SD,{"data-slot":"dialog-portal",...t})}function kp({...t}){return x.jsx(My,{"data-slot":"dialog-close",...t})}function _9({className:t,...e}){return x.jsx(ED,{"data-slot":"dialog-overlay",className:De("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",t),...e})}function Cc({className:t,children:e,showCloseButton:n=!0,...r}){return x.jsxs(E9,{children:[x.jsx(_9,{}),x.jsxs(MD,{"data-slot":"dialog-content",className:De("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...r,children:[e,n&&x.jsx(My,{"data-slot":"dialog-close",asChild:!0,children:x.jsxs(ze,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm",children:[x.jsx(bp,{}),x.jsx("span",{className:"sr-only",children:"Close"})]})})]})]})}function Sc({className:t,...e}){return x.jsx("div",{"data-slot":"dialog-header",className:De("flex flex-col gap-2",t),...e})}function wp({className:t,showCloseButton:e=!1,children:n,...r}){return x.jsxs("div",{"data-slot":"dialog-footer",className:De("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",t),...r,children:[n,e&&x.jsx(My,{asChild:!0,children:x.jsx(ze,{variant:"outline",children:"Close"})})]})}function Ec({className:t,...e}){return x.jsx(RD,{"data-slot":"dialog-title",className:De("font-heading text-base leading-none font-medium",t),...e})}function _c({className:t,...e}){return x.jsx(ID,{"data-slot":"dialog-description",className:De("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",t),...e})}function o_({...t}){return x.jsx(yO,{"data-slot":"dropdown-menu",...t})}function s_({...t}){return x.jsx(xO,{"data-slot":"dropdown-menu-trigger",...t})}function i_({className:t,align:e="start",sideOffset:n=4,...r}){return x.jsx(vO,{children:x.jsx(bO,{"data-slot":"dropdown-menu-content",sideOffset:n,align:e,className:De("z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:overflow-hidden data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...r})})}function X0({className:t,inset:e,variant:n="default",...r}){return x.jsx(wO,{"data-slot":"dropdown-menu-item","data-inset":e,"data-variant":n,className:De("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",t),...r})}function T9({className:t,children:e,checked:n,inset:r,...o}){return x.jsxs(CO,{"data-slot":"dropdown-menu-checkbox-item","data-inset":r,className:De("relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),checked:n,...o,children:[x.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-checkbox-item-indicator",children:x.jsx(SO,{children:x.jsx(Qy,{})})}),e]})}function a_({className:t,inset:e,...n}){return x.jsx(kO,{"data-slot":"dropdown-menu-label","data-inset":e,className:De("px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7",t),...n})}function Df({className:t,...e}){return x.jsx(EO,{"data-slot":"dropdown-menu-separator",className:De("-mx-1 my-1 h-px bg-border",t),...e})}function ar({className:t,type:e,...n}){return x.jsx("input",{type:e,"data-slot":"input",className:De("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",t),...n})}function pu({className:t,...e}){return x.jsx(AO,{"data-slot":"label",className:De("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...e})}function Wf({...t}){return x.jsx(BO,{"data-slot":"select",...t})}function qf({...t}){return x.jsx(WO,{"data-slot":"select-value",...t})}function Kf({className:t,size:e="default",children:n,...r}){return x.jsxs(HO,{"data-slot":"select-trigger","data-size":e,className:De("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...r,children:[n,x.jsx(qO,{asChild:!0,children:x.jsx(ex,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function Gf({className:t,children:e,position:n="item-aligned",align:r="center",...o}){return x.jsx(ZO,{children:x.jsxs(YO,{"data-slot":"select-content","data-align-trigger":n==="item-aligned",className:De("relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",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,align:r,...o,children:[x.jsx(M9,{}),x.jsx(rI,{"data-position":n,className:De("data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)",n==="popper"&&""),children:e}),x.jsx(A9,{})]})})}function Jf({className:t,children:e,...n}){return x.jsxs(iI,{"data-slot":"select-item",className:De("relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...n,children:[x.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center",children:x.jsx(uI,{children:x.jsx(Qy,{className:"pointer-events-none"})})}),x.jsx(aI,{children:e})]})}function M9({className:t,...e}){return x.jsx(cI,{"data-slot":"select-scroll-up-button",className:De("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",t),...e,children:x.jsx(YP,{})})}function A9({className:t,...e}){return x.jsx(dI,{"data-slot":"select-scroll-down-button",className:De("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",t),...e,children:x.jsx(ex,{})})}var N9=(t,e,n,r,o,s,i,l)=>{let u=document.documentElement,d=["light","dark"];function f(y){(Array.isArray(t)?t:[t]).forEach(v=>{let b=v==="class",k=b&&s?o.map(E=>s[E]||E):o;b?(u.classList.remove(...k),u.classList.add(s&&s[y]?s[y]:y)):u.setAttribute(v,y)}),p(y)}function p(y){l&&d.includes(y)&&(u.style.colorScheme=y)}function m(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)f(r);else try{let y=localStorage.getItem(e)||n,v=i&&y==="system"?m():y;f(v)}catch{}},D9=C.createContext(void 0),R9={setTheme:t=>{},themes:[]},O9=()=>{var t;return(t=C.useContext(D9))!=null?t:R9};C.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:r,enableColorScheme:o,defaultTheme:s,value:i,themes:l,nonce:u,scriptProps:d})=>{let f=JSON.stringify([n,e,s,t,l,i,r,o]).slice(1,-1);return C.createElement("script",{...d,suppressHydrationWarning:!0,nonce:typeof window>"u"?u:"",dangerouslySetInnerHTML:{__html:`(${N9.toString()})(${f})`}})});function I9(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}const P9=t=>{switch(t){case"success":return z9;case"info":return $9;case"warning":return F9;case"error":return B9;default:return null}},j9=Array(12).fill(0),L9=({visible:t,className:e})=>te.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},te.createElement("div",{className:"sonner-spinner"},j9.map((n,r)=>te.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),z9=te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},te.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),F9=te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},te.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),$9=te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},te.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),B9=te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},te.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),V9=te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},te.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),te.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),H9=()=>{const[t,e]=te.useState(document.hidden);return te.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t};let k1=1;class U9{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var n;const{message:r,...o}=e,s=typeof(e==null?void 0:e.id)=="number"||((n=e.id)==null?void 0:n.length)>0?e.id:k1++,i=this.toasts.find(u=>u.id===s),l=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(u=>u.id===s?(this.publish({...u,...e,id:s,title:r}),{...u,...e,id:s,dismissible:l,title:r}):u):this.addToast({title:r,...o,dismissible:l,id:s}),s},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:e,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),e),this.message=(e,n)=>this.create({...n,message:e}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const o=Promise.resolve(e instanceof Function?e():e);let s=r!==void 0,i;const l=o.then(async d=>{if(i=["resolve",d],te.isValidElement(d))s=!1,this.create({id:r,type:"default",message:d});else if(q9(d)&&!d.ok){s=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,m=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,v=typeof p=="object"&&!te.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:m,...v})}else if(d instanceof Error){s=!1;const p=typeof n.error=="function"?await n.error(d):n.error,m=typeof n.description=="function"?await n.description(d):n.description,v=typeof p=="object"&&!te.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:m,...v})}else if(n.success!==void 0){s=!1;const p=typeof n.success=="function"?await n.success(d):n.success,m=typeof n.description=="function"?await n.description(d):n.description,v=typeof p=="object"&&!te.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:m,...v})}}).catch(async d=>{if(i=["reject",d],n.error!==void 0){s=!1;const f=typeof n.error=="function"?await n.error(d):n.error,p=typeof n.description=="function"?await n.description(d):n.description,y=typeof f=="object"&&!te.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:p,...y})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),u=()=>new Promise((d,f)=>l.then(()=>i[0]==="reject"?f(i[1]):d(i[1])).catch(f));return typeof r!="string"&&typeof r!="number"?{unwrap:u}:Object.assign(r,{unwrap:u})},this.custom=(e,n)=>{const r=(n==null?void 0:n.id)||k1++;return this.create({jsx:e(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Jn=new U9,W9=(t,e)=>{const n=(e==null?void 0:e.id)||k1++;return Jn.addToast({title:t,...e,id:n}),n},q9=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",K9=W9,G9=()=>Jn.toasts,J9=()=>Jn.getActiveToasts(),Zt=Object.assign(K9,{success:Jn.success,info:Jn.info,warning:Jn.warning,error:Jn.error,custom:Jn.custom,message:Jn.message,promise:Jn.promise,dismiss:Jn.dismiss,loading:Jn.loading},{getHistory:G9,getToasts:J9});I9("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function of(t){return t.label!==void 0}const Z9=3,Y9="24px",X9="16px",G2=4e3,Q9=356,eL=14,tL=45,nL=200;function so(...t){return t.filter(Boolean).join(" ")}function rL(t){const[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}const oL=t=>{var e,n,r,o,s,i,l,u,d;const{invert:f,toast:p,unstyled:m,interacting:y,setHeights:v,visibleToasts:b,heights:k,index:E,toasts:_,expanded:T,removeToast:A,defaultRichColors:N,closeButton:D,style:I,cancelButtonStyle:P,actionButtonStyle:O,className:U="",descriptionClassName:J="",duration:K,position:q,gap:Z,expandByDefault:Q,classNames:G,icons:Y,closeButtonAriaLabel:W="Close toast"}=t,[ee,z]=te.useState(null),[j,B]=te.useState(null),[ne,fe]=te.useState(!1),[ue,he]=te.useState(!1),[Ae,X]=te.useState(!1),[ce,pe]=te.useState(!1),[Le,Ne]=te.useState(!1),[$e,Ze]=te.useState(0),[Mt,Pt]=te.useState(0),Ht=te.useRef(p.duration||K||G2),zn=te.useRef(null),Ut=te.useRef(null),en=E===0,An=E+1<=b,ht=p.type,hr=p.dismissible!==!1,gi=p.className||"",ha=p.descriptionClassName||"",To=te.useMemo(()=>k.findIndex(Te=>Te.toastId===p.id)||0,[k,p.id]),pr=te.useMemo(()=>{var Te;return(Te=p.closeButton)!=null?Te:D},[p.closeButton,D]),Fn=te.useMemo(()=>p.duration||K||G2,[p.duration,K]),mr=te.useRef(0),Nn=te.useRef(0),hn=te.useRef(0),Rr=te.useRef(null),[pa,ma]=q.split("-"),ds=te.useMemo(()=>k.reduce((Te,st,et)=>et>=To?Te:Te+st.height,0),[k,To]),Mo=H9(),yi=p.invert||f,Zr=ht==="loading";Nn.current=te.useMemo(()=>To*Z+ds,[To,ds]),te.useEffect(()=>{Ht.current=Fn},[Fn]),te.useEffect(()=>{fe(!0)},[]),te.useEffect(()=>{const Te=Ut.current;if(Te){const st=Te.getBoundingClientRect().height;return Pt(st),v(et=>[{toastId:p.id,height:st,position:p.position},...et]),()=>v(et=>et.filter(it=>it.toastId!==p.id))}},[v,p.id]),te.useLayoutEffect(()=>{if(!ne)return;const Te=Ut.current,st=Te.style.height;Te.style.height="auto";const et=Te.getBoundingClientRect().height;Te.style.height=st,Pt(et),v(it=>it.find(pt=>pt.toastId===p.id)?it.map(pt=>pt.toastId===p.id?{...pt,height:et}:pt):[{toastId:p.id,height:et,position:p.position},...it])},[ne,p.title,p.description,v,p.id,p.jsx,p.action,p.cancel]);const $n=te.useCallback(()=>{he(!0),Ze(Nn.current),v(Te=>Te.filter(st=>st.toastId!==p.id)),setTimeout(()=>{A(p)},nL)},[p,A,v,Nn]);te.useEffect(()=>{if(p.promise&&ht==="loading"||p.duration===1/0||p.type==="loading")return;let Te;return T||y||Mo?(()=>{if(hn.current<mr.current){const it=new Date().getTime()-mr.current;Ht.current=Ht.current-it}hn.current=new Date().getTime()})():(()=>{Ht.current!==1/0&&(mr.current=new Date().getTime(),Te=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),$n()},Ht.current))})(),()=>clearTimeout(Te)},[T,y,p,ht,Mo,$n]),te.useEffect(()=>{p.delete&&($n(),p.onDismiss==null||p.onDismiss.call(p,p))},[$n,p.delete]);function xi(){var Te;if(Y!=null&&Y.loading){var st;return te.createElement("div",{className:so(G==null?void 0:G.loader,p==null||(st=p.classNames)==null?void 0:st.loader,"sonner-loader"),"data-visible":ht==="loading"},Y.loading)}return te.createElement(L9,{className:so(G==null?void 0:G.loader,p==null||(Te=p.classNames)==null?void 0:Te.loader),visible:ht==="loading"})}const Yr=p.icon||(Y==null?void 0:Y[ht])||P9(ht);var mt,Wt;return te.createElement("li",{tabIndex:0,ref:Ut,className:so(U,gi,G==null?void 0:G.toast,p==null||(e=p.classNames)==null?void 0:e.toast,G==null?void 0:G.default,G==null?void 0:G[ht],p==null||(n=p.classNames)==null?void 0:n[ht]),"data-sonner-toast":"","data-rich-colors":(mt=p.richColors)!=null?mt:N,"data-styled":!(p.jsx||p.unstyled||m),"data-mounted":ne,"data-promise":!!p.promise,"data-swiped":Le,"data-removed":ue,"data-visible":An,"data-y-position":pa,"data-x-position":ma,"data-index":E,"data-front":en,"data-swiping":Ae,"data-dismissible":hr,"data-type":ht,"data-invert":yi,"data-swipe-out":ce,"data-swipe-direction":j,"data-expanded":!!(T||Q&&ne),"data-testid":p.testId,style:{"--index":E,"--toasts-before":E,"--z-index":_.length-E,"--offset":`${ue?$e:Nn.current}px`,"--initial-height":Q?"auto":`${Mt}px`,...I,...p.style},onDragEnd:()=>{X(!1),z(null),Rr.current=null},onPointerDown:Te=>{Te.button!==2&&(Zr||!hr||(zn.current=new Date,Ze(Nn.current),Te.target.setPointerCapture(Te.pointerId),Te.target.tagName!=="BUTTON"&&(X(!0),Rr.current={x:Te.clientX,y:Te.clientY})))},onPointerUp:()=>{var Te,st,et;if(ce||!hr)return;Rr.current=null;const it=Number(((Te=Ut.current)==null?void 0:Te.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),qt=Number(((st=Ut.current)==null?void 0:st.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),pt=new Date().getTime()-((et=zn.current)==null?void 0:et.getTime()),Ge=ee==="x"?it:qt,pn=Math.abs(Ge)/pt;if(Math.abs(Ge)>=tL||pn>.11){Ze(Nn.current),p.onDismiss==null||p.onDismiss.call(p,p),B(ee==="x"?it>0?"right":"left":qt>0?"down":"up"),$n(),pe(!0);return}else{var dt,Et;(dt=Ut.current)==null||dt.style.setProperty("--swipe-amount-x","0px"),(Et=Ut.current)==null||Et.style.setProperty("--swipe-amount-y","0px")}Ne(!1),X(!1),z(null)},onPointerMove:Te=>{var st,et,it;if(!Rr.current||!hr||((st=window.getSelection())==null?void 0:st.toString().length)>0)return;const pt=Te.clientY-Rr.current.y,Ge=Te.clientX-Rr.current.x;var pn;const dt=(pn=t.swipeDirections)!=null?pn:rL(q);!ee&&(Math.abs(Ge)>1||Math.abs(pt)>1)&&z(Math.abs(Ge)>Math.abs(pt)?"x":"y");let Et={x:0,y:0};const Bn=tn=>1/(1.5+Math.abs(tn)/20);if(ee==="y"){if(dt.includes("top")||dt.includes("bottom"))if(dt.includes("top")&&pt<0||dt.includes("bottom")&&pt>0)Et.y=pt;else{const tn=pt*Bn(pt);Et.y=Math.abs(tn)<Math.abs(pt)?tn:pt}}else if(ee==="x"&&(dt.includes("left")||dt.includes("right")))if(dt.includes("left")&&Ge<0||dt.includes("right")&&Ge>0)Et.x=Ge;else{const tn=Ge*Bn(Ge);Et.x=Math.abs(tn)<Math.abs(Ge)?tn:Ge}(Math.abs(Et.x)>0||Math.abs(Et.y)>0)&&Ne(!0),(et=Ut.current)==null||et.style.setProperty("--swipe-amount-x",`${Et.x}px`),(it=Ut.current)==null||it.style.setProperty("--swipe-amount-y",`${Et.y}px`)}},pr&&!p.jsx&&ht!=="loading"?te.createElement("button",{"aria-label":W,"data-disabled":Zr,"data-close-button":!0,onClick:Zr||!hr?()=>{}:()=>{$n(),p.onDismiss==null||p.onDismiss.call(p,p)},className:so(G==null?void 0:G.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(Wt=Y==null?void 0:Y.close)!=null?Wt:V9):null,(ht||p.icon||p.promise)&&p.icon!==null&&((Y==null?void 0:Y[ht])!==null||p.icon)?te.createElement("div",{"data-icon":"",className:so(G==null?void 0:G.icon,p==null||(o=p.classNames)==null?void 0:o.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||xi():null,p.type!=="loading"?Yr:null):null,te.createElement("div",{"data-content":"",className:so(G==null?void 0:G.content,p==null||(s=p.classNames)==null?void 0:s.content)},te.createElement("div",{"data-title":"",className:so(G==null?void 0:G.title,p==null||(i=p.classNames)==null?void 0:i.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?te.createElement("div",{"data-description":"",className:so(J,ha,G==null?void 0:G.description,p==null||(l=p.classNames)==null?void 0:l.description)},typeof p.description=="function"?p.description():p.description):null),te.isValidElement(p.cancel)?p.cancel:p.cancel&&of(p.cancel)?te.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||P,onClick:Te=>{of(p.cancel)&&hr&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Te),$n())},className:so(G==null?void 0:G.cancelButton,p==null||(u=p.classNames)==null?void 0:u.cancelButton)},p.cancel.label):null,te.isValidElement(p.action)?p.action:p.action&&of(p.action)?te.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||O,onClick:Te=>{of(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Te),!Te.defaultPrevented&&$n())},className:so(G==null?void 0:G.actionButton,p==null||(d=p.classNames)==null?void 0:d.actionButton)},p.action.label):null)};function J2(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function sL(t,e){const n={};return[t,e].forEach((r,o)=>{const s=o===1,i=s?"--mobile-offset":"--offset",l=s?X9:Y9;function u(d){["top","right","bottom","left"].forEach(f=>{n[`${i}-${f}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?u(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${i}-${d}`]=l:n[`${i}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):u(l)}),n}const iL=te.forwardRef(function(e,n){const{id:r,invert:o,position:s="bottom-right",hotkey:i=["altKey","KeyT"],expand:l,closeButton:u,className:d,offset:f,mobileOffset:p,theme:m="light",richColors:y,duration:v,style:b,visibleToasts:k=Z9,toastOptions:E,dir:_=J2(),gap:T=eL,icons:A,containerAriaLabel:N="Notifications"}=e,[D,I]=te.useState([]),P=te.useMemo(()=>r?D.filter(ne=>ne.toasterId===r):D.filter(ne=>!ne.toasterId),[D,r]),O=te.useMemo(()=>Array.from(new Set([s].concat(P.filter(ne=>ne.position).map(ne=>ne.position)))),[P,s]),[U,J]=te.useState([]),[K,q]=te.useState(!1),[Z,Q]=te.useState(!1),[G,Y]=te.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=te.useRef(null),ee=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),z=te.useRef(null),j=te.useRef(!1),B=te.useCallback(ne=>{I(fe=>{var ue;return(ue=fe.find(he=>he.id===ne.id))!=null&&ue.delete||Jn.dismiss(ne.id),fe.filter(({id:he})=>he!==ne.id)})},[]);return te.useEffect(()=>Jn.subscribe(ne=>{if(ne.dismiss){requestAnimationFrame(()=>{I(fe=>fe.map(ue=>ue.id===ne.id?{...ue,delete:!0}:ue))});return}setTimeout(()=>{FS.flushSync(()=>{I(fe=>{const ue=fe.findIndex(he=>he.id===ne.id);return ue!==-1?[...fe.slice(0,ue),{...fe[ue],...ne},...fe.slice(ue+1)]:[ne,...fe]})})})}),[D]),te.useEffect(()=>{if(m!=="system"){Y(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Y("dark"):Y("light")),typeof window>"u")return;const ne=window.matchMedia("(prefers-color-scheme: dark)");try{ne.addEventListener("change",({matches:fe})=>{Y(fe?"dark":"light")})}catch{ne.addListener(({matches:ue})=>{try{Y(ue?"dark":"light")}catch(he){console.error(he)}})}},[m]),te.useEffect(()=>{D.length<=1&&q(!1)},[D]),te.useEffect(()=>{const ne=fe=>{var ue;if(i.every(X=>fe[X]||fe.code===X)){var Ae;q(!0),(Ae=W.current)==null||Ae.focus()}fe.code==="Escape"&&(document.activeElement===W.current||(ue=W.current)!=null&&ue.contains(document.activeElement))&&q(!1)};return document.addEventListener("keydown",ne),()=>document.removeEventListener("keydown",ne)},[i]),te.useEffect(()=>{if(W.current)return()=>{z.current&&(z.current.focus({preventScroll:!0}),z.current=null,j.current=!1)}},[W.current]),te.createElement("section",{ref:n,"aria-label":`${N} ${ee}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},O.map((ne,fe)=>{var ue;const[he,Ae]=ne.split("-");return P.length?te.createElement("ol",{key:ne,dir:_==="auto"?J2():_,tabIndex:-1,ref:W,className:d,"data-sonner-toaster":!0,"data-sonner-theme":G,"data-y-position":he,"data-x-position":Ae,style:{"--front-toast-height":`${((ue=U[0])==null?void 0:ue.height)||0}px`,"--width":`${Q9}px`,"--gap":`${T}px`,...b,...sL(f,p)},onBlur:X=>{j.current&&!X.currentTarget.contains(X.relatedTarget)&&(j.current=!1,z.current&&(z.current.focus({preventScroll:!0}),z.current=null))},onFocus:X=>{X.target instanceof HTMLElement&&X.target.dataset.dismissible==="false"||j.current||(j.current=!0,z.current=X.relatedTarget)},onMouseEnter:()=>q(!0),onMouseMove:()=>q(!0),onMouseLeave:()=>{Z||q(!1)},onDragEnd:()=>q(!1),onPointerDown:X=>{X.target instanceof HTMLElement&&X.target.dataset.dismissible==="false"||Q(!0)},onPointerUp:()=>Q(!1)},P.filter(X=>!X.position&&fe===0||X.position===ne).map((X,ce)=>{var pe,Le;return te.createElement(oL,{key:X.id,icons:A,index:ce,toast:X,defaultRichColors:y,duration:(pe=E==null?void 0:E.duration)!=null?pe:v,className:E==null?void 0:E.className,descriptionClassName:E==null?void 0:E.descriptionClassName,invert:o,visibleToasts:k,closeButton:(Le=E==null?void 0:E.closeButton)!=null?Le:u,interacting:Z,position:ne,style:E==null?void 0:E.style,unstyled:E==null?void 0:E.unstyled,classNames:E==null?void 0:E.classNames,cancelButtonStyle:E==null?void 0:E.cancelButtonStyle,actionButtonStyle:E==null?void 0:E.actionButtonStyle,closeButtonAriaLabel:E==null?void 0:E.closeButtonAriaLabel,removeToast:B,toasts:P.filter(Ne=>Ne.position==X.position),heights:U.filter(Ne=>Ne.position==X.position),setHeights:J,expandByDefault:l,gap:T,expanded:K,swipeDirections:e.swipeDirections})})):null}))}),aL=({...t})=>{const{theme:e="system"}=O9();return x.jsx(iL,{theme:e,className:"toaster group",icons:{success:x.jsx(tj,{className:"size-4"}),info:x.jsx(Tj,{className:"size-4"}),warning:x.jsx(ox,{className:"size-4"}),error:x.jsx(Vj,{className:"size-4"}),loading:x.jsx(Xi,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},toastOptions:{classNames:{toast:"cn-toast"}},...t})};function lL({className:t,...e}){return x.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:x.jsx("table",{"data-slot":"table",className:De("w-full caption-bottom text-sm",t),...e})})}function uL({className:t,...e}){return x.jsx("thead",{"data-slot":"table-header",className:De("[&_tr]:border-b",t),...e})}function cL({className:t,...e}){return x.jsx("tbody",{"data-slot":"table-body",className:De("[&_tr:last-child]:border-0",t),...e})}function Q0({className:t,...e}){return x.jsx("tr",{"data-slot":"table-row",className:De("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",t),...e})}function sf({className:t,...e}){return x.jsx("th",{"data-slot":"table-head",className:De("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",t),...e})}function Rs({className:t,...e}){return x.jsx("td",{"data-slot":"table-cell",className:De("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",t),...e})}function dL({delayDuration:t=0,...e}){return x.jsx(AI,{"data-slot":"tooltip-provider",delayDuration:t,...e})}function sx({...t}){return x.jsx(NI,{"data-slot":"tooltip",...t})}function ix({...t}){return x.jsx(DI,{"data-slot":"tooltip-trigger",...t})}function ax({className:t,sideOffset:e=0,children:n,...r}){return x.jsx(RI,{children:x.jsxs(OI,{"data-slot":"tooltip-content",sideOffset:e,className:De("z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...r,children:[n,x.jsx(II,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}var nt;(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function n(o){throw new Error}t.assertNever=n,t.arrayToEnum=o=>{const s={};for(const i of o)s[i]=i;return s},t.getValidEnumValues=o=>{const s=t.objectKeys(o).filter(l=>typeof o[o[l]]!="number"),i={};for(const l of s)i[l]=o[l];return t.objectValues(i)},t.objectValues=o=>t.objectKeys(o).map(function(s){return o[s]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const s=[];for(const i in o)Object.prototype.hasOwnProperty.call(o,i)&&s.push(i);return s},t.find=(o,s)=>{for(const i of o)if(s(i))return i},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(nt||(nt={}));var Z2;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(Z2||(Z2={}));const Ce=nt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ps=t=>{switch(typeof t){case"undefined":return Ce.undefined;case"string":return Ce.string;case"number":return Number.isNaN(t)?Ce.nan:Ce.number;case"boolean":return Ce.boolean;case"function":return Ce.function;case"bigint":return Ce.bigint;case"symbol":return Ce.symbol;case"object":return Array.isArray(t)?Ce.array:t===null?Ce.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Ce.promise:typeof Map<"u"&&t instanceof Map?Ce.map:typeof Set<"u"&&t instanceof Set?Ce.set:typeof Date<"u"&&t instanceof Date?Ce.date:Ce.object;default:return Ce.unknown}},ae=nt.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"]);class rs extends Error{get errors(){return this.issues}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}format(e){const n=e||function(s){return s.message},r={_errors:[]},o=s=>{for(const i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let l=r,u=0;for(;u<i.path.length;){const d=i.path[u];u===i.path.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(n(i))):l[d]=l[d]||{_errors:[]},l=l[d],u++}}};return o(this),r}static assert(e){if(!(e instanceof rs))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,nt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const o of this.issues)if(o.path.length>0){const s=o.path[0];n[s]=n[s]||[],n[s].push(e(o))}else r.push(e(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}rs.create=t=>new rs(t);const w1=(t,e)=>{let n;switch(t.code){case ae.invalid_type:t.received===Ce.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case ae.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,nt.jsonStringifyReplacer)}`;break;case ae.unrecognized_keys:n=`Unrecognized key(s) in object: ${nt.joinValues(t.keys,", ")}`;break;case ae.invalid_union:n="Invalid input";break;case ae.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${nt.joinValues(t.options)}`;break;case ae.invalid_enum_value:n=`Invalid enum value. Expected ${nt.joinValues(t.options)}, received '${t.received}'`;break;case ae.invalid_arguments:n="Invalid function arguments";break;case ae.invalid_return_type:n="Invalid function return type";break;case ae.invalid_date:n="Invalid date";break;case ae.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}"`:nt.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case ae.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==="bigint"?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 ae.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 ae.custom:n="Invalid input";break;case ae.invalid_intersection_types:n="Intersection results could not be merged";break;case ae.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case ae.not_finite:n="Number must be finite";break;default:n=e.defaultError,nt.assertNever(t)}return{message:n}};let fL=w1;function hL(){return fL}const pL=t=>{const{data:e,path:n,errorMaps:r,issueData:o}=t,s=[...n,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let l="";const u=r.filter(d=>!!d).slice().reverse();for(const d of u)l=d(i,{data:e,defaultError:l}).message;return{...o,path:s,message:l}};function ge(t,e){const n=hL(),r=pL({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===w1?void 0:w1].filter(o=>!!o)});t.common.issues.push(r)}class ur{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 Be;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){const s=await o.key,i=await o.value;r.push({key:s,value:i})}return ur.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const o of n){const{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return Be;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(r[s.value]=i.value)}return{status:e.value,value:r}}}const Be=Object.freeze({status:"aborted"}),mu=t=>({status:"dirty",value:t}),Dr=t=>({status:"valid",value:t}),Y2=t=>t.status==="aborted",X2=t=>t.status==="dirty",tl=t=>t.status==="valid",Zf=t=>typeof Promise<"u"&&t instanceof Promise;var Ee;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Ee||(Ee={}));class oi{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||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Q2=(t,e)=>{if(tl(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 rs(t.common.issues);return this._error=n,this._error}}};function Ke(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:(i,l)=>{const{message:u}=t;return i.code==="invalid_enum_value"?{message:u??l.defaultError}:typeof l.data>"u"?{message:u??r??l.defaultError}:i.code!=="invalid_type"?{message:l.defaultError}:{message:u??n??l.defaultError}},description:o}}class Qe{get description(){return this._def.description}_getType(e){return Ps(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Ps(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ur,ctx:{common:e.parent.common,data:e.data,parsedType:Ps(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Zf(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){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ps(e)},o=this._parseSync({data:e,path:r.path,parent:r});return Q2(r,o)}"~validate"(e){var r,o;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ps(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:n});return tl(s)?{value:s.value}:{issues:n.common.issues}}catch(s){(o=(r=s==null?void 0:s.message)==null?void 0:r.toLowerCase())!=null&&o.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(s=>tl(s)?{value:s.value}:{issues:n.common.issues})}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:Ps(e)},o=this._parse({data:e,path:r.path,parent:r}),s=await(Zf(o)?o:Promise.resolve(o));return Q2(r,s)}refine(e,n){const r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,s)=>{const i=e(o),l=()=>s.addIssue({code:ae.custom,...r(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(u=>u?!0:(l(),!1)):i?!0:(l(),!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 rl({schema:this,typeName:Ve.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(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),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Gs.create(this,this._def)}nullable(){return ol.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return yo.create(this)}promise(){return eh.create(this,this._def)}or(e){return Xf.create([this,e],this._def)}and(e){return Qf.create(this,e,this._def)}transform(e){return new rl({...Ke(this._def),schema:this,typeName:Ve.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new _1({...Ke(this._def),innerType:this,defaultValue:n,typeName:Ve.ZodDefault})}brand(){return new LL({typeName:Ve.ZodBranded,type:this,...Ke(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new T1({...Ke(this._def),innerType:this,catchValue:n,typeName:Ve.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return lx.create(this,e)}readonly(){return M1.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const mL=/^c[^\s-]{8,}$/i,gL=/^[0-9a-z]+$/,yL=/^[0-9A-HJKMNP-TV-Z]{26}$/i,xL=/^[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,vL=/^[a-z0-9_-]{21}$/i,bL=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,kL=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,wL=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,CL="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let eg;const SL=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,EL=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,_L=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,TL=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ML=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,AL=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,l_="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",NL=new RegExp(`^${l_}$`);function u_(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function DL(t){return new RegExp(`^${u_(t)}$`)}function RL(t){let e=`${l_}T${u_(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function OL(t,e){return!!((e==="v4"||!e)&&SL.test(t)||(e==="v6"||!e)&&_L.test(t))}function IL(t,e){if(!bL.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(r));return!(typeof o!="object"||o===null||"typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function PL(t,e){return!!((e==="v4"||!e)&&EL.test(t)||(e==="v6"||!e)&&TL.test(t))}class Hs extends Qe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Ce.string){const s=this._getOrReturnCtx(e);return ge(s,{code:ae.invalid_type,expected:Ce.string,received:s.parsedType}),Be}const r=new ur;let o;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(o=this._getOrReturnCtx(e,o),ge(o,{code:ae.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(o=this._getOrReturnCtx(e,o),ge(o,{code:ae.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const i=e.data.length>s.value,l=e.data.length<s.value;(i||l)&&(o=this._getOrReturnCtx(e,o),i?ge(o,{code:ae.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):l&&ge(o,{code:ae.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")wL.test(e.data)||(o=this._getOrReturnCtx(e,o),ge(o,{validation:"email",code:ae.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")eg||(eg=new RegExp(CL,"u")),eg.test(e.data)||(o=this._getOrReturnCtx(e,o),ge(o,{validation:"emoji",code:ae.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")xL.test(e.data)||(o=this._getOrReturnCtx(e,o),ge(o,{validation:"uuid",code:ae.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")vL.test(e.data)||(o=this._getOrReturnCtx(e,o),ge(o,{validation:"nanoid",code:ae.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")mL.test(e.data)||(o=this._getOrReturnCtx(e,o),ge(o,{validation:"cuid",code:ae.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")gL.test(e.data)||(o=this._getOrReturnCtx(e,o),ge(o,{validation:"cuid2",code:ae.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")yL.test(e.data)||(o=this._getOrReturnCtx(e,o),ge(o,{validation:"ulid",code:ae.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),ge(o,{validation:"url",code:ae.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),ge(o,{validation:"regex",code:ae.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(e,o),ge(o,{code:ae.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(o=this._getOrReturnCtx(e,o),ge(o,{code:ae.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(o=this._getOrReturnCtx(e,o),ge(o,{code:ae.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?RL(s).test(e.data)||(o=this._getOrReturnCtx(e,o),ge(o,{code:ae.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?NL.test(e.data)||(o=this._getOrReturnCtx(e,o),ge(o,{code:ae.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?DL(s).test(e.data)||(o=this._getOrReturnCtx(e,o),ge(o,{code:ae.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?kL.test(e.data)||(o=this._getOrReturnCtx(e,o),ge(o,{validation:"duration",code:ae.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?OL(e.data,s.version)||(o=this._getOrReturnCtx(e,o),ge(o,{validation:"ip",code:ae.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?IL(e.data,s.alg)||(o=this._getOrReturnCtx(e,o),ge(o,{validation:"jwt",code:ae.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?PL(e.data,s.version)||(o=this._getOrReturnCtx(e,o),ge(o,{validation:"cidr",code:ae.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?ML.test(e.data)||(o=this._getOrReturnCtx(e,o),ge(o,{validation:"base64",code:ae.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?AL.test(e.data)||(o=this._getOrReturnCtx(e,o),ge(o,{validation:"base64url",code:ae.invalid_string,message:s.message}),r.dirty()):nt.assertNever(s);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(o=>e.test(o),{validation:n,code:ae.invalid_string,...Ee.errToObj(r)})}_addCheck(e){return new Hs({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ee.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ee.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Ee.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ee.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Ee.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ee.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ee.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Ee.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Ee.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Ee.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Ee.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Ee.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Ee.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...Ee.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...Ee.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Ee.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Ee.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...Ee.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Ee.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Ee.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Ee.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Ee.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Ee.errToObj(n)})}nonempty(e){return this.min(1,Ee.errToObj(e))}trim(){return new Hs({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Hs({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Hs({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}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 isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}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 isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}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}}Hs.create=t=>new Hs({checks:[],typeName:Ve.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...Ke(t)});function jL(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,o=n>r?n:r,s=Number.parseInt(t.toFixed(o).replace(".","")),i=Number.parseInt(e.toFixed(o).replace(".",""));return s%i/10**o}class qu extends Qe{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)!==Ce.number){const s=this._getOrReturnCtx(e);return ge(s,{code:ae.invalid_type,expected:Ce.number,received:s.parsedType}),Be}let r;const o=new ur;for(const s of this._def.checks)s.kind==="int"?nt.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),ge(r,{code:ae.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),ge(r,{code:ae.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),ge(r,{code:ae.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?jL(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),ge(r,{code:ae.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),ge(r,{code:ae.not_finite,message:s.message}),o.dirty()):nt.assertNever(s);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Ee.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ee.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ee.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ee.toString(n))}setLimit(e,n,r,o){return new qu({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ee.toString(o)}]})}_addCheck(e){return new qu({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ee.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ee.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ee.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ee.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ee.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ee.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Ee.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ee.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ee.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"&&nt.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)}}qu.create=t=>new qu({checks:[],typeName:Ve.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ke(t)});class Ku extends Qe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Ce.bigint)return this._getInvalidInput(e);let r;const o=new ur;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),ge(r,{code:ae.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),ge(r,{code:ae.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),ge(r,{code:ae.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):nt.assertNever(s);return{status:o.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return ge(n,{code:ae.invalid_type,expected:Ce.bigint,received:n.parsedType}),Be}gte(e,n){return this.setLimit("min",e,!0,Ee.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ee.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ee.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ee.toString(n))}setLimit(e,n,r,o){return new Ku({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ee.toString(o)}]})}_addCheck(e){return new Ku({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ee.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ee.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ee.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ee.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ee.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}}Ku.create=t=>new Ku({checks:[],typeName:Ve.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...Ke(t)});class C1 extends Qe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Ce.boolean){const r=this._getOrReturnCtx(e);return ge(r,{code:ae.invalid_type,expected:Ce.boolean,received:r.parsedType}),Be}return Dr(e.data)}}C1.create=t=>new C1({typeName:Ve.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ke(t)});class Yf extends Qe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Ce.date){const s=this._getOrReturnCtx(e);return ge(s,{code:ae.invalid_type,expected:Ce.date,received:s.parsedType}),Be}if(Number.isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return ge(s,{code:ae.invalid_date}),Be}const r=new ur;let o;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(o=this._getOrReturnCtx(e,o),ge(o,{code:ae.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(o=this._getOrReturnCtx(e,o),ge(o,{code:ae.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):nt.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Yf({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Ee.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Ee.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}}Yf.create=t=>new Yf({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:Ve.ZodDate,...Ke(t)});class ew extends Qe{_parse(e){if(this._getType(e)!==Ce.symbol){const r=this._getOrReturnCtx(e);return ge(r,{code:ae.invalid_type,expected:Ce.symbol,received:r.parsedType}),Be}return Dr(e.data)}}ew.create=t=>new ew({typeName:Ve.ZodSymbol,...Ke(t)});class tw extends Qe{_parse(e){if(this._getType(e)!==Ce.undefined){const r=this._getOrReturnCtx(e);return ge(r,{code:ae.invalid_type,expected:Ce.undefined,received:r.parsedType}),Be}return Dr(e.data)}}tw.create=t=>new tw({typeName:Ve.ZodUndefined,...Ke(t)});class nw extends Qe{_parse(e){if(this._getType(e)!==Ce.null){const r=this._getOrReturnCtx(e);return ge(r,{code:ae.invalid_type,expected:Ce.null,received:r.parsedType}),Be}return Dr(e.data)}}nw.create=t=>new nw({typeName:Ve.ZodNull,...Ke(t)});class rw extends Qe{constructor(){super(...arguments),this._any=!0}_parse(e){return Dr(e.data)}}rw.create=t=>new rw({typeName:Ve.ZodAny,...Ke(t)});class ow extends Qe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Dr(e.data)}}ow.create=t=>new ow({typeName:Ve.ZodUnknown,...Ke(t)});class si extends Qe{_parse(e){const n=this._getOrReturnCtx(e);return ge(n,{code:ae.invalid_type,expected:Ce.never,received:n.parsedType}),Be}}si.create=t=>new si({typeName:Ve.ZodNever,...Ke(t)});class sw extends Qe{_parse(e){if(this._getType(e)!==Ce.undefined){const r=this._getOrReturnCtx(e);return ge(r,{code:ae.invalid_type,expected:Ce.void,received:r.parsedType}),Be}return Dr(e.data)}}sw.create=t=>new sw({typeName:Ve.ZodVoid,...Ke(t)});class yo extends Qe{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),o=this._def;if(n.parsedType!==Ce.array)return ge(n,{code:ae.invalid_type,expected:Ce.array,received:n.parsedType}),Be;if(o.exactLength!==null){const i=n.data.length>o.exactLength.value,l=n.data.length<o.exactLength.value;(i||l)&&(ge(n,{code:i?ae.too_big:ae.too_small,minimum:l?o.exactLength.value:void 0,maximum:i?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&&(ge(n,{code:ae.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&&(ge(n,{code:ae.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((i,l)=>o.type._parseAsync(new oi(n,i,n.path,l)))).then(i=>ur.mergeArray(r,i));const s=[...n.data].map((i,l)=>o.type._parseSync(new oi(n,i,n.path,l)));return ur.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new yo({...this._def,minLength:{value:e,message:Ee.toString(n)}})}max(e,n){return new yo({...this._def,maxLength:{value:e,message:Ee.toString(n)}})}length(e,n){return new yo({...this._def,exactLength:{value:e,message:Ee.toString(n)}})}nonempty(e){return this.min(1,e)}}yo.create=(t,e)=>new yo({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Ve.ZodArray,...Ke(e)});function Ua(t){if(t instanceof zt){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Gs.create(Ua(r))}return new zt({...t._def,shape:()=>e})}else return t instanceof yo?new yo({...t._def,type:Ua(t.element)}):t instanceof Gs?Gs.create(Ua(t.unwrap())):t instanceof ol?ol.create(Ua(t.unwrap())):t instanceof ea?ea.create(t.items.map(e=>Ua(e))):t}class zt extends Qe{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=nt.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==Ce.object){const d=this._getOrReturnCtx(e);return ge(d,{code:ae.invalid_type,expected:Ce.object,received:d.parsedType}),Be}const{status:r,ctx:o}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),l=[];if(!(this._def.catchall instanceof si&&this._def.unknownKeys==="strip"))for(const d in o.data)i.includes(d)||l.push(d);const u=[];for(const d of i){const f=s[d],p=o.data[d];u.push({key:{status:"valid",value:d},value:f._parse(new oi(o,p,o.path,d)),alwaysSet:d in o.data})}if(this._def.catchall instanceof si){const d=this._def.unknownKeys;if(d==="passthrough")for(const f of l)u.push({key:{status:"valid",value:f},value:{status:"valid",value:o.data[f]}});else if(d==="strict")l.length>0&&(ge(o,{code:ae.unrecognized_keys,keys:l}),r.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const f of l){const p=o.data[f];u.push({key:{status:"valid",value:f},value:d._parse(new oi(o,p,o.path,f)),alwaysSet:f in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const d=[];for(const f of u){const p=await f.key,m=await f.value;d.push({key:p,value:m,alwaysSet:f.alwaysSet})}return d}).then(d=>ur.mergeObjectSync(r,d)):ur.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(e){return Ee.errToObj,new zt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var s,i;const o=((i=(s=this._def).errorMap)==null?void 0:i.call(s,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:Ee.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new zt({...this._def,unknownKeys:"strip"})}passthrough(){return new zt({...this._def,unknownKeys:"passthrough"})}extend(e){return new zt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new zt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ve.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new zt({...this._def,catchall:e})}pick(e){const n={};for(const r of nt.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new zt({...this._def,shape:()=>n})}omit(e){const n={};for(const r of nt.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new zt({...this._def,shape:()=>n})}deepPartial(){return Ua(this)}partial(e){const n={};for(const r of nt.objectKeys(this.shape)){const o=this.shape[r];e&&!e[r]?n[r]=o:n[r]=o.optional()}return new zt({...this._def,shape:()=>n})}required(e){const n={};for(const r of nt.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Gs;)s=s._def.innerType;n[r]=s}return new zt({...this._def,shape:()=>n})}keyof(){return c_(nt.objectKeys(this.shape))}}zt.create=(t,e)=>new zt({shape:()=>t,unknownKeys:"strip",catchall:si.create(),typeName:Ve.ZodObject,...Ke(e)});zt.strictCreate=(t,e)=>new zt({shape:()=>t,unknownKeys:"strict",catchall:si.create(),typeName:Ve.ZodObject,...Ke(e)});zt.lazycreate=(t,e)=>new zt({shape:t,unknownKeys:"strip",catchall:si.create(),typeName:Ve.ZodObject,...Ke(e)});class Xf extends Qe{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function o(s){for(const l of s)if(l.result.status==="valid")return l.result;for(const l of s)if(l.result.status==="dirty")return n.common.issues.push(...l.ctx.common.issues),l.result;const i=s.map(l=>new rs(l.ctx.common.issues));return ge(n,{code:ae.invalid_union,unionErrors:i}),Be}if(n.common.async)return Promise.all(r.map(async s=>{const i={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(o);{let s;const i=[];for(const u of r){const d={...n,common:{...n.common,issues:[]},parent:null},f=u._parseSync({data:n.data,path:n.path,parent:d});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,ctx:d}),d.common.issues.length&&i.push(d.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const l=i.map(u=>new rs(u));return ge(n,{code:ae.invalid_union,unionErrors:l}),Be}}get options(){return this._def.options}}Xf.create=(t,e)=>new Xf({options:t,typeName:Ve.ZodUnion,...Ke(e)});function S1(t,e){const n=Ps(t),r=Ps(e);if(t===e)return{valid:!0,data:t};if(n===Ce.object&&r===Ce.object){const o=nt.objectKeys(e),s=nt.objectKeys(t).filter(l=>o.indexOf(l)!==-1),i={...t,...e};for(const l of s){const u=S1(t[l],e[l]);if(!u.valid)return{valid:!1};i[l]=u.data}return{valid:!0,data:i}}else if(n===Ce.array&&r===Ce.array){if(t.length!==e.length)return{valid:!1};const o=[];for(let s=0;s<t.length;s++){const i=t[s],l=e[s],u=S1(i,l);if(!u.valid)return{valid:!1};o.push(u.data)}return{valid:!0,data:o}}else return n===Ce.date&&r===Ce.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Qf extends Qe{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),o=(s,i)=>{if(Y2(s)||Y2(i))return Be;const l=S1(s.value,i.value);return l.valid?((X2(s)||X2(i))&&n.dirty(),{status:n.value,value:l.data}):(ge(r,{code:ae.invalid_intersection_types}),Be)};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(([s,i])=>o(s,i)):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}))}}Qf.create=(t,e,n)=>new Qf({left:t,right:e,typeName:Ve.ZodIntersection,...Ke(n)});class ea extends Qe{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ce.array)return ge(r,{code:ae.invalid_type,expected:Ce.array,received:r.parsedType}),Be;if(r.data.length<this._def.items.length)return ge(r,{code:ae.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Be;!this._def.rest&&r.data.length>this._def.items.length&&(ge(r,{code:ae.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((i,l)=>{const u=this._def.items[l]||this._def.rest;return u?u._parse(new oi(r,i,r.path,l)):null}).filter(i=>!!i);return r.common.async?Promise.all(s).then(i=>ur.mergeArray(n,i)):ur.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new ea({...this._def,rest:e})}}ea.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ea({items:t,typeName:Ve.ZodTuple,rest:null,...Ke(e)})};class iw extends Qe{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!==Ce.map)return ge(r,{code:ae.invalid_type,expected:Ce.map,received:r.parsedType}),Be;const o=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([l,u],d)=>({key:o._parse(new oi(r,l,r.path,[d,"key"])),value:s._parse(new oi(r,u,r.path,[d,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const u of i){const d=await u.key,f=await u.value;if(d.status==="aborted"||f.status==="aborted")return Be;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),l.set(d.value,f.value)}return{status:n.value,value:l}})}else{const l=new Map;for(const u of i){const d=u.key,f=u.value;if(d.status==="aborted"||f.status==="aborted")return Be;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),l.set(d.value,f.value)}return{status:n.value,value:l}}}}iw.create=(t,e,n)=>new iw({valueType:e,keyType:t,typeName:Ve.ZodMap,...Ke(n)});class Gu extends Qe{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ce.set)return ge(r,{code:ae.invalid_type,expected:Ce.set,received:r.parsedType}),Be;const o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(ge(r,{code:ae.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&&(ge(r,{code:ae.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const s=this._def.valueType;function i(u){const d=new Set;for(const f of u){if(f.status==="aborted")return Be;f.status==="dirty"&&n.dirty(),d.add(f.value)}return{status:n.value,value:d}}const l=[...r.data.values()].map((u,d)=>s._parse(new oi(r,u,r.path,d)));return r.common.async?Promise.all(l).then(u=>i(u)):i(l)}min(e,n){return new Gu({...this._def,minSize:{value:e,message:Ee.toString(n)}})}max(e,n){return new Gu({...this._def,maxSize:{value:e,message:Ee.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Gu.create=(t,e)=>new Gu({valueType:t,minSize:null,maxSize:null,typeName:Ve.ZodSet,...Ke(e)});class aw extends Qe{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})}}aw.create=(t,e)=>new aw({getter:t,typeName:Ve.ZodLazy,...Ke(e)});class E1 extends Qe{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ge(n,{received:n.data,code:ae.invalid_literal,expected:this._def.value}),Be}return{status:"valid",value:e.data}}get value(){return this._def.value}}E1.create=(t,e)=>new E1({value:t,typeName:Ve.ZodLiteral,...Ke(e)});function c_(t,e){return new nl({values:t,typeName:Ve.ZodEnum,...Ke(e)})}class nl extends Qe{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return ge(n,{expected:nt.joinValues(r),received:n.parsedType,code:ae.invalid_type}),Be}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return ge(n,{received:n.data,code:ae.invalid_enum_value,options:r}),Be}return Dr(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,n=this._def){return nl.create(e,{...this._def,...n})}exclude(e,n=this._def){return nl.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}nl.create=c_;class lw extends Qe{_parse(e){const n=nt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Ce.string&&r.parsedType!==Ce.number){const o=nt.objectValues(n);return ge(r,{expected:nt.joinValues(o),received:r.parsedType,code:ae.invalid_type}),Be}if(this._cache||(this._cache=new Set(nt.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const o=nt.objectValues(n);return ge(r,{received:r.data,code:ae.invalid_enum_value,options:o}),Be}return Dr(e.data)}get enum(){return this._def.values}}lw.create=(t,e)=>new lw({values:t,typeName:Ve.ZodNativeEnum,...Ke(e)});class eh extends Qe{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Ce.promise&&n.common.async===!1)return ge(n,{code:ae.invalid_type,expected:Ce.promise,received:n.parsedType}),Be;const r=n.parsedType===Ce.promise?n.data:Promise.resolve(n.data);return Dr(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}eh.create=(t,e)=>new eh({type:t,typeName:Ve.ZodPromise,...Ke(e)});class rl extends Qe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ve.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),o=this._def.effect||null,s={addIssue:i=>{ge(r,i),i.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){const i=o.transform(r.data,s);if(r.common.async)return Promise.resolve(i).then(async l=>{if(n.value==="aborted")return Be;const u=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return u.status==="aborted"?Be:u.status==="dirty"||n.value==="dirty"?mu(u.value):u});{if(n.value==="aborted")return Be;const l=this._def.schema._parseSync({data:i,path:r.path,parent:r});return l.status==="aborted"?Be:l.status==="dirty"||n.value==="dirty"?mu(l.value):l}}if(o.type==="refinement"){const i=l=>{const u=o.refinement(l,s);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?Be:(l.status==="dirty"&&n.dirty(),i(l.value),{status:n.value,value:l.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>l.status==="aborted"?Be:(l.status==="dirty"&&n.dirty(),i(l.value).then(()=>({status:n.value,value:l.value}))))}if(o.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!tl(i))return Be;const l=o.transform(i.value,s);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>tl(i)?Promise.resolve(o.transform(i.value,s)).then(l=>({status:n.value,value:l})):Be);nt.assertNever(o)}}rl.create=(t,e,n)=>new rl({schema:t,typeName:Ve.ZodEffects,effect:e,...Ke(n)});rl.createWithPreprocess=(t,e,n)=>new rl({schema:e,effect:{type:"preprocess",transform:t},typeName:Ve.ZodEffects,...Ke(n)});class Gs extends Qe{_parse(e){return this._getType(e)===Ce.undefined?Dr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Gs.create=(t,e)=>new Gs({innerType:t,typeName:Ve.ZodOptional,...Ke(e)});class ol extends Qe{_parse(e){return this._getType(e)===Ce.null?Dr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ol.create=(t,e)=>new ol({innerType:t,typeName:Ve.ZodNullable,...Ke(e)});class _1 extends Qe{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===Ce.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}_1.create=(t,e)=>new _1({innerType:t,typeName:Ve.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ke(e)});class T1 extends Qe{_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 Zf(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new rs(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new rs(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}T1.create=(t,e)=>new T1({innerType:t,typeName:Ve.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ke(e)});class uw extends Qe{_parse(e){if(this._getType(e)!==Ce.nan){const r=this._getOrReturnCtx(e);return ge(r,{code:ae.invalid_type,expected:Ce.nan,received:r.parsedType}),Be}return{status:"valid",value:e.data}}}uw.create=t=>new uw({typeName:Ve.ZodNaN,...Ke(t)});class LL extends Qe{_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 lx extends Qe{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Be:s.status==="dirty"?(n.dirty(),mu(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Be: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 lx({in:e,out:n,typeName:Ve.ZodPipeline})}}class M1 extends Qe{_parse(e){const n=this._def.innerType._parse(e),r=o=>(tl(o)&&(o.value=Object.freeze(o.value)),o);return Zf(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}}M1.create=(t,e)=>new M1({innerType:t,typeName:Ve.ZodReadonly,...Ke(e)});var Ve;(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"})(Ve||(Ve={}));const ho=Hs.create,zL=C1.create;si.create;const Ju=yo.create,Cp=zt.create;Xf.create;Qf.create;ea.create;const FL=E1.create,$L=nl.create;eh.create;Gs.create;ol.create;var BL=["text","richtext","number","boolean","date","select","relation","image"],d_=Cp({key:ho().min(1),label:ho().optional(),type:$L(BL),required:zL().optional(),options:Ju(ho()).optional(),to:ho().optional()}).superRefine((t,e)=>{t.type==="select"&&(!t.options||t.options.length===0)&&e.addIssue({code:ae.custom,message:"select alanı options gerektirir"}),t.type==="relation"&&!t.to&&e.addIssue({code:ae.custom,message:'relation alanı "to" gerektirir'})}),VL=Cp({name:ho().min(1),label:ho().optional(),path:ho().min(1),fields:Ju(d_)}),HL=Cp({name:ho().min(1),label:ho().optional(),path:ho().min(1),fields:Ju(d_)});Cp({version:FL(1),collections:Ju(VL),singletons:Ju(HL)}).superRefine((t,e)=>{const n=new Set,r=new Set,o=new Set(t.collections.map(i=>i.name)),s=[...t.collections,...t.singletons];for(const i of s){n.has(i.name)&&e.addIssue({code:ae.custom,message:`tekrar eden ad: ${i.name}`}),n.add(i.name),(i.path.includes("..")||i.path.startsWith("/")||i.path.includes("\\"))&&e.addIssue({code:ae.custom,message:`güvensiz path: ${i.path}`}),r.has(i.path)&&e.addIssue({code:ae.custom,message:`tekrar eden path: ${i.path}`}),r.add(i.path);const l=new Set;for(const u of i.fields)l.has(u.key)&&e.addIssue({code:ae.custom,message:`tekrar eden field key: ${u.key}`}),l.add(u.key),u.type==="relation"&&u.to&&!o.has(u.to)&&e.addIssue({code:ae.custom,message:`relation hedefi yok: ${u.to}`})}});var UL={ç:"c",ğ:"g",ı:"i",ö:"o",ş:"s",ü:"u",Ç:"c",Ğ:"g",İ:"i",Ö:"o",Ş:"s",Ü:"u",I:"i"};function ux(t){return t.replace(/[çğıöşüÇĞİÖŞÜI]/g,r=>UL[r]??r).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"icerik"}function WL(t){return t==null||t===""}function qL(t,e){var n;switch(t.type){case"text":case"richtext":case"date":case"image":return typeof e=="string"?null:"metin bekleniyor";case"relation":return!Array.isArray(e)||e.some(r=>typeof r!="string")?"slug dizisi bekleniyor":null;case"number":return typeof e=="number"?null:"sayı bekleniyor";case"boolean":return typeof e=="boolean"?null:"boolean bekleniyor";case"select":return typeof e!="string"?"metin bekleniyor":(n=t.options)!=null&&n.includes(e)?null:"seçenek dışı değer"}}function f_(t,e){const n=[],r=new Set(t.map(o=>o.key));for(const o of t){const s=e[o.key];if(WL(s)){o.required&&n.push({key:o.key,level:"warning",message:"zorunlu alan boş"});continue}const i=qL(o,s);i&&n.push({key:o.key,level:"error",message:i})}for(const o of Object.keys(e))r.has(o)||n.push({key:o,level:"warning",message:"anahtar şemada yok"});return{ok:n.every(o=>o.level!=="error"),issues:n}}var tg={exports:{}},ng={};/**
416
- * @license React
417
- * use-sync-external-store-shim.production.js
418
- *
419
- * Copyright (c) Meta Platforms, Inc. and affiliates.
420
- *
421
- * This source code is licensed under the MIT license found in the
422
- * LICENSE file in the root directory of this source tree.
423
- */var cw;function KL(){if(cw)return ng;cw=1;var t=gc();function e(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,o=t.useEffect,s=t.useLayoutEffect,i=t.useDebugValue;function l(p,m){var y=m(),v=r({inst:{value:y,getSnapshot:m}}),b=v[0].inst,k=v[1];return s(function(){b.value=y,b.getSnapshot=m,u(b)&&k({inst:b})},[p,y,m]),o(function(){return u(b)&&k({inst:b}),p(function(){u(b)&&k({inst:b})})},[p]),i(y),y}function u(p){var m=p.getSnapshot;p=p.value;try{var y=m();return!n(p,y)}catch{return!0}}function d(p,m){return m()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return ng.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:f,ng}var dw;function h_(){return dw||(dw=1,tg.exports=KL()),tg.exports}var p_=h_();function yn(t){this.content=t}yn.prototype={constructor:yn,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),s=r.content.slice();return o==-1?s.push(n||t,e):(s[o+1]=e,n&&(s[o]=n)),new yn(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new yn(n)},addToStart:function(t,e){return new yn([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new yn(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),s=r.find(t);return o.splice(s==-1?o.length:s,0,e,n),new yn(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=yn.from(t),t.size?new yn(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=yn.from(t),t.size?new yn(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=yn.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}};yn.from=function(t){if(t instanceof yn)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new yn(e)};function m_(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),s=e.child(r);if(o==s){n+=o.nodeSize;continue}if(!o.sameMarkup(s))return n;if(o.isText&&o.text!=s.text){let i=o.text,l=s.text,u=0;for(;i[u]==l[u];u++)n++;return u&&u<i.length&&u<l.length&&x_(i.charCodeAt(u-1))&&y_(i.charCodeAt(u))&&n--,n}if(o.content.size||s.content.size){let i=m_(o.content,s.content,n+1);if(i!=null)return i}n+=o.nodeSize}}function g_(t,e,n,r){for(let o=t.childCount,s=e.childCount;;){if(o==0||s==0)return o==s?null:{a:n,b:r};let i=t.child(--o),l=e.child(--s),u=i.nodeSize;if(i==l){n-=u,r-=u;continue}if(!i.sameMarkup(l))return{a:n,b:r};if(i.isText&&i.text!=l.text){let d=i.text,f=l.text,p=d.length,m=f.length;for(;p>0&&m>0&&d[p-1]==f[m-1];)p--,m--,n--,r--;return p&&m&&p<d.length&&x_(d.charCodeAt(p-1))&&y_(d.charCodeAt(p))&&(n++,r++),{a:n,b:r}}if(i.content.size||l.content.size){let d=g_(i.content,l.content,n-1,r-1);if(d)return d}n-=u,r-=u}}function y_(t){return t>=56320&&t<57344}function x_(t){return t>=55296&&t<56320}class re{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,s){for(let i=0,l=0;l<n;i++){let u=this.content[i],d=l+u.nodeSize;if(d>e&&r(u,o+l,s||null,i)!==!1&&u.content.size){let f=l+1;u.nodesBetween(Math.max(0,e-f),Math.min(u.content.size,n-f),r,o+f)}l=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let s="",i=!0;return this.nodesBetween(e,n,(l,u)=>{let d=l.isText?l.text.slice(Math.max(e,u)-u,n-u):l.isLeaf?o?typeof o=="function"?o(l):o:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&d||l.isTextblock)&&r&&(i?i=!1:s+=r),s+=d},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,o=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)o.push(e.content[s]);return new re(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 s=0,i=0;i<n;s++){let l=this.content[s],u=i+l.nodeSize;u>e&&((i<e||u>n)&&(l.isText?l=l.cut(Math.max(0,e-i),Math.min(l.text.length,n-i)):l=l.cut(Math.max(0,e-i-1),Math.min(l.content.size,n-i-1))),r.push(l),o+=l.nodeSize),i=u}return new re(r,o)}cutByIndex(e,n){return e==n?re.empty:e==0&&n==this.content.length?this:new re(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let o=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return o[e]=n,new re(o,s)}addToStart(e){return new re([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new re(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 m_(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return g_(this,e,n,r)}findIndex(e){if(e==0)return af(0,e);if(e==this.size)return af(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let o=this.child(n),s=r+o.nodeSize;if(s>=e)return s==e?af(n+1,s):af(n,r);r=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 re.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return re.fromArray(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return re.empty;let n,r=0;for(let o=0;o<e.length;o++){let s=e[o];r+=s.nodeSize,o&&s.isText&&e[o-1].sameMarkup(s)?(n||(n=e.slice(0,o)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new re(n||e,r)}static from(e){if(!e)return re.empty;if(e instanceof re)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new re([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}re.empty=new re([],0);const rg={index:0,offset:0};function af(t,e){return rg.index=t,rg.offset=e,rg}function th(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(!th(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!th(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let lt=class A1{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let o=0;o<e.length;o++){let s=e[o];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,o));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,o)),n.push(this),r=!0),n&&n.push(s)}}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&&th(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let o=r.create(n.attrs);return r.checkAttrs(o.attrs),o}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return A1.none;if(e instanceof A1)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};lt.none=[];class Zu extends Error{}class ye{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=b_(this.content,e+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new ye(r,this.openStart,this.openEnd)}removeBetween(e,n){return new ye(v_(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 ye.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 ye(re.fromJSON(e,n.content),r,o)}static maxOpen(e,n=!0){let r=0,o=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)o++;return new ye(e,r,o)}}ye.empty=new ye(re.empty,0,0);function v_(t,e,n){let{index:r,offset:o}=t.findIndex(e),s=t.maybeChild(r),{index:i,offset:l}=t.findIndex(n);if(o==e||s.isText){if(l!=n&&!t.child(i).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=i)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(v_(s.content,e-o-1,n-o-1)))}function b_(t,e,n,r,o,s){let{index:i,offset:l}=t.findIndex(e),u=t.maybeChild(i);if(l==e||u.isText)return s&&r<=0&&o<=0&&!s.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let d=b_(u.content,e-l-1,n,i==0?r-1:0,i==t.childCount-1?o-1:0,u);return d&&t.replaceChild(i,u.copy(d))}function GL(t,e,n){if(n.openStart>t.depth)throw new Zu("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Zu("Inconsistent open depths");return k_(t,e,n,0)}function k_(t,e,n,r){let o=t.index(r),s=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let i=k_(t,e,n,r+1);return s.copy(s.content.replaceChild(o,i))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let i=t.parent,l=i.content;return Hi(i,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:i,end:l}=JL(n,t);return Hi(s,C_(t,i,l,e,r))}else return Hi(s,nh(t,e,r))}function w_(t,e){if(!e.type.compatibleContent(t.type))throw new Zu("Cannot join "+e.type.name+" onto "+t.type.name)}function N1(t,e,n){let r=t.node(n);return w_(r,e.node(n)),r}function Vi(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 wu(t,e,n,r){let o=(e||t).node(n),s=0,i=e?e.index(n):o.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(Vi(t.nodeAfter,r),s++));for(let l=s;l<i;l++)Vi(o.child(l),r);e&&e.depth==n&&e.textOffset&&Vi(e.nodeBefore,r)}function Hi(t,e){if(!t.type.validContent(e))throw new Zu("Invalid content for node "+t.type.name);return t.copy(e)}function C_(t,e,n,r,o){let s=t.depth>o&&N1(t,e,o+1),i=r.depth>o&&N1(n,r,o+1),l=[];return wu(null,t,o,l),s&&i&&e.index(o)==n.index(o)?(w_(s,i),Vi(Hi(s,C_(t,e,n,r,o+1)),l)):(s&&Vi(Hi(s,nh(t,e,o+1)),l),wu(e,n,o,l),i&&Vi(Hi(i,nh(n,r,o+1)),l)),wu(r,null,o,l),new re(l)}function nh(t,e,n){let r=[];if(wu(null,t,n,r),t.depth>n){let o=N1(t,e,n+1);Vi(Hi(o,nh(t,e,n+1)),r)}return wu(e,null,n,r),new re(r)}function JL(t,e){let n=e.depth-t.openStart,o=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)o=e.node(s).copy(re.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}class Yu{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 s=0;s<e;s++)o+=r.child(s).nodeSize;return o}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return lt.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),o=e.maybeChild(n);if(!r){let l=r;r=o,o=l}let s=r.marks;for(var i=0;i<s.length;i++)s[i].type.spec.inclusive===!1&&(!o||!s[i].isInSet(o.marks))&&(s=s[i--].removeFromSet(s));return s}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 s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!o||!r[s].isInSet(o.marks))&&(r=r[s--].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 rh(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,s=n;for(let i=e;;){let{index:l,offset:u}=i.content.findIndex(s),d=s-u;if(r.push(i,l,o+u),!d||(i=i.child(l),i.isText))break;s=d-1,o+=u+1}return new Yu(n,r,s)}static resolveCached(e,n){let r=fw.get(e);if(r)for(let s=0;s<r.elts.length;s++){let i=r.elts[s];if(i.pos==n)return i}else fw.set(e,r=new ZL);let o=r.elts[r.i]=Yu.resolve(e,n);return r.i=(r.i+1)%YL,o}}class ZL{constructor(){this.elts=[],this.i=0}}const YL=12,fw=new WeakMap;class rh{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 XL=Object.create(null);let Js=class D1{constructor(e,n,r,o=lt.none){this.type=e,this.attrs=n,this.marks=o,this.content=r||re.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,o=0){this.content.nodesBetween(e,n,r,o,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,o){return this.content.textBetween(e,n,r,o)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&th(this.attrs,n||e.defaultAttrs||XL)&&lt.sameSet(this.marks,r||lt.none)}copy(e=null){return e==this.content?this:new D1(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new D1(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 ye.empty;let o=this.resolve(e),s=this.resolve(n),i=r?0:o.sharedDepth(n),l=o.start(i),d=o.node(i).content.cut(o.pos-l,s.pos-l);return new ye(d,o.depth-i,s.depth-i)}replace(e,n,r){return GL(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 Yu.resolveCached(this,e)}resolveNoCache(e){return Yu.resolve(this,e)}rangeHasMark(e,n,r){let o=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.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()+")"),S_(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=re.empty,o=0,s=r.childCount){let i=this.contentMatchAt(e).matchFragment(r,o,s),l=i&&i.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let u=o;u<s;u++)if(!this.type.allowsMarks(r.child(u).marks))return!1;return!0}canReplaceWith(e,n,r,o){if(o&&!this.type.allowsMarks(o))return!1;let s=this.contentMatchAt(e).matchType(r),i=s&&s.matchFragment(this.content,n);return i?i.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=lt.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!lt.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let o=re.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,o,r);return s.type.checkAttrs(s.attrs),s}};Js.prototype.text=void 0;class oh extends Js{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):S_(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 oh(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new oh(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 S_(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class ta{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new QL(e,n);if(r.next==null)return ta.empty;let o=E_(r);r.next&&r.err("Unexpected trailing text");let s=i7(s7(o));return a7(s,r),s}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 s=n;o&&s<r;s++)o=o.matchType(e.child(s).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 s(i,l){let u=i.matchFragment(e,r);if(u&&(!n||u.validEnd))return re.from(l.map(d=>d.createAndFill()));for(let d=0;d<i.next.length;d++){let{type:f,next:p}=i.next[d];if(!(f.isText||f.hasRequiredAttrs())&&o.indexOf(p)==-1){o.push(p);let m=s(p,l.concat(f));if(m)return m}}return null}return s(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(),s=o.match;if(s.matchType(e)){let i=[];for(let l=o;l.type;l=l.via)i.push(l.type);return i.reverse()}for(let i=0;i<s.next.length;i++){let{type:l,next:u}=s.next[i];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!o.type||u.validEnd)&&(r.push({match:l.contentMatch,type:l,via:o}),n[l.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 s=o+(r.validEnd?"*":" ")+" ";for(let i=0;i<r.next.length;i++)s+=(i?", ":"")+r.next[i].type.name+"->"+e.indexOf(r.next[i].next);return s}).join(`
424
- `)}}ta.empty=new ta(!0);class QL{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 E_(t){let e=[];do e.push(e7(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function e7(t){let e=[];do e.push(t7(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function t7(t){let e=o7(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=n7(t,e);else break;return e}function hw(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function n7(t,e){let n=hw(t),r=n;return t.eat(",")&&(t.next!="}"?r=hw(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function r7(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let s in n){let i=n[s];i.isInGroup(e)&&o.push(i)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function o7(t){if(t.eat("(")){let e=E_(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=r7(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 s7(t){let e=[[]];return o(s(t,0),n()),e;function n(){return e.push([])-1}function r(i,l,u){let d={term:u,to:l};return e[i].push(d),d}function o(i,l){i.forEach(u=>u.to=l)}function s(i,l){if(i.type=="choice")return i.exprs.reduce((u,d)=>u.concat(s(d,l)),[]);if(i.type=="seq")for(let u=0;;u++){let d=s(i.exprs[u],l);if(u==i.exprs.length-1)return d;o(d,l=n())}else if(i.type=="star"){let u=n();return r(l,u),o(s(i.expr,u),u),[r(u)]}else if(i.type=="plus"){let u=n();return o(s(i.expr,l),u),o(s(i.expr,u),u),[r(u)]}else{if(i.type=="opt")return[r(l)].concat(s(i.expr,l));if(i.type=="range"){let u=l;for(let d=0;d<i.min;d++){let f=n();o(s(i.expr,u),f),u=f}if(i.max==-1)o(s(i.expr,u),u);else for(let d=i.min;d<i.max;d++){let f=n();r(u,f),o(s(i.expr,u),f),u=f}return[r(u)]}else{if(i.type=="name")return[r(l,void 0,i.value)];throw new Error("Unknown expr type")}}}}function __(t,e){return e-t}function pw(t,e){let n=[];return r(e),n.sort(__);function r(o){let s=t[o];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(o);for(let i=0;i<s.length;i++){let{term:l,to:u}=s[i];!l&&n.indexOf(u)==-1&&r(u)}}}function i7(t){let e=Object.create(null);return n(pw(t,0));function n(r){let o=[];r.forEach(i=>{t[i].forEach(({term:l,to:u})=>{if(!l)return;let d;for(let f=0;f<o.length;f++)o[f][0]==l&&(d=o[f][1]);pw(t,u).forEach(f=>{d||o.push([l,d=[]]),d.indexOf(f)==-1&&d.push(f)})})});let s=e[r.join(",")]=new ta(r.indexOf(t.length-1)>-1);for(let i=0;i<o.length;i++){let l=o[i][1].sort(__);s.next.push({type:o[i][0],next:e[l.join(",")]||n(l)})}return s}}function a7(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],s=!o.validEnd,i=[];for(let l=0;l<o.next.length;l++){let{type:u,next:d}=o.next[l];i.push(u.name),s&&!(u.isText||u.hasRequiredAttrs())&&(s=!1),r.indexOf(d)==-1&&r.push(d)}s&&e.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function T_(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function M_(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(o===void 0){let s=t[r];if(s.hasDefault)o=s.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function A_(t,e,n,r){for(let o in e)if(!(o in t))throw new RangeError(`Unsupported attribute ${o} for ${n} of type ${r}`);for(let o in t)t[o].validate&&t[o].validate(e[o])}function N_(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new u7(t,r,e[r]);return n}let mw=class D_{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=N_(e,r.attrs),this.defaultAttrs=T_(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==ta.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:M_(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Js(this,this.computeAttrs(e),re.from(n),lt.setFrom(r))}createChecked(e=null,n,r){return n=re.from(n),this.checkContent(n),new Js(this,this.computeAttrs(e),n,lt.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=re.from(n),n.size){let i=this.contentMatch.fillBefore(n);if(!i)return null;n=i.append(n)}let o=this.contentMatch.matchFragment(n),s=o&&o.fillBefore(re.empty,!0);return s?new Js(this,e,n.append(s),lt.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){A_(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:lt.none:e}static compile(e,n){let r=Object.create(null);e.forEach((s,i)=>r[s]=new D_(s,n,i));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 s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function l7(t,e,n){let r=n.split("|");return o=>{let s=o===null?"null":typeof o;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${s}`)}}class u7{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?l7(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Sp{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=N_(e,o.attrs),this.excluded=null;let s=T_(this.attrs);this.instance=s?new lt(this,s):null}create(e=null){return!e&&this.instance?this.instance:new lt(this,M_(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((s,i)=>r[s]=new Sp(s,o++,n,i)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){A_(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class cx{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in e)n[o]=e[o];n.nodes=yn.from(e.nodes),n.marks=yn.from(e.marks||{}),this.nodes=mw.compile(this.spec.nodes,this),this.marks=Sp.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 s=this.nodes[o],i=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=r[i]||(r[i]=ta.parse(i,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=l=="_"?null:l?gw(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let o in this.marks){let s=this.marks[o],i=s.spec.excludes;s.excluded=i==null?[s]:i==""?[]:gw(this,i.split(" "))}this.nodeFromJSON=o=>Js.fromJSON(this,o),this.markFromJSON=o=>lt.fromJSON(this,o),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof mw){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 oh(r,r.defaultAttrs,e,lt.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function gw(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],s=t.marks[o],i=s;if(s)n.push(s);else for(let l in t.marks){let u=t.marks[l];(o=="_"||u.spec.group&&u.spec.group.split(" ").indexOf(o)>-1)&&n.push(i=u)}if(!i)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function c7(t){return t.tag!=null}function d7(t){return t.style!=null}class Xo{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(o=>{if(c7(o))this.tags.push(o);else if(d7(o)){let s=/[^=]*/.exec(o.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let s=e.nodes[o.node];return s.contentMatch.matchType(s)})}parse(e,n={}){let r=new xw(this,n,!1);return r.addAll(e,lt.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new xw(this,n,!0);return r.addAll(e,lt.none,n.from,n.to),ye.maxOpen(r.finish())}matchTag(e,n,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let s=this.tags[o];if(p7(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let i=s.getAttrs(e);if(i===!1)continue;s.attrs=i||void 0}return s}}}matchStyle(e,n,r,o){for(let s=o?this.styles.indexOf(o)+1:0;s<this.styles.length;s++){let i=this.styles[s],l=i.style;if(!(l.indexOf(e)!=0||i.context&&!r.matchesContext(i.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(i.getAttrs){let u=i.getAttrs(n);if(u===!1)continue;i.attrs=u||void 0}return i}}}static schemaRules(e){let n=[];function r(o){let s=o.priority==null?50:o.priority,i=0;for(;i<n.length;i++){let l=n[i];if((l.priority==null?50:l.priority)<s)break}n.splice(i,0,o)}for(let o in e.marks){let s=e.marks[o].spec.parseDOM;s&&s.forEach(i=>{r(i=vw(i)),i.mark||i.ignore||i.clearMark||(i.mark=o)})}for(let o in e.nodes){let s=e.nodes[o].spec.parseDOM;s&&s.forEach(i=>{r(i=vw(i)),i.node||i.ignore||i.mark||(i.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Xo(e,Xo.schemaRules(e)))}}const R_={address:!0,article:!0,aside:!0,blockquote:!0,body:!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},f7={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},O_={ol:!0,ul:!0},Xu=1,R1=2,Cu=4;function yw(t,e,n){return e!=null?(e?Xu:0)|(e==="full"?R1:0):t&&t.whitespace=="pre"?Xu|R1:n&~Cu}class lf{constructor(e,n,r,o,s,i){this.type=e,this.attrs=n,this.marks=r,this.solid=o,this.options=i,this.content=[],this.activeMarks=lt.none,this.match=s||(i&Cu?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(re.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&Xu)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-o[0].length))}}let n=re.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(re.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!R_.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class xw{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let o=n.topNode,s,i=yw(null,n.preserveWhitespace,0)|(r?Cu:0);o?s=new lf(o.type,o.attrs,lt.none,!0,n.topMatch||o.type.contentMatch,i):r?s=new lf(null,null,lt.none,!0,null,i):s=new lf(e.schema.topNodeType,null,lt.none,!0,null,i),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,o=this.top,s=o.options&R1?"full":this.localPreserveWS||(o.options&Xu)>0,{schema:i}=this.parser;if(s==="full"||o.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)if(s==="full")r=r.replace(/\r\n?/g,`
425
- `);else if(i.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(i.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let u=0;u<l.length;u++)u&&this.insertNode(i.linebreakReplacement.create(),n,!0),l[u]&&this.insertNode(i.text(l[u]),n,!/\S/.test(l[u]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let l=o.content[o.content.length-1],u=e.previousSibling;(!l||u&&u.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(i.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let o=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let i=e.nodeName.toLowerCase(),l;O_.hasOwnProperty(i)&&this.parser.normalizeLists&&h7(e);let u=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(u?u.ignore:f7.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e,n);else if(!u||u.skip||u.closeParent){u&&u.closeParent?this.open=Math.max(0,this.open-1):u&&u.skip.nodeType&&(e=u.skip);let d,f=this.needsBlock;if(R_.hasOwnProperty(i))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),d=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let p=u&&u.skip?n:this.readStyles(e,n);p&&this.addAll(e,p),d&&this.sync(s),this.needsBlock=f}else{let d=this.readStyles(e,n);d&&this.addElementByRule(e,u,d,u.consuming===!1?l:void 0)}this.localPreserveWS=o}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
426
- `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let s=this.parser.matchedStyles[o],i=r.getPropertyValue(s);if(i)for(let l=void 0;;){let u=this.parser.matchStyle(s,i,this,l);if(!u)break;if(u.ignore)return null;if(u.clearMark?n=n.filter(d=>!u.clearMark(d)):n=n.concat(this.parser.schema.marks[u.mark].create(u.attrs)),u.consuming===!1)l=u;else break}}return n}addElementByRule(e,n,r,o){let s,i;if(n.node)if(i=this.parser.schema.nodes[n.node],i.isLeaf)this.insertNode(i.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let u=this.enter(i,n.attrs||null,r,n.preserveWhitespace);u&&(s=!0,r=u)}else{let u=this.parser.schema.marks[n.mark];r=r.concat(u.create(n.attrs))}let l=this.top;if(i&&i.isLeaf)this.findInside(e);else if(o)this.addElement(e,r,o);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(u=>this.insertNode(u,r,!1));else{let u=e;typeof n.contentElement=="string"?u=e.querySelector(n.contentElement):typeof n.contentElement=="function"?u=n.contentElement(e):n.contentElement&&(u=n.contentElement),this.findAround(e,u,!0),this.addAll(u,r),this.findAround(e,u,!1)}s&&this.sync(l)&&this.open--}addAll(e,n,r,o){let s=r||0;for(let i=r?e.childNodes[r]:e.firstChild,l=o==null?null:e.childNodes[o];i!=l;i=i.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(i,n);this.findAtPoint(e,s)}findPlace(e,n,r){let o,s;for(let i=this.open,l=0;i>=0;i--){let u=this.nodes[i],d=u.findWrapping(e);if(d&&(!o||o.length>d.length+l)&&(o=d,s=u,!d.length))break;if(u.solid){if(r)break;l+=2}}if(!o)return null;this.sync(s);for(let i=0;i<o.length;i++)n=this.enterInner(o[i],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(n=this.enterInner(s,null,n))}let o=this.findPlace(e,n,r);if(o){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let i=lt.none;for(let l of o.concat(e.marks))(s.type?s.type.allowsMarkType(l.type):bw(l.type,e.type))&&(i=l.addToSet(i));return s.content.push(e.mark(i)),!0}return!1}enter(e,n,r,o){let s=this.findPlace(e.create(n),r,!1);return s&&(s=this.enterInner(e,n,r,!0,o)),s}enterInner(e,n,r,o=!1,s){this.closeExtra();let i=this.top;i.match=i.match&&i.match.matchType(e);let l=yw(e,s,i.options);i.options&Cu&&i.content.length==0&&(l|=Cu);let u=lt.none;return r=r.filter(d=>(i.type?i.type.allowsMarkType(d.type):bw(d.type,e))?(u=d.addToSet(u),!1):!0),this.nodes.push(new lf(e,n,u,o,null,l)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Xu)}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),s=-(r?r.depth+1:0)+(o?0:1),i=(l,u)=>{for(;l>=0;l--){let d=n[l];if(d==""){if(l==n.length-1||l==0)continue;for(;u>=s;u--)if(i(l-1,u))return!0;return!1}else{let f=u>0||u==0&&o?this.nodes[u].type:r&&u>=s?r.node(u-s).type:null;if(!f||f.name!=d&&!f.isInGroup(d))return!1;u--}}return!0};return i(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function h7(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&O_.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function p7(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function vw(t){let e={};for(let n in t)e[n]=t[n];return e}function bw(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let s=[],i=l=>{s.push(l);for(let u=0;u<l.edgeCount;u++){let{type:d,next:f}=l.edge(u);if(d==e||s.indexOf(f)<0&&i(f))return!0}};if(i(o.contentMatch))return!0}}class da{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=uf(n).createDocumentFragment());let o=r,s=[];return e.forEach(i=>{if(s.length||i.marks.length){let l=0,u=0;for(;l<s.length&&u<i.marks.length;){let d=i.marks[u];if(!this.marks[d.type.name]){u++;continue}if(!d.eq(s[l][0])||d.type.spec.spanning===!1)break;l++,u++}for(;l<s.length;)o=s.pop()[1];for(;u<i.marks.length;){let d=i.marks[u++],f=this.serializeMark(d,i.isInline,n);f&&(s.push([d,o]),o.appendChild(f.dom),o=f.contentDOM||f.dom)}}o.appendChild(this.serializeNodeInner(i,n))}),r}serializeNodeInner(e,n){if(e.isText)return uf(n).createTextNode(e.text);let{dom:r,contentDOM:o}=Rf(uf(n),this.nodes[e.type.name](e),null,e.attrs);if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,o)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let o=e.marks.length-1;o>=0;o--){let s=this.serializeMark(e.marks[o],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,n,r={}){let o=this.marks[e.type.name];return o&&Rf(uf(r),o(e,n),null,e.attrs)}static renderSpec(e,n,r=null,o){return typeof n=="string"?{dom:e.createTextNode(n)}:Rf(e,n,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new da(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=kw(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return kw(e.marks)}}function kw(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function uf(t){return t.document||window.document}const ww=new WeakMap;function m7(t){let e=ww.get(t);return e===void 0&&ww.set(t,e=g7(t)),e}function g7(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let o=0;o<r.length;o++)n(r[o]);else for(let o in r)n(r[o])}return n(t),e}function Rf(t,e,n,r){if(e.nodeType==1)return{dom:e};if(e.dom&&e.dom.nodeType==1)return e;let o=e[0],s;if(typeof o!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=m7(r))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let i=o.indexOf(" ");i>0&&(n=o.slice(0,i),o=o.slice(i+1));let l,u=n?t.createElementNS(n,o):t.createElement(o),d=e[1],f=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){f=2;for(let p in d)if(d[p]!=null){let m=p.indexOf(" ");m>0?u.setAttributeNS(p.slice(0,m),p.slice(m+1),d[p]):p=="style"&&u.style?u.style.cssText=d[p]:u.setAttribute(p,d[p])}}for(let p=f;p<e.length;p++){let m=e[p];if(m===0){if(p<e.length-1||p>f)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else if(typeof m=="string")u.appendChild(t.createTextNode(m));else{let{dom:y,contentDOM:v}=Rf(t,m,n,r);if(u.appendChild(y),v){if(l)throw new RangeError("Multiple content holes");l=v}}}return{dom:u,contentDOM:l}}const I_=65535,P_=Math.pow(2,16);function y7(t,e){return t+e*P_}function Cw(t){return t&I_}function x7(t){return(t-(t&I_))/P_}const j_=1,L_=2,Of=4,z_=8;class O1{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&z_)>0}get deletedBefore(){return(this.delInfo&(j_|Of))>0}get deletedAfter(){return(this.delInfo&(L_|Of))>0}get deletedAcross(){return(this.delInfo&Of)>0}}class ir{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&ir.empty)return ir.empty}recover(e){let n=0,r=Cw(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+x7(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,s=this.inverted?2:1,i=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let u=this.ranges[l]-(this.inverted?o:0);if(u>e)break;let d=this.ranges[l+s],f=this.ranges[l+i],p=u+d;if(e<=p){let m=d?e==u?-1:e==p?1:n:n,y=u+o+(m<0?0:f);if(r)return y;let v=e==(n<0?u:p)?null:y7(l/3,e-u),b=e==u?L_:e==p?j_:Of;return(n<0?e!=u:e!=p)&&(b|=z_),new O1(y,b,v)}o+=f-d}return r?e+o:new O1(e+o,0,null)}touches(e,n){let r=0,o=Cw(n),s=this.inverted?2:1,i=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let u=this.ranges[l]-(this.inverted?r:0);if(u>e)break;let d=this.ranges[l+s],f=u+d;if(e<=f&&l==o*3)return!0;r+=this.ranges[l+i]-d}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,s=0;o<this.ranges.length;o+=3){let i=this.ranges[o],l=i-(this.inverted?s:0),u=i+(this.inverted?0:s),d=this.ranges[o+n],f=this.ranges[o+r];e(l,l+d,u,u+f),s+=f-d}}invert(){return new ir(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?ir.empty:new ir(e<0?[0,-e,0]:[0,0,e])}}ir.empty=new ir([]);class Qu{constructor(e,n,r=0,o=e?e.length:0){this.mirror=n,this.from=r,this.to=o,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new Qu(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let o=e.getMirror(n);this.appendMap(e._maps[n],o!=null&&o<n?r+o:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let o=e.getMirror(n);this.appendMap(e._maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let e=new Qu;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 s=this.from;s<this.to;s++){let i=this._maps[s],l=i.mapResult(e,n);if(l.recover!=null){let u=this.getMirror(s);if(u!=null&&u>s&&u<this.to){s=u,e=this._maps[u].recover(l.recover);continue}}o|=l.delInfo,e=l.pos}return r?e:new O1(e,o,null)}}const og=Object.create(null);class Mn{getMap(){return ir.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=og[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 og)throw new RangeError("Duplicate use of step JSON ID "+e);return og[e]=n,n.prototype.jsonID=e,n}}class $t{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new $t(e,null)}static fail(e){return new $t(null,e)}static fromReplace(e,n,r,o){try{return $t.ok(e.replace(n,r,o))}catch(s){if(s instanceof Zu)return $t.fail(s.message);throw s}}}function dx(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let s=t.child(o);s.content.size&&(s=s.copy(dx(s.content,e,s))),s.isInline&&(s=e(s,n,o)),r.push(s)}return re.fromArray(r)}class Us extends Mn{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)),s=new ye(dx(n.content,(i,l)=>!i.isAtom||!l.type.allowsMarkType(this.mark.type)?i:i.mark(this.mark.addToSet(i.marks)),o),n.openStart,n.openEnd);return $t.fromReplace(e,this.from,this.to,s)}invert(){return new Hr(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 Us(n.pos,r.pos,this.mark)}merge(e){return e instanceof Us&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Us(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 Us(n.from,n.to,e.markFromJSON(n.mark))}}Mn.jsonID("addMark",Us);class Hr extends Mn{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 ye(dx(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return $t.fromReplace(e,this.from,this.to,r)}invert(){return new Us(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 Hr(n.pos,r.pos,this.mark)}merge(e){return e instanceof Hr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Hr(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 Hr(n.from,n.to,e.markFromJSON(n.mark))}}Mn.jsonID("removeMark",Hr);class Ws extends Mn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return $t.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return $t.fromReplace(e,this.pos,this.pos+1,new ye(re.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 Ws(this.pos,n.marks[o]);return new Ws(this.pos,this.mark)}}return new na(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Ws(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 Ws(n.pos,e.markFromJSON(n.mark))}}Mn.jsonID("addNodeMark",Ws);class na extends Mn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return $t.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return $t.fromReplace(e,this.pos,this.pos+1,new ye(re.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Ws(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new na(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 na(n.pos,e.markFromJSON(n.mark))}}Mn.jsonID("removeNodeMark",na);class Ft extends Mn{constructor(e,n,r,o=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=o}apply(e){return this.structure&&I1(e,this.from,this.to)?$t.fail("Structure replace would overwrite content"):$t.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new ir([this.from,this.to-this.from,this.slice.size])}invert(e){return new Ft(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.to,-1),r=this.from==this.to&&Ft.MAP_BIAS<0?n:e.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new Ft(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Ft)||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?ye.empty:new ye(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Ft(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?ye.empty:new ye(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Ft(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 Ft(n.from,n.to,ye.fromJSON(e,n.slice),!!n.structure)}}Ft.MAP_BIAS=1;Mn.jsonID("replace",Ft);class dn extends Mn{constructor(e,n,r,o,s,i,l=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=s,this.insert=i,this.structure=l}apply(e){if(this.structure&&(I1(e,this.from,this.gapFrom)||I1(e,this.gapTo,this.to)))return $t.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return $t.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?$t.fromReplace(e,this.from,this.to,r):$t.fail("Content does not fit in gap")}getMap(){return new ir([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 dn(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||s>r.pos?null:new dn(n.pos,r.pos,o,s,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 dn(n.from,n.to,n.gapFrom,n.gapTo,ye.fromJSON(e,n.slice),n.insert,!!n.structure)}}Mn.jsonID("replaceAround",dn);function I1(t,e,n){let r=t.resolve(e),o=n-e,s=r.depth;for(;o>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,o--;if(o>0){let i=r.node(s).maybeChild(r.indexAfter(s));for(;o>0;){if(!i||i.isLeaf)return!0;i=i.firstChild,o--}}return!1}function v7(t,e,n,r){let o=[],s=[],i,l;t.doc.nodesBetween(e,n,(u,d,f)=>{if(!u.isInline)return;let p=u.marks;if(!r.isInSet(p)&&f.type.allowsMarkType(r.type)){let m=Math.max(d,e),y=Math.min(d+u.nodeSize,n),v=r.addToSet(p);for(let b=0;b<p.length;b++)p[b].isInSet(v)||(i&&i.to==m&&i.mark.eq(p[b])?i.to=y:o.push(i=new Hr(m,y,p[b])));l&&l.to==m?l.to=y:s.push(l=new Us(m,y,r))}}),o.forEach(u=>t.step(u)),s.forEach(u=>t.step(u))}function b7(t,e,n,r){let o=[],s=0;t.doc.nodesBetween(e,n,(i,l)=>{if(!i.isInline)return;s++;let u=null;if(r instanceof Sp){let d=i.marks,f;for(;f=r.isInSet(d);)(u||(u=[])).push(f),d=f.removeFromSet(d)}else r?r.isInSet(i.marks)&&(u=[r]):u=i.marks;if(u&&u.length){let d=Math.min(l+i.nodeSize,n);for(let f=0;f<u.length;f++){let p=u[f],m;for(let y=0;y<o.length;y++){let v=o[y];v.step==s-1&&p.eq(o[y].style)&&(m=v)}m?(m.to=d,m.step=s):o.push({style:p,from:Math.max(l,e),to:d,step:s})}}}),o.forEach(i=>t.step(new Hr(i.from,i.to,i.style)))}function fx(t,e,n,r=n.contentMatch,o=!0){let s=t.doc.nodeAt(e),i=[],l=e+1;for(let u=0;u<s.childCount;u++){let d=s.child(u),f=l+d.nodeSize,p=r.matchType(d.type);if(!p)i.push(new Ft(l,f,ye.empty));else{r=p;for(let m=0;m<d.marks.length;m++)n.allowsMarkType(d.marks[m].type)||t.step(new Hr(l,f,d.marks[m]));if(o&&d.isText&&n.whitespace!="pre"){let m,y=/\r?\n|\r/g,v;for(;m=y.exec(d.text);)v||(v=new ye(re.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),i.push(new Ft(l+m.index,l+m.index+m[0].length,v))}}l=f}if(!r.validEnd){let u=r.fillBefore(re.empty,!0);t.replace(l,l,new ye(u,0,0))}for(let u=i.length-1;u>=0;u--)t.step(i[u])}function k7(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function wl(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,o=0,s=0;;--r){let i=t.$from.node(r),l=t.$from.index(r)+o,u=t.$to.indexAfter(r)-s;if(r<t.depth&&i.canReplace(l,u,n))return r;if(r==0||i.type.spec.isolating||!k7(i,l,u))break;l&&(o=1),u<i.childCount&&(s=1)}return null}function w7(t,e,n){let{$from:r,$to:o,depth:s}=e,i=r.before(s+1),l=o.after(s+1),u=i,d=l,f=re.empty,p=0;for(let v=s,b=!1;v>n;v--)b||r.index(v)>0?(b=!0,f=re.from(r.node(v).copy(f)),p++):u--;let m=re.empty,y=0;for(let v=s,b=!1;v>n;v--)b||o.after(v+1)<o.end(v)?(b=!0,m=re.from(o.node(v).copy(m)),y++):d++;t.step(new dn(u,d,i,l,new ye(f.append(m),p,y),f.size-p,!0))}function hx(t,e,n=null,r=t){let o=C7(t,e),s=o&&S7(r,e);return s?o.map(Sw).concat({type:e,attrs:n}).concat(s.map(Sw)):null}function Sw(t){return{type:t,attrs:null}}function C7(t,e){let{parent:n,startIndex:r,endIndex:o}=t,s=n.contentMatchAt(r).findWrapping(e);if(!s)return null;let i=s.length?s[0]:e;return n.canReplaceWith(r,o,i)?s:null}function S7(t,e){let{parent:n,startIndex:r,endIndex:o}=t,s=n.child(r),i=e.contentMatch.findWrapping(s.type);if(!i)return null;let u=(i.length?i[i.length-1]:e).contentMatch;for(let d=r;u&&d<o;d++)u=u.matchType(n.child(d).type);return!u||!u.validEnd?null:i}function E7(t,e,n){let r=re.empty;for(let i=n.length-1;i>=0;i--){if(r.size){let l=n[i].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=re.from(n[i].type.create(n[i].attrs,r))}let o=e.start,s=e.end;t.step(new dn(o,s,o,s,new ye(r,0,0),n.length,!0))}function _7(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(i,l)=>{let u=typeof o=="function"?o(i):o;if(i.isTextblock&&!i.hasMarkup(r,u)&&T7(t.doc,t.mapping.slice(s).map(l),r)){let d=null;if(r.schema.linebreakReplacement){let y=r.whitespace=="pre",v=!!r.contentMatch.matchType(r.schema.linebreakReplacement);y&&!v?d=!1:!y&&v&&(d=!0)}d===!1&&$_(t,i,l,s),fx(t,t.mapping.slice(s).map(l,1),r,void 0,d===null);let f=t.mapping.slice(s),p=f.map(l,1),m=f.map(l+i.nodeSize,1);return t.step(new dn(p,m,p+1,m-1,new ye(re.from(r.create(u,null,i.marks)),0,0),1,!0)),d===!0&&F_(t,i,l,s),!1}})}function F_(t,e,n,r){e.forEach((o,s)=>{if(o.isText){let i,l=/\r?\n|\r/g;for(;i=l.exec(o.text);){let u=t.mapping.slice(r).map(n+1+s+i.index);t.replaceWith(u,u+1,e.type.schema.linebreakReplacement.create())}}})}function $_(t,e,n,r){e.forEach((o,s)=>{if(o.type==o.type.schema.linebreakReplacement){let i=t.mapping.slice(r).map(n+1+s);t.replaceWith(i,i+1,e.type.schema.text(`
427
- `))}})}function T7(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function M7(t,e,n,r,o){let s=t.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let i=n.create(r,null,o||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,i);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new dn(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new ye(re.from(i),0,0),1,!0))}function Qo(t,e,n=1,r){let o=t.resolve(e),s=o.depth-n,i=r&&r[r.length-1]||o.parent;if(s<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!i.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let d=o.depth-1,f=n-2;d>s;d--,f--){let p=o.node(d),m=o.index(d);if(p.type.spec.isolating)return!1;let y=p.content.cutByIndex(m,p.childCount),v=r&&r[f+1];v&&(y=y.replaceChild(0,v.type.create(v.attrs)));let b=r&&r[f]||p;if(!p.canReplace(m+1,p.childCount)||!b.type.validContent(y))return!1}let l=o.indexAfter(s),u=r&&r[0];return o.node(s).canReplaceWith(l,l,u?u.type:o.node(s+1).type)}function A7(t,e,n=1,r){let o=t.doc.resolve(e),s=re.empty,i=re.empty;for(let l=o.depth,u=o.depth-n,d=n-1;l>u;l--,d--){s=re.from(o.node(l).copy(s));let f=r&&r[d];i=re.from(f?f.type.create(f.attrs,i):o.node(l).copy(i))}t.step(new Ft(e,e,new ye(s.append(i),n,n),!0))}function hi(t,e){let n=t.resolve(e),r=n.index();return B_(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function N7(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let o=0;o<e.childCount;o++){let s=e.child(o),i=s.type==r?t.type.schema.nodes.text:s.type;if(n=n.matchType(i),!n||!t.type.allowsMarks(s.marks))return!1}return n.validEnd}function B_(t,e){return!!(t&&e&&!t.isLeaf&&N7(t,e))}function Ep(t,e,n=-1){let r=t.resolve(e);for(let o=r.depth;;o--){let s,i,l=r.index(o);if(o==r.depth?(s=r.nodeBefore,i=r.nodeAfter):n>0?(s=r.node(o+1),l++,i=r.node(o).maybeChild(l)):(s=r.node(o).maybeChild(l-1),i=r.node(o+1)),s&&!s.isTextblock&&B_(s,i)&&r.node(o).canReplace(l,l+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function D7(t,e,n){let r=null,{linebreakReplacement:o}=t.doc.type.schema,s=t.doc.resolve(e-n),i=s.node().type;if(o&&i.inlineContent){let f=i.whitespace=="pre",p=!!i.contentMatch.matchType(o);f&&!p?r=!1:!f&&p&&(r=!0)}let l=t.steps.length;if(r===!1){let f=t.doc.resolve(e+n);$_(t,f.node(),f.before(),l)}i.inlineContent&&fx(t,e+n-1,i,s.node().contentMatchAt(s.index()),r==null);let u=t.mapping.slice(l),d=u.map(e-n);if(t.step(new Ft(d,u.map(e+n,-1),ye.empty,!0)),r===!0){let f=t.doc.resolve(d);F_(t,f.node(),f.before(),t.steps.length)}return t}function R7(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 s=r.index(o);if(r.node(o).canReplaceWith(s,s,n))return r.before(o+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let s=r.indexAfter(o);if(r.node(o).canReplaceWith(s,s,n))return r.after(o+1);if(s<r.node(o).childCount)return null}return null}function V_(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let s=0;s<n.openStart;s++)o=o.firstChild.content;for(let s=1;s<=(n.openStart==0&&n.size?2:1);s++)for(let i=r.depth;i>=0;i--){let l=i==r.depth?0:r.pos<=(r.start(i+1)+r.end(i+1))/2?-1:1,u=r.index(i)+(l>0?1:0),d=r.node(i),f=!1;if(s==1)f=d.canReplace(u,u,o);else{let p=d.contentMatchAt(u).findWrapping(o.firstChild.type);f=p&&d.canReplaceWith(u,u,p[0])}if(f)return l==0?r.pos:l<0?r.before(i+1):r.after(i+1)}return null}function _p(t,e,n=e,r=ye.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),s=t.resolve(n);return H_(o,s,r)?new Ft(e,n,r):new O7(o,s,r).fit()}function H_(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class O7{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=re.empty;for(let o=0;o<=e.depth;o++){let s=e.node(o);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=re.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let 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 s=this.placed,i=r.depth,l=o.depth;for(;i&&l&&s.childCount==1;)s=s.firstChild.content,i--,l--;let u=new ye(s,i,l);return e>-1?new dn(r.pos,e,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new Ft(r.pos,o.pos,u):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let s=n.firstChild;if(n.childCount>1&&(o=0),s.type.spec.isolating&&o<=r){e=r;break}n=s.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let o,s=null;r?(s=sg(this.unplaced.content,r-1).firstChild,o=s.content):o=this.unplaced.content;let i=o.firstChild;for(let l=this.depth;l>=0;l--){let{type:u,match:d}=this.frontier[l],f,p=null;if(n==1&&(i?d.matchType(i.type)||(p=d.fillBefore(re.from(i),!1)):s&&u.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:l,parent:s,inject:p};if(n==2&&i&&(f=d.findWrapping(i.type)))return{sliceDepth:r,frontierDepth:l,parent:s,wrap:f};if(s&&d.matchType(s.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=sg(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new ye(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=sg(e,n);if(o.childCount<=1&&n>0){let s=e.size-n<=n+o.size;this.unplaced=new ye(gu(e,n-1,1),n-1,s?n-1:r)}else this.unplaced=new ye(gu(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let b=0;b<s.length;b++)this.openFrontierNode(s[b]);let i=this.unplaced,l=r?r.content:i.content,u=i.openStart-e,d=0,f=[],{match:p,type:m}=this.frontier[n];if(o){for(let b=0;b<o.childCount;b++)f.push(o.child(b));p=p.matchFragment(o)}let y=l.size+e-(i.content.size-i.openEnd);for(;d<l.childCount;){let b=l.child(d),k=p.matchType(b.type);if(!k)break;d++,(d>1||u==0||b.content.size)&&(p=k,f.push(U_(b.mark(m.allowedMarks(b.marks)),d==1?u:0,d==l.childCount?y:-1)))}let v=d==l.childCount;v||(y=-1),this.placed=yu(this.placed,n,re.from(f)),this.frontier[n].match=p,v&&y<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let b=0,k=l;b<y;b++){let E=k.lastChild;this.frontier.push({type:E.type,match:E.contentMatchAt(E.childCount)}),k=E.content}this.unplaced=v?e==0?ye.empty:new ye(gu(i.content,e-1,1),e-1,y<0?i.openEnd:e-1):new ye(gu(i.content,e,d),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!ig(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],s=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),i=ig(e,n,o,r,s);if(i){for(let l=n-1;l>=0;l--){let{match:u,type:d}=this.frontier[l],f=ig(e,l,d,u,!0);if(!f||f.childCount)continue e}return{depth:n,fit:i,move:s?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=yu(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let o=e.node(r),s=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,s)}return e}openFrontierNode(e,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=yu(this.placed,this.depth,re.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(re.empty,!0);n.childCount&&(this.placed=yu(this.placed,this.frontier.length,n))}}function gu(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(gu(t.firstChild.content,e-1,n)))}function yu(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(yu(t.lastChild.content,e-1,n)))}function sg(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function U_(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,U_(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(re.empty,!0)))),t.copy(r)}function ig(t,e,n,r,o){let s=t.node(e),i=o?t.indexAfter(e):t.index(e);if(i==s.childCount&&!n.compatibleContent(s.type))return null;let l=r.fillBefore(s.content,!0,i);return l&&!I7(n,s.content,i)?l:null}function I7(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function P7(t){return t.spec.defining||t.spec.definingForContent}function j7(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),s=t.doc.resolve(n);if(H_(o,s,r))return t.step(new Ft(e,n,r));let i=q_(o,s);i[i.length-1]==0&&i.pop();let l=-(o.depth+1);i.unshift(l);for(let m=o.depth,y=o.pos-1;m>0;m--,y--){let v=o.node(m).type.spec;if(v.defining||v.definingAsContext||v.isolating)break;i.indexOf(m)>-1?l=m:o.before(m)==y&&i.splice(1,0,-m)}let u=i.indexOf(l),d=[],f=r.openStart;for(let m=r.content,y=0;;y++){let v=m.firstChild;if(d.push(v),y==r.openStart)break;m=v.content}for(let m=f-1;m>=0;m--){let y=d[m],v=P7(y.type);if(v&&!y.sameMarkup(o.node(Math.abs(l)-1)))f=m;else if(v||!y.type.isTextblock)break}for(let m=r.openStart;m>=0;m--){let y=(m+f+1)%(r.openStart+1),v=d[y];if(v)for(let b=0;b<i.length;b++){let k=i[(b+u)%i.length],E=!0;k<0&&(E=!1,k=-k);let _=o.node(k-1),T=o.index(k-1);if(_.canReplaceWith(T,T,v.type,v.marks))return t.replace(o.before(k),E?s.after(k):n,new ye(W_(r.content,0,r.openStart,y),y,r.openEnd))}}let p=t.steps.length;for(let m=i.length-1;m>=0&&(t.replace(e,n,r),!(t.steps.length>p));m--){let y=i[m];y<0||(e=o.before(y),n=s.after(y))}}function W_(t,e,n,r,o){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(W_(s.content,e+1,n,r,s)))}if(e>r){let s=o.contentMatchAt(0),i=s.fillBefore(t).append(t);t=i.append(s.matchFragment(i).fillBefore(re.empty,!0))}return t}function L7(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=R7(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new ye(re.from(r),0,0))}function z7(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n);if(r.parent.isTextblock&&o.parent.isTextblock&&r.start()!=o.start()&&r.parentOffset==0&&o.parentOffset==0){let i=r.sharedDepth(n),l=!1;for(let u=r.depth;u>i;u--)r.node(u).type.spec.isolating&&(l=!0);for(let u=o.depth;u>i;u--)o.node(u).type.spec.isolating&&(l=!0);if(!l){for(let u=r.depth;u>0&&e==r.start(u);u--)e=r.before(u);for(let u=o.depth;u>0&&n==o.start(u);u--)n=o.before(u);r=t.doc.resolve(e),o=t.doc.resolve(n)}}let s=q_(r,o);for(let i=0;i<s.length;i++){let l=s[i],u=i==s.length-1;if(u&&l==0||r.node(l).type.contentMatch.validEnd)return t.delete(r.start(l),o.end(l));if(l>0&&(u||r.node(l-1).canReplace(r.index(l-1),o.indexAfter(l-1))))return t.delete(r.before(l),o.after(l))}for(let i=1;i<=r.depth&&i<=o.depth;i++)if(e-r.start(i)==r.depth-i&&n>r.end(i)&&o.end(i)-n!=o.depth-i&&r.start(i-1)==o.start(i-1)&&r.node(i-1).canReplace(r.index(i-1),o.index(i-1)))return t.delete(r.before(i),n);t.delete(e,n)}function q_(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let o=r;o>=0;o--){let s=t.start(o);if(s<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;(s==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==s-1)&&n.push(o)}return n}class Za extends Mn{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 $t.fail("No node at attribute step's position");let r=Object.create(null);for(let s in n.attrs)r[s]=n.attrs[s];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return $t.fromReplace(e,this.pos,this.pos+1,new ye(re.from(o),0,n.isLeaf?0:1))}getMap(){return ir.empty}invert(e){return new Za(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 Za(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 Za(n.pos,n.attr,n.value)}}Mn.jsonID("attr",Za);class ec extends Mn{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 $t.ok(r)}getMap(){return ir.empty}invert(e){return new ec(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 ec(n.attr,n.value)}}Mn.jsonID("docAttr",ec);let sl=class extends Error{};sl=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};sl.prototype=Object.create(Error.prototype);sl.prototype.constructor=sl;sl.prototype.name="TransformError";class K_{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Qu}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new sl(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let o=this.mapping.maps[r];r&&(e=o.map(e,1),n=o.map(n,-1)),o.forEach((s,i,l,u)=>{e=Math.min(e,l),n=Math.max(n,u)})}return e==1e9?null:{from:e,to:n}}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=ye.empty){let o=_p(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new ye(re.from(r),0,0))}delete(e,n){return this.replace(e,n,ye.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return j7(this,e,n,r),this}replaceRangeWith(e,n,r){return L7(this,e,n,r),this}deleteRange(e,n){return z7(this,e,n),this}lift(e,n){return w7(this,e,n),this}join(e,n=1){return D7(this,e,n),this}wrap(e,n){return E7(this,e,n),this}setBlockType(e,n=e,r,o=null){return _7(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return M7(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new Za(e,n,r)),this}setDocAttribute(e,n){return this.step(new ec(e,n)),this}addNodeMark(e,n){return this.step(new Ws(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof lt)n.isInSet(r.marks)&&this.step(new na(e,n));else{let o=r.marks,s,i=[];for(;s=n.isInSet(o);)i.push(new na(e,s)),o=s.removeFromSet(o);for(let l=i.length-1;l>=0;l--)this.step(i[l])}return this}split(e,n=1,r){return A7(this,e,n,r),this}addMark(e,n,r){return v7(this,e,n,r),this}removeMark(e,n,r){return b7(this,e,n,r),this}clearIncompatible(e,n,r){return fx(this,e,n,r),this}}const ag=Object.create(null);class He{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new F7(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=ye.empty){let r=n.content.lastChild,o=null;for(let l=0;l<n.openEnd;l++)o=r,r=r.lastChild;let s=e.steps.length,i=this.ranges;for(let l=0;l<i.length;l++){let{$from:u,$to:d}=i[l],f=e.mapping.slice(s);e.replaceRange(f.map(u.pos),f.map(d.pos),l?ye.empty:n),l==0&&Tw(e,s,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:i,$to:l}=o[s],u=e.mapping.slice(r),d=u.map(i.pos),f=u.map(l.pos);s?e.deleteRange(d,f):(e.replaceRangeWith(d,f,n),Tw(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let o=e.parent.inlineContent?new je(e):Wa(e.node(0),e.parent,e.pos,e.index(),n,r);if(o)return o;for(let s=e.depth-1;s>=0;s--){let i=n<0?Wa(e.node(0),e.node(s),e.before(s+1),e.index(s),n,r):Wa(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,n,r);if(i)return i}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new lr(e.node(0))}static atStart(e){return Wa(e,e,0,0,1)||new lr(e)}static atEnd(e){return Wa(e,e,e.content.size,e.childCount,-1)||new lr(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=ag[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 ag)throw new RangeError("Duplicate use of selection JSON ID "+e);return ag[e]=n,n.prototype.jsonID=e,n}getBookmark(){return je.between(this.$anchor,this.$head).getBookmark()}}He.prototype.visible=!0;class F7{constructor(e,n){this.$from=e,this.$to=n}}let Ew=!1;function _w(t){!Ew&&!t.parent.inlineContent&&(Ew=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class je extends He{constructor(e,n=e){_w(e),_w(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 He.near(r);let o=e.resolve(n.map(this.anchor));return new je(o.parent.inlineContent?o:r,r)}replace(e,n=ye.empty){if(super.replace(e,n),n==ye.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof je&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Tp(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 je(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 s=He.findFrom(n,r,!0)||He.findFrom(n,-r,!0);if(s)n=s.$head;else return He.near(n,r)}return e.parent.inlineContent||(o==0?e=n:(e=(He.findFrom(e,-r,!0)||He.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=o<0&&(e=n))),new je(e,n)}}He.jsonID("text",je);class Tp{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Tp(e.map(this.anchor),e.map(this.head))}resolve(e){return je.between(e.resolve(this.anchor),e.resolve(this.head))}}class Oe extends He{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),s=e.resolve(o);return r?He.near(s):new Oe(s)}content(){return new ye(re.from(this.node),0,0)}eq(e){return e instanceof Oe&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new px(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Oe(e.resolve(n.anchor))}static create(e,n){return new Oe(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Oe.prototype.visible=!1;He.jsonID("node",Oe);class px{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Tp(r,r):new px(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&Oe.isSelectable(r)?new Oe(n):He.near(n)}}class lr extends He{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=ye.empty){if(n==ye.empty){e.delete(0,e.doc.content.size);let r=He.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new lr(e)}map(e){return new lr(e)}eq(e){return e instanceof lr}getBookmark(){return $7}}He.jsonID("all",lr);const $7={map(){return this},resolve(t){return new lr(t)}};function Wa(t,e,n,r,o,s=!1){if(e.inlineContent)return je.create(t,n);for(let i=r-(o>0?0:1);o>0?i<e.childCount:i>=0;i+=o){let l=e.child(i);if(l.isAtom){if(!s&&Oe.isSelectable(l))return Oe.create(t,n-(o<0?l.nodeSize:0))}else{let u=Wa(t,l,n+o,o<0?l.childCount:0,o,s);if(u)return u}n+=l.nodeSize*o}return null}function Tw(t,e,n){let r=t.steps.length-1;if(r<e)return;let o=t.steps[r];if(!(o instanceof Ft||o instanceof dn))return;let s=t.mapping.maps[r],i;s.forEach((l,u,d,f)=>{i==null&&(i=f)}),t.setSelection(He.near(t.doc.resolve(i),n))}const Mw=1,cf=2,Aw=4;class B7 extends K_{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|Mw)&~cf,this.storedMarks=null,this}get selectionSet(){return(this.updated&Mw)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=cf,this}ensureMarks(e){return lt.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&cf)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~cf,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)||lt.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let o=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),!e)return this.deleteRange(n,r);let s=this.storedMarks;if(!s){let i=this.doc.resolve(n);s=r==n?i.marks():i.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(e,s)),!this.selection.empty&&this.selection.to==n+e.length&&this.setSelection(He.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|=Aw,this}get scrolledIntoView(){return(this.updated&Aw)>0}}function Nw(t,e){return!e||!t?t:t.bind(e)}class xu{constructor(e,n,r){this.name=e,this.init=Nw(n.init,r),this.apply=Nw(n.apply,r)}}const V7=[new xu("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new xu("selection",{init(t,e){return t.selection||He.atStart(e.doc)},apply(t){return t.selection}}),new xu("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new xu("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class lg{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=V7.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 xu(r.key,r.spec.state,r))})}}class ji{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 s=!1;for(let i=0;i<this.config.plugins.length;i++){let l=this.config.plugins[i];if(l.spec.appendTransaction){let u=o?o[i].n:0,d=o?o[i].state:this,f=u<n.length&&l.spec.appendTransaction.call(l,u?n.slice(u):n,d,r);if(f&&r.filterTransaction(f,i)){if(f.setMeta("appendedTransaction",e),!o){o=[];for(let p=0;p<this.config.plugins.length;p++)o.push(p<i?{state:r,n:n.length}:{state:this,n:0})}n.push(f),r=r.applyInner(f),s=!0}o&&(o[i]={state:r,n:n.length})}}if(!s)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new ji(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let s=r[o];n[s.name]=s.apply(e,this[s.name],this,n)}return n}get tr(){return new B7(this)}static create(e){let n=new lg(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new ji(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 lg(this.schema,e.plugins),r=n.fields,o=new ji(n);for(let s=0;s<r.length;s++){let i=r[s].name;o[i]=this.hasOwnProperty(i)?this[i]:r[s].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],s=o.spec.state;s&&s.toJSON&&(n[r]=s.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 lg(e.schema,e.plugins),s=new ji(o);return o.fields.forEach(i=>{if(i.name=="doc")s.doc=Js.fromJSON(e.schema,n.doc);else if(i.name=="selection")s.selection=He.fromJSON(s.doc,n.selection);else if(i.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let u=r[l],d=u.spec.state;if(u.key==i.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){s[i.name]=d.fromJSON.call(u,e,n[l],s);return}}s[i.name]=i.init(e,s)}}),s}}function G_(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=G_(o,e,{})),n[r]=o}return n}class wt{constructor(e){this.spec=e,this.props={},e.props&&G_(e.props,this,this.props),this.key=e.key?e.key.key:J_("plugin")}getState(e){return e[this.key]}}const ug=Object.create(null);function J_(t){return t in ug?t+"$"+ ++ug[t]:(ug[t]=0,t+"$")}class Vt{constructor(e="key"){this.key=J_(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Z_=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function Y_(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const X_=(t,e,n)=>{let r=Y_(t,n);if(!r)return!1;let o=mx(r);if(!o){let i=r.blockRange(),l=i&&wl(i);return l==null?!1:(e&&e(t.tr.lift(i,l).scrollIntoView()),!0)}let s=o.nodeBefore;if(a4(t,o,e,-1))return!0;if(r.parent.content.size==0&&(il(s,"end")||Oe.isSelectable(s)))for(let i=r.depth;;i--){let l=_p(t.doc,r.before(i),r.after(i),ye.empty);if(l&&l.slice.size<l.to-l.from){if(e){let u=t.tr.step(l);u.setSelection(il(s,"end")?He.findFrom(u.doc.resolve(u.mapping.map(o.pos,-1)),-1):Oe.create(u.doc,o.pos-s.nodeSize)),e(u.scrollIntoView())}return!0}if(i==1||r.node(i-1).childCount>1)break}return s.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos-s.nodeSize,o.pos).scrollIntoView()),!0):!1},H7=(t,e,n)=>{let r=Y_(t,n);if(!r)return!1;let o=mx(r);return o?Q_(t,o,e):!1},U7=(t,e,n)=>{let r=t4(t,n);if(!r)return!1;let o=gx(r);return o?Q_(t,o,e):!1};function Q_(t,e,n){let r=e.nodeBefore,o=r,s=e.pos-1;for(;!o.isTextblock;s--){if(o.type.spec.isolating)return!1;let f=o.lastChild;if(!f)return!1;o=f}let i=e.nodeAfter,l=i,u=e.pos+1;for(;!l.isTextblock;u++){if(l.type.spec.isolating)return!1;let f=l.firstChild;if(!f)return!1;l=f}let d=_p(t.doc,s,u,ye.empty);if(!d||d.from!=s||d instanceof Ft&&d.slice.size>=u-s)return!1;if(n){let f=t.tr.step(d);f.setSelection(je.create(f.doc,s)),n(f.scrollIntoView())}return!0}function il(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 e4=(t,e,n)=>{let{$head:r,empty:o}=t.selection,s=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;s=mx(r)}let i=s&&s.nodeBefore;return!i||!Oe.isSelectable(i)?!1:(e&&e(t.tr.setSelection(Oe.create(t.doc,s.pos-i.nodeSize)).scrollIntoView()),!0)};function mx(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 t4(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const n4=(t,e,n)=>{let r=t4(t,n);if(!r)return!1;let o=gx(r);if(!o)return!1;let s=o.nodeAfter;if(a4(t,o,e,1))return!0;if(r.parent.content.size==0&&(il(s,"start")||Oe.isSelectable(s))){let i=_p(t.doc,r.before(),r.after(),ye.empty);if(i&&i.slice.size<i.to-i.from){if(e){let l=t.tr.step(i);l.setSelection(il(s,"start")?He.findFrom(l.doc.resolve(l.mapping.map(o.pos)),1):Oe.create(l.doc,l.mapping.map(o.pos))),e(l.scrollIntoView())}return!0}}return s.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos,o.pos+s.nodeSize).scrollIntoView()),!0):!1},r4=(t,e,n)=>{let{$head:r,empty:o}=t.selection,s=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;s=gx(r)}let i=s&&s.nodeAfter;return!i||!Oe.isSelectable(i)?!1:(e&&e(t.tr.setSelection(Oe.create(t.doc,s.pos)).scrollIntoView()),!0)};function gx(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 W7=(t,e)=>{let n=t.selection,r=n instanceof Oe,o;if(r){if(n.node.isTextblock||!hi(t.doc,n.from))return!1;o=n.from}else if(o=Ep(t.doc,n.from,-1),o==null)return!1;if(e){let s=t.tr.join(o);r&&s.setSelection(Oe.create(s.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},q7=(t,e)=>{let n=t.selection,r;if(n instanceof Oe){if(n.node.isTextblock||!hi(t.doc,n.to))return!1;r=n.to}else if(r=Ep(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},K7=(t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),s=o&&wl(o);return s==null?!1:(e&&e(t.tr.lift(o,s).scrollIntoView()),!0)},o4=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
428
- `).scrollIntoView()),!0)};function yx(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 G7=(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),s=n.indexAfter(-1),i=yx(o.contentMatchAt(s));if(!i||!o.canReplaceWith(s,s,i))return!1;if(e){let l=n.after(),u=t.tr.replaceWith(l,l,i.createAndFill());u.setSelection(He.near(u.doc.resolve(l),1)),e(u.scrollIntoView())}return!0},s4=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof lr||r.parent.inlineContent||o.parent.inlineContent)return!1;let s=yx(o.parent.contentMatchAt(o.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let i=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,l=t.tr.insert(i,s.createAndFill());l.setSelection(je.create(l.doc,i+1)),e(l.scrollIntoView())}return!0},i4=(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 s=n.before();if(Qo(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),o=r&&wl(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)};function J7(t){return(e,n)=>{let{$from:r,$to:o}=e.selection;if(e.selection instanceof Oe&&e.selection.node.isBlock)return!r.parentOffset||!Qo(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let s=[],i,l,u=!1,d=!1;for(let y=r.depth;;y--)if(r.node(y).isBlock){u=r.end(y)==r.pos+(r.depth-y),d=r.start(y)==r.pos-(r.depth-y),l=yx(r.node(y-1).contentMatchAt(r.indexAfter(y-1))),s.unshift(u&&l?{type:l}:null),i=y;break}else{if(y==1)return!1;s.unshift(null)}let f=e.tr;(e.selection instanceof je||e.selection instanceof lr)&&f.deleteSelection();let p=f.mapping.map(r.pos),m=Qo(f.doc,p,s.length,s);if(m||(s[0]=l?{type:l}:null,m=Qo(f.doc,p,s.length,s)),!m)return!1;if(f.split(p,s.length,s),!u&&d&&r.node(i).type!=l){let y=f.mapping.map(r.before(i)),v=f.doc.resolve(y);l&&r.node(i-1).canReplaceWith(v.index(),v.index()+1,l)&&f.setNodeMarkup(f.mapping.map(r.before(i)),l)}return n&&n(f.scrollIntoView()),!0}}const Z7=J7(),Y7=(t,e)=>{let{$from:n,to:r}=t.selection,o,s=n.sharedDepth(r);return s==0?!1:(o=n.before(s),e&&e(t.tr.setSelection(Oe.create(t.doc,o))),!0)};function X7(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,s=e.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(o.isTextblock||hi(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function a4(t,e,n,r){let o=e.nodeBefore,s=e.nodeAfter,i,l,u=o.type.spec.isolating||s.type.spec.isolating;if(!u&&X7(t,e,n))return!0;let d=!u&&e.parent.canReplace(e.index(),e.index()+1);if(d&&(i=(l=o.contentMatchAt(o.childCount)).findWrapping(s.type))&&l.matchType(i[0]||s.type).validEnd){if(n){let y=e.pos+s.nodeSize,v=re.empty;for(let E=i.length-1;E>=0;E--)v=re.from(i[E].create(null,v));v=re.from(o.copy(v));let b=t.tr.step(new dn(e.pos-1,y,e.pos,y,new ye(v,1,0),i.length,!0)),k=b.doc.resolve(y+2*i.length);k.nodeAfter&&k.nodeAfter.type==o.type&&hi(b.doc,k.pos)&&b.join(k.pos),n(b.scrollIntoView())}return!0}let f=s.type.spec.isolating||r>0&&u?null:He.findFrom(e,1),p=f&&f.$from.blockRange(f.$to),m=p&&wl(p);if(m!=null&&m>=e.depth)return n&&n(t.tr.lift(p,m).scrollIntoView()),!0;if(d&&il(s,"start",!0)&&il(o,"end")){let y=o,v=[];for(;v.push(y),!y.isTextblock;)y=y.lastChild;let b=s,k=1;for(;!b.isTextblock;b=b.firstChild)k++;if(y.canReplace(y.childCount,y.childCount,b.content)){if(n){let E=re.empty;for(let T=v.length-1;T>=0;T--)E=re.from(v[T].copy(E));let _=t.tr.step(new dn(e.pos-v.length,e.pos+s.nodeSize,e.pos+k,e.pos+s.nodeSize-k,new ye(E,v.length,0),0,!0));n(_.scrollIntoView())}return!0}}return!1}function l4(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,s=o.depth;for(;o.node(s).isInline;){if(!s)return!1;s--}return o.node(s).isTextblock?(n&&n(e.tr.setSelection(je.create(e.doc,t<0?o.start(s):o.end(s)))),!0):!1}}const Q7=l4(-1),ez=l4(1);function tz(t,e=null){return function(n,r){let{$from:o,$to:s}=n.selection,i=o.blockRange(s),l=i&&hx(i,t,e);return l?(r&&r(n.tr.wrap(i,l).scrollIntoView()),!0):!1}}function Dw(t,e=null){return function(n,r){let o=!1;for(let s=0;s<n.selection.ranges.length&&!o;s++){let{$from:{pos:i},$to:{pos:l}}=n.selection.ranges[s];n.doc.nodesBetween(i,l,(u,d)=>{if(o)return!1;if(!(!u.isTextblock||u.hasMarkup(t,e)))if(u.type==t)o=!0;else{let f=n.doc.resolve(d),p=f.index();o=f.parent.canReplaceWith(p,p+1,t)}})}if(!o)return!1;if(r){let s=n.tr;for(let i=0;i<n.selection.ranges.length;i++){let{$from:{pos:l},$to:{pos:u}}=n.selection.ranges[i];s.setBlockType(l,u,t,e)}r(s.scrollIntoView())}return!0}}function xx(...t){return function(e,n,r){for(let o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}xx(Z_,X_,e4);xx(Z_,n4,r4);xx(o4,s4,i4,Z7);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function nz(t,e=null){return function(n,r){let{$from:o,$to:s}=n.selection,i=o.blockRange(s);if(!i)return!1;let l=r?n.tr:null;return rz(l,i,t,e)?(r&&r(l.scrollIntoView()),!0):!1}}function rz(t,e,n,r=null){let o=!1,s=e,i=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let u=i.resolve(e.start-2);s=new rh(u,u,e.depth),e.endIndex<e.parent.childCount&&(e=new rh(e.$from,i.resolve(e.$to.end(e.depth)),e.depth)),o=!0}let l=hx(s,n,r,e);return l?(t&&oz(t,e,l,o,n),!0):!1}function oz(t,e,n,r,o){let s=re.empty;for(let f=n.length-1;f>=0;f--)s=re.from(n[f].type.create(n[f].attrs,s));t.step(new dn(e.start-(r?2:0),e.end,e.start,e.end,new ye(s,0,0),n.length,!0));let i=0;for(let f=0;f<n.length;f++)n[f].type==o&&(i=f+1);let l=n.length-i,u=e.start+n.length-(r?2:0),d=e.parent;for(let f=e.startIndex,p=e.endIndex,m=!0;f<p;f++,m=!1)!m&&Qo(t.doc,u,l)&&(t.split(u,l),u+=2*l),u+=d.child(f).nodeSize;return t}function sz(t){return function(e,n){let{$from:r,$to:o}=e.selection,s=r.blockRange(o,i=>i.childCount>0&&i.firstChild.type==t);return s?n?r.node(s.depth-1).type==t?iz(e,n,t,s):az(e,n,s):!0:!1}}function iz(t,e,n,r){let o=t.tr,s=r.end,i=r.$to.end(r.depth);s<i&&(o.step(new dn(s-1,i,s,i,new ye(re.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new rh(o.doc.resolve(r.$from.pos),o.doc.resolve(i),r.depth));const l=wl(r);if(l==null)return!1;o.lift(r,l);let u=o.doc.resolve(o.mapping.map(s,-1)-1);return hi(o.doc,u.pos)&&u.nodeBefore.type==u.nodeAfter.type&&o.join(u.pos),e(o.scrollIntoView()),!0}function az(t,e,n){let r=t.tr,o=n.parent;for(let y=n.end,v=n.endIndex-1,b=n.startIndex;v>b;v--)y-=o.child(v).nodeSize,r.delete(y-1,y+1);let s=r.doc.resolve(n.start),i=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,u=n.endIndex==o.childCount,d=s.node(-1),f=s.index(-1);if(!d.canReplace(f+(l?0:1),f+1,i.content.append(u?re.empty:re.from(o))))return!1;let p=s.pos,m=p+i.nodeSize;return r.step(new dn(p-(l?1:0),m+(u?1:0),p+1,m-1,new ye((l?re.empty:re.from(o.copy(re.empty))).append(u?re.empty:re.from(o.copy(re.empty))),l?0:1,u?0:1),l?0:1)),e(r.scrollIntoView()),!0}function lz(t){return function(e,n){let{$from:r,$to:o}=e.selection,s=r.blockRange(o,d=>d.childCount>0&&d.firstChild.type==t);if(!s)return!1;let i=s.startIndex;if(i==0)return!1;let l=s.parent,u=l.child(i-1);if(u.type!=t)return!1;if(n){let d=u.lastChild&&u.lastChild.type==l.type,f=re.from(d?t.create():null),p=new ye(re.from(t.create(null,re.from(l.type.create(null,f)))),d?3:1,0),m=s.start,y=s.end;n(e.tr.step(new dn(m-(d?3:1),y,m,y,p,1,!0)).scrollIntoView())}return!0}}const xn=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},al=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let P1=null;const Wo=function(t,e,n){let r=P1||(P1=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},uz=function(){P1=null},ra=function(t,e,n,r){return n&&(Rw(t,e,n,r,-1)||Rw(t,e,n,r,1))},cz=/^(img|br|input|textarea|hr)$/i;function Rw(t,e,n,r,o){for(var s;;){if(t==n&&e==r)return!0;if(e==(o<0?0:Tr(t))){let i=t.parentNode;if(!i||i.nodeType!=1||Tc(t)||cz.test(t.nodeName)||t.contentEditable=="false")return!1;e=xn(t)+(o<0?0:1),t=i}else if(t.nodeType==1){let i=t.childNodes[e+(o<0?-1:0)];if(i.nodeType==1&&i.contentEditable=="false")if(!((s=i.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)e+=o;else return!1;else t=i,e=o<0?Tr(t):0}else return!1}}function Tr(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function dz(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Tr(t)}else if(t.parentNode&&!Tc(t))e=xn(t),t=t.parentNode;else return null}}function fz(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!Tc(t))e=xn(t)+1,t=t.parentNode;else return null}}function hz(t,e,n){for(let r=e==0,o=e==Tr(t);r||o;){if(t==n)return!0;let s=xn(t);if(t=t.parentNode,!t)return!1;r=r&&s==0,o=o&&s==Tr(t)}}function Tc(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 Mp=function(t){return t.focusNode&&ra(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Pi(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function pz(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function mz(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Tr(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Tr(r.startContainer),r.startOffset)}}}const ko=typeof navigator<"u"?navigator:null,Ow=typeof document<"u"?document:null,pi=ko&&ko.userAgent||"",j1=/Edge\/(\d+)/.exec(pi),u4=/MSIE \d/.exec(pi),L1=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(pi),Xn=!!(u4||L1||j1),Zs=u4?document.documentMode:L1?+L1[1]:j1?+j1[1]:0,Mr=!Xn&&/gecko\/(\d+)/i.test(pi);Mr&&+(/Firefox\/(\d+)/.exec(pi)||[0,0])[1];const z1=!Xn&&/Chrome\/(\d+)/.exec(pi),bn=!!z1,c4=z1?+z1[1]:0,Tn=!Xn&&!!ko&&/Apple Computer/.test(ko.vendor),ll=Tn&&(/Mobile\/\w+/.test(pi)||!!ko&&ko.maxTouchPoints>2),Sr=ll||(ko?/Mac/.test(ko.platform):!1),d4=ko?/Win/.test(ko.platform):!1,Ko=/Android \d/.test(pi),Mc=!!Ow&&"webkitFontSmoothing"in Ow.documentElement.style,gz=Mc?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function yz(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Fo(t,e){return typeof t=="number"?t:t[e]}function xz(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 Iw(t,e,n){if(!F1(e)&&e.left==0)return;let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let i=n||t.dom;i;){if(i.nodeType!=1){i=al(i);continue}let l=i,u=l==s.body,d=u?yz(s):xz(l),f=0,p=0;if(e.top<d.top+Fo(r,"top")?p=-(d.top-e.top+Fo(o,"top")):e.bottom>d.bottom-Fo(r,"bottom")&&(p=e.bottom-e.top>d.bottom-d.top?e.top+Fo(o,"top")-d.top:e.bottom-d.bottom+Fo(o,"bottom")),e.left<d.left+Fo(r,"left")?f=-(d.left-e.left+Fo(o,"left")):e.right>d.right-Fo(r,"right")&&(f=e.right-d.right+Fo(o,"right")),f||p)if(u)s.defaultView.scrollBy(f,p);else{let y=l.scrollLeft,v=l.scrollTop;p&&(l.scrollTop+=p),f&&(l.scrollLeft+=f);let b=l.scrollLeft-y,k=l.scrollTop-v;e={left:e.left-b,top:e.top-k,right:e.right-b,bottom:e.bottom-k}}let m=u?"fixed":getComputedStyle(i).position;if(/^(fixed|sticky)$/.test(m))break;i=m=="absolute"?i.offsetParent:al(i)}}function vz(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,o;for(let s=(e.left+e.right)/2,i=n+1;i<Math.min(innerHeight,e.bottom);i+=5){let l=t.root.elementFromPoint(s,i);if(!l||l==t.dom||!t.dom.contains(l))continue;let u=l.getBoundingClientRect();if(u.top>=n-20){r=l,o=u.top;break}}return{refDOM:r,refTop:o,stack:f4(t.dom)}}function f4(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=al(r));return e}function bz({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;h4(n,r==0?0:r-e)}function h4(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:o,left:s}=t[n];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=s&&(r.scrollLeft=s)}}let Ba=null;function kz(t){if(t.setActive)return t.setActive();if(Ba)return t.focus(Ba);let e=f4(t);t.focus(Ba==null?{get preventScroll(){return Ba={preventScroll:!0},!0}}:void 0),Ba||(Ba=!1,h4(e,0))}function p4(t,e){let n,r=2e8,o,s=0,i=e.top,l=e.top,u,d;for(let f=t.firstChild,p=0;f;f=f.nextSibling,p++){let m;if(f.nodeType==1)m=f.getClientRects();else if(f.nodeType==3)m=Wo(f).getClientRects();else continue;for(let y=0;y<m.length;y++){let v=m[y];if(v.top<=i&&v.bottom>=l){i=Math.max(v.bottom,i),l=Math.min(v.top,l);let b=v.left>e.left?v.left-e.left:v.right<e.left?e.left-v.right:0;if(b<r){n=f,r=b,o=b&&n.nodeType==3?{left:v.right<e.left?v.right:v.left,top:e.top}:e,f.nodeType==1&&b&&(s=p+(e.left>=(v.left+v.right)/2?1:0));continue}}else v.top>e.top&&!u&&v.left<=e.left&&v.right>=e.left&&(u=f,d={left:Math.max(v.left,Math.min(v.right,e.left)),top:v.top});!n&&(e.left>=v.right&&e.top>=v.top||e.left>=v.left&&e.top>=v.bottom)&&(s=p+1)}}return!n&&u&&(n=u,o=d,r=0),n&&n.nodeType==3?wz(n,o):!n||r&&n.nodeType==1?{node:t,offset:s}:p4(n,o)}function wz(t,e){let n=t.nodeValue.length,r=document.createRange(),o;for(let s=0;s<n;s++){r.setEnd(t,s+1),r.setStart(t,s);let i=Is(r,1);if(i.top!=i.bottom&&vx(e,i)){o={node:t,offset:s+(e.left>=(i.left+i.right)/2?1:0)};break}}return r.detach(),o||{node:t,offset:0}}function vx(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function Cz(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function Sz(t,e,n){let{node:r,offset:o}=p4(e,n),s=-1;if(r.nodeType==1&&!r.firstChild){let i=r.getBoundingClientRect();s=i.left!=i.right&&n.left>(i.left+i.right)/2?1:-1}return t.docView.posFromDOM(r,o,s)}function Ez(t,e,n,r){let o=-1;for(let s=e,i=!1;s!=t.dom;){let l=t.docView.nearestDesc(s,!0),u;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((u=l.dom.getBoundingClientRect()).width||u.height)&&(l.node.isBlock&&l.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(l.dom.nodeName)&&(!i&&u.left>r.left||u.top>r.top?o=l.posBefore:(!i&&u.right<r.left||u.bottom<r.top)&&(o=l.posAfter),i=!0),!l.contentDOM&&o<0&&!l.node.isText))return(l.node.isBlock?r.top<(u.top+u.bottom)/2:r.left<(u.left+u.right)/2)?l.posBefore:l.posAfter;s=l.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,-1)}function m4(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)),s=o;;){let i=t.childNodes[s];if(i.nodeType==1){let l=i.getClientRects();for(let u=0;u<l.length;u++){let d=l[u];if(vx(e,d))return m4(i,e,d)}}if((s=(s+1)%r)==o)break}return t}function _z(t,e){let n=t.dom.ownerDocument,r,o=0,s=mz(n,e.left,e.top);s&&({node:r,offset:o}=s);let i=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),l;if(!i||!t.dom.contains(i.nodeType!=1?i.parentNode:i)){let d=t.dom.getBoundingClientRect();if(!vx(e,d)||(i=m4(t.dom,e,d),!i))return null}if(Tn)for(let d=i;r&&d;d=al(d))d.draggable&&(r=void 0);if(i=Cz(i,e),r){if(Mr&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let f=r.childNodes[o],p;f.nodeName=="IMG"&&(p=f.getBoundingClientRect()).right<=e.left&&p.bottom>e.top&&o++}let d;Mc&&o&&r.nodeType==1&&(d=r.childNodes[o-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&o--,r==t.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(l=Ez(t,r,o,e))}l==null&&(l=Sz(t,i,e));let u=t.docView.nearestDesc(i,!0);return{pos:l,inside:u?u.posAtStart-u.border:-1}}function F1(t){return t.top<t.bottom||t.left<t.right}function Is(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(F1(r))return r}return Array.prototype.find.call(n,F1)||t.getBoundingClientRect()}const Tz=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function g4(t,e,n){let{node:r,offset:o,atom:s}=t.docView.domFromPos(e,n<0?-1:1),i=Mc||Mr;if(r.nodeType==3)if(i&&(Tz.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let u=Is(Wo(r,o,o),n);if(Mr&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let d=Is(Wo(r,o-1,o-1),-1);if(d.top==u.top){let f=Is(Wo(r,o,o+1),-1);if(f.top!=u.top)return uu(f,f.left<d.left)}}return u}else{let u=o,d=o,f=n<0?1:-1;return n<0&&!o?(d++,f=-1):n>=0&&o==r.nodeValue.length?(u--,f=1):n<0?u--:d++,uu(Is(Wo(r,u,d),f),f<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&o&&(n<0||o==Tr(r))){let u=r.childNodes[o-1];if(u.nodeType==1)return cg(u.getBoundingClientRect(),!1)}if(s==null&&o<Tr(r)){let u=r.childNodes[o];if(u.nodeType==1)return cg(u.getBoundingClientRect(),!0)}return cg(r.getBoundingClientRect(),n>=0)}if(s==null&&o&&(n<0||o==Tr(r))){let u=r.childNodes[o-1],d=u.nodeType==3?Wo(u,Tr(u)-(i?0:1)):u.nodeType==1&&(u.nodeName!="BR"||!u.nextSibling)?u:null;if(d)return uu(Is(d,1),!1)}if(s==null&&o<Tr(r)){let u=r.childNodes[o];for(;u.pmViewDesc&&u.pmViewDesc.ignoreForCoords;)u=u.nextSibling;let d=u?u.nodeType==3?Wo(u,0,i?0:1):u.nodeType==1?u:null:null;if(d)return uu(Is(d,-1),!0)}return uu(Is(r.nodeType==3?Wo(r):r,-n),n>=0)}function uu(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 cg(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 y4(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 Mz(t,e,n){let r=e.selection,o=n=="up"?r.$from:r.$to;return y4(t,e,()=>{let{node:s}=t.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(s,!0);if(!l)break;if(l.node.isBlock){s=l.contentDOM||l.dom;break}s=l.dom.parentNode}let i=g4(t,o.pos,1);for(let l=s.firstChild;l;l=l.nextSibling){let u;if(l.nodeType==1)u=l.getClientRects();else if(l.nodeType==3)u=Wo(l,0,l.nodeValue.length).getClientRects();else continue;for(let d=0;d<u.length;d++){let f=u[d];if(f.bottom>f.top+1&&(n=="up"?i.top-f.top>(f.bottom-i.top)*2:f.bottom-i.bottom>(i.bottom-f.top)*2))return!1}}return!0})}const Az=/[\u0590-\u08ac]/;function Nz(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,s=!o,i=o==r.parent.content.size,l=t.domSelection();return l?!Az.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?s:i:y4(t,e,()=>{let{focusNode:u,focusOffset:d,anchorNode:f,anchorOffset:p}=t.domSelectionRange(),m=l.caretBidiLevel;l.modify("move",n,"character");let y=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:v,focusOffset:b}=t.domSelectionRange(),k=v&&!y.contains(v.nodeType==1?v:v.parentNode)||u==v&&d==b;try{l.collapse(f,p),u&&(u!=f||d!=p)&&l.extend&&l.extend(u,d)}catch{}return m!=null&&(l.caretBidiLevel=m),k}):r.pos==r.start()||r.pos==r.end()}let Pw=null,jw=null,Lw=!1;function Dz(t,e,n){return Pw==e&&jw==n?Lw:(Pw=e,jw=n,Lw=n=="up"||n=="down"?Mz(t,e,n):Nz(t,e,n))}const Ar=0,zw=1,Li=2,Ur=3;class Ac{constructor(e,n,r,o){this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=Ar,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(e){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 s,i;if(e==this.contentDOM)s=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((i=s.pmViewDesc)&&i.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(i)+i.size:this.posAtStart}else{let s,i;if(e==this.contentDOM)s=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((i=s.pmViewDesc)&&i.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(i):this.posAtEnd}let o;if(e==this.dom&&this.contentDOM)o=n>xn(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 s=e;;s=s.parentNode){if(s==this.dom){o=!1;break}if(s.previousSibling)break}if(o==null&&n==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){o=!0;break}if(s.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 s=this.getDesc(o),i;if(s&&(!n||s.node))if(r&&(i=s.nodeDOM)&&!(i.nodeType==1?i.contains(e.nodeType==1?e:e.parentNode):i==e))r=!1;else return s}}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 s=this.getDesc(o);if(s)return s.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let o=this.children[n],s=r+o.size;if(r==e&&s!=r){for(;!o.border&&o.children.length;)for(let i=0;i<o.children.length;i++){let l=o.children[i];if(l.size){o=l;break}}return o}if(e<s)return o.descAt(e-r-o.border);r=s}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,o=0;for(let s=0;r<this.children.length;r++){let i=this.children[r],l=s+i.size;if(l>e||i instanceof v4){o=e-s;break}s=l}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof x4&&s.side>=0;r--);if(n<=0){let s,i=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,i=!1);return s&&n&&i&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?xn(s.dom)+1:0}}else{let s,i=!0;for(;s=r<this.children.length?this.children[r]:null,!(!s||s.dom.parentNode==this.contentDOM);r++,i=!1);return s&&i&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?xn(s.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,s=-1;for(let i=r,l=0;;l++){let u=this.children[l],d=i+u.size;if(o==-1&&e<=d){let f=i+u.border;if(e>=f&&n<=d-u.border&&u.node&&u.contentDOM&&this.contentDOM.contains(u.contentDOM))return u.parseRange(e,n,f);e=i;for(let p=l;p>0;p--){let m=this.children[p-1];if(m.size&&m.dom.parentNode==this.contentDOM&&!m.emptyChildAt(1)){o=xn(m.dom)+1;break}e-=m.size}o==-1&&(o=0)}if(o>-1&&(d>n||l==this.children.length-1)){n=d;for(let f=l+1;f<this.children.length;f++){let p=this.children[f];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(-1)){s=xn(p.dom);break}n+=p.size}s==-1&&(s=this.contentDOM.childNodes.length);break}i=d}return{node:this.contentDOM,from:e,to:n,fromOffset:o,toOffset:s}}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 s=Math.min(e,n),i=Math.max(e,n);for(let y=0,v=0;y<this.children.length;y++){let b=this.children[y],k=v+b.size;if(s>v&&i<k)return b.setSelection(e-v-b.border,n-v-b.border,r,o);v=k}let l=this.domFromPos(e,e?-1:1),u=n==e?l:this.domFromPos(n,n?-1:1),d=r.root.getSelection(),f=r.domSelectionRange(),p=!1;if((Mr||Tn)&&e==n){let{node:y,offset:v}=l;if(y.nodeType==3){if(p=!!(v&&y.nodeValue[v-1]==`
429
- `),p&&v==y.nodeValue.length)for(let b=y,k;b;b=b.parentNode){if(k=b.nextSibling){k.nodeName=="BR"&&(l=u={node:k.parentNode,offset:xn(k)+1});break}let E=b.pmViewDesc;if(E&&E.node&&E.node.isBlock)break}}else{let b=y.childNodes[v-1];p=b&&(b.nodeName=="BR"||b.contentEditable=="false")}}if(Mr&&f.focusNode&&f.focusNode!=u.node&&f.focusNode.nodeType==1){let y=f.focusNode.childNodes[f.focusOffset];y&&y.contentEditable=="false"&&(o=!0)}if(!(o||p&&Tn)&&ra(l.node,l.offset,f.anchorNode,f.anchorOffset)&&ra(u.node,u.offset,f.focusNode,f.focusOffset))return;let m=!1;if((d.extend||e==n)&&!(p&&Mr)){d.collapse(l.node,l.offset);try{e!=n&&d.extend(u.node,u.offset),m=!0}catch{}}if(!m){if(e>n){let v=l;l=u,u=v}let y=document.createRange();y.setEnd(u.node,u.offset),y.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(y)}}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 s=this.children[o],i=r+s.size;if(r==i?e<=i&&n>=r:e<i&&n>r){let l=r+s.border,u=i-s.border;if(e>=l&&n<=u){this.dirty=e==r||n==i?Li:zw,e==l&&n==u&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=Ur:s.markDirty(e-l,n-l);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?Li:Ur}r=i}this.dirty=Li}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Li:zw;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class x4 extends Ac{constructor(e,n,r,o){let s,i=n.type.toDOM;if(typeof i=="function"&&(i=i(r,()=>{if(!s)return o;if(s.parent)return s.parent.posBeforeChild(s)})),!n.type.spec.raw){if(i.nodeType!=1){let l=document.createElement("span");l.appendChild(i),i=l}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(e,[],i,null),this.widget=n,this.widget=n,s=this}matchesWidget(e){return this.dirty==Ar&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class Rz extends Ac{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 Ys extends Ac{constructor(e,n,r,o,s){super(e,[],r,o),this.mark=n,this.spec=s}static create(e,n,r,o){let s=o.nodeViews[n.type.name],i=s&&s(n,o,r);return(!i||!i.dom)&&(i=da.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Ys(e,n,i.dom,i.contentDOM||i.dom,i)}parseRule(){return this.dirty&Ur||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Ur&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Ar){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Ar}}slice(e,n,r){let o=Ys.create(this.parent,this.mark,!0,r),s=this.children,i=this.size;n<i&&(s=B1(s,n,i,r)),e>0&&(s=B1(s,0,e,r));for(let l=0;l<s.length;l++)s[l].parent=o;return o.children=s,o}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Xs extends Ac{constructor(e,n,r,o,s,i,l){super(e,[],s,i),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=l}static create(e,n,r,o,s,i){let l=s.nodeViews[n.type.name],u,d=l&&l(n,s,()=>{if(!u)return i;if(u.parent)return u.parent.posBeforeChild(u)},r,o),f=d&&d.dom,p=d&&d.contentDOM;if(n.isText){if(!f)f=document.createTextNode(n.text);else if(f.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else f||({dom:f,contentDOM:p}=da.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!p&&!n.isText&&f.nodeName!="BR"&&(f.hasAttribute("contenteditable")||(f.contentEditable="false"),n.type.spec.draggable&&(f.draggable=!0));let m=f;return f=w4(f,r,n),d?u=new Oz(e,n,r,o,f,p||null,m,d):n.isText?new Ap(e,n,r,o,f,m):new Xs(e,n,r,o,f,p||null,m)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let n={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(n.preserveWhitespace="full"),!this.contentDOM)n.getContent=()=>this.node.content;else if(!this.contentLost)n.contentElement=this.contentDOM;else{for(let r=this.children.length-1;r>=0;r--){let o=this.children[r];if(this.dom.contains(o.dom.parentNode)){n.contentElement=o.dom.parentNode;break}}if(!n.contentElement){let r=e&&e.find(o=>o.nodeType==1&&e.indexOf(o.parentNode)<0&&this.dom.contains(o));r?n.contentElement=r:n.getContent=()=>re.empty}}return n}matchesNode(e,n,r){return this.dirty==Ar&&e.eq(this.node)&&sh(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,s=e.composing?this.localCompositionInfo(e,n):null,i=s&&s.pos>-1?s:null,l=s&&s.pos<0,u=new Pz(this,i&&i.node,e);zz(this.node,this.innerDeco,(d,f,p)=>{d.spec.marks?u.syncToMarks(d.spec.marks,r,e,f):d.type.side>=0&&!p&&u.syncToMarks(f==this.node.childCount?lt.none:this.node.child(f).marks,r,e,f),u.placeWidget(d,e,o)},(d,f,p,m)=>{u.syncToMarks(d.marks,r,e,m);let y;u.findNodeMatch(d,f,p,m)||l&&e.state.selection.from>o&&e.state.selection.to<o+d.nodeSize&&(y=u.findIndexWithChild(s.node))>-1&&u.updateNodeAt(d,f,p,y,e)||u.updateNextNode(d,f,p,e,m,o)||u.addNode(d,f,p,e,o),o+=d.nodeSize}),u.syncToMarks([],r,e,0),this.node.isTextblock&&u.addTextblockHacks(),u.destroyRest(),(u.changed||this.dirty==Li)&&(i&&this.protectLocalComposition(e,i),b4(this.contentDOM,this.children,e),ll&&Fz(this.dom))}localCompositionInfo(e,n){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof je)||r<n||o>n+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let i=s.nodeValue,l=$z(this.node.content,i,r-n,o-n);return l<0?null:{node:s,pos:l,text:i}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let i=new Rz(this,s,n,o);e.input.compositionNodes.push(i),this.children=B1(this.children,r,r+o.length,e,i)}update(e,n,r,o){return this.dirty==Ur||!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=Ar}updateOuterDeco(e){if(sh(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=k4(this.dom,this.nodeDOM,$1(this.outerDeco,this.node,n),$1(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function Fw(t,e,n,r,o){w4(r,e,t);let s=new Xs(void 0,t,e,n,r,r,r);return s.contentDOM&&s.updateChildren(o,0),s}class Ap extends Xs{constructor(e,n,r,o,s,i){super(e,n,r,o,s,null,i)}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==Ur||this.dirty!=Ar&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Ar||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=Ar,!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),s=document.createTextNode(o.text);return new Ap(this.parent,o,this.outerDeco,this.innerDeco,s,s)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Ur)}get domAtom(){return!1}isText(e){return this.node.text==e}}class v4 extends Ac{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Ar&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class Oz extends Xs{constructor(e,n,r,o,s,i,l,u){super(e,n,r,o,s,i,l),this.spec=u}update(e,n,r,o){if(this.dirty==Ur)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,n,r);return s&&this.updateInner(e,n,r,o),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function b4(t,e,n){let r=t.firstChild,o=!1;for(let s=0;s<e.length;s++){let i=e[s],l=i.dom;if(l.parentNode==t){for(;l!=r;)r=$w(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(l,r);if(i instanceof Ys){let u=r?r.previousSibling:t.lastChild;b4(i.contentDOM,i.children,n),r=u?u.nextSibling:t.firstChild}}for(;r;)r=$w(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}const Su=function(t){t&&(this.nodeName=t)};Su.prototype=Object.create(null);const zi=[new Su];function $1(t,e,n){if(t.length==0)return zi;let r=n?zi[0]:new Su,o=[r];for(let s=0;s<t.length;s++){let i=t[s].type.attrs;if(i){i.nodeName&&o.push(r=new Su(i.nodeName));for(let l in i){let u=i[l];u!=null&&(n&&o.length==1&&o.push(r=new Su(e.isInline?"span":"div")),l=="class"?r.class=(r.class?r.class+" ":"")+u:l=="style"?r.style=(r.style?r.style+";":"")+u:l!="nodeName"&&(r[l]=u))}}}return o}function k4(t,e,n,r){if(n==zi&&r==zi)return e;let o=e;for(let s=0;s<r.length;s++){let i=r[s],l=n[s];if(s){let u;l&&l.nodeName==i.nodeName&&o!=t&&(u=o.parentNode)&&u.nodeName.toLowerCase()==i.nodeName||(u=document.createElement(i.nodeName),u.pmIsDeco=!0,u.appendChild(o),l=zi[0]),o=u}Iz(o,l||zi[0],i)}return o}function Iz(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 s=0;s<r.length;s++)o.indexOf(r[s])==-1&&t.classList.remove(r[s]);for(let s=0;s<o.length;s++)r.indexOf(o[s])==-1&&t.classList.add(o[s]);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 w4(t,e,n){return k4(t,t,zi,$1(e,n,t.nodeType!=1))}function sh(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 $w(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class Pz{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=jz(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r,o){let s=0,i=this.stack.length>>1,l=Math.min(i,e.length);for(;s<l&&(s==i-1?this.top:this.stack[s+1<<1]).matchesMark(e[s])&&e[s].type.spec.spanning!==!1;)s++;for(;s<i;)this.destroyRest(),this.top.dirty=Ar,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let u=-1,d=this.top.children.length;o<this.preMatch.index&&(d=Math.min(this.index+3,d));for(let f=this.index;f<d;f++){let p=this.top.children[f];if(p.matchesMark(e[i])&&!this.isLocked(p.dom)){u=f;break}}if(u<0&&this.index<this.top.children.length){let f=this.top.children[this.index];f instanceof Ys&&f.dirty!=Ur&&f.mark.type==e[i].type&&f.spec.update&&!this.isLocked(f.dom)&&f.spec.update(e[i])&&(f.mark=e[i],u=this.index,this.changed=!0)}if(u>-1)u>this.index&&(this.changed=!0,this.destroyBetween(this.index,u)),this.top=this.top.children[this.index];else{let f=Ys.create(this.top,e[i],n,r);this.top.children.splice(this.index,0,f),this.top=f,this.changed=!0}this.index=0,i++}}findNodeMatch(e,n,r,o){let s=-1,i;if(o>=this.preMatch.index&&(i=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&i.matchesNode(e,n,r))s=this.top.children.indexOf(i,this.index);else for(let l=this.index,u=Math.min(this.top.children.length,l+5);l<u;l++){let d=this.top.children[l];if(d.matchesNode(e,n,r)&&!this.preMatch.matched.has(d)){s=l;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,n,r,o,s){let i=this.top.children[o];return i.dirty==Ur&&i.dom==i.contentDOM&&(i.dirty=Li),i.update(e,n,r,s)?(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,s,i){for(let l=this.index;l<this.top.children.length;l++){let u=this.top.children[l];if(u instanceof Xs){let d=this.preMatch.matched.get(u);if(d!=null&&d!=s)return!1;let f=u.dom,p,m=this.isLocked(f)&&!(e.isText&&u.node&&u.node.isText&&u.nodeDOM.nodeValue==e.text&&u.dirty!=Ur&&sh(n,u.outerDeco));if(!m&&u.update(e,n,r,o))return this.destroyBetween(this.index,l),u.dom!=f&&(this.changed=!0),this.index++,!0;if(!m&&(p=this.recreateWrapper(u,e,n,r,o,i)))return this.destroyBetween(this.index,l),this.top.children[this.index]=p,p.contentDOM&&(p.dirty=Li,p.updateChildren(o,i+1),p.dirty=Ar),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,o,s,i){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!sh(r,e.outerDeco)||!o.eq(e.innerDeco))return null;let l=Xs.create(this.top,n,r,o,s,i);if(l.contentDOM){l.children=e.children,e.children=[];for(let u of l.children)u.parent=l}return e.destroy(),l}addNode(e,n,r,o,s){let i=Xs.create(this.top,e,n,r,o,s);i.contentDOM&&i.updateChildren(o,s+1),this.top.children.splice(this.index++,0,i),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 s=new x4(this.top,e,n,r);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof Ys;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Ap)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Tn||bn)&&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 v4(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 jz(t,e){let n=e,r=n.children.length,o=t.childCount,s=new Map,i=[];e:for(;o>0;){let l;for(;;)if(r){let d=n.children[r-1];if(d instanceof Ys)n=d,r=d.children.length;else{l=d,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let u=l.node;if(u){if(u!=t.child(o-1))break;--o,s.set(l,o),i.push(l)}}return{index:o,matched:s,matches:i.reverse()}}function Lz(t,e){return t.type.side-e.type.side}function zz(t,e,n,r){let o=e.locals(t),s=0;if(o.length==0){for(let d=0;d<t.childCount;d++){let f=t.child(d);r(f,o,e.forChild(s,f),d),s+=f.nodeSize}return}let i=0,l=[],u=null;for(let d=0;;){let f,p;for(;i<o.length&&o[i].to==s;){let k=o[i++];k.widget&&(f?(p||(p=[f])).push(k):f=k)}if(f)if(p){p.sort(Lz);for(let k=0;k<p.length;k++)n(p[k],d,!!u)}else n(f,d,!!u);let m,y;if(u)y=-1,m=u,u=null;else if(d<t.childCount)y=d,m=t.child(d++);else break;for(let k=0;k<l.length;k++)l[k].to<=s&&l.splice(k--,1);for(;i<o.length&&o[i].from<=s&&o[i].to>s;)l.push(o[i++]);let v=s+m.nodeSize;if(m.isText){let k=v;i<o.length&&o[i].from<k&&(k=o[i].from);for(let E=0;E<l.length;E++)l[E].to<k&&(k=l[E].to);k<v&&(u=m.cut(k-s),m=m.cut(0,k-s),v=k,y=-1)}else for(;i<o.length&&o[i].to<v;)i++;let b=m.isInline&&!m.isLeaf?l.filter(k=>!k.inline):l.slice();r(m,b,e.forChild(s,m),y),s=v}}function Fz(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 $z(t,e,n,r){for(let o=0,s=0;o<t.childCount&&s<=r;){let i=t.child(o++),l=s;if(s+=i.nodeSize,!i.isText)continue;let u=i.text;for(;o<t.childCount;){let d=t.child(o++);if(s+=d.nodeSize,!d.isText)break;u+=d.text}if(s>=n){if(s>=r&&u.slice(r-e.length-l,r-l)==e)return r-e.length;let d=l<r?u.lastIndexOf(e,r-l-1):-1;if(d>=0&&d+e.length+l>=n)return l+d;if(n==r&&u.length>=r+e.length-l&&u.slice(r-l,r-l+e.length)==e)return r}}return-1}function B1(t,e,n,r,o){let s=[];for(let i=0,l=0;i<t.length;i++){let u=t[i],d=l,f=l+=u.size;d>=n||f<=e?s.push(u):(d<e&&s.push(u.slice(0,e-d,r)),o&&(s.push(o),o=void 0),f>n&&s.push(u.slice(n-d,u.size,r)))}return s}function bx(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),s=o&&o.size==0,i=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(i<0)return null;let l=r.resolve(i),u,d;if(Mp(n)){for(u=i;o&&!o.node;)o=o.parent;let p=o.node;if(o&&p.isAtom&&Oe.isSelectable(p)&&o.parent&&!(p.isInline&&hz(n.focusNode,n.focusOffset,o.dom))){let m=o.posBefore;d=new Oe(i==m?l:r.resolve(m))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let p=i,m=i;for(let y=0;y<n.rangeCount;y++){let v=n.getRangeAt(y);p=Math.min(p,t.docView.posFromDOM(v.startContainer,v.startOffset,1)),m=Math.max(m,t.docView.posFromDOM(v.endContainer,v.endOffset,-1))}if(p<0)return null;[u,i]=m==t.state.selection.anchor?[m,p]:[p,m],l=r.resolve(i)}else u=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(u<0)return null}let f=r.resolve(u);if(!d){let p=e=="pointer"||t.state.selection.head<l.pos&&!s?1:-1;d=kx(t,f,l,p)}return d}function C4(t){return t.editable?t.hasFocus():E4(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function es(t,e=!1){let n=t.state.selection;if(S4(t,n),!C4(t))return;let r=t.input.mouseDown;if(!e&&bn&&r){let o=t.domSelectionRange(),s=t.domObserver.currentSelection;if(o.anchorNode&&s.anchorNode&&ra(o.anchorNode,o.anchorOffset,s.anchorNode,s.anchorOffset)&&r.delaySelUpdate()){t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)Vz(t);else{let{anchor:o,head:s}=n,i,l;Bw&&!(n instanceof je)&&(n.$from.parent.inlineContent||(i=Vw(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(l=Vw(t,n.to))),t.docView.setSelection(o,s,t,e),Bw&&(i&&Hw(i),l&&Hw(l)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Bz(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}const Bw=Tn||bn&&c4<63;function Vw(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(Tn&&o&&o.contentEditable=="false")return dg(o);if((!o||o.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(o)return dg(o);if(s)return dg(s)}}function dg(t){return t.contentEditable="true",Tn&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Hw(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Bz(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(()=>{(!C4(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function Vz(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,xn(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&Xn&&Zs<=11&&(n.disabled=!0,n.disabled=!1)}function S4(t,e){if(e instanceof Oe){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Uw(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Uw(t)}function Uw(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function kx(t,e,n,r){return t.someProp("createSelectionBetween",o=>o(t,e,n))||je.between(e,n,r)}function Ww(t){return t.editable&&!t.hasFocus()?!1:E4(t)}function E4(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 Hz(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return ra(e.node,e.offset,n.anchorNode,n.anchorOffset)}function V1(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),s=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return s&&He.findFrom(s,e)}function js(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function qw(t,e,n){let r=t.state.selection;if(r instanceof je)if(n.indexOf("s")>-1){let{$head:o}=r,s=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let i=t.state.doc.resolve(o.pos+s.nodeSize*(e<0?-1:1));return js(t,new je(r.$anchor,i))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let o=V1(t.state,e);return o&&o instanceof Oe?js(t,o):!1}else if(!(Sr&&n.indexOf("m")>-1)){let o=r.$head,s=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter,i;if(!s||s.isText)return!1;let l=e<0?o.pos-s.nodeSize:o.pos;return s.isAtom||(i=t.docView.descAt(l))&&!i.contentDOM?Oe.isSelectable(s)?js(t,new Oe(e<0?t.state.doc.resolve(o.pos-s.nodeSize):o)):Mc?js(t,new je(t.state.doc.resolve(e<0?l:l+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Oe&&r.node.isInline)return js(t,new je(e>0?r.$to:r.$from));{let o=V1(t.state,e);return o?js(t,o):!1}}}function ih(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Eu(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Va(t,e){return e<0?Uz(t):Wz(t)}function Uz(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,s,i=!1;for(Mr&&n.nodeType==1&&r<ih(n)&&Eu(n.childNodes[r],-1)&&(i=!0);;)if(r>0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(Eu(l,-1))o=n,s=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(_4(n))break;{let l=n.previousSibling;for(;l&&Eu(l,-1);)o=n.parentNode,s=xn(l),l=l.previousSibling;if(l)n=l,r=ih(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}i?H1(t,n,r):o&&H1(t,o,s)}function Wz(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o=ih(n),s,i;for(;;)if(r<o){if(n.nodeType!=1)break;let l=n.childNodes[r];if(Eu(l,1))s=n,i=++r;else break}else{if(_4(n))break;{let l=n.nextSibling;for(;l&&Eu(l,1);)s=l.parentNode,i=xn(l)+1,l=l.nextSibling;if(l)n=l,r=0,o=ih(n);else{if(n=n.parentNode,n==t.dom)break;r=o=0}}}s&&H1(t,s,i)}function _4(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function qz(t,e){for(;t&&e==t.childNodes.length&&!Tc(t);)e=xn(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 Kz(t,e){for(;t&&!e&&!Tc(t);)e=xn(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 H1(t,e,n){if(e.nodeType!=3){let s,i;(i=qz(e,n))?(e=i,n=0):(s=Kz(e,n))&&(e=s,n=s.nodeValue.length)}let r=t.domSelection();if(!r)return;if(Mp(r)){let s=document.createRange();s.setEnd(e,n),s.setStart(e,n),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:o}=t;setTimeout(()=>{t.state==o&&es(t)},50)}function Kw(t,e){let n=t.state.doc.resolve(e);if(!(bn||d4)&&n.parent.inlineContent){let o=t.coordsAtPos(e);if(e>n.start()){let s=t.coordsAtPos(e-1),i=(s.top+s.bottom)/2;if(i>o.top&&i<o.bottom&&Math.abs(s.left-o.left)>1)return s.left<o.left?"ltr":"rtl"}if(e<n.end()){let s=t.coordsAtPos(e+1),i=(s.top+s.bottom)/2;if(i>o.top&&i<o.bottom&&Math.abs(s.left-o.left)>1)return s.left>o.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function Gw(t,e,n){let r=t.state.selection;if(r instanceof je&&!r.empty||n.indexOf("s")>-1||Sr&&n.indexOf("m")>-1)return!1;let{$from:o,$to:s}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let i=V1(t.state,e);if(i&&i instanceof Oe)return js(t,i)}if(!o.parent.inlineContent){let i=e<0?o:s,l=r instanceof lr?He.near(i,e):He.findFrom(i,e);return l?js(t,l):!1}return!1}function Jw(t,e){if(!(t.state.selection instanceof je))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 s=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let i=t.state.tr;return e<0?i.delete(n.pos-s.nodeSize,n.pos):i.delete(n.pos,n.pos+s.nodeSize),t.dispatch(i),!0}return!1}function Zw(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Gz(t){if(!Tn||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;Zw(t,r,"true"),setTimeout(()=>Zw(t,r,"false"),20)}return!1}function Jz(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function Zz(t,e){let n=e.keyCode,r=Jz(e);if(n==8||Sr&&n==72&&r=="c")return Jw(t,-1)||Va(t,-1);if(n==46&&!e.shiftKey||Sr&&n==68&&r=="c")return Jw(t,1)||Va(t,1);if(n==13||n==27)return!0;if(n==37||Sr&&n==66&&r=="c"){let o=n==37?Kw(t,t.state.selection.from)=="ltr"?-1:1:-1;return qw(t,o,r)||Va(t,o)}else if(n==39||Sr&&n==70&&r=="c"){let o=n==39?Kw(t,t.state.selection.from)=="ltr"?1:-1:1;return qw(t,o,r)||Va(t,o)}else{if(n==38||Sr&&n==80&&r=="c")return Gw(t,-1,r)||Va(t,-1);if(n==40||Sr&&n==78&&r=="c")return Gz(t)||Gw(t,1,r)||Va(t,1);if(r==(Sr?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function wx(t,e){t.someProp("transformCopied",y=>{e=y(e,t)});let n=[],{content:r,openStart:o,openEnd:s}=e;for(;o>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,s--;let y=r.firstChild;n.push(y.type.name,y.attrs!=y.type.defaultAttrs?y.attrs:null),r=y.content}let i=t.someProp("clipboardSerializer")||da.fromSchema(t.state.schema),l=R4(),u=l.createElement("div");u.appendChild(i.serializeFragment(r,{document:l}));let d=u.firstChild,f,p=0;for(;d&&d.nodeType==1&&(f=D4[d.nodeName.toLowerCase()]);){for(let y=f.length-1;y>=0;y--){let v=l.createElement(f[y]);for(;u.firstChild;)v.appendChild(u.firstChild);u.appendChild(v),p++}d=u.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${o} ${s}${p?` -${p}`:""} ${JSON.stringify(n)}`);let m=t.someProp("clipboardTextSerializer",y=>y(e,t))||e.content.textBetween(0,e.content.size,`
430
-
431
- `);return{dom:u,text:m,slice:e}}function T4(t,e,n,r,o){let s=o.parent.type.spec.code,i,l;if(!n&&!e)return null;let u=!!e&&(r||s||!n);if(u){if(t.someProp("transformPastedText",m=>{e=m(e,s||r,t)}),s)return l=new ye(re.from(t.state.schema.text(e.replace(/\r\n?/g,`
432
- `))),0,0),t.someProp("transformPasted",m=>{l=m(l,t,!0)}),l;let p=t.someProp("clipboardTextParser",m=>m(e,o,r,t));if(p)l=p;else{let m=o.marks(),{schema:y}=t.state,v=da.fromSchema(y);i=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(b=>{let k=i.appendChild(document.createElement("p"));b&&k.appendChild(v.serializeNode(y.text(b,m)))})}}else t.someProp("transformPastedHTML",p=>{n=p(n,t)}),i=eF(n),Mc&&tF(i);let d=i&&i.querySelector("[data-pm-slice]"),f=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(f&&f[3])for(let p=+f[3];p>0;p--){let m=i.firstChild;for(;m&&m.nodeType!=1;)m=m.nextSibling;if(!m)break;i=m}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||Xo.fromSchema(t.state.schema)).parseSlice(i,{preserveWhitespace:!!(u||f),context:o,ruleFromNode(m){return m.nodeName=="BR"&&!m.nextSibling&&m.parentNode&&!Yz.test(m.parentNode.nodeName)?{ignore:!0}:null}})),f)l=nF(Yw(l,+f[1],+f[2]),f[4]);else if(l=ye.maxOpen(Xz(l.content,o),!0),l.openStart||l.openEnd){let p=0,m=0;for(let y=l.content.firstChild;p<l.openStart&&!y.type.spec.isolating;p++,y=y.firstChild);for(let y=l.content.lastChild;m<l.openEnd&&!y.type.spec.isolating;m++,y=y.lastChild);l=Yw(l,p,m)}return t.someProp("transformPasted",p=>{l=p(l,t,u)}),l}const Yz=/^(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 Xz(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)),s,i=[];if(t.forEach(l=>{if(!i)return;let u=o.findWrapping(l.type),d;if(!u)return i=null;if(d=i.length&&s.length&&A4(u,s,l,i[i.length-1],0))i[i.length-1]=d;else{i.length&&(i[i.length-1]=N4(i[i.length-1],s.length));let f=M4(l,u);i.push(f),o=o.matchType(f.type),s=u}}),i)return re.from(i)}return t}function M4(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,re.from(t));return t}function A4(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let s=A4(t,e,n,r.lastChild,o+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(re.from(M4(n,t,o+1))))}}function N4(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,N4(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(re.empty,!0);return t.copy(n.append(r))}function U1(t,e,n,r,o,s){let i=e<0?t.firstChild:t.lastChild,l=i.content;return t.childCount>1&&(s=0),o<r-1&&(l=U1(l,e,n,r,o+1,s)),o>=n&&(l=e<0?i.contentMatchAt(0).fillBefore(l,s<=o).append(l):l.append(i.contentMatchAt(i.childCount).fillBefore(re.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,i.copy(l))}function Yw(t,e,n){return e<t.openStart&&(t=new ye(U1(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new ye(U1(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const D4={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function R4(){return document.implementation.createHTMLDocument("title")}let fg=null;function Qz(t){let e=window.trustedTypes;return e?(fg||(fg=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),fg.createHTML(t)):t}function eF(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=R4(),r=n.body,o=/<([a-z][^>\s]+)/i.exec(t),s;if((s=o&&D4[o[1].toLowerCase()])&&(t=s.map(i=>"<"+i+">").join("")+t+s.map(i=>"</"+i+">").reverse().join("")),r.innerHTML=Qz(t),s)for(let i=0;i<s.length;i++)r=r.querySelector(s[i])||r;for(let i=0;i<n.styleSheets.length;i++){let l=n.styleSheets[i];for(let u=0;u<l.rules.length;u++){let d=l.rules[u];if(d instanceof CSSStyleRule){let f=r.querySelectorAll(d.selectorText);for(let p=0;p<f.length;p++)f[p].style.cssText+=d.style.cssText}}}return r}function tF(t){let e=t.querySelectorAll(bn?"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 nF(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:s,openEnd:i}=t;for(let l=r.length-2;l>=0;l-=2){let u=n.nodes[r[l]];if(!u||u.hasRequiredAttrs())break;o=re.from(u.create(r[l+1],o)),s++,i++}return new ye(o,s,i)}const Pn={},jn={},rF={touchstart:!0,touchmove:!0};class oF{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function sF(t){for(let e in Pn){let n=Pn[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{aF(t,r)&&!Cx(t,r)&&(t.editable||!(r.type in jn))&&n(t,r)},rF[e]?{passive:!0}:void 0)}Tn&&t.dom.addEventListener("input",()=>null),W1(t)}function Go(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function iF(t){t.input.mouseDown&&t.input.mouseDown.done(),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 W1(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Cx(t,r))})}function Cx(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function aF(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 lF(t,e){!Cx(t,e)&&Pn[e.type]&&(t.editable||!(e.type in jn))&&Pn[e.type](t,e)}jn.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!j4(t)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Ko&&bn&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),ll&&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,Pi(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||Zz(t,n)?n.preventDefault():Go(t,"key")};jn.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};jn.keypress=(t,e)=>{let n=e;if(j4(t)||!n.charCode||n.ctrlKey&&!n.altKey||Sr&&n.metaKey)return;if(t.someProp("handleKeyPress",o=>o(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof je)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode),s=()=>t.state.tr.insertText(o).scrollIntoView();!/[\r\n]/.test(o)&&!t.someProp("handleTextInput",i=>i(t,r.$from.pos,r.$to.pos,o,s))&&t.dispatch(s()),n.preventDefault()}};function Nc(t){return{left:t.clientX,top:t.clientY}}function uF(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Sx(t,e,n,r,o){if(r==-1)return!1;let s=t.state.doc.resolve(r);for(let i=s.depth+1;i>0;i--)if(t.someProp(e,l=>i>s.depth?l(t,n,s.nodeAfter,s.before(i),o,!0):l(t,n,s.node(i),s.before(i),o,!1)))return!0;return!1}function Dc(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function cF(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&Oe.isSelectable(r)?(Dc(t,new Oe(n)),!0):!1}function dF(t,e){if(e==-1)return!1;let n=t.state.selection,r,o;n instanceof Oe&&(r=n.node);let s=t.state.doc.resolve(e);for(let i=s.depth+1;i>0;i--){let l=i>s.depth?s.nodeAfter:s.node(i);if(Oe.isSelectable(l)){r&&n.$from.depth>0&&i>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?o=s.before(n.$from.depth):o=s.before(i);break}}return o!=null?(Dc(t,Oe.create(t.state.doc,o)),!0):!1}function fF(t,e,n,r,o){return Sx(t,"handleClickOn",e,n,r)||t.someProp("handleClick",s=>s(t,e,r))||(o?dF(t,n):cF(t,n))}function hF(t,e,n,r){return Sx(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",o=>o(t,e,r))}function pF(t,e,n,r){return Sx(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",o=>o(t,e,r))||mF(t,n,r)}function mF(t,e,n){if(n.button!=0)return!1;let r=O4(t,e,!0),o=t.state.doc;return r?(Dc(t,r),r instanceof je&&o.eq(t.state.doc)&&(t.input.mouseDown=new yF(t,r)),!0):!1}function O4(t,e,n){let r=t.state.doc;if(e==-1)return r.inlineContent?je.create(r,0,r.content.size):null;let o=r.resolve(e);for(let s=o.depth+1;s>0;s--){let i=s>o.depth?o.nodeAfter:o.node(s),l=o.before(s);if(i.inlineContent)return je.create(r,l+1,l+1+i.content.size);if(n&&Oe.isSelectable(i))return Oe.create(r,l)}return null}function Ex(t){return ah(t)}const I4=Sr?"metaKey":"ctrlKey";Pn.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Ex(t),o=Date.now(),s="singleClick";o-t.input.lastClick.time<500&&uF(n,t.input.lastClick)&&!n[I4]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?s="doubleClick":t.input.lastClick.type=="doubleClick"&&(s="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:s,button:n.button},t.input.mouseDown&&t.input.mouseDown.done();let i=t.posAtCoords(Nc(n));i&&(s=="singleClick"?t.input.mouseDown=new gF(t,i,n,!!r):(s=="doubleClick"?hF:pF)(t,i.pos,i.inside,n)?n.preventDefault():Go(t,"pointer"))};class P4{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class gF extends P4{constructor(e,n,r,o){super(e),this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!r[I4],this.allowDefault=r.shiftKey;let s,i;if(n.inside>-1)s=e.state.doc.nodeAt(n.inside),i=n.inside;else{let f=e.state.doc.resolve(n.pos);s=f.parent,i=f.depth?f.before():0}const l=o?null:r.target,u=l?e.docView.nearestDesc(l,!0):null;this.target=u&&u.nodeDOM.nodeType==1?u.nodeDOM:null;let{selection:d}=e.state;r.button==0&&(s.type.spec.draggable&&s.type.spec.selectable!==!1||d instanceof Oe&&d.from<=i&&d.to>i)&&(this.mightDrag={node:s,pos:i,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Mr&&!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()),Go(e,"pointer")}done(){super.done(),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(()=>{this.view.isDestroyed||es(this.view)})}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(Nc(e))),this.updateAllowDefault(e),this.allowDefault||!n?Go(this.view,"pointer"):fF(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Tn&&this.mightDrag&&!this.mightDrag.node.isAtom||bn&&!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)?(Dc(this.view,He.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Go(this.view,"pointer")}move(e){this.updateAllowDefault(e),Go(this.view,"pointer"),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class yF extends P4{constructor(e,n){super(e),this.startSelection=n,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),Go(this.view,"pointer");let n=this.view.posAtCoords(Nc(e)),r=n&&O4(this.view,n.inside,!1);if(!r)return;let{doc:o}=this.view.state,s=this.startSelection,[i,l]=r.from<s.from?[s.to,r.from]:[s.from,r.to];Dc(this.view,je.create(o,i,l))}}Pn.touchstart=t=>{t.input.lastTouch=Date.now(),Ex(t),Go(t,"pointer")};Pn.touchmove=t=>{t.input.lastTouch=Date.now(),Go(t,"pointer")};Pn.contextmenu=t=>Ex(t);function j4(t,e){return t.composing?!0:Tn&&Math.abs(Date.now()-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const xF=Ko?5e3:-1;jn.compositionstart=jn.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof je&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||bn&&d4&&vF(t)))t.markCursor=t.state.storedMarks||n.marks(),ah(t,!0),t.markCursor=null;else if(ah(t,!e.selection.empty),Mr&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let o=r.focusNode,s=r.focusOffset;o&&o.nodeType==1&&s!=0;){let i=s<0?o.lastChild:o.childNodes[s-1];if(!i)break;if(i.nodeType==3){let l=t.domSelection();l&&l.collapse(i,i.nodeValue.length);break}else o=i,s=-1}}t.input.composing=!0}L4(t,xF)};function vF(t){let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(!e||e.nodeType!=1||n>=e.childNodes.length)return!1;let r=e.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}jn.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now(),t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,L4(t,20))};function L4(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>ah(t),e))}function z4(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function bF(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=dz(e.focusNode,e.focusOffset),r=fz(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let o=r.pmViewDesc,s=t.domObserver.lastChangedTextNode;if(n==s||r==s)return s;if(!o||!o.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let i=n.pmViewDesc;if(!(!i||!i.isText(n.nodeValue)))return r}}return n||r}function ah(t,e=!1){if(!(Ko&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),z4(t),e||t.docView&&t.docView.dirty){let n=bx(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function kF(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 tc=Xn&&Zs<15||ll&&gz<604;Pn.copy=jn.cut=(t,e)=>{let n=e,r=t.state.selection,o=n.type=="cut";if(r.empty)return;let s=tc?null:n.clipboardData,i=r.content(),{dom:l,text:u}=wx(t,i);s?(n.preventDefault(),s.clearData(),s.setData("text/html",l.innerHTML),s.setData("text/plain",u)):kF(t,l),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function wF(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function CF(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?nc(t,r.value,null,o,e):nc(t,r.textContent,r.innerHTML,o,e)},50)}function nc(t,e,n,r,o){let s=T4(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",u=>u(t,o,s||ye.empty)))return!0;if(!s)return!1;let i=wF(s),l=i?t.state.tr.replaceSelectionWith(i,r):t.state.tr.replaceSelection(s);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function F4(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," "):""}jn.paste=(t,e)=>{let n=e;if(t.composing&&!Ko)return;let r=tc?null:n.clipboardData,o=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&nc(t,F4(r),r.getData("text/html"),o,n)?n.preventDefault():CF(t,n)};class $4{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const SF=Sr?"altKey":"ctrlKey";function B4(t,e){let n;return t.someProp("dragCopies",r=>{n=n||r(e)}),n!=null?!n:!e[SF]}Pn.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,s=o.empty?null:t.posAtCoords(Nc(n)),i;if(!(s&&s.pos>=o.from&&s.pos<=(o instanceof Oe?o.to-1:o.to))){if(r&&r.mightDrag)i=Oe.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let p=t.docView.nearestDesc(n.target,!0);p&&p.node.type.spec.draggable&&p!=t.docView&&(i=Oe.create(t.state.doc,p.posBefore))}}let l=(i||t.state.selection).content(),{dom:u,text:d,slice:f}=wx(t,l);(!n.dataTransfer.files.length||!bn||c4>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(tc?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",tc||n.dataTransfer.setData("text/plain",d),t.dragging=new $4(f,B4(t,n),i)};Pn.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};jn.dragover=jn.dragenter=(t,e)=>e.preventDefault();jn.drop=(t,e)=>{try{EF(t,e,t.dragging)}finally{t.dragging=null}};function EF(t,e,n){if(!e.dataTransfer)return;let r=t.posAtCoords(Nc(e));if(!r)return;let o=t.state.doc.resolve(r.pos),s=n&&n.slice;s?t.someProp("transformPasted",y=>{s=y(s,t,!1)}):s=T4(t,F4(e.dataTransfer),tc?null:e.dataTransfer.getData("text/html"),!1,o);let i=!!(n&&B4(t,e));if(t.someProp("handleDrop",y=>y(t,e,s||ye.empty,i))){e.preventDefault();return}if(!s)return;e.preventDefault();let l=s?V_(t.state.doc,o.pos,s):o.pos;l==null&&(l=o.pos);let u=t.state.tr;if(i){let{node:y}=n;y?y.replace(u):u.deleteSelection()}let d=u.mapping.map(l),f=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,p=u.doc;if(f?u.replaceRangeWith(d,d,s.content.firstChild):u.replaceRange(d,d,s),u.doc.eq(p))return;let m=u.doc.resolve(d);if(f&&Oe.isSelectable(s.content.firstChild)&&m.nodeAfter&&m.nodeAfter.sameMarkup(s.content.firstChild))u.setSelection(new Oe(m));else{let y=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach((v,b,k,E)=>y=E),u.setSelection(kx(t,m,u.doc.resolve(y)))}t.focus(),t.dispatch(u.setMeta("uiEvent","drop"))}Pn.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())&&es(t)},20))};Pn.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)};Pn.beforeinput=(t,e)=>{if(Ko&&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",s=>s(t,Pi(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 jn)Pn[t]=jn[t];function rc(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 lh{constructor(e,n){this.toDOM=e,this.spec=n||Ui,this.side=this.spec.side||0}map(e,n,r,o){let{pos:s,deleted:i}=e.mapResult(n.from+o,this.side<0?-1:1);return i?null:new In(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof lh&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&rc(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Qs{constructor(e,n){this.attrs=e,this.spec=n||Ui}map(e,n,r,o){let s=e.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,i=e.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return s>=i?null:new In(s,i,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Qs&&rc(this.attrs,e.attrs)&&rc(this.spec,e.spec)}static is(e){return e.type instanceof Qs}destroy(){}}class _x{constructor(e,n){this.attrs=e,this.spec=n||Ui}map(e,n,r,o){let s=e.mapResult(n.from+o,1);if(s.deleted)return null;let i=e.mapResult(n.to+o,-1);return i.deleted||i.pos<=s.pos?null:new In(s.pos-r,i.pos-r,this)}valid(e,n){let{index:r,offset:o}=e.content.findIndex(n.from),s;return o==n.from&&!(s=e.child(r)).isText&&o+s.nodeSize==n.to}eq(e){return this==e||e instanceof _x&&rc(this.attrs,e.attrs)&&rc(this.spec,e.spec)}destroy(){}}class In{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new In(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 In(e,e,new lh(n,r))}static inline(e,n,r,o){return new In(e,n,new Qs(r,o))}static node(e,n,r,o){return new In(e,n,new _x(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof Qs}get widget(){return this.type instanceof lh}}const qa=[],Ui={};class yt{constructor(e,n){this.local=e.length?e:qa,this.children=n.length?n:qa}static create(e,n){return n.length?uh(n,e,0,Ui):_n}find(e,n,r){let o=[];return this.findInner(e??0,n??1e9,o,0,r),o}findInner(e,n,r,o,s){for(let i=0;i<this.local.length;i++){let l=this.local[i];l.from<=n&&l.to>=e&&(!s||s(l.spec))&&r.push(l.copy(l.from+o,l.to+o))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<n&&this.children[i+1]>e){let l=this.children[i]+1;this.children[i+2].findInner(e-l,n-l,r,o+l,s)}}map(e,n,r){return this==_n||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Ui)}mapInner(e,n,r,o,s){let i;for(let l=0;l<this.local.length;l++){let u=this.local[l].map(e,r,o);u&&u.type.valid(n,u)?(i||(i=[])).push(u):s.onRemove&&s.onRemove(this.local[l].spec)}return this.children.length?_F(this.children,i||[],e,n,r,o,s):i?new yt(i.sort(Wi),qa):_n}add(e,n){return n.length?this==_n?yt.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let o,s=0;e.forEach((l,u)=>{let d=u+r,f;if(f=H4(n,l,d)){for(o||(o=this.children.slice());s<o.length&&o[s]<u;)s+=3;o[s]==u?o[s+2]=o[s+2].addInner(l,f,d+1):o.splice(s,0,u,u+l.nodeSize,uh(f,l,d+1,Ui)),s+=3}});let i=V4(s?U4(n):n,-r);for(let l=0;l<i.length;l++)i[l].type.valid(e,i[l])||i.splice(l--,1);return new yt(i.length?this.local.concat(i).sort(Wi):this.local,o||this.children)}remove(e){return e.length==0||this==_n?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,o=this.local;for(let s=0;s<r.length;s+=3){let i,l=r[s]+n,u=r[s+1]+n;for(let f=0,p;f<e.length;f++)(p=e[f])&&p.from>l&&p.to<u&&(e[f]=null,(i||(i=[])).push(p));if(!i)continue;r==this.children&&(r=this.children.slice());let d=r[s+2].removeInner(i,l+1);d!=_n?r[s+2]=d:(r.splice(s,3),s-=3)}if(o.length){for(let s=0,i;s<e.length;s++)if(i=e[s])for(let l=0;l<o.length;l++)o[l].eq(i,n)&&(o==this.local&&(o=this.local.slice()),o.splice(l--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new yt(o,r):_n}forChild(e,n){if(this==_n)return this;if(n.isLeaf)return yt.empty;let r,o;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(r=this.children[l+2]);break}let s=e+1,i=s+n.content.size;for(let l=0;l<this.local.length;l++){let u=this.local[l];if(u.from<i&&u.to>s&&u.type instanceof Qs){let d=Math.max(s,u.from)-s,f=Math.min(i,u.to)-s;d<f&&(o||(o=[])).push(u.copy(d,f))}}if(o){let l=new yt(o.sort(Wi),qa);return r?new Vs([l,r]):l}return r||_n}eq(e){if(this==e)return!0;if(!(e instanceof yt)||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 Tx(this.localsInner(e))}localsInner(e){if(this==_n)return qa;if(e.inlineContent||!this.local.some(Qs.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Qs||n.push(this.local[r]);return n}forEachSet(e){e(this)}}yt.empty=new yt([],[]);yt.removeOverlap=Tx;const _n=yt.empty;class Vs{constructor(e){this.members=e}map(e,n){const r=this.members.map(o=>o.map(e,n,Ui));return Vs.from(r)}forChild(e,n){if(n.isLeaf)return yt.empty;let r=[];for(let o=0;o<this.members.length;o++){let s=this.members[o].forChild(e,n);s!=_n&&(s instanceof Vs?r=r.concat(s.members):r.push(s))}return Vs.from(r)}eq(e){if(!(e instanceof Vs)||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 s=this.members[o].localsInner(e);if(s.length)if(!n)n=s;else{r&&(n=n.slice(),r=!1);for(let i=0;i<s.length;i++)n.push(s[i])}}return n?Tx(r?n:n.sort(Wi)):qa}static from(e){switch(e.length){case 0:return _n;case 1:return e[0];default:return new Vs(e.every(n=>n instanceof yt)?e:e.reduce((n,r)=>n.concat(r instanceof yt?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function _F(t,e,n,r,o,s,i){let l=t.slice();for(let d=0,f=s;d<n.maps.length;d++){let p=0;n.maps[d].forEach((m,y,v,b)=>{let k=b-v-(y-m);for(let E=0;E<l.length;E+=3){let _=l[E+1];if(_<0||m>_+f-p)continue;let T=l[E]+f-p;y>=T?l[E+1]=m<=T?-2:-1:m>=f&&k&&(l[E]+=k,l[E+1]+=k)}p+=k}),f=n.maps[d].map(f,-1)}let u=!1;for(let d=0;d<l.length;d+=3)if(l[d+1]<0){if(l[d+1]==-2){u=!0,l[d+1]=-1;continue}let f=n.map(t[d]+s),p=f-o;if(p<0||p>=r.content.size){u=!0;continue}let m=n.map(t[d+1]+s,-1),y=m-o,{index:v,offset:b}=r.content.findIndex(p),k=r.maybeChild(v);if(k&&b==p&&b+k.nodeSize==y){let E=l[d+2].mapInner(n,k,f+1,t[d]+s+1,i);E!=_n?(l[d]=p,l[d+1]=y,l[d+2]=E):(l[d+1]=-2,u=!0)}else u=!0}if(u){let d=TF(l,t,e,n,o,s,i),f=uh(d,r,0,i);e=f.local;for(let p=0;p<l.length;p+=3)l[p+1]<0&&(l.splice(p,3),p-=3);for(let p=0,m=0;p<f.children.length;p+=3){let y=f.children[p];for(;m<l.length&&l[m]<y;)m+=3;l.splice(m,0,f.children[p],f.children[p+1],f.children[p+2])}}return new yt(e.sort(Wi),l)}function V4(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 In(o.from+e,o.to+e,o.type))}return n}function TF(t,e,n,r,o,s,i){function l(u,d){for(let f=0;f<u.local.length;f++){let p=u.local[f].map(r,o,d);p?n.push(p):i.onRemove&&i.onRemove(u.local[f].spec)}for(let f=0;f<u.children.length;f+=3)l(u.children[f+2],u.children[f]+d+1)}for(let u=0;u<t.length;u+=3)t[u+1]==-1&&l(t[u+2],e[u]+s+1);return n}function H4(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let s=0,i;s<t.length;s++)(i=t[s])&&i.from>n&&i.to<r&&((o||(o=[])).push(i),t[s]=null);return o}function U4(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function uh(t,e,n,r){let o=[],s=!1;e.forEach((l,u)=>{let d=H4(t,l,u+n);if(d){s=!0;let f=uh(d,l,n+u+1,r);f!=_n&&o.push(u,u+l.nodeSize,f)}});let i=V4(s?U4(t):t,-n).sort(Wi);for(let l=0;l<i.length;l++)i[l].type.valid(e,i[l])||(r.onRemove&&r.onRemove(i[l].spec),i.splice(l--,1));return i.length||o.length?new yt(i,o):_n}function Wi(t,e){return t.from-e.from||t.to-e.to}function Tx(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 s=e[o];if(s.from==r.from){s.to!=r.to&&(e==t&&(e=t.slice()),e[o]=s.copy(s.from,r.to),Xw(e,o+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,s.from),Xw(e,o,r.copy(s.from,r.to)));break}}}return e}function Xw(t,e,n){for(;e<t.length&&Wi(n,t[e])>0;)e++;t.splice(e,0,n)}function hg(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=_n&&e.push(r)}),t.cursorWrapper&&e.push(yt.create(t.state.doc,[t.cursorWrapper.deco])),Vs.from(e)}const MF={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},AF=Xn&&Zs<=11;class NF{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 DF{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new NF,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;o<r.length;o++)this.queue.push(r[o]);Xn&&Zs<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():Tn&&e.composing&&r.some(o=>o.type=="childList"&&o.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),AF&&(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,MF)),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(Ww(this.view)){if(this.suppressingSelectionUpdates)return es(this.view);if(Xn&&Zs<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&ra(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 s=e.focusNode;s;s=al(s))n.add(s);for(let s=e.anchorNode;s;s=al(s))if(n.has(s)){r=s;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)&&Ww(e)&&!this.ignoreSelectionChange(r),s=-1,i=-1,l=!1,u=[];if(e.editable)for(let f=0;f<n.length;f++){let p=this.registerMutation(n[f],u);p&&(s=s<0?p.from:Math.min(p.from,s),i=i<0?p.to:Math.max(p.to,i),p.typeOver&&(l=!0))}if(u.some(f=>f.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||bn&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&n.some(f=>f.type=="childList"&&f.removedNodes.length))){for(let f of u)if(f.nodeName=="BR"&&f.parentNode){let p=f.nextSibling;for(;p&&p.nodeType==1;){if(p.contentEditable=="false"){f.parentNode.removeChild(f);break}p=p.firstChild}}}else if(Mr&&u.length){let f=u.filter(p=>p.nodeName=="BR");if(f.length==2){let[p,m]=f;p.parentNode&&p.parentNode.parentNode==m.parentNode?m.remove():p.remove()}else{let{focusNode:p}=this.currentSelection;for(let m of f){let y=m.parentNode;y&&y.nodeName=="LI"&&(!p||IF(e,p)!=y)&&m.remove()}}}let d=null;s<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Mp(r)&&(d=bx(e))&&d.eq(He.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,es(e),this.currentSelection.set(r),e.scrollToSelection()):(s>-1||o)&&(s>-1&&(e.docView.markDirty(s,i),RF(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,PF(e,u)),this.handleDOMChange(s,i,l,u),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||es(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 f=0;f<e.addedNodes.length;f++){let p=e.addedNodes[f];n.push(p),p.nodeType==3&&(this.lastChangedTextNode=p)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let o=e.previousSibling,s=e.nextSibling;if(Xn&&Zs<=11&&e.addedNodes.length)for(let f=0;f<e.addedNodes.length;f++){let{previousSibling:p,nextSibling:m}=e.addedNodes[f];(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(o=p),(!m||Array.prototype.indexOf.call(e.addedNodes,m)<0)&&(s=m)}let i=o&&o.parentNode==e.target?xn(o)+1:0,l=r.localPosFromDOM(e.target,i,-1),u=s&&s.parentNode==e.target?xn(s):e.target.childNodes.length,d=r.localPosFromDOM(e.target,u,1);return{from:l,to:d}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Qw=new WeakMap,eC=!1;function RF(t){if(!Qw.has(t)&&(Qw.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Mr,eC)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."),eC=!0}}function tC(t,e){let n=e.startContainer,r=e.startOffset,o=e.endContainer,s=e.endOffset,i=t.domAtPos(t.state.selection.anchor);return ra(i.node,i.offset,o,s)&&([n,r,o,s]=[o,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:s}}function OF(t,e){if(e.getComposedRanges){let o=e.getComposedRanges(t.root)[0];if(o)return tC(t,o)}let n;function r(o){o.preventDefault(),o.stopImmediatePropagation(),n=o.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?tC(t,n):null}function IF(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function PF(t,e){var n;let{focusNode:r,focusOffset:o}=t.domSelectionRange();for(let s of e)if(((n=s.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let i=s.nextSibling;for(;i&&i.nodeName!="TD"&&i.nodeName!="TH";)i=i.nextSibling;if(i){let l=i;for(;;){let u=l.firstChild;if(!u||u.nodeType!=1||u.contentEditable=="false"||/^(BR|IMG)$/.test(u.nodeName))break;l=u}l.insertBefore(s,l.firstChild),r==s&&t.domSelection().collapse(s,o)}else s.parentNode.removeChild(s)}}function jF(t,e,n,r){let{node:o,fromOffset:s,toOffset:i,from:l,to:u}=t.docView.parseRange(e,n),d=t.domSelectionRange(),f,p=d.anchorNode;if(p&&t.dom.contains(p.nodeType==1?p:p.parentNode)&&(f=[{node:p,offset:d.anchorOffset}],Mp(d)||f.push({node:d.focusNode,offset:d.focusOffset})),bn&&t.input.lastKeyCode===8)for(let E=i;E>s;E--){let _=o.childNodes[E-1],T=_.pmViewDesc;if(_.nodeName=="BR"&&!T){i=E;break}if(!T||T.size)break}let m=t.state.doc,y=t.someProp("domParser")||Xo.fromSchema(t.state.schema),v=m.resolve(l),b=null,k=y.parse(o,{topNode:v.parent,topMatch:v.parent.contentMatchAt(v.index()),topOpen:!0,from:s,to:i,preserveWhitespace:v.parent.type.whitespace=="pre"?"full":!0,findPositions:f,ruleFromNode:LF(r),context:v});if(f&&f[0].pos!=null){let E=f[0].pos,_=f[1]&&f[1].pos;_==null&&(_=E),b={anchor:E+l,head:_+l}}return{doc:k,sel:b,from:l,to:u}}const LF=t=>e=>{let n=e.pmViewDesc;if(n)return n.parseRule(t);if(e.nodeName=="BR"&&e.parentNode){if(Tn&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(e.parentNode.lastChild==e||Tn&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null},zF=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function FF(t,e,n,r,o){let s=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let I=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,P=bx(t,I);if(P&&!t.state.selection.eq(P)){if(bn&&Ko&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",U=>U(t,Pi(13,"Enter"))))return;let O=t.state.tr.setSelection(P);I=="pointer"?O.setMeta("pointer",!0):I=="key"&&O.scrollIntoView(),s&&O.setMeta("composition",s),t.dispatch(O)}return}let i=t.state.doc.resolve(e),l=i.sharedDepth(n);e=i.before(l+1),n=t.state.doc.resolve(n).after(l+1);let u=t.state.selection,d=jF(t,e,n,o),f=t.state.doc,p=f.slice(d.from,d.to),m,y;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(m=t.state.selection.to,y="end"):(m=t.state.selection.from,y="start"),t.input.lastKeyCode=null;let v=VF(p.content,d.doc.content,d.from,m,y);if(v&&t.input.domChangeCount++,(ll&&t.input.lastIOSEnter>Date.now()-225||Ko)&&o.some(I=>I.nodeType==1&&!zF.test(I.nodeName))&&(!v||v.endA>=v.endB)&&t.someProp("handleKeyDown",I=>I(t,Pi(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!v)if(r&&u instanceof je&&!u.empty&&u.$head.sameParent(u.$anchor)&&!t.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))v={start:u.from,endA:u.to,endB:u.to};else{if(d.sel){let I=nC(t,t.state.doc,d.sel);if(I&&!I.eq(t.state.selection)){let P=t.state.tr.setSelection(I);s&&P.setMeta("composition",s),t.dispatch(P)}}return}t.state.selection.from<t.state.selection.to&&v.start==v.endB&&t.state.selection instanceof je&&(v.start>t.state.selection.from&&v.start<=t.state.selection.from+2&&t.state.selection.from>=d.from?v.start=t.state.selection.from:v.endA<t.state.selection.to&&v.endA>=t.state.selection.to-2&&t.state.selection.to<=d.to&&(v.endB+=t.state.selection.to-v.endA,v.endA=t.state.selection.to)),Xn&&Zs<=11&&v.endB==v.start+1&&v.endA==v.start&&v.start>d.from&&d.doc.textBetween(v.start-d.from-1,v.start-d.from+1)=="  "&&(v.start--,v.endA--,v.endB--);let b=d.doc.resolveNoCache(v.start-d.from),k=d.doc.resolveNoCache(v.endB-d.from),E=f.resolve(v.start),_=b.sameParent(k)&&b.parent.inlineContent&&E.end()>=v.endA;if((ll&&t.input.lastIOSEnter>Date.now()-225&&(!_||o.some(I=>I.nodeName=="DIV"||I.nodeName=="P"))||!_&&b.pos<d.doc.content.size&&(!b.sameParent(k)||!b.parent.inlineContent)&&b.pos<k.pos&&!/\S/.test(d.doc.textBetween(b.pos,k.pos,"","")))&&t.someProp("handleKeyDown",I=>I(t,Pi(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>v.start&&BF(f,v.start,v.endA,b,k)&&t.someProp("handleKeyDown",I=>I(t,Pi(8,"Backspace")))){Ko&&bn&&t.domObserver.suppressSelectionUpdates();return}bn&&v.endB==v.start&&(t.input.lastChromeDelete=Date.now()),Ko&&!_&&b.start()!=k.start()&&k.parentOffset==0&&b.depth==k.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==v.endA&&(v.endB-=2,k=d.doc.resolveNoCache(v.endB-d.from),setTimeout(()=>{t.someProp("handleKeyDown",function(I){return I(t,Pi(13,"Enter"))})},20));let T=v.start,A=v.endA,N=I=>{let P=I||t.state.tr.replace(T,A,d.doc.slice(v.start-d.from,v.endB-d.from));if(d.sel){let O=nC(t,P.doc,d.sel);O&&!(bn&&t.composing&&O.empty&&(v.start!=v.endB||t.input.lastChromeDelete<Date.now()-100)&&(O.head==T||O.head==P.mapping.map(A)-1)||Xn&&O.empty&&O.head==T)&&P.setSelection(O)}return s&&P.setMeta("composition",s),P.scrollIntoView()},D;if(_)if(b.pos==k.pos){Xn&&Zs<=11&&b.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>es(t),20));let I=N(t.state.tr.delete(T,A)),P=f.resolve(v.start).marksAcross(f.resolve(v.endA));P&&I.ensureMarks(P),t.dispatch(I)}else if(v.endA==v.endB&&(D=$F(b.parent.content.cut(b.parentOffset,k.parentOffset),E.parent.content.cut(E.parentOffset,v.endA-E.start())))){let I=N(t.state.tr);D.type=="add"?I.addMark(T,A,D.mark):I.removeMark(T,A,D.mark),t.dispatch(I)}else if(b.parent.child(b.index()).isText&&b.index()==k.index()-(k.textOffset?0:1)){let I=b.parent.textBetween(b.parentOffset,k.parentOffset),P=()=>N(t.state.tr.insertText(I,T,A));t.someProp("handleTextInput",O=>O(t,T,A,I,P))||t.dispatch(P())}else t.dispatch(N());else t.dispatch(N())}function nC(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:kx(t,e.resolve(n.anchor),e.resolve(n.head))}function $F(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,o=n,s=r,i,l,u;for(let f=0;f<r.length;f++)o=r[f].removeFromSet(o);for(let f=0;f<n.length;f++)s=n[f].removeFromSet(s);if(o.length==1&&s.length==0)l=o[0],i="add",u=f=>f.mark(l.addToSet(f.marks));else if(o.length==0&&s.length==1)l=s[0],i="remove",u=f=>f.mark(l.removeFromSet(f.marks));else return null;let d=[];for(let f=0;f<e.childCount;f++)d.push(u(e.child(f)));if(re.from(d).eq(t))return{mark:l,type:i}}function BF(t,e,n,r,o){if(n-e<=o.pos-r.pos||pg(r,!0,!1)<o.pos)return!1;let s=t.resolve(e);if(!r.parent.isTextblock){let l=s.nodeAfter;return l!=null&&n==e+l.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let i=t.resolve(pg(s,!0,!0));return!i.parent.isTextblock||i.pos>n||pg(i,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(i.parent.content)}function pg(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 s=t.node(r).maybeChild(t.indexAfter(r));for(;s&&!s.isLeaf;)s=s.firstChild,o++}return o}function VF(t,e,n,r,o){let s=t.findDiffStart(e,n),i=n+t.size,l=n+e.size;if(s==null)return null;let{a:u,b:d}=t.findDiffEnd(e,i,l);if(o=="end"){let f=Math.max(0,s-Math.min(u,d));r-=u+f-s}if(u<s&&i<l){let f=r<=s&&r>=u?s-r:0;s-=f,d=s+(d-u),u=s}else if(d<s){let f=r<=s&&r>=d?s-r:0;s-=f,u=s+(u-d),d=s}return{start:s,endA:u,endB:d}}class W4{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 oF,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(aC),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=sC(this),oC(this),this.nodeViews=iC(this),this.docView=Fw(this.state.doc,rC(this),hg(this),this.dom,this),this.domObserver=new DF(this,(r,o,s,i)=>FF(this,r,o,s,i)),this.domObserver.start(),sF(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&&W1(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(aC),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,s=!1,i=!1;e.storedMarks&&this.composing&&(z4(this),i=!0),this.state=e;let l=o.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let y=iC(this);UF(y,this.nodeViews)&&(this.nodeViews=y,s=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&W1(this),this.editable=sC(this),oC(this);let u=hg(this),d=rC(this),f=o.plugins!=e.plugins&&!o.doc.eq(e.doc)?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",p=s||!this.docView.matchesNode(e.doc,d,u);(p||!e.selection.eq(o.selection))&&(i=!0);let m=f=="preserve"&&i&&this.dom.style.overflowAnchor==null&&vz(this);if(i){this.domObserver.stop();let y=p&&(Xn||bn)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&HF(o.selection,e.selection);if(p){let b=bn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=bF(this)),(s||!this.docView.update(e.doc,d,u,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=Fw(e.doc,d,u,this.dom,this)),b&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(y=!0)}let v=this.input.mouseDown;y||!(v&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Hz(this)&&v.delaySelUpdate())?es(this,y):(S4(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),f=="reset"?this.dom.scrollTop=0:f=="to selection"?this.scrollToSelection():m&&bz(m)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof Oe){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Iw(this,n.getBoundingClientRect(),e)}else Iw(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,o=-1;if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)o=r.from;else{let s=r.from+(this.state.doc.content.size-n.doc.content.size);(s>0&&s<this.state.doc.content.size&&this.state.doc.nodeAt(s))==r.node&&(o=s)}this.dragging=new $4(e.slice,e.move,o<0?void 0:Oe.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 i=0;i<this.directPlugins.length;i++){let l=this.directPlugins[i].props[e];if(l!=null&&(o=n?n(l):l))return o}let s=this.state.plugins;if(s)for(let i=0;i<s.length;i++){let l=s[i].props[e];if(l!=null&&(o=n?n(l):l))return o}}hasFocus(){if(Xn){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&&kz(this.dom),es(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 _z(this,e)}coordsAtPos(e,n=1){return g4(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 Dz(this,n||this.state,e)}pasteHTML(e,n){return nc(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return nc(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return wx(this,e)}destroy(){this.docView&&(iF(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],hg(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,uz())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return lF(this,e)}domSelectionRange(){let e=this.domSelection();return e?Tn&&this.root.nodeType===11&&pz(this.dom.ownerDocument)==this.dom&&OF(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}W4.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function rC(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"),[In.node(0,t.state.doc.content.size,e)]}function oC(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:In.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function sC(t){return!t.someProp("editable",e=>e(t.state)===!1)}function HF(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 iC(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 UF(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 aC(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 ii={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:"'"},ch={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},WF=typeof navigator<"u"&&/Mac/.test(navigator.platform),qF=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var vn=0;vn<10;vn++)ii[48+vn]=ii[96+vn]=String(vn);for(var vn=1;vn<=24;vn++)ii[vn+111]="F"+vn;for(var vn=65;vn<=90;vn++)ii[vn]=String.fromCharCode(vn+32),ch[vn]=String.fromCharCode(vn);for(var mg in ii)ch.hasOwnProperty(mg)||(ch[mg]=ii[mg]);function KF(t){var e=WF&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||qF&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?ch:ii)[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 GF=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),JF=typeof navigator<"u"&&/Win/.test(navigator.platform);function ZF(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,o,s,i;for(let l=0;l<e.length-1;l++){let u=e[l];if(/^(cmd|meta|m)$/i.test(u))i=!0;else if(/^a(lt)?$/i.test(u))r=!0;else if(/^(c|ctrl|control)$/i.test(u))o=!0;else if(/^s(hift)?$/i.test(u))s=!0;else if(/^mod$/i.test(u))GF?i=!0:o=!0;else throw new Error("Unrecognized modifier name: "+u)}return r&&(n="Alt-"+n),o&&(n="Ctrl-"+n),i&&(n="Meta-"+n),s&&(n="Shift-"+n),n}function YF(t){let e=Object.create(null);for(let n in t)e[ZF(n)]=t[n];return e}function gg(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 XF(t){return new wt({props:{handleKeyDown:q4(t)}})}function q4(t){let e=YF(t);return function(n,r){let o=KF(r),s,i=e[gg(o,r)];if(i&&i(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let l=e[gg(o,r,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(JF&&r.ctrlKey&&r.altKey)&&(s=ii[r.keyCode])&&s!=o){let l=e[gg(s,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}var QF=Object.defineProperty,Mx=(t,e)=>{for(var n in e)QF(t,n,{get:e[n],enumerable:!0})};function Np(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:o}=n,{storedMarks:s}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,s=n.storedMarks,n}}}var Dp=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:r}=e,{tr:o}=n,s=this.buildProps(o);return Object.fromEntries(Object.entries(t).map(([i,l])=>[i,(...d)=>{const f=l(...d)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(o),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:r,state:o}=this,{view:s}=r,i=[],l=!!t,u=t||o.tr,d=()=>(!l&&e&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(u),i.every(p=>p===!0)),f={...Object.fromEntries(Object.entries(n).map(([p,m])=>[p,(...v)=>{const b=this.buildProps(u,e),k=m(...v)(b);return i.push(k),f}])),run:d};return f}createCan(t){const{rawCommands:e,state:n}=this,r=!1,o=t||n.tr,s=this.buildProps(o,r);return{...Object.fromEntries(Object.entries(e).map(([l,u])=>[l,(...d)=>u(...d)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,r)}}buildProps(t,e=!0){const{rawCommands:n,editor:r,state:o}=this,{view:s}=r,i={tr:t,editor:r,view:s,state:Np({state:o,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map(([l,u])=>[l,(...d)=>u(...d)(i)]))}};return i}},K4={};Mx(K4,{blur:()=>e$,clearContent:()=>t$,clearNodes:()=>n$,command:()=>r$,createParagraphNear:()=>o$,cut:()=>s$,deleteCurrentNode:()=>i$,deleteNode:()=>a$,deleteRange:()=>l$,deleteSelection:()=>d$,enter:()=>f$,exitCode:()=>h$,extendMarkRange:()=>p$,first:()=>m$,focus:()=>y$,forEach:()=>x$,insertContent:()=>v$,insertContentAt:()=>k$,insertDefaultBlock:()=>w$,joinBackward:()=>E$,joinDown:()=>S$,joinForward:()=>_$,joinItemBackward:()=>T$,joinItemForward:()=>M$,joinTextblockBackward:()=>A$,joinTextblockForward:()=>N$,joinUp:()=>C$,keyboardShortcut:()=>R$,lift:()=>O$,liftEmptyBlock:()=>I$,liftListItem:()=>P$,newlineInCode:()=>j$,resetAttributes:()=>L$,scrollIntoView:()=>z$,selectAll:()=>F$,selectNodeBackward:()=>$$,selectNodeForward:()=>B$,selectParentNode:()=>V$,selectTextblockEnd:()=>H$,selectTextblockStart:()=>U$,setContent:()=>W$,setMark:()=>dB,setMeta:()=>fB,setNode:()=>hB,setNodeSelection:()=>pB,setTextDirection:()=>mB,setTextSelection:()=>gB,sinkListItem:()=>yB,splitBlock:()=>xB,splitListItem:()=>vB,toggleList:()=>kB,toggleMark:()=>wB,toggleNode:()=>CB,toggleWrap:()=>SB,undoInputRule:()=>EB,unsetAllMarks:()=>_B,unsetMark:()=>TB,unsetTextDirection:()=>MB,updateAttributes:()=>AB,wrapIn:()=>NB,wrapInList:()=>DB});var e$=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),t$=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),n$=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:o}=r;return n&&o.forEach(({$from:s,$to:i})=>{t.doc.nodesBetween(s.pos,i.pos,(l,u)=>{if(l.type.isText)return;const{doc:d,mapping:f}=e,p=d.resolve(f.map(u)),m=d.resolve(f.map(u+l.nodeSize)),y=p.blockRange(m);if(!y)return;const v=wl(y);if(l.type.isTextblock){const{defaultType:b}=p.parent.contentMatchAt(p.index());e.setNodeMarkup(y.start,b)}(v||v===0)&&e.lift(y,v)})}),!0},r$=t=>e=>t(e),o$=()=>({state:t,dispatch:e})=>s4(t,e),s$=(t,e)=>({editor:n,tr:r})=>{const{state:o}=n,s=o.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const i=r.mapping.map(e);return r.insert(i,s.content),r.setSelection(new je(r.doc.resolve(Math.max(i-1,0)))),!0},i$=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const o=t.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===r.type){if(e){const l=o.before(s),u=o.after(s);t.delete(l,u).scrollIntoView()}return!0}return!1};function Bt(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}var a$=t=>({tr:e,state:n,dispatch:r})=>{const o=Bt(t,n.schema),s=e.selection.$anchor;for(let i=s.depth;i>0;i-=1)if(s.node(i).type===o){if(r){const u=s.before(i),d=s.after(i);e.delete(u,d).scrollIntoView()}return!0}return!1},l$=t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0},u$=t=>t.content?/^text(\*|\+)/.test(t.content):!1,lC=(t,e,n)=>{if(!t.parent.isInline||n==="left"&&t.pos>t.start()||n==="right"&&t.pos<t.end())return t.pos;const r=e.nodes[t.parent.type.name].spec;return u$(r)?n==="left"?t.start()-1:t.end()+1:t.pos},c$=(t,e,n)=>{const r=lC(t,n,"left"),o=lC(e,n,"right");return{from:r,to:o}},d$=()=>({state:t,dispatch:e})=>{if(t.selection.empty)return!1;if(e){const n=t.tr,{ranges:r}=t.selection,o=n.steps.length;r.forEach(s=>{const i=n.mapping.slice(o),l=n.doc.resolve(i.map(s.$from.pos)),u=n.doc.resolve(i.map(s.$to.pos)),{from:d,to:f}=c$(l,u,t.schema);n.deleteRange(d,f)}),n.selection.empty||n.setSelection(je.near(n.doc.resolve(n.selection.from))),n.scrollIntoView(),e(n)}return!0},f$=()=>({commands:t})=>t.keyboardShortcut("Enter"),h$=()=>({state:t,dispatch:e})=>G7(t,e);function Ax(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function dh(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(o=>n.strict?e[o]===t[o]:Ax(e[o])?e[o].test(t[o]):e[o]===t[o]):!0}function G4(t,e,n={}){return t.find(r=>r.type===e&&dh(Object.fromEntries(Object.keys(n).map(o=>[o,r.attrs[o]])),n))}function uC(t,e,n={}){return!!G4(t,e,n)}function Nx(t,e,n){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if((!r.node||!r.node.marks.some(d=>d.type===e))&&(r=t.parent.childBefore(t.parentOffset)),!r.node||!r.node.marks.some(d=>d.type===e))return;if(!n){const d=r.node.marks.find(f=>f.type===e);d&&(n=d.attrs)}if(!G4([...r.node.marks],e,n))return;let s=r.index,i=t.start()+r.offset,l=s+1,u=i+r.node.nodeSize;for(;s>0&&uC([...t.parent.child(s-1).marks],e,n);)s-=1,i-=t.parent.child(s).nodeSize;for(;l<t.parent.childCount&&uC([...t.parent.child(l).marks],e,n);)u+=t.parent.child(l).nodeSize,l+=1;return{from:i,to:u}}function cs(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}var p$=(t,e)=>({tr:n,state:r,dispatch:o})=>{const s=cs(t,r.schema),{doc:i,selection:l}=n,{$from:u,from:d,to:f}=l;if(o){const p=Nx(u,s,e);if(p&&p.from<=d&&p.to>=f){const m=je.create(i,p.from,p.to);n.setSelection(m)}}return!0},m$=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function J4(t){return t instanceof je}function Fi(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function q1(t,e=null){if(!e)return null;const n=He.atStart(t),r=He.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const o=n.from,s=r.to;return e==="all"?je.create(t,Fi(0,o,s),Fi(t.content.size,o,s)):je.create(t,Fi(e,o,s),Fi(e,o,s))}function cC(){return["Android"].includes(navigator.platform)||/android/i.test(navigator.userAgent)}function fh(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function g$(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var y$=(t=null,e={})=>({editor:n,view:r,tr:o,dispatch:s})=>{e={scrollIntoView:!0,...e};const i=()=>{(fh()||cC())&&r.dom.focus(),g$()&&!fh()&&!cC()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&t===null||t===!1)return!0}catch{return!1}if(s&&t===null&&!J4(n.state.selection))return i(),!0;const l=q1(o.doc,t)||n.state.selection,u=n.state.selection.eq(l);return s&&(u||o.setSelection(l),u&&o.storedMarks&&o.setStoredMarks(o.storedMarks),i()),!0},x$=(t,e)=>n=>t.every((r,o)=>e(r,{...n,index:o})),v$=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),Z4=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&Z4(r)}return t};function df(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return Z4(n)}function ul(t,e,n){if(t instanceof Js||t instanceof re)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,o=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return re.fromArray(t.map(l=>e.nodeFromJSON(l)));const i=e.nodeFromJSON(t);return n.errorOnInvalidContent&&i.check(),i}catch(s){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",s),ul("",e,n)}if(o){if(n.errorOnInvalidContent){let i=!1,l="";const u=new cx({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:d=>(i=!0,l=typeof d=="string"?d:d.outerHTML,null)}]}})});if(n.slice?Xo.fromSchema(u).parseSlice(df(t),n.parseOptions):Xo.fromSchema(u).parse(df(t),n.parseOptions),n.errorOnInvalidContent&&i)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const s=Xo.fromSchema(e);return n.slice?s.parseSlice(df(t),n.parseOptions).content:s.parse(df(t),n.parseOptions)}return ul("",e,n)}function Y4(t,e,n){const r=t.steps.length-1;if(r<e)return;const o=t.steps[r];if(!(o instanceof Ft||o instanceof dn))return;const s=t.mapping.maps[r];let i=0;s.forEach((l,u,d,f)=>{i===0&&(i=f)}),t.setSelection(He.near(t.doc.resolve(i),n))}var b$=t=>!("type"in t),k$=(t,e,n)=>({tr:r,dispatch:o,editor:s})=>{var i;if(o){n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;const u=k=>{s.emit("contentError",{editor:s,error:k,disableCollaboration:()=>{"collaboration"in s.storage&&typeof s.storage.collaboration=="object"&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},d={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{ul(e,s.schema,{parseOptions:d,errorOnInvalidContent:!0})}catch(k){u(k)}try{l=ul(e,s.schema,{parseOptions:d,errorOnInvalidContent:(i=n.errorOnInvalidContent)!=null?i:s.options.enableContentCheck})}catch(k){return u(k),!1}let{from:f,to:p}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},m=!0,y=!0;if((b$(l)?l:[l]).forEach(k=>{k.check(),m=m?k.isText&&k.marks.length===0:!1,y=y?k.isBlock:!1}),f===p&&y){const{parent:k}=r.doc.resolve(f);k.isTextblock&&!k.type.spec.code&&!k.childCount&&(f-=1,p+=1)}let b;if(m){if(Array.isArray(e))b=e.map(k=>k.text||"").join("");else if(e instanceof re){let k="";e.forEach(E=>{E.text&&(k+=E.text)}),b=k}else typeof e=="object"&&e&&e.text?b=e.text:b=e;r.insertText(b,f,p)}else{b=l;const k=r.doc.resolve(f),E=k.node(),_=k.parentOffset===0,T=E.isText||E.isTextblock,A=E.content.size>0;_&&T&&A&&y&&(f=Math.max(0,f-1)),r.replaceWith(f,p,b)}n.updateSelection&&Y4(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:f,text:b}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:f,text:b})}return!0};function X4(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var w$=(t={})=>({tr:e,dispatch:n,editor:r})=>{const{pos:o,attrs:s,content:i,updateSelection:l=!0}=t;let u;typeof o=="number"?u=e.doc.resolve(o):o?u=o:u=e.selection.$from;const d=X4(u.parent.contentMatchAt(u.index()));if(!d)return!1;const f=Object.keys(d.spec.attrs||{}),p=s?Object.fromEntries(Object.entries(s).filter(([y])=>f.includes(y))):{};let m;if(i){const y=ul(i,r.schema);m=d.createAndFill(p,y)}else m=d.createAndFill(p);return m?(n&&(e.insert(u.pos,m),l&&Y4(e,e.steps.length-1,-1)),!0):!1},C$=()=>({state:t,dispatch:e})=>W7(t,e),S$=()=>({state:t,dispatch:e})=>q7(t,e),E$=()=>({state:t,dispatch:e})=>X_(t,e),_$=()=>({state:t,dispatch:e})=>n4(t,e),T$=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Ep(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},M$=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Ep(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},A$=()=>({state:t,dispatch:e})=>H7(t,e),N$=()=>({state:t,dispatch:e})=>U7(t,e);function Q4(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function D$(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,o,s,i;for(let l=0;l<e.length-1;l+=1){const u=e[l];if(/^(cmd|meta|m)$/i.test(u))i=!0;else if(/^a(lt)?$/i.test(u))r=!0;else if(/^(c|ctrl|control)$/i.test(u))o=!0;else if(/^s(hift)?$/i.test(u))s=!0;else if(/^mod$/i.test(u))fh()||Q4()?i=!0:o=!0;else throw new Error(`Unrecognized modifier name: ${u}`)}return r&&(n=`Alt-${n}`),o&&(n=`Ctrl-${n}`),i&&(n=`Meta-${n}`),s&&(n=`Shift-${n}`),n}var R$=t=>({editor:e,view:n,tr:r,dispatch:o})=>{const s=D$(t).split(/-(?!$)/),i=s.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),l=new KeyboardEvent("keydown",{key:i==="Space"?" ":i,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),u=e.captureTransaction(()=>{n.someProp("handleKeyDown",d=>d(n,l))});return u==null||u.steps.forEach(d=>{const f=d.map(r.mapping);f&&o&&r.maybeStep(f)}),!0};function ai(t,e,n={}){const{from:r,to:o,empty:s}=t.selection,i=e?Bt(e,t.schema):null,l=[];t.doc.nodesBetween(r,o,(p,m)=>{if(p.isText)return;const y=Math.max(r,m),v=Math.min(o,m+p.nodeSize);l.push({node:p,from:y,to:v})});const u=o-r,d=l.filter(p=>i?i.name===p.node.type.name:!0).filter(p=>dh(p.node.attrs,n,{strict:!1}));return s?!!d.length:d.reduce((p,m)=>p+m.to-m.from,0)>=u}var O$=(t,e={})=>({state:n,dispatch:r})=>{const o=Bt(t,n.schema);return ai(n,o,e)?K7(n,r):!1},I$=()=>({state:t,dispatch:e})=>i4(t,e),P$=t=>({state:e,dispatch:n})=>{const r=Bt(t,e.schema);return sz(r)(e,n)},j$=()=>({state:t,dispatch:e})=>o4(t,e);function Rp(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function dC(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,o)=>(n.includes(o)||(r[o]=t[o]),r),{})}var L$=(t,e)=>({tr:n,state:r,dispatch:o})=>{let s=null,i=null;const l=Rp(typeof t=="string"?t:t.name,r.schema);if(!l)return!1;l==="node"&&(s=Bt(t,r.schema)),l==="mark"&&(i=cs(t,r.schema));let u=!1;return n.selection.ranges.forEach(d=>{r.doc.nodesBetween(d.$from.pos,d.$to.pos,(f,p)=>{s&&s===f.type&&(u=!0,o&&n.setNodeMarkup(p,void 0,dC(f.attrs,e))),i&&f.marks.length&&f.marks.forEach(m=>{i===m.type&&(u=!0,o&&n.addMark(p,p+f.nodeSize,i.create(dC(m.attrs,e))))})})}),u},z$=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),F$=()=>({tr:t,dispatch:e})=>{if(e){const n=new lr(t.doc);t.setSelection(n)}return!0},$$=()=>({state:t,dispatch:e})=>e4(t,e),B$=()=>({state:t,dispatch:e})=>r4(t,e),V$=()=>({state:t,dispatch:e})=>Y7(t,e),H$=()=>({state:t,dispatch:e})=>ez(t,e),U$=()=>({state:t,dispatch:e})=>Q7(t,e);function K1(t,e,n={},r={}){return ul(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var W$=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:o,tr:s,dispatch:i,commands:l})=>{const{doc:u}=s;if(r.preserveWhitespace!=="full"){const d=K1(t,o.schema,r,{errorOnInvalidContent:e??o.options.enableContentCheck});return i&&s.replaceWith(0,u.content.size,d).setMeta("preventUpdate",!n),!0}return i&&s.setMeta("preventUpdate",!n),l.insertContentAt({from:0,to:u.content.size},t,{parseOptions:r,errorOnInvalidContent:e??o.options.enableContentCheck})};function e6(t,e){const n=cs(e,t.schema),{from:r,to:o,empty:s}=t.selection,i=[];s?(t.storedMarks&&i.push(...t.storedMarks),i.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,o,u=>{i.push(...u.marks)});const l=i.find(u=>u.type.name===n.name);return l?{...l.attrs}:{}}function t6(t,e){const n=new K_(t);return e.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}function q$(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(o,s)=>{n(o)&&r.push({node:o,pos:s})}),r}function K$(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Op(t){return e=>K$(e.$from,t)}function Me(t,e,n){return t.config[e]===void 0&&t.parent?Me(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?Me(t.parent,e,n):null}):t.config[e]}function Dx(t){return t.map(e=>{const n={name:e.name,options:e.options,storage:e.storage},r=Me(e,"addExtensions",n);return r?[e,...Dx(r())]:e}).flat(10)}function Rc(t,e){const n=da.fromSchema(e).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}function n6(t){return typeof t=="function"}function at(t,e=void 0,...n){return n6(t)?e?t.bind(e)(...n):t(...n):t}function G$(t={}){return Object.keys(t).length===0&&t.constructor===Object}function cl(t){const e=t.filter(o=>o.type==="extension"),n=t.filter(o=>o.type==="node"),r=t.filter(o=>o.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function r6(t){const e=[],{nodeExtensions:n,markExtensions:r}=cl(t),o=[...n,...r],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},i=n.filter(d=>d.name!=="text").map(d=>d.name),l=r.map(d=>d.name),u=[...i,...l];return t.forEach(d=>{const f={name:d.name,options:d.options,storage:d.storage,extensions:o},p=Me(d,"addGlobalAttributes",f);if(!p)return;p().forEach(y=>{let v;Array.isArray(y.types)?v=y.types:y.types==="*"?v=u:y.types==="nodes"?v=i:y.types==="marks"?v=l:v=[],v.forEach(b=>{Object.entries(y.attributes).forEach(([k,E])=>{e.push({type:b,name:k,attribute:{...s,...E}})})})})}),o.forEach(d=>{const f={name:d.name,options:d.options,storage:d.storage},p=Me(d,"addAttributes",f);if(!p)return;const m=p();Object.entries(m).forEach(([y,v])=>{const b={...s,...v};typeof(b==null?void 0:b.default)=="function"&&(b.default=b.default()),b!=null&&b.isRequired&&(b==null?void 0:b.default)===void 0&&delete b.default,e.push({type:d.name,name:y,attribute:b})})}),e}function J$(t){const e=[];let n="",r=!1,o=!1,s=0;const i=t.length;for(let l=0;l<i;l+=1){const u=t[l];if(u==="'"&&!o){r=!r,n+=u;continue}if(u==='"'&&!r){o=!o,n+=u;continue}if(!r&&!o){if(u==="("){s+=1,n+=u;continue}if(u===")"&&s>0){s-=1,n+=u;continue}if(u===";"&&s===0){e.push(n),n="";continue}}n+=u}return n&&e.push(n),e}function fC(t){const e=[],n=J$(t||""),r=n.length;for(let o=0;o<r;o+=1){const s=n[o],i=s.indexOf(":");if(i===-1)continue;const l=s.slice(0,i).trim(),u=s.slice(i+1).trim();l&&u&&e.push([l,u])}return e}function Qt(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([o,s])=>{if(!r[o]){r[o]=s;return}if(o==="class"){const l=s?String(s).split(" "):[],u=r[o]?r[o].split(" "):[],d=l.filter(f=>!u.includes(f));r[o]=[...u,...d].join(" ")}else if(o==="style"){const l=new Map([...fC(r[o]),...fC(s)]);r[o]=Array.from(l.entries()).map(([u,d])=>`${u}: ${d}`).join("; ")}else r[o]=s}),r},{})}function oc(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>Qt(n,r),{})}function Z$(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function hC(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const o=e.reduce((s,i)=>{const l=i.attribute.parseHTML?i.attribute.parseHTML(n):Z$(n.getAttribute(i.name));return l==null?s:{...s,[i.name]:l}},{});return{...r,...o}}}}function pC(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&G$(n)?!1:n!=null))}function mC(t){var e,n;const r={};return!((e=t==null?void 0:t.attribute)!=null&&e.isRequired)&&"default"in((t==null?void 0:t.attribute)||{})&&(r.default=t.attribute.default),((n=t==null?void 0:t.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=t.attribute.validate),[t.name,r]}function Y$(t,e){var n;const r=r6(t),{nodeExtensions:o,markExtensions:s}=cl(t),i=(n=o.find(d=>Me(d,"topNode")))==null?void 0:n.name,l=Object.fromEntries(o.map(d=>{const f=r.filter(E=>E.type===d.name),p={name:d.name,options:d.options,storage:d.storage,editor:e},m=t.reduce((E,_)=>{const T=Me(_,"extendNodeSchema",p);return{...E,...T?T(d):{}}},{}),y=pC({...m,content:at(Me(d,"content",p)),marks:at(Me(d,"marks",p)),group:at(Me(d,"group",p)),inline:at(Me(d,"inline",p)),atom:at(Me(d,"atom",p)),selectable:at(Me(d,"selectable",p)),draggable:at(Me(d,"draggable",p)),code:at(Me(d,"code",p)),whitespace:at(Me(d,"whitespace",p)),linebreakReplacement:at(Me(d,"linebreakReplacement",p)),defining:at(Me(d,"defining",p)),isolating:at(Me(d,"isolating",p)),attrs:Object.fromEntries(f.map(mC))}),v=at(Me(d,"parseHTML",p));v&&(y.parseDOM=v.map(E=>hC(E,f)));const b=Me(d,"renderHTML",p);b&&(y.toDOM=E=>b({node:E,HTMLAttributes:oc(E,f)}));const k=Me(d,"renderText",p);return k&&(y.toText=k),[d.name,y]})),u=Object.fromEntries(s.map(d=>{const f=r.filter(k=>k.type===d.name),p={name:d.name,options:d.options,storage:d.storage,editor:e},m=t.reduce((k,E)=>{const _=Me(E,"extendMarkSchema",p);return{...k,..._?_(d):{}}},{}),y=pC({...m,inclusive:at(Me(d,"inclusive",p)),excludes:at(Me(d,"excludes",p)),group:at(Me(d,"group",p)),spanning:at(Me(d,"spanning",p)),code:at(Me(d,"code",p)),attrs:Object.fromEntries(f.map(mC))}),v=at(Me(d,"parseHTML",p));v&&(y.parseDOM=v.map(k=>hC(k,f)));const b=Me(d,"renderHTML",p);return b&&(y.toDOM=k=>b({mark:k,HTMLAttributes:oc(k,f)})),[d.name,y]}));return new cx({topNode:i,nodes:l,marks:u})}function X$(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function _u(t){return t.sort((n,r)=>{const o=Me(n,"priority")||100,s=Me(r,"priority")||100;return o>s?-1:o<s?1:0})}function o6(t){const e=_u(Dx(t)),n=X$(e.map(r=>r.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function s6(t,e,n){const{from:r,to:o}=e,{blockSeparator:s=`
433
-
434
- `,textSerializers:i={}}=n||{};let l="";return t.nodesBetween(r,o,(u,d,f,p)=>{var m;u.isBlock&&d>r&&(l+=s);const y=i==null?void 0:i[u.type.name];if(y)return f&&(l+=y({node:u,pos:d,parent:f,index:p,range:e})),!1;u.isText&&(l+=(m=u==null?void 0:u.text)==null?void 0:m.slice(Math.max(r,d)-d,o-d))}),l}function Q$(t,e){const n={from:0,to:t.content.size};return s6(t,n,e)}function i6(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function eB(t,e){const n=Bt(e,t.schema),{from:r,to:o}=t.selection,s=[];t.doc.nodesBetween(r,o,l=>{s.push(l)});const i=s.reverse().find(l=>l.type.name===n.name);return i?{...i.attrs}:{}}function a6(t,e){const n=Rp(typeof e=="string"?e:e.name,t.schema);return n==="node"?eB(t,e):n==="mark"?e6(t,e):{}}function tB(t,e=JSON.stringify){const n={};return t.filter(r=>{const o=e(r);return Object.prototype.hasOwnProperty.call(n,o)?!1:n[o]=!0})}function nB(t){const e=tB(t);return e.length===1?e:e.filter((n,r)=>!e.filter((s,i)=>i!==r).some(s=>n.oldRange.from>=s.oldRange.from&&n.oldRange.to<=s.oldRange.to&&n.newRange.from>=s.newRange.from&&n.newRange.to<=s.newRange.to))}function Rx(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((o,s)=>{const i=[];if(o.ranges.length)o.forEach((l,u)=>{i.push({from:l,to:u})});else{const{from:l,to:u}=n[s];if(l===void 0||u===void 0)return;i.push({from:l,to:u})}i.forEach(({from:l,to:u})=>{const d=e.slice(s).map(l,-1),f=e.slice(s).map(u),p=e.invert().map(d,-1),m=e.invert().map(f);r.push({oldRange:{from:p,to:m},newRange:{from:d,to:f}})})}),nB(r)}function Ox(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(o=>{const s=n.resolve(t),i=Nx(s,o.type);i&&r.push({mark:o,...i})}):n.nodesBetween(t,e,(o,s)=>{!o||(o==null?void 0:o.nodeSize)===void 0||r.push(...o.marks.map(i=>({from:s,to:s+o.nodeSize,mark:i})))}),r}var rB=(t,e,n,r=20)=>{const o=t.doc.resolve(n);let s=r,i=null;for(;s>0&&i===null;){const l=o.node(s);(l==null?void 0:l.type.name)===e?i=l:s-=1}return[i,s]};function cu(t,e){return e.nodes[t]||e.marks[t]||null}function If(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const o=t.find(s=>s.type===e&&s.name===r);return o?o.attribute.keepOnSplit:!1}))}var oB=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,s,i,l)=>{var u,d;const f=((d=(u=o.type.spec).toText)==null?void 0:d.call(u,{node:o,pos:s,parent:i,index:l}))||o.textContent||"%leaf%";n+=o.isAtom&&!o.isText?f:f.slice(0,Math.max(0,r-s))}),n};function G1(t,e,n={}){const{empty:r,ranges:o}=t.selection,s=e?cs(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(p=>s?s.name===p.type.name:!0).find(p=>dh(p.attrs,n,{strict:!1}));let i=0;const l=[];if(o.forEach(({$from:p,$to:m})=>{const y=p.pos,v=m.pos;t.doc.nodesBetween(y,v,(b,k)=>{if(s&&b.inlineContent&&!b.type.allowsMarkType(s))return!1;if(!b.isText&&!b.marks.length)return;const E=Math.max(y,k),_=Math.min(v,k+b.nodeSize),T=_-E;i+=T,l.push(...b.marks.map(A=>({mark:A,from:E,to:_})))})}),i===0)return!1;const u=l.filter(p=>s?s.name===p.mark.type.name:!0).filter(p=>dh(p.mark.attrs,n,{strict:!1})).reduce((p,m)=>p+m.to-m.from,0),d=l.filter(p=>s?p.mark.type!==s&&p.mark.type.excludes(s):!0).reduce((p,m)=>p+m.to-m.from,0);return(u>0?u+d:u)>=i}function sB(t,e,n={}){if(!e)return ai(t,null,n)||G1(t,null,n);const r=Rp(e,t.schema);return r==="node"?ai(t,e,n):r==="mark"?G1(t,e,n):!1}var iB=(t,e)=>{const{$from:n,$to:r,$anchor:o}=t.selection;if(e){const s=Op(l=>l.type.name===e)(t.selection);if(!s)return!1;const i=t.doc.resolve(s.pos+1);return o.pos+1===i.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},aB=t=>{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function gC(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function yg(t,e){const{nodeExtensions:n}=cl(e),r=n.find(i=>i.name===t);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},s=at(Me(r,"group",o));return typeof s!="string"?!1:s.split(" ").includes("list")}function Oc(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return!/\S/.test((r=t.text)!=null?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let o=!0;return t.content.forEach(s=>{o!==!1&&(Oc(s,{ignoreWhitespace:n,checkChildren:e})||(o=!1))}),o}return!1}function l6(t){return t instanceof Oe}var u6=class c6{constructor(e){this.position=e}static fromJSON(e){return new c6(e.position)}toJSON(){return{position:this.position}}};function lB(t,e){const n=e.mapping.mapResult(t.position);return{position:new u6(n.pos),mapResult:n}}function uB(t){return new u6(t)}function cB(t,e,n){var r;const{selection:o}=e;let s=null;if(J4(o)&&(s=o.$cursor),s){const l=(r=t.storedMarks)!=null?r:s.marks();return s.parent.type.allowsMarkType(n)&&(!!n.isInSet(l)||!l.some(d=>d.type.excludes(n)))}const{ranges:i}=o;return i.some(({$from:l,$to:u})=>{let d=l.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(l.pos,u.pos,(f,p,m)=>{if(d)return!1;if(f.isInline){const y=!m||m.type.allowsMarkType(n),v=!!n.isInSet(f.marks)||!f.marks.some(b=>b.type.excludes(n));d=y&&v}return!d}),d})}var dB=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:s}=n,{empty:i,ranges:l}=s,u=cs(t,r.schema);if(o)if(i){const d=e6(r,u);n.addStoredMark(u.create({...d,...e}))}else l.forEach(d=>{const f=d.$from.pos,p=d.$to.pos;r.doc.nodesBetween(f,p,(m,y)=>{const v=Math.max(y,f),b=Math.min(y+m.nodeSize,p);m.marks.find(E=>E.type===u)?m.marks.forEach(E=>{u===E.type&&n.addMark(v,b,u.create({...E.attrs,...e}))}):n.addMark(v,b,u.create(e))})});return cB(r,n,u)},fB=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),hB=(t,e={})=>({state:n,dispatch:r,chain:o})=>{const s=Bt(t,n.schema);let i;return n.selection.$anchor.sameParent(n.selection.$head)&&(i=n.selection.$anchor.parent.attrs),s.isTextblock?o().command(({commands:l})=>Dw(s,{...i,...e})(n)?!0:l.clearNodes()).command(({state:l})=>Dw(s,{...i,...e})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},pB=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,o=Fi(t,0,r.content.size),s=Oe.create(r,o);e.setSelection(s)}return!0},mB=(t,e)=>({tr:n,state:r,dispatch:o})=>{const{selection:s}=r;let i,l;return typeof e=="number"?(i=e,l=e):e&&"from"in e&&"to"in e?(i=e.from,l=e.to):(i=s.from,l=s.to),o&&n.doc.nodesBetween(i,l,(u,d)=>{u.isText||n.setNodeMarkup(d,void 0,{...u.attrs,dir:t})}),!0},gB=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:o,to:s}=typeof t=="number"?{from:t,to:t}:t,i=je.atStart(r).from,l=je.atEnd(r).to,u=Fi(o,i,l),d=Fi(s,i,l),f=je.create(r,u,d);e.setSelection(f)}return!0},yB=t=>({state:e,dispatch:n})=>{const r=Bt(t,e.schema);return lz(r)(e,n)};function yC(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(o=>e==null?void 0:e.includes(o.type.name));t.tr.ensureMarks(r)}}var xB=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:s,doc:i}=e,{$from:l,$to:u}=s,d=o.extensionManager.attributes,f=If(d,l.node().type.name,l.node().attrs);if(s instanceof Oe&&s.node.isBlock)return!l.parentOffset||!Qo(i,l.pos)?!1:(r&&(t&&yC(n,o.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const p=u.parentOffset===u.parent.content.size,m=l.depth===0?void 0:X4(l.node(-1).contentMatchAt(l.indexAfter(-1)));let y=p&&m?[{type:m,attrs:f}]:void 0,v=Qo(e.doc,e.mapping.map(l.pos),1,y);if(!y&&!v&&Qo(e.doc,e.mapping.map(l.pos),1,m?[{type:m}]:void 0)&&(v=!0,y=m?[{type:m,attrs:f}]:void 0),r){if(v&&(s instanceof je&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,y),m&&!p&&!l.parentOffset&&l.parent.type!==m)){const b=e.mapping.map(l.before()),k=e.doc.resolve(b);l.node(-1).canReplaceWith(k.index(),k.index()+1,m)&&e.setNodeMarkup(e.mapping.map(l.before()),m)}t&&yC(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return v},vB=(t,e={})=>({tr:n,state:r,dispatch:o,editor:s})=>{var i;const l=Bt(t,r.schema),{$from:u,$to:d}=r.selection,f=r.selection.node;if(f&&f.isBlock||u.depth<2||!u.sameParent(d))return!1;const p=u.node(-1);if(p.type!==l)return!1;const m=s.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==l||u.index(-2)!==u.node(-2).childCount-1)return!1;if(o){let E=re.empty;const _=u.index(-1)?1:u.index(-2)?2:3;for(let P=u.depth-_;P>=u.depth-3;P-=1)E=re.from(u.node(P).copy(E));const T=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,A={...If(m,u.node().type.name,u.node().attrs),...e},N=((i=l.contentMatch.defaultType)==null?void 0:i.createAndFill(A))||void 0;E=E.append(re.from(l.createAndFill(null,N)||void 0));const D=u.before(u.depth-(_-1));n.replace(D,u.after(-T),new ye(E,4-_,0));let I=-1;n.doc.nodesBetween(D,n.doc.content.size,(P,O)=>{if(I>-1)return!1;P.isTextblock&&P.content.size===0&&(I=O+1)}),I>-1&&n.setSelection(je.near(n.doc.resolve(I))),n.scrollIntoView()}return!0}const y=d.pos===u.end()?p.contentMatchAt(0).defaultType:null,v={...If(m,p.type.name,p.attrs),...e},b={...If(m,u.node().type.name,u.node().attrs),...e};n.delete(u.pos,d.pos);const k=y?[{type:l,attrs:v},{type:y,attrs:b}]:[{type:l,attrs:v}];if(!Qo(n.doc,u.pos,2))return!1;if(o){const{selection:E,storedMarks:_}=r,{splittableMarks:T}=s.extensionManager,A=_||E.$to.parentOffset&&E.$from.marks();if(n.split(u.pos,2,k).scrollIntoView(),!A||!o)return!0;const N=A.filter(D=>T.includes(D.type.name));n.ensureMarks(N)}return!0};function xC(t){return!t||t==="1"?null:t}function d6(t,e){return xC(t)===xC(e)}var xg=(t,e)=>{const n=Op(i=>i.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return!(n.node.type===(o==null?void 0:o.type)&&hi(t.doc,n.pos))||!d6(n.node.attrs.type,o==null?void 0:o.attrs.type)||t.join(n.pos),!0},vg=(t,e)=>{const n=Op(i=>i.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return!(n.node.type===(o==null?void 0:o.type)&&hi(t.doc,r))||!d6(n.node.attrs.type,o==null?void 0:o.attrs.type)||t.join(r),!0};function bB(t){const e=t.doc,n=e.firstChild;if(!n)return null;const r=e.resolve(1),o=e.resolve(n.nodeSize-1);return je.between(r,o)}var kB=(t,e,n,r={})=>({editor:o,tr:s,state:i,dispatch:l,chain:u,commands:d,can:f})=>{const{extensions:p,splittableMarks:m}=o.extensionManager,y=Bt(t,i.schema),v=Bt(e,i.schema),{selection:b,storedMarks:k}=i,{$from:E,$to:_}=b,T=E.blockRange(_),A=k||b.$to.parentOffset&&b.$from.marks();if(!T)return!1;const N=Op(q=>yg(q.type.name,p))(b),D=b.from===0&&b.to===i.doc.content.size,I=i.doc.content.content,P=I.length===1?I[0]:null,O=D&&P&&yg(P.type.name,p)?{node:P,pos:0}:null,U=N??O,J=!!N&&T.depth>=1&&T.depth-N.depth<=1,K=!!O;if((J||K)&&U){if(U.node.type===y)return D&&K?u().command(({tr:q,dispatch:Z})=>{const Q=bB(q);return Q?(q.setSelection(Q),Z&&Z(q),!0):!1}).liftListItem(v).run():d.liftListItem(v);if(yg(U.node.type.name,p)&&y.validContent(U.node.content))return u().command(()=>(s.setNodeMarkup(U.pos,y),!0)).command(()=>xg(s,y)).command(()=>vg(s,y)).run()}return!n||!A||!l?u().command(()=>f().wrapInList(y,r)?!0:d.clearNodes()).wrapInList(y,r).command(()=>xg(s,y)).command(()=>vg(s,y)).run():u().command(()=>{const q=f().wrapInList(y,r),Z=A.filter(Q=>m.includes(Q.type.name));return s.ensureMarks(Z),q?!0:d.clearNodes()}).wrapInList(y,r).command(()=>xg(s,y)).command(()=>vg(s,y)).run()},wB=(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:s=!1}=n,i=cs(t,r.schema);return G1(r,i,e)?o.unsetMark(i,{extendEmptyMarkRange:s}):o.setMark(i,e)},CB=(t,e,n={})=>({state:r,commands:o})=>{const s=Bt(t,r.schema),i=Bt(e,r.schema),l=ai(r,s,n);let u;return r.selection.$anchor.sameParent(r.selection.$head)&&(u=r.selection.$anchor.parent.attrs),l?o.setNode(i,u):o.setNode(s,{...u,...n})},SB=(t,e={})=>({state:n,commands:r})=>{const o=Bt(t,n.schema);return ai(n,o,e)?r.lift(o):r.wrapIn(o,e)},EB=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let s;if(o.spec.isInputRules&&(s=o.getState(t))){if(e){const i=t.tr,l=s.transform;for(let u=l.steps.length-1;u>=0;u-=1)i.step(l.steps[u].invert(l.docs[u]));if(s.text){const u=i.doc.resolve(s.from).marks();i.replaceWith(s.from,s.to,t.schema.text(s.text,u))}else i.delete(s.from,s.to)}return!0}}return!1},_B=(t={})=>({tr:e,dispatch:n,editor:r})=>{const{ignoreClearable:o=!1}=t,{selection:s}=e,{empty:i,ranges:l}=s;if(i)return!0;const{nonClearableMarks:u}=r.extensionManager;if(n){const d=Object.values(r.schema.marks).filter(f=>o||!u.includes(f.name));l.forEach(f=>{for(const p of d)e.removeMark(f.$from.pos,f.$to.pos,p)})}return!0},TB=(t,e={})=>({tr:n,state:r,dispatch:o})=>{var s;const{extendEmptyMarkRange:i=!1}=e,{selection:l}=n,u=cs(t,r.schema),{$from:d,empty:f,ranges:p}=l;if(!o)return!0;if(f&&i){let{from:m,to:y}=l;const v=(s=d.marks().find(k=>k.type===u))==null?void 0:s.attrs,b=Nx(d,u,v);b&&(m=b.from,y=b.to),n.removeMark(m,y,u)}else p.forEach(m=>{n.removeMark(m.$from.pos,m.$to.pos,u)});return n.removeStoredMark(u),!0},MB=t=>({tr:e,state:n,dispatch:r})=>{const{selection:o}=n;let s,i;return typeof t=="number"?(s=t,i=t):t&&"from"in t&&"to"in t?(s=t.from,i=t.to):(s=o.from,i=o.to),r&&e.doc.nodesBetween(s,i,(l,u)=>{if(l.isText)return;const d={...l.attrs};delete d.dir,e.setNodeMarkup(u,void 0,d)}),!0},AB=(t,e={})=>({tr:n,state:r,dispatch:o})=>{let s=null,i=null;const l=Rp(typeof t=="string"?t:t.name,r.schema);if(!l)return!1;l==="node"&&(s=Bt(t,r.schema)),l==="mark"&&(i=cs(t,r.schema));let u=!1;return n.selection.ranges.forEach(d=>{const f=d.$from.pos,p=d.$to.pos;let m,y,v,b;n.selection.empty?r.doc.nodesBetween(f,p,(k,E)=>{s&&s===k.type&&(u=!0,v=Math.max(E,f),b=Math.min(E+k.nodeSize,p),m=E,y=k)}):r.doc.nodesBetween(f,p,(k,E)=>{E<f&&s&&s===k.type&&(u=!0,v=Math.max(E,f),b=Math.min(E+k.nodeSize,p),m=E,y=k),E>=f&&E<=p&&(s&&s===k.type&&(u=!0,o&&n.setNodeMarkup(E,void 0,{...k.attrs,...e})),i&&k.marks.length&&k.marks.forEach(_=>{if(i===_.type&&(u=!0,o)){const T=Math.max(E,f),A=Math.min(E+k.nodeSize,p);n.addMark(T,A,i.create({..._.attrs,...e}))}}))}),y&&(m!==void 0&&o&&n.setNodeMarkup(m,void 0,{...y.attrs,...e}),i&&y.marks.length&&y.marks.forEach(k=>{i===k.type&&o&&n.addMark(v,b,i.create({...k.attrs,...e}))}))}),u},NB=(t,e={})=>({state:n,dispatch:r})=>{const o=Bt(t,n.schema);return tz(o,e)(n,r)},DB=(t,e={})=>({state:n,dispatch:r})=>{const o=Bt(t,n.schema);return nz(o,e)(n,r)},RB=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach(r=>r.apply(this,e)),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(r=>r!==e):delete this.callbacks[t]),this}once(t,e){const n=(...r)=>{this.off(t,n),e.apply(this,r)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}};function OB(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof Oe){const s=r.index();return r.parent.canReplaceWith(s,s+1,e)}let o=r.depth;for(;o>=0;){const s=r.index(o);if(r.node(o).contentMatchAt(s).matchType(e))return!0;o-=1}return!1}function IB(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const o=document.createElement("style");return e&&o.setAttribute("nonce",e),o.setAttribute("data-tiptap-style",""),o.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(o),o}function PB(t){return typeof t=="number"}function jB(t){return Object.prototype.toString.call(t).slice(8,-1)}function ff(t){return jB(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}var LB={};Mx(LB,{createAtomBlockMarkdownSpec:()=>zB,createBlockMarkdownSpec:()=>FB,createInlineMarkdownSpec:()=>VB,parseAttributes:()=>Ix,parseIndentedBlocks:()=>J1,renderNestedMarkdownContent:()=>jx,serializeAttributes:()=>Px});function Ix(t){if(!(t!=null&&t.trim()))return{};const e={},n=[],r=t.replace(/["']([^"']*)["']/g,d=>(n.push(d),`__QUOTED_${n.length-1}__`)),o=r.match(/(?:^|\s)\.([\w-]+)/g);if(o){const d=o.map(f=>f.trim().slice(1));e.class=d.join(" ")}const s=r.match(/(?:^|\s)#([\w-]+)/);s&&(e.id=s[1]);const i=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(i)).forEach(([,d,f])=>{var p;const m=parseInt(((p=f.match(/__QUOTED_(\d+)__/))==null?void 0:p[1])||"0",10),y=n[m];y&&(e[d]=y.slice(1,-1))});const u=r.replace(/(?:^|\s)\.([\w-]+)/g,"").replace(/(?:^|\s)#([\w-]+)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return u&&u.split(/\s+/).filter(Boolean).forEach(f=>{f.match(/^[a-zA-Z][\w-]*$/)&&(e[f]=!0)}),e}function Px(t){if(!t||Object.keys(t).length===0)return"";const e=[];return t.class&&String(t.class).split(/\s+/).filter(Boolean).forEach(r=>e.push(`.${r}`)),t.id&&e.push(`#${t.id}`),Object.entries(t).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?e.push(n):r!==!1&&r!=null&&e.push(`${n}="${String(r)}"`))}),e.join(" ")}function zB(t){const{nodeName:e,name:n,parseAttributes:r=Ix,serializeAttributes:o=Px,defaultAttributes:s={},requiredAttributes:i=[],allowedAttributes:l}=t,u=n||e,d=f=>{if(!l)return f;const p={};return l.forEach(m=>{m in f&&(p[m]=f[m])}),p};return{parseMarkdown:(f,p)=>{const m={...s,...f.attributes};return p.createNode(e,m,[])},markdownTokenizer:{name:e,level:"block",start(f){var p;const m=new RegExp(`^:::${u}(?:\\s|$)`,"m"),y=(p=f.match(m))==null?void 0:p.index;return y!==void 0?y:-1},tokenize(f,p,m){const y=new RegExp(`^:::${u}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),v=f.match(y);if(!v)return;const b=v[1]||"",k=r(b);if(!i.find(_=>!(_ in k)))return{type:e,raw:v[0],attributes:k}}},renderMarkdown:f=>{const p=d(f.attrs||{}),m=o(p),y=m?` {${m}}`:"";return`:::${u}${y} :::`}}}function FB(t){const{nodeName:e,name:n,getContent:r,parseAttributes:o=Ix,serializeAttributes:s=Px,defaultAttributes:i={},content:l="block",allowedAttributes:u}=t,d=n||e,f=p=>{if(!u)return p;const m={};return u.forEach(y=>{y in p&&(m[y]=p[y])}),m};return{parseMarkdown:(p,m)=>{let y;if(r){const b=r(p);y=typeof b=="string"?[{type:"text",text:b}]:b}else l==="block"?y=m.parseChildren(p.tokens||[]):y=m.parseInline(p.tokens||[]);const v={...i,...p.attributes};return m.createNode(e,v,y)},markdownTokenizer:{name:e,level:"block",start(p){var m;const y=new RegExp(`^:::${d}`,"m"),v=(m=p.match(y))==null?void 0:m.index;return v!==void 0?v:-1},tokenize(p,m,y){var v;const b=new RegExp(`^:::${d}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),k=p.match(b);if(!k)return;const[E,_=""]=k,T=o(_);let A=1;const N=E.length;let D="";const I=/^:::([\w-]*)(\s.*)?/gm,P=p.slice(N);for(I.lastIndex=0;;){const O=I.exec(P);if(O===null)break;const U=O.index,J=O[1];if(!((v=O[2])!=null&&v.endsWith(":::"))){if(J)A+=1;else if(A-=1,A===0){const K=P.slice(0,U);D=K.trim();const q=p.slice(0,N+U+O[0].length);let Z=[];if(D)if(l==="block")for(Z=y.blockTokens(K),Z.forEach(Q=>{Q.text&&(!Q.tokens||Q.tokens.length===0)&&(Q.tokens=y.inlineTokens(Q.text))});Z.length>0;){const Q=Z[Z.length-1];if(Q.type==="paragraph"&&(!Q.text||Q.text.trim()===""))Z.pop();else break}else Z=y.inlineTokens(D);return{type:e,raw:q,attributes:T,content:D,tokens:Z}}}}}},renderMarkdown:(p,m)=>{const y=f(p.attrs||{}),v=s(y),b=v?` {${v}}`:"",k=m.renderChildren(p.content||[],`
435
-
436
- `);return`:::${d}${b}
437
-
438
- ${k}
439
-
440
- :::`}}}function $B(t){if(!t.trim())return{};const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(t);for(;r!==null;){const[,o,s,i]=r;e[o]=s||i,r=n.exec(t)}return e}function BB(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}function VB(t){const{nodeName:e,name:n,getContent:r,parseAttributes:o=$B,serializeAttributes:s=BB,defaultAttributes:i={},selfClosing:l=!1,allowedAttributes:u}=t,d=n||e,f=m=>{if(!u)return m;const y={};return u.forEach(v=>{const b=typeof v=="string"?v:v.name,k=typeof v=="string"?void 0:v.skipIfDefault;if(b in m){const E=m[b];if(k!==void 0&&E===k)return;y[b]=E}}),y},p=d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(m,y)=>{const v={...i,...m.attributes};if(l)return y.createNode(e,v);const b=r?r(m):m.content||"";return b?y.createNode(e,v,[y.createTextNode(b)]):y.createNode(e,v,[])},markdownTokenizer:{name:e,level:"inline",start(m){const y=l?new RegExp(`\\[${p}\\s*[^\\]]*\\]`):new RegExp(`\\[${p}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${p}\\]`),v=m.match(y),b=v==null?void 0:v.index;return b!==void 0?b:-1},tokenize(m,y,v){const b=l?new RegExp(`^\\[${p}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${p}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${p}\\]`),k=m.match(b);if(!k)return;let E="",_="";if(l){const[,A]=k;_=A}else{const[,A,N]=k;_=A,E=N||""}const T=o(_.trim());return{type:e,raw:k[0],content:E.trim(),attributes:T}}},renderMarkdown:m=>{let y="";r?y=r(m):m.content&&m.content.length>0&&(y=m.content.filter(E=>E.type==="text").map(E=>E.text).join(""));const v=f(m.attrs||{}),b=s(v),k=b?` ${b}`:"";return l?`[${d}${k}]`:`[${d}${k}]${y}[/${d}]`}}}function J1(t,e,n){var r,o,s,i;const l=t.split(`
441
- `),u=[];let d="",f=0;const p=e.baseIndentSize||2;for(;f<l.length;){const m=l[f],y=m.match(e.itemPattern);if(!y){if(u.length>0)break;if(m.trim()===""){f+=1,d=`${d}${m}
442
- `;continue}else return}const v=e.extractItemData(y),{indentLevel:b,mainContent:k}=v;d=`${d}${m}
443
- `;const E=[k];for(f+=1;f<l.length;){const N=l[f];if(N.trim()===""){const I=l.slice(f+1).findIndex(U=>U.trim()!=="");if(I===-1)break;if((((o=(r=l[f+1+I].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:o.length)||0)>b){E.push(N),d=`${d}${N}
444
- `,f+=1;continue}else break}if((((i=(s=N.match(/^(\s*)/))==null?void 0:s[1])==null?void 0:i.length)||0)>b)E.push(N),d=`${d}${N}
445
- `,f+=1;else break}let _;const T=E.slice(1);if(T.length>0){const N=T.map(D=>D.slice(b+p)).join(`
446
- `);N.trim()&&(e.customNestedParser?_=e.customNestedParser(N):_=n.blockTokens(N))}const A=e.createToken(v,_);u.push(A)}if(u.length!==0)return{items:u,raw:d}}function jx(t,e,n,r){if(!t||!Array.isArray(t.content))return"";const o=typeof n=="function"?n(r):n,[s,...i]=t.content,l=e.renderChildren([s]);let u=`${o}${l}`;return i&&i.length>0&&i.forEach((d,f)=>{var p,m;const y=(m=(p=e.renderChild)==null?void 0:p.call(e,d,f+1))!=null?m:e.renderChildren([d]);if(y!=null){const v=y.split(`
447
- `).map(b=>b?e.indent(b):e.indent("")).join(`
448
- `);u+=d.type==="paragraph"?`
449
-
450
- ${v}`:`
451
- ${v}`}}),u}function f6(t,e){const n={...t};return ff(t)&&ff(e)&&Object.keys(e).forEach(r=>{ff(e[r])&&ff(t[r])?n[r]=f6(t[r],e[r]):n[r]=e[r]}),n}function HB(t,e,n={}){const{state:r}=e,{doc:o,tr:s}=r,i=t;o.descendants((l,u)=>{const d=s.mapping.map(u),f=s.mapping.map(u)+l.nodeSize;let p=null;if(l.marks.forEach(y=>{if(y!==i)return!1;p=y}),!p)return;let m=!1;if(Object.keys(n).forEach(y=>{n[y]!==p.attrs[y]&&(m=!0)}),m){const y=t.type.create({...t.attrs,...n});s.removeMark(d,f,t.type),s.addMark(d,f,y)}}),s.docChanged&&e.view.dispatch(s)}var Ic=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!=null?e:!0}},UB=(t,e)=>{if(Ax(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function hf(t){var e;const{editor:n,from:r,to:o,text:s,rules:i,plugin:l}=t,{view:u}=n;if(u.composing)return!1;const d=u.state.doc.resolve(r);if(d.parent.type.spec.code||(e=d.nodeBefore||d.nodeAfter)!=null&&e.marks.find(m=>m.type.spec.code))return!1;let f=!1;const p=oB(d)+s;return i.forEach(m=>{if(f)return;const y=UB(p,m.find);if(!y)return;const v=y[0].length-s.length;if(v>0){const D=d.parentOffset-v;if(D<0||d.parent.textBetween(D,d.parentOffset)!==y[0].slice(0,v))return}const b=u.state.tr,k=Np({state:u.state,transaction:b}),E={from:r-(y[0].length-s.length),to:o},{commands:_,chain:T,can:A}=new Dp({editor:n,state:k});m.handler({state:k,range:E,match:y,commands:_,chain:T,can:A})===null||!b.steps.length||(m.undoable&&b.setMeta(l,{transform:b,from:r,to:o,text:s}),u.dispatch(b),f=!0)}),f}function WB(t){const{editor:e,rules:n}=t,r=new wt({state:{init(){return null},apply(o,s,i){const l=o.getMeta(r);if(l)return l;const u=o.getMeta("applyInputRules");return!!u&&setTimeout(()=>{let{text:f}=u;typeof f=="string"?f=f:f=Rc(re.from(f),i.schema);const{from:p}=u,m=p+f.length;hf({editor:e,from:p,to:m,text:f,rules:n,plugin:r})}),o.selectionSet||o.docChanged?null:s}},props:{handleTextInput(o,s,i,l){return hf({editor:e,from:s,to:i,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:s}=o.state.selection;s&&hf({editor:e,from:s.pos,to:s.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(o,s){if(s.key!=="Enter")return!1;const{$cursor:i}=o.state.selection;return i?hf({editor:e,from:i.pos,to:i.pos,text:`
452
- `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var Lx=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...at(Me(this,"addOptions",{name:this.name}))}}get storage(){return{...at(Me(this,"addStorage",{name:this.name,options:this.options}))}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>f6(this.options,t)});return e.name=this.name,e.parent=this.parent,this.child=null,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},fr=class h6 extends Lx{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new h6(n)}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,o=e.state.selection.$from;if(o.pos===o.end()){const i=o.marks();if(!!!i.find(d=>(d==null?void 0:d.type.name)===n.name))return!1;const u=i.find(d=>(d==null?void 0:d.type.name)===n.name);return u&&r.removeStoredMark(u),r.insertText(" ",o.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},p6=class{constructor(t){this.find=t.find,this.handler=t.handler}},qB=(t,e,n)=>{if(Ax(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(o=>{const s=[o.text];return s.index=o.index,s.input=t,s.data=o.data,o.replaceWith&&(o.text.includes(o.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(o.replaceWith)),s}):[]};function KB(t){const{editor:e,state:n,from:r,to:o,rule:s,pasteEvent:i,dropEvent:l}=t,{commands:u,chain:d,can:f}=new Dp({editor:e,state:n}),p=[];return n.doc.nodesBetween(r,o,(y,v)=>{var b,k,E,_,T;if((k=(b=y.type)==null?void 0:b.spec)!=null&&k.code||!(y.isText||y.isTextblock||y.isInline))return;const A=(T=(_=(E=y.content)==null?void 0:E.size)!=null?_:y.nodeSize)!=null?T:0,N=Math.max(r,v),D=Math.min(o,v+A);if(N>=D)return;const I=y.isText?y.text||"":y.textBetween(N-v,D-v,void 0,"");qB(I,s.find,i).forEach(O=>{if(O.index===void 0)return;const U=N+O.index+1,J=U+O[0].length,K={from:n.tr.mapping.map(U),to:n.tr.mapping.map(J)},q=s.handler({state:n,range:K,match:O,commands:u,chain:d,can:f,pasteEvent:i,dropEvent:l});p.push(q)})}),p.every(y=>y!==null)}var pf=null,GB=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)==null||e.setData("text/html",t),n};function JB(t){const{editor:e,rules:n}=t;let r=null,o=!1,s=!1,i=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}const u=({state:f,from:p,to:m,rule:y,pasteEvt:v})=>{const b=f.tr,k=Np({state:f,transaction:b});if(!(!KB({editor:e,state:k,from:Math.max(p-1,0),to:m.b-1,rule:y,pasteEvent:v,dropEvent:l})||!b.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return i=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,b}};return n.map(f=>new wt({view(p){const m=v=>{var b;r=(b=p.dom.parentElement)!=null&&b.contains(v.target)?p.dom.parentElement:null,r&&(pf=e)},y=()=>{pf&&(pf=null)};return window.addEventListener("dragstart",m),window.addEventListener("dragend",y),{destroy(){window.removeEventListener("dragstart",m),window.removeEventListener("dragend",y)}}},props:{handleDOMEvents:{drop:(p,m)=>{if(s=r===p.dom.parentElement,l=m,!s){const y=pf;y!=null&&y.isEditable&&setTimeout(()=>{const v=y.state.selection;v&&y.commands.deleteRange({from:v.from,to:v.to})},10)}return!1},paste:(p,m)=>{var y;const v=(y=m.clipboardData)==null?void 0:y.getData("text/html");return i=m,o=!!(v!=null&&v.includes("data-pm-slice")),!1}}},appendTransaction:(p,m,y)=>{const v=p[0],b=v.getMeta("uiEvent")==="paste"&&!o,k=v.getMeta("uiEvent")==="drop"&&!s,E=v.getMeta("applyPasteRules"),_=!!E;if(!b&&!k&&!_)return;if(_){let{text:N}=E;typeof N=="string"?N=N:N=Rc(re.from(N),y.schema);const{from:D}=E,I=D+N.length,P=GB(N);return u({rule:f,state:y,from:D,to:{b:I},pasteEvt:P})}const T=m.doc.content.findDiffStart(y.doc.content),A=m.doc.content.findDiffEnd(y.doc.content);if(!(!PB(T)||!A||T===A.b))return u({rule:f,state:y,from:T,to:A,pasteEvt:i})}}))}var Ip=class{constructor(t,e){this.splittableMarks=[],this.nonClearableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=o6(t),this.schema=Y$(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:cu(e.name,this.schema)},r=Me(e,"addCommands",n);return r?{...t,...r()}:t},{})}get plugins(){const{editor:t}=this;return _u([...this.extensions].reverse()).flatMap(r=>{const o={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:cu(r.name,this.schema)},s=[],i=Me(r,"addKeyboardShortcuts",o);let l={};if(r.type==="mark"&&Me(r,"exitable",o)&&(l.ArrowRight=()=>fr.handleExit({editor:t,mark:r})),i){const m=Object.fromEntries(Object.entries(i()).map(([y,v])=>[y,()=>v({editor:t})]));l={...l,...m}}const u=XF(l);s.push(u);const d=Me(r,"addInputRules",o);if(gC(r,t.options.enableInputRules)&&d){const m=d();if(m&&m.length){const y=WB({editor:t,rules:m}),v=Array.isArray(y)?y:[y];s.push(...v)}}const f=Me(r,"addPasteRules",o);if(gC(r,t.options.enablePasteRules)&&f){const m=f();if(m&&m.length){const y=JB({editor:t,rules:m});s.push(...y)}}const p=Me(r,"addProseMirrorPlugins",o);if(p){const m=p();s.push(...m)}return s})}get attributes(){return r6(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=cl(this.extensions);return Object.fromEntries(e.filter(n=>!!Me(n,"addNodeView")).map(n=>{const r=this.attributes.filter(u=>u.type===n.name),o={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Bt(n.name,this.schema)},s=Me(n,"addNodeView",o);if(!s)return[];const i=s();if(!i)return[];const l=(u,d,f,p,m)=>{const y=oc(u,r);return i({node:u,view:d,getPos:f,decorations:p,innerDecorations:m,editor:t,extension:n,HTMLAttributes:y})};return[n.name,l]}))}dispatchTransaction(t){const{editor:e}=this;return _u([...this.extensions].reverse()).reduceRight((r,o)=>{const s={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:e,type:cu(o.name,this.schema)},i=Me(o,"dispatchTransaction",s);return i?l=>{i.call(s,{transaction:l,next:r})}:r},t)}transformPastedHTML(t){const{editor:e}=this;return _u([...this.extensions]).reduce((r,o)=>{const s={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:e,type:cu(o.name,this.schema)},i=Me(o,"transformPastedHTML",s);return i?(l,u)=>{const d=r(l,u);return i.call(s,d)}:r},t||(r=>r))}get markViews(){const{editor:t}=this,{markExtensions:e}=cl(this.extensions);return Object.fromEntries(e.filter(n=>!!Me(n,"addMarkView")).map(n=>{const r=this.attributes.filter(l=>l.type===n.name),o={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:cs(n.name,this.schema)},s=Me(n,"addMarkView",o);if(!s)return[];const i=(l,u,d)=>{const f=oc(l,r);return s()({mark:l,view:u,inline:d,editor:t,extension:n,HTMLAttributes:f,updateAttributes:p=>{HB(l,t,p)}})};return[n.name,i]}))}destroy(){this.extensions.forEach(t=>{let e=t;for(;e.parent;){const n=e.parent;n.child===e&&(n.child=null),e=n}}),this.extensions=[],this.baseExtensions=[],this.schema=null,this.editor=null}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var n,r;const o={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:cu(e.name,this.schema)};e.type==="mark"&&(((n=at(Me(e,"keepOnSplit",o)))==null||n)&&this.splittableMarks.push(e.name),(r=at(Me(e,"clearable",o)))==null||r||this.nonClearableMarks.push(e.name));const s=Me(e,"onBeforeCreate",o),i=Me(e,"onCreate",o),l=Me(e,"onUpdate",o),u=Me(e,"onSelectionUpdate",o),d=Me(e,"onTransaction",o),f=Me(e,"onFocus",o),p=Me(e,"onBlur",o),m=Me(e,"onDestroy",o);s&&this.editor.on("beforeCreate",s),i&&this.editor.on("create",i),l&&this.editor.on("update",l),u&&this.editor.on("selectionUpdate",u),d&&this.editor.on("transaction",d),f&&this.editor.on("focus",f),p&&this.editor.on("blur",p),m&&this.editor.on("destroy",m)})}};Ip.resolve=o6;Ip.sort=_u;Ip.flatten=Dx;var m6={};Mx(m6,{ClipboardTextSerializer:()=>y6,Commands:()=>x6,Delete:()=>v6,Drop:()=>b6,Editable:()=>k6,FocusEvents:()=>C6,Keymap:()=>S6,Paste:()=>E6,Tabindex:()=>_6,TextDirection:()=>T6,focusEventsPluginKey:()=>w6});var Ct=class g6 extends Lx{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new g6(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},y6=Ct.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new wt({key:new Vt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:o}=e,s=i6(n),{blockSeparator:i}=this.options,l={...i!==void 0?{blockSeparator:i}:{},textSerializers:s};return[...o.ranges].sort((d,f)=>d.$from.pos-f.$from.pos).map(({$from:d,$to:f})=>s6(r,{from:d.pos,to:f.pos},l)).join(i??`
453
-
454
- `)}}})]}}),x6=Ct.create({name:"commands",addCommands(){return{...K4}}}),v6=Ct.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r,o;const s=()=>{var i,l,u,d;if((d=(u=(l=(i=this.editor.options.coreExtensionOptions)==null?void 0:i.delete)==null?void 0:l.filterTransaction)==null?void 0:u.call(l,t))!=null?d:t.getMeta("y-sync$"))return;const f=t6(t.before,[t,...e]);Rx(f).forEach(y=>{f.mapping.mapResult(y.oldRange.from).deletedAfter&&f.mapping.mapResult(y.oldRange.to).deletedBefore&&f.before.nodesBetween(y.oldRange.from,y.oldRange.to,(v,b)=>{const k=b+v.nodeSize-2,E=y.oldRange.from<=b&&k<=y.oldRange.to;this.editor.emit("delete",{type:"node",node:v,from:b,to:k,newFrom:f.mapping.map(b),newTo:f.mapping.map(k),deletedRange:y.oldRange,newRange:y.newRange,partial:!E,editor:this.editor,transaction:t,combinedTransform:f})})});const m=f.mapping;f.steps.forEach((y,v)=>{var b,k;if(y instanceof Hr){const E=m.slice(v).map(y.from,-1),_=m.slice(v).map(y.to),T=m.invert().map(E,-1),A=m.invert().map(_),N=E>0?(b=f.doc.nodeAt(E-1))==null?void 0:b.marks.some(I=>I.eq(y.mark)):!1,D=(k=f.doc.nodeAt(_))==null?void 0:k.marks.some(I=>I.eq(y.mark));this.editor.emit("delete",{type:"mark",mark:y.mark,from:y.from,to:y.to,deletedRange:{from:T,to:A},newRange:{from:E,to:_},partial:!!(D||N),editor:this.editor,transaction:t,combinedTransform:f})}})};(o=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||o?setTimeout(s,0):s()}}),b6=Ct.create({name:"drop",addProseMirrorPlugins(){return[new wt({key:new Vt("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),k6=Ct.create({name:"editable",addProseMirrorPlugins(){return[new wt({key:new Vt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),w6=new Vt("focusEvents"),C6=Ct.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new wt({key:w6,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),S6=Ct.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:i})=>[()=>i.undoInputRule(),()=>i.command(({tr:l})=>{const{selection:u,doc:d}=l,{empty:f,$anchor:p}=u,{pos:m,parent:y}=p,v=p.parent.isTextblock&&m>0?l.doc.resolve(m-1):p,b=v.parent.type.spec.isolating,k=p.pos-p.parentOffset,E=b&&v.parent.childCount===1?k===p.pos:He.atStart(d).from===m;return!f||!y.type.isTextblock||y.textContent.length||!E||E&&p.parent.type.name==="paragraph"?!1:i.clearNodes()}),()=>i.deleteSelection(),()=>i.joinBackward(),()=>i.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:i})=>[()=>i.deleteSelection(),()=>i.deleteCurrentNode(),()=>i.joinForward(),()=>i.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:i})=>[()=>i.newlineInCode(),()=>i.createParagraphNear(),()=>i.liftEmptyBlock(),()=>i.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},s={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return fh()||Q4()?s:o},addProseMirrorPlugins(){return[new wt({key:new Vt("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(b=>b.getMeta("composition")))return;const r=t.some(b=>b.docChanged)&&!e.doc.eq(n.doc),o=t.some(b=>b.getMeta("preventClearDocument"));if(!r||o)return;const{empty:s,from:i,to:l}=e.selection,u=He.atStart(e.doc).from,d=He.atEnd(e.doc).to;if(s||!(i===u&&l===d)||!Oc(n.doc))return;const m=n.tr,y=Np({state:n,transaction:m}),{commands:v}=new Dp({editor:this.editor,state:y});if(v.clearNodes(),!!m.steps.length)return m}})]}}),E6=Ct.create({name:"paste",addProseMirrorPlugins(){return[new wt({key:new Vt("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),_6=Ct.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new wt({key:new Vt("tabindex"),props:{attributes:()=>{var t;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(t=this.options.value)!=null?t:"0"}}}})]}}),T6=Ct.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=cl(this.extensions);return[{types:t.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const n=e.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new wt({key:new Vt("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}}),ZB=class vu{constructor(e,n,r=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=o}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new vu(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new vu(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new vu(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const o=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,i=n.isInline,l=this.pos+r+(s?0:1);if(l<0||l>this.resolvedPos.doc.nodeSize-2)return;const u=this.resolvedPos.doc.resolve(l);if(!o&&!i&&u.depth<=this.depth)return;const d=new vu(u,this.editor,o,o||i?n:null);o&&(d.actualDepth=this.depth+1),e.push(d)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,o=this.parent;for(;o&&!r;){if(o.node.type.name===e)if(Object.keys(n).length>0){const s=o.node.attrs,i=Object.keys(n);for(let l=0;l<i.length;l+=1){const u=i[l];if(s[u]!==n[u])break}}else r=o;o=o.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let o=[];if(!this.children||this.children.length===0)return o;const s=Object.keys(n);return this.children.forEach(i=>{r&&o.length>0||(i.node.type.name===e&&s.every(u=>n[u]===i.node.attrs[u])&&o.push(i),!(r&&o.length>0)&&(o=o.concat(i.querySelectorAll(e,n,r))))}),o}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},YB=`.ProseMirror {
455
- position: relative;
456
- }
457
-
458
- .ProseMirror {
459
- word-wrap: break-word;
460
- white-space: pre-wrap;
461
- white-space: break-spaces;
462
- -webkit-font-variant-ligatures: none;
463
- font-variant-ligatures: none;
464
- font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
465
- }
466
-
467
- .ProseMirror [contenteditable="false"] {
468
- white-space: normal;
469
- }
470
-
471
- .ProseMirror [contenteditable="false"] [contenteditable="true"] {
472
- white-space: pre-wrap;
473
- }
474
-
475
- .ProseMirror pre {
476
- white-space: pre-wrap;
477
- }
478
-
479
- img.ProseMirror-separator {
480
- display: inline !important;
481
- border: none !important;
482
- margin: 0 !important;
483
- width: 0 !important;
484
- height: 0 !important;
485
- }
486
-
487
- .ProseMirror-gapcursor {
488
- display: none;
489
- pointer-events: none;
490
- position: absolute;
491
- margin: 0;
492
- }
493
-
494
- .ProseMirror-gapcursor:after {
495
- content: "";
496
- display: block;
497
- position: absolute;
498
- top: -2px;
499
- width: 20px;
500
- border-top: 1px solid black;
501
- animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
502
- }
503
-
504
- @keyframes ProseMirror-cursor-blink {
505
- to {
506
- visibility: hidden;
507
- }
508
- }
509
-
510
- .ProseMirror-hideselection *::selection {
511
- background: transparent;
512
- }
513
-
514
- .ProseMirror-hideselection *::-moz-selection {
515
- background: transparent;
516
- }
517
-
518
- .ProseMirror-hideselection * {
519
- caret-color: transparent;
520
- }
521
-
522
- .ProseMirror-focused .ProseMirror-gapcursor {
523
- display: block;
524
- }`,XB=class extends RB{constructor(t={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:lB,createMappablePosition:uB},this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:r,moved:o})=>this.options.onDrop(n,r,o)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),this.on("delete",this.options.onDelete);const e=this.createDoc();if(!this.editorState){const n=q1(e,this.options.autofocus);this.editorState=ji.create({doc:e,schema:this.schema,selection:n||void 0})}this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const t=this.editorView.dom;t!=null&&t.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=IB(YB,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const n=n6(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach(o=>{const s=typeof o=="string"?`${o}$`:o.key;n=n.filter(i=>!i.key.startsWith(s))}),e.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var t,e,n,r;const s=[...this.options.enableCoreExtensions?[k6,y6.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),x6,C6,S6,_6.configure({value:(r=(n=this.options.coreExtensionOptions)==null?void 0:n.tabindex)==null?void 0:r.value}),b6,E6,v6,T6.configure({direction:this.options.textDirection})].filter(i=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[i.name]!==!1:!0):[],...this.options.extensions].filter(i=>["extension","node","mark"].includes(i==null?void 0:i.type));this.extensionManager=new Ip(s,this)}createCommandManager(){this.commandManager=new Dp({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=K1(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;const n=K1(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=ji.create({doc:n,schema:this.schema,selection:q1(n,this.options.autofocus)||void 0}),this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(r=>r.name!=="collaboration"),this.createExtensionManager()}}),this.editorState.doc}return t}createView(t){const{editorProps:e,enableExtensionDispatchTransaction:n}=this.options,r=e.dispatchTransaction||this.dispatchTransaction.bind(this),o=n?this.extensionManager.dispatchTransaction(r):r,s=e.transformPastedHTML,i=this.extensionManager.transformPastedHTML(s);this.editorView=new W4(t,{...e,attributes:{role:"textbox",...e==null?void 0:e.attributes},dispatchTransaction:o,transformPastedHTML:i,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const l=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(l),this.prependClass(),this.injectCSS();const u=this.view.dom;u.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(d=>{var f;return(f=this.capturedTransaction)==null?void 0:f.step(d)});return}const{state:e,transactions:n}=this.state.applyTransaction(t),r=!this.state.selection.eq(e.selection),o=n.includes(t),s=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!o)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const i=n.findLast(d=>d.getMeta("focus")||d.getMeta("blur")),l=i==null?void 0:i.getMeta("focus"),u=i==null?void 0:i.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:i}),u&&this.emit("blur",{editor:this,event:u.event,transaction:i}),!(t.getMeta("preventUpdate")||!n.some(d=>d.docChanged)||s.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:t,appendedTransactions:n.slice(1)})}getAttributes(t){return a6(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return sB(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Rc(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
525
-
526
- `,textSerializers:n={}}=t||{};return Q$(this.state.doc,{blockSeparator:e,textSerializers:{...i6(this.schema),...n}})}get isEmpty(){return Oc(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var t,e;return(e=(t=this.editorView)==null?void 0:t.isDestroyed)!=null?e:!0}$node(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t),n=t>0&&e.nodeAfter&&!e.nodeAfter.isText&&e.nodeAfter.isAtom?e.nodeAfter:null;return new ZB(e,this,!1,n)}get $doc(){return this.$pos(0)}};function oa(t){return new Ic({find:t.find,handler:({state:e,range:n,match:r})=>{const o=at(t.getAttributes,void 0,r);if(o===!1||o===null)return null;const{tr:s}=e,i=r[r.length-1],l=r[0];if(i){const u=l.search(/\S/),d=n.from+l.indexOf(i),f=d+i.length;if(Ox(n.from,n.to,e.doc).filter(y=>y.mark.type.excluded.find(b=>b===t.type&&b!==y.mark.type)).filter(y=>y.to>d).length)return null;f<n.to&&s.delete(f,n.to),d>n.from&&s.delete(n.from+u,d);const m=n.from+u+i.length;s.addMark(n.from+u,m,t.type.create(o||{})),s.removeStoredMark(t.type)}},undoable:t.undoable})}function QB(t){return new Ic({find:t.find,handler:({state:e,range:n,match:r})=>{const o=at(t.getAttributes,void 0,r)||{},{tr:s}=e,i=n.from;let l=n.to;const u=t.type.create(o);if(r[1]){const d=r[0].lastIndexOf(r[1]);let f=i+d;f>l?f=l:l=f+r[1].length;const p=r[0][r[0].length-1];s.insertText(p,i+r[0].length-1),s.replaceWith(f,l,u)}else if(r[0]){const d=t.type.isInline?i:i-1;s.insert(d,t.type.create(o)).delete(s.mapping.map(i),s.mapping.map(l))}s.scrollIntoView()},undoable:t.undoable})}function Z1(t){return new Ic({find:t.find,handler:({state:e,range:n,match:r})=>{const o=e.doc.resolve(n.from),s=at(t.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)},undoable:t.undoable})}function dl(t){return new Ic({find:t.find,handler:({state:e,range:n,match:r,chain:o})=>{const s=at(t.getAttributes,void 0,r)||{},i=e.tr.delete(n.from,n.to),u=i.doc.resolve(n.from).blockRange(),d=u&&hx(u,t.type,s);if(!d)return null;if(i.wrap(u,d),t.keepMarks&&t.editor){const{selection:p,storedMarks:m}=e,{splittableMarks:y}=t.editor.extensionManager,v=m||p.$to.parentOffset&&p.$from.marks();if(v){const b=v.filter(k=>y.includes(k.type.name));i.ensureMarks(b)}}if(t.keepAttributes){const p=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";o().updateAttributes(p,s).run()}const f=i.doc.resolve(n.from-1).nodeBefore;f&&f.type===t.type&&hi(i.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,f))&&i.join(n.from-1)},undoable:t.undoable})}var ft=class M6 extends Lx{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new M6(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function li(t){return new p6({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:o})=>{const s=at(t.getAttributes,void 0,r,o);if(s===!1||s===null)return null;const{tr:i}=e,l=r[r.length-1],u=r[0];let d=n.to;if(l){const f=u.search(/\S/),p=n.from+u.indexOf(l),m=p+l.length;if(Ox(n.from,n.to,e.doc).filter(b=>b.mark.type.excluded.find(E=>E===t.type&&E!==b.mark.type)).filter(b=>b.to>p).length)return null;m<n.to&&i.delete(m,n.to),p>n.from&&i.delete(n.from+f,p),d=n.from+f+l.length,i.addMark(n.from+f,d,t.type.create(s||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||i.removeStoredMark(t.type)}}})}const{getOwnPropertyNames:eV,getOwnPropertySymbols:tV}=Object,{hasOwnProperty:nV}=Object.prototype;function bg(t,e){return function(r,o,s){return t(r,o,s)&&e(r,o,s)}}function mf(t){return function(n,r,o){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,o);const{cache:s}=o,i=s.get(n),l=s.get(r);if(i&&l)return i===r&&l===n;s.set(n,r),s.set(r,n);const u=t(n,r,o);return s.delete(n),s.delete(r),u}}function rV(t){return t!=null?t[Symbol.toStringTag]:void 0}function vC(t){return eV(t).concat(tV(t))}const oV=Object.hasOwn||((t,e)=>nV.call(t,e));function fa(t,e){return t===e||!t&&!e&&t!==t&&e!==e}const sV="__v",iV="__o",aV="_owner",{getOwnPropertyDescriptor:bC,keys:kC}=Object;function lV(t,e){return t.byteLength===e.byteLength&&hh(new Uint8Array(t),new Uint8Array(e))}function uV(t,e,n){let r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function cV(t,e){return t.byteLength===e.byteLength&&hh(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function dV(t,e){return fa(t.getTime(),e.getTime())}function fV(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function hV(t,e){return t===e}function wC(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const o=new Array(r),s=t.entries();let i,l,u=0;for(;(i=s.next())&&!i.done;){const d=e.entries();let f=!1,p=0;for(;(l=d.next())&&!l.done;){if(o[p]){p++;continue}const m=i.value,y=l.value;if(n.equals(m[0],y[0],u,p,t,e,n)&&n.equals(m[1],y[1],m[0],y[0],t,e,n)){f=o[p]=!0;break}p++}if(!f)return!1;u++}return!0}const pV=fa;function mV(t,e,n){const r=kC(t);let o=r.length;if(kC(e).length!==o)return!1;for(;o-- >0;)if(!A6(t,e,n,r[o]))return!1;return!0}function du(t,e,n){const r=vC(t);let o=r.length;if(vC(e).length!==o)return!1;let s,i,l;for(;o-- >0;)if(s=r[o],!A6(t,e,n,s)||(i=bC(t,s),l=bC(e,s),(i||l)&&(!i||!l||i.configurable!==l.configurable||i.enumerable!==l.enumerable||i.writable!==l.writable)))return!1;return!0}function gV(t,e){return fa(t.valueOf(),e.valueOf())}function yV(t,e){return t.source===e.source&&t.flags===e.flags}function CC(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const o=new Array(r),s=t.values();let i,l;for(;(i=s.next())&&!i.done;){const u=e.values();let d=!1,f=0;for(;(l=u.next())&&!l.done;){if(!o[f]&&n.equals(i.value,l.value,i.value,l.value,t,e,n)){d=o[f]=!0;break}f++}if(!d)return!1}return!0}function hh(t,e){let n=t.byteLength;if(e.byteLength!==n||t.byteOffset!==e.byteOffset)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function xV(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function A6(t,e,n,r){return(r===aV||r===iV||r===sV)&&(t.$$typeof||e.$$typeof)?!0:oV(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}const vV="[object ArrayBuffer]",bV="[object Arguments]",kV="[object Boolean]",wV="[object DataView]",CV="[object Date]",SV="[object Error]",EV="[object Map]",_V="[object Number]",TV="[object Object]",MV="[object RegExp]",AV="[object Set]",NV="[object String]",DV={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},RV="[object URL]",OV=Object.prototype.toString;function IV({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:o,areFunctionsEqual:s,areMapsEqual:i,areNumbersEqual:l,areObjectsEqual:u,arePrimitiveWrappersEqual:d,areRegExpsEqual:f,areSetsEqual:p,areTypedArraysEqual:m,areUrlsEqual:y,unknownTagComparators:v}){return function(k,E,_){if(k===E)return!0;if(k==null||E==null)return!1;const T=typeof k;if(T!==typeof E)return!1;if(T!=="object")return T==="number"?l(k,E,_):T==="function"?s(k,E,_):!1;const A=k.constructor;if(A!==E.constructor)return!1;if(A===Object)return u(k,E,_);if(Array.isArray(k))return e(k,E,_);if(A===Date)return r(k,E,_);if(A===RegExp)return f(k,E,_);if(A===Map)return i(k,E,_);if(A===Set)return p(k,E,_);const N=OV.call(k);if(N===CV)return r(k,E,_);if(N===MV)return f(k,E,_);if(N===EV)return i(k,E,_);if(N===AV)return p(k,E,_);if(N===TV)return typeof k.then!="function"&&typeof E.then!="function"&&u(k,E,_);if(N===RV)return y(k,E,_);if(N===SV)return o(k,E,_);if(N===bV)return u(k,E,_);if(DV[N])return m(k,E,_);if(N===vV)return t(k,E,_);if(N===wV)return n(k,E,_);if(N===kV||N===_V||N===NV)return d(k,E,_);if(v){let D=v[N];if(!D){const I=rV(k);I&&(D=v[I])}if(D)return D(k,E,_)}return!1}}function PV({circular:t,createCustomConfig:e,strict:n}){let r={areArrayBuffersEqual:lV,areArraysEqual:n?du:uV,areDataViewsEqual:cV,areDatesEqual:dV,areErrorsEqual:fV,areFunctionsEqual:hV,areMapsEqual:n?bg(wC,du):wC,areNumbersEqual:pV,areObjectsEqual:n?du:mV,arePrimitiveWrappersEqual:gV,areRegExpsEqual:yV,areSetsEqual:n?bg(CC,du):CC,areTypedArraysEqual:n?bg(hh,du):hh,areUrlsEqual:xV,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),t){const o=mf(r.areArraysEqual),s=mf(r.areMapsEqual),i=mf(r.areObjectsEqual),l=mf(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:o,areMapsEqual:s,areObjectsEqual:i,areSetsEqual:l})}return r}function jV(t){return function(e,n,r,o,s,i,l){return t(e,n,l)}}function LV({circular:t,comparator:e,createState:n,equals:r,strict:o}){if(n)return function(l,u){const{cache:d=t?new WeakMap:void 0,meta:f}=n();return e(l,u,{cache:d,equals:r,meta:f,strict:o})};if(t)return function(l,u){return e(l,u,{cache:new WeakMap,equals:r,meta:void 0,strict:o})};const s={cache:void 0,equals:r,meta:void 0,strict:o};return function(l,u){return e(l,u,s)}}const zV=mi();mi({strict:!0});mi({circular:!0});mi({circular:!0,strict:!0});mi({createInternalComparator:()=>fa});mi({strict:!0,createInternalComparator:()=>fa});mi({circular:!0,createInternalComparator:()=>fa});mi({circular:!0,createInternalComparator:()=>fa,strict:!0});function mi(t={}){const{circular:e=!1,createInternalComparator:n,createState:r,strict:o=!1}=t,s=PV(t),i=IV(s),l=n?n(i):jV(i);return LV({circular:e,comparator:i,createState:r,equals:l,strict:o})}var kg={exports:{}},wg={};/**
527
- * @license React
528
- * use-sync-external-store-shim/with-selector.production.js
529
- *
530
- * Copyright (c) Meta Platforms, Inc. and affiliates.
531
- *
532
- * This source code is licensed under the MIT license found in the
533
- * LICENSE file in the root directory of this source tree.
534
- */var SC;function FV(){if(SC)return wg;SC=1;var t=gc(),e=h_();function n(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var r=typeof Object.is=="function"?Object.is:n,o=e.useSyncExternalStore,s=t.useRef,i=t.useEffect,l=t.useMemo,u=t.useDebugValue;return wg.useSyncExternalStoreWithSelector=function(d,f,p,m,y){var v=s(null);if(v.current===null){var b={hasValue:!1,value:null};v.current=b}else b=v.current;v=l(function(){function E(D){if(!_){if(_=!0,T=D,D=m(D),y!==void 0&&b.hasValue){var I=b.value;if(y(I,D))return A=I}return A=D}if(I=A,r(T,D))return I;var P=m(D);return y!==void 0&&y(I,P)?(T=D,I):(T=D,A=P)}var _=!1,T,A,N=p===void 0?null:p;return[function(){return E(f())},N===null?void 0:function(){return E(N())}]},[f,p,m,y]);var k=o(d,v[0],v[1]);return i(function(){b.hasValue=!0,b.value=k},[k]),u(k),k},wg}var EC;function $V(){return EC||(EC=1,kg.exports=FV()),kg.exports}var BV=$V(),VV=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},HV=({contentComponent:t})=>{const e=p_.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return x.jsx(x.Fragment,{children:Object.values(e)})};function UV(){const t=new Set;let e={},n=!1;const r=()=>{n||!t.size||(n=!0,queueMicrotask(()=>{n=!1,t.forEach(o=>o())}))};return{subscribe(o){return t.add(o),()=>{t.delete(o)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(o,s){e={...e,[o]:FS.createPortal(s.reactElement,s.element,o)},r()},removeRenderer(o){const s={...e};delete s[o],e=s,r()}}}var WV=class extends te.Component{constructor(t){super(t),this.editorContentRef=te.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var t;const e=this.props.editor;if(e&&!e.isDestroyed&&((t=e.view.dom)!=null&&t.parentNode)){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n}),e.contentComponent=UV(),e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){var t;const e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{if(!((t=e.view.dom)!=null&&t.parentNode))return;const n=document.createElement("div");n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n})}catch{}}}render(){const{editor:t,innerRef:e,...n}=this.props;return x.jsxs(x.Fragment,{children:[x.jsx("div",{ref:VV(e,this.editorContentRef),...n}),(t==null?void 0:t.contentComponent)&&x.jsx(HV,{contentComponent:t.contentComponent})]})}},qV=C.forwardRef((t,e)=>{const n=te.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return te.createElement(WV,{key:n,innerRef:e,...t})}),N6=te.memo(qV),KV=typeof window<"u"?C.useLayoutEffect:C.useEffect,GV=class{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){let e;const n=o=>{(o==null?void 0:o.transaction)!==void 0&&o.transaction===e||(e=o==null?void 0:o.transaction,this.transactionNumber+=1,this.subscribers.forEach(s=>s()))},r=this.editor;return r.on("transaction",n),r.on("update",n),()=>{r.off("transaction",n),r.off("update",n)}}}};function JV(t){var e;const[n]=C.useState(()=>new GV(t.editor)),r=BV.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!=null?e:zV);return KV(()=>n.watch(t.editor),[t.editor,n]),C.useDebugValue(r),r}var ZV=!1,D6=typeof window>"u",YV=D6||!!(typeof window<"u"&&window.next),XV=class R6{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){const e=this.options.current.immediatelyRender;let n=e??!0;return D6?(n&&ZV&&console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"),n=!1):YV&&e===void 0&&(n=!1),n?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var o,s;return(s=(o=this.options.current).onBeforeCreate)==null?void 0:s.call(o,...r)},onBlur:(...r)=>{var o,s;return(s=(o=this.options.current).onBlur)==null?void 0:s.call(o,...r)},onCreate:(...r)=>{var o,s;return(s=(o=this.options.current).onCreate)==null?void 0:s.call(o,...r)},onDestroy:(...r)=>{var o,s;return(s=(o=this.options.current).onDestroy)==null?void 0:s.call(o,...r)},onFocus:(...r)=>{var o,s;return(s=(o=this.options.current).onFocus)==null?void 0:s.call(o,...r)},onSelectionUpdate:(...r)=>{var o,s;return(s=(o=this.options.current).onSelectionUpdate)==null?void 0:s.call(o,...r)},onTransaction:(...r)=>{var o,s;return(s=(o=this.options.current).onTransaction)==null?void 0:s.call(o,...r)},onUpdate:(...r)=>{var o,s;return(s=(o=this.options.current).onUpdate)==null?void 0:s.call(o,...r)},onContentError:(...r)=>{var o,s;return(s=(o=this.options.current).onContentError)==null?void 0:s.call(o,...r)},onDrop:(...r)=>{var o,s;return(s=(o=this.options.current).onDrop)==null?void 0:s.call(o,...r)},onPaste:(...r)=>{var o,s;return(s=(o=this.options.current).onPaste)==null?void 0:s.call(o,...r)},onDelete:(...r)=>{var o,s;return(s=(o=this.options.current).onDelete)==null?void 0:s.call(o,...r)},onMount:(...r)=>{var o,s;return(s=(o=this.options.current).onMount)==null?void 0:s.call(o,...r)},onUnmount:(...r)=>{var o,s;return(s=(o=this.options.current).onUnmount)==null?void 0:s.call(o,...r)}};return new XB(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,n){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&n.extensions?e.extensions.length!==n.extensions.length?!1:e.extensions.every((o,s)=>{var i;return o===((i=n.extensions)==null?void 0:i[s])}):e[r]===n[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?R6.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,o)=>r===e[o]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function QV(t={},e=[]){const n=C.useRef(t);n.current=t;const[r]=C.useState(()=>new XV(n)),o=p_.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return C.useDebugValue(o),C.useEffect(r.onRender(e)),JV({editor:o,selector:({transactionNumber:s})=>t.shouldRerenderOnTransaction===!1||t.shouldRerenderOnTransaction===void 0?null:t.immediatelyRender&&s===0?0:s+1}),o}var O6=C.createContext({editor:null});O6.Consumer;var eH=C.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),tH=()=>C.useContext(eH);te.forwardRef((t,e)=>{const{onDragStart:n}=tH(),r=t.as||"div";return x.jsx(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});te.createContext({markViewContentRef:()=>{}});var zx=C.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});zx.displayName="TiptapContext";var nH=()=>C.useContext(zx);function I6({children:t,...e}){const n="editor"in e?e.editor:e.instance;if(!n)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const r=C.useMemo(()=>({editor:n}),[n]),o=C.useMemo(()=>({editor:n}),[n]);return x.jsx(O6.Provider,{value:o,children:x.jsx(zx.Provider,{value:r,children:t})})}I6.displayName="Tiptap";function P6({...t}){const{editor:e}=nH();return x.jsx(N6,{editor:e,...t})}P6.displayName="Tiptap.Content";Object.assign(I6,{Content:P6});var ph=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);const{children:n,...r}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,r,n]},rH=(t,e)=>{var n;const{state:r,view:o}=t,{selection:s}=r;if(!s.empty)return!1;const{$from:i}=s;if(i.parentOffset!==0)return!1;const l=i.depth-1;if(l<0)return!1;const u=i.node(l),d=i.index(l);if(d===0)return!1;if(u.type===e)return t.commands.lift(e.name);const f=u.child(d-1);if(f.type!==e||!((n=f.lastChild)!=null&&n.isTextblock))return!1;const p=i.before(),y=p-1-1,{tr:v}=r;return v.delete(p,i.after()).insert(y,i.parent.content),v.setSelection(je.create(v.doc,y)),o.dispatch(v.scrollIntoView()),!0},oH=/^\s*>\s$/,sH=ft.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return ph("blockquote",{...Qt(this.options.HTMLAttributes,t),children:ph("slot",{})})},parseMarkdown:(t,e)=>{var n;const r=(n=e.parseBlockChildren)!=null?n:e.parseChildren;return e.createNode("blockquote",void 0,r(t.tokens||[]))},renderMarkdown:(t,e)=>{if(!t.content)return"";const n=">",r=[];return t.content.forEach((o,s)=>{var i,l;const f=((l=(i=e.renderChild)==null?void 0:i.call(e,o,s))!=null?l:e.renderChildren([o])).split(`
535
- `).map(p=>p.trim()===""?n:`${n} ${p}`);r.push(f.join(`
536
- `))}),r.join(`
537
- ${n}
538
- `)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>rH(this.editor,this.type)}},addInputRules(){return[dl({find:oH,type:this.type})]}}),iH=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,aH=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,lH=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,uH=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,cH=fr.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return ph("strong",{...Qt(this.options.HTMLAttributes,t),children:ph("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[oa({find:iH,type:this.type}),oa({find:lH,type:this.type})]},addPasteRules(){return[li({find:aH,type:this.type}),li({find:uH,type:this.type})]}}),dH=t=>{const e=/`([^`]+)`(?!`)$/.exec(t);return!e||e.index>0&&t[e.index-1]==="`"?null:{index:e.index,text:e[0],replaceWith:e[1]}},fH=t=>{const e=/`([^`]+)`(?!`)/g,n=[];let r;for(;(r=e.exec(t))!==null;)r.index>0&&t[r.index-1]==="`"||n.push({index:r.index,text:r[0],replaceWith:r[1]});return n},hH=fr.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",Qt(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[oa({find:dH,type:this.type})]},addPasteRules(){return[li({find:fH,type:this.type})]}}),Cg=4,pH=/^```([a-z]+)?[\s\n]$/,mH=/^~~~([a-z]+)?[\s\n]$/,gH=ft.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:Cg,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options;if(!n)return null;const s=[...((e=t.firstElementChild)==null?void 0:e.classList)||[]].filter(i=>i.startsWith(n)).map(i=>i.replace(n,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",Qt(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>{var n,r;return((n=t.raw)==null?void 0:n.startsWith("```"))===!1&&((r=t.raw)==null?void 0:r.startsWith("~~~"))===!1&&t.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:(t,e)=>{var n;let r="";const o=((n=t.attrs)==null?void 0:n.language)||"";return t.content?r=[`\`\`\`${o}`,e.renderChildren(t.content),"```"].join(`
539
- `):r=`\`\`\`${o}
540
-
541
- \`\`\``,r},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:Cg,{state:r}=t,{selection:o}=r,{$from:s,empty:i}=o;if(s.parent.type!==this.type)return!1;const l=" ".repeat(n);return i?t.commands.insertContent(l):t.commands.command(({tr:u})=>{const{from:d,to:f}=o,y=r.doc.textBetween(d,f,`
542
- `,`
543
- `).split(`
544
- `).map(v=>l+v).join(`
545
- `);return u.replaceWith(d,f,r.schema.text(y)),!0})},"Shift-Tab":({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:Cg,{state:r}=t,{selection:o}=r,{$from:s,empty:i}=o;return s.parent.type!==this.type?!1:i?t.commands.command(({tr:l})=>{var u;const{pos:d}=s,f=s.start(),p=s.end(),y=r.doc.textBetween(f,p,`
546
- `,`
547
- `).split(`
548
- `);let v=0,b=0;const k=d-f;for(let D=0;D<y.length;D+=1){if(b+y[D].length>=k){v=D;break}b+=y[D].length+1}const _=((u=y[v].match(/^ */))==null?void 0:u[0])||"",T=Math.min(_.length,n);if(T===0)return!0;let A=f;for(let D=0;D<v;D+=1)A+=y[D].length+1;return l.delete(A,A+T),d-A<=T&&l.setSelection(je.create(l.doc,A)),!0}):t.commands.command(({tr:l})=>{const{from:u,to:d}=o,m=r.doc.textBetween(u,d,`
549
- `,`
550
- `).split(`
551
- `).map(y=>{var v;const b=((v=y.match(/^ */))==null?void 0:v[0])||"",k=Math.min(b.length,n);return y.slice(k)}).join(`
552
- `);return l.replaceWith(u,d,r.schema.text(m)),!0})},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,i=r.parent.textContent.endsWith(`
553
-
554
- `);return!s||!i?!1:t.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowUp:({editor:t})=>{if(!this.options.exitOnArrowUp)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type||r.parentOffset!==0)return!1;const s=r.before();return s>0?!1:t.commands.insertDefaultBlock({pos:s})},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:o,empty:s}=n;if(!s||o.parent.type!==this.type||!(o.parentOffset===o.parent.nodeSize-2))return!1;const l=o.after();return l===void 0?!1:r.nodeAt(l)?t.commands.command(({tr:d})=>(d.setSelection(He.near(r.resolve(l))),!0)):t.commands.exitCode()}}},addInputRules(){return[Z1({find:pH,type:this.type,getAttributes:t=>({language:t[1]})}),Z1({find:mH,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new wt({key:new Vt("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,s=o==null?void 0:o.mode;if(!n||!s)return!1;const{tr:i,schema:l}=t.state,u=l.text(n.replace(/\r\n?/g,`
555
- `));return i.replaceSelectionWith(this.type.create({language:s},u)),i.selection.$from.parent.type!==this.type&&i.setSelection(je.near(i.doc.resolve(Math.max(0,i.selection.from-2)))),i.setMeta("paste",!0),t.dispatch(i),!0}}})]}}),yH=ft.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
556
-
557
- `):""}),xH=ft.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",Qt(this.options.HTMLAttributes,t)]},renderText(){return`
558
- `},renderMarkdown:()=>`
559
- `,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:o,storedMarks:s}=n;if(o.$from.parent.type.spec.isolating)return!1;const{keepMarks:i}=this.options,{splittableMarks:l}=r.extensionManager,u=s||o.$to.parentOffset&&o.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:f})=>{if(f&&u&&i){const p=u.filter(m=>l.includes(m.type.name));d.ensureMarks(p)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),vH=ft.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,Qt(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;const r=(n=t.attrs)!=null&&n.level?parseInt(t.attrs.level,10):1,o="#".repeat(r);return t.content?`${o} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>Z1({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),bH=ft.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",Qt(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!OB(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$to:r}=n,o=t();return l6(n)?o.insertContentAt(r.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({state:s,tr:i,dispatch:l})=>{if(l){const{$to:u}=i.selection,d=u.end();if(u.nodeAfter)u.nodeAfter.isTextblock?i.setSelection(je.create(i.doc,u.pos+1)):u.nodeAfter.isBlock?i.setSelection(Oe.create(i.doc,u.pos)):i.setSelection(je.create(i.doc,u.pos));else{const f=s.schema.nodes[this.options.nextNodeType]||u.parent.type.contentMatch.defaultType,p=f==null?void 0:f.create();p&&(i.insert(d,p),i.setSelection(je.create(i.doc,d+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[QB({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),kH=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,wH=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,CH=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,SH=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,EH=fr.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",Qt(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[oa({find:kH,type:this.type}),oa({find:CH,type:this.type})]},addPasteRules(){return[li({find:wH,type:this.type}),li({find:SH,type:this.type})]}});const _H="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",TH="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Y1="numeric",X1="ascii",Q1="alpha",Tu="asciinumeric",bu="alphanumeric",ey="domain",j6="emoji",MH="scheme",AH="slashscheme",Sg="whitespace";function NH(t,e){return t in e||(e[t]=[]),e[t]}function $i(t,e,n){e[Y1]&&(e[Tu]=!0,e[bu]=!0),e[X1]&&(e[Tu]=!0,e[Q1]=!0),e[Tu]&&(e[bu]=!0),e[Q1]&&(e[bu]=!0),e[bu]&&(e[ey]=!0),e[j6]&&(e[ey]=!0);for(const r in e){const o=NH(r,n);o.indexOf(t)<0&&o.push(t)}}function DH(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function Zn(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}Zn.groups={};Zn.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const o=e.jr[r][0],s=e.jr[r][1];if(s&&o.test(t))return s}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let o=0;o<t.length;o++)this.tt(t[o],e,n,r)},tr(t,e,n,r){r=r||Zn.groups;let o;return e&&e.j?o=e:(o=new Zn(e),n&&r&&$i(e,n,r)),this.jr.push([t,o]),o},ts(t,e,n,r){let o=this;const s=t.length;if(!s)return o;for(let i=0;i<s-1;i++)o=o.tt(t[i]);return o.tt(t[s-1],e,n,r)},tt(t,e,n,r){r=r||Zn.groups;const o=this;if(e&&e.j)return o.j[t]=e,e;const s=e;let i,l=o.go(t);if(l?(i=new Zn,Object.assign(i.j,l.j),i.jr.push.apply(i.jr,l.jr),i.jd=l.jd,i.t=l.t):i=new Zn,s){if(r)if(i.t&&typeof i.t=="string"){const u=Object.assign(DH(i.t,r),n);$i(s,u,r)}else n&&$i(s,n,r);i.t=s}return o.j[t]=i,i}};const Ue=(t,e,n,r,o)=>t.ta(e,n,r,o),Nt=(t,e,n,r,o)=>t.tr(e,n,r,o),_C=(t,e,n,r,o)=>t.ts(e,n,r,o),le=(t,e,n,r,o)=>t.tt(e,n,r,o),Ho="WORD",ty="UWORD",L6="ASCIINUMERICAL",z6="ALPHANUMERICAL",sc="LOCALHOST",ny="TLD",ry="UTLD",Pf="SCHEME",Ka="SLASH_SCHEME",Fx="NUM",oy="WS",$x="NL",Mu="OPENBRACE",Au="CLOSEBRACE",mh="OPENBRACKET",gh="CLOSEBRACKET",yh="OPENPAREN",xh="CLOSEPAREN",vh="OPENANGLEBRACKET",bh="CLOSEANGLEBRACKET",kh="FULLWIDTHLEFTPAREN",wh="FULLWIDTHRIGHTPAREN",Ch="LEFTCORNERBRACKET",Sh="RIGHTCORNERBRACKET",Eh="LEFTWHITECORNERBRACKET",_h="RIGHTWHITECORNERBRACKET",Th="FULLWIDTHLESSTHAN",Mh="FULLWIDTHGREATERTHAN",Ah="AMPERSAND",Nh="APOSTROPHE",Dh="ASTERISK",Ls="AT",Rh="BACKSLASH",Oh="BACKTICK",Ih="CARET",Bi="COLON",Bx="COMMA",Ph="DOLLAR",ao="DOT",jh="EQUALS",Vx="EXCLAMATION",Cr="HYPHEN",Nu="PERCENT",Lh="PIPE",zh="PLUS",Fh="POUND",Du="QUERY",Hx="QUOTE",F6="FULLWIDTHMIDDLEDOT",Ux="SEMI",lo="SLASH",Ru="TILDE",$h="UNDERSCORE",$6="EMOJI",Bh="SYM";var B6=Object.freeze({__proto__:null,ALPHANUMERICAL:z6,AMPERSAND:Ah,APOSTROPHE:Nh,ASCIINUMERICAL:L6,ASTERISK:Dh,AT:Ls,BACKSLASH:Rh,BACKTICK:Oh,CARET:Ih,CLOSEANGLEBRACKET:bh,CLOSEBRACE:Au,CLOSEBRACKET:gh,CLOSEPAREN:xh,COLON:Bi,COMMA:Bx,DOLLAR:Ph,DOT:ao,EMOJI:$6,EQUALS:jh,EXCLAMATION:Vx,FULLWIDTHGREATERTHAN:Mh,FULLWIDTHLEFTPAREN:kh,FULLWIDTHLESSTHAN:Th,FULLWIDTHMIDDLEDOT:F6,FULLWIDTHRIGHTPAREN:wh,HYPHEN:Cr,LEFTCORNERBRACKET:Ch,LEFTWHITECORNERBRACKET:Eh,LOCALHOST:sc,NL:$x,NUM:Fx,OPENANGLEBRACKET:vh,OPENBRACE:Mu,OPENBRACKET:mh,OPENPAREN:yh,PERCENT:Nu,PIPE:Lh,PLUS:zh,POUND:Fh,QUERY:Du,QUOTE:Hx,RIGHTCORNERBRACKET:Sh,RIGHTWHITECORNERBRACKET:_h,SCHEME:Pf,SEMI:Ux,SLASH:lo,SLASH_SCHEME:Ka,SYM:Bh,TILDE:Ru,TLD:ny,UNDERSCORE:$h,UTLD:ry,UWORD:ty,WORD:Ho,WS:oy});const $o=/[a-z]/,fu=new RegExp("\\p{L}","u"),Eg=new RegExp("\\p{Emoji}","u"),Bo=/\d/,_g=/\s/,TC="\r",Tg=`
560
- `,RH="️",OH="‍",Mg="";let gf=null,yf=null;function IH(t=[]){const e={};Zn.groups=e;const n=new Zn;gf==null&&(gf=MC(_H)),yf==null&&(yf=MC(TH)),le(n,"'",Nh),le(n,"{",Mu),le(n,"}",Au),le(n,"[",mh),le(n,"]",gh),le(n,"(",yh),le(n,")",xh),le(n,"<",vh),le(n,">",bh),le(n,"(",kh),le(n,")",wh),le(n,"「",Ch),le(n,"」",Sh),le(n,"『",Eh),le(n,"』",_h),le(n,"<",Th),le(n,">",Mh),le(n,"&",Ah),le(n,"*",Dh),le(n,"@",Ls),le(n,"`",Oh),le(n,"^",Ih),le(n,":",Bi),le(n,",",Bx),le(n,"$",Ph),le(n,".",ao),le(n,"=",jh),le(n,"!",Vx),le(n,"-",Cr),le(n,"%",Nu),le(n,"|",Lh),le(n,"+",zh),le(n,"#",Fh),le(n,"?",Du),le(n,'"',Hx),le(n,"/",lo),le(n,";",Ux),le(n,"~",Ru),le(n,"_",$h),le(n,"\\",Rh),le(n,"・",F6);const r=Nt(n,Bo,Fx,{[Y1]:!0});Nt(r,Bo,r);const o=Nt(r,$o,L6,{[Tu]:!0}),s=Nt(r,fu,z6,{[bu]:!0}),i=Nt(n,$o,Ho,{[X1]:!0});Nt(i,Bo,o),Nt(i,$o,i),Nt(o,Bo,o),Nt(o,$o,o);const l=Nt(n,fu,ty,{[Q1]:!0});Nt(l,$o),Nt(l,Bo,s),Nt(l,fu,l),Nt(s,Bo,s),Nt(s,$o),Nt(s,fu,s);const u=le(n,Tg,$x,{[Sg]:!0}),d=le(n,TC,oy,{[Sg]:!0}),f=Nt(n,_g,oy,{[Sg]:!0});le(n,Mg,f),le(d,Tg,u),le(d,Mg,f),Nt(d,_g,f),le(f,TC),le(f,Tg),Nt(f,_g,f),le(f,Mg,f);const p=Nt(n,Eg,$6,{[j6]:!0});le(p,"#"),Nt(p,Eg,p),le(p,RH,p);const m=le(p,OH);le(m,"#"),Nt(m,Eg,p);const y=[[$o,i],[Bo,o]],v=[[$o,null],[fu,l],[Bo,s]];for(let b=0;b<gf.length;b++)Os(n,gf[b],ny,Ho,y);for(let b=0;b<yf.length;b++)Os(n,yf[b],ry,ty,v);$i(ny,{tld:!0,ascii:!0},e),$i(ry,{utld:!0,alpha:!0},e),Os(n,"file",Pf,Ho,y),Os(n,"mailto",Pf,Ho,y),Os(n,"http",Ka,Ho,y),Os(n,"https",Ka,Ho,y),Os(n,"ftp",Ka,Ho,y),Os(n,"ftps",Ka,Ho,y),$i(Pf,{scheme:!0,ascii:!0},e),$i(Ka,{slashscheme:!0,ascii:!0},e),t=t.sort((b,k)=>b[0]>k[0]?1:-1);for(let b=0;b<t.length;b++){const k=t[b][0],_=t[b][1]?{[MH]:!0}:{[AH]:!0};k.indexOf("-")>=0?_[ey]=!0:$o.test(k)?Bo.test(k)?_[Tu]=!0:_[X1]=!0:_[Y1]=!0,_C(n,k,k,_)}return _C(n,"localhost",sc,{ascii:!0}),n.jd=new Zn(Bh),{start:n,tokens:Object.assign({groups:e},B6)}}function V6(t,e){const n=PH(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,o=[];let s=0,i=0;for(;i<r;){let l=t,u=null,d=0,f=null,p=-1,m=-1;for(;i<r&&(u=l.go(n[i]));)l=u,l.accepts()?(p=0,m=0,f=l):p>=0&&(p+=n[i].length,m++),d+=n[i].length,s+=n[i].length,i++;s-=p,i-=m,d-=p,o.push({t:f.t,v:e.slice(s-d,s),s:s-d,e:s})}return o}function PH(t){const e=[],n=t.length;let r=0;for(;r<n;){let o=t.charCodeAt(r),s,i=o<55296||o>56319||r+1===n||(s=t.charCodeAt(r+1))<56320||s>57343?t[r]:t.slice(r,r+2);e.push(i),r+=i.length}return e}function Os(t,e,n,r,o){let s;const i=e.length;for(let l=0;l<i-1;l++){const u=e[l];t.j[u]?s=t.j[u]:(s=new Zn(r),s.jr=o.slice(),t.j[u]=s),t=s}return s=new Zn(n),s.jr=o.slice(),t.j[e[i-1]]=s,s}function MC(t){const e=[],n=[];let r=0,o="0123456789";for(;r<t.length;){let s=0;for(;o.indexOf(t[r+s])>=0;)s++;if(s>0){e.push(n.join(""));for(let i=parseInt(t.substring(r,r+s),10);i>0;i--)n.pop();r+=s}else n.push(t[r]),r++}return e}const ic={defaultProtocol:"http",events:null,format:AC,formatHref:AC,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Wx(t,e=null){let n=Object.assign({},ic);t&&(n=Object.assign(n,t instanceof Wx?t.o:t));const r=n.ignoreTags,o=[];for(let s=0;s<r.length;s++)o.push(r[s].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=o}Wx.prototype={o:ic,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let o=this.o[t];return o&&(typeof o=="object"?(o=n.t in o?o[n.t]:ic[t],typeof o=="function"&&r&&(o=o(e,n))):typeof o=="function"&&r&&(o=o(e,n.t,n)),o)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function AC(t){return t}function H6(t,e){this.t="token",this.v=t,this.tk=e}H6.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=ic.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),o=t.get("tagName",n,e),s=this.toFormattedString(t),i={},l=t.get("className",n,e),u=t.get("target",n,e),d=t.get("rel",n,e),f=t.getObj("attributes",n,e),p=t.getObj("events",n,e);return i.href=r,l&&(i.class=l),u&&(i.target=u),d&&(i.rel=d),f&&Object.assign(i,f),{tagName:o,attributes:i,content:s,eventListeners:p}}};function Pp(t,e){class n extends H6{constructor(o,s){super(o,s),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const jH=Pp("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),NC=Pp("text"),LH=Pp("nl"),xf=Pp("url",{isLink:!0,toHref(t=ic.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==sc&&t[1].t===Bi}}),wr=t=>new Zn(t);function zH({groups:t}){const e=t.domain.concat([Ah,Dh,Ls,Rh,Oh,Ih,Ph,jh,Cr,Fx,Nu,Lh,zh,Fh,lo,Bh,Ru,$h]),n=[Nh,Bi,Bx,ao,Vx,Nu,Du,Hx,Ux,vh,bh,Mu,Au,gh,mh,yh,xh,kh,wh,Ch,Sh,Eh,_h,Th,Mh],r=[Ah,Nh,Dh,Rh,Oh,Ih,Ph,jh,Cr,Mu,Au,Nu,Lh,zh,Fh,Du,lo,Bh,Ru,$h],o=wr(),s=le(o,Ru);Ue(s,r,s),Ue(s,t.domain,s);const i=wr(),l=wr(),u=wr();Ue(o,t.domain,i),Ue(o,t.scheme,l),Ue(o,t.slashscheme,u),Ue(i,r,s),Ue(i,t.domain,i);const d=le(i,Ls);le(s,Ls,d),le(l,Ls,d),le(u,Ls,d);const f=le(s,ao);Ue(f,r,s),Ue(f,t.domain,s);const p=wr();Ue(d,t.domain,p),Ue(p,t.domain,p);const m=le(p,ao);Ue(m,t.domain,p);const y=wr(jH);Ue(m,t.tld,y),Ue(m,t.utld,y),le(d,sc,y);const v=le(p,Cr);le(v,Cr,v),Ue(v,t.domain,p),Ue(y,t.domain,p),le(y,ao,m),le(y,Cr,v);const b=le(i,Cr),k=le(i,ao);le(b,Cr,b),Ue(b,t.domain,i),Ue(k,r,s),Ue(k,t.domain,i);const E=wr(xf);Ue(k,t.tld,E),Ue(k,t.utld,E),Ue(E,t.domain,i),Ue(E,r,s),le(E,ao,k),le(E,Cr,b),le(E,Ls,d);const _=le(E,Bi),T=wr(xf);Ue(_,t.numeric,T);const A=wr(xf),N=wr();Ue(A,e,A),Ue(A,n,N),Ue(N,e,A),Ue(N,n,N),le(E,lo,A),le(T,lo,A);const D=le(l,Bi),I=le(u,Bi),P=le(I,lo),O=le(P,lo);Ue(l,t.domain,i),le(l,ao,k),le(l,Cr,b),Ue(u,t.domain,i),le(u,ao,k),le(u,Cr,b),Ue(D,t.domain,A),le(D,lo,A),le(D,Du,A),Ue(O,t.domain,A),Ue(O,e,A),le(O,lo,A);const U=[[Mu,Au],[mh,gh],[yh,xh],[vh,bh],[kh,wh],[Ch,Sh],[Eh,_h],[Th,Mh]];for(let J=0;J<U.length;J++){const[K,q]=U[J],Z=le(A,K);le(N,K,Z);const Q=wr(xf);Ue(Z,e,Q);const G=wr();Ue(Z,n,G),le(Z,q,A),Ue(Q,e,Q),Ue(Q,n,G),Ue(G,e,Q),Ue(G,n,G),le(Q,q,A),le(G,q,A)}return le(o,sc,E),le(o,$x,LH),{start:o,tokens:B6}}function FH(t,e,n){let r=n.length,o=0,s=[],i=[];for(;o<r;){let l=t,u=null,d=null,f=0,p=null,m=-1;for(;o<r&&!(u=l.go(n[o].t));)i.push(n[o++]);for(;o<r&&(d=u||l.go(n[o].t));)u=null,l=d,l.accepts()?(m=0,p=l):m>=0&&m++,o++,f++;if(m<0)o-=f,o<r&&(i.push(n[o]),o++);else{i.length>0&&(s.push(Ag(NC,e,i)),i=[]),o-=m,f-=m;const y=p.t,v=n.slice(o-f,o);s.push(Ag(y,e,v))}}return i.length>0&&s.push(Ag(NC,e,i)),s}function Ag(t,e,n){const r=n[0].s,o=n[n.length-1].e,s=e.slice(r,o);return new t(s,n)}const $H=typeof console<"u"&&console&&console.warn||(()=>{}),BH="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",kt={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function VH(){return Zn.groups={},kt.scanner=null,kt.parser=null,kt.tokenQueue=[],kt.pluginQueue=[],kt.customSchemes=[],kt.initialized=!1,kt}function DC(t,e=!1){if(kt.initialized&&$H(`linkifyjs: already initialized - will not register custom scheme "${t}" ${BH}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
561
- 1. Must only contain digits, lowercase ASCII letters or "-"
562
- 2. Cannot start or end with "-"
563
- 3. "-" cannot repeat`);kt.customSchemes.push([t,e])}function HH(){kt.scanner=IH(kt.customSchemes);for(let t=0;t<kt.tokenQueue.length;t++)kt.tokenQueue[t][1]({scanner:kt.scanner});kt.parser=zH(kt.scanner.tokens);for(let t=0;t<kt.pluginQueue.length;t++)kt.pluginQueue[t][1]({scanner:kt.scanner,parser:kt.parser});return kt.initialized=!0,kt}function qx(t){return kt.initialized||HH(),FH(kt.parser.start,t,V6(kt.scanner.start,t))}qx.scan=V6;function U6(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new Wx(n),o=qx(t),s=[];for(let i=0;i<o.length;i++){const l=o[i];l.isLink&&(!e||l.t===e)&&r.check(l)&&s.push(l.toFormattedObject(r))}return s}var Kx="[\0-   ᠎ -\u2029  ]",UH=new RegExp(Kx),WH=new RegExp(`${Kx}$`),qH=new RegExp(Kx,"g");function KH(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function GH(t){return new wt({key:new Vt("autolink"),appendTransaction:(e,n,r)=>{const o=e.some(d=>d.docChanged)&&!n.doc.eq(r.doc),s=e.some(d=>d.getMeta("preventAutolink"));if(!o||s)return;const{tr:i}=r,l=t6(n.doc,[...e]);if(Rx(l).forEach(({newRange:d})=>{const f=q$(r.doc,d,y=>y.isTextblock);let p,m;if(f.length>1)p=f[0],m=r.doc.textBetween(p.pos,p.pos+p.node.nodeSize,void 0," ");else if(f.length){const y=r.doc.textBetween(d.from,d.to," "," ");if(!WH.test(y))return;p=f[0],m=r.doc.textBetween(p.pos,d.to,void 0," ")}if(p&&m){const y=m.split(UH).filter(Boolean);if(y.length<=0)return!1;const v=y[y.length-1],b=p.pos+m.lastIndexOf(v);if(!v)return!1;const k=qx(v).map(E=>E.toObject(t.defaultProtocol));if(!KH(k))return!1;k.filter(E=>E.isLink).map(E=>({...E,from:b+E.start+1,to:b+E.end+1})).filter(E=>r.schema.marks.code?!r.doc.rangeHasMark(E.from,E.to,r.schema.marks.code):!0).filter(E=>t.validate(E.value)).filter(E=>t.shouldAutoLink(E.value)).forEach(E=>{Ox(E.from,E.to,r.doc).some(_=>_.mark.type===t.type)||i.addMark(E.from,E.to,t.type.create({href:E.href}))})}}),!!i.steps.length)return i}})}function JH(t){return new wt({key:new Vt("handleClickLink"),props:{handleClick:(e,n,r)=>{var o,s;if(r.button!==0||!e.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{const u=r.target;if(!u)return!1;const d=t.editor.view.dom;i=u.closest("a"),i&&!d.contains(i)&&(i=null)}if(!i)return!1;let l=!1;if(t.enableClickSelection&&(l=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){const u=a6(e.state,t.type.name),d=(o=i.href)!=null?o:u.href,f=(s=i.target)!=null?s:u.target;d&&(window.open(d,f),l=!0)}return l}}})}var ZH=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,YH=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function W6(t,e){let n=0;for(let r=e-1;r>=0&&t[r]==="\\";r-=1)n+=1;return n%2===1}function XH(t,e){let n=0,r=0;for(;r<e;){if(t[r]!=="`"){r+=1;continue}if(n===0&&W6(t,r)){r+=1;continue}let o=0;for(;r<e&&t[r]==="`";)o+=1,r+=1;n===0?n=o:o===n&&(n=0)}return n>0}function q6(t,e,n){var r,o;const[,s,i]=e;return(e.index?t[e.index-1]:void 0)==="!"||W6(t,(r=e.index)!=null?r:0)||XH(t,(o=e.index)!=null?o:0)?!1:!!s.trim()&&n(i)}function K6(t){var e,n;const[r,o,s,,i,l,u]=t,d=(e=i??l)!=null?e:u;return{index:(n=t.index)!=null?n:0,text:r,replaceWith:o,data:{href:s,title:d||null,markdown:!0}}}function QH(t,e){return t.index<e.index+e.text.length&&e.index<t.index+t.text.length}function G6(t){var e,n,r;return{href:(e=t.data)==null?void 0:e.href,title:(r=(n=t.data)==null?void 0:n.title)!=null?r:null}}function eU(t){const e=oa({find:n=>{const r=ZH.exec(n);return!r||!q6(n,r,t.isAllowedHref)?null:K6(r)},type:t.type,getAttributes:G6});return new Ic({find:e.find,handler:n=>{const r=e.handler(n);return r!==null&&n.state.tr.steps.length&&n.state.tr.setMeta("preventAutolink",!0),r}})}function tU(t){const e=li({find:n=>{var r,o;const s=[];for(const l of n.matchAll(YH))q6(n,l,t.isAllowedHref)&&s.push(K6(l));const i=((o=(r=t.findPlainUrls)==null?void 0:r.call(t,n))!=null?o:[]).filter(l=>!s.some(u=>QH(u,l)));return[...s,...i]},type:t.type,getAttributes:G6});return new p6({find:e.find,handler:n=>{var r;const o=e.handler(n);return o!==null&&n.state.tr.steps.length&&((r=n.match.data)!=null&&r.markdown)&&n.state.tr.setMeta("preventAutolink",!0),o}})}function nU(t){return new wt({key:new Vt("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{shouldAutoLink:o}=t,{state:s}=e,{selection:i}=s,{empty:l}=i;if(l)return!1;let u="";r.content.forEach(f=>{u+=f.textContent});const d=U6(u,{defaultProtocol:t.defaultProtocol}).find(f=>f.isLink&&f.value===u);return!u||!d||o!==void 0&&!o(d.value)?!1:t.editor.commands.setMark(t.type,{href:d.href})}}})}function Vo(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const o=typeof r=="string"?r:r.scheme;o&&n.push(o)}),!t||t.replace(qH,"").match(new RegExp(`^(?:(?:${n.map(r=>r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}var rU=fr.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){DC(t);return}DC(t.scheme,t.optionalSlashes)})},onDestroy(){VH()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!Vo(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(t),n=/^[a-z][a-z0-9+.-]*:/i.test(t);if(e||n&&!t.includes("@"))return!0;const o=(t.includes("@")?t.split("@").pop():t).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(o)||!/\./.test(o))}}},addAttributes(){var t,e,n;return{href:{default:null,parseHTML(r){return r.getAttribute("href")}},target:{default:(t=this.options.HTMLAttributes.target)!=null?t:null},rel:{default:(e=this.options.HTMLAttributes.rel)!=null?e:null},class:{default:(n=this.options.HTMLAttributes.class)!=null?n:null},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!Vo(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!Vo(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Qt(this.options.HTMLAttributes,t),0]:["a",Qt(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var n,r,o,s;const i=(r=(n=t.attrs)==null?void 0:n.href)!=null?r:"",l=(s=(o=t.attrs)==null?void 0:o.title)!=null?s:"",u=e.renderChildren(t);return l?`[${u}](${i} "${l}")`:`[${u}](${i})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Vo(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!Vo(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addInputRules(){return this.options.markdownLinks?[eU({type:this.type,isAllowedHref:t=>this.options.isAllowedUri(t,{defaultValidate:e=>!!Vo(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){const t=e=>{const n=[];if(e){const{protocols:r,defaultProtocol:o}=this.options;U6(e).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:l=>!!Vo(l,r),protocols:r,defaultProtocol:o})).forEach(i=>{this.options.shouldAutoLink(i.value)&&n.push({text:i.value,data:{href:i.href},index:i.start})})}return n};return this.options.markdownLinks?[tU({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:n=>!!Vo(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:t})]:[li({find:t,type:this.type,getAttributes:e=>{var n;return{href:(n=e.data)==null?void 0:n.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(GH({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!Vo(o,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),t.push(JH({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(nU({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),oU=Object.defineProperty,sU=(t,e)=>{for(var n in e)oU(t,n,{get:e[n],enumerable:!0})},iU="listItem",RC="textStyle",OC=/^\s*([-+*])\s$/,J6=ft.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",Qt(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
564
- `):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(iU,this.editor.getAttributes(RC)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=dl({find:OC,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=dl({find:OC,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(RC),editor:this.editor})),[t]}}),aU=(t,e,n)=>{const{selection:r}=t;if(!r.empty)return null;const{$from:o}=r;if(!o.parent.isTextblock||o.parentOffset!==o.parent.content.size)return null;let s=-1;for(let y=o.depth;y>0;y-=1)if(o.node(y).type.name===e){s=y;break}if(s<0)return null;const i=o.node(s),l=o.index(s);if(l+1>=i.childCount)return null;const u=i.child(l+1);if(!n.includes(u.type.name))return null;const d=t.schema.nodes[e];let f=!1;if(u.forEach(y=>{y.type===d&&y.childCount>1&&(f=!0)}),!f)return null;const p=t.doc.resolve(o.after()).nodeAfter;if(!p||!n.includes(p.type.name))return null;const m=[];return p.forEach(y=>{m.push(y)}),m.length===0?null:{listItemDepth:s,nestedList:p,nestedListPos:o.after(),insertPos:o.after(s),items:m}},lU=(t,e,n,r)=>{const o=aU(t,n,r);if(!o)return!1;const{selection:s}=t,{nestedList:i,nestedListPos:l,insertPos:u,items:d}=o,f=t.tr;f.delete(l,l+i.nodeSize);const p=f.mapping.map(u);return f.insert(p,re.from(d)),f.setSelection(s.map(f.doc,f.mapping)),e&&e(f),!0},uU=(t,e,n)=>lU(t.state,t.view.dispatch,e,n),Z6=(t,e)=>Ct.create({name:`${t}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){const n=()=>uU(this.editor,t,e);return{Delete:n,"Mod-Delete":n}}}),Y6=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],vf="abcdefghijklmnopqrstuvwxyz",cU="[a-zA-Z]{1,2}",X6=String.raw`\d+|[ivxlcdmIVXLCDM]+|${cU}`;function jp(t){let e=t,n="";for(const[r,o]of Y6)for(;e>=r;)n+=o,e-=r;return n}function Gx(t){return jp(t).toUpperCase()}function Q6(t){const e=t.toLowerCase();let n=0,r=0;for(;n<e.length;){let o=!1;for(const[s,i]of Y6)if(e.startsWith(i,n)){r+=s,n+=i.length,o=!0;break}if(!o)return 0}return r}function dU(t){if(!/^[ivxlcdmIVXLCDM]+$/.test(t))return!1;const e=Q6(t);return e<=0?!1:(t===t.toLowerCase()?jp(e):Gx(e))===t}function fU(t){const e=t.toLowerCase();if(e.length===1)return e.charCodeAt(0)-97+1;if(e.length===2){const n=e.charCodeAt(0)-97,r=e.charCodeAt(1)-97;return(n+1)*26+r+1}return 0}function Vh(t){if(t<=26)return vf[t-1];const e=Math.floor((t-1)/26)-1,n=(t-1)%26;return e<0?vf[n]:vf[e]+vf[n]}function Lp(t){if(!(!t||/^\d+$/.test(t))){if(dU(t))return t===t.toLowerCase()?"i":"I";if(/^[a-z]{1,2}$/.test(t))return"a";if(/^[A-Z]{1,2}$/.test(t))return"A"}}function Jx(t){if(/^\d+$/.test(t))return parseInt(t,10);const e=Lp(t);if(e==="i"||e==="I")return Q6(t);if(e==="a"||e==="A"){const r=fU(t);return r>0?r:1}const n=parseInt(t,10);return Number.isNaN(n)?1:n}function hU(t,e){if(t==="numeric")return String(e);switch(t){case"a":return Vh(e);case"A":return Vh(e).toUpperCase();case"i":return jp(e);case"I":return Gx(e);default:return String(e)}}function pU(t){var e;if(t.length===0)return!1;const n=(e=Lp(t[0]))!=null?e:"numeric",r=Jx(t[0]);if(r<1)return!1;for(let o=0;o<t.length;o++){const s=hU(n,r+o);if(t[o]!==s)return!1}return!0}function mU(t){return{type:Lp(t),start:Jx(t)}}function gU(t){const{type:e,start:n}=mU(t),r={};return e&&(r.type=e),n!==1&&(r.start=n),r}function yU(t,e,n=". "){const r=e+1;if(!t||t==="1")return`${r}${n}`;switch(t){case"a":return`${Vh(r)}${n}`;case"A":return`${Vh(r).toUpperCase()}${n}`;case"i":return`${jp(r)}${n}`;case"I":return`${Gx(r)}${n}`;default:return`${r}${n}`}}function xU(t){var e,n;const r=(e=t.tokens)==null?void 0:e[0];return!!(t.text&&((n=t.tokens)==null?void 0:n.length)===1&&(r==null?void 0:r.type)==="list"&&r.ordered&&r.raw===t.text)}function vU(t,e){return e.tokenizeInline?e.parseInline(e.tokenizeInline(t)):e.parseInline([{type:"text",raw:t,text:t}])}var eT=ft.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Qt(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:(t,e)=>{var n;if(t.type!=="list_item")return[];const r=(n=e.parseBlockChildren)!=null?n:e.parseChildren;let o=[];if(t.tokens&&t.tokens.length>0){if(xU(t))return{type:"listItem",content:[{type:"paragraph",content:vU(t.text||"",e)}]};if(t.tokens.some(i=>i.type==="paragraph"))o=r(t.tokens);else{const i=t.tokens[0];if(i&&i.type==="text"&&i.tokens&&i.tokens.length>0){if(o=[{type:"paragraph",content:e.parseInline(i.tokens)}],t.tokens.length>1){const u=t.tokens.slice(1),d=r(u);o.push(...d)}}else o=r(t.tokens)}}return o.length===0&&(o=[{type:"paragraph",content:[]}]),{type:"listItem",content:o}},renderMarkdown:(t,e,n)=>jx(t,e,r=>{var o,s,i,l;if(r.parentType==="bulletList")return"- ";if(r.parentType==="orderedList"){const u=((s=(o=r.meta)==null?void 0:o.parentAttrs)==null?void 0:s.start)||1,d=(l=(i=r.meta)==null?void 0:i.parentAttrs)==null?void 0:l.type,f=u-1+(r.index||0);return yU(d,f,". ")}return"- "},n),addExtensions(){return[Z6(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),bU={};sU(bU,{findListItemPos:()=>zp,getNextListDepth:()=>Zx,handleBackspace:()=>sy,handleDelete:()=>iy,hasListBefore:()=>tT,hasListItemAfter:()=>kU,hasListItemBefore:()=>wU,listItemHasSubList:()=>CU,nextListIsDeeper:()=>nT,nextListIsHigher:()=>rT});var zp=(t,e)=>{const{$from:n}=e.selection,r=Bt(t,e.schema);let o=null,s=n.depth,i=n.pos,l=null;for(;s>0&&l===null;)o=n.node(s),o.type===r?l=s:(s-=1,i-=1);return l===null?null:{$pos:e.doc.resolve(i),depth:l}},Zx=(t,e)=>{const n=zp(t,e);if(!n)return!1;const[,r]=rB(e,t,n.$pos.pos+4);return r},tT=(t,e,n)=>{const{$anchor:r}=t.selection,o=Math.max(0,r.pos-2),s=t.doc.resolve(o).node();return!(!s||!n.includes(s.type.name))},sy=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!ai(t.state,e)&&tT(t.state,e,n)){const{$anchor:r}=t.state.selection,o=t.state.doc.resolve(r.before()-1),s=[];o.node().descendants((u,d)=>{u.type.name===e&&s.push({node:u,pos:d})});const i=s.at(-1);if(!i)return!1;const l=t.state.doc.resolve(o.start()+i.pos+1);return t.chain().cut({from:r.start()-1,to:r.end()+1},l.end()).joinForward().run()}return!ai(t.state,e)||!aB(t.state)?!1:t.chain().liftListItem(e).run()},nT=(t,e)=>{const n=Zx(t,e),r=zp(t,e);return!r||!n?!1:n>r.depth},rT=(t,e)=>{const n=Zx(t,e),r=zp(t,e);return!r||!n?!1:n<r.depth},iy=(t,e)=>{if(!ai(t.state,e)||!iB(t.state,e))return!1;const{selection:n}=t.state,{$from:r,$to:o}=n;return!n.empty&&r.sameParent(o)?!1:nT(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():rT(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},kU=(t,e)=>{var n;const{$anchor:r}=e.selection,o=e.doc.resolve(r.pos-r.parentOffset-2);return!(o.index()===o.parent.childCount-1||((n=o.nodeAfter)==null?void 0:n.type.name)!==t)},wU=(t,e)=>{var n;const{$anchor:r}=e.selection,o=e.doc.resolve(r.pos-2);return!(o.index()===0||((n=o.nodeBefore)==null?void 0:n.type.name)!==t)},CU=(t,e,n)=>{if(!n)return!1;const r=Bt(t,e.schema);let o=!1;return n.descendants(s=>{s.type===r&&(o=!0)}),o},oT=Ct.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&iy(t,n)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&iy(t,n)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&sy(t,n,r)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&sy(t,n,r)&&(e=!0)}),e}}}}),ay=new RegExp(`^(\\s*)(${X6})([.)])\\s+(.*)$`),SU=/^\s/,ku={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function EU(t){return ay.test(t.trimStart())}function _U(t){const e=t.trimStart();return ku.bulletItem.test(e)||EU(e)||ku.heading.test(e)||ku.thematicBreak.test(e)&&!e.startsWith("-")||/^>\s?/.test(e)||ku.codeFence.test(e)}function TU(t){return Object.values(ku).some(e=>e.test(t))}function MU(t){const e=[],n=[];let r=!1;return t.forEach(o=>{if(r){n.push(o);return}if(o.trim()===""){r=!0,n.push(o);return}if(e.length>0&&_U(o)){r=!0,n.push(o);return}e.push(o)}),{paragraphLines:e,blockLines:n}}function AU(t){const e=[];let n=0,r=0;for(;n<t.length;){const o=t[n],s=o.match(ay);if(!s)break;const[,i,l,u,d]=s,f=i.length,p=parseInt(l,10),m=isNaN(p)?Lp(l):void 0,y=isNaN(p)?Jx(l):p,v=[d];let b=n+1;const k=[o];let E=!1;for(;b<t.length;){const _=t[b];if(_.match(ay))break;if(_.trim()==="")k.push(_),v.push(""),E=!0,b+=1;else if(_.match(SU)){const A=_.length-_.trimStart().length,N=f+l.length+1;k.push(_),v.push(_.slice(Math.min(A,N))),b+=1}else{if(E||TU(_))break;k.push(_),v.push(_),b+=1}}e.push({indent:f,number:y,type:m,content:v.join(`
565
- `).trim(),contentLines:v,raw:k.join(`
566
- `)}),r=b,n=b}return[e,r]}var NU=new RegExp(`^(${X6})([.)])\\s+(.+)$`);function DU(t){const e=t.split(`
567
- `).filter(s=>s.trim().length>0);if(e.length===0)return null;const n=[];for(const s of e){const i=s.trim().match(NU);if(!i)return null;n.push({marker:i[1],content:i[3]})}const r=n.map(s=>s.marker);return pU(r)?{type:"orderedList",attrs:gU(n[0].marker),content:n.map(s=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:s.content}]}]}))}:null}function sT(t,e,n){const r=[];let o=0;for(;o<t.length;){const s=t[o];if(s.indent===e){const{paragraphLines:i,blockLines:l}=MU(s.contentLines),u=i.join(`
568
- `).trim(),d=[];u&&d.push({type:"paragraph",raw:u,tokens:n.inlineTokens(u)});const f=l.join(`
569
- `).trim();if(f){const y=n.blockTokens(f);d.push(...y)}let p=o+1;const m=[];for(;p<t.length&&t[p].indent>e;)m.push(t[p]),p+=1;if(m.length>0){const y=Math.min(...m.map(b=>b.indent)),v=sT(m,y,n);d.push({type:"list",ordered:!0,start:m[0].number,typeMarker:m[0].type,items:v,raw:m.map(b=>b.raw).join(`
570
- `)})}r.push({type:"list_item",raw:s.raw,tokens:d}),o=p}else o+=1}return r}function RU(t,e){return t.map(n=>{if(n.type!=="list_item")return e.parseChildren([n])[0];const r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(o=>{if(o.type==="paragraph"||o.type==="list"||o.type==="blockquote"||o.type==="code")r.push(...e.parseChildren([o]));else if(o.type==="text"&&o.tokens){const s=e.parseChildren([o]);r.push({type:"paragraph",content:s})}else{const s=e.parseChildren([o]);s.length>0&&r.push(...s)}}),{type:"listItem",content:r}})}var OU="listItem",IC="textStyle",PC=/^(\d+)\.\s$/;function jC(t){const e=t.match(/list-style-type\s*:\s*([^;]+)/i);if(!e)return null;switch(e[1].trim().toLowerCase()){case"upper-roman":return"I";case"lower-roman":return"i";case"upper-alpha":case"upper-latin":return"A";case"lower-alpha":case"lower-latin":return"a";default:return null}}var iT=ft.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>{const e=t.getAttribute("type");if(e)return e;const n=t.getAttribute("style");if(n){const o=jC(n);if(o)return o}const r=t.querySelector("li");if(r){const o=r.getAttribute("style");if(o){const s=jC(o);if(s)return s}}return null}}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,type:n,...r}=t,o=Qt(this.options.HTMLAttributes,r);return e!==1&&(o.start=e),n&&n!=="1"&&(o.type=n),["ol",o,0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if(t.type!=="list"||!t.ordered)return[];const n=t.start||1,r=t.typeMarker,o=t.items?RU(t.items,e):[],s={};return n!==1&&(s.start=n),r&&(s.type=r),Object.keys(s).length>0?{type:"orderedList",attrs:s,content:o}:{type:"orderedList",content:o}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
571
- `):"",markdownTokenizer:{name:"orderedList",level:"block",start:()=>-1,tokenize:(t,e,n)=>{var r,o;const s=t.split(`
572
- `),[i,l]=AU(s);if(i.length===0)return;const u=sT(i,i[0].indent,n);if(u.length===0)return;const d=((r=i[0])==null?void 0:r.number)||1,f=(o=i[0])==null?void 0:o.type;return{type:"list",ordered:!0,start:d,typeMarker:f,items:u,raw:s.slice(0,l).join(`
573
- `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(OU,this.editor.getAttributes(IC)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new wt({props:{handlePaste:(t,e)=>{var n,r;const o=(n=e.clipboardData)==null?void 0:n.getData("text/html");if(o!=null&&o.trim())return!1;const s=(r=e.clipboardData)==null?void 0:r.getData("text/plain");if(!s)return!1;const i=DU(s);if(!i)return!1;try{const l=t.state.schema.nodeFromJSON(i),u=t.state.tr.replaceSelectionWith(l);return t.dispatch(u),!0}catch{return!1}}}})]},addInputRules(){const t=(n,r)=>(!r.attrs.type||r.attrs.type==="1")&&r.childCount+r.attrs.start===+n[1];let e=dl({find:PC,type:this.type,getAttributes:n=>({start:+n[1]}),joinPredicate:t});return(this.options.keepMarks||this.options.keepAttributes)&&(e=dl({find:PC,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:n=>({start:+n[1],...this.editor.getAttributes(IC)}),joinPredicate:t,editor:this.editor})),[e]}}),IU=/^\s*(\[([( |x])?\])\s$/,PU=ft.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",Qt(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{const n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):n.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){const r=e.parseChildren(t.nestedTokens);n.push(...r)}return e.createNode("taskItem",{checked:t.checked||!1},n)},renderMarkdown:(t,e)=>{var n;const o=`- [${(n=t.attrs)!=null&&n.checked?"x":" "}] `;return jx(t,e,o)},addExtensions(){return this.options.nested?[Z6(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const o=document.createElement("li"),s=document.createElement("label"),i=document.createElement("span"),l=document.createElement("input"),u=document.createElement("div"),d=p=>{var m,y;l.ariaLabel=((y=(m=this.options.a11y)==null?void 0:m.checkboxLabel)==null?void 0:y.call(m,p,l.checked))||`Task item checkbox for ${p.textContent||"empty task item"}`};d(t),s.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",p=>p.preventDefault()),l.addEventListener("change",p=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:m}=p.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:y})=>{const v=n();if(typeof v!="number")return!1;const b=y.doc.nodeAt(v);return y.setNodeMarkup(v,void 0,{...b==null?void 0:b.attrs,checked:m}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,m)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([p,m])=>{o.setAttribute(p,m)}),o.dataset.checked=t.attrs.checked,l.checked=t.attrs.checked,s.append(l,i),o.append(s,u),Object.entries(e).forEach(([p,m])=>{o.setAttribute(p,m)});let f=new Set(Object.keys(e));return{dom:o,contentDOM:u,update:p=>{if(p.type!==this.type)return!1;o.dataset.checked=p.attrs.checked,l.checked=p.attrs.checked,d(p);const m=r.extensionManager.attributes,y=oc(p,m),v=new Set(Object.keys(y)),b=this.options.HTMLAttributes;return f.forEach(k=>{v.has(k)||(k in b?o.setAttribute(k,b[k]):o.removeAttribute(k))}),Object.entries(y).forEach(([k,E])=>{E==null?k in b?o.setAttribute(k,b[k]):o.removeAttribute(k):o.setAttribute(k,E)}),f=v,!0}}}},addInputRules(){return[dl({find:IU,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),jU=ft.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",Qt(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
574
- `):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const n=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){const r=s=>{const i=J1(s,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,u)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:n.inlineTokens(l.mainContent),nestedTokens:u}),customNestedParser:r},n);if(i){const l={type:"taskList",raw:i.raw,items:i.items},u=s.slice(i.raw.length);return u.trim()?[l,...n.blockTokens(u)]:[l]}return n.blockTokens(s)},o=J1(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:s=>({indentLevel:s[1].length,mainContent:s[4],checked:s[3].toLowerCase()==="x"}),createToken:(s,i)=>({type:"taskItem",raw:"",mainContent:s.mainContent,indentLevel:s.indentLevel,checked:s.checked,text:s.mainContent,tokens:n.inlineTokens(s.mainContent),nestedTokens:i}),customNestedParser:r},n);if(o)return{type:"taskList",raw:o.raw,items:o.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Ct.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(J6.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(eT.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(oT.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(iT.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(PU.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(jU.configure(this.options.taskList)),t}});var bf="&nbsp;",Ng=" ",LU=ft.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Qt(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];if(n.length===1&&n[0].type==="image")return e.parseChildren([n[0]]);const r=e.parseInline(n);return n.length===1&&n[0].type==="text"&&(n[0].raw===bf||n[0].text===bf||n[0].raw===Ng||n[0].text===Ng)&&r.length===1&&r[0].type==="text"&&(r[0].text===bf||r[0].text===Ng)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(t,e,n)=>{var r,o;if(!t)return"";const s=Array.isArray(t.content)?t.content:[];if(s.length===0){const i=Array.isArray((r=n==null?void 0:n.previousNode)==null?void 0:r.content)?n.previousNode.content:[];return((o=n==null?void 0:n.previousNode)==null?void 0:o.type)==="paragraph"&&i.length===0?bf:""}return e.renderChildren(s)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),zU=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,FU=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,$U=fr.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",Qt(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[oa({find:zU,type:this.type})]},addPasteRules(){return[li({find:FU,type:this.type})]}}),BU=ft.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),VU=fr.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",Qt(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,n){const o=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!o)return;const s=o[2].trim();return{type:"underline",raw:o[0],text:s,tokens:n.inlineTokens(s)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function HU(t={}){return new wt({view(e){return new UU(e,t)}})}class UU{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,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 s=i=>{this[o](i)};return e.dom.addEventListener(o,s),{name:o,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){if(this.cursorPos!=null&&n.doc!=e.state.doc)if(this.lastDragEvent){let r=this.computeTarget(this.lastDragEvent);r==this.cursorPos?this.updateOverlay():this.setCursor(r)}else this.updateOverlay()}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r,o=this.editorView.dom,s=o.getBoundingClientRect(),i=s.width/o.offsetWidth,l=s.height/o.offsetHeight;if(n){let p=e.nodeBefore,m=e.nodeAfter;if(p||m){let y=this.editorView.nodeDOM(this.cursorPos-(p?p.nodeSize:0));if(y){let v=y.getBoundingClientRect(),b=p?v.bottom:v.top;p&&m&&(b=(b+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let k=this.width/2*l;r={left:v.left,right:v.right,top:b-k,bottom:b+k}}}}if(!r){let p=this.editorView.coordsAtPos(this.cursorPos),m=this.width/2*i;r={left:p.left-m,right:p.left+m,top:p.top,bottom:p.bottom}}let u=this.editorView.dom.offsetParent;this.element||(this.element=u.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let d,f;if(!u||u==document.body&&getComputedStyle(u).position=="static")d=-pageXOffset,f=-pageYOffset;else{let p=u.getBoundingClientRect(),m=p.width/u.offsetWidth,y=p.height/u.offsetHeight;d=p.left-u.scrollLeft*m,f=p.top-u.scrollTop*y}this.element.style.left=(r.left-d)/i+"px",this.element.style.top=(r.top-f)/l+"px",this.element.style.width=(r.right-r.left)/i+"px",this.element.style.height=(r.bottom-r.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){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,s=typeof o=="function"?o(this.editorView,n,e):o;if(!n||s)return null;let i=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=V_(this.editorView.state.doc,i,this.editorView.dragging.slice);l!=null&&(i=l)}return i}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let n=this.computeTarget(e);n!=null&&(this.setCursor(n),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class Dt extends He{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Dt.valid(r)?new Dt(r):He.near(r)}content(){return ye.empty}eq(e){return e instanceof Dt&&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 Dt(e.resolve(n.pos))}getBookmark(){return new Yx(this.anchor)}static valid(e){let n=e.parent;if(n.inlineContent||!WU(e)||!qU(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&&Dt.valid(e))return e;let o=e.pos,s=null;for(let i=e.depth;;i--){let l=e.node(i);if(n>0?e.indexAfter(i)<l.childCount:e.index(i)>0){s=l.child(n>0?e.indexAfter(i):e.index(i)-1);break}else if(i==0)return null;o+=n;let u=e.doc.resolve(o);if(Dt.valid(u))return u}for(;;){let i=n>0?s.firstChild:s.lastChild;if(!i){if(s.isAtom&&!s.isText&&!Oe.isSelectable(s)){e=e.doc.resolve(o+s.nodeSize*n),r=!1;continue e}break}s=i,o+=n;let l=e.doc.resolve(o);if(Dt.valid(l))return l}return null}}}Dt.prototype.visible=!1;Dt.findFrom=Dt.findGapCursorFrom;He.jsonID("gapcursor",Dt);class Yx{constructor(e){this.pos=e}map(e){return new Yx(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Dt.valid(n)?new Dt(n):He.near(n)}}function aT(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function WU(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||aT(o.type))return!0;if(o.inlineContent)return!1}}return!0}function qU(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||aT(o.type))return!0;if(o.inlineContent)return!1}}return!0}function KU(){return new wt({props:{decorations:YU,createSelectionBetween(t,e,n){return e.pos==n.pos&&Dt.valid(n)?new Dt(n):null},handleClick:JU,handleKeyDown:GU,handleDOMEvents:{beforeinput:ZU}}})}const GU=q4({ArrowLeft:kf("horiz",-1),ArrowRight:kf("horiz",1),ArrowUp:kf("vert",-1),ArrowDown:kf("vert",1)});function kf(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,o,s){let i=r.selection,l=e>0?i.$to:i.$from,u=i.empty;if(i instanceof je){if(!s.endOfTextblock(n)||l.depth==0)return!1;u=!1,l=r.doc.resolve(e>0?l.after():l.before())}let d=Dt.findGapCursorFrom(l,e,u);return d?(o&&o(r.tr.setSelection(new Dt(d))),!0):!1}}function JU(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Dt.valid(r))return!1;let o=t.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&Oe.isSelectable(t.state.doc.nodeAt(o.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Dt(r))),!0)}function ZU(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Dt))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=re.empty;for(let i=r.length-1;i>=0;i--)o=re.from(r[i].createAndFill(null,o));let s=t.state.tr.replace(n.pos,n.pos,new ye(o,0,0));return s.setSelection(je.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function YU(t){if(!(t.selection instanceof Dt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",yt.create(t.doc,[In.widget(t.selection.head,e,{key:"gapcursor"})])}var Hh=200,fn=function(){};fn.prototype.append=function(e){return e.length?(e=fn.from(e),!this.length&&e||e.length<Hh&&this.leafAppend(e)||this.length<Hh&&e.leafPrepend(this)||this.appendInner(e)):this};fn.prototype.prepend=function(e){return e.length?fn.from(e).append(this):this};fn.prototype.appendInner=function(e){return new XU(this,e)};fn.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?fn.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};fn.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};fn.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)};fn.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(s,i){return o.push(e(s,i))},n,r),o};fn.from=function(e){return e instanceof fn?e:e&&e.length?new lT(e):fn.empty};var lT=(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,s){return o==0&&s==this.length?this:new e(this.values.slice(o,s))},e.prototype.getInner=function(o){return this.values[o]},e.prototype.forEachInner=function(o,s,i,l){for(var u=s;u<i;u++)if(o(this.values[u],l+u)===!1)return!1},e.prototype.forEachInvertedInner=function(o,s,i,l){for(var u=s-1;u>=i;u--)if(o(this.values[u],l+u)===!1)return!1},e.prototype.leafAppend=function(o){if(this.length+o.length<=Hh)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=Hh)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})(fn);fn.empty=new lT([]);var XU=(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,s,i){var l=this.left.length;if(o<l&&this.left.forEachInner(r,o,Math.min(s,l),i)===!1||s>l&&this.right.forEachInner(r,Math.max(o-l,0),Math.min(this.length,s)-l,i+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,s,i){var l=this.left.length;if(o>l&&this.right.forEachInvertedInner(r,o-l,Math.max(s,l)-l,i+l)===!1||s<l&&this.left.forEachInvertedInner(r,Math.min(o,l),s,i)===!1)return!1},e.prototype.sliceInner=function(r,o){if(r==0&&o==this.length)return this;var s=this.left.length;return o<=s?this.left.slice(r,o):r>=s?this.right.slice(r-s,o-s):this.left.slice(r,s).append(this.right.slice(0,o-s))},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})(fn);const QU=500;class Br{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,s;n&&(o=this.remapping(r,this.items.length),s=o.maps.length);let i=e.tr,l,u,d=[],f=[];return this.items.forEach((p,m)=>{if(!p.step){o||(o=this.remapping(r,m+1),s=o.maps.length),s--,f.push(p);return}if(o){f.push(new uo(p.map));let y=p.step.map(o.slice(s)),v;y&&i.maybeStep(y).doc&&(v=i.mapping.maps[i.mapping.maps.length-1],d.push(new uo(v,void 0,void 0,d.length+f.length))),s--,v&&o.appendMap(v,s)}else i.maybeStep(p.step);if(p.selection)return l=o?p.selection.map(o.slice(s)):p.selection,u=new Br(this.items.slice(0,r).append(f.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:u,transform:i,selection:l}}addTransform(e,n,r,o){let s=[],i=this.eventCount,l=this.items,u=!o&&l.length?l.get(l.length-1):null;for(let f=0;f<e.steps.length;f++){let p=e.steps[f].invert(e.docs[f]),m=new uo(e.mapping.maps[f],p,n),y;(y=u&&u.merge(m))&&(m=y,f?s.pop():l=l.slice(0,l.length-1)),s.push(m),n&&(i++,n=void 0),o||(u=m)}let d=i-r.depth;return d>tW&&(l=eW(l,d),i-=d),new Br(l.append(s),i)}remapping(e,n){let r=new Qu;return this.items.forEach((o,s)=>{let i=o.mirrorOffset!=null&&s-o.mirrorOffset>=e?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,i)},e,n),r}addMaps(e){return this.eventCount==0?this:new Br(this.items.append(e.map(n=>new uo(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),s=e.mapping,i=e.steps.length,l=this.eventCount;this.items.forEach(m=>{m.selection&&l--},o);let u=n;this.items.forEach(m=>{let y=s.getMirror(--u);if(y==null)return;i=Math.min(i,y);let v=s.maps[y];if(m.step){let b=e.steps[y].invert(e.docs[y]),k=m.selection&&m.selection.map(s.slice(u+1,y));k&&l++,r.push(new uo(v,b,k))}else r.push(new uo(v))},o);let d=[];for(let m=n;m<i;m++)d.push(new uo(s.maps[m]));let f=this.items.slice(0,o).append(d).append(r),p=new Br(f,l);return p.emptyItemCount()>QU&&(p=p.compress(this.items.length-r.length)),p}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=[],s=0;return this.items.forEach((i,l)=>{if(l>=e)o.push(i),i.selection&&s++;else if(i.step){let u=i.step.map(n.slice(r)),d=u&&u.getMap();if(r--,d&&n.appendMap(d,r),u){let f=i.selection&&i.selection.map(n.slice(r));f&&s++;let p=new uo(d.invert(),u,f),m,y=o.length-1;(m=o.length&&o[y].merge(p))?o[y]=m:o.push(p)}}else i.map&&r--},this.items.length,0),new Br(fn.from(o.reverse()),s)}}Br.empty=new Br(fn.empty,0);function eW(t,e){let n;return t.forEach((r,o)=>{if(r.selection&&e--==0)return n=o,!1}),t.slice(n)}class uo{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 uo(n.getMap().invert(),n,this.selection)}}}class zs{constructor(e,n,r,o,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=s}}const tW=20;function nW(t,e,n,r){let o=n.getMeta(qi),s;if(o)return o.historyState;n.getMeta(sW)&&(t=new zs(t.done,t.undone,null,0,-1));let i=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(i&&i.getMeta(qi))return i.getMeta(qi).redo?new zs(t.done.addTransform(n,void 0,r,jf(e)),t.undone,LC(n.mapping.maps),t.prevTime,t.prevComposition):new zs(t.done,t.undone.addTransform(n,void 0,r,jf(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(i&&i.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),u=t.prevTime==0||!i&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!rW(n,t.prevRanges)),d=i?Dg(t.prevRanges,n.mapping):LC(n.mapping.maps);return new zs(t.done.addTransform(n,u?e.selection.getBookmark():void 0,r,jf(e)),Br.empty,d,n.time,l??t.prevComposition)}else return(s=n.getMeta("rebased"))?new zs(t.done.rebased(n,s),t.undone.rebased(n,s),Dg(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new zs(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Dg(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function rW(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,o)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&o>=e[s]&&(n=!0)}),n}function LC(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,o,s,i)=>e.push(s,i));return e}function Dg(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),s=e.map(t[r+1],-1);o<=s&&n.push(o,s)}return n}function oW(t,e,n){let r=jf(e),o=qi.get(e).spec.config,s=(n?t.undone:t.done).popEvent(e,r);if(!s)return null;let i=s.selection.resolve(s.transform.doc),l=(n?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),o,r),u=new zs(n?l:s.remaining,n?s.remaining:l,null,0,-1);return s.transform.setSelection(i).setMeta(qi,{redo:n,historyState:u})}let Rg=!1,zC=null;function jf(t){let e=t.plugins;if(zC!=e){Rg=!1,zC=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Rg=!0;break}}return Rg}const qi=new Vt("history"),sW=new Vt("closeHistory");function iW(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new wt({key:qi,state:{init(){return new zs(Br.empty,Br.empty,null,0,-1)},apply(e,n,r){return nW(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,o=r=="historyUndo"?cT:r=="historyRedo"?dT:null;return!o||!e.editable?!1:(n.preventDefault(),o(e.state,e.dispatch))}}}})}function uT(t,e){return(n,r)=>{let o=qi.getState(n);if(!o||(t?o.undone:o.done).eventCount==0)return!1;if(r){let s=oW(o,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}const cT=uT(!1,!0),dT=uT(!0,!0);Ct.create({name:"characterCount",addOptions(){return{limit:null,autoTrim:!0,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new wt({key:new Vt("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const o=this.options.limit,s=this.options.autoTrim;if(o==null||o===0||s===!1){t=!0;return}const i=this.storage.characters({node:r.doc});if(i>o){const l=i-o,u=0,d=l;console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);const f=r.tr.deleteRange(u,d);return t=!0,f}t=!0},filterTransaction:(e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const o=this.storage.characters({node:n.doc}),s=this.storage.characters({node:e.doc});if(s<=r||o>r&&s>r&&s<=o)return!0;if(o>r&&s>r&&s>o||!e.getMeta("paste"))return!1;const l=e.selection.$head.pos,u=s-r,d=l-u,f=l;return e.deleteRange(d,f),!(this.storage.characters({node:e.doc})>r)}})]}});var aW=Ct.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[HU(this.options)]}});Ct.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new wt({key:new Vt("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:o}=e,s=[];if(!n||!r)return yt.create(t,[]);let i=0;this.options.mode==="deepest"&&t.descendants((u,d)=>{if(u.isText)return;if(!(o>=d&&o<=d+u.nodeSize-1))return!1;i+=1});let l=0;return t.descendants((u,d)=>{if(u.isText||!(o>=d&&o<=d+u.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&i-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";s.push(In.node(d,d+u.nodeSize,{class:this.options.className}))}),yt.create(t,s)}}})]}});var lW=Ct.create({name:"gapCursor",addProseMirrorPlugins(){return[KU()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=at(Me(t,"allowGapCursor",n)))!=null?e:null}}}),fT="placeholder",FC=new Vt("tiptap__placeholder");function hT(t){const{editor:e,placeholder:n,dataAttribute:r,pos:o,node:s,isEmptyDoc:i,hasAnchor:l,classes:{emptyNode:u,emptyEditor:d}}=t,f=[u];return i&&f.push(d),In.node(o,o+s.nodeSize,{class:f.join(" "),[r]:typeof n=="function"?n({editor:e,node:s,pos:o,hasAnchor:l}):n})}function pT(t,e){return typeof t=="function"?t(e):t}function mT({editor:t,options:e,dataAttribute:n,doc:r,selection:o,from:s,to:i}){const{anchor:l}=o,u=[],d=t.isEmpty;return r.nodesBetween(s,i,(f,p)=>{const m=l>=p&&l<=p+f.nodeSize,y=!f.isLeaf&&Oc(f);return f.type.isTextblock&&(m||!e.showOnlyCurrent)&&y&&u.push(hT({editor:t,isEmptyDoc:d,dataAttribute:n,hasAnchor:m,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:pT(e.emptyNodeClass,{editor:t,node:f,pos:p,hasAnchor:m})},node:f,pos:p})),e.includeChildren}),u}function gT({editor:t,options:e,dataAttribute:n,doc:r,selection:o}){if(!(t.isEditable||!e.showOnlyWhenEditable))return null;const{anchor:i}=o,l=[],u=t.isEmpty;if(e.showOnlyCurrent&&!e.includeChildren){const f=r.resolve(i),p=f.depth>0?f.node(1):f.nodeAfter,m=f.depth>0?f.before(1):i;if(p&&p.type.isTextblock&&Oc(p)){const y=i>=m&&i<=m+p.nodeSize;l.push(hT({editor:t,isEmptyDoc:u,dataAttribute:n,hasAnchor:y,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:pT(e.emptyNodeClass,{editor:t,node:p,pos:m,hasAnchor:y})},node:p,pos:m}))}}else l.push(...mT({editor:t,options:e,dataAttribute:n,doc:r,selection:o,from:0,to:r.content.size}));return yt.create(r,l)}function Ou(t,e){var n;const r=t.resolve(e);if(r.depth===0){const i=(n=r.nodeAfter)!=null?n:r.nodeBefore;if(!i)return{from:e,to:e};const l=r.nodeAfter?e:e-i.nodeSize;return{from:l,to:l+i.nodeSize}}const o=r.before(1),s=r.node(1);return{from:o,to:o+s.nodeSize}}function Iu(t,e){return{from:Math.max(0,e.from-1),to:Math.min(t.content.size,e.to-1)}}function uW(t,e,n){const r=[];return t.forEach((o,s)=>{const i=s,l=i+o.nodeSize,u=i+1,d=l+1;u<n&&d>e&&r.push({from:i,to:l})}),r}function cW(t){if(t.length===0)return[];const e=[...t].sort((r,o)=>r.from-o.from),n=[{...e[0]}];for(let r=1;r<e.length;r+=1){const o=n[n.length-1],s=e[r];s.from<=o.to?o.to=Math.max(o.to,s.to):n.push({...s})}return n}function dW(t,e){const n=uW(t,e.from,e.to);return n.push(Iu(t,Ou(t,e.from))),e.to>e.from?n.push(Iu(t,Ou(t,Math.min(e.to,t.content.size+1)-1))):e.from<t.content.size+1&&n.push(Iu(t,Ou(t,Math.min(e.from+1,t.content.size)))),n}function fW(t,e,n){const r=[];if(t.docChanged){const o=Rx(t);for(const s of o)r.push(...dW(n.doc,s.newRange))}return t.selectionSet&&(r.push(Iu(n.doc,Ou(n.doc,t.mapping.map(e.selection.anchor)))),r.push(Iu(n.doc,Ou(n.doc,n.selection.anchor)))),cW(r)}function hW(t,e,n){const r=Math.max(0,Math.min(t,n.content.size)),o=Math.max(r,Math.min(e,n.content.size));return{from:r,to:o}}function pW({decorations:t,ranges:e,editor:n,options:r,dataAttribute:o,doc:s,selection:i}){let l=t;for(const u of e){const{from:d,to:f}=hW(u.from,u.to,s),p=l.find(d,f).filter(y=>y.from>=d&&y.to<=f);p.length&&(l=l.remove(p));const m=mT({editor:n,options:r,dataAttribute:o,doc:s,selection:i,from:d,to:f});m.length&&(l=l.add(s,m))}return l}function mW({editor:t,options:e,dataAttribute:n}){return{init(r,o){const s=gT({editor:t,options:e,dataAttribute:n,doc:o.doc,selection:o.selection});return s??yt.empty},apply(r,o,s,i){if(!r.docChanged&&!r.selectionSet)return o;const l=o.map(r.mapping,r.doc),u=fW(r,s,i);return pW({decorations:l,ranges:u,editor:t,options:e,dataAttribute:n,doc:i.doc,selection:i.selection})}}}function gW(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}function yW({editor:t,options:e}){const n=e.dataAttribute?`data-${gW(e.dataAttribute)}`:`data-${fT}`,r=e.showOnlyCurrent&&!e.includeChildren;return new wt({key:FC,...r?{}:{state:mW({editor:t,options:e,dataAttribute:n})},props:{decorations:r?({doc:o,selection:s})=>gT({editor:t,options:e,dataAttribute:n,doc:o,selection:s}):o=>{var s;return e.showOnlyWhenEditable&&!t.isEditable?yt.empty:(s=FC.getState(o))!=null?s:yt.empty}}})}Ct.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:fT,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[yW({editor:this.editor,options:this.options})]}});function ly(t,e){return!t.selection.empty&&!l6(t.selection)&&e.isEditable}function xW(t,e){return ly(t,e)&&!e.isFocused&&!e.view.dragging}function vW(){var t;(t=window.getSelection())==null||t.removeAllRanges()}function bW(t){t.focus()}Ct.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new wt({key:new Vt("selection"),props:{decorations(n){return xW(n,t)?yt.create(n.doc,[In.inline(n.selection.from,n.selection.to,{class:e.className})]):null},handleDOMEvents:{blur(n){return ly(n.state,t)&&vW(),!1},focus(n){return ly(n.state,t)&&requestAnimationFrame(()=>{!t.isDestroyed&&n.hasFocus()&&bW(n)}),!1}}}})]}});var kW="skipTrailingNode";function $C({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(e==null?void 0:e.type)===t}var wW=Ct.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new Vt(this.name),n=this.options.node||((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,o])=>o).filter(o=>(this.options.notAfter||[]).concat(n).includes(o.name));return[new wt({key:e,appendTransaction:(o,s,i)=>{const{doc:l,tr:u,schema:d}=i,f=e.getState(i),p=l.content.size,m=d.nodes[n];if(!o.some(y=>y.getMeta(kW))&&f)return u.insert(p,m.create())},state:{init:(o,s)=>{const i=s.tr.doc.lastChild;return!$C({node:i,types:r})},apply:(o,s)=>{if(!o.docChanged||o.getMeta("__uniqueIDTransaction"))return s;const i=o.doc.lastChild;return!$C({node:i,types:r})}}})]}}),CW=Ct.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>cT(t,e),redo:()=>({state:t,dispatch:e})=>dT(t,e)}},addProseMirrorPlugins(){return[iW(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),SW=Ct.create({name:"starterKit",addExtensions(){var t,e,n,r;const o=[];return this.options.bold!==!1&&o.push(cH.configure(this.options.bold)),this.options.blockquote!==!1&&o.push(sH.configure(this.options.blockquote)),this.options.bulletList!==!1&&o.push(J6.configure(this.options.bulletList)),this.options.code!==!1&&o.push(hH.configure(this.options.code)),this.options.codeBlock!==!1&&o.push(gH.configure(this.options.codeBlock)),this.options.document!==!1&&o.push(yH.configure(this.options.document)),this.options.dropcursor!==!1&&o.push(aW.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&o.push(lW.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&o.push(xH.configure(this.options.hardBreak)),this.options.heading!==!1&&o.push(vH.configure(this.options.heading)),this.options.undoRedo!==!1&&o.push(CW.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&o.push(bH.configure(this.options.horizontalRule)),this.options.italic!==!1&&o.push(EH.configure(this.options.italic)),this.options.listItem!==!1&&o.push(eT.configure(this.options.listItem)),this.options.listKeymap!==!1&&o.push(oT.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&o.push(rU.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&o.push(iT.configure(this.options.orderedList)),this.options.paragraph!==!1&&o.push(LU.configure(this.options.paragraph)),this.options.strike!==!1&&o.push($U.configure(this.options.strike)),this.options.text!==!1&&o.push(BU.configure(this.options.text)),this.options.underline!==!1&&o.push(VU.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&o.push(wW.configure((r=this.options)==null?void 0:r.trailingNode)),o}}),EW=SW;const BC={};function _W(t){let e=BC[t];if(e)return e;e=BC[t]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);e.push(r)}for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);e[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return e}function fl(t,e){typeof e!="string"&&(e=fl.defaultChars);const n=_W(e);return t.replace(/(%[a-f0-9]{2})+/gi,function(r){let o="";for(let s=0,i=r.length;s<i;s+=3){const l=parseInt(r.slice(s+1,s+3),16);if(l<128){o+=n[l];continue}if((l&224)===192&&s+3<i){const u=parseInt(r.slice(s+4,s+6),16);if((u&192)===128){const d=l<<6&1984|u&63;d<128?o+="��":o+=String.fromCharCode(d),s+=3;continue}}if((l&240)===224&&s+6<i){const u=parseInt(r.slice(s+4,s+6),16),d=parseInt(r.slice(s+7,s+9),16);if((u&192)===128&&(d&192)===128){const f=l<<12&61440|u<<6&4032|d&63;f<2048||f>=55296&&f<=57343?o+="���":o+=String.fromCharCode(f),s+=6;continue}}if((l&248)===240&&s+9<i){const u=parseInt(r.slice(s+4,s+6),16),d=parseInt(r.slice(s+7,s+9),16),f=parseInt(r.slice(s+10,s+12),16);if((u&192)===128&&(d&192)===128&&(f&192)===128){let p=l<<18&1835008|u<<12&258048|d<<6&4032|f&63;p<65536||p>1114111?o+="����":(p-=65536,o+=String.fromCharCode(55296+(p>>10),56320+(p&1023))),s+=9;continue}}o+="�"}return o})}fl.defaultChars=";/?:@&=+$,#";fl.componentChars="";const VC={};function TW(t){let e=VC[t];if(e)return e;e=VC[t]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);/^[0-9a-z]$/i.test(r)?e.push(r):e.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<t.length;n++)e[t.charCodeAt(n)]=t[n];return e}function Pc(t,e,n){typeof e!="string"&&(n=e,e=Pc.defaultChars),typeof n>"u"&&(n=!0);const r=TW(e);let o="";for(let s=0,i=t.length;s<i;s++){const l=t.charCodeAt(s);if(n&&l===37&&s+2<i&&/^[0-9a-f]{2}$/i.test(t.slice(s+1,s+3))){o+=t.slice(s,s+3),s+=2;continue}if(l<128){o+=r[l];continue}if(l>=55296&&l<=57343){if(l>=55296&&l<=56319&&s+1<i){const u=t.charCodeAt(s+1);if(u>=56320&&u<=57343){o+=encodeURIComponent(t[s]+t[s+1]),s++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(t[s])}return o}Pc.defaultChars=";/?:@&=+$,-_.!~*'()#";Pc.componentChars="-_.!~*'()";function Xx(t){let e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&t.hostname.indexOf(":")!==-1?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||"",e}function Uh(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const MW=/^([a-z0-9.+-]+:)/i,AW=/:[0-9]*$/,NW=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,DW=["<",">",'"',"`"," ","\r",`
575
- `," "],RW=["{","}","|","\\","^","`"].concat(DW),OW=["'"].concat(RW),HC=["%","/","?",";","#"].concat(OW),UC=["/","?","#"],IW=255,WC=/^[+a-z0-9A-Z_-]{0,63}$/,PW=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,qC={javascript:!0,"javascript:":!0},KC={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Qx(t,e){if(t&&t instanceof Uh)return t;const n=new Uh;return n.parse(t,e),n}Uh.prototype.parse=function(t,e){let n,r,o,s=t;if(s=s.trim(),!e&&t.split("#").length===1){const d=NW.exec(s);if(d)return this.pathname=d[1],d[2]&&(this.search=d[2]),this}let i=MW.exec(s);if(i&&(i=i[0],n=i.toLowerCase(),this.protocol=i,s=s.substr(i.length)),(e||i||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=s.substr(0,2)==="//",o&&!(i&&qC[i])&&(s=s.substr(2),this.slashes=!0)),!qC[i]&&(o||i&&!KC[i])){let d=-1;for(let v=0;v<UC.length;v++)r=s.indexOf(UC[v]),r!==-1&&(d===-1||r<d)&&(d=r);let f,p;d===-1?p=s.lastIndexOf("@"):p=s.lastIndexOf("@",d),p!==-1&&(f=s.slice(0,p),s=s.slice(p+1),this.auth=f),d=-1;for(let v=0;v<HC.length;v++)r=s.indexOf(HC[v]),r!==-1&&(d===-1||r<d)&&(d=r);d===-1&&(d=s.length),s[d-1]===":"&&d--;const m=s.slice(0,d);s=s.slice(d),this.parseHost(m),this.hostname=this.hostname||"";const y=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!y){const v=this.hostname.split(/\./);for(let b=0,k=v.length;b<k;b++){const E=v[b];if(E&&!E.match(WC)){let _="";for(let T=0,A=E.length;T<A;T++)E.charCodeAt(T)>127?_+="x":_+=E[T];if(!_.match(WC)){const T=v.slice(0,b),A=v.slice(b+1),N=E.match(PW);N&&(T.push(N[1]),A.unshift(N[2])),A.length&&(s=A.join(".")+s),this.hostname=T.join(".");break}}}}this.hostname.length>IW&&(this.hostname=""),y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=s.indexOf("#");l!==-1&&(this.hash=s.substr(l),s=s.slice(0,l));const u=s.indexOf("?");return u!==-1&&(this.search=s.substr(u),s=s.slice(0,u)),s&&(this.pathname=s),KC[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Uh.prototype.parseHost=function(t){let e=AW.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};const jW=Object.freeze(Object.defineProperty({__proto__:null,decode:fl,encode:Pc,format:Xx,parse:Qx},Symbol.toStringTag,{value:"Module"})),yT=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,xT=/[\0-\x1F\x7F-\x9F]/,LW=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,ev=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,vT=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,bT=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,zW=Object.freeze(Object.defineProperty({__proto__:null,Any:yT,Cc:xT,Cf:LW,P:ev,S:vT,Z:bT},Symbol.toStringTag,{value:"Module"})),FW=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),$W=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(t=>t.charCodeAt(0)));var Og;const BW=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),VW=(Og=String.fromCodePoint)!==null&&Og!==void 0?Og:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function HW(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=BW.get(t))!==null&&e!==void 0?e:t}var cn;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(cn||(cn={}));const UW=32;var qs;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(qs||(qs={}));function uy(t){return t>=cn.ZERO&&t<=cn.NINE}function WW(t){return t>=cn.UPPER_A&&t<=cn.UPPER_F||t>=cn.LOWER_A&&t<=cn.LOWER_F}function qW(t){return t>=cn.UPPER_A&&t<=cn.UPPER_Z||t>=cn.LOWER_A&&t<=cn.LOWER_Z||uy(t)}function KW(t){return t===cn.EQUALS||qW(t)}var sn;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(sn||(sn={}));var qo;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(qo||(qo={}));class GW{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=sn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=qo.Strict}startEntity(e){this.decodeMode=e,this.state=sn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case sn.EntityStart:return e.charCodeAt(n)===cn.NUM?(this.state=sn.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=sn.NamedEntity,this.stateNamedEntity(e,n));case sn.NumericStart:return this.stateNumericStart(e,n);case sn.NumericDecimal:return this.stateNumericDecimal(e,n);case sn.NumericHex:return this.stateNumericHex(e,n);case sn.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|UW)===cn.LOWER_X?(this.state=sn.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=sn.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,o){if(n!==r){const s=r-n;this.result=this.result*Math.pow(o,s)+parseInt(e.substr(n,s),o),this.consumed+=s}}stateNumericHex(e,n){const r=n;for(;n<e.length;){const o=e.charCodeAt(n);if(uy(o)||WW(o))n+=1;else return this.addToNumericResult(e,r,n,16),this.emitNumericEntity(o,3)}return this.addToNumericResult(e,r,n,16),-1}stateNumericDecimal(e,n){const r=n;for(;n<e.length;){const o=e.charCodeAt(n);if(uy(o))n+=1;else return this.addToNumericResult(e,r,n,10),this.emitNumericEntity(o,2)}return this.addToNumericResult(e,r,n,10),-1}emitNumericEntity(e,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===cn.SEMI)this.consumed+=1;else if(this.decodeMode===qo.Strict)return 0;return this.emitCodePoint(HW(this.result),this.consumed),this.errors&&(e!==cn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let o=r[this.treeIndex],s=(o&qs.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const i=e.charCodeAt(n);if(this.treeIndex=JW(r,o,this.treeIndex+Math.max(1,s),i),this.treeIndex<0)return this.result===0||this.decodeMode===qo.Attribute&&(s===0||KW(i))?0:this.emitNotTerminatedNamedEntity();if(o=r[this.treeIndex],s=(o&qs.VALUE_LENGTH)>>14,s!==0){if(i===cn.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==qo.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,o=(r[n]&qs.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,o,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:o}=this;return this.emitCodePoint(n===1?o[e]&~qs.VALUE_LENGTH:o[e+1],r),n===3&&this.emitCodePoint(o[e+2],r),r}end(){var e;switch(this.state){case sn.NamedEntity:return this.result!==0&&(this.decodeMode!==qo.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case sn.NumericDecimal:return this.emitNumericEntity(0,2);case sn.NumericHex:return this.emitNumericEntity(0,3);case sn.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case sn.EntityStart:return 0}}}function kT(t){let e="";const n=new GW(t,r=>e+=VW(r));return function(o,s){let i=0,l=0;for(;(l=o.indexOf("&",l))>=0;){e+=o.slice(i,l),n.startEntity(s);const d=n.write(o,l+1);if(d<0){i=l+n.end();break}i=l+d,l=d===0?i+1:i}const u=e+o.slice(i);return e="",u}}function JW(t,e,n,r){const o=(e&qs.BRANCH_LENGTH)>>7,s=e&qs.JUMP_TABLE;if(o===0)return s!==0&&r===s?n:-1;if(s){const u=r-s;return u<0||u>=o?-1:t[n+u]-1}let i=n,l=i+o-1;for(;i<=l;){const u=i+l>>>1,d=t[u];if(d<r)i=u+1;else if(d>r)l=u-1;else return t[u+o]}return-1}const wT=kT(FW);kT($W);function ZW(t,e=qo.Legacy){return wT(t,e)}function YW(t){return wT(t,qo.Strict)}function XW(t){return Object.prototype.toString.call(t)}function tv(t){return XW(t)==="[object String]"}const QW=Object.prototype.hasOwnProperty;function eq(t,e){return QW.call(t,e)}function Fp(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){if(n){if(typeof n!="object")throw new TypeError(n+"must be object");Object.keys(n).forEach(function(r){t[r]=n[r]})}}),t}function CT(t,e,n){return[].concat(t.slice(0,e),n,t.slice(e+1))}function nv(t){return!(t>=55296&&t<=57343||t>=64976&&t<=65007||(t&65535)===65535||(t&65535)===65534||t>=0&&t<=8||t===11||t>=14&&t<=31||t>=127&&t<=159||t>1114111)}function ac(t){if(t>65535){t-=65536;const e=55296+(t>>10),n=56320+(t&1023);return String.fromCharCode(e,n)}return String.fromCharCode(t)}const ST=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,tq=/&([a-z#][a-z0-9]{1,31});/gi,nq=new RegExp(ST.source+"|"+tq.source,"gi"),rq=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function oq(t,e){if(e.charCodeAt(0)===35&&rq.test(e)){const r=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return nv(r)?ac(r):t}const n=ZW(t);return n!==t?n:t}function sq(t){return t.indexOf("\\")<0?t:t.replace(ST,"$1")}function hl(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(nq,function(e,n,r){return n||oq(e,r)})}const iq=/[&<>"]/,aq=/[&<>"]/g,lq={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function uq(t){return lq[t]}function ui(t){return iq.test(t)?t.replace(aq,uq):t}const cq=/[.?*+^$[\]\\(){}|-]/g;function dq(t){return t.replace(cq,"\\$&")}function xt(t){switch(t){case 9:case 32:return!0}return!1}function lc(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function ET(t){return ev.test(t)||vT.test(t)}function uc(t){return ET(ac(t))}function cc(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function $p(t){return t=t.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(t=t.replace(/ẞ/g,"ß")),t.toLowerCase().toUpperCase()}function GC(t){return t===32||t===9||t===10||t===13}function Bp(t){let e=0;for(;e<t.length&&GC(t.charCodeAt(e));e++);let n=t.length-1;for(;n>=e&&GC(t.charCodeAt(n));n--);return t.slice(e,n+1)}const fq={mdurl:jW,ucmicro:zW},hq=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:CT,asciiTrim:Bp,assign:Fp,escapeHtml:ui,escapeRE:dq,fromCodePoint:ac,has:eq,isMdAsciiPunct:cc,isPunctChar:ET,isPunctCharCode:uc,isSpace:xt,isString:tv,isValidEntityCode:nv,isWhiteSpace:lc,lib:fq,normalizeReference:$p,unescapeAll:hl,unescapeMd:sq},Symbol.toStringTag,{value:"Module"}));function pq(t,e,n){let r,o,s,i;const l=t.posMax,u=t.pos;for(t.pos=e+1,r=1;t.pos<l;){if(s=t.src.charCodeAt(t.pos),s===93&&(r--,r===0)){o=!0;break}if(i=t.pos,t.md.inline.skipToken(t),s===91){if(i===t.pos-1)r++;else if(n)return t.pos=u,-1}}let d=-1;return o&&(d=t.pos),t.pos=u,d}function mq(t,e,n){let r,o=e;const s={ok:!1,pos:0,str:""};if(t.charCodeAt(o)===60){for(o++;o<n;){if(r=t.charCodeAt(o),r===10||r===60)return s;if(r===62)return s.pos=o+1,s.str=hl(t.slice(e+1,o)),s.ok=!0,s;if(r===92&&o+1<n){o+=2;continue}o++}return s}let i=0;for(;o<n&&(r=t.charCodeAt(o),!(r===32||r<32||r===127));){if(r===92&&o+1<n){if(t.charCodeAt(o+1)===32)break;o+=2;continue}if(r===40&&(i++,i>32))return s;if(r===41){if(i===0)break;i--}o++}return e===o||i!==0||(s.str=hl(t.slice(e,o)),s.pos=o,s.ok=!0),s}function gq(t,e,n,r){let o,s=e;const i={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)i.str=r.str,i.marker=r.marker;else{if(s>=n)return i;let l=t.charCodeAt(s);if(l!==34&&l!==39&&l!==40)return i;e++,s++,l===40&&(l=41),i.marker=l}for(;s<n;){if(o=t.charCodeAt(s),o===i.marker)return i.pos=s+1,i.str+=hl(t.slice(e,s)),i.ok=!0,i;if(o===40&&i.marker===41)return i;o===92&&s+1<n&&s++,s++}return i.can_continue=!0,i.str+=hl(t.slice(e,s)),i}const yq=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:mq,parseLinkLabel:pq,parseLinkTitle:gq},Symbol.toStringTag,{value:"Module"})),Co={};Co.code_inline=function(t,e,n,r,o){const s=t[e];return"<code"+o.renderAttrs(s)+">"+ui(s.content)+"</code>"};Co.code_block=function(t,e,n,r,o){const s=t[e];return"<pre"+o.renderAttrs(s)+"><code>"+ui(t[e].content)+`</code></pre>
576
- `};Co.fence=function(t,e,n,r,o){const s=t[e],i=s.info?hl(s.info).trim():"";let l="",u="";if(i){const f=i.split(/(\s+)/g);l=f[0],u=f.slice(2).join("")}let d;if(n.highlight?d=n.highlight(s.content,l,u)||ui(s.content):d=ui(s.content),d.indexOf("<pre")===0)return d+`
577
- `;if(i){const f=s.attrIndex("class"),p=s.attrs?s.attrs.slice():[];f<0?p.push(["class",n.langPrefix+l]):(p[f]=p[f].slice(),p[f][1]+=" "+n.langPrefix+l);const m={attrs:p};return`<pre><code${o.renderAttrs(m)}>${d}</code></pre>
578
- `}return`<pre><code${o.renderAttrs(s)}>${d}</code></pre>
579
- `};Co.image=function(t,e,n,r,o){const s=t[e];return s.attrs[s.attrIndex("alt")][1]=o.renderInlineAsText(s.children,n,r),o.renderToken(t,e,n)};Co.hardbreak=function(t,e,n){return n.xhtmlOut?`<br />
580
- `:`<br>
581
- `};Co.softbreak=function(t,e,n){return n.breaks?n.xhtmlOut?`<br />
582
- `:`<br>
583
- `:`
584
- `};Co.text=function(t,e){return ui(t[e].content)};Co.html_block=function(t,e){return t[e].content};Co.html_inline=function(t,e){return t[e].content};function Cl(){this.rules=Fp({},Co)}Cl.prototype.renderAttrs=function(e){let n,r,o;if(!e.attrs)return"";for(o="",n=0,r=e.attrs.length;n<r;n++)o+=" "+ui(e.attrs[n][0])+'="'+ui(e.attrs[n][1])+'"';return o};Cl.prototype.renderToken=function(e,n,r){const o=e[n];let s="";if(o.hidden)return"";o.block&&o.nesting!==-1&&n&&e[n-1].hidden&&(s+=`
585
- `),s+=(o.nesting===-1?"</":"<")+o.tag,s+=this.renderAttrs(o),o.nesting===0&&r.xhtmlOut&&(s+=" /");let i=!1;if(o.block&&(i=!0,o.nesting===1&&n+1<e.length)){const l=e[n+1];(l.type==="inline"||l.hidden||l.nesting===-1&&l.tag===o.tag)&&(i=!1)}return s+=i?`>
586
- `:">",s};Cl.prototype.renderInline=function(t,e,n){let r="";const o=this.rules;for(let s=0,i=t.length;s<i;s++){const l=t[s].type;typeof o[l]<"u"?r+=o[l](t,s,e,n,this):r+=this.renderToken(t,s,e)}return r};Cl.prototype.renderInlineAsText=function(t,e,n){let r="";for(let o=0,s=t.length;o<s;o++)switch(t[o].type){case"text":r+=t[o].content;break;case"image":r+=this.renderInlineAsText(t[o].children,e,n);break;case"html_inline":case"html_block":r+=t[o].content;break;case"softbreak":case"hardbreak":r+=`
587
- `;break}return r};Cl.prototype.render=function(t,e,n){let r="";const o=this.rules;for(let s=0,i=t.length;s<i;s++){const l=t[s].type;l==="inline"?r+=this.renderInline(t[s].children,e,n):typeof o[l]<"u"?r+=o[l](t,s,e,n,this):r+=this.renderToken(t,s,e,n)}return r};function Qn(){this.__rules__=[],this.__cache__=null}Qn.prototype.__find__=function(t){for(let e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===t)return e;return-1};Qn.prototype.__compile__=function(){const t=this,e=[""];t.__rules__.forEach(function(n){n.enabled&&n.alt.forEach(function(r){e.indexOf(r)<0&&e.push(r)})}),t.__cache__={},e.forEach(function(n){t.__cache__[n]=[],t.__rules__.forEach(function(r){r.enabled&&(n&&r.alt.indexOf(n)<0||t.__cache__[n].push(r.fn))})})};Qn.prototype.at=function(t,e,n){const r=this.__find__(t),o=n||{};if(r===-1)throw new Error("Parser rule not found: "+t);this.__rules__[r].fn=e,this.__rules__[r].alt=o.alt||[],this.__cache__=null};Qn.prototype.before=function(t,e,n,r){const o=this.__find__(t),s=r||{};if(o===-1)throw new Error("Parser rule not found: "+t);this.__rules__.splice(o,0,{name:e,enabled:!0,fn:n,alt:s.alt||[]}),this.__cache__=null};Qn.prototype.after=function(t,e,n,r){const o=this.__find__(t),s=r||{};if(o===-1)throw new Error("Parser rule not found: "+t);this.__rules__.splice(o+1,0,{name:e,enabled:!0,fn:n,alt:s.alt||[]}),this.__cache__=null};Qn.prototype.push=function(t,e,n){const r=n||{};this.__rules__.push({name:t,enabled:!0,fn:e,alt:r.alt||[]}),this.__cache__=null};Qn.prototype.enable=function(t,e){Array.isArray(t)||(t=[t]);const n=[];return t.forEach(function(r){const o=this.__find__(r);if(o<0){if(e)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[o].enabled=!0,n.push(r)},this),this.__cache__=null,n};Qn.prototype.enableOnly=function(t,e){Array.isArray(t)||(t=[t]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(t,e)};Qn.prototype.disable=function(t,e){Array.isArray(t)||(t=[t]);const n=[];return t.forEach(function(r){const o=this.__find__(r);if(o<0){if(e)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[o].enabled=!1,n.push(r)},this),this.__cache__=null,n};Qn.prototype.getRules=function(t){return this.__cache__===null&&this.__compile__(),this.__cache__[t]||[]};function Jr(t,e,n){this.type=t,this.tag=e,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}Jr.prototype.attrIndex=function(e){if(!this.attrs)return-1;const n=this.attrs;for(let r=0,o=n.length;r<o;r++)if(n[r][0]===e)return r;return-1};Jr.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]};Jr.prototype.attrSet=function(e,n){const r=this.attrIndex(e),o=[e,n];r<0?this.attrPush(o):this.attrs[r]=o};Jr.prototype.attrGet=function(e){const n=this.attrIndex(e);let r=null;return n>=0&&(r=this.attrs[n][1]),r};Jr.prototype.attrJoin=function(e,n){const r=this.attrIndex(e);r<0?this.attrPush([e,n]):this.attrs[r][1]=this.attrs[r][1]+" "+n};function _T(t,e,n){this.src=t,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=e}_T.prototype.Token=Jr;const xq=/\r\n?|\n/g,vq=/\0/g;function bq(t){let e;e=t.src.replace(xq,`
588
- `),e=e.replace(vq,"�"),t.src=e}function kq(t){let e;t.inlineMode?(e=new t.Token("inline","",0),e.content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}function wq(t){const e=t.tokens;for(let n=0,r=e.length;n<r;n++){const o=e[n];o.type==="inline"&&t.md.inline.parse(o.content,t.md,t.env,o.children)}}function Cq(t){return/^<a[>\s]/i.test(t)}function Sq(t){return/^<\/a\s*>/i.test(t)}function Eq(t){const e=t.tokens;if(t.md.options.linkify)for(let n=0,r=e.length;n<r;n++){if(e[n].type!=="inline"||!t.md.linkify.pretest(e[n].content))continue;let o=e[n].children,s=0;for(let i=o.length-1;i>=0;i--){const l=o[i];if(l.type==="link_close"){for(i--;o[i].level!==l.level&&o[i].type!=="link_open";)i--;continue}if(l.type==="html_inline"&&(Cq(l.content)&&s>0&&s--,Sq(l.content)&&s++),!(s>0)&&l.type==="text"&&t.md.linkify.test(l.content)){const u=l.content;let d=t.md.linkify.match(u);const f=[];let p=l.level,m=0;d.length>0&&d[0].index===0&&i>0&&o[i-1].type==="text_special"&&(d=d.slice(1));for(let y=0;y<d.length;y++){const v=d[y].url,b=t.md.normalizeLink(v);if(!t.md.validateLink(b))continue;let k=d[y].text;d[y].schema?d[y].schema==="mailto:"&&!/^mailto:/i.test(k)?k=t.md.normalizeLinkText("mailto:"+k).replace(/^mailto:/,""):k=t.md.normalizeLinkText(k):k=t.md.normalizeLinkText("http://"+k).replace(/^http:\/\//,"");const E=d[y].index;if(E>m){const N=new t.Token("text","",0);N.content=u.slice(m,E),N.level=p,f.push(N)}const _=new t.Token("link_open","a",1);_.attrs=[["href",b]],_.level=p++,_.markup="linkify",_.info="auto",f.push(_);const T=new t.Token("text","",0);T.content=k,T.level=p,f.push(T);const A=new t.Token("link_close","a",-1);A.level=--p,A.markup="linkify",A.info="auto",f.push(A),m=d[y].lastIndex}if(m<u.length){const y=new t.Token("text","",0);y.content=u.slice(m),y.level=p,f.push(y)}e[n].children=o=CT(o,i,f)}}}}const TT=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,_q=/\((c|tm|r)\)/i,Tq=/\((c|tm|r)\)/ig,Mq={c:"©",r:"®",tm:"™"};function Aq(t,e){return Mq[e.toLowerCase()]}function Nq(t){let e=0;for(let n=t.length-1;n>=0;n--){const r=t[n];r.type==="text"&&!e&&(r.content=r.content.replace(Tq,Aq)),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function Dq(t){let e=0;for(let n=t.length-1;n>=0;n--){const r=t[n];r.type==="text"&&!e&&TT.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function Rq(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(_q.test(t.tokens[e].content)&&Nq(t.tokens[e].children),TT.test(t.tokens[e].content)&&Dq(t.tokens[e].children))}const Oq=/['"]/,JC=/['"]/g,ZC="’";function wf(t,e,n,r){t[e]||(t[e]=[]),t[e].push({pos:n,ch:r})}function Iq(t,e){let n="",r=0;e.sort((o,s)=>o.pos-s.pos);for(let o=0;o<e.length;o++){const s=e[o];n+=t.slice(r,s.pos)+s.ch,r=s.pos+1}return n+t.slice(r)}function Pq(t,e){let n;const r=[],o={};for(let s=0;s<t.length;s++){const i=t[s],l=t[s].level;for(n=r.length-1;n>=0&&!(r[n].level<=l);n--);if(r.length=n+1,i.type!=="text")continue;const u=i.content;let d=0;const f=u.length;e:for(;d<f;){JC.lastIndex=d;const p=JC.exec(u);if(!p)break;let m=!0,y=!0;d=p.index+1;const v=p[0]==="'";let b=32;if(p.index-1>=0)b=u.charCodeAt(p.index-1);else for(n=s-1;n>=0&&!(t[n].type==="softbreak"||t[n].type==="hardbreak");n--)if(t[n].content){b=t[n].content.charCodeAt(t[n].content.length-1);break}let k=32;if(d<f)k=u.charCodeAt(d);else for(n=s+1;n<t.length&&!(t[n].type==="softbreak"||t[n].type==="hardbreak");n++)if(t[n].content){k=t[n].content.charCodeAt(0);break}const E=cc(b)||uc(b),_=cc(k)||uc(k),T=lc(b),A=lc(k);if(A?m=!1:_&&(T||E||(m=!1)),T?y=!1:E&&(A||_||(y=!1)),k===34&&p[0]==='"'&&b>=48&&b<=57&&(y=m=!1),m&&y&&(m=E,y=_),!m&&!y){v&&wf(o,s,p.index,ZC);continue}if(y)for(n=r.length-1;n>=0;n--){let N=r[n];if(r[n].level<l)break;if(N.single===v&&r[n].level===l){N=r[n];let D,I;v?(D=e.md.options.quotes[2],I=e.md.options.quotes[3]):(D=e.md.options.quotes[0],I=e.md.options.quotes[1]),wf(o,s,p.index,I),wf(o,N.token,N.pos,D),r.length=n;continue e}}m?r.push({token:s,pos:p.index,single:v,level:l}):y&&v&&wf(o,s,p.index,ZC)}}Object.keys(o).forEach(function(s){t[s].content=Iq(t[s].content,o[s])})}function jq(t){if(t.md.options.typographer)for(let e=t.tokens.length-1;e>=0;e--)t.tokens[e].type!=="inline"||!Oq.test(t.tokens[e].content)||Pq(t.tokens[e].children,t)}function Lq(t){let e,n;const r=t.tokens,o=r.length;for(let s=0;s<o;s++){if(r[s].type!=="inline")continue;const i=r[s].children,l=i.length;for(e=0;e<l;e++)i[e].type==="text_special"&&(i[e].type="text");for(e=n=0;e<l;e++)i[e].type==="text"&&e+1<l&&i[e+1].type==="text"?i[e+1].content=i[e].content+i[e+1].content:(e!==n&&(i[n]=i[e]),n++);e!==n&&(i.length=n)}}const Ig=[["normalize",bq],["block",kq],["inline",wq],["linkify",Eq],["replacements",Rq],["smartquotes",jq],["text_join",Lq]];function rv(){this.ruler=new Qn;for(let t=0;t<Ig.length;t++)this.ruler.push(Ig[t][0],Ig[t][1])}rv.prototype.process=function(t){const e=this.ruler.getRules("");for(let n=0,r=e.length;n<r;n++)e[n](t)};rv.prototype.State=_T;function So(t,e,n,r){this.src=t,this.md=e,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const o=this.src;for(let s=0,i=0,l=0,u=0,d=o.length,f=!1;i<d;i++){const p=o.charCodeAt(i);if(!f)if(xt(p)){l++,p===9?u+=4-u%4:u++;continue}else f=!0;(p===10||i===d-1)&&(p!==10&&i++,this.bMarks.push(s),this.eMarks.push(i),this.tShift.push(l),this.sCount.push(u),this.bsCount.push(0),f=!1,l=0,u=0,s=i+1)}this.bMarks.push(o.length),this.eMarks.push(o.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}So.prototype.push=function(t,e,n){const r=new Jr(t,e,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r};So.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]};So.prototype.skipEmptyLines=function(e){for(let n=this.lineMax;e<n&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e};So.prototype.skipSpaces=function(e){for(let n=this.src.length;e<n;e++){const r=this.src.charCodeAt(e);if(!xt(r))break}return e};So.prototype.skipSpacesBack=function(e,n){if(e<=n)return e;for(;e>n;)if(!xt(this.src.charCodeAt(--e)))return e+1;return e};So.prototype.skipChars=function(e,n){for(let r=this.src.length;e<r&&this.src.charCodeAt(e)===n;e++);return e};So.prototype.skipCharsBack=function(e,n,r){if(e<=r)return e;for(;e>r;)if(n!==this.src.charCodeAt(--e))return e+1;return e};So.prototype.getLines=function(e,n,r,o){if(e>=n)return"";const s=new Array(n-e);for(let i=0,l=e;l<n;l++,i++){let u=0;const d=this.bMarks[l];let f=d,p;for(l+1<n||o?p=this.eMarks[l]+1:p=this.eMarks[l];f<p&&u<r;){const m=this.src.charCodeAt(f);if(xt(m))m===9?u+=4-(u+this.bsCount[l])%4:u++;else if(f-d<this.tShift[l])u++;else break;f++}u>r?s[i]=new Array(u-r+1).join(" ")+this.src.slice(f,p):s[i]=this.src.slice(f,p)}return s.join("")};So.prototype.Token=Jr;const zq=65536;function Pg(t,e){const n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];return t.src.slice(n,r)}function YC(t){const e=[],n=t.length;let r=0,o=t.charCodeAt(r),s=!1,i=0,l="";for(;r<n;)o===124&&(s?(l+=t.substring(i,r-1),i=r):(e.push(l+t.substring(i,r)),l="",i=r+1)),s=o===92,r++,o=t.charCodeAt(r);return e.push(l+t.substring(i)),e}function Fq(t,e,n,r){if(e+2>n)return!1;let o=e+1;if(t.sCount[o]<t.blkIndent||t.sCount[o]-t.blkIndent>=4)return!1;let s=t.bMarks[o]+t.tShift[o];if(s>=t.eMarks[o])return!1;const i=t.src.charCodeAt(s++);if(i!==124&&i!==45&&i!==58||s>=t.eMarks[o])return!1;const l=t.src.charCodeAt(s++);if(l!==124&&l!==45&&l!==58&&!xt(l)||i===45&&xt(l))return!1;for(;s<t.eMarks[o];){const A=t.src.charCodeAt(s);if(A!==124&&A!==45&&A!==58&&!xt(A))return!1;s++}let u=Pg(t,e+1),d=u.split("|");const f=[];for(let A=0;A<d.length;A++){const N=d[A].trim();if(!N){if(A===0||A===d.length-1)continue;return!1}if(!/^:?-+:?$/.test(N))return!1;N.charCodeAt(N.length-1)===58?f.push(N.charCodeAt(0)===58?"center":"right"):N.charCodeAt(0)===58?f.push("left"):f.push("")}if(u=Pg(t,e).trim(),u.indexOf("|")===-1||t.sCount[e]-t.blkIndent>=4)return!1;d=YC(u),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop();const p=d.length;if(p===0||p!==f.length)return!1;if(r)return!0;const m=t.parentType;t.parentType="table";const y=t.md.block.ruler.getRules("blockquote"),v=t.push("table_open","table",1),b=[e,0];v.map=b;const k=t.push("thead_open","thead",1);k.map=[e,e+1];const E=t.push("tr_open","tr",1);E.map=[e,e+1];for(let A=0;A<d.length;A++){const N=t.push("th_open","th",1);f[A]&&(N.attrs=[["style","text-align:"+f[A]]]);const D=t.push("inline","",0);D.content=d[A].trim(),D.children=[],t.push("th_close","th",-1)}t.push("tr_close","tr",-1),t.push("thead_close","thead",-1);let _,T=0;for(o=e+2;o<n&&!(t.sCount[o]<t.blkIndent);o++){let A=!1;for(let D=0,I=y.length;D<I;D++)if(y[D](t,o,n,!0)){A=!0;break}if(A||(u=Pg(t,o).trim(),!u)||t.sCount[o]-t.blkIndent>=4||(d=YC(u),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop(),T+=p-d.length,T>zq))break;if(o===e+2){const D=t.push("tbody_open","tbody",1);D.map=_=[e+2,0]}const N=t.push("tr_open","tr",1);N.map=[o,o+1];for(let D=0;D<p;D++){const I=t.push("td_open","td",1);f[D]&&(I.attrs=[["style","text-align:"+f[D]]]);const P=t.push("inline","",0);P.content=d[D]?d[D].trim():"",P.children=[],t.push("td_close","td",-1)}t.push("tr_close","tr",-1)}return _&&(t.push("tbody_close","tbody",-1),_[1]=o),t.push("table_close","table",-1),b[1]=o,t.parentType=m,t.line=o,!0}function $q(t,e,n){if(t.sCount[e]-t.blkIndent<4)return!1;let r=e+1,o=r;for(;r<n;){if(t.isEmpty(r)){r++;continue}if(t.sCount[r]-t.blkIndent>=4){r++,o=r;continue}break}t.line=o;const s=t.push("code_block","code",0);return s.content=t.getLines(e,o,4+t.blkIndent,!1)+`
589
- `,s.map=[e,t.line],!0}function Bq(t,e,n,r){let o=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||o+3>s)return!1;const i=t.src.charCodeAt(o);if(i!==126&&i!==96)return!1;let l=o;o=t.skipChars(o,i);let u=o-l;if(u<3)return!1;const d=t.src.slice(l,o),f=t.src.slice(o,s);if(i===96&&f.indexOf(String.fromCharCode(i))>=0)return!1;if(r)return!0;let p=e,m=!1;for(;p++,!(p>=n||(o=l=t.bMarks[p]+t.tShift[p],s=t.eMarks[p],o<s&&t.sCount[p]<t.blkIndent));)if(t.src.charCodeAt(o)===i&&!(t.sCount[p]-t.blkIndent>=4)&&(o=t.skipChars(o,i),!(o-l<u)&&(o=t.skipSpaces(o),!(o<s)))){m=!0;break}u=t.sCount[e],t.line=p+(m?1:0);const y=t.push("fence","code",0);return y.info=f,y.content=t.getLines(e+1,p,u,!0),y.markup=d,y.map=[e,t.line],!0}function Vq(t,e,n,r){let o=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];const i=t.lineMax;if(t.sCount[e]-t.blkIndent>=4||t.src.charCodeAt(o)!==62)return!1;if(r)return!0;const l=[],u=[],d=[],f=[],p=t.md.block.ruler.getRules("blockquote"),m=t.parentType;t.parentType="blockquote";let y=!1,v;for(v=e;v<n;v++){const T=t.sCount[v]<t.blkIndent;if(o=t.bMarks[v]+t.tShift[v],s=t.eMarks[v],o>=s)break;if(t.src.charCodeAt(o++)===62&&!T){let N=t.sCount[v]+1,D,I;t.src.charCodeAt(o)===32?(o++,N++,I=!1,D=!0):t.src.charCodeAt(o)===9?(D=!0,(t.bsCount[v]+N)%4===3?(o++,N++,I=!1):I=!0):D=!1;let P=N;for(l.push(t.bMarks[v]),t.bMarks[v]=o;o<s;){const O=t.src.charCodeAt(o);if(xt(O))O===9?P+=4-(P+t.bsCount[v]+(I?1:0))%4:P++;else break;o++}y=o>=s,u.push(t.bsCount[v]),t.bsCount[v]=t.sCount[v]+1+(D?1:0),d.push(t.sCount[v]),t.sCount[v]=P-N,f.push(t.tShift[v]),t.tShift[v]=o-t.bMarks[v];continue}if(y)break;let A=!1;for(let N=0,D=p.length;N<D;N++)if(p[N](t,v,n,!0)){A=!0;break}if(A){t.lineMax=v,t.blkIndent!==0&&(l.push(t.bMarks[v]),u.push(t.bsCount[v]),f.push(t.tShift[v]),d.push(t.sCount[v]),t.sCount[v]-=t.blkIndent);break}l.push(t.bMarks[v]),u.push(t.bsCount[v]),f.push(t.tShift[v]),d.push(t.sCount[v]),t.sCount[v]=-1}const b=t.blkIndent;t.blkIndent=0;const k=t.push("blockquote_open","blockquote",1);k.markup=">";const E=[e,0];k.map=E,t.md.block.tokenize(t,e,v);const _=t.push("blockquote_close","blockquote",-1);_.markup=">",t.lineMax=i,t.parentType=m,E[1]=t.line;for(let T=0;T<f.length;T++)t.bMarks[T+e]=l[T],t.tShift[T+e]=f[T],t.sCount[T+e]=d[T],t.bsCount[T+e]=u[T];return t.blkIndent=b,!0}function Hq(t,e,n,r){const o=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;let s=t.bMarks[e]+t.tShift[e];const i=t.src.charCodeAt(s++);if(i!==42&&i!==45&&i!==95)return!1;let l=1;for(;s<o;){const d=t.src.charCodeAt(s++);if(d!==i&&!xt(d))return!1;d===i&&l++}if(l<3)return!1;if(r)return!0;t.line=e+1;const u=t.push("hr","hr",0);return u.map=[e,t.line],u.markup=Array(l+1).join(String.fromCharCode(i)),!0}function XC(t,e){const n=t.eMarks[e];let r=t.bMarks[e]+t.tShift[e];const o=t.src.charCodeAt(r++);if(o!==42&&o!==45&&o!==43)return-1;if(r<n){const s=t.src.charCodeAt(r);if(!xt(s))return-1}return r}function QC(t,e){const n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];let o=n;if(o+1>=r)return-1;let s=t.src.charCodeAt(o++);if(s<48||s>57)return-1;for(;;){if(o>=r)return-1;if(s=t.src.charCodeAt(o++),s>=48&&s<=57){if(o-n>=10)return-1;continue}if(s===41||s===46)break;return-1}return o<r&&(s=t.src.charCodeAt(o),!xt(s))?-1:o}function Uq(t,e){const n=t.level+2;for(let r=e+2,o=t.tokens.length-2;r<o;r++)t.tokens[r].level===n&&t.tokens[r].type==="paragraph_open"&&(t.tokens[r+2].hidden=!0,t.tokens[r].hidden=!0,r+=2)}function Wq(t,e,n,r){let o,s,i,l,u=e,d=!0;if(t.sCount[u]-t.blkIndent>=4||t.listIndent>=0&&t.sCount[u]-t.listIndent>=4&&t.sCount[u]<t.blkIndent)return!1;let f=!1;r&&t.parentType==="paragraph"&&t.sCount[u]>=t.blkIndent&&(f=!0);let p,m,y;if((y=QC(t,u))>=0){if(p=!0,i=t.bMarks[u]+t.tShift[u],m=Number(t.src.slice(i,y-1)),f&&m!==1)return!1}else if((y=XC(t,u))>=0)p=!1;else return!1;if(f&&t.skipSpaces(y)>=t.eMarks[u])return!1;if(r)return!0;const v=t.src.charCodeAt(y-1),b=t.tokens.length;p?(l=t.push("ordered_list_open","ol",1),m!==1&&(l.attrs=[["start",m]])):l=t.push("bullet_list_open","ul",1);const k=[u,0];l.map=k,l.markup=String.fromCharCode(v);let E=!1;const _=t.md.block.ruler.getRules("list"),T=t.parentType;for(t.parentType="list";u<n;){s=y,o=t.eMarks[u];const A=t.sCount[u]+y-(t.bMarks[u]+t.tShift[u]);let N=A;for(;s<o;){const Q=t.src.charCodeAt(s);if(Q===9)N+=4-(N+t.bsCount[u])%4;else if(Q===32)N++;else break;s++}const D=s;let I;D>=o?I=1:I=N-A,I>4&&(I=1);const P=A+I;l=t.push("list_item_open","li",1),l.markup=String.fromCharCode(v);const O=[u,0];l.map=O,p&&(l.info=t.src.slice(i,y-1));const U=t.tight,J=t.tShift[u],K=t.sCount[u],q=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=P,t.tight=!0,t.tShift[u]=D-t.bMarks[u],t.sCount[u]=N,D>=o&&t.isEmpty(u+1)?t.line=Math.min(t.line+2,n):t.md.block.tokenize(t,u,n,!0),(!t.tight||E)&&(d=!1),E=t.line-u>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=q,t.tShift[u]=J,t.sCount[u]=K,t.tight=U,l=t.push("list_item_close","li",-1),l.markup=String.fromCharCode(v),u=t.line,O[1]=u,u>=n||t.sCount[u]<t.blkIndent||t.sCount[u]-t.blkIndent>=4)break;let Z=!1;for(let Q=0,G=_.length;Q<G;Q++)if(_[Q](t,u,n,!0)){Z=!0;break}if(Z)break;if(p){if(y=QC(t,u),y<0)break;i=t.bMarks[u]+t.tShift[u]}else if(y=XC(t,u),y<0)break;if(v!==t.src.charCodeAt(y-1))break}return p?l=t.push("ordered_list_close","ol",-1):l=t.push("bullet_list_close","ul",-1),l.markup=String.fromCharCode(v),k[1]=u,t.line=u,t.parentType=T,d&&Uq(t,b),!0}function qq(t,e,n,r){let o=t.bMarks[e]+t.tShift[e],s=t.eMarks[e],i=e+1;if(t.sCount[e]-t.blkIndent>=4||t.src.charCodeAt(o)!==91)return!1;function l(_){const T=t.lineMax;if(_>=T||t.isEmpty(_))return null;let A=!1;if(t.sCount[_]-t.blkIndent>3&&(A=!0),t.sCount[_]<0&&(A=!0),!A){const I=t.md.block.ruler.getRules("reference"),P=t.parentType;t.parentType="reference";let O=!1;for(let U=0,J=I.length;U<J;U++)if(I[U](t,_,T,!0)){O=!0;break}if(t.parentType=P,O)return null}const N=t.bMarks[_]+t.tShift[_],D=t.eMarks[_];return t.src.slice(N,D+1)}let u=t.src.slice(o,s+1);s=u.length;let d=-1;for(o=1;o<s;o++){const _=u.charCodeAt(o);if(_===91)return!1;if(_===93){d=o;break}else if(_===10){const T=l(i);T!==null&&(u+=T,s=u.length,i++)}else if(_===92&&(o++,o<s&&u.charCodeAt(o)===10)){const T=l(i);T!==null&&(u+=T,s=u.length,i++)}}if(d<0||u.charCodeAt(d+1)!==58)return!1;for(o=d+2;o<s;o++){const _=u.charCodeAt(o);if(_===10){const T=l(i);T!==null&&(u+=T,s=u.length,i++)}else if(!xt(_))break}const f=t.md.helpers.parseLinkDestination(u,o,s);if(!f.ok)return!1;const p=t.md.normalizeLink(f.str);if(!t.md.validateLink(p))return!1;o=f.pos;const m=o,y=i,v=o;for(;o<s;o++){const _=u.charCodeAt(o);if(_===10){const T=l(i);T!==null&&(u+=T,s=u.length,i++)}else if(!xt(_))break}let b=t.md.helpers.parseLinkTitle(u,o,s);for(;b.can_continue;){const _=l(i);if(_===null)break;u+=_,o=s,s=u.length,i++,b=t.md.helpers.parseLinkTitle(u,o,s,b)}let k;for(o<s&&v!==o&&b.ok?(k=b.str,o=b.pos):(k="",o=m,i=y);o<s;){const _=u.charCodeAt(o);if(!xt(_))break;o++}if(o<s&&u.charCodeAt(o)!==10&&k)for(k="",o=m,i=y;o<s;){const _=u.charCodeAt(o);if(!xt(_))break;o++}if(o<s&&u.charCodeAt(o)!==10)return!1;const E=$p(u.slice(1,d));return E?(r||(typeof t.env.references>"u"&&(t.env.references={}),typeof t.env.references[E]>"u"&&(t.env.references[E]={title:k,href:p}),t.line=i),!0):!1}const Kq=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Gq="[a-zA-Z_:][a-zA-Z0-9:._-]*",Jq="[^\"'=<>`\\x00-\\x20]+",Zq="'[^']*'",Yq='"[^"]*"',Xq="(?:"+Jq+"|"+Zq+"|"+Yq+")",Qq="(?:\\s+"+Gq+"(?:\\s*=\\s*"+Xq+")?)",MT="<[A-Za-z][A-Za-z0-9\\-]*"+Qq+"*\\s*\\/?>",AT="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",eK="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",tK="<[?][\\s\\S]*?[?]>",nK="<![A-Za-z][^>]*>",rK="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",oK=new RegExp("^(?:"+MT+"|"+AT+"|"+eK+"|"+tK+"|"+nK+"|"+rK+")"),sK=new RegExp("^(?:"+MT+"|"+AT+")"),Ii=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+Kq.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(sK.source+"\\s*$"),/^$/,!1]];function iK(t,e,n,r){let o=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||!t.md.options.html||t.src.charCodeAt(o)!==60)return!1;let i=t.src.slice(o,s),l=0;for(;l<Ii.length&&!Ii[l][0].test(i);l++);if(l===Ii.length)return!1;if(r)return Ii[l][2];let u=e+1;const d=Ii[l][1].test("");if(!Ii[l][1].test(i)){for(;u<n&&!(t.sCount[u]<t.blkIndent&&(d||!t.isEmpty(u)));u++)if(o=t.bMarks[u]+t.tShift[u],s=t.eMarks[u],i=t.src.slice(o,s),Ii[l][1].test(i)){i.length!==0&&u++;break}}t.line=u;const f=t.push("html_block","",0);return f.map=[e,u],f.content=t.getLines(e,u,t.blkIndent,!0),!0}function aK(t,e,n,r){let o=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;let i=t.src.charCodeAt(o);if(i!==35||o>=s)return!1;let l=1;for(i=t.src.charCodeAt(++o);i===35&&o<s&&l<=6;)l++,i=t.src.charCodeAt(++o);if(l>6||o<s&&!xt(i))return!1;if(r)return!0;s=t.skipSpacesBack(s,o);const u=t.skipCharsBack(s,35,o);u>o&&xt(t.src.charCodeAt(u-1))&&(s=u),t.line=e+1;const d=t.push("heading_open","h"+String(l),1);d.markup="########".slice(0,l),d.map=[e,t.line];const f=t.push("inline","",0);f.content=Bp(t.src.slice(o,s)),f.map=[e,t.line],f.children=[];const p=t.push("heading_close","h"+String(l),-1);return p.markup="########".slice(0,l),!0}function lK(t,e,n){const r=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;const o=t.parentType;t.parentType="paragraph";let s=0,i,l=e+1;for(;l<n&&!t.isEmpty(l);l++){if(t.sCount[l]-t.blkIndent>3)continue;if(t.sCount[l]>=t.blkIndent){let y=t.bMarks[l]+t.tShift[l];const v=t.eMarks[l];if(y<v&&(i=t.src.charCodeAt(y),(i===45||i===61)&&(y=t.skipChars(y,i),y=t.skipSpaces(y),y>=v))){s=i===61?1:2;break}}if(t.sCount[l]<0)continue;let m=!1;for(let y=0,v=r.length;y<v;y++)if(r[y](t,l,n,!0)){m=!0;break}if(m)break}if(!s)return t.parentType=o,!1;const u=Bp(t.getLines(e,l,t.blkIndent,!1));t.line=l+1;const d=t.push("heading_open","h"+String(s),1);d.markup=String.fromCharCode(i),d.map=[e,t.line];const f=t.push("inline","",0);f.content=u,f.map=[e,t.line-1],f.children=[];const p=t.push("heading_close","h"+String(s),-1);return p.markup=String.fromCharCode(i),t.parentType=o,!0}function uK(t,e,n){const r=t.md.block.ruler.getRules("paragraph"),o=t.parentType;let s=e+1;for(t.parentType="paragraph";s<n&&!t.isEmpty(s);s++){if(t.sCount[s]-t.blkIndent>3||t.sCount[s]<0)continue;let d=!1;for(let f=0,p=r.length;f<p;f++)if(r[f](t,s,n,!0)){d=!0;break}if(d)break}const i=Bp(t.getLines(e,s,t.blkIndent,!1));t.line=s;const l=t.push("paragraph_open","p",1);l.map=[e,t.line];const u=t.push("inline","",0);return u.content=i,u.map=[e,t.line],u.children=[],t.push("paragraph_close","p",-1),t.parentType=o,!0}const Cf=[["table",Fq,["paragraph","reference"]],["code",$q],["fence",Bq,["paragraph","reference","blockquote","list"]],["blockquote",Vq,["paragraph","reference","blockquote","list"]],["hr",Hq,["paragraph","reference","blockquote","list"]],["list",Wq,["paragraph","reference","blockquote"]],["reference",qq],["html_block",iK,["paragraph","reference","blockquote"]],["heading",aK,["paragraph","reference","blockquote"]],["lheading",lK],["paragraph",uK]];function Vp(){this.ruler=new Qn;for(let t=0;t<Cf.length;t++)this.ruler.push(Cf[t][0],Cf[t][1],{alt:(Cf[t][2]||[]).slice()})}Vp.prototype.tokenize=function(t,e,n){const r=this.ruler.getRules(""),o=r.length,s=t.md.options.maxNesting;let i=e,l=!1;for(;i<n&&(t.line=i=t.skipEmptyLines(i),!(i>=n||t.sCount[i]<t.blkIndent));){if(t.level>=s){t.line=n;break}const u=t.line;let d=!1;for(let f=0;f<o;f++)if(d=r[f](t,i,n,!1),d){if(u>=t.line)throw new Error("block rule didn't increment state.line");break}if(!d)throw new Error("none of the block rules matched");t.tight=!l,t.isEmpty(t.line-1)&&(l=!0),i=t.line,i<n&&t.isEmpty(i)&&(l=!0,i++,t.line=i)}};Vp.prototype.parse=function(t,e,n,r){if(!t)return;const o=new this.State(t,e,n,r);this.tokenize(o,o.line,o.lineMax)};Vp.prototype.State=So;function jc(t,e,n,r){this.src=t,this.env=n,this.md=e,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}jc.prototype.pushPending=function(){const t=new Jr("text","",0);return t.content=this.pending,t.level=this.pendingLevel,this.tokens.push(t),this.pending="",t};jc.prototype.push=function(t,e,n){this.pending&&this.pushPending();const r=new Jr(t,e,n);let o=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(o),r};jc.prototype.scanDelims=function(t,e){const n=this.posMax,r=this.src.charCodeAt(t);let o;if(t===0)o=32;else if(t===1)o=this.src.charCodeAt(0),(o&63488)===55296&&(o=65533);else if(o=this.src.charCodeAt(t-1),(o&64512)===56320){const k=this.src.charCodeAt(t-2);o=(k&64512)===55296?65536+(k-55296<<10)+(o-56320):65533}else(o&64512)===55296&&(o=65533);let s=t;for(;s<n&&this.src.charCodeAt(s)===r;)s++;const i=s-t;let l=s<n?this.src.charCodeAt(s):32;if((l&64512)===55296){const k=this.src.charCodeAt(s+1);l=(k&64512)===56320?65536+(l-55296<<10)+(k-56320):65533}else(l&64512)===56320&&(l=65533);const u=cc(o)||uc(o),d=cc(l)||uc(l),f=lc(o),p=lc(l),m=!p&&(!d||f||u),y=!f&&(!u||p||d);return{can_open:m&&(e||!y||u),can_close:y&&(e||!m||d),length:i}};jc.prototype.Token=Jr;function cK(t){switch(t){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function dK(t,e){let n=t.pos;for(;n<t.posMax&&!cK(t.src.charCodeAt(n));)n++;return n===t.pos?!1:(e||(t.pending+=t.src.slice(t.pos,n)),t.pos=n,!0)}const fK=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function hK(t,e){if(!t.md.options.linkify||t.linkLevel>0)return!1;const n=t.pos,r=t.posMax;if(n+3>r||t.src.charCodeAt(n)!==58||t.src.charCodeAt(n+1)!==47||t.src.charCodeAt(n+2)!==47)return!1;const o=t.pending.match(fK);if(!o)return!1;const s=o[1],i=t.md.linkify.matchAtStart(t.src.slice(n-s.length));if(!i)return!1;let l=i.url;if(l.length<=s.length)return!1;let u=l.length;for(;u>0&&l.charCodeAt(u-1)===42;)u--;u!==l.length&&(l=l.slice(0,u));const d=t.md.normalizeLink(l);if(!t.md.validateLink(d))return!1;if(!e){t.pending=t.pending.slice(0,-s.length);const f=t.push("link_open","a",1);f.attrs=[["href",d]],f.markup="linkify",f.info="auto";const p=t.push("text","",0);p.content=t.md.normalizeLinkText(l);const m=t.push("link_close","a",-1);m.markup="linkify",m.info="auto"}return t.pos+=l.length-s.length,!0}function pK(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==10)return!1;const r=t.pending.length-1,o=t.posMax;if(!e)if(r>=0&&t.pending.charCodeAt(r)===32)if(r>=1&&t.pending.charCodeAt(r-1)===32){let s=r-1;for(;s>=1&&t.pending.charCodeAt(s-1)===32;)s--;t.pending=t.pending.slice(0,s),t.push("hardbreak","br",0)}else t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0);else t.push("softbreak","br",0);for(n++;n<o&&xt(t.src.charCodeAt(n));)n++;return t.pos=n,!0}const ov=[];for(let t=0;t<256;t++)ov.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(t){ov[t.charCodeAt(0)]=1});function mK(t,e){let n=t.pos;const r=t.posMax;if(t.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let o=t.src.charCodeAt(n);if(o===10){for(e||t.push("hardbreak","br",0),n++;n<r&&(o=t.src.charCodeAt(n),!!xt(o));)n++;return t.pos=n,!0}if(o===32){if(!e){const l=t.push("text_special","",0);l.content="\\",l.markup="\\",l.info="escape"}return t.pos=n,!0}let s=t.src[n];if(o>=55296&&o<=56319&&n+1<r){const l=t.src.charCodeAt(n+1);l>=56320&&l<=57343&&(s+=t.src[n+1],n++)}const i="\\"+s;if(!e){const l=t.push("text_special","",0);o<256&&ov[o]!==0?l.content=s:l.content=i,l.markup=i,l.info="escape"}return t.pos=n+1,!0}function gK(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==96)return!1;const o=n;n++;const s=t.posMax;for(;n<s&&t.src.charCodeAt(n)===96;)n++;const i=t.src.slice(o,n),l=i.length;if(t.backticksScanned&&(t.backticks[l]||0)<=o)return e||(t.pending+=i),t.pos+=l,!0;let u=n,d;for(;(d=t.src.indexOf("`",u))!==-1;){for(u=d+1;u<s&&t.src.charCodeAt(u)===96;)u++;const f=u-d;if(f===l){if(!e){const p=t.push("code_inline","code",0);p.markup=i,p.content=t.src.slice(n,d).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return t.pos=u,!0}t.backticks[f]=d}return t.backticksScanned=!0,e||(t.pending+=i),t.pos+=l,!0}function yK(t,e){const n=t.pos,r=t.src.charCodeAt(n);if(e||r!==126)return!1;const o=t.scanDelims(t.pos,!0);let s=o.length;const i=String.fromCharCode(r);if(s<2)return!1;let l;s%2&&(l=t.push("text","",0),l.content=i,s--);for(let u=0;u<s;u+=2)l=t.push("text","",0),l.content=i+i,t.delimiters.push({marker:r,length:0,token:t.tokens.length-1,end:-1,open:o.can_open,close:o.can_close});return t.pos+=o.length,!0}function eS(t,e){let n;const r=[],o=e.length;for(let s=0;s<o;s++){const i=e[s];if(i.marker!==126||i.end===-1)continue;const l=e[i.end];n=t.tokens[i.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=t.tokens[l.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",t.tokens[l.token-1].type==="text"&&t.tokens[l.token-1].content==="~"&&r.push(l.token-1)}for(;r.length;){const s=r.pop();let i=s+1;for(;i<t.tokens.length&&t.tokens[i].type==="s_close";)i++;i--,s!==i&&(n=t.tokens[i],t.tokens[i]=t.tokens[s],t.tokens[s]=n)}}function xK(t){const e=t.tokens_meta,n=t.tokens_meta.length;eS(t,t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&eS(t,e[r].delimiters)}const NT={tokenize:yK,postProcess:xK};function vK(t,e){const n=t.pos,r=t.src.charCodeAt(n);if(e||r!==95&&r!==42)return!1;const o=t.scanDelims(t.pos,r===42);for(let s=0;s<o.length;s++){const i=t.push("text","",0);i.content=String.fromCharCode(r),t.delimiters.push({marker:r,length:o.length,token:t.tokens.length-1,end:-1,open:o.can_open,close:o.can_close})}return t.pos+=o.length,!0}function tS(t,e){const n=e.length;for(let r=n-1;r>=0;r--){const o=e[r];if(o.marker!==95&&o.marker!==42||o.end===-1)continue;const s=e[o.end],i=r>0&&e[r-1].end===o.end+1&&e[r-1].marker===o.marker&&e[r-1].token===o.token-1&&e[o.end+1].token===s.token+1,l=String.fromCharCode(o.marker),u=t.tokens[o.token];u.type=i?"strong_open":"em_open",u.tag=i?"strong":"em",u.nesting=1,u.markup=i?l+l:l,u.content="";const d=t.tokens[s.token];d.type=i?"strong_close":"em_close",d.tag=i?"strong":"em",d.nesting=-1,d.markup=i?l+l:l,d.content="",i&&(t.tokens[e[r-1].token].content="",t.tokens[e[o.end+1].token].content="",r--)}}function bK(t){const e=t.tokens_meta,n=t.tokens_meta.length;tS(t,t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&tS(t,e[r].delimiters)}const DT={tokenize:vK,postProcess:bK};function kK(t,e){let n,r,o,s,i="",l="",u=t.pos,d=!0;if(t.src.charCodeAt(t.pos)!==91)return!1;const f=t.pos,p=t.posMax,m=t.pos+1,y=t.md.helpers.parseLinkLabel(t,t.pos,!0);if(y<0)return!1;let v=y+1;if(v<p&&t.src.charCodeAt(v)===40){for(d=!1,v++;v<p&&(n=t.src.charCodeAt(v),!(!xt(n)&&n!==10));v++);if(v>=p)return!1;if(u=v,o=t.md.helpers.parseLinkDestination(t.src,v,t.posMax),o.ok){for(i=t.md.normalizeLink(o.str),t.md.validateLink(i)?v=o.pos:i="",u=v;v<p&&(n=t.src.charCodeAt(v),!(!xt(n)&&n!==10));v++);if(o=t.md.helpers.parseLinkTitle(t.src,v,t.posMax),v<p&&u!==v&&o.ok)for(l=o.str,v=o.pos;v<p&&(n=t.src.charCodeAt(v),!(!xt(n)&&n!==10));v++);}(v>=p||t.src.charCodeAt(v)!==41)&&(d=!0),v++}if(d){if(typeof t.env.references>"u")return!1;if(v<p&&t.src.charCodeAt(v)===91?(u=v+1,v=t.md.helpers.parseLinkLabel(t,v),v>=0?r=t.src.slice(u,v++):v=y+1):v=y+1,r||(r=t.src.slice(m,y)),s=t.env.references[$p(r)],!s)return t.pos=f,!1;i=s.href,l=s.title}if(!e){t.pos=m,t.posMax=y;const b=t.push("link_open","a",1),k=[["href",i]];b.attrs=k,l&&k.push(["title",l]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,t.push("link_close","a",-1)}return t.pos=v,t.posMax=p,!0}function wK(t,e){let n,r,o,s,i,l,u,d,f="";const p=t.pos,m=t.posMax;if(t.src.charCodeAt(t.pos)!==33||t.src.charCodeAt(t.pos+1)!==91)return!1;const y=t.pos+2,v=t.md.helpers.parseLinkLabel(t,t.pos+1,!1);if(v<0)return!1;if(s=v+1,s<m&&t.src.charCodeAt(s)===40){for(s++;s<m&&(n=t.src.charCodeAt(s),!(!xt(n)&&n!==10));s++);if(s>=m)return!1;for(d=s,l=t.md.helpers.parseLinkDestination(t.src,s,t.posMax),l.ok&&(f=t.md.normalizeLink(l.str),t.md.validateLink(f)?s=l.pos:f=""),d=s;s<m&&(n=t.src.charCodeAt(s),!(!xt(n)&&n!==10));s++);if(l=t.md.helpers.parseLinkTitle(t.src,s,t.posMax),s<m&&d!==s&&l.ok)for(u=l.str,s=l.pos;s<m&&(n=t.src.charCodeAt(s),!(!xt(n)&&n!==10));s++);else u="";if(s>=m||t.src.charCodeAt(s)!==41)return t.pos=p,!1;s++}else{if(typeof t.env.references>"u")return!1;if(s<m&&t.src.charCodeAt(s)===91?(d=s+1,s=t.md.helpers.parseLinkLabel(t,s),s>=0?o=t.src.slice(d,s++):s=v+1):s=v+1,o||(o=t.src.slice(y,v)),i=t.env.references[$p(o)],!i)return t.pos=p,!1;f=i.href,u=i.title}if(!e){r=t.src.slice(y,v);const b=[];t.md.inline.parse(r,t.md,t.env,b);const k=t.push("image","img",0),E=[["src",f],["alt",""]];k.attrs=E,k.children=b,k.content=r,u&&E.push(["title",u])}return t.pos=s,t.posMax=m,!0}const CK=/^([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])?)*)$/,SK=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function EK(t,e){let n=t.pos;if(t.src.charCodeAt(n)!==60)return!1;const r=t.pos,o=t.posMax;for(;;){if(++n>=o)return!1;const i=t.src.charCodeAt(n);if(i===60)return!1;if(i===62)break}const s=t.src.slice(r+1,n);if(SK.test(s)){const i=t.md.normalizeLink(s);if(!t.md.validateLink(i))return!1;if(!e){const l=t.push("link_open","a",1);l.attrs=[["href",i]],l.markup="autolink",l.info="auto";const u=t.push("text","",0);u.content=t.md.normalizeLinkText(s);const d=t.push("link_close","a",-1);d.markup="autolink",d.info="auto"}return t.pos+=s.length+2,!0}if(CK.test(s)){const i=t.md.normalizeLink("mailto:"+s);if(!t.md.validateLink(i))return!1;if(!e){const l=t.push("link_open","a",1);l.attrs=[["href",i]],l.markup="autolink",l.info="auto";const u=t.push("text","",0);u.content=t.md.normalizeLinkText(s);const d=t.push("link_close","a",-1);d.markup="autolink",d.info="auto"}return t.pos+=s.length+2,!0}return!1}function _K(t){return/^<a[>\s]/i.test(t)}function TK(t){return/^<\/a\s*>/i.test(t)}function MK(t){const e=t|32;return e>=97&&e<=122}function AK(t,e){if(!t.md.options.html)return!1;const n=t.posMax,r=t.pos;if(t.src.charCodeAt(r)!==60||r+2>=n)return!1;const o=t.src.charCodeAt(r+1);if(o!==33&&o!==63&&o!==47&&!MK(o))return!1;const s=t.src.slice(r).match(oK);if(!s)return!1;if(!e){const i=t.push("html_inline","",0);i.content=s[0],_K(i.content)&&t.linkLevel++,TK(i.content)&&t.linkLevel--}return t.pos+=s[0].length,!0}const NK=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,DK=/^&([a-z][a-z0-9]{1,31});/i;function RK(t,e){const n=t.pos,r=t.posMax;if(t.src.charCodeAt(n)!==38||n+1>=r)return!1;if(t.src.charCodeAt(n+1)===35){const s=t.src.slice(n).match(NK);if(s){if(!e){const i=s[1][0].toLowerCase()==="x"?parseInt(s[1].slice(1),16):parseInt(s[1],10),l=t.push("text_special","",0);l.content=nv(i)?ac(i):ac(65533),l.markup=s[0],l.info="entity"}return t.pos+=s[0].length,!0}}else{const s=t.src.slice(n).match(DK);if(s){const i=YW(s[0]);if(i!==s[0]){if(!e){const l=t.push("text_special","",0);l.content=i,l.markup=s[0],l.info="entity"}return t.pos+=s[0].length,!0}}}return!1}function nS(t){const e={},n=t.length;if(!n)return;let r=0,o=-2;const s=[];for(let i=0;i<n;i++){const l=t[i];if(s.push(0),(t[r].marker!==l.marker||o!==l.token-1)&&(r=i),o=l.token,l.length=l.length||0,!l.close)continue;e.hasOwnProperty(l.marker)||(e[l.marker]=[-1,-1,-1,-1,-1,-1]);const u=e[l.marker][(l.open?3:0)+l.length%3];let d=r-s[r]-1,f=d;for(;d>u;d-=s[d]+1){const p=t[d];if(p.marker===l.marker&&p.open&&p.end<0){let m=!1;if((p.close||l.open)&&(p.length+l.length)%3===0&&(p.length%3!==0||l.length%3!==0)&&(m=!0),!m){const y=d>0&&!t[d-1].open?s[d-1]+1:0;s[i]=i-d+y,s[d]=y,l.open=!1,p.end=i,p.close=!1,f=-1,o=-2;break}}}f!==-1&&(e[l.marker][(l.open?3:0)+(l.length||0)%3]=f)}}function OK(t){const e=t.tokens_meta,n=t.tokens_meta.length;nS(t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&nS(e[r].delimiters)}function IK(t){let e,n,r=0;const o=t.tokens,s=t.tokens.length;for(e=n=0;e<s;e++)o[e].nesting<0&&r--,o[e].level=r,o[e].nesting>0&&r++,o[e].type==="text"&&e+1<s&&o[e+1].type==="text"?o[e+1].content=o[e].content+o[e+1].content:(e!==n&&(o[n]=o[e]),n++);e!==n&&(o.length=n)}const jg=[["text",dK],["linkify",hK],["newline",pK],["escape",mK],["backticks",gK],["strikethrough",NT.tokenize],["emphasis",DT.tokenize],["link",kK],["image",wK],["autolink",EK],["html_inline",AK],["entity",RK]],Lg=[["balance_pairs",OK],["strikethrough",NT.postProcess],["emphasis",DT.postProcess],["fragments_join",IK]];function Lc(){this.ruler=new Qn;for(let t=0;t<jg.length;t++)this.ruler.push(jg[t][0],jg[t][1]);this.ruler2=new Qn;for(let t=0;t<Lg.length;t++)this.ruler2.push(Lg[t][0],Lg[t][1])}Lc.prototype.skipToken=function(t){const e=t.pos,n=this.ruler.getRules(""),r=n.length,o=t.md.options.maxNesting,s=t.cache;if(typeof s[e]<"u"){t.pos=s[e];return}let i=!1;if(t.level<o){for(let l=0;l<r;l++)if(t.level++,i=n[l](t,!0),t.level--,i){if(e>=t.pos)throw new Error("inline rule didn't increment state.pos");break}}else t.pos=t.posMax;i||t.pos++,s[e]=t.pos};Lc.prototype.tokenize=function(t){const e=this.ruler.getRules(""),n=e.length,r=t.posMax,o=t.md.options.maxNesting;for(;t.pos<r;){const s=t.pos;let i=!1;if(t.level<o){for(let l=0;l<n;l++)if(i=e[l](t,!1),i){if(s>=t.pos)throw new Error("inline rule didn't increment state.pos");break}}if(i){if(t.pos>=r)break;continue}t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()};Lc.prototype.parse=function(t,e,n,r){const o=new this.State(t,e,n,r);this.tokenize(o);const s=this.ruler2.getRules(""),i=s.length;for(let l=0;l<i;l++)s[l](o)};Lc.prototype.State=jc;function PK(t){const e={};t=t||{},e.src_Any=yT.source,e.src_Cc=xT.source,e.src_Z=bT.source,e.src_P=ev.source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|");const n="[><|]";return e.src_pseudo_letter=`(?:(?!${n}|${e.src_ZPCc})${e.src_Any})`,e.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",e.src_auth=`(?:(?:(?!${e.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`,e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",e.src_host_terminator=`(?=$|${n}|${e.src_ZPCc})(?!${t["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${e.src_ZPCc}))`,e.src_path=`(?:[/?#](?:(?!${e.src_ZCc}|${n}|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!${e.src_ZCc}|\\]).)*\\]|\\((?:(?!${e.src_ZCc}|[)]).)*\\)|\\{(?:(?!${e.src_ZCc}|[}]).)*\\}|\\"(?:(?!${e.src_ZCc}|["]).)+\\"|\\'(?:(?!${e.src_ZCc}|[']).)+\\'|\\'(?=${e.src_pseudo_letter}|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!${e.src_ZCc}|[.]|$)|`+(t["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+`,(?!${e.src_ZCc}|$)|;(?!${e.src_ZCc}|$)|\\!+(?!${e.src_ZCc}|[!]|$)|\\?(?!${e.src_ZCc}|[?]|$))+|\\/)?`,e.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]{0,63}',e.src_xn="xn--[a-z0-9\\-]{1,59}",e.src_domain_root="(?:"+e.src_xn+`|${e.src_pseudo_letter}{1,63})`,e.src_domain="(?:"+e.src_xn+`|(?:${e.src_pseudo_letter})|(?:${e.src_pseudo_letter}(?:-|${e.src_pseudo_letter}){0,61}${e.src_pseudo_letter}))`,e.src_host=`(?:(?:(?:(?:${e.src_domain})\\.)*${e.src_domain}))`,e.tpl_host_fuzzy="(?:"+e.src_ip4+`|(?:(?:(?:${e.src_domain})\\.)+(?:%TLDS%)))`,e.tpl_host_no_ip_fuzzy=`(?:(?:(?:${e.src_domain})\\.)+(?:%TLDS%))`,e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test=`localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:${e.src_ZPCc}|>|$))`,e.tpl_email_fuzzy=`(^|${n}|"|\\(|${e.src_ZCc})(${e.src_email_name}@${e.tpl_host_fuzzy_strict})`,e.tpl_link_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${e.src_ZPCc}))((?![$+<=>^\`||])${e.tpl_host_port_fuzzy_strict}${e.src_path})`,e.tpl_link_no_ip_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${e.src_ZPCc}))((?![$+<=>^\`||])${e.tpl_host_port_no_ip_fuzzy_strict}${e.src_path})`,e}function cy(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(r){t[r]=n[r]})}),t}function Hp(t){return Object.prototype.toString.call(t)}function jK(t){return Hp(t)==="[object String]"}function LK(t){return Hp(t)==="[object Object]"}function zK(t){return Hp(t)==="[object RegExp]"}function rS(t){return Hp(t)==="[object Function]"}function FK(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const RT={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function $K(t){return Object.keys(t||{}).reduce(function(e,n){return e||RT.hasOwnProperty(n)},!1)}const BK={"http:":{validate:function(t,e,n){const r=t.slice(e);return n.re.http||(n.re.http=new RegExp(`^\\/\\/${n.re.src_auth}${n.re.src_host_port_strict}${n.re.src_path}`,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(t,e,n){const r=t.slice(e);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+`(?:localhost|(?:(?:${n.re.src_domain})\\.)+${n.re.src_domain_root})`+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?e>=3&&t[e-3]===":"||e>=3&&t[e-3]==="/"?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(t,e,n){const r=t.slice(e);return n.re.mailto||(n.re.mailto=new RegExp(`^${n.re.src_email_name}@${n.re.src_host_strict}`,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},VK="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",HK="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function UK(t){return function(e,n){const r=e.slice(n);return t.test(r)?r.match(t)[0].length:0}}function oS(){return function(t,e){e.normalize(t)}}function Wh(t){const e=t.re=PK(t.__opts__),n=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||n.push(VK),n.push(e.src_xn),e.src_tlds=n.join("|");function r(l){return l.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(r(e.tpl_email_fuzzy),"i"),e.email_fuzzy_global=RegExp(r(e.tpl_email_fuzzy),"ig"),e.link_fuzzy=RegExp(r(e.tpl_link_fuzzy),"i"),e.link_fuzzy_global=RegExp(r(e.tpl_link_fuzzy),"ig"),e.link_no_ip_fuzzy=RegExp(r(e.tpl_link_no_ip_fuzzy),"i"),e.link_no_ip_fuzzy_global=RegExp(r(e.tpl_link_no_ip_fuzzy),"ig"),e.host_fuzzy_test=RegExp(r(e.tpl_host_fuzzy_test),"i");const o=[];t.__compiled__={};function s(l,u){throw new Error(`(LinkifyIt) Invalid schema "${l}": ${u}`)}Object.keys(t.__schemas__).forEach(function(l){const u=t.__schemas__[l];if(u===null)return;const d={validate:null,link:null};if(t.__compiled__[l]=d,LK(u)){zK(u.validate)?d.validate=UK(u.validate):rS(u.validate)?d.validate=u.validate:s(l,u),rS(u.normalize)?d.normalize=u.normalize:u.normalize?s(l,u):d.normalize=oS();return}if(jK(u)){o.push(l);return}s(l,u)}),o.forEach(function(l){t.__compiled__[t.__schemas__[l]]&&(t.__compiled__[l].validate=t.__compiled__[t.__schemas__[l]].validate,t.__compiled__[l].normalize=t.__compiled__[t.__schemas__[l]].normalize)}),t.__compiled__[""]={validate:null,normalize:oS()};const i=Object.keys(t.__compiled__).filter(function(l){return l.length>0&&t.__compiled__[l]}).map(FK).join("|");t.re.schema_test=RegExp(`(^|(?!_)(?:[><|]|${e.src_ZPCc}))(${i})`,"i"),t.re.schema_search=RegExp(`(^|(?!_)(?:[><|]|${e.src_ZPCc}))(${i})`,"ig"),t.re.schema_at_start=RegExp(`^${t.re.schema_search.source}`,"i"),t.re.pretest=RegExp(`(${t.re.schema_test.source})|(${t.re.host_fuzzy_test.source})|@`,"i")}function OT(t,e,n,r){const o=t.slice(n,r);this.schema=e.toLowerCase(),this.index=n,this.lastIndex=r,this.raw=o,this.text=o,this.url=o}function cr(t,e){if(!(this instanceof cr))return new cr(t,e);e||$K(t)&&(e=t,t={}),this.__opts__=cy({},RT,e),this.__schemas__=cy({},BK,t),this.__compiled__={},this.__tlds__=HK,this.__tlds_replaced__=!1,this.re={},Wh(this)}cr.prototype.add=function(e,n){return this.__schemas__[e]=n,Wh(this),this};cr.prototype.set=function(e){return this.__opts__=cy(this.__opts__,e),this};cr.prototype.test=function(e){if(!e.length)return!1;let n,r;if(this.re.schema_test.test(e)){for(r=this.re.schema_search,r.lastIndex=0;(n=r.exec(e))!==null;)if(this.testSchemaAt(e,n[2],r.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&e.search(this.re.host_fuzzy_test)>=0&&e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&e.indexOf("@")>=0&&e.match(this.re.email_fuzzy)!==null)};cr.prototype.pretest=function(e){return this.re.pretest.test(e)};cr.prototype.testSchemaAt=function(e,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(e,r,this):0};cr.prototype.match=function(e){const n=[],r=[],o=[],s=[];let i,l,u;function d(m,y){return m?y?m.index!==y.index?m.index<y.index?m:y:m.lastIndex>=y.lastIndex?m:y:m:y}if(!e.length)return null;if(this.re.schema_test.test(e))for(u=this.re.schema_search,u.lastIndex=0;(i=u.exec(e))!==null;)l=this.testSchemaAt(e,i[2],u.lastIndex),l&&r.push({schema:i[2],index:i.index+i[1].length,lastIndex:i.index+i[0].length+l});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(u=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,u.lastIndex=0;(i=u.exec(e))!==null;)o.push({schema:"",index:i.index+i[1].length,lastIndex:i.index+i[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(u=this.re.email_fuzzy_global,u.lastIndex=0;(i=u.exec(e))!==null;)s.push({schema:"mailto:",index:i.index+i[1].length,lastIndex:i.index+i[0].length});const f=[0,0,0];let p=0;for(;;){const m=[r[f[0]],s[f[1]],o[f[2]]],y=d(d(m[0],m[1]),m[2]);if(!y)break;if(y===m[0]?f[0]++:y===m[1]?f[1]++:f[2]++,y.index<p)continue;const v=new OT(e,y.schema,y.index,y.lastIndex);this.__compiled__[v.schema].normalize(v,this),n.push(v),p=y.lastIndex}return n.length?n:null};cr.prototype.matchAtStart=function(e){if(!e.length)return null;const n=this.re.schema_at_start.exec(e);if(!n)return null;const r=this.testSchemaAt(e,n[2],n[0].length);if(!r)return null;const o=new OT(e,n[2],n.index+n[1].length,n.index+n[0].length+r);return this.__compiled__[o.schema].normalize(o,this),o};cr.prototype.tlds=function(e,n){return e=Array.isArray(e)?e:[e],n?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(r,o,s){return r!==s[o-1]}).reverse(),Wh(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,Wh(this),this)};cr.prototype.normalize=function(e){e.schema||(e.url=`http://${e.url}`),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)};cr.prototype.onCompile=function(){};const Ya=2147483647,po=36,sv=1,dc=26,WK=38,qK=700,IT=72,PT=128,jT="-",KK=/^xn--/,GK=/[^\0-\x7F]/,JK=/[\x2E\u3002\uFF0E\uFF61]/g,ZK={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},zg=po-sv,mo=Math.floor,Fg=String.fromCharCode;function Fs(t){throw new RangeError(ZK[t])}function YK(t,e){const n=[];let r=t.length;for(;r--;)n[r]=e(t[r]);return n}function LT(t,e){const n=t.split("@");let r="";n.length>1&&(r=n[0]+"@",t=n[1]),t=t.replace(JK,".");const o=t.split("."),s=YK(o,e).join(".");return r+s}function zT(t){const e=[];let n=0;const r=t.length;for(;n<r;){const o=t.charCodeAt(n++);if(o>=55296&&o<=56319&&n<r){const s=t.charCodeAt(n++);(s&64512)==56320?e.push(((o&1023)<<10)+(s&1023)+65536):(e.push(o),n--)}else e.push(o)}return e}const XK=t=>String.fromCodePoint(...t),QK=function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:po},sS=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},FT=function(t,e,n){let r=0;for(t=n?mo(t/qK):t>>1,t+=mo(t/e);t>zg*dc>>1;r+=po)t=mo(t/zg);return mo(r+(zg+1)*t/(t+WK))},$T=function(t){const e=[],n=t.length;let r=0,o=PT,s=IT,i=t.lastIndexOf(jT);i<0&&(i=0);for(let l=0;l<i;++l)t.charCodeAt(l)>=128&&Fs("not-basic"),e.push(t.charCodeAt(l));for(let l=i>0?i+1:0;l<n;){const u=r;for(let f=1,p=po;;p+=po){l>=n&&Fs("invalid-input");const m=QK(t.charCodeAt(l++));m>=po&&Fs("invalid-input"),m>mo((Ya-r)/f)&&Fs("overflow"),r+=m*f;const y=p<=s?sv:p>=s+dc?dc:p-s;if(m<y)break;const v=po-y;f>mo(Ya/v)&&Fs("overflow"),f*=v}const d=e.length+1;s=FT(r-u,d,u==0),mo(r/d)>Ya-o&&Fs("overflow"),o+=mo(r/d),r%=d,e.splice(r++,0,o)}return String.fromCodePoint(...e)},BT=function(t){const e=[];t=zT(t);const n=t.length;let r=PT,o=0,s=IT;for(const u of t)u<128&&e.push(Fg(u));const i=e.length;let l=i;for(i&&e.push(jT);l<n;){let u=Ya;for(const f of t)f>=r&&f<u&&(u=f);const d=l+1;u-r>mo((Ya-o)/d)&&Fs("overflow"),o+=(u-r)*d,r=u;for(const f of t)if(f<r&&++o>Ya&&Fs("overflow"),f===r){let p=o;for(let m=po;;m+=po){const y=m<=s?sv:m>=s+dc?dc:m-s;if(p<y)break;const v=p-y,b=po-y;e.push(Fg(sS(y+v%b,0))),p=mo(v/b)}e.push(Fg(sS(p,0))),s=FT(o,d,l===i),o=0,++l}++o,++r}return e.join("")},eG=function(t){return LT(t,function(e){return KK.test(e)?$T(e.slice(4).toLowerCase()):e})},tG=function(t){return LT(t,function(e){return GK.test(e)?"xn--"+BT(e):e})},VT={version:"2.3.1",ucs2:{decode:zT,encode:XK},decode:$T,encode:BT,toASCII:tG,toUnicode:eG},nG={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},rG={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},oG={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}},sG={default:nG,zero:rG,commonmark:oG},iG=/^(vbscript|javascript|file|data):/,aG=/^data:image\/(gif|png|jpeg|webp);/;function lG(t){const e=t.trim().toLowerCase();return iG.test(e)?aG.test(e):!0}const HT=["http:","https:","mailto:"];function uG(t){const e=Qx(t,!0);if(e.hostname&&(!e.protocol||HT.indexOf(e.protocol)>=0))try{e.hostname=VT.toASCII(e.hostname)}catch{}return Pc(Xx(e))}function cG(t){const e=Qx(t,!0);if(e.hostname&&(!e.protocol||HT.indexOf(e.protocol)>=0))try{e.hostname=VT.toUnicode(e.hostname)}catch{}return fl(Xx(e),fl.defaultChars+"%")}function er(t,e){if(!(this instanceof er))return new er(t,e);e||tv(t)||(e=t||{},t="default"),this.inline=new Lc,this.block=new Vp,this.core=new rv,this.renderer=new Cl,this.linkify=new cr,this.validateLink=lG,this.normalizeLink=uG,this.normalizeLinkText=cG,this.utils=hq,this.helpers=Fp({},yq),this.options={},this.configure(t),e&&this.set(e)}er.prototype.set=function(t){return Fp(this.options,t),this};er.prototype.configure=function(t){const e=this;if(tv(t)){const n=t;if(t=sG[n],!t)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&e.set(t.options),t.components&&Object.keys(t.components).forEach(function(n){t.components[n].rules&&e[n].ruler.enableOnly(t.components[n].rules),t.components[n].rules2&&e[n].ruler2.enableOnly(t.components[n].rules2)}),this};er.prototype.enable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(o){n=n.concat(this[o].ruler.enable(t,!0))},this),n=n.concat(this.inline.ruler2.enable(t,!0));const r=t.filter(function(o){return n.indexOf(o)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this};er.prototype.disable=function(t,e){let n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(o){n=n.concat(this[o].ruler.disable(t,!0))},this),n=n.concat(this.inline.ruler2.disable(t,!0));const r=t.filter(function(o){return n.indexOf(o)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this};er.prototype.use=function(t){const e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this};er.prototype.parse=function(t,e){if(typeof t!="string")throw new Error("Input data should be a String");const n=new this.core.State(t,this,e);return this.core.process(n),n.tokens};er.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)};er.prototype.parseInline=function(t,e){const n=new this.core.State(t,this,e);return n.inlineMode=!0,this.core.process(n),n.tokens};er.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};const dG=new cx({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM(){return["p",0]}},blockquote:{content:"block+",group:"block",parseDOM:[{tag:"blockquote"}],toDOM(){return["blockquote",0]}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM(){return["div",["hr"]]}},heading:{attrs:{level:{default:1}},content:"(text | image)*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM(t){return["h"+t.attrs.level,0]}},code_block:{content:"text*",group:"block",code:!0,defining:!0,marks:"",attrs:{params:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:t=>({params:t.getAttribute("data-params")||""})}],toDOM(t){return["pre",t.attrs.params?{"data-params":t.attrs.params}:{},["code",0]]}},ordered_list:{content:"list_item+",group:"block",attrs:{order:{default:1},tight:{default:!1}},parseDOM:[{tag:"ol",getAttrs(t){return{order:t.hasAttribute("start")?+t.getAttribute("start"):1,tight:t.hasAttribute("data-tight")}}}],toDOM(t){return["ol",{start:t.attrs.order==1?null:t.attrs.order,"data-tight":t.attrs.tight?"true":null},0]}},bullet_list:{content:"list_item+",group:"block",attrs:{tight:{default:!1}},parseDOM:[{tag:"ul",getAttrs:t=>({tight:t.hasAttribute("data-tight")})}],toDOM(t){return["ul",{"data-tight":t.attrs.tight?"true":null},0]}},list_item:{content:"block+",defining:!0,parseDOM:[{tag:"li"}],toDOM(){return["li",0]}},text:{group:"inline"},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs(t){return{src:t.getAttribute("src"),title:t.getAttribute("title"),alt:t.getAttribute("alt")}}}],toDOM(t){return["img",t.attrs]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM(){return["br"]}}},marks:{em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:t=>t.type.name=="em"}],toDOM(){return["em"]}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name=="strong"},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],toDOM(){return["strong"]}},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs(t){return{href:t.getAttribute("href"),title:t.getAttribute("title")}}}],toDOM(t){return["a",t.attrs]}},code:{code:!0,parseDOM:[{tag:"code"}],toDOM(){return["code"]}}}});function fG(t,e){if(t.isText&&e.isText&&lt.sameSet(t.marks,e.marks))return t.withText(t.text+e.text)}class hG{constructor(e,n){this.schema=e,this.tokenHandlers=n,this.stack=[{type:e.topNodeType,attrs:null,content:[],marks:lt.none}]}top(){return this.stack[this.stack.length-1]}push(e){this.stack.length&&this.top().content.push(e)}addText(e){if(!e)return;let n=this.top(),r=n.content,o=r[r.length-1],s=this.schema.text(e,n.marks),i;o&&(i=fG(o,s))?r[r.length-1]=i:r.push(s)}openMark(e){let n=this.top();n.marks=e.addToSet(n.marks)}closeMark(e){let n=this.top();n.marks=e.removeFromSet(n.marks)}parseTokens(e){for(let n=0;n<e.length;n++){let r=e[n],o=this.tokenHandlers[r.type];if(!o)throw new Error("Token type `"+r.type+"` not supported by Markdown parser");o(this,r,e,n)}}addNode(e,n,r){let o=this.top(),s=e.createAndFill(n,r,o?o.marks:[]);return s?(this.push(s),s):null}openNode(e,n){this.stack.push({type:e,attrs:n,content:[],marks:lt.none})}closeNode(){let e=this.stack.pop();return this.addNode(e.type,e.attrs,e.content)}}function hu(t,e,n,r){return t.getAttrs?t.getAttrs(e,n,r):t.attrs instanceof Function?t.attrs(e):t.attrs}function $g(t,e){return t.noCloseToken||e=="code_inline"||e=="code_block"||e=="fence"}function iS(t){return t[t.length-1]==`
590
- `?t.slice(0,t.length-1):t}function Bg(){}function pG(t,e){let n=Object.create(null);for(let r in e){let o=e[r];if(o.block){let s=t.nodeType(o.block);$g(o,r)?n[r]=(i,l,u,d)=>{i.openNode(s,hu(o,l,u,d)),i.addText(iS(l.content)),i.closeNode()}:(n[r+"_open"]=(i,l,u,d)=>i.openNode(s,hu(o,l,u,d)),n[r+"_close"]=i=>i.closeNode())}else if(o.node){let s=t.nodeType(o.node);n[r]=(i,l,u,d)=>i.addNode(s,hu(o,l,u,d))}else if(o.mark){let s=t.marks[o.mark];$g(o,r)?n[r]=(i,l,u,d)=>{i.openMark(s.create(hu(o,l,u,d))),i.addText(iS(l.content)),i.closeMark(s)}:(n[r+"_open"]=(i,l,u,d)=>i.openMark(s.create(hu(o,l,u,d))),n[r+"_close"]=i=>i.closeMark(s))}else if(o.ignore)$g(o,r)?n[r]=Bg:(n[r+"_open"]=Bg,n[r+"_close"]=Bg);else throw new RangeError("Unrecognized parsing spec "+JSON.stringify(o))}return n.text=(r,o)=>r.addText(o.content),n.inline=(r,o)=>r.parseTokens(o.children),n.softbreak=n.softbreak||(r=>r.addText(" ")),n}let mG=class{constructor(e,n,r){this.schema=e,this.tokenizer=n,this.tokens=r,this.tokenHandlers=pG(e,r)}parse(e,n={}){let r=new hG(this.schema,this.tokenHandlers),o;r.parseTokens(this.tokenizer.parse(e,n));do o=r.closeNode();while(r.stack.length);return o||this.schema.topNodeType.createAndFill()}};function aS(t,e){for(;++e<t.length;)if(t[e].type!="list_item_open")return t[e].hidden;return!1}new mG(dG,er("commonmark",{html:!1}),{blockquote:{block:"blockquote"},paragraph:{block:"paragraph"},list_item:{block:"list_item"},bullet_list:{block:"bullet_list",getAttrs:(t,e,n)=>({tight:aS(e,n)})},ordered_list:{block:"ordered_list",getAttrs:(t,e,n)=>({order:+t.attrGet("start")||1,tight:aS(e,n)})},heading:{block:"heading",getAttrs:t=>({level:+t.tag.slice(1)})},code_block:{block:"code_block",noCloseToken:!0},fence:{block:"code_block",getAttrs:t=>({params:t.info||""}),noCloseToken:!0},hr:{node:"horizontal_rule"},image:{node:"image",getAttrs:t=>({src:t.attrGet("src"),title:t.attrGet("title")||null,alt:t.children[0]&&t.children[0].content||null})},hardbreak:{node:"hard_break"},em:{mark:"em"},strong:{mark:"strong"},link:{mark:"link",getAttrs:t=>({href:t.attrGet("href"),title:t.attrGet("title")||null})},code_inline:{mark:"code",noCloseToken:!0}});const gG={open:"",close:"",mixable:!0};let yG=class{constructor(e,n,r={}){this.nodes=e,this.marks=n,this.options=r}serialize(e,n={}){n=Object.assign({},this.options,n);let r=new UT(this.nodes,this.marks,n);return r.renderContent(e),r.out}};const Eo=new yG({blockquote(t,e){t.wrapBlock("> ",null,e,()=>t.renderContent(e))},code_block(t,e){const n=e.textContent.match(/`{3,}/gm),r=n?n.sort().slice(-1)[0]+"`":"```";t.write(r+(e.attrs.params||"")+`
591
- `),t.text(e.textContent,!1),t.write(`
592
- `),t.write(r),t.closeBlock(e)},heading(t,e){t.write(t.repeat("#",e.attrs.level)+" "),t.renderInline(e,!1),t.closeBlock(e)},horizontal_rule(t,e){t.write(e.attrs.markup||"---"),t.closeBlock(e)},bullet_list(t,e){t.renderList(e," ",()=>(e.attrs.bullet||"*")+" ")},ordered_list(t,e){var n;let r=(n=e.attrs.order)!==null&&n!==void 0?n:1,o=String(r+e.childCount-1).length,s=t.repeat(" ",o+2);t.renderList(e,s,i=>{let l=String(r+i);return t.repeat(" ",o-l.length)+l+". "})},list_item(t,e){t.renderContent(e)},paragraph(t,e){t.renderInline(e),t.closeBlock(e)},image(t,e){t.write("!["+t.esc(e.attrs.alt||"")+"]("+e.attrs.src.replace(/[\(\)]/g,"\\$&")+(e.attrs.title?' "'+e.attrs.title.replace(/"/g,'\\"')+'"':"")+")")},hard_break(t,e,n,r){for(let o=r+1;o<n.childCount;o++)if(n.child(o).type!=e.type){t.write(`\\
593
- `);return}},text(t,e){t.text(e.text,!t.inAutolink)}},{em:{open:"*",close:"*",mixable:!0,expelEnclosingWhitespace:!0},strong:{open:"**",close:"**",mixable:!0,expelEnclosingWhitespace:!0},link:{open(t,e,n,r){return t.inAutolink=xG(e,n,r),t.inAutolink?"<":"["},close(t,e,n,r){let{inAutolink:o}=t;return t.inAutolink=void 0,o?">":"]("+e.attrs.href.replace(/[\(\)"]/g,"\\$&")+(e.attrs.title?` "${e.attrs.title.replace(/"/g,'\\"')}"`:"")+")"},mixable:!0},code:{open(t,e,n,r){return lS(n.child(r),-1)},close(t,e,n,r){return lS(n.child(r-1),1)},escape:!1}});function lS(t,e){let n=/`+/g,r,o=0;if(t.isText)for(;r=n.exec(t.text);)o=Math.max(o,r[0].length);let s=o>0&&e>0?" `":"`";for(let i=0;i<o;i++)s+="`";return o>0&&e<0&&(s+=" "),s}function xG(t,e,n){if(t.attrs.title||!/^\w+:/.test(t.attrs.href))return!1;let r=e.child(n);return!r.isText||r.text!=t.attrs.href||r.marks[r.marks.length-1]!=t?!1:n==e.childCount-1||!t.isInSet(e.child(n+1).marks)}let UT=class{constructor(e,n,r){this.nodes=e,this.marks=n,this.options=r,this.delim="",this.out="",this.closed=null,this.inAutolink=void 0,this.atBlockStart=!1,this.inTightList=!1,typeof this.options.tightLists>"u"&&(this.options.tightLists=!1),typeof this.options.hardBreakNodeName>"u"&&(this.options.hardBreakNodeName="hard_break")}flushClose(e=2){if(this.closed){if(this.atBlank()||(this.out+=`
594
- `),e>1){let n=this.delim,r=/\s+$/.exec(n);r&&(n=n.slice(0,n.length-r[0].length));for(let o=1;o<e;o++)this.out+=n+`
595
- `}this.closed=null}}getMark(e){let n=this.marks[e];if(!n){if(this.options.strict!==!1)throw new Error(`Mark type \`${e}\` not supported by Markdown renderer`);n=gG}return n}wrapBlock(e,n,r,o){let s=this.delim;this.write(n??e),this.delim+=e,o(),this.delim=s,this.closeBlock(r)}atBlank(){return/(^|\n)$/.test(this.out)}ensureNewLine(){this.atBlank()||(this.out+=`
596
- `)}write(e){this.flushClose(),this.delim&&this.atBlank()&&(this.out+=this.delim),e&&(this.out+=e)}closeBlock(e){this.closed=e}text(e,n=!0){let r=e.split(`
597
- `);for(let o=0;o<r.length;o++)this.write(),!n&&r[o][0]=="["&&/(^|[^\\])\!$/.test(this.out)&&(this.out=this.out.slice(0,this.out.length-1)+"\\!"),this.out+=n?this.esc(r[o],this.atBlockStart):r[o],o!=r.length-1&&(this.out+=`
598
- `)}render(e,n,r){if(this.nodes[e.type.name])this.nodes[e.type.name](this,e,n,r);else{if(this.options.strict!==!1)throw new Error("Token type `"+e.type.name+"` not supported by Markdown renderer");e.type.isLeaf||(e.type.inlineContent?this.renderInline(e):this.renderContent(e),e.isBlock&&this.closeBlock(e))}}renderContent(e){e.forEach((n,r,o)=>this.render(n,e,o))}renderInline(e,n=!0){this.atBlockStart=n;let r=[],o="",s=(i,l,u)=>{let d=i?i.marks:[];i&&i.type.name===this.options.hardBreakNodeName&&(d=d.filter(b=>{if(u+1==e.childCount)return!1;let k=e.child(u+1);return b.isInSet(k.marks)&&(!k.isText||/\S/.test(k.text))}));let f=o;if(o="",i&&i.isText&&d.some(b=>{let k=this.getMark(b.type.name);return k&&k.expelEnclosingWhitespace&&!b.isInSet(r)})){let[b,k,E]=/^(\s*)(.*)$/m.exec(i.text);k&&(f+=k,i=E?i.withText(E):null,i||(d=r))}if(i&&i.isText&&d.some(b=>{let k=this.getMark(b.type.name);return k&&k.expelEnclosingWhitespace&&!this.isMarkAhead(e,u+1,b)})){let[b,k,E]=/^(.*?)(\s*)$/m.exec(i.text);E&&(o=E,i=k?i.withText(k):null,i||(d=r))}let p=d.length?d[d.length-1]:null,m=p&&this.getMark(p.type.name).escape===!1,y=d.length-(m?1:0);e:for(let b=0;b<y;b++){let k=d[b];if(!this.getMark(k.type.name).mixable)break;for(let E=0;E<r.length;E++){let _=r[E];if(!this.getMark(_.type.name).mixable)break;if(k.eq(_)){b>E?d=d.slice(0,E).concat(k).concat(d.slice(E,b)).concat(d.slice(b+1,y)):E>b&&(d=d.slice(0,b).concat(d.slice(b+1,E)).concat(k).concat(d.slice(E,y)));continue e}}}let v=0;for(;v<Math.min(r.length,y)&&d[v].eq(r[v]);)++v;for(;v<r.length;)this.text(this.markString(r.pop(),!1,e,u),!1);if(f&&this.text(f),i){for(;r.length<y;){let b=d[r.length];r.push(b),this.text(this.markString(b,!0,e,u),!1),this.atBlockStart=!1}m&&i.isText?this.text(this.markString(p,!0,e,u)+i.text+this.markString(p,!1,e,u+1),!1):this.render(i,e,u),this.atBlockStart=!1}i!=null&&i.isText&&i.nodeSize>0&&(this.atBlockStart=!1)};e.forEach(s),s(null,0,e.childCount),this.atBlockStart=!1}renderList(e,n,r){this.closed&&this.closed.type==e.type?this.flushClose(3):this.inTightList&&this.flushClose(1);let o=typeof e.attrs.tight<"u"?e.attrs.tight:this.options.tightLists,s=this.inTightList;this.inTightList=o,e.forEach((i,l,u)=>{u&&o&&this.flushClose(1),this.wrapBlock(n,r(u),e,()=>this.render(i,e,u))}),this.inTightList=s}esc(e,n=!1){return e=e.replace(/[`*\\~\[\]_]/g,(r,o)=>r=="_"&&o>0&&o+1<e.length&&e[o-1].match(/\w/)&&e[o+1].match(/\w/)?r:"\\"+r),n&&(e=e.replace(/^(\+[ ]|[\-*>])/,"\\$&").replace(/^(\s*)(#{1,6})(\s|$)/,"$1\\$2$3").replace(/^(\s*\d+)\.\s/,"$1\\. ")),this.options.escapeExtraCharacters&&(e=e.replace(this.options.escapeExtraCharacters,"\\$&")),e}quote(e){let n=e.indexOf('"')==-1?'""':e.indexOf("'")==-1?"''":"()";return n[0]+e+n[1]}repeat(e,n){let r="";for(let o=0;o<n;o++)r+=e;return r}markString(e,n,r,o){let s=this.getMark(e.type.name),i=n?s.open:s.close;return typeof i=="string"?i:i(this,e,r,o)}getEnclosingWhitespace(e){return{leading:(e.match(/^(\s+)/)||[void 0])[0],trailing:(e.match(/(\s+)$/)||[void 0])[0]}}isMarkAhead(e,n,r){for(;;n++){if(n>=e.childCount)return!1;let o=e.child(n);if(o.type.name!=this.options.hardBreakNodeName)return r.isInSet(o.marks);n++}}};var Vg,uS;function vG(){if(uS)return Vg;uS=1;var t=!0,e=!1,n=!1;Vg=function(b,k){k&&(t=!k.enabled,e=!!k.label,n=!!k.labelAfter),b.core.ruler.after("inline","github-task-lists",function(E){for(var _=E.tokens,T=2;T<_.length;T++)s(_,T)&&(i(_[T],E.Token),r(_[T-2],"class","task-list-item"+(t?"":" enabled")),r(_[o(_,T-2)],"class","contains-task-list"))})};function r(b,k,E){var _=b.attrIndex(k),T=[k,E];_<0?b.attrPush(T):b.attrs[_]=T}function o(b,k){for(var E=b[k].level-1,_=k-1;_>=0;_--)if(b[_].level===E)return _;return-1}function s(b,k){return p(b[k])&&m(b[k-1])&&y(b[k-2])&&v(b[k])}function i(b,k){if(b.children.unshift(l(b,k)),b.children[1].content=b.children[1].content.slice(3),b.content=b.content.slice(3),e)if(n){b.children.pop();var E="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);b.children[0].content=b.children[0].content.slice(0,-1)+' id="'+E+'">',b.children.push(f(b.content,E,k))}else b.children.unshift(u(k)),b.children.push(d(k))}function l(b,k){var E=new k("html_inline","",0),_=t?' disabled="" ':"";return b.content.indexOf("[ ] ")===0?E.content='<input class="task-list-item-checkbox"'+_+'type="checkbox">':(b.content.indexOf("[x] ")===0||b.content.indexOf("[X] ")===0)&&(E.content='<input class="task-list-item-checkbox" checked=""'+_+'type="checkbox">'),E}function u(b){var k=new b("html_inline","",0);return k.content="<label>",k}function d(b){var k=new b("html_inline","",0);return k.content="</label>",k}function f(b,k,E){var _=new E("html_inline","",0);return _.content='<label class="task-list-item-label" for="'+k+'">'+b+"</label>",_.attrs=[{for:k}],_}function p(b){return b.type==="inline"}function m(b){return b.type==="paragraph_open"}function y(b){return b.type==="list_item_open"}function v(b){return b.content.indexOf("[ ] ")===0||b.content.indexOf("[x] ")===0||b.content.indexOf("[X] ")===0}return Vg}var bG=vG();const kG=xy(bG);var wG=Object.defineProperty,CG=(t,e,n)=>e in t?wG(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,qh=(t,e,n)=>(CG(t,typeof e!="symbol"?e+"":e,n),n);const SG=Ct.create({name:"markdownTightLists",addOptions:()=>({tight:!0,tightClass:"tight",listTypes:["bulletList","orderedList"]}),addGlobalAttributes(){return[{types:this.options.listTypes,attributes:{tight:{default:this.options.tight,parseHTML:t=>t.getAttribute("data-tight")==="true"||!t.querySelector("p"),renderHTML:t=>({class:t.tight?this.options.tightClass:null,"data-tight":t.tight?"true":null})}}}]},addCommands(){var t=this;return{toggleTight:function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return n=>{let{editor:r,commands:o}=n;function s(i){if(!r.isActive(i))return!1;const l=r.getAttributes(i);return o.updateAttributes(i,{tight:e??!(l!=null&&l.tight)})}return t.options.listTypes.some(i=>s(i))}}}}}),cS=er();function WT(t,e){return cS.inline.State.prototype.scanDelims.call({src:t,posMax:t.length}),new cS.inline.State(t,null,null,[]).scanDelims(e,!0)}function qT(t,e,n,r){let o=t.substring(0,n)+t.substring(n+e.length);return o=o.substring(0,n+r)+e+o.substring(n+r),o}function EG(t,e,n,r){let o=n,s=t;for(;o<r&&!WT(s,o).can_open;)s=qT(s,e,o,1),o++;return{text:s,from:o,to:r}}function _G(t,e,n,r){let o=r,s=t;for(;o>n&&!WT(s,o).can_close;)s=qT(s,e,o,-1),o--;return{text:s,from:n,to:o}}function TG(t,e,n,r){let o={text:t,from:n,to:r};return o=EG(o.text,e,o.from,o.to),o=_G(o.text,e,o.from,o.to),o.to-o.from<e.length+1&&(o.text=o.text.substring(0,o.from)+o.text.substring(o.to+e.length)),o.text}class MG extends UT{constructor(e,n,r){super(e,n,r??{}),qh(this,"inTable",!1),this.inlines=[]}render(e,n,r){super.render(e,n,r);const o=this.inlines[this.inlines.length-1];if(o!=null&&o.start&&o!==null&&o!==void 0&&o.end){const{delimiter:s,start:i,end:l}=this.normalizeInline(o);this.out=TG(this.out,s,i,l),this.inlines.pop()}}markString(e,n,r,o){const s=this.marks[e.type.name];if(s.expelEnclosingWhitespace)if(n)this.inlines.push({start:this.out.length,delimiter:s.open});else{const i=this.inlines.pop();this.inlines.push({...i,end:this.out.length})}return super.markString(e,n,r,o)}normalizeInline(e){let{start:n,end:r}=e;for(;this.out.charAt(n).match(/\s/);)n++;return{...e,start:n}}}const KT=fr.create({name:"markdownHTMLMark",addStorage(){return{markdown:{serialize:{open(t,e){var n,r;return this.editor.storage.markdown.options.html?(n=(r=dS(e))===null||r===void 0?void 0:r[0])!==null&&n!==void 0?n:"":(console.warn(`Tiptap Markdown: "${e.type.name}" mark is only available in html mode`),"")},close(t,e){var n,r;return this.editor.storage.markdown.options.html&&(n=(r=dS(e))===null||r===void 0?void 0:r[1])!==null&&n!==void 0?n:""}},parse:{}}}}});function dS(t){const e=t.type.schema,n=e.text(" ",[t]),o=Rc(re.from(n),e).match(/^(<.*?>) (<\/.*?>)$/);return o?[o[1],o[2]]:null}function iv(t){const e=`<body>${t}</body>`;return new window.DOMParser().parseFromString(e,"text/html").body}function AG(t){return t==null?void 0:t.replace(/</g,"&lt;").replace(/>/g,"&gt;")}function NG(t){const e=t.parentElement,n=e.cloneNode();for(;e.firstChild&&e.firstChild!==t;)n.appendChild(e.firstChild);n.childNodes.length>0&&e.parentElement.insertBefore(n,e),e.parentElement.insertBefore(t,e),e.childNodes.length===0&&e.remove()}function DG(t){const e=t.parentNode;for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}const Up=ft.create({name:"markdownHTMLNode",addStorage(){return{markdown:{serialize(t,e,n){this.editor.storage.markdown.options.html?t.write(RG(e,n)):(console.warn(`Tiptap Markdown: "${e.type.name}" node is only available in html mode`),t.write(`[${e.type.name}]`)),e.isBlock&&t.closeBlock(e)},parse:{}}}}});function RG(t,e){const n=t.type.schema,r=Rc(re.from(t),n);return t.isBlock&&(e instanceof re||e.type.name===n.topNodeType.name)?OG(r):r}function OG(t){const n=iv(t).firstElementChild;return n.innerHTML=n.innerHTML.trim()?`
599
- ${n.innerHTML}
600
- `:`
601
- `,n.outerHTML}const IG=ft.create({name:"blockquote"}),PG=IG.extend({addStorage(){return{markdown:{serialize:Eo.nodes.blockquote,parse:{}}}}}),jG=ft.create({name:"bulletList"}),GT=jG.extend({addStorage(){return{markdown:{serialize(t,e){return t.renderList(e," ",()=>(this.editor.storage.markdown.options.bulletListMarker||"-")+" ")},parse:{}}}}}),LG=ft.create({name:"codeBlock"}),zG=LG.extend({addStorage(){return{markdown:{serialize(t,e){t.write("```"+(e.attrs.language||"")+`
602
- `),t.text(e.textContent,!1),t.ensureNewLine(),t.write("```"),t.closeBlock(e)},parse:{setup(t){var e;t.set({langPrefix:(e=this.options.languageClassPrefix)!==null&&e!==void 0?e:"language-"})},updateDOM(t){t.innerHTML=t.innerHTML.replace(/\n<\/code><\/pre>/g,"</code></pre>")}}}}}}),FG=ft.create({name:"hardBreak"}),JT=FG.extend({addStorage(){return{markdown:{serialize(t,e,n,r){for(let o=r+1;o<n.childCount;o++)if(n.child(o).type!=e.type){t.write(t.inTable?Up.storage.markdown.serialize.call(this,t,e,n):`\\
603
- `);return}},parse:{}}}}}),$G=ft.create({name:"heading"}),BG=$G.extend({addStorage(){return{markdown:{serialize:Eo.nodes.heading,parse:{}}}}}),VG=ft.create({name:"horizontalRule"}),HG=VG.extend({addStorage(){return{markdown:{serialize:Eo.nodes.horizontal_rule,parse:{}}}}}),UG=ft.create({name:"image"}),WG=UG.extend({addStorage(){return{markdown:{serialize:Eo.nodes.image,parse:{}}}}}),qG=ft.create({name:"listItem"}),KG=qG.extend({addStorage(){return{markdown:{serialize:Eo.nodes.list_item,parse:{}}}}}),GG=ft.create({name:"orderedList"});function JG(t,e,n){let r=0;for(;n-r>0&&e.child(n-r-1).type.name===t.type.name;r++);return r}const ZG=GG.extend({addStorage(){return{markdown:{serialize(t,e,n,r){const o=e.attrs.start||1,s=String(o+e.childCount-1).length,i=t.repeat(" ",s+2),u=JG(e,n,r)%2?") ":". ";t.renderList(e,i,d=>{const f=String(o+d);return t.repeat(" ",s-f.length)+f+u})},parse:{}}}}}),YG=ft.create({name:"paragraph"}),XG=YG.extend({addStorage(){return{markdown:{serialize:Eo.nodes.paragraph,parse:{}}}}});function Hg(t){var e,n;return(e=t==null||(n=t.content)===null||n===void 0?void 0:n.content)!==null&&e!==void 0?e:[]}const QG=ft.create({name:"table"}),eJ=QG.extend({addStorage(){return{markdown:{serialize(t,e,n){if(!tJ(e)){Up.storage.markdown.serialize.call(this,t,e,n);return}t.inTable=!0,e.forEach((r,o,s)=>{if(t.write("| "),r.forEach((i,l,u)=>{u&&t.write(" | ");const d=i.firstChild;d.textContent.trim()&&t.renderInline(d)}),t.write(" |"),t.ensureNewLine(),!s){const i=Array.from({length:r.childCount}).map(()=>"---").join(" | ");t.write(`| ${i} |`),t.ensureNewLine()}}),t.closeBlock(e),t.inTable=!1},parse:{}}}}});function fS(t){return t.attrs.colspan>1||t.attrs.rowspan>1}function tJ(t){const e=Hg(t),n=e[0],r=e.slice(1);return!(Hg(n).some(o=>o.type.name!=="tableHeader"||fS(o)||o.childCount>1)||r.some(o=>Hg(o).some(s=>s.type.name==="tableHeader"||fS(s)||s.childCount>1)))}const nJ=ft.create({name:"taskItem"}),rJ=nJ.extend({addStorage(){return{markdown:{serialize(t,e){const n=e.attrs.checked?"[x]":"[ ]";t.write(`${n} `),t.renderContent(e)},parse:{updateDOM(t){[...t.querySelectorAll(".task-list-item")].forEach(e=>{const n=e.querySelector("input");e.setAttribute("data-type","taskItem"),n&&(e.setAttribute("data-checked",n.checked),n.remove())})}}}}}}),oJ=ft.create({name:"taskList"}),sJ=oJ.extend({addStorage(){return{markdown:{serialize:GT.storage.markdown.serialize,parse:{setup(t){t.use(kG)},updateDOM(t){[...t.querySelectorAll(".contains-task-list")].forEach(e=>{e.setAttribute("data-type","taskList")})}}}}}}),iJ=ft.create({name:"text"}),aJ=iJ.extend({addStorage(){return{markdown:{serialize(t,e){t.text(AG(e.text))},parse:{}}}}}),lJ=fr.create({name:"bold"}),uJ=lJ.extend({addStorage(){return{markdown:{serialize:Eo.marks.strong,parse:{}}}}}),cJ=fr.create({name:"code"}),dJ=cJ.extend({addStorage(){return{markdown:{serialize:Eo.marks.code,parse:{}}}}}),fJ=fr.create({name:"italic"}),hJ=fJ.extend({addStorage(){return{markdown:{serialize:Eo.marks.em,parse:{}}}}}),pJ=fr.create({name:"link"}),mJ=pJ.extend({addStorage(){return{markdown:{serialize:Eo.marks.link,parse:{}}}}}),gJ=fr.create({name:"strike"}),yJ=gJ.extend({addStorage(){return{markdown:{serialize:{open:"~~",close:"~~",expelEnclosingWhitespace:!0},parse:{}}}}}),xJ=[PG,GT,zG,JT,BG,HG,Up,WG,KG,ZG,XG,eJ,rJ,sJ,aJ,uJ,dJ,KT,hJ,mJ,yJ];function Kh(t){var e,n;const r=(e=t.storage)===null||e===void 0?void 0:e.markdown,o=(n=xJ.find(s=>s.name===t.name))===null||n===void 0?void 0:n.storage.markdown;return r||o?{...o,...r}:null}class vJ{constructor(e){qh(this,"editor",null),this.editor=e}serialize(e){const n=new MG(this.nodes,this.marks,{hardBreakNodeName:JT.name});return n.renderContent(e),n.out}get nodes(){var e;return{...Object.fromEntries(Object.keys(this.editor.schema.nodes).map(n=>[n,this.serializeNode(Up)])),...Object.fromEntries((e=this.editor.extensionManager.extensions.filter(n=>n.type==="node"&&this.serializeNode(n)).map(n=>[n.name,this.serializeNode(n)]))!==null&&e!==void 0?e:[])}}get marks(){var e;return{...Object.fromEntries(Object.keys(this.editor.schema.marks).map(n=>[n,this.serializeMark(KT)])),...Object.fromEntries((e=this.editor.extensionManager.extensions.filter(n=>n.type==="mark"&&this.serializeMark(n)).map(n=>[n.name,this.serializeMark(n)]))!==null&&e!==void 0?e:[])}}serializeNode(e){var n;return(n=Kh(e))===null||n===void 0||(n=n.serialize)===null||n===void 0?void 0:n.bind({editor:this.editor,options:e.options})}serializeMark(e){var n;const r=(n=Kh(e))===null||n===void 0?void 0:n.serialize;return r?{...r,open:typeof r.open=="function"?r.open.bind({editor:this.editor,options:e.options}):r.open,close:typeof r.close=="function"?r.close.bind({editor:this.editor,options:e.options}):r.close}:null}}class bJ{constructor(e,n){qh(this,"editor",null),qh(this,"md",null);let{html:r,linkify:o,breaks:s}=n;this.editor=e,this.md=this.withPatchedRenderer(er({html:r,linkify:o,breaks:s}))}parse(e){let{inline:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof e=="string"){this.editor.extensionManager.extensions.forEach(s=>{var i;return(i=Kh(s))===null||i===void 0||(i=i.parse)===null||i===void 0||(i=i.setup)===null||i===void 0?void 0:i.call({editor:this.editor,options:s.options},this.md)});const r=this.md.render(e),o=iv(r);return this.editor.extensionManager.extensions.forEach(s=>{var i;return(i=Kh(s))===null||i===void 0||(i=i.parse)===null||i===void 0||(i=i.updateDOM)===null||i===void 0?void 0:i.call({editor:this.editor,options:s.options},o)}),this.normalizeDOM(o,{inline:n,content:e}),o.innerHTML}return e}normalizeDOM(e,n){let{inline:r,content:o}=n;return this.normalizeBlocks(e),e.querySelectorAll("*").forEach(s=>{var i;((i=s.nextSibling)===null||i===void 0?void 0:i.nodeType)===Node.TEXT_NODE&&!s.closest("pre")&&(s.nextSibling.textContent=s.nextSibling.textContent.replace(/^\n/,""))}),r&&this.normalizeInline(e,o),e}normalizeBlocks(e){const r=Object.values(this.editor.schema.nodes).filter(o=>o.isBlock).map(o=>{var s;return(s=o.spec.parseDOM)===null||s===void 0?void 0:s.map(i=>i.tag)}).flat().filter(Boolean).join(",");r&&[...e.querySelectorAll(r)].forEach(o=>{o.parentElement.matches("p")&&NG(o)})}normalizeInline(e,n){var r;if((r=e.firstElementChild)!==null&&r!==void 0&&r.matches("p")){var o,s,i,l;const u=e.firstElementChild,{nextElementSibling:d}=u,f=(o=(s=n.match(/^\s+/))===null||s===void 0?void 0:s[0])!==null&&o!==void 0?o:"",p=d?"":(i=(l=n.match(/\s+$/))===null||l===void 0?void 0:l[0])!==null&&i!==void 0?i:"";if(n.match(/^\n\n/)){u.innerHTML=`${u.innerHTML}${p}`;return}DG(u),e.innerHTML=`${f}${e.innerHTML}${p}`}}withPatchedRenderer(e){const n=r=>function(){const o=r(...arguments);return o===`
604
- `?o:o[o.length-1]===`
605
- `?o.slice(0,-1):o};return e.renderer.rules.hardbreak=n(e.renderer.rules.hardbreak),e.renderer.rules.softbreak=n(e.renderer.rules.softbreak),e.renderer.rules.fence=n(e.renderer.rules.fence),e.renderer.rules.code_block=n(e.renderer.rules.code_block),e.renderer.renderToken=n(e.renderer.renderToken.bind(e.renderer)),e}}const kJ=Ct.create({name:"markdownClipboard",addOptions(){return{transformPastedText:!1,transformCopiedText:!1}},addProseMirrorPlugins(){return[new wt({key:new Vt("markdownClipboard"),props:{clipboardTextParser:(t,e,n)=>{if(n||!this.options.transformPastedText)return null;const r=this.editor.storage.markdown.parser.parse(t,{inline:!0});return Xo.fromSchema(this.editor.schema).parseSlice(iv(r),{preserveWhitespace:!0,context:e})},clipboardTextSerializer:t=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(t.content):null}})]}}),wJ=Ct.create({name:"markdown",priority:50,addOptions(){return{html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!1,breaks:!1,transformPastedText:!1,transformCopiedText:!1}},addCommands(){const t=m6.Commands.config.addCommands();return{setContent:(e,n)=>r=>t.setContent(r.editor.storage.markdown.parser.parse(e),n)(r),insertContentAt:(e,n,r)=>o=>t.insertContentAt(e,o.editor.storage.markdown.parser.parse(n,{inline:!0}),r)(o)}},onBeforeCreate(){this.editor.storage.markdown={options:{...this.options},parser:new bJ(this.editor,this.options),serializer:new vJ(this.editor),getMarkdown:()=>this.editor.storage.markdown.serializer.serialize(this.editor.state.doc)},this.editor.options.initialContent=this.editor.options.content,this.editor.options.content=this.editor.storage.markdown.parser.parse(this.editor.options.content)},onCreate(){this.editor.options.content=this.editor.options.initialContent,delete this.editor.options.initialContent},addStorage(){return{}},addExtensions(){return[SG.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),kJ.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}});function CJ({value:t,onChange:e}){const n=QV({extensions:[EW,wJ],content:t||"",onUpdate:({editor:r})=>{const o=r.storage;e(o.markdown.getMarkdown())},editorProps:{attributes:{class:"tiptap min-h-40 px-4 py-3 text-sm text-foreground outline-none"}}});return n?x.jsxs("div",{className:"overflow-hidden rounded-lg border border-input bg-card shadow-sm focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/20",children:[x.jsxs("div",{className:"flex flex-wrap items-center gap-0.5 border-b border-border bg-muted/50 px-2 py-1.5",children:[x.jsx(io,{editor:n,on:"bold",cmd:r=>r.toggleBold(),title:"Kalın",children:x.jsx(IP,{className:"h-4 w-4"})}),x.jsx(io,{editor:n,on:"italic",cmd:r=>r.toggleItalic(),title:"İtalik",children:x.jsx(Aj,{className:"h-4 w-4"})}),x.jsx(Ug,{}),x.jsx(io,{editor:n,on:"heading",attrs:{level:2},cmd:r=>r.toggleHeading({level:2}),title:"Başlık 2",children:x.jsx(wj,{className:"h-4 w-4"})}),x.jsx(io,{editor:n,on:"heading",attrs:{level:3},cmd:r=>r.toggleHeading({level:3}),title:"Başlık 3",children:x.jsx(Sj,{className:"h-4 w-4"})}),x.jsx(Ug,{}),x.jsx(io,{editor:n,on:"bulletList",cmd:r=>r.toggleBulletList(),title:"Madde listesi",children:x.jsx(e_,{className:"h-4 w-4"})}),x.jsx(io,{editor:n,on:"orderedList",cmd:r=>r.toggleOrderedList(),title:"Sıralı liste",children:x.jsx(jj,{className:"h-4 w-4"})}),x.jsx(io,{editor:n,on:"blockquote",cmd:r=>r.toggleBlockquote(),title:"Alıntı",children:x.jsx(Gj,{className:"h-4 w-4"})}),x.jsx(io,{editor:n,on:"codeBlock",cmd:r=>r.toggleCodeBlock(),title:"Kod",children:x.jsx(rj,{className:"h-4 w-4"})}),x.jsx(Ug,{}),x.jsx(io,{editor:n,cmd:r=>r.undo(),title:"Geri al",children:x.jsx(v9,{className:"h-4 w-4"})}),x.jsx(io,{editor:n,cmd:r=>r.redo(),title:"Yinele",children:x.jsx(Zj,{className:"h-4 w-4"})})]}),x.jsx(N6,{editor:n})]}):null}function io({editor:t,on:e,attrs:n,cmd:r,title:o,children:s}){const i=e?t.isActive(e,n):!1;return x.jsx("button",{type:"button",title:o,onClick:()=>r(t.chain().focus()).run(),className:`flex h-8 w-8 items-center justify-center rounded-md transition ${i?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/60"}`,children:s})}function Ug(){return x.jsx("span",{className:"mx-1 h-5 w-px bg-border"})}function SJ(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return C.useMemo(()=>r=>{e.forEach(o=>o(r))},e)}const Wp=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Sl(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function av(t){return"nodeType"in t}function Ln(t){var e,n;return t?Sl(t)?t:av(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function lv(t){const{Document:e}=Ln(t);return t instanceof e}function zc(t){return Sl(t)?!1:t instanceof Ln(t).HTMLElement}function ZT(t){return t instanceof Ln(t).SVGElement}function El(t){return t?Sl(t)?t.document:av(t)?lv(t)?t:zc(t)||ZT(t)?t.ownerDocument:document:document:document}const Wr=Wp?C.useLayoutEffect:C.useEffect;function qp(t){const e=C.useRef(t);return Wr(()=>{e.current=t}),C.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return e.current==null?void 0:e.current(...r)},[])}function EJ(){const t=C.useRef(null),e=C.useCallback((r,o)=>{t.current=setInterval(r,o)},[]),n=C.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function fc(t,e){e===void 0&&(e=[t]);const n=C.useRef(t);return Wr(()=>{n.current!==t&&(n.current=t)},e),n}function Fc(t,e){const n=C.useRef();return C.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function Gh(t){const e=qp(t),n=C.useRef(null),r=C.useCallback(o=>{o!==n.current&&(e==null||e(o,n.current)),n.current=o},[]);return[n,r]}function Jh(t){const e=C.useRef();return C.useEffect(()=>{e.current=t},[t]),e.current}let Wg={};function $c(t,e){return C.useMemo(()=>{if(e)return e;const n=Wg[t]==null?0:Wg[t]+1;return Wg[t]=n,t+"-"+n},[t,e])}function YT(t){return 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 r.reduce((s,i)=>{const l=Object.entries(i);for(const[u,d]of l){const f=s[u];f!=null&&(s[u]=f+t*d)}return s},{...e})}}const Xa=YT(1),hc=YT(-1);function _J(t){return"clientX"in t&&"clientY"in t}function Kp(t){if(!t)return!1;const{KeyboardEvent:e}=Ln(t.target);return e&&t instanceof e}function TJ(t){if(!t)return!1;const{TouchEvent:e}=Ln(t.target);return e&&t instanceof e}function Zh(t){if(TJ(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return _J(t)?{x:t.clientX,y:t.clientY}:null}const ss=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:n}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:n}=t;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(t){if(t)return[ss.Translate.toString(t),ss.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),hS="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function MJ(t){return t.matches(hS)?t:t.querySelector(hS)}const AJ={display:"none"};function NJ(t){let{id:e,value:n}=t;return te.createElement("div",{id:e,style:AJ},n)}function DJ(t){let{id:e,announcement:n,ariaLiveType:r="assertive"}=t;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return te.createElement("div",{id:e,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function RJ(){const[t,e]=C.useState("");return{announce:C.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const XT=C.createContext(null);function OJ(t){const e=C.useContext(XT);C.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(t)},[t,e])}function IJ(){const[t]=C.useState(()=>new Set),e=C.useCallback(r=>(t.add(r),()=>t.delete(r)),[t]);return[C.useCallback(r=>{let{type:o,event:s}=r;t.forEach(i=>{var l;return(l=i[o])==null?void 0:l.call(i,s)})},[t]),e]}const PJ={draggable:`
606
- To pick up a draggable item, press the space bar.
607
- While dragging, use the arrow keys to move the item.
608
- Press space again to drop the item in its new position, or press escape to cancel.
609
- `},jJ={onDragStart(t){let{active:e}=t;return"Picked up draggable item "+e.id+"."},onDragOver(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was moved over droppable area "+n.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(t){let{active:e}=t;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function LJ(t){let{announcements:e=jJ,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=PJ}=t;const{announce:s,announcement:i}=RJ(),l=$c("DndLiveRegion"),[u,d]=C.useState(!1);if(C.useEffect(()=>{d(!0)},[]),OJ(C.useMemo(()=>({onDragStart(p){let{active:m}=p;s(e.onDragStart({active:m}))},onDragMove(p){let{active:m,over:y}=p;e.onDragMove&&s(e.onDragMove({active:m,over:y}))},onDragOver(p){let{active:m,over:y}=p;s(e.onDragOver({active:m,over:y}))},onDragEnd(p){let{active:m,over:y}=p;s(e.onDragEnd({active:m,over:y}))},onDragCancel(p){let{active:m,over:y}=p;s(e.onDragCancel({active:m,over:y}))}}),[s,e])),!u)return null;const f=te.createElement(te.Fragment,null,te.createElement(NJ,{id:r,value:o.draggable}),te.createElement(DJ,{id:l,announcement:i}));return n?Vr.createPortal(f,n):f}var Yt;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(Yt||(Yt={}));function Yh(){}function pS(t,e){return C.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function zJ(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return C.useMemo(()=>[...e].filter(r=>r!=null),[...e])}const qr=Object.freeze({x:0,y:0});function QT(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function FJ(t,e){const n=Zh(t);if(!n)return"0 0";const r={x:(n.x-e.left)/e.width*100,y:(n.y-e.top)/e.height*100};return r.x+"% "+r.y+"%"}function eM(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function $J(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function mS(t){let{left:e,top:n,height:r,width:o}=t;return[{x:e,y:n},{x:e+o,y:n},{x:e,y:n+r},{x:e+o,y:n+r}]}function tM(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function gS(t,e,n){return e===void 0&&(e=t.left),n===void 0&&(n=t.top),{x:e+t.width*.5,y:n+t.height*.5}}const BJ=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const o=gS(e,e.left,e.top),s=[];for(const i of r){const{id:l}=i,u=n.get(l);if(u){const d=QT(gS(u),o);s.push({id:l,data:{droppableContainer:i,value:d}})}}return s.sort(eM)},VJ=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const o=mS(e),s=[];for(const i of r){const{id:l}=i,u=n.get(l);if(u){const d=mS(u),f=o.reduce((m,y,v)=>m+QT(d[v],y),0),p=Number((f/4).toFixed(4));s.push({id:l,data:{droppableContainer:i,value:p}})}}return s.sort(eM)};function HJ(t,e){const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),o=Math.min(e.left+e.width,t.left+t.width),s=Math.min(e.top+e.height,t.top+t.height),i=o-r,l=s-n;if(r<o&&n<s){const u=e.width*e.height,d=t.width*t.height,f=i*l,p=f/(u+d-f);return Number(p.toFixed(4))}return 0}const UJ=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const o=[];for(const s of r){const{id:i}=s,l=n.get(i);if(l){const u=HJ(l,e);u>0&&o.push({id:i,data:{droppableContainer:s,value:u}})}}return o.sort($J)};function WJ(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function nM(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:qr}function qJ(t){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];return o.reduce((i,l)=>({...i,top:i.top+t*l.y,bottom:i.bottom+t*l.y,left:i.left+t*l.x,right:i.right+t*l.x}),{...n})}}const KJ=qJ(1);function rM(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function GJ(t,e,n){const r=rM(e);if(!r)return t;const{scaleX:o,scaleY:s,x:i,y:l}=r,u=t.left-i-(1-o)*parseFloat(n),d=t.top-l-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),f=o?t.width/o:t.width,p=s?t.height/s:t.height;return{width:f,height:p,top:d,right:u+f,bottom:d+p,left:u}}const JJ={ignoreTransform:!1};function _l(t,e){e===void 0&&(e=JJ);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:d,transformOrigin:f}=Ln(t).getComputedStyle(t);d&&(n=GJ(n,d,f))}const{top:r,left:o,width:s,height:i,bottom:l,right:u}=n;return{top:r,left:o,width:s,height:i,bottom:l,right:u}}function yS(t){return _l(t,{ignoreTransform:!0})}function ZJ(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function YJ(t,e){return e===void 0&&(e=Ln(t).getComputedStyle(t)),e.position==="fixed"}function XJ(t,e){e===void 0&&(e=Ln(t).getComputedStyle(t));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const s=e[o];return typeof s=="string"?n.test(s):!1})}function Gp(t,e){const n=[];function r(o){if(e!=null&&n.length>=e||!o)return n;if(lv(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!zc(o)||ZT(o)||n.includes(o))return n;const s=Ln(t).getComputedStyle(o);return o!==t&&XJ(o,s)&&n.push(o),YJ(o,s)?n:r(o.parentNode)}return t?r(t):n}function oM(t){const[e]=Gp(t,1);return e??null}function qg(t){return!Wp||!t?null:Sl(t)?t:av(t)?lv(t)||t===El(t).scrollingElement?window:zc(t)?t:null:null}function sM(t){return Sl(t)?t.scrollX:t.scrollLeft}function iM(t){return Sl(t)?t.scrollY:t.scrollTop}function dy(t){return{x:sM(t),y:iM(t)}}var an;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(an||(an={}));function aM(t){return!Wp||!t?!1:t===document.scrollingElement}function lM(t){const e={x:0,y:0},n=aM(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},r={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},o=t.scrollTop<=e.y,s=t.scrollLeft<=e.x,i=t.scrollTop>=r.y,l=t.scrollLeft>=r.x;return{isTop:o,isLeft:s,isBottom:i,isRight:l,maxScroll:r,minScroll:e}}const QJ={x:.2,y:.2};function eZ(t,e,n,r,o){let{top:s,left:i,right:l,bottom:u}=n;r===void 0&&(r=10),o===void 0&&(o=QJ);const{isTop:d,isBottom:f,isLeft:p,isRight:m}=lM(t),y={x:0,y:0},v={x:0,y:0},b={height:e.height*o.y,width:e.width*o.x};return!d&&s<=e.top+b.height?(y.y=an.Backward,v.y=r*Math.abs((e.top+b.height-s)/b.height)):!f&&u>=e.bottom-b.height&&(y.y=an.Forward,v.y=r*Math.abs((e.bottom-b.height-u)/b.height)),!m&&l>=e.right-b.width?(y.x=an.Forward,v.x=r*Math.abs((e.right-b.width-l)/b.width)):!p&&i<=e.left+b.width&&(y.x=an.Backward,v.x=r*Math.abs((e.left+b.width-i)/b.width)),{direction:y,speed:v}}function tZ(t){if(t===document.scrollingElement){const{innerWidth:s,innerHeight:i}=window;return{top:0,left:0,right:s,bottom:i,width:s,height:i}}const{top:e,left:n,right:r,bottom:o}=t.getBoundingClientRect();return{top:e,left:n,right:r,bottom:o,width:t.clientWidth,height:t.clientHeight}}function uM(t){return t.reduce((e,n)=>Xa(e,dy(n)),qr)}function nZ(t){return t.reduce((e,n)=>e+sM(n),0)}function rZ(t){return t.reduce((e,n)=>e+iM(n),0)}function cM(t,e){if(e===void 0&&(e=_l),!t)return;const{top:n,left:r,bottom:o,right:s}=e(t);oM(t)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const oZ=[["x",["left","right"],nZ],["y",["top","bottom"],rZ]];class uv{constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Gp(n),o=uM(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[s,i,l]of oZ)for(const u of i)Object.defineProperty(this,u,{get:()=>{const d=l(r),f=o[s]-d;return this.rect[u]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Pu{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=e}add(e,n,r){var o;(o=this.target)==null||o.addEventListener(e,n,r),this.listeners.push([e,n,r])}}function sZ(t){const{EventTarget:e}=Ln(t);return t instanceof e?t:El(t)}function Kg(t,e){const n=Math.abs(t.x),r=Math.abs(t.y);return typeof e=="number"?Math.sqrt(n**2+r**2)>e:"x"in e&&"y"in e?n>e.x&&r>e.y:"x"in e?n>e.x:"y"in e?r>e.y:!1}var Er;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(Er||(Er={}));function xS(t){t.preventDefault()}function iZ(t){t.stopPropagation()}var Je;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(Je||(Je={}));const dM={start:[Je.Space,Je.Enter],cancel:[Je.Esc],end:[Je.Space,Je.Enter,Je.Tab]},aZ=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case Je.Right:return{...n,x:n.x+25};case Je.Left:return{...n,x:n.x-25};case Je.Down:return{...n,y:n.y+25};case Je.Up:return{...n,y:n.y-25}}};class cv{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new Pu(El(n)),this.windowListeners=new Pu(Ln(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Er.Resize,this.handleCancel),this.windowListeners.add(Er.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Er.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&cM(r),n(qr)}handleKeyDown(e){if(Kp(e)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=dM,coordinateGetter:i=aZ,scrollBehavior:l="smooth"}=o,{code:u}=e;if(s.end.includes(u)){this.handleEnd(e);return}if(s.cancel.includes(u)){this.handleCancel(e);return}const{collisionRect:d}=r.current,f=d?{x:d.left,y:d.top}:qr;this.referenceCoordinates||(this.referenceCoordinates=f);const p=i(e,{active:n,context:r.current,currentCoordinates:f});if(p){const m=hc(p,f),y={x:0,y:0},{scrollableAncestors:v}=r.current;for(const b of v){const k=e.code,{isTop:E,isRight:_,isLeft:T,isBottom:A,maxScroll:N,minScroll:D}=lM(b),I=tZ(b),P={x:Math.min(k===Je.Right?I.right-I.width/2:I.right,Math.max(k===Je.Right?I.left:I.left+I.width/2,p.x)),y:Math.min(k===Je.Down?I.bottom-I.height/2:I.bottom,Math.max(k===Je.Down?I.top:I.top+I.height/2,p.y))},O=k===Je.Right&&!_||k===Je.Left&&!T,U=k===Je.Down&&!A||k===Je.Up&&!E;if(O&&P.x!==p.x){const J=b.scrollLeft+m.x,K=k===Je.Right&&J<=N.x||k===Je.Left&&J>=D.x;if(K&&!m.y){b.scrollTo({left:J,behavior:l});return}K?y.x=b.scrollLeft-J:y.x=k===Je.Right?b.scrollLeft-N.x:b.scrollLeft-D.x,y.x&&b.scrollBy({left:-y.x,behavior:l});break}else if(U&&P.y!==p.y){const J=b.scrollTop+m.y,K=k===Je.Down&&J<=N.y||k===Je.Up&&J>=D.y;if(K&&!m.x){b.scrollTo({top:J,behavior:l});return}K?y.y=b.scrollTop-J:y.y=k===Je.Down?b.scrollTop-N.y:b.scrollTop-D.y,y.y&&b.scrollBy({top:-y.y,behavior:l});break}}this.handleMove(e,Xa(hc(p,this.referenceCoordinates),y))}}}handleMove(e,n){const{onMove:r}=this.props;e.preventDefault(),r(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}cv.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=dM,onActivation:o}=e,{active:s}=n;const{code:i}=t.nativeEvent;if(r.start.includes(i)){const l=s.activatorNode.current;return l&&t.target!==l?!1:(t.preventDefault(),o==null||o({event:t.nativeEvent}),!0)}return!1}}];function vS(t){return!!(t&&"distance"in t)}function bS(t){return!!(t&&"delay"in t)}class dv{constructor(e,n,r){var o;r===void 0&&(r=sZ(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=n;const{event:s}=e,{target:i}=s;this.props=e,this.events=n,this.document=El(i),this.documentListeners=new Pu(this.document),this.listeners=new Pu(r),this.windowListeners=new Pu(Ln(i)),this.initialCoordinates=(o=Zh(s))!=null?o:qr,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Er.Resize,this.handleCancel),this.windowListeners.add(Er.DragStart,xS),this.windowListeners.add(Er.VisibilityChange,this.handleCancel),this.windowListeners.add(Er.ContextMenu,xS),this.documentListeners.add(Er.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(bS(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(vS(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,n){const{active:r,onPending:o}=this.props;o(r,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(Er.Click,iZ,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Er.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:o,props:s}=this,{onMove:i,options:{activationConstraint:l}}=s;if(!o)return;const u=(n=Zh(e))!=null?n:qr,d=hc(o,u);if(!r&&l){if(vS(l)){if(l.tolerance!=null&&Kg(d,l.tolerance))return this.handleCancel();if(Kg(d,l.distance))return this.handleStart()}if(bS(l)&&Kg(d,l.tolerance))return this.handleCancel();this.handlePending(l,d);return}e.cancelable&&e.preventDefault(),i(u)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===Je.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const lZ={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class fv extends dv{constructor(e){const{event:n}=e,r=El(n.target);super(e,lZ,r)}}fv.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const uZ={move:{name:"mousemove"},end:{name:"mouseup"}};var fy;(function(t){t[t.RightClick=2]="RightClick"})(fy||(fy={}));class cZ extends dv{constructor(e){super(e,uZ,El(e.event.target))}}cZ.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===fy.RightClick?!1:(r==null||r({event:n}),!0)}}];const Gg={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class dZ extends dv{constructor(e){super(e,Gg)}static setup(){return window.addEventListener(Gg.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(Gg.move.name,e)};function e(){}}}dZ.activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;const{touches:o}=n;return o.length>1?!1:(r==null||r({event:n}),!0)}}];var ju;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(ju||(ju={}));var Xh;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(Xh||(Xh={}));function fZ(t){let{acceleration:e,activator:n=ju.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:i=5,order:l=Xh.TreeOrder,pointerCoordinates:u,scrollableAncestors:d,scrollableAncestorRects:f,delta:p,threshold:m}=t;const y=pZ({delta:p,disabled:!s}),[v,b]=EJ(),k=C.useRef({x:0,y:0}),E=C.useRef({x:0,y:0}),_=C.useMemo(()=>{switch(n){case ju.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case ju.DraggableRect:return o}},[n,o,u]),T=C.useRef(null),A=C.useCallback(()=>{const D=T.current;if(!D)return;const I=k.current.x*E.current.x,P=k.current.y*E.current.y;D.scrollBy(I,P)},[]),N=C.useMemo(()=>l===Xh.TreeOrder?[...d].reverse():d,[l,d]);C.useEffect(()=>{if(!s||!d.length||!_){b();return}for(const D of N){if((r==null?void 0:r(D))===!1)continue;const I=d.indexOf(D),P=f[I];if(!P)continue;const{direction:O,speed:U}=eZ(D,P,_,e,m);for(const J of["x","y"])y[J][O[J]]||(U[J]=0,O[J]=0);if(U.x>0||U.y>0){b(),T.current=D,v(A,i),k.current=U,E.current=O;return}}k.current={x:0,y:0},E.current={x:0,y:0},b()},[e,A,r,b,s,i,JSON.stringify(_),JSON.stringify(y),v,d,N,f,JSON.stringify(m)])}const hZ={x:{[an.Backward]:!1,[an.Forward]:!1},y:{[an.Backward]:!1,[an.Forward]:!1}};function pZ(t){let{delta:e,disabled:n}=t;const r=Jh(e);return Fc(o=>{if(n||!r||!o)return hZ;const s={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[an.Backward]:o.x[an.Backward]||s.x===-1,[an.Forward]:o.x[an.Forward]||s.x===1},y:{[an.Backward]:o.y[an.Backward]||s.y===-1,[an.Forward]:o.y[an.Forward]||s.y===1}}},[n,e,r])}function mZ(t,e){const n=e!=null?t.get(e):void 0,r=n?n.node.current:null;return Fc(o=>{var s;return e==null?null:(s=r??o)!=null?s:null},[r,e])}function gZ(t,e){return C.useMemo(()=>t.reduce((n,r)=>{const{sensor:o}=r,s=o.activators.map(i=>({eventName:i.eventName,handler:e(i.handler,r)}));return[...n,...s]},[]),[t,e])}var pc;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(pc||(pc={}));var hy;(function(t){t.Optimized="optimized"})(hy||(hy={}));const kS=new Map;function yZ(t,e){let{dragging:n,dependencies:r,config:o}=e;const[s,i]=C.useState(null),{frequency:l,measure:u,strategy:d}=o,f=C.useRef(t),p=k(),m=fc(p),y=C.useCallback(function(E){E===void 0&&(E=[]),!m.current&&i(_=>_===null?E:_.concat(E.filter(T=>!_.includes(T))))},[m]),v=C.useRef(null),b=Fc(E=>{if(p&&!n)return kS;if(!E||E===kS||f.current!==t||s!=null){const _=new Map;for(let T of t){if(!T)continue;if(s&&s.length>0&&!s.includes(T.id)&&T.rect.current){_.set(T.id,T.rect.current);continue}const A=T.node.current,N=A?new uv(u(A),A):null;T.rect.current=N,N&&_.set(T.id,N)}return _}return E},[t,s,n,p,u]);return C.useEffect(()=>{f.current=t},[t]),C.useEffect(()=>{p||y()},[n,p]),C.useEffect(()=>{s&&s.length>0&&i(null)},[JSON.stringify(s)]),C.useEffect(()=>{p||typeof l!="number"||v.current!==null||(v.current=setTimeout(()=>{y(),v.current=null},l))},[l,p,y,...r]),{droppableRects:b,measureDroppableContainers:y,measuringScheduled:s!=null};function k(){switch(d){case pc.Always:return!1;case pc.BeforeDragging:return n;default:return!n}}}function hv(t,e){return Fc(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function xZ(t,e){return hv(t,e)}function vZ(t){let{callback:e,disabled:n}=t;const r=qp(e),o=C.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return C.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Jp(t){let{callback:e,disabled:n}=t;const r=qp(e),o=C.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return C.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function bZ(t){return new uv(_l(t),t)}function wS(t,e,n){e===void 0&&(e=bZ);const[r,o]=C.useState(null);function s(){o(u=>{if(!t)return null;if(t.isConnected===!1){var d;return(d=u??n)!=null?d:null}const f=e(t);return JSON.stringify(u)===JSON.stringify(f)?u:f})}const i=vZ({callback(u){if(t)for(const d of u){const{type:f,target:p}=d;if(f==="childList"&&p instanceof HTMLElement&&p.contains(t)){s();break}}}}),l=Jp({callback:s});return Wr(()=>{s(),t?(l==null||l.observe(t),i==null||i.observe(document.body,{childList:!0,subtree:!0})):(l==null||l.disconnect(),i==null||i.disconnect())},[t]),r}function kZ(t){const e=hv(t);return nM(t,e)}const CS=[];function wZ(t){const e=C.useRef(t),n=Fc(r=>t?r&&r!==CS&&t&&e.current&&t.parentNode===e.current.parentNode?r:Gp(t):CS,[t]);return C.useEffect(()=>{e.current=t},[t]),n}function CZ(t){const[e,n]=C.useState(null),r=C.useRef(t),o=C.useCallback(s=>{const i=qg(s.target);i&&n(l=>l?(l.set(i,dy(i)),new Map(l)):null)},[]);return C.useEffect(()=>{const s=r.current;if(t!==s){i(s);const l=t.map(u=>{const d=qg(u);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,dy(d)]):null}).filter(u=>u!=null);n(l.length?new Map(l):null),r.current=t}return()=>{i(t),i(s)};function i(l){l.forEach(u=>{const d=qg(u);d==null||d.removeEventListener("scroll",o)})}},[o,t]),C.useMemo(()=>t.length?e?Array.from(e.values()).reduce((s,i)=>Xa(s,i),qr):uM(t):qr,[t,e])}function SS(t,e){e===void 0&&(e=[]);const n=C.useRef(null);return C.useEffect(()=>{n.current=null},e),C.useEffect(()=>{const r=t!==qr;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?hc(t,n.current):qr}function SZ(t){C.useEffect(()=>{if(!Wp)return;const e=t.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of e)n==null||n()}},t.map(e=>{let{sensor:n}=e;return n}))}function EZ(t,e){return C.useMemo(()=>t.reduce((n,r)=>{let{eventName:o,handler:s}=r;return n[o]=i=>{s(i,e)},n},{}),[t,e])}function fM(t){return C.useMemo(()=>t?ZJ(t):null,[t])}const ES=[];function _Z(t,e){e===void 0&&(e=_l);const[n]=t,r=fM(n?Ln(n):null),[o,s]=C.useState(ES);function i(){s(()=>t.length?t.map(u=>aM(u)?r:new uv(e(u),u)):ES)}const l=Jp({callback:i});return Wr(()=>{l==null||l.disconnect(),i(),t.forEach(u=>l==null?void 0:l.observe(u))},[t]),o}function hM(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return zc(e)?e:t}function TZ(t){let{measure:e}=t;const[n,r]=C.useState(null),o=C.useCallback(d=>{for(const{target:f}of d)if(zc(f)){r(p=>{const m=e(f);return p?{...p,width:m.width,height:m.height}:m});break}},[e]),s=Jp({callback:o}),i=C.useCallback(d=>{const f=hM(d);s==null||s.disconnect(),f&&(s==null||s.observe(f)),r(f?e(f):null)},[e,s]),[l,u]=Gh(i);return C.useMemo(()=>({nodeRef:l,rect:n,setRef:u}),[n,l,u])}const MZ=[{sensor:fv,options:{}},{sensor:cv,options:{}}],AZ={current:{}},Lf={draggable:{measure:yS},droppable:{measure:yS,strategy:pc.WhileDragging,frequency:hy.Optimized},dragOverlay:{measure:_l}};class Lu extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,r;return(n=(r=this.get(e))==null?void 0:r.node.current)!=null?n:void 0}}const NZ={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Lu,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Yh},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Lf,measureDroppableContainers:Yh,windowRect:null,measuringScheduled:!1},pM={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Yh,draggableNodes:new Map,over:null,measureDroppableContainers:Yh},Bc=C.createContext(pM),mM=C.createContext(NZ);function DZ(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Lu}}}function RZ(t,e){switch(e.type){case Yt.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case Yt.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}}};case Yt.DragEnd:case Yt.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Yt.RegisterDroppable:{const{element:n}=e,{id:r}=n,o=new Lu(t.droppable.containers);return o.set(r,n),{...t,droppable:{...t.droppable,containers:o}}}case Yt.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=e,s=t.droppable.containers.get(n);if(!s||r!==s.key)return t;const i=new Lu(t.droppable.containers);return i.set(n,{...s,disabled:o}),{...t,droppable:{...t.droppable,containers:i}}}case Yt.UnregisterDroppable:{const{id:n,key:r}=e,o=t.droppable.containers.get(n);if(!o||r!==o.key)return t;const s=new Lu(t.droppable.containers);return s.delete(n),{...t,droppable:{...t.droppable,containers:s}}}default:return t}}function OZ(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:o}=C.useContext(Bc),s=Jh(r),i=Jh(n==null?void 0:n.id);return C.useEffect(()=>{if(!e&&!r&&s&&i!=null){if(!Kp(s)||document.activeElement===s.target)return;const l=o.get(i);if(!l)return;const{activatorNode:u,node:d}=l;if(!u.current&&!d.current)return;requestAnimationFrame(()=>{for(const f of[u.current,d.current]){if(!f)continue;const p=MJ(f);if(p){p.focus();break}}})}},[r,e,o,i,s]),null}function gM(t,e){let{transform:n,...r}=e;return t!=null&&t.length?t.reduce((o,s)=>s({transform:o,...r}),n):n}function IZ(t){return C.useMemo(()=>({draggable:{...Lf.draggable,...t==null?void 0:t.draggable},droppable:{...Lf.droppable,...t==null?void 0:t.droppable},dragOverlay:{...Lf.dragOverlay,...t==null?void 0:t.dragOverlay}}),[t==null?void 0:t.draggable,t==null?void 0:t.droppable,t==null?void 0:t.dragOverlay])}function PZ(t){let{activeNode:e,measure:n,initialRect:r,config:o=!0}=t;const s=C.useRef(!1),{x:i,y:l}=typeof o=="boolean"?{x:o,y:o}:o;Wr(()=>{if(!i&&!l||!e){s.current=!1;return}if(s.current||!r)return;const d=e==null?void 0:e.node.current;if(!d||d.isConnected===!1)return;const f=n(d),p=nM(f,r);if(i||(p.x=0),l||(p.y=0),s.current=!0,Math.abs(p.x)>0||Math.abs(p.y)>0){const m=oM(d);m&&m.scrollBy({top:p.y,left:p.x})}},[e,i,l,r,n])}const Zp=C.createContext({...qr,scaleX:1,scaleY:1});var $s;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})($s||($s={}));const jZ=C.memo(function(e){var n,r,o,s;let{id:i,accessibility:l,autoScroll:u=!0,children:d,sensors:f=MZ,collisionDetection:p=UJ,measuring:m,modifiers:y,...v}=e;const b=C.useReducer(RZ,void 0,DZ),[k,E]=b,[_,T]=IJ(),[A,N]=C.useState($s.Uninitialized),D=A===$s.Initialized,{draggable:{active:I,nodes:P,translate:O},droppable:{containers:U}}=k,J=I!=null?P.get(I):null,K=C.useRef({initial:null,translated:null}),q=C.useMemo(()=>{var mt;return I!=null?{id:I,data:(mt=J==null?void 0:J.data)!=null?mt:AZ,rect:K}:null},[I,J]),Z=C.useRef(null),[Q,G]=C.useState(null),[Y,W]=C.useState(null),ee=fc(v,Object.values(v)),z=$c("DndDescribedBy",i),j=C.useMemo(()=>U.getEnabled(),[U]),B=IZ(m),{droppableRects:ne,measureDroppableContainers:fe,measuringScheduled:ue}=yZ(j,{dragging:D,dependencies:[O.x,O.y],config:B.droppable}),he=mZ(P,I),Ae=C.useMemo(()=>Y?Zh(Y):null,[Y]),X=Yr(),ce=xZ(he,B.draggable.measure);PZ({activeNode:I!=null?P.get(I):null,config:X.layoutShiftCompensation,initialRect:ce,measure:B.draggable.measure});const pe=wS(he,B.draggable.measure,ce),Le=wS(he?he.parentElement:null),Ne=C.useRef({activatorEvent:null,active:null,activeNode:he,collisionRect:null,collisions:null,droppableRects:ne,draggableNodes:P,draggingNode:null,draggingNodeRect:null,droppableContainers:U,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),$e=U.getNodeFor((n=Ne.current.over)==null?void 0:n.id),Ze=TZ({measure:B.dragOverlay.measure}),Mt=(r=Ze.nodeRef.current)!=null?r:he,Pt=D?(o=Ze.rect)!=null?o:pe:null,Ht=!!(Ze.nodeRef.current&&Ze.rect),zn=kZ(Ht?null:pe),Ut=fM(Mt?Ln(Mt):null),en=wZ(D?$e??he:null),An=_Z(en),ht=gM(y,{transform:{x:O.x-zn.x,y:O.y-zn.y,scaleX:1,scaleY:1},activatorEvent:Y,active:q,activeNodeRect:pe,containerNodeRect:Le,draggingNodeRect:Pt,over:Ne.current.over,overlayNodeRect:Ze.rect,scrollableAncestors:en,scrollableAncestorRects:An,windowRect:Ut}),hr=Ae?Xa(Ae,O):null,gi=CZ(en),ha=SS(gi),To=SS(gi,[pe]),pr=Xa(ht,ha),Fn=Pt?KJ(Pt,ht):null,mr=q&&Fn?p({active:q,collisionRect:Fn,droppableRects:ne,droppableContainers:j,pointerCoordinates:hr}):null,Nn=tM(mr,"id"),[hn,Rr]=C.useState(null),pa=Ht?ht:Xa(ht,To),ma=WJ(pa,(s=hn==null?void 0:hn.rect)!=null?s:null,pe),ds=C.useRef(null),Mo=C.useCallback((mt,Wt)=>{let{sensor:Te,options:st}=Wt;if(Z.current==null)return;const et=P.get(Z.current);if(!et)return;const it=mt.nativeEvent,qt=new Te({active:Z.current,activeNode:et,event:it,options:st,context:Ne,onAbort(Ge){if(!P.get(Ge))return;const{onDragAbort:dt}=ee.current,Et={id:Ge};dt==null||dt(Et),_({type:"onDragAbort",event:Et})},onPending(Ge,pn,dt,Et){if(!P.get(Ge))return;const{onDragPending:tn}=ee.current,Vn={id:Ge,constraint:pn,initialCoordinates:dt,offset:Et};tn==null||tn(Vn),_({type:"onDragPending",event:Vn})},onStart(Ge){const pn=Z.current;if(pn==null)return;const dt=P.get(pn);if(!dt)return;const{onDragStart:Et}=ee.current,Bn={activatorEvent:it,active:{id:pn,data:dt.data,rect:K}};Vr.unstable_batchedUpdates(()=>{Et==null||Et(Bn),N($s.Initializing),E({type:Yt.DragStart,initialCoordinates:Ge,active:pn}),_({type:"onDragStart",event:Bn}),G(ds.current),W(it)})},onMove(Ge){E({type:Yt.DragMove,coordinates:Ge})},onEnd:pt(Yt.DragEnd),onCancel:pt(Yt.DragCancel)});ds.current=qt;function pt(Ge){return async function(){const{active:dt,collisions:Et,over:Bn,scrollAdjustedTranslate:tn}=Ne.current;let Vn=null;if(dt&&tn){const{cancelDrop:Ao}=ee.current;Vn={activatorEvent:it,active:dt,collisions:Et,delta:tn,over:Bn},Ge===Yt.DragEnd&&typeof Ao=="function"&&await Promise.resolve(Ao(Vn))&&(Ge=Yt.DragCancel)}Z.current=null,Vr.unstable_batchedUpdates(()=>{E({type:Ge}),N($s.Uninitialized),Rr(null),G(null),W(null),ds.current=null;const Ao=Ge===Yt.DragEnd?"onDragEnd":"onDragCancel";if(Vn){const Tl=ee.current[Ao];Tl==null||Tl(Vn),_({type:Ao,event:Vn})}})}}},[P]),yi=C.useCallback((mt,Wt)=>(Te,st)=>{const et=Te.nativeEvent,it=P.get(st);if(Z.current!==null||!it||et.dndKit||et.defaultPrevented)return;const qt={active:it};mt(Te,Wt.options,qt)===!0&&(et.dndKit={capturedBy:Wt.sensor},Z.current=st,Mo(Te,Wt))},[P,Mo]),Zr=gZ(f,yi);SZ(f),Wr(()=>{pe&&A===$s.Initializing&&N($s.Initialized)},[pe,A]),C.useEffect(()=>{const{onDragMove:mt}=ee.current,{active:Wt,activatorEvent:Te,collisions:st,over:et}=Ne.current;if(!Wt||!Te)return;const it={active:Wt,activatorEvent:Te,collisions:st,delta:{x:pr.x,y:pr.y},over:et};Vr.unstable_batchedUpdates(()=>{mt==null||mt(it),_({type:"onDragMove",event:it})})},[pr.x,pr.y]),C.useEffect(()=>{const{active:mt,activatorEvent:Wt,collisions:Te,droppableContainers:st,scrollAdjustedTranslate:et}=Ne.current;if(!mt||Z.current==null||!Wt||!et)return;const{onDragOver:it}=ee.current,qt=st.get(Nn),pt=qt&&qt.rect.current?{id:qt.id,rect:qt.rect.current,data:qt.data,disabled:qt.disabled}:null,Ge={active:mt,activatorEvent:Wt,collisions:Te,delta:{x:et.x,y:et.y},over:pt};Vr.unstable_batchedUpdates(()=>{Rr(pt),it==null||it(Ge),_({type:"onDragOver",event:Ge})})},[Nn]),Wr(()=>{Ne.current={activatorEvent:Y,active:q,activeNode:he,collisionRect:Fn,collisions:mr,droppableRects:ne,draggableNodes:P,draggingNode:Mt,draggingNodeRect:Pt,droppableContainers:U,over:hn,scrollableAncestors:en,scrollAdjustedTranslate:pr},K.current={initial:Pt,translated:Fn}},[q,he,mr,Fn,P,Mt,Pt,ne,U,hn,en,pr]),fZ({...X,delta:O,draggingRect:Fn,pointerCoordinates:hr,scrollableAncestors:en,scrollableAncestorRects:An});const $n=C.useMemo(()=>({active:q,activeNode:he,activeNodeRect:pe,activatorEvent:Y,collisions:mr,containerNodeRect:Le,dragOverlay:Ze,draggableNodes:P,droppableContainers:U,droppableRects:ne,over:hn,measureDroppableContainers:fe,scrollableAncestors:en,scrollableAncestorRects:An,measuringConfiguration:B,measuringScheduled:ue,windowRect:Ut}),[q,he,pe,Y,mr,Le,Ze,P,U,ne,hn,fe,en,An,B,ue,Ut]),xi=C.useMemo(()=>({activatorEvent:Y,activators:Zr,active:q,activeNodeRect:pe,ariaDescribedById:{draggable:z},dispatch:E,draggableNodes:P,over:hn,measureDroppableContainers:fe}),[Y,Zr,q,pe,E,z,P,hn,fe]);return te.createElement(XT.Provider,{value:T},te.createElement(Bc.Provider,{value:xi},te.createElement(mM.Provider,{value:$n},te.createElement(Zp.Provider,{value:ma},d)),te.createElement(OZ,{disabled:(l==null?void 0:l.restoreFocus)===!1})),te.createElement(LJ,{...l,hiddenTextDescribedById:z}));function Yr(){const mt=(Q==null?void 0:Q.autoScrollEnabled)===!1,Wt=typeof u=="object"?u.enabled===!1:u===!1,Te=D&&!mt&&!Wt;return typeof u=="object"?{...u,enabled:Te}:{enabled:Te}}}),LZ=C.createContext(null),_S="button",zZ="Draggable";function FZ(t){let{id:e,data:n,disabled:r=!1,attributes:o}=t;const s=$c(zZ),{activators:i,activatorEvent:l,active:u,activeNodeRect:d,ariaDescribedById:f,draggableNodes:p,over:m}=C.useContext(Bc),{role:y=_S,roleDescription:v="draggable",tabIndex:b=0}=o??{},k=(u==null?void 0:u.id)===e,E=C.useContext(k?Zp:LZ),[_,T]=Gh(),[A,N]=Gh(),D=EZ(i,e),I=fc(n);Wr(()=>(p.set(e,{id:e,key:s,node:_,activatorNode:A,data:I}),()=>{const O=p.get(e);O&&O.key===s&&p.delete(e)}),[p,e]);const P=C.useMemo(()=>({role:y,tabIndex:b,"aria-disabled":r,"aria-pressed":k&&y===_S?!0:void 0,"aria-roledescription":v,"aria-describedby":f.draggable}),[r,y,b,k,v,f.draggable]);return{active:u,activatorEvent:l,activeNodeRect:d,attributes:P,isDragging:k,listeners:r?void 0:D,node:_,over:m,setNodeRef:T,setActivatorNodeRef:N,transform:E}}function yM(){return C.useContext(mM)}const $Z="Droppable",BZ={timeout:25};function VZ(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:o}=t;const s=$c($Z),{active:i,dispatch:l,over:u,measureDroppableContainers:d}=C.useContext(Bc),f=C.useRef({disabled:n}),p=C.useRef(!1),m=C.useRef(null),y=C.useRef(null),{disabled:v,updateMeasurementsFor:b,timeout:k}={...BZ,...o},E=fc(b??r),_=C.useCallback(()=>{if(!p.current){p.current=!0;return}y.current!=null&&clearTimeout(y.current),y.current=setTimeout(()=>{d(Array.isArray(E.current)?E.current:[E.current]),y.current=null},k)},[k]),T=Jp({callback:_,disabled:v||!i}),A=C.useCallback((P,O)=>{T&&(O&&(T.unobserve(O),p.current=!1),P&&T.observe(P))},[T]),[N,D]=Gh(A),I=fc(e);return C.useEffect(()=>{!T||!N.current||(T.disconnect(),p.current=!1,T.observe(N.current))},[N,T]),C.useEffect(()=>(l({type:Yt.RegisterDroppable,element:{id:r,key:s,disabled:n,node:N,rect:m,data:I}}),()=>l({type:Yt.UnregisterDroppable,key:s,id:r})),[r]),C.useEffect(()=>{n!==f.current.disabled&&(l({type:Yt.SetDroppableDisabled,id:r,key:s,disabled:n}),f.current.disabled=n)},[r,s,n,l]),{active:i,rect:m,isOver:(u==null?void 0:u.id)===r,node:N,over:u,setNodeRef:D}}function HZ(t){let{animation:e,children:n}=t;const[r,o]=C.useState(null),[s,i]=C.useState(null),l=Jh(n);return!n&&!r&&l&&o(l),Wr(()=>{if(!s)return;const u=r==null?void 0:r.key,d=r==null?void 0:r.props.id;if(u==null||d==null){o(null);return}Promise.resolve(e(d,s)).then(()=>{o(null)})},[e,r,s]),te.createElement(te.Fragment,null,n,r?C.cloneElement(r,{ref:i}):null)}const UZ={x:0,y:0,scaleX:1,scaleY:1};function WZ(t){let{children:e}=t;return te.createElement(Bc.Provider,{value:pM},te.createElement(Zp.Provider,{value:UZ},e))}const qZ={position:"fixed",touchAction:"none"},KZ=t=>Kp(t)?"transform 250ms ease":void 0,GZ=C.forwardRef((t,e)=>{let{as:n,activatorEvent:r,adjustScale:o,children:s,className:i,rect:l,style:u,transform:d,transition:f=KZ}=t;if(!l)return null;const p=o?d:{...d,scaleX:1,scaleY:1},m={...qZ,width:l.width,height:l.height,top:l.top,left:l.left,transform:ss.Transform.toString(p),transformOrigin:o&&r?FJ(r,l):void 0,transition:typeof f=="function"?f(r):f,...u};return te.createElement(n,{className:i,style:m,ref:e},s)}),JZ=t=>e=>{let{active:n,dragOverlay:r}=e;const o={},{styles:s,className:i}=t;if(s!=null&&s.active)for(const[l,u]of Object.entries(s.active))u!==void 0&&(o[l]=n.node.style.getPropertyValue(l),n.node.style.setProperty(l,u));if(s!=null&&s.dragOverlay)for(const[l,u]of Object.entries(s.dragOverlay))u!==void 0&&r.node.style.setProperty(l,u);return i!=null&&i.active&&n.node.classList.add(i.active),i!=null&&i.dragOverlay&&r.node.classList.add(i.dragOverlay),function(){for(const[u,d]of Object.entries(o))n.node.style.setProperty(u,d);i!=null&&i.active&&n.node.classList.remove(i.active)}},ZZ=t=>{let{transform:{initial:e,final:n}}=t;return[{transform:ss.Transform.toString(e)},{transform:ss.Transform.toString(n)}]},YZ={duration:250,easing:"ease",keyframes:ZZ,sideEffects:JZ({styles:{active:{opacity:"0"}}})};function XZ(t){let{config:e,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=t;return qp((s,i)=>{if(e===null)return;const l=n.get(s);if(!l)return;const u=l.node.current;if(!u)return;const d=hM(i);if(!d)return;const{transform:f}=Ln(i).getComputedStyle(i),p=rM(f);if(!p)return;const m=typeof e=="function"?e:QZ(e);return cM(u,o.draggable.measure),m({active:{id:s,data:l.data,node:u,rect:o.draggable.measure(u)},draggableNodes:n,dragOverlay:{node:i,rect:o.dragOverlay.measure(d)},droppableContainers:r,measuringConfiguration:o,transform:p})})}function QZ(t){const{duration:e,easing:n,sideEffects:r,keyframes:o}={...YZ,...t};return s=>{let{active:i,dragOverlay:l,transform:u,...d}=s;if(!e)return;const f={x:l.rect.left-i.rect.left,y:l.rect.top-i.rect.top},p={scaleX:u.scaleX!==1?i.rect.width*u.scaleX/l.rect.width:1,scaleY:u.scaleY!==1?i.rect.height*u.scaleY/l.rect.height:1},m={x:u.x-f.x,y:u.y-f.y,...p},y=o({...d,active:i,dragOverlay:l,transform:{initial:u,final:m}}),[v]=y,b=y[y.length-1];if(JSON.stringify(v)===JSON.stringify(b))return;const k=r==null?void 0:r({active:i,dragOverlay:l,...d}),E=l.node.animate(y,{duration:e,easing:n,fill:"forwards"});return new Promise(_=>{E.onfinish=()=>{k==null||k(),_()}})}}let TS=0;function eY(t){return C.useMemo(()=>{if(t!=null)return TS++,TS},[t])}const tY=te.memo(t=>{let{adjustScale:e=!1,children:n,dropAnimation:r,style:o,transition:s,modifiers:i,wrapperElement:l="div",className:u,zIndex:d=999}=t;const{activatorEvent:f,active:p,activeNodeRect:m,containerNodeRect:y,draggableNodes:v,droppableContainers:b,dragOverlay:k,over:E,measuringConfiguration:_,scrollableAncestors:T,scrollableAncestorRects:A,windowRect:N}=yM(),D=C.useContext(Zp),I=eY(p==null?void 0:p.id),P=gM(i,{activatorEvent:f,active:p,activeNodeRect:m,containerNodeRect:y,draggingNodeRect:k.rect,over:E,overlayNodeRect:k.rect,scrollableAncestors:T,scrollableAncestorRects:A,transform:D,windowRect:N}),O=hv(m),U=XZ({config:r,draggableNodes:v,droppableContainers:b,measuringConfiguration:_}),J=O?k.setRef:void 0;return te.createElement(WZ,null,te.createElement(HZ,{animation:U},p&&I?te.createElement(GZ,{key:I,id:p.id,ref:J,as:l,activatorEvent:f,adjustScale:e,className:u,transition:s,rect:O,style:{zIndex:d,...o},transform:P},n):null))});function nY(t,e,n){const r={...t};return e.top+t.y<=n.top?r.y=n.top-e.top:e.bottom+t.y>=n.top+n.height&&(r.y=n.top+n.height-e.bottom),e.left+t.x<=n.left?r.x=n.left-e.left:e.right+t.x>=n.left+n.width&&(r.x=n.left+n.width-e.right),r}const rY=t=>{let{containerNodeRect:e,draggingNodeRect:n,transform:r}=t;return!n||!e?r:nY(r,n,e)},oY=t=>{let{transform:e}=t;return{...e,x:0}};function Bs(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function sY(t,e){return t.reduce((n,r,o)=>{const s=e.get(r);return s&&(n[o]=s),n},Array(t.length))}function Sf(t){return t!==null&&t>=0}function iY(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function aY(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const xM=t=>{let{rects:e,activeIndex:n,overIndex:r,index:o}=t;const s=Bs(e,r,n),i=e[o],l=s[o];return!l||!i?null:{x:l.left-i.left,y:l.top-i.top,scaleX:l.width/i.width,scaleY:l.height/i.height}},Ef={scaleX:1,scaleY:1},lY=t=>{var e;let{activeIndex:n,activeNodeRect:r,index:o,rects:s,overIndex:i}=t;const l=(e=s[n])!=null?e:r;if(!l)return null;if(o===n){const d=s[i];return d?{x:0,y:n<i?d.top+d.height-(l.top+l.height):d.top-l.top,...Ef}:null}const u=uY(s,o,n);return o>n&&o<=i?{x:0,y:-l.height-u,...Ef}:o<n&&o>=i?{x:0,y:l.height+u,...Ef}:{x:0,y:0,...Ef}};function uY(t,e,n){const r=t[e],o=t[e-1],s=t[e+1];return r?n<e?o?r.top-(o.top+o.height):s?s.top-(r.top+r.height):0:s?s.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const vM="Sortable",bM=te.createContext({activeIndex:-1,containerId:vM,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:xM,disabled:{draggable:!1,droppable:!1}});function cY(t){let{children:e,id:n,items:r,strategy:o=xM,disabled:s=!1}=t;const{active:i,dragOverlay:l,droppableRects:u,over:d,measureDroppableContainers:f}=yM(),p=$c(vM,n),m=l.rect!==null,y=C.useMemo(()=>r.map(D=>typeof D=="object"&&"id"in D?D.id:D),[r]),v=i!=null,b=i?y.indexOf(i.id):-1,k=d?y.indexOf(d.id):-1,E=C.useRef(y),_=!iY(y,E.current),T=k!==-1&&b===-1||_,A=aY(s);Wr(()=>{_&&v&&f(y)},[_,y,v,f]),C.useEffect(()=>{E.current=y},[y]);const N=C.useMemo(()=>({activeIndex:b,containerId:p,disabled:A,disableTransforms:T,items:y,overIndex:k,useDragOverlay:m,sortedRects:sY(y,u),strategy:o}),[b,p,A.draggable,A.droppable,T,y,k,u,m,o]);return te.createElement(bM.Provider,{value:N},e)}const dY=t=>{let{id:e,items:n,activeIndex:r,overIndex:o}=t;return Bs(n,r,o).indexOf(e)},fY=t=>{let{containerId:e,isSorting:n,wasDragging:r,index:o,items:s,newIndex:i,previousItems:l,previousContainerId:u,transition:d}=t;return!d||!r||l!==s&&o===i?!1:n?!0:i!==o&&e===u},hY={duration:200,easing:"ease"},kM="transform",pY=ss.Transition.toString({property:kM,duration:0,easing:"linear"}),mY={roleDescription:"sortable"};function gY(t){let{disabled:e,index:n,node:r,rect:o}=t;const[s,i]=C.useState(null),l=C.useRef(n);return Wr(()=>{if(!e&&n!==l.current&&r.current){const u=o.current;if(u){const d=_l(r.current,{ignoreTransform:!0}),f={x:u.left-d.left,y:u.top-d.top,scaleX:u.width/d.width,scaleY:u.height/d.height};(f.x||f.y)&&i(f)}}n!==l.current&&(l.current=n)},[e,n,r,o]),C.useEffect(()=>{s&&i(null)},[s]),s}function wM(t){let{animateLayoutChanges:e=fY,attributes:n,disabled:r,data:o,getNewIndex:s=dY,id:i,strategy:l,resizeObserverConfig:u,transition:d=hY}=t;const{items:f,containerId:p,activeIndex:m,disabled:y,disableTransforms:v,sortedRects:b,overIndex:k,useDragOverlay:E,strategy:_}=C.useContext(bM),T=yY(r,y),A=f.indexOf(i),N=C.useMemo(()=>({sortable:{containerId:p,index:A,items:f},...o}),[p,o,A,f]),D=C.useMemo(()=>f.slice(f.indexOf(i)),[f,i]),{rect:I,node:P,isOver:O,setNodeRef:U}=VZ({id:i,data:N,disabled:T.droppable,resizeObserverConfig:{updateMeasurementsFor:D,...u}}),{active:J,activatorEvent:K,activeNodeRect:q,attributes:Z,setNodeRef:Q,listeners:G,isDragging:Y,over:W,setActivatorNodeRef:ee,transform:z}=FZ({id:i,data:N,attributes:{...mY,...n},disabled:T.draggable}),j=SJ(U,Q),B=!!J,ne=B&&!v&&Sf(m)&&Sf(k),fe=!E&&Y,ue=fe&&ne?z:null,Ae=ne?ue??(l??_)({rects:b,activeNodeRect:q,activeIndex:m,overIndex:k,index:A}):null,X=Sf(m)&&Sf(k)?s({id:i,items:f,activeIndex:m,overIndex:k}):A,ce=J==null?void 0:J.id,pe=C.useRef({activeId:ce,items:f,newIndex:X,containerId:p}),Le=f!==pe.current.items,Ne=e({active:J,containerId:p,isDragging:Y,isSorting:B,id:i,index:A,items:f,newIndex:pe.current.newIndex,previousItems:pe.current.items,previousContainerId:pe.current.containerId,transition:d,wasDragging:pe.current.activeId!=null}),$e=gY({disabled:!Ne,index:A,node:P,rect:I});return C.useEffect(()=>{B&&pe.current.newIndex!==X&&(pe.current.newIndex=X),p!==pe.current.containerId&&(pe.current.containerId=p),f!==pe.current.items&&(pe.current.items=f)},[B,X,p,f]),C.useEffect(()=>{if(ce===pe.current.activeId)return;if(ce!=null&&pe.current.activeId==null){pe.current.activeId=ce;return}const Mt=setTimeout(()=>{pe.current.activeId=ce},50);return()=>clearTimeout(Mt)},[ce]),{active:J,activeIndex:m,attributes:Z,data:N,rect:I,index:A,newIndex:X,items:f,isOver:O,isSorting:B,isDragging:Y,listeners:G,node:P,overIndex:k,over:W,setNodeRef:j,setActivatorNodeRef:ee,setDroppableNodeRef:U,setDraggableNodeRef:Q,transform:$e??Ae,transition:Ze()};function Ze(){if($e||Le&&pe.current.newIndex===A)return pY;if(!(fe&&!Kp(K)||!d)&&(B||Ne))return ss.Transition.toString({...d,property:kM})}}function yY(t,e){var n,r;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(n=t==null?void 0:t.draggable)!=null?n:e.draggable,droppable:(r=t==null?void 0:t.droppable)!=null?r:e.droppable}}function Qh(t){if(!t)return!1;const e=t.data.current;return!!(e&&"sortable"in e&&typeof e.sortable=="object"&&"containerId"in e.sortable&&"items"in e.sortable&&"index"in e.sortable)}const xY=[Je.Down,Je.Right,Je.Up,Je.Left],vY=(t,e)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:s,over:i,scrollableAncestors:l}}=e;if(xY.includes(t.code)){if(t.preventDefault(),!n||!r)return;const u=[];s.getEnabled().forEach(p=>{if(!p||p!=null&&p.disabled)return;const m=o.get(p.id);if(m)switch(t.code){case Je.Down:r.top<m.top&&u.push(p);break;case Je.Up:r.top>m.top&&u.push(p);break;case Je.Left:r.left>m.left&&u.push(p);break;case Je.Right:r.left<m.left&&u.push(p);break}});const d=VJ({collisionRect:r,droppableRects:o,droppableContainers:u});let f=tM(d,"id");if(f===(i==null?void 0:i.id)&&d.length>1&&(f=d[1].id),f!=null){const p=s.get(n.id),m=s.get(f),y=m?o.get(m.id):null,v=m==null?void 0:m.node.current;if(v&&y&&p&&m){const k=Gp(v).some((D,I)=>l[I]!==D),E=CM(p,m),_=bY(p,m),T=k||!E?{x:0,y:0}:{x:_?r.width-y.width:0,y:_?r.height-y.height:0},A={x:y.left,y:y.top};return T.x&&T.y?A:hc(A,T)}}}};function CM(t,e){return!Qh(t)||!Qh(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function bY(t,e){return!Qh(t)||!Qh(e)||!CM(t,e)?!1:t.data.current.sortable.index<e.data.current.sortable.index}const pv=C.forwardRef(({label:t,className:e,...n},r)=>x.jsx(ze,{ref:r,type:"button",variant:"ghost",size:"icon-xs","aria-label":t,title:t,className:De("cursor-grab touch-none text-muted-foreground/50 hover:bg-transparent hover:text-foreground active:cursor-grabbing",e),...n,children:x.jsx(rx,{})}));pv.displayName="DragHandle";function SM({ids:t,onReorder:e,renderOverlay:n,children:r}){const[o,s]=C.useState(null),i=zJ(pS(fv,{activationConstraint:{distance:4}}),pS(cv,{coordinateGetter:vY})),l=d=>t.indexOf(String(d))+1,u={onDragStart:()=>"Öğe kaldırıldı. Ok tuşlarıyla taşı, boşluk tuşuyla bırak.",onDragOver:({over:d})=>d?`${l(d.id)}. sıraya taşınıyor.`:"Öğe listenin dışında.",onDragEnd:({over:d})=>d?`${l(d.id)}. sıraya bırakıldı.`:"Öğe eski yerine döndü.",onDragCancel:()=>"Taşıma iptal edildi."};return x.jsxs(jZ,{accessibility:{announcements:u},sensors:i,collisionDetection:BJ,modifiers:[oY,rY],onDragStart:({active:d})=>s(String(d.id)),onDragCancel:()=>s(null),onDragEnd:({active:d,over:f})=>{if(s(null),!f||d.id===f.id)return;const p=t.indexOf(String(d.id)),m=t.indexOf(String(f.id));p<0||m<0||e(p,m)},children:[x.jsx(cY,{items:t,strategy:lY,children:r}),x.jsx(tY,{children:o?n(o):null})]})}function pl({className:t,size:e="default",...n}){return x.jsx("div",{"data-slot":"card","data-size":e,className:De("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",t),...n})}function mc({className:t,...e}){return x.jsx("div",{"data-slot":"card-header",className:De("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",t),...e})}function py({className:t,...e}){return x.jsx("div",{"data-slot":"card-title",className:De("font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",t),...e})}function my({className:t,...e}){return x.jsx("div",{"data-slot":"card-description",className:De("text-sm text-muted-foreground",t),...e})}function ml({className:t,...e}){return x.jsx("div",{"data-slot":"card-content",className:De("px-(--card-spacing)",t),...e})}function ep({className:t,...e}){return x.jsx("div",{"data-slot":"card-footer",className:De("flex items-center rounded-b-xl border-t bg-muted/50 p-(--card-spacing)",t),...e})}async function _o(t){if(!t.ok)throw new Error(`İstek başarısız: ${t.status}`);return t}async function kY(){return(await _o(await fetch("/api/_project"))).json()}async function MS(){return(await _o(await fetch("/api/_schema"))).json()}async function wY(){return(await(await _o(await fetch("/api/_templates"))).json()).items}async function CY(t){const e=await fetch("/api/_init",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({template:t})});if(!e.ok){const n=await e.json().catch(()=>({}));throw new Error(n.error??`Template uygulanamadı: ${e.status}`)}}async function EM(t){const e=await fetch("/api/_import",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({raw:t})});if(!e.ok){const n=await e.json().catch(()=>({}));throw new Error(n.error??`İçe aktarılamadı: ${e.status}`)}}const SY="/api/_export";function EY(){const t=document.createElement("a");t.href=SY,t.download="justjson-export.zip",document.body.appendChild(t),t.click(),t.remove()}async function _M(t){const e=await fetch("/api/_schema",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(t)});if(!e.ok){const n=await e.json().catch(()=>({}));throw new Error(n.error??`Şema kaydedilemedi: ${e.status}`)}}async function mv(t){return(await(await _o(await fetch(`/api/${encodeURIComponent(t)}`))).json()).items}async function _Y(t){return(await mv(t)).map(e=>e.slug)}async function gy(t,e){const n=await fetch(`/api/${encodeURIComponent(t)}/${encodeURIComponent(e)}`);return n.status===404?null:(await _o(n),n.json())}async function TY(t,e,n){return(await(await _o(await fetch(`/api/${encodeURIComponent(t)}/${encodeURIComponent(e)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(n)}))).json()).slug}async function MY(t,e){await _o(await fetch(`/api/${encodeURIComponent(t)}/${encodeURIComponent(e)}`,{method:"DELETE"}))}async function AY(t,e){return(await(await _o(await fetch("/api/_media",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({dataBase64:t,filename:e})}))).json()).path}async function TM(t){return(await _o(await fetch(`/api/_singleton/${encodeURIComponent(t)}`))).json()}async function NY(t,e){await _o(await fetch(`/api/_singleton/${encodeURIComponent(t)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(e)}))}async function MM(t,e,n){const r=await fetch("/api/_ai/generate",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({...t,system:e,prompt:n})}),o=await r.json();if(!r.ok||!o.text)throw new Error(o.error||`AI isteği başarısız (${r.status})`);return o.text}async function DY(t){const e=await fetch("/api/_ai/models",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),n=await e.json();if(!e.ok||!n.models)throw new Error(n.error||`Modeller alınamadı (${e.status})`);return n.models}const AM=[{type:"text",label:"Metin",desc:"Tek satır metin",icon:y9},{type:"richtext",label:"Zengin metin",desc:"Markdown içerik",icon:ZE},{type:"number",label:"Sayı",desc:"Sayısal değer",icon:bj},{type:"boolean",label:"Evet / Hayır",desc:"Doğru veya yanlış",icon:h9},{type:"date",label:"Tarih",desc:"Takvim tarihi",icon:VP},{type:"select",label:"Seçim",desc:"Sabit seçenekler listesi",icon:e_},{type:"relation",label:"İlişki",desc:"Başka koleksiyona bağla",icon:QE},{type:"image",label:"Görsel",desc:"Resim URL veya yolu",icon:XE}],gv=Object.fromEntries(AM.map(t=>[t.type,t]));let AS=0;function sa(t){return AS+=1,`${t}${AS}`}function Jg(t){return JSON.parse(JSON.stringify(t))}function RY(t){const e=(n,r)=>n.map(o=>({id:sa(r),fields:o.fields.map(()=>sa("f"))}));return{collections:e(t.collections,"c"),singletons:e(t.singletons,"s")}}function OY(t){const e=n=>n.map(r=>({id:r.id,fields:[...r.fields]}));return{collections:e(t.collections),singletons:e(t.singletons)}}function IY(t,e){const n=(r,o,s)=>r.map((i,l)=>{const u=o[l];return{id:(u==null?void 0:u.id)??sa(s),fields:i.fields.map((d,f)=>(u==null?void 0:u.fields[f])??sa("f"))}});return{collections:n(t.collections,e.collections,"c"),singletons:n(t.singletons,e.singletons,"s")}}function yv(t,e){let n=1;for(;e.includes(`${t}${n}`);)n+=1;return`${t}${n}`}function Zg(t,e){const n=yv("koleksiyon",t.collections.map(r=>r.name));t.collections.push({name:n,label:"Yeni koleksiyon",path:n,fields:[]}),e.collections.push({id:sa("c"),fields:[]})}function Yg(t,e){const n=yv("tekil",t.singletons.map(r=>r.name));t.singletons.push({name:n,label:"Yeni tekil",path:`${n}.json`,fields:[]}),e.singletons.push({id:sa("s"),fields:[]})}function PY({schema:t,onSaved:e,onBrowseTemplates:n,initialAdd:r}){const[o,s]=C.useState(()=>{const O=Jg(t),U=RY(O);return r==="collection"?Zg(O,U):r==="singleton"&&Yg(O,U),{schema:O,ids:U}}),[i,l]=C.useState(()=>{const O=[...o.ids.collections,...o.ids.singletons];return O.length<=5?{}:Object.fromEntries(O.map(U=>[U.id,!0]))}),[u,d]=C.useState(!1),[f,p]=C.useState(null),[m,y]=C.useState(null),v=o.schema,b=o.ids,k=v.collections.map(O=>O.name),E=O=>s(U=>{const J=Jg(U.schema);return O(J),{schema:J,ids:U.ids}}),_=O=>s(U=>{const J=Jg(U.schema),K=OY(U.ids);return O(J,K),{schema:J,ids:IY(J,K)}}),T=(O,U)=>l(J=>({...J,[O]:U})),A=(O,U)=>l(J=>{const K={...J};for(const q of O)K[q.id]=U;return K}),N=v.collections.length===0&&v.singletons.length===0,D=O=>{m&&(_((U,J)=>{var Q;const K=m.kind==="collection"?U.collections:U.singletons,q=m.kind==="collection"?J.collections:J.singletons,Z=K[m.ci];if(Z)if(m.fi===null){const G=yv("alan",Z.fields.map(Y=>Y.key));Z.fields.push({key:G,label:"",type:O}),(Q=q[m.ci])==null||Q.fields.push(sa("f"))}else{const G=Z.fields[m.fi];if(!G)return;G.type=O,O!=="select"&&(G.options=void 0),O!=="relation"&&(G.to=void 0)}}),y(null))},I=async()=>{p(null),d(!0);try{await _M(v),e()}catch(O){p(O.message)}finally{d(!1)}},P=O=>{const U=O==="collection"?v.collections:v.singletons,J=O==="collection"?b.collections:b.singletons;return x.jsx(SM,{ids:J.map(K=>K.id),onReorder:(K,q)=>_((Z,Q)=>{O==="collection"?(Z.collections=Bs(Z.collections,K,q),Q.collections=Bs(Q.collections,K,q)):(Z.singletons=Bs(Z.singletons,K,q),Q.singletons=Bs(Q.singletons,K,q))}),renderOverlay:K=>{const q=J.findIndex(Q=>Q.id===K),Z=U[q];return Z?x.jsx(FY,{container:Z}):null},children:U.map((K,q)=>{const Z=J[q];return Z?x.jsx(LY,{id:Z.id,container:K,kind:O,collectionNames:k,fieldIds:Z.fields,collapsed:i[Z.id]??!1,onToggleCollapse:()=>T(Z.id,!i[Z.id]),onChange:Q=>E(G=>{const W=(O==="collection"?G.collections:G.singletons)[q];W&&Q(W)}),onRemove:()=>_((Q,G)=>{O==="collection"?(Q.collections.splice(q,1),G.collections.splice(q,1)):(Q.singletons.splice(q,1),G.singletons.splice(q,1))}),onRemoveField:Q=>_((G,Y)=>{var z,j;const W=O==="collection"?G.collections:G.singletons,ee=O==="collection"?Y.collections:Y.singletons;(z=W[q])==null||z.fields.splice(Q,1),(j=ee[q])==null||j.fields.splice(Q,1)}),onReorderFields:(Q,G)=>_((Y,W)=>{const ee=O==="collection"?Y.collections:Y.singletons,z=O==="collection"?W.collections:W.singletons,j=ee[q],B=z[q];!j||!B||(j.fields=Bs(j.fields,Q,G),B.fields=Bs(B.fields,Q,G))}),onAddField:()=>y({kind:O,ci:q,fi:null}),onChangeType:Q=>y({kind:O,ci:q,fi:Q})},Z.id):null})})};return x.jsxs("div",{className:"flex h-full flex-col",children:[x.jsx("header",{className:"sticky top-0 z-10 shrink-0 border-b bg-card px-8 py-4",children:x.jsxs("div",{className:"mx-auto flex w-full max-w-4xl items-center justify-between",children:[x.jsxs("div",{children:[x.jsx("h1",{className:"font-heading text-lg font-semibold text-foreground",children:"Şema"}),x.jsx("p",{className:"text-sm text-muted-foreground",children:"Koleksiyonlarını ve alanlarını tasarla."})]}),x.jsxs(ze,{type:"button",onClick:I,disabled:u,children:[x.jsx(Qy,{}),u?"Kaydediliyor…":"Şemayı kaydet"]})]})}),x.jsx("div",{className:"flex-1 overflow-y-auto px-8 py-6",children:x.jsxs("div",{className:"mx-auto w-full max-w-4xl",children:[f&&x.jsx("p",{className:"mb-5 rounded-lg border border-destructive/20 bg-destructive/10 px-4 py-3 text-sm text-destructive",children:f}),N?x.jsx(jY,{onAddCollection:()=>_(Zg),onAddSingleton:()=>_(Yg),onBrowseTemplates:n}):x.jsxs("div",{className:"space-y-10",children:[x.jsx(NS,{title:"Koleksiyonlar",hint:"Çok kayıtlı içerik (yazılar, ürünler…)",onAdd:()=>_(Zg),allCollapsed:b.collections.length>0&&b.collections.every(O=>i[O.id]),onToggleAll:b.collections.length>1?O=>A(b.collections,O):void 0,children:P("collection")}),x.jsx(NS,{title:"Tekil",hint:"Tek kayıt (site ayarları, profil…)",onAdd:()=>_(Yg),allCollapsed:b.singletons.length>0&&b.singletons.every(O=>i[O.id]),onToggleAll:b.singletons.length>1?O=>A(b.singletons,O):void 0,children:P("singleton")})]})]})}),x.jsx(HY,{open:m!==null,onPick:D,onClose:()=>y(null)})]})}function NS({title:t,hint:e,onAdd:n,allCollapsed:r,onToggleAll:o,children:s}){return x.jsxs("section",{children:[x.jsxs("div",{className:"mb-3 flex items-end justify-between gap-3",children:[x.jsxs("div",{children:[x.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:t}),x.jsx("p",{className:"text-xs text-muted-foreground/70",children:e})]}),x.jsxs("div",{className:"flex items-center gap-1.5",children:[o&&x.jsxs(ze,{type:"button",variant:"ghost",size:"sm",onClick:()=>o(!r),className:"text-muted-foreground",children:[r?x.jsx(JE,{}):x.jsx(JP,{}),r?"Tümünü genişlet":"Tümünü daralt"]}),x.jsxs(ze,{type:"button",variant:"outline",size:"sm",onClick:n,children:[x.jsx(Qi,{})," Ekle"]})]})]}),x.jsx("div",{className:"space-y-3",children:s})]})}function jY({onAddCollection:t,onAddSingleton:e,onBrowseTemplates:n}){return x.jsx(pl,{className:"mx-auto max-w-md",children:x.jsxs(ml,{className:"flex flex-col items-center px-8 py-10 text-center",children:[x.jsx("div",{className:"mb-4 flex size-14 items-center justify-center rounded-2xl bg-primary/10 text-primary",children:x.jsx(vp,{className:"size-7"})}),x.jsx("h2",{className:"font-heading text-lg font-semibold text-foreground",children:"Şeman boş"}),x.jsx("p",{className:"mt-1.5 text-sm text-muted-foreground",children:"Koleksiyon, içeriğinin bir tipini tanımlar — yazılar, ürünler, projeler. İlkini ekleyerek başla."}),x.jsxs(ze,{type:"button",size:"lg",onClick:t,className:"mt-6",children:[x.jsx(Qi,{})," Koleksiyon ekle"]}),x.jsxs("div",{className:"mt-3 flex items-center gap-3 text-sm",children:[x.jsx(ze,{type:"button",variant:"link",onClick:e,className:"h-auto p-0 text-muted-foreground hover:text-foreground",children:"Tekil kayıt ekle"}),n&&x.jsxs(x.Fragment,{children:[x.jsx("span",{className:"text-border",children:"·"}),x.jsx(ze,{type:"button",variant:"link",onClick:n,className:"h-auto p-0",children:"veya bir template’den başla"})]})]})]})})}function LY({id:t,...e}){const{attributes:n,listeners:r,setNodeRef:o,setActivatorNodeRef:s,transform:i,transition:l,isDragging:u}=wM({id:t});return x.jsx("div",{ref:o,style:{transform:ss.Translate.toString(i),transition:l},className:De(u&&"opacity-40"),children:x.jsx(zY,{...e,dragHandle:x.jsx(pv,{ref:s,label:"Sürükleyerek sırala",...n,...r})})})}function zY({container:t,kind:e,collectionNames:n,fieldIds:r,collapsed:o,onToggleCollapse:s,onChange:i,onRemove:l,onRemoveField:u,onReorderFields:d,onAddField:f,onChangeType:p,dragHandle:m}){const y=b=>{const k=ux(b);i(E=>{E.name=k,E.path=e==="collection"?k:`${k}.json`})},v=t.fields.length;return x.jsxs(pl,{className:"gap-0 overflow-hidden py-0 shadow-sm",children:[x.jsxs(mc,{className:De("relative grid grid-cols-[1.5rem_1.75rem_minmax(0,1fr)_auto_1.75rem] items-center gap-2 bg-muted/40 px-4 py-3",!o&&"border-b"),children:[x.jsx("button",{type:"button","aria-hidden":"true",tabIndex:-1,onClick:s,className:"absolute inset-0 cursor-pointer"}),x.jsx("div",{className:"relative opacity-0 transition group-focus-within/card:opacity-100 group-hover/card:opacity-100 focus-within:opacity-100",children:m}),x.jsx(ze,{type:"button",variant:"ghost",size:"icon-sm",onClick:s,"aria-expanded":!o,"aria-label":o?"Genişlet":"Daralt",className:"relative text-muted-foreground",children:x.jsx(ex,{className:De("transition-transform",o&&"-rotate-90")})}),x.jsx(ar,{className:"relative h-8 border-transparent bg-transparent font-medium shadow-none focus-visible:border-input focus-visible:bg-background",value:t.label??"",placeholder:e==="collection"?"Koleksiyon adı":"Tekil ad",onChange:b=>i(k=>{k.label=b.target.value})}),x.jsxs("div",{className:"relative flex items-center gap-2",children:[o&&x.jsxs("span",{className:"whitespace-nowrap rounded-full bg-foreground/5 px-2 py-0.5 text-xs text-muted-foreground",children:[v," alan"]}),x.jsx(ar,{className:"h-8 w-40 border-transparent bg-transparent font-mono text-xs text-primary hover:border-input focus-visible:bg-background",value:t.name,placeholder:"api-adi",onChange:b=>y(b.target.value)})]}),x.jsx(NM,{label:"Sil",danger:!0,onClick:l,className:"relative",children:x.jsx(n_,{})})]}),!o&&x.jsxs(x.Fragment,{children:[x.jsxs(ml,{className:"px-0",children:[v===0&&x.jsx("p",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:"Henüz alan yok. Aşağıdan ilk alanı ekle."}),x.jsx(SM,{ids:r,onReorder:d,renderOverlay:b=>{const k=r.indexOf(b),E=t.fields[k];return E?x.jsx(VY,{field:E}):null},children:x.jsx("div",{className:"divide-y divide-border/60",children:t.fields.map((b,k)=>{const E=r[k];return E?x.jsx($Y,{id:E,field:b,collectionNames:n,onChange:_=>i(T=>_(T.fields[k])),onRemove:()=>u(k),onChangeType:()=>p(k)},E):null})})})]}),x.jsxs(ze,{type:"button",variant:"ghost",onClick:f,className:"h-11 w-full justify-center gap-1.5 rounded-none border-t text-primary hover:bg-primary/5 hover:text-primary",children:[x.jsx(Qi,{})," Alan ekle"]})]})]})}function FY({container:t}){return x.jsxs("div",{className:"flex scale-[1.01] items-center gap-2 rounded-xl bg-card px-4 py-3 shadow-lg ring-2 ring-primary/40",children:[x.jsx(rx,{className:"size-4 shrink-0 text-muted-foreground"}),x.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:t.label||t.name}),x.jsx("span",{className:"truncate font-mono text-xs text-primary",children:t.name}),x.jsxs("span",{className:"ml-auto shrink-0 text-xs text-muted-foreground",children:[t.fields.length," alan"]})]})}function $Y({id:t,...e}){const{attributes:n,listeners:r,setNodeRef:o,setActivatorNodeRef:s,transform:i,transition:l,isDragging:u}=wM({id:t});return x.jsx(BY,{...e,rowRef:o,style:{transform:ss.Translate.toString(i),transition:l},dragging:u,dragHandle:x.jsx(pv,{ref:s,label:"Sürükleyerek sırala",...n,...r})})}function BY({field:t,collectionNames:e,onChange:n,onRemove:r,onChangeType:o,rowRef:s,style:i,dragging:l,dragHandle:u}){const d=gv[t.type],f=d.icon,p="opacity-0 transition group-focus-within/row:opacity-100 group-hover/row:opacity-100 focus-within:opacity-100";return x.jsxs("div",{ref:s,style:i,className:De("group/row grid grid-cols-[1.5rem_2rem_minmax(0,1fr)_7rem_4.5rem_1.75rem] items-center gap-2 bg-card px-4 py-2.5 md:grid-cols-[1.5rem_2rem_minmax(0,1fr)_10rem_4.5rem_1.75rem]",l&&"opacity-40"),children:[x.jsx("div",{className:p,children:u}),x.jsxs(sx,{children:[x.jsx(ix,{asChild:!0,children:x.jsx(ze,{type:"button",variant:"ghost",size:"icon",onClick:o,"aria-label":"Tipi değiştir",className:"bg-primary/10 text-primary hover:bg-primary/15 hover:text-primary",children:x.jsx(f,{})})}),x.jsxs(ax,{children:[d.label," · tipi değiştir"]})]}),x.jsx(ar,{className:"h-8 border-transparent bg-transparent font-medium shadow-none focus-visible:border-input focus-visible:bg-background",value:t.label??"",placeholder:"Alan adı",onChange:m=>n(y=>{y.label=m.target.value})}),x.jsx(ar,{className:"h-8 border-transparent bg-transparent font-mono text-xs text-muted-foreground hover:border-input focus-visible:bg-background focus-visible:text-foreground",value:t.key,placeholder:"anahtar",onChange:m=>n(y=>{y.key=ux(m.target.value)})}),x.jsx(ze,{type:"button",size:"xs",variant:t.required?"default":"ghost","aria-pressed":t.required??!1,title:t.required?"Zorunlu alan":"Zorunlu yap",onClick:()=>n(m=>{m.required=!m.required}),className:De("w-full rounded-full",!t.required&&`border-dashed border-border text-muted-foreground ${p}`),children:"Zorunlu"}),x.jsx(NM,{label:"Sil",danger:!0,onClick:r,className:p,children:x.jsx(bp,{})}),t.type==="select"&&x.jsx(ar,{className:"col-start-3 col-end-[-1] row-start-2 mt-1",value:(t.options??[]).join(", "),placeholder:"seçenekler (virgülle ayır)",onChange:m=>n(y=>{y.options=m.target.value.split(",").map(v=>v.trim()).filter(Boolean)})}),t.type==="relation"&&x.jsx("div",{className:"col-start-3 col-end-[-1] row-start-2 mt-1",children:x.jsxs(Wf,{value:t.to||void 0,onValueChange:m=>n(y=>{y.to=m}),children:[x.jsx(Kf,{className:"w-full",children:x.jsx(qf,{placeholder:"hedef koleksiyon seç…"})}),x.jsx(Gf,{children:e.map(m=>x.jsx(Jf,{value:m,children:m},m))})]})})]})}function VY({field:t}){const e=gv[t.type],n=e.icon;return x.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-card px-4 py-2.5 shadow-lg ring-2 ring-primary/40",children:[x.jsx(rx,{className:"size-4 shrink-0 text-muted-foreground"}),x.jsx("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:x.jsx(n,{className:"size-4"})}),x.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:t.label||e.label}),x.jsx("span",{className:"ml-auto shrink-0 font-mono text-xs text-muted-foreground",children:t.key})]})}function HY({open:t,onPick:e,onClose:n}){return x.jsx(wc,{open:t,onOpenChange:r=>{r||n()},children:x.jsxs(Cc,{className:"sm:max-w-lg",children:[x.jsxs(Sc,{children:[x.jsx(Ec,{children:"Alan tipi seç"}),x.jsx(_c,{children:"Bu alanın hangi türde veri tutacağını belirle."})]}),x.jsx("div",{className:"grid grid-cols-2 gap-2.5",children:AM.map(({type:r,label:o,desc:s,icon:i})=>x.jsxs("button",{type:"button",onClick:()=>e(r),className:"flex items-start gap-3 rounded-xl border p-3 text-left outline-none transition-colors hover:border-primary hover:bg-primary/5 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50",children:[x.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:x.jsx(i,{className:"size-4"})}),x.jsxs("span",{children:[x.jsx("span",{className:"block text-sm font-medium text-foreground",children:o}),x.jsx("span",{className:"block text-xs text-muted-foreground",children:s})]})]},r))})]})})}function NM({children:t,label:e,danger:n,onClick:r,className:o}){return x.jsxs(sx,{children:[x.jsx(ix,{asChild:!0,children:x.jsx(ze,{type:"button",variant:"ghost",size:"icon-sm",onClick:r,"aria-label":e,className:De("text-muted-foreground",n&&"hover:bg-destructive/10 hover:text-destructive",o),children:t})}),x.jsx(ax,{children:e})]})}function xv({className:t,...e}){return x.jsx("textarea",{"data-slot":"textarea",className:De("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",t),...e})}const yy={gemini:{id:"gemini",label:"Google Gemini",hint:"Ücretsiz katmanı var — kendi Gemini API key’ini kullan.",modelPlaceholder:"gemini-2.0-flash",keyUrl:"https://aistudio.google.com/apikey"},groq:{id:"groq",label:"Groq",hint:"Ücretsiz katmanı var — hızlı açık modeller.",modelPlaceholder:"llama-3.3-70b-versatile",keyUrl:"https://console.groq.com/keys"},openrouter:{id:"openrouter",label:"OpenRouter",hint:"Birçok ücretsiz model (isimleri :free ile biter).",modelPlaceholder:"meta-llama/llama-3.3-70b-instruct:free",keyUrl:"https://openrouter.ai/keys"},custom:{id:"custom",label:"Özel (OpenAI uyumlu)",hint:"Kendi sunucun ya da Ollama gibi yerel bir servis.",modelPlaceholder:"llama3.1",needsBaseUrl:!0,keyUrl:""}},UY=Object.values(yy),vv="jj-ai-config";function WY(){try{const t=localStorage.getItem(vv);if(!t)return null;const e=JSON.parse(t);return!e.provider||!e.model||!e.apiKey?null:e}catch{return null}}function qY(t){localStorage.setItem(vv,JSON.stringify(t))}function KY(){localStorage.removeItem(vv)}const DM=C.createContext(null);function bv(){const t=C.useContext(DM);if(!t)throw new Error("useAiSettings, AiSettingsProvider içinde kullanılmalı");return t}function GY({children:t}){const[e,n]=C.useState(()=>WY()),[r,o]=C.useState(!1),[s,i]=C.useState((e==null?void 0:e.provider)??"gemini"),[l,u]=C.useState((e==null?void 0:e.model)??""),[d,f]=C.useState((e==null?void 0:e.apiKey)??""),[p,m]=C.useState((e==null?void 0:e.baseUrl)??""),[y,v]=C.useState([]),[b,k]=C.useState(!1),[E,_]=C.useState(!1),T=C.useMemo(()=>yy[s],[s]),A=()=>{i((e==null?void 0:e.provider)??"gemini"),u((e==null?void 0:e.model)??""),f((e==null?void 0:e.apiKey)??""),m((e==null?void 0:e.baseUrl)??""),v([]),_(!1),o(!0)},N=O=>{i(O),u(""),v([]),_(!1)},D=async()=>{var U;const O=yy[s];if(!O.needsBaseUrl&&!d.trim()){Zt.error("Önce API key gir");return}if(O.needsBaseUrl&&!p.trim()){Zt.error("Önce taban URL gir");return}k(!0);try{const J=await DY({provider:s,apiKey:d.trim(),...O.needsBaseUrl?{baseUrl:p.trim()}:{}});if(J.length===0){_(!0),Zt.error("Model bulunamadı — elle girebilirsin");return}v(J),_(!1),J.some(K=>K.id===l)||u(((U=J[0])==null?void 0:U.id)??"")}catch(J){_(!0),Zt.error(J.message)}finally{k(!1)}},I=()=>{if(!l.trim()){Zt.error("Model adı gerekli");return}if(T.needsBaseUrl&&!p.trim()){Zt.error("Taban URL gerekli");return}if(!T.needsBaseUrl&&!d.trim()){Zt.error("API key gerekli");return}const O={provider:s,model:l.trim(),apiKey:d.trim(),...T.needsBaseUrl?{baseUrl:p.trim()}:{}};qY(O),n(O),o(!1),Zt.success("AI ayarları kaydedildi")},P=()=>{KY(),n(null),f(""),u(""),Zt.success("AI bağlantısı kaldırıldı")};return x.jsxs(DM.Provider,{value:{config:e,openSettings:A},children:[t,x.jsx(wc,{open:r,onOpenChange:o,children:x.jsxs(Cc,{children:[x.jsxs(Sc,{children:[x.jsxs(Ec,{className:"flex items-center gap-2",children:[x.jsx(Dj,{className:"h-4 w-4 text-primary"})," AI ayarları"]}),x.jsx(_c,{children:"Tamamen opsiyonel. Girdiğin key yalnızca bu tarayıcıda saklanır ve doğrudan sağlayıcıya gider — bize hiçbir şey ulaşmaz."})]}),x.jsxs("div",{className:"space-y-4",children:[x.jsxs("div",{className:"space-y-2",children:[x.jsx(pu,{children:"Sağlayıcı"}),x.jsxs(Wf,{value:s,onValueChange:O=>N(O),children:[x.jsx(Kf,{className:"w-full",children:x.jsx(qf,{})}),x.jsx(Gf,{children:UY.map(O=>x.jsx(Jf,{value:O.id,children:O.label},O.id))})]}),x.jsx("p",{className:"text-xs text-muted-foreground",children:T.hint})]}),T.needsBaseUrl&&x.jsxs("div",{className:"space-y-2",children:[x.jsx(pu,{children:"Taban URL"}),x.jsx(ar,{value:p,onChange:O=>m(O.target.value),placeholder:"http://localhost:11434/v1",className:"font-mono"})]}),x.jsxs("div",{className:"space-y-2",children:[x.jsxs(pu,{children:["API key",T.needsBaseUrl&&x.jsx("span",{className:"ml-1 font-normal text-muted-foreground",children:"(opsiyonel)"})]}),x.jsx(ar,{type:"password",value:d,onChange:O=>f(O.target.value),placeholder:"••••••••••••",className:"font-mono"}),T.keyUrl&&x.jsx("a",{href:T.keyUrl,target:"_blank",rel:"noreferrer",className:"inline-block text-xs text-primary hover:underline",children:"Ücretsiz key al →"})]}),x.jsxs("div",{className:"space-y-2",children:[x.jsx(pu,{children:"Model"}),E?x.jsx(ar,{value:l,onChange:O=>u(O.target.value),placeholder:T.modelPlaceholder,className:"font-mono"}):y.length===0?x.jsx(ze,{type:"button",variant:"outline",className:"w-full",onClick:D,disabled:b,children:b?x.jsxs(x.Fragment,{children:[x.jsx(Xi,{className:"animate-spin"})," Modeller yükleniyor…"]}):"Modelleri yükle"}):x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsxs(Wf,{value:l,onValueChange:u,children:[x.jsx(Kf,{className:"w-full font-mono",children:x.jsx(qf,{placeholder:"Model seç…"})}),x.jsx(Gf,{children:y.map(O=>x.jsx(Jf,{value:O.id,className:"font-mono",children:O.label},O.id))})]}),x.jsxs(ze,{type:"button",variant:"ghost",size:"icon-sm",onClick:D,disabled:b,title:"Modelleri yenile",className:"text-muted-foreground",children:[b?x.jsx(Xi,{className:"animate-spin"}):x.jsx(Xj,{}),x.jsx("span",{className:"sr-only",children:"Modelleri yenile"})]})]}),!E&&y.length>0&&x.jsx("button",{type:"button",onClick:()=>_(!0),className:"text-xs text-muted-foreground hover:text-primary",children:"Modeli elle gir"})]})]}),x.jsxs(wp,{className:"sm:justify-between",children:[e?x.jsx(ze,{variant:"ghost",onClick:P,className:"text-muted-foreground",children:"Bağlantıyı kaldır"}):x.jsx("span",{}),x.jsxs("div",{className:"flex gap-2",children:[x.jsx(kp,{asChild:!0,children:x.jsx(ze,{variant:"outline",children:"Vazgeç"})}),x.jsx(ze,{onClick:I,children:"Kaydet"})]})]})]})})]})}const JY={blog:$j,cv:w9,portfolio:Oj,docs:jP,changelog:e9,recipe:WP,event:$P,catalog:c9};function ZY(t){const e=[];return t.collections.length&&e.push(`${t.collections.length} koleksiyon`),t.singletons.length&&e.push(`${t.singletons.length} tekil`),e.join(" · ")}function YY(){return x.jsxs(pl,{className:"h-full",children:[x.jsxs(mc,{children:[x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsx("div",{className:"size-10 shrink-0 animate-pulse rounded-lg bg-muted"}),x.jsx("div",{className:"h-4 w-28 animate-pulse rounded bg-muted"})]}),x.jsx("div",{className:"mt-2 h-3 w-full animate-pulse rounded bg-muted"}),x.jsx("div",{className:"mt-1.5 h-3 w-2/3 animate-pulse rounded bg-muted"})]}),x.jsxs(ml,{className:"flex-1 space-y-1.5",children:[x.jsx("div",{className:"h-8 animate-pulse rounded-md bg-muted"}),x.jsx("div",{className:"h-8 animate-pulse rounded-md bg-muted"})]}),x.jsx(ep,{children:x.jsx("div",{className:"h-9 w-full animate-pulse rounded-lg bg-muted"})})]})}const XY=["Bir headless CMS için içerik şeması tasarlıyorsun.","SADECE geçerli JSON döndür — açıklama, markdown kod bloğu ya da başka metin ekleme.","Tam olarak şu şekle uy:",'{"version":1,"collections":[{"name":"ingilizce-cogul-kimlik","label":"Görünen ad","path":"ayni-kimlik","fields":[{"key":"alan_adi","label":"Görünen ad","type":"text|richtext|number|boolean|date|select|relation|image","required":true}]}],"singletons":[{"name":"ingilizce-kimlik","label":"Görünen ad","path":"isim.json","fields":[...]}]}',`Kullanıcının anlattığı içeriğe göre alan tiplerini akıllıca seç: uzun/biçimli metin için richtext, tarih için date, sabit seçenekli alan için select (bir de "options" dizisi ekle), görsel için image, başka bir koleksiyona bağlantı için relation (bir de hedef koleksiyonun name'ini "to" alanına yaz).`,"En az bir koleksiyon üret. Her koleksiyonda title/slug'a benzer bir kimlik alanı olsun.","name ve key değerleri İngilizce, kebap/snake-case, kısa olsun. label değerleri kullanıcının dilinde olsun."].join(" ");function QY(t){return t.trim().replace(/^```(?:json)?\s*/i,"").replace(/```\s*$/,"").trim()}function eX({onApplied:t,disabled:e}){const{config:n,openSettings:r}=bv(),[o,s]=C.useState(""),[i,l]=C.useState(!1),[u,d]=C.useState(null),f=async()=>{if(!n){r();return}if(o.trim()){d(null),l(!0);try{const p=await MM(n,XY,o.trim());let m;try{m=JSON.parse(QY(p))}catch{throw new Error("AI geçerli bir JSON döndürmedi, tekrar dene.")}await EM(m),t()}catch(p){d(p.message),l(!1)}}};return x.jsxs("div",{className:"mb-8 rounded-2xl border border-primary/30 bg-accent/40 p-6 sm:p-8",children:[x.jsxs("div",{className:"flex items-center justify-between gap-2",children:[x.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-primary",children:[x.jsx(Wu,{className:"size-4"})," AI ile oluştur"]}),x.jsx("button",{type:"button",onClick:r,className:"text-xs text-muted-foreground underline-offset-2 hover:text-primary hover:underline",children:n?"AI ayarları":"Sağlayıcı bağla"})]}),x.jsx("h2",{className:"mt-2 font-heading text-lg font-semibold text-foreground sm:text-xl",children:"Ne yöneteceğini anlat, şemayı senin için tasarlasın"}),x.jsx("p",{className:"mt-1.5 text-sm text-muted-foreground",children:"Kendi API key'inle çalışır — tamamen opsiyonel, hiçbir şey bize gitmez. Sadece koleksiyon ve alanları üretir; içeriği sen girersin."}),x.jsxs("div",{className:"mt-4 flex flex-col gap-3 sm:flex-row sm:items-start",children:[x.jsx(xv,{value:o,onChange:p=>{s(p.target.value),u&&d(null)},disabled:i||e,rows:2,placeholder:'Örn. "Tarif paylaştığım bir blog; kategori, zorluk seviyesi ve pişirme süresi olsun"',className:"min-h-0 flex-1 resize-none bg-card",onKeyDown:p=>{p.key==="Enter"&&(p.metaKey||p.ctrlKey)&&f()}}),x.jsx(ze,{onClick:f,disabled:i||e||!o.trim(),className:"shrink-0 sm:mt-0",children:i?x.jsxs(x.Fragment,{children:[x.jsx(Xi,{className:"animate-spin"})," Oluşturuluyor…"]}):x.jsxs(x.Fragment,{children:[x.jsx(Wu,{})," Şema oluştur"]})})]}),!n&&x.jsx("p",{className:"mt-3 text-xs text-muted-foreground",children:"Henüz bir AI sağlayıcı bağlamadın — butona basınca ayarlar açılacak."}),u&&x.jsxs("div",{className:"mt-3 flex items-start gap-2.5 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2.5 text-sm text-destructive",children:[x.jsx(nx,{className:"mt-0.5 size-4 shrink-0"}),x.jsx("span",{className:"break-words",children:u})]})]})}function tX({onApplied:t,disabled:e}){const[n,r]=C.useState(!1),[o,s]=C.useState(""),[i,l]=C.useState(null),[u,d]=C.useState(!1),f=async m=>{var v;const y=(v=m.target.files)==null?void 0:v[0];if(m.target.value="",!!y){l(null);try{s(await y.text())}catch{l("Dosya okunamadı.")}}},p=async()=>{let m;try{m=JSON.parse(o)}catch{l("Geçersiz JSON");return}const y=m&&typeof m=="object"&&"schema"in m?m.schema:m;l(null),d(!0);try{await EM(y),r(!1),t()}catch(v){l(v.message),d(!1)}};return x.jsxs(wc,{open:n,onOpenChange:m=>{r(m),!m&&!u&&(s(""),l(null))},children:[x.jsxs(pl,{className:"h-full border border-dashed border-border bg-transparent ring-0 transition-colors hover:border-foreground/25 data-[busy=true]:opacity-60","data-busy":e,children:[x.jsxs(mc,{children:[x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsx("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground",children:x.jsx(dj,{className:"size-5"})}),x.jsx(py,{className:"text-base",children:"İçe aktar — kendi JSON'un"})]}),x.jsx(my,{className:"mt-2 leading-relaxed",children:"Elindeki JSON'u getir; JustJSON yapıyı çıkarıp projeni kurar."})]}),x.jsx(ml,{className:"flex-1",children:x.jsxs("div",{className:"flex h-full items-center rounded-md border border-dashed border-border/70 px-3 py-4 text-sm text-muted-foreground",children:["İçerik JSON'un ya da hazır bir"," ",x.jsx("code",{className:"mx-1 font-mono text-xs text-foreground",children:"_schema.json"})," — yapı otomatik çıkarılır."]})}),x.jsx(ep,{children:x.jsx(S9,{asChild:!0,children:x.jsx(ze,{variant:"outline",className:"h-9 w-full",disabled:e,children:"Kendi JSON'unu içe aktar"})})})]}),x.jsxs(Cc,{className:"sm:max-w-lg",children:[x.jsxs(Sc,{children:[x.jsx(Ec,{children:"Kendi JSON'unu içe aktar"}),x.jsxs(_c,{children:["İçerik JSON'unu (ör. bir JustFields dışa aktarımı) ya da hazır bir"," ",x.jsx("code",{className:"font-mono text-xs",children:"_schema.json"}),"'u yapıştır/seç — JustJSON koleksiyon ve tekil yapısını otomatik çıkarır."]})]}),x.jsxs("div",{className:"space-y-3",children:[x.jsxs("div",{className:"flex items-center justify-between gap-3",children:[x.jsx("span",{className:"text-sm font-medium text-foreground",children:"JSON"}),x.jsxs("label",{className:De(Xy({variant:"outline",size:"sm"}),"cursor-pointer",u&&"pointer-events-none opacity-50"),children:[x.jsx(r_,{}),"Dosya seç",x.jsx("input",{type:"file",accept:".json,application/json",className:"sr-only",disabled:u,onChange:f})]})]}),x.jsx(xv,{value:o,onChange:m=>{s(m.target.value),i&&l(null)},disabled:u,spellCheck:!1,rows:10,placeholder:'{ "collections": { ... }, "singletons": { ... } }',className:"max-h-72 resize-y font-mono text-xs leading-relaxed"}),i&&x.jsxs("div",{className:"flex items-start gap-2.5 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2.5 text-sm text-destructive",children:[x.jsx(nx,{className:"mt-0.5 size-4 shrink-0"}),x.jsx("span",{className:"break-words",children:i})]})]}),x.jsxs(wp,{children:[x.jsx(kp,{asChild:!0,children:x.jsx(ze,{variant:"ghost",disabled:u,children:"Vazgeç"})}),x.jsx(ze,{disabled:u||!o.trim(),onClick:p,children:u?x.jsxs(x.Fragment,{children:[x.jsx(Xi,{className:"animate-spin"}),"İçe aktarılıyor…"]}):"İçe aktar"})]})]})]})}function nX({onApplied:t,onScratch:e}){const[n,r]=C.useState(null),[o,s]=C.useState(null),[i,l]=C.useState(null);C.useEffect(()=>{wY().then(r).catch(()=>s("Şablon listesi yüklenemedi."))},[]);const u=async f=>{s(null),l(f);try{await CY(f),t()}catch(p){s(p.message),l(null)}},d=i!==null;return x.jsx("div",{className:"h-full overflow-y-auto bg-muted/30",children:x.jsxs("div",{className:"mx-auto max-w-5xl px-6 py-12 sm:px-8",children:[x.jsxs("header",{className:"mb-9 max-w-2xl",children:[x.jsxs("div",{className:"mb-5 inline-flex items-center gap-2 text-sm font-medium text-muted-foreground",children:[x.jsx("span",{className:"flex size-6 items-center justify-center rounded-md bg-primary text-primary-foreground",children:x.jsx(kl,{className:"size-3.5"})}),"JustJSON"]}),x.jsx("h1",{className:"font-heading text-2xl font-semibold tracking-tight text-foreground sm:text-3xl",children:"Bir şablon seç"}),x.jsx("p",{className:"mt-2 text-base leading-relaxed text-muted-foreground",children:"İçeriğini görsel olarak düzenle; her şey klasöründe düz JSON olarak kalır — sunucu yok, hesap yok."}),x.jsx("p",{className:"mt-1.5 text-sm text-muted-foreground",children:"Seçtiğin şablon, içerik dosyalarını ve şemanı senin için oluşturur — hepsini sonra değiştirebilirsin."})]}),o&&x.jsxs("div",{className:"mb-6 flex items-start gap-2.5 rounded-lg border border-destructive/30 bg-destructive/10 px-4 py-3 text-sm text-destructive",children:[x.jsx(nx,{className:"mt-0.5 size-4 shrink-0"}),x.jsx("span",{children:o})]}),x.jsx(eX,{onApplied:t,disabled:d}),x.jsxs("div",{className:"mb-5 flex items-center gap-3 text-xs font-medium text-muted-foreground",children:[x.jsx("span",{className:"h-px flex-1 bg-border"}),"ya da bir şablonla başla",x.jsx("span",{className:"h-px flex-1 bg-border"})]}),x.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[n===null&&!o&&[0,1,2,3,4].map(f=>x.jsx(YY,{},f)),n==null?void 0:n.map(f=>{const p=JY[f.id]??mj,m=i===f.id;return x.jsxs(pl,{className:"h-full transition-shadow hover:shadow-md data-[busy=true]:opacity-60","data-busy":d&&!m,children:[x.jsxs(mc,{children:[x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsx("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-lg bg-accent text-accent-foreground",children:x.jsx(p,{className:"size-5"})}),x.jsx(py,{className:"text-base",children:f.title})]}),x.jsx(my,{className:"mt-2 leading-relaxed",children:f.description})]}),x.jsxs(ml,{className:"flex-1",children:[x.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[x.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Oluşturulacak yapı"}),x.jsx("span",{className:"text-xs text-muted-foreground/80",children:ZY(f)})]}),x.jsxs("div",{className:"space-y-1.5",children:[f.collections.map(y=>x.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-muted/60 px-2.5 py-1.5",children:[x.jsx(o9,{className:"size-3.5 shrink-0 text-muted-foreground"}),x.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:y.label}),x.jsxs(Yi,{variant:"secondary",className:"ml-auto shrink-0 font-normal",children:[y.fields," alan"]})]},y.label)),f.singletons.map(y=>x.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-muted/60 px-2.5 py-1.5",children:[x.jsx(ZE,{className:"size-3.5 shrink-0 text-muted-foreground"}),x.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:y.label}),x.jsx(Yi,{variant:"outline",className:"ml-auto shrink-0 font-normal",children:"tekil"})]},y.label))]})]}),x.jsx(ep,{children:x.jsx(ze,{className:"h-9 w-full",disabled:d,onClick:()=>u(f.id),children:m?x.jsxs(x.Fragment,{children:[x.jsx(Xi,{className:"animate-spin"}),"Uygulanıyor…"]}):"Bu şablonu kullan"})})]},f.id)}),x.jsxs(pl,{className:"h-full border border-dashed border-border bg-transparent ring-0 transition-colors hover:border-foreground/25 data-[busy=true]:opacity-60","data-busy":d,children:[x.jsxs(mc,{children:[x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsx("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground",children:x.jsx(Uj,{className:"size-5"})}),x.jsx(py,{className:"text-base",children:"Sıfırdan başla"})]}),x.jsx(my,{className:"mt-2 leading-relaxed",children:"Boş bir şemayla başla, koleksiyonlarını ve alanlarını kendin tanımla."})]}),x.jsx(ml,{className:"flex-1",children:x.jsx("div",{className:"flex h-full items-center rounded-md border border-dashed border-border/70 px-3 py-4 text-sm text-muted-foreground",children:"Henüz içerik yok — yapıyı baştan sen kurarsın."})}),x.jsx(ep,{children:x.jsx(ze,{variant:"outline",className:"h-9 w-full",disabled:d,onClick:e,children:"Boş projeyle devam et"})})]}),x.jsx(tX,{onApplied:t,disabled:d})]})]})})}function rX({context:t,fieldLabel:e,currentValue:n,richtext:r,onResult:o}){const{config:s,openSettings:i}=bv(),[l,u]=C.useState(!1),[d,f]=C.useState(""),[p,m]=C.useState(!1),y=()=>{if(!s){i();return}f(""),u(!0)},v=async()=>{if(s){m(!0);try{const b=[`"${t}" içindeki "${e}" alanını dolduruyorsun.`,r?"Yanıtı Markdown olarak yaz.":"Yanıtı düz metin olarak, tek satır tercih ederek yaz.","Sadece alanın değerini döndür — açıklama, tırnak ya da ön ek ekleme."].join(" "),k=[d.trim()||`${e} için uygun bir içerik üret.`,n.trim()?`
610
-
611
- Mevcut metin (bunu geliştir/temel al):
612
- ${n}`:""].join(""),E=await MM(s,b,k);o(E.trim()),u(!1),Zt.success("İçerik üretildi")}catch(b){Zt.error(b.message)}finally{m(!1)}}};return x.jsxs(x.Fragment,{children:[x.jsxs(ze,{type:"button",variant:"ghost",size:"icon-xs",onClick:y,className:"text-muted-foreground hover:text-primary",title:"AI ile doldur",children:[x.jsx(Wu,{className:"h-3.5 w-3.5"}),x.jsx("span",{className:"sr-only",children:"AI ile doldur"})]}),x.jsx(wc,{open:l,onOpenChange:u,children:x.jsxs(Cc,{children:[x.jsxs(Sc,{children:[x.jsxs(Ec,{className:"flex items-center gap-2",children:[x.jsx(Wu,{className:"h-4 w-4 text-primary"})," ",e]}),x.jsxs(_c,{children:["Ne istediğini kısaca yaz, model ",t," bağlamına göre dolduracak.",n.trim()?" Mevcut metin bağlam olarak gönderilecek.":""]})]}),x.jsx(xv,{autoFocus:!0,value:d,onChange:b=>f(b.target.value),placeholder:`Örn. "${e} için kısa ve samimi bir metin yaz"`,className:"min-h-24",onKeyDown:b=>{b.key==="Enter"&&(b.metaKey||b.ctrlKey)&&v()}}),x.jsxs(wp,{children:[x.jsx(kp,{asChild:!0,children:x.jsx(ze,{variant:"outline",children:"Vazgeç"})}),x.jsx(ze,{onClick:v,disabled:p,children:p?x.jsxs(x.Fragment,{children:[x.jsx(Xi,{className:"h-4 w-4 animate-spin"})," Üretiliyor…"]}):"Oluştur"})]})]})})]})}function ei({children:t}){return x.jsx("div",{className:"flex h-full min-h-0 flex-col",children:t})}function ti({title:t,badge:e,subtitle:n,actions:r,toolbar:o}){return x.jsxs("header",{className:"sticky top-0 z-20 shrink-0 border-b bg-card px-8 pt-4 pb-3.5",children:[x.jsxs("div",{className:"flex items-start justify-between gap-6",children:[x.jsxs("div",{className:"min-w-0",children:[x.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[x.jsx("h1",{className:"truncate text-lg font-semibold leading-tight tracking-tight text-foreground",children:t}),e]}),n&&x.jsx("div",{className:"mt-1.5 flex min-w-0 items-center gap-2 text-xs text-muted-foreground",children:n})]}),r&&x.jsx("div",{className:"flex shrink-0 items-center gap-2",children:r})]}),o&&x.jsx("div",{className:"mt-3.5",children:o})]})}function RM({children:t}){return x.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:t})}function oX({children:t}){return x.jsx("div",{className:"min-h-0 flex-1 overflow-hidden px-8 py-6",children:t})}function sX({className:t,children:e}){return x.jsx("div",{className:De("overflow-hidden rounded-xl border bg-card shadow-sm",t),children:e})}function zf({children:t}){return x.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1.5 rounded-md border bg-muted/60 px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground",children:[x.jsx(uj,{className:"h-3 w-3 shrink-0 text-muted-foreground/70"}),x.jsx("span",{className:"truncate",children:t})]})}function DS({icon:t,title:e,hint:n,action:r}){return x.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center px-6 py-16 text-center",children:[x.jsx("div",{className:"mb-3 flex h-12 w-12 items-center justify-center rounded-xl bg-muted text-muted-foreground",children:t}),x.jsx("p",{className:"text-sm font-medium text-foreground",children:e}),n&&x.jsx("p",{className:"mt-1 max-w-xs text-sm text-muted-foreground",children:n}),r&&x.jsx("div",{className:"mt-5",children:r})]})}const OM=["a","b","c","d","e"];function zu({className:t}){return x.jsx("div",{className:De("animate-pulse rounded-md bg-muted",t)})}function iX(){return x.jsxs(dL,{delayDuration:300,children:[x.jsx(GY,{children:x.jsx(aX,{})}),x.jsx(aL,{position:"bottom-right"})]})}function aX(){const[t,e]=C.useState(null),[n,r]=C.useState(null),[o,s]=C.useState(null),[i,l]=C.useState(null),[u,d]=C.useState(!1),[f,p]=C.useState(0),[m,y]=C.useState(null),v=C.useCallback(async()=>{const T=await MS();return e(T),T},[]),b=C.useCallback(T=>{T&&(y(T),p(A=>A+1)),l({kind:"schema"})},[]);if(C.useEffect(()=>{MS().then(T=>{e(T),T.collections.length===0&&T.singletons.length===0&&d(!0)}).catch(()=>s("Şema yüklenemedi. `justjson serve` çalışıyor mu?"))},[]),C.useEffect(()=>{kY().then(r).catch(()=>{})},[]),o)return x.jsx(Fu,{children:o});if(!t)return x.jsx(Fu,{children:"Yükleniyor…"});if(u)return x.jsx(nX,{onApplied:async()=>{const T=await v();d(!1),l(T.collections[0]?{kind:"collection",name:T.collections[0].name}:{kind:"schema"})},onScratch:()=>{d(!1),l({kind:"schema"})}});const k=t.collections.length===0&&t.singletons.length===0,E=()=>{EY(),Zt.success("Dışa aktarma indiriliyor")},_=async()=>{await _M({version:1,collections:[],singletons:[]}),await v(),l(null),d(!0),Zt.success("Şema sıfırlandı")};return x.jsxs("div",{className:"flex h-full bg-background",children:[x.jsx(cX,{project:n,schema:t,selection:i,onSelect:l,onOpenSchema:b,onExport:E,onReset:_}),x.jsxs("main",{className:"flex min-w-0 flex-1 flex-col overflow-hidden bg-muted/30",children:[x.jsx(uX,{project:n,crumbs:lX(t,i,l)}),x.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:x.jsx(hX,{schema:t,selection:i,onSelect:l,onReload:v,onOpenSchema:b,addSeq:f,addKind:m,onBrowseTemplates:k?()=>d(!0):void 0})})]})]})}function lX(t,e,n){if(!e)return[];if(e.kind==="schema")return[{label:"Şema"}];if(e.kind==="json")return[{label:"Ham JSON"}];if(e.kind==="collection"){const o=t.collections.find(s=>s.name===e.name);return[{label:(o==null?void 0:o.label)??e.name}]}if(e.kind==="entry"||e.kind==="newEntry"){const o=t.collections.find(s=>s.name===e.collection);return[{label:(o==null?void 0:o.label)??e.collection,onClick:()=>n({kind:"collection",name:e.collection})},e.kind==="entry"?{label:e.slug}:{label:"Yeni kayıt"}]}const r=t.singletons.find(o=>o.name===e.name);return[{label:(r==null?void 0:r.label)??e.name,tag:"tekil"}]}function uX({project:t,crumbs:e}){return x.jsxs("header",{className:"flex h-12 shrink-0 items-center gap-1 overflow-x-auto border-b bg-card px-8 text-xs",children:[x.jsxs("span",{title:t==null?void 0:t.path,className:"inline-flex shrink-0 items-center gap-1.5 text-muted-foreground",children:[x.jsx(YE,{className:"h-3.5 w-3.5 text-muted-foreground/70"}),(t==null?void 0:t.name)??"…"]}),e.map(n=>x.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1",children:[x.jsx(tx,{className:"h-3.5 w-3.5 text-muted-foreground/40"}),n.onClick?x.jsx("button",{type:"button",onClick:n.onClick,className:"rounded text-muted-foreground transition-colors hover:text-primary",children:n.label}):x.jsx("span",{className:"font-medium text-foreground/80",children:n.label}),n.tag&&x.jsx(Yi,{variant:"secondary",className:"ml-0.5 font-normal",children:n.tag})]},n.label))]})}function Fu({children:t}){return x.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:t})}function cX({project:t,schema:e,selection:n,onSelect:r,onOpenSchema:o,onExport:s,onReset:i}){const l=u=>n?n.kind==="collection"?n.name===u:n.kind==="entry"||n.kind==="newEntry"?n.collection===u:!1:!1;return x.jsxs("aside",{className:"flex w-60 shrink-0 flex-col border-r bg-card",children:[x.jsx("div",{className:"flex h-12 shrink-0 items-center border-b px-5",children:x.jsxs("div",{className:"font-mono text-[15px] font-bold tracking-tight text-foreground",children:["Just",x.jsx("span",{className:"text-primary",children:"JSON"})]})}),t&&x.jsx("div",{className:"px-3 pt-3",children:x.jsx(dX,{project:t,onExport:s,onReset:i})}),x.jsxs("nav",{className:"flex-1 space-y-1 overflow-y-auto px-3 pt-3 pb-4",children:[x.jsx(fX,{active:(n==null?void 0:n.kind)==="schema",onClick:()=>o()}),x.jsx(Xg,{icon:x.jsx(kl,{className:"h-4 w-4"}),active:(n==null?void 0:n.kind)==="json",onClick:()=>r({kind:"json"}),children:"Ham JSON"}),x.jsx(RS,{label:"Koleksiyonlar",onAdd:()=>o("collection"),children:e.collections.length===0?x.jsx(OS,{onClick:()=>o("collection"),children:"Koleksiyon ekle"}):e.collections.map(u=>x.jsx(Xg,{icon:x.jsx(vp,{className:"h-4 w-4"}),active:l(u.name),onClick:()=>r({kind:"collection",name:u.name}),children:u.label??u.name},u.name))}),x.jsx(RS,{label:"Tekil",onAdd:()=>o("singleton"),children:e.singletons.length===0?x.jsx(OS,{onClick:()=>o("singleton"),children:"Tekil ekle"}):e.singletons.map(u=>x.jsx(Xg,{icon:x.jsx(hj,{className:"h-4 w-4"}),active:(n==null?void 0:n.kind)==="singleton"&&n.name===u.name,onClick:()=>r({kind:"singleton",name:u.name}),children:u.label??u.name},u.name))})]})]})}function dX({project:t,onExport:e,onReset:n}){const[r,o]=C.useState(!1),[s,i]=C.useState(!1),{config:l,openSettings:u}=bv(),d=async()=>{i(!0);try{await n(),o(!1)}finally{i(!1)}};return x.jsxs(x.Fragment,{children:[x.jsxs(o_,{children:[x.jsx(s_,{asChild:!0,children:x.jsxs("button",{type:"button",title:t.path,className:"flex w-full max-w-full items-center gap-1.5 rounded-lg border bg-muted/50 px-2.5 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[x.jsx(YE,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground/70"}),x.jsx("span",{className:"truncate",children:t.name}),x.jsx(JE,{className:"ml-auto h-3.5 w-3.5 shrink-0 text-muted-foreground/60"})]})}),x.jsxs(i_,{align:"start",className:"w-56",children:[x.jsx(a_,{className:"truncate",children:t.name}),x.jsx(Df,{}),x.jsxs(X0,{onSelect:e,children:[x.jsx(aj,{}),"Dışa aktar (.zip)"]}),x.jsx(Df,{}),x.jsxs(X0,{onSelect:u,children:[x.jsx(Wu,{}),"AI ayarları",l&&x.jsx(Yi,{variant:"secondary",className:"ml-auto font-normal",children:"bağlı"})]}),x.jsx(Df,{}),x.jsxs(X0,{variant:"destructive",onSelect:()=>o(!0),children:[x.jsx(n9,{}),"Baştan başla (sıfırla)"]})]})]}),x.jsx(wc,{open:r,onOpenChange:o,children:x.jsxs(Cc,{children:[x.jsxs(Sc,{children:[x.jsx(Ec,{children:"Şemayı sıfırla?"}),x.jsx(_c,{children:"İçerik dosyaların diskte kalır ama şema temizlenir, baştan şablon/JSON seçebilirsin."})]}),x.jsxs(wp,{children:[x.jsx(kp,{asChild:!0,children:x.jsx(ze,{variant:"outline",children:"Vazgeç"})}),x.jsx(ze,{variant:"destructive",onClick:d,disabled:s,children:s?"Sıfırlanıyor…":"Sıfırla"})]})]})})]})}function fX({active:t,onClick:e}){return x.jsxs("button",{type:"button",onClick:e,className:De("flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-left transition-colors",t?"bg-accent text-primary":"text-muted-foreground hover:bg-accent/60"),children:[x.jsx(t_,{className:"h-4 w-4 shrink-0"}),x.jsxs("span",{className:"min-w-0",children:[x.jsx("span",{className:"block text-sm font-medium leading-tight",children:"Şema"}),x.jsx("span",{className:De("block text-xs leading-tight",t?"text-primary/70":"text-muted-foreground/70"),children:"İçerik yapısı"})]})]})}function RS({label:t,onAdd:e,children:n}){return x.jsxs("div",{className:"pt-4",children:[x.jsxs("div",{className:"flex items-center justify-between px-3 pb-1",children:[x.jsx("p",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground/80",children:t}),x.jsxs(sx,{children:[x.jsx(ix,{asChild:!0,children:x.jsxs(ze,{variant:"ghost",size:"icon-xs",onClick:e,className:"text-muted-foreground hover:text-primary",children:[x.jsx(Qi,{}),x.jsxs("span",{className:"sr-only",children:[t," ekle"]})]})}),x.jsxs(ax,{children:[t," ekle"]})]})]}),x.jsx("div",{className:"space-y-0.5",children:n})]})}function OS({onClick:t,children:e}){return x.jsxs("button",{type:"button",onClick:t,className:"flex w-full items-center gap-2 rounded-lg px-3 py-2 text-sm text-muted-foreground/70 transition-colors hover:bg-accent/60 hover:text-primary",children:[x.jsx(Qi,{className:"h-4 w-4"})," ",e]})}function Xg({children:t,icon:e,active:n,onClick:r}){return x.jsxs("button",{type:"button",onClick:r,className:De("flex w-full items-center gap-2 rounded-lg px-3 py-2 text-sm transition-colors",n?"bg-accent font-medium text-primary":"text-muted-foreground hover:bg-accent/60 hover:text-foreground"),children:[e&&x.jsx("span",{className:n?"text-primary":"text-muted-foreground/70",children:e}),x.jsx("span",{className:"truncate",children:t})]})}function hX({schema:t,selection:e,onSelect:n,onReload:r,onOpenSchema:o,addSeq:s,addKind:i,onBrowseTemplates:l}){if(!e)return x.jsx(pX,{icon:x.jsx(vp,{className:"h-6 w-6"}),title:"Soldan başla",hint:"Bir koleksiyon ya da tekil kayıt seçerek düzenlemeye başla. Yapıyı değiştirmek istersen Şema'ya git.",action:x.jsxs(ze,{onClick:()=>o(),children:[x.jsx(t_,{})," Şemayı aç"]})});if(e.kind==="schema")return x.jsx(PY,{schema:t,initialAdd:i??void 0,onSaved:()=>void r(),onBrowseTemplates:l},s);if(e.kind==="json")return x.jsx(gX,{schema:t});if(e.kind==="collection"){const d=t.collections.find(f=>f.name===e.name);return d?x.jsx(xX,{collection:d,onOpen:f=>n({kind:"entry",collection:d.name,slug:f}),onNew:()=>n({kind:"newEntry",collection:d.name})}):x.jsx(Fu,{children:"Bu koleksiyon bulunamadı."})}if(e.kind==="entry"||e.kind==="newEntry"){const d=t.collections.find(p=>p.name===e.collection);if(!d)return x.jsx(Fu,{children:"Bu koleksiyon bulunamadı."});const f=e.kind==="entry"?e.slug:null;return x.jsx(vX,{collection:d,slug:f,onSaved:p=>n({kind:"entry",collection:d.name,slug:p}),onDeleted:()=>n({kind:"collection",name:d.name})},`${d.name}/${f??"new"}`)}const u=t.singletons.find(d=>d.name===e.name);return u?x.jsx(bX,{singleton:u},u.name):x.jsx(Fu,{children:"Bu tekil kayıt bulunamadı."})}function pX({icon:t,title:e,hint:n,action:r}){return x.jsxs("div",{className:"flex h-full flex-col items-center justify-center px-6 text-center",children:[t&&x.jsx("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl border bg-card text-muted-foreground shadow-sm",children:t}),x.jsx("p",{className:"text-base font-semibold text-foreground",children:e}),n&&x.jsx("p",{className:"mt-1.5 max-w-sm text-sm text-muted-foreground",children:n}),r&&x.jsx("div",{className:"mt-5",children:r})]})}function Yp({children:t}){return x.jsx("div",{className:"rounded-xl border bg-card p-6 shadow-sm",children:t})}function IM(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/("(?:\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(?:\s*:)?|\b(?:true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+-]?\d+)?)/g,n=>{let r="jk-num";return/^"/.test(n)?r=/:\s*$/.test(n)?"jk-key":"jk-str":n==="true"||n==="false"?r="jk-bool":n==="null"&&(r="jk-null"),`<span class="${r}">${n}</span>`})}function PM({path:t,data:e}){const n=C.useMemo(()=>JSON.stringify(e,null,2),[e]),r=n==="{}",o=()=>{navigator.clipboard&&navigator.clipboard.writeText(n),Zt.success("JSON kopyalandı")};return x.jsxs("div",{className:"overflow-hidden rounded-xl border shadow-sm",children:[x.jsxs("div",{className:"flex items-center gap-2 border-b bg-muted/60 px-3 py-2",children:[x.jsx(kl,{className:"h-3.5 w-3.5 shrink-0 text-primary"}),x.jsx("span",{className:"truncate font-mono text-xs text-muted-foreground",children:t}),x.jsxs(ze,{variant:"ghost",size:"xs",onClick:o,disabled:r,className:"ml-auto text-muted-foreground hover:text-primary",children:[x.jsx(sj,{})," Kopyala"]})]}),r?x.jsx("p",{className:"jk-pre text-muted-foreground/70",children:"Henüz alan doldurulmadı."}):x.jsx("pre",{className:"jk-pre overflow-x-auto",children:x.jsx("code",{dangerouslySetInnerHTML:{__html:IM(n)}})})]})}function Qa({children:t}){return x.jsx(RM,{children:x.jsx("div",{className:"mx-auto max-w-3xl space-y-5 px-8 py-6",children:t})})}function mX({path:t,data:e,defaultOpen:n}){const[r,o]=C.useState(n??!1),s=C.useMemo(()=>JSON.stringify(e,null,2),[e]);return x.jsxs("div",{className:"overflow-hidden rounded-lg border",children:[x.jsxs("button",{type:"button",onClick:()=>o(i=>!i),className:"flex w-full items-center gap-2 bg-muted/50 px-3 py-2 text-left transition-colors hover:bg-muted",children:[x.jsx(tx,{className:De("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform",r&&"rotate-90")}),x.jsx(kl,{className:"h-3.5 w-3.5 shrink-0 text-primary"}),x.jsx("span",{className:"truncate font-mono text-xs text-foreground/80",children:t})]}),r&&x.jsx("pre",{className:"jk-pre overflow-x-auto border-t",children:x.jsx("code",{dangerouslySetInnerHTML:{__html:IM(s)}})})]})}function gX({schema:t}){const[e,n]=C.useState(null),[r,o]=C.useState(null);return C.useEffect(()=>{let s=!1;return(async()=>{try{const i=[{path:"_schema.json",data:t}];for(const l of t.collections){const u=await mv(l.name),d=await Promise.all(u.map(f=>gy(l.name,f.slug).then(p=>({slug:f.slug,d:p}))));for(const f of d)f.d&&i.push({path:`${l.name}/${f.slug}.json`,data:f.d})}for(const l of t.singletons){const u=await TM(l.name);i.push({path:`${l.name}.json`,data:u})}s||n(i)}catch(i){s||o(i.message)}})(),()=>{s=!0}},[t]),x.jsxs(ei,{children:[x.jsx(ti,{title:"Ham JSON",subtitle:e?`content/ • ${e.length} dosya`:"content/ klasöründeki her dosya, diske yazıldığı hâliyle"}),x.jsx(RM,{children:x.jsxs("div",{className:"mx-auto max-w-3xl space-y-2 px-8 py-6",children:[r&&x.jsx(kv,{title:"Yüklenemedi",children:r}),e===null&&!r&&x.jsx("p",{className:"px-1 text-sm text-muted-foreground",children:"Yükleniyor…"}),e==null?void 0:e.map((s,i)=>x.jsx(mX,{path:s.path,data:s.data,defaultOpen:i===0},s.path))]})})]})}function jM(){return x.jsx(Yp,{children:x.jsx("div",{className:"space-y-6",children:OM.slice(0,4).map(t=>x.jsxs("div",{className:"space-y-2",children:[x.jsx(zu,{className:"h-3.5 w-28"}),x.jsx(zu,{className:"h-8 w-full"})]},t))})})}function LM({onRetry:t,onBack:e}){return x.jsx(Yp,{children:x.jsxs("div",{className:"flex flex-col items-center py-8 text-center",children:[x.jsx("div",{className:"mb-3 flex size-12 items-center justify-center rounded-xl bg-destructive/10 text-destructive",children:x.jsx(ox,{className:"size-5"})}),x.jsx("p",{className:"font-medium text-foreground",children:"Kayıt yüklenemedi"}),x.jsx("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:"Dosya okunamadı ya da silinmiş olabilir. Boş bir formla üzerine yazmamak için düzenleme kapatıldı."}),x.jsxs("div",{className:"mt-4 flex items-center gap-2",children:[x.jsx(ze,{onClick:t,children:"Tekrar dene"}),e&&x.jsx(ze,{variant:"outline",onClick:e,children:"Listeye dön"})]})]})})}function yX(t){return t?new Intl.DateTimeFormat("tr-TR",{day:"numeric",month:"short",year:"numeric"}).format(new Date(t)):"—"}function xX({collection:t,onOpen:e,onNew:n}){const[r,o]=C.useState(null),[s,i]=C.useState("");C.useEffect(()=>{mv(t.name).then(o)},[t.name]);const l=s.trim().toLowerCase(),u=r==null?void 0:r.filter(f=>f.title.toLowerCase().includes(l)||f.slug.includes(l)),d=!!r&&r.length>0;return x.jsxs(ei,{children:[x.jsx(ti,{title:t.label??t.name,subtitle:r?`${r.length} kayıt`:"Kayıtlar yükleniyor…",actions:x.jsxs(ze,{onClick:n,children:[x.jsx(Qi,{})," Yeni kayıt"]}),toolbar:d?x.jsxs("div",{className:"flex items-center gap-3",children:[x.jsxs("div",{className:"relative w-full max-w-sm",children:[x.jsx(l9,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),x.jsx(ar,{className:"pl-9",placeholder:"Başlık veya slug ara…",value:s,onChange:f=>i(f.target.value)})]}),x.jsx("span",{className:"ml-auto shrink-0 text-xs tabular-nums text-muted-foreground",children:l?`${(u==null?void 0:u.length)??0} sonuç`:null})]}):void 0}),x.jsx(oX,{children:x.jsxs(sX,{className:"flex h-full flex-col [&>[data-slot=table-container]]:min-h-0 [&>[data-slot=table-container]]:flex-1",children:[r===null&&x.jsx(IS,{rows:null,onOpen:e}),r!==null&&r.length===0&&x.jsx(DS,{icon:x.jsx(vp,{className:"h-6 w-6"}),title:"Henüz kayıt yok",hint:"Bu koleksiyona ilk içeriği ekleyerek başla.",action:x.jsxs(ze,{onClick:n,variant:"outline",children:[x.jsx(Qi,{})," İlk kaydı oluştur"]})}),d&&(u==null?void 0:u.length)===0&&x.jsx(DS,{icon:x.jsx(i9,{className:"h-6 w-6"}),title:"Eşleşen kayıt yok",hint:`“${s.trim()}” için sonuç bulunamadı. Aramayı değiştir ya da temizle.`,action:x.jsx(ze,{variant:"outline",onClick:()=>i(""),children:"Aramayı temizle"})}),d&&u&&u.length>0&&x.jsx(IS,{rows:u,onOpen:e})]})})]})}const _f="h-9 bg-muted/50 px-4 text-xs font-medium uppercase tracking-wide text-muted-foreground";function IS({rows:t,onOpen:e}){return x.jsxs(lL,{children:[x.jsx(uL,{className:"sticky top-0 z-10",children:x.jsxs(Q0,{className:"hover:bg-transparent",children:[x.jsx(sf,{className:De(_f,"w-full"),children:"Başlık"}),x.jsx(sf,{className:_f,children:"Dosya"}),x.jsx(sf,{className:De(_f,"text-right"),children:"Güncellendi"}),x.jsx(sf,{className:De(_f,"w-10 pl-0"),children:x.jsx("span",{className:"sr-only",children:"Aç"})})]})}),x.jsx(cL,{children:t===null?OM.map(n=>x.jsxs(Q0,{className:"hover:bg-transparent",children:[x.jsx(Rs,{className:"px-4 py-3",children:x.jsx(zu,{className:"h-3.5 w-48"})}),x.jsx(Rs,{className:"px-4 py-3",children:x.jsx(zu,{className:"h-3 w-24"})}),x.jsx(Rs,{className:"px-4 py-3",children:x.jsx(zu,{className:"ml-auto h-3 w-20"})}),x.jsx(Rs,{className:"w-10 py-3 pl-0"})]},n)):t.map(n=>x.jsxs(Q0,{tabIndex:0,onClick:()=>e(n.slug),onKeyDown:r=>r.key==="Enter"&&e(n.slug),className:"group/row cursor-pointer hover:bg-muted/40 focus:bg-accent focus:outline-none",children:[x.jsx(Rs,{className:"px-4 py-3 font-medium text-foreground",children:n.title}),x.jsx(Rs,{className:"px-4 py-3 font-mono text-xs text-muted-foreground",children:n.slug}),x.jsx(Rs,{className:"px-4 py-3 text-right text-xs tabular-nums text-muted-foreground",children:yX(n.updatedAt)}),x.jsxs(Rs,{className:"w-10 py-3 pr-4 pl-0 text-right",children:[x.jsx(tx,{className:"ml-auto h-4 w-4 text-transparent transition-colors group-hover/row:text-muted-foreground/70 group-focus/row:text-muted-foreground/70"}),x.jsx("span",{className:"sr-only",children:"aç"})]})]},n.slug))})]})}function zM(t,e){const[n,r]=C.useState({}),[o,s]=C.useState(!0),[i,l]=C.useState(!1),[u,d]=C.useState(0),f=C.useRef(0);C.useEffect(()=>{const m=++f.current;s(!0),l(!1),t().then(y=>{m===f.current&&(y===null&&e?l(!0):r(y??{}),s(!1))}).catch(()=>{m===f.current&&(l(!0),s(!1))})},[u]);const p=C.useCallback(()=>d(m=>m+1),[]);return{data:n,setData:r,loading:o,failed:i,retry:p}}function vX({collection:t,slug:e,onSaved:n,onDeleted:r}){const o=e===null,s=C.useCallback(()=>o?Promise.resolve({}):gy(t.name,e),[t.name,e,o]),{data:i,setData:l,loading:u,failed:d,retry:f}=zM(s,!o),[p,m]=C.useState(""),[y,v]=C.useState(!1),[b,k]=C.useState(null),[E,_]=C.useState(!1),T=(O,U)=>l(J=>{const K={...J};return U===""||U===void 0?delete K[O]:K[O]=U,K}),A=C.useMemo(()=>f_(t.fields,i),[i,t.fields]),N=o?ux(p||String(i.title??"icerik")):e,D=async()=>{k(null),v(!0);try{if(o&&await gy(t.name,N)){const U=`"${N}" zaten var — farklı bir slug seç.`;k(U),Zt.error(U);return}const O=await TY(t.name,N,i);Zt.success(`"${O}" kaydedildi`),n(O)}finally{v(!1)}},I=async()=>{o||(await MY(t.name,e),Zt.success(`"${e}" silindi`),r())},P=t.label??t.name;return u?x.jsxs(ei,{children:[x.jsx(ti,{title:P,subtitle:x.jsx(zf,{children:`${t.name}/…`})}),x.jsx(Qa,{children:x.jsx(jM,{})})]}):d?x.jsxs(ei,{children:[x.jsx(ti,{title:P,subtitle:x.jsx(zf,{children:`${t.name}/${e}.json`})}),x.jsx(Qa,{children:x.jsx(LM,{onRetry:f,onBack:r})})]}):x.jsxs(ei,{children:[x.jsx(ti,{title:P,badge:o?x.jsx(Yi,{variant:"secondary",className:"font-normal",children:"yeni"}):void 0,subtitle:x.jsx(zf,{children:`${t.name}/${N}.json`}),actions:x.jsxs(x.Fragment,{children:[x.jsxs(ze,{variant:E?"secondary":"outline",onClick:()=>_(O=>!O),children:[x.jsx(kl,{})," JSON"]}),!o&&x.jsxs(ze,{variant:"destructive",onClick:I,children:[x.jsx(n_,{})," Sil"]}),x.jsx(ze,{onClick:D,disabled:y||!A.ok,children:y?"Kaydediliyor…":"Kaydet"})]})}),x.jsxs(Qa,{children:[b&&x.jsx(kv,{title:"Kaydedilemedi",children:b}),E&&x.jsx(PM,{path:`${t.name}/${N}.json`,data:i}),x.jsxs(Yp,{children:[o&&x.jsxs("div",{className:"mb-6 rounded-lg border bg-muted/40 p-4",children:[x.jsx($M,{label:"Dosya adı",hint:`${N}.json`,children:x.jsx(ar,{value:p,onChange:O=>m(O.target.value),placeholder:"otomatik",className:"bg-card font-mono"})}),x.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:"Boş bırakırsan başlıktan üretilir. Kaydettikten sonra değişmez."})]}),x.jsx("div",{className:"space-y-6",children:t.fields.map(O=>x.jsx(BM,{field:O,value:i[O.key],onChange:T,context:t.label??t.name},O.key))})]}),x.jsx(FM,{result:A})]})]})}function bX({singleton:t}){const e=C.useCallback(()=>TM(t.name),[t.name]),{data:n,setData:r,loading:o,failed:s,retry:i}=zM(e,!1),[l,u]=C.useState(!1),[d,f]=C.useState(!1),p=(k,E)=>r(_=>{const T={..._};return E===""||E===void 0?delete T[k]:T[k]=E,T}),m=C.useMemo(()=>f_(t.fields,n),[n,t.fields]),y=async()=>{u(!0);try{await NY(t.name,n),Zt.success(`${t.label??t.name} kaydedildi`)}finally{u(!1)}},v=t.label??t.name,b=x.jsx(Yi,{variant:"secondary",className:"font-normal",children:"tekil"});return o?x.jsxs(ei,{children:[x.jsx(ti,{title:v,badge:b}),x.jsx(Qa,{children:x.jsx(jM,{})})]}):s?x.jsxs(ei,{children:[x.jsx(ti,{title:v,badge:b}),x.jsx(Qa,{children:x.jsx(LM,{onRetry:i})})]}):x.jsxs(ei,{children:[x.jsx(ti,{title:v,badge:b,subtitle:x.jsx(zf,{children:`${t.name}.json`}),actions:x.jsxs(x.Fragment,{children:[x.jsxs(ze,{variant:d?"secondary":"outline",onClick:()=>f(k=>!k),children:[x.jsx(kl,{})," JSON"]}),x.jsx(ze,{onClick:y,disabled:l||!m.ok,children:l?"Kaydediliyor…":"Kaydet"})]})}),x.jsxs(Qa,{children:[d&&x.jsx(PM,{path:`${t.name}.json`,data:n}),x.jsx(Yp,{children:x.jsx("div",{className:"space-y-6",children:t.fields.map(k=>x.jsx(BM,{field:k,value:n[k.key],onChange:p,context:t.label??t.name},k.key))})}),x.jsx(FM,{result:m})]})]})}function kv({title:t,tone:e="error",children:n}){const r=e==="error";return x.jsxs("div",{className:De("rounded-xl border p-4",r?"border-destructive/30 bg-destructive/5":"border-border bg-muted/40"),children:[x.jsxs("div",{className:De("flex items-center gap-2 text-sm font-medium",r?"text-destructive":"text-foreground"),children:[x.jsx(ox,{className:"h-4 w-4 shrink-0"}),t]}),x.jsx("div",{className:"mt-2.5 text-sm text-muted-foreground",children:n})]})}function FM({result:t}){if(t.issues.length===0)return null;const e=t.issues.some(n=>n.level==="error");return x.jsx(kv,{tone:e?"error":"warning",title:e?"Kaydetmeden önce düzeltilecekler":"Uyarılar",children:x.jsx("ul",{className:"space-y-2",children:t.issues.map(n=>x.jsxs("li",{className:"flex items-start gap-2.5",children:[x.jsx("span",{"aria-hidden":!0,className:De("mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full",n.level==="error"?"bg-destructive":"bg-muted-foreground/50")}),x.jsx("span",{className:"rounded bg-background px-1.5 py-0.5 font-mono text-xs text-foreground",children:n.key}),x.jsx("span",{className:"min-w-0",children:n.message})]},`${n.key}-${n.message}`))})})}function $M({label:t,required:e,type:n,hint:r,actions:o,children:s}){var l;const i=n?(l=gv[n])==null?void 0:l.icon:null;return x.jsxs("div",{className:"space-y-2",children:[x.jsxs("div",{className:"flex items-center gap-1.5",children:[i&&x.jsx(i,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground/60"}),x.jsx(pu,{className:"text-sm font-medium text-foreground",children:t}),e&&x.jsx("span",{className:"text-destructive","aria-hidden":!0,children:"*"}),r&&x.jsx("span",{className:"ml-auto truncate font-mono text-xs text-primary",children:r}),o&&x.jsx("span",{className:r?"":"ml-auto",children:o})]}),s]})}const kX=new Set(["text","richtext"]);function BM({field:t,value:e,onChange:n,context:r}){const[o,s]=C.useState(0),i=l=>{n(t.key,l),t.type==="richtext"&&s(u=>u+1)};return x.jsx($M,{label:t.label||t.key,required:t.required,type:t.type,actions:kX.has(t.type)?x.jsx(rX,{context:r,fieldLabel:t.label||t.key,currentValue:typeof e=="string"?e:"",richtext:t.type==="richtext",onResult:i}):void 0,children:x.jsx(wX,{field:t,value:e,onChange:n,richtextKey:o})})}function wX({field:t,value:e,onChange:n,richtextKey:r}){const o=t.key;switch(t.type){case"richtext":return x.jsx(CJ,{value:e??"",onChange:s=>n(o,s)},r);case"number":return x.jsx(ar,{type:"number",value:e===void 0?"":String(e),onChange:s=>n(o,s.target.value===""?"":Number(s.target.value))});case"boolean":return x.jsx(ze,{type:"button",variant:e?"default":"outline",role:"switch","aria-checked":!!e,onClick:()=>n(o,!e),className:"min-w-20",children:e?"Evet":"Hayır"});case"date":return x.jsx(ar,{type:"date",className:"w-[240px]",value:e??"",onChange:s=>n(o,s.target.value)});case"select":return x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsxs(Wf,{value:e||void 0,onValueChange:s=>n(o,s),children:[x.jsx(Kf,{className:"w-[240px]",children:x.jsx(qf,{placeholder:"Seç…"})}),x.jsx(Gf,{children:(t.options??[]).map(s=>x.jsx(Jf,{value:s,children:s},s))})]}),e?x.jsxs(ze,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>n(o,""),className:"text-muted-foreground",children:[x.jsx(bp,{}),x.jsx("span",{className:"sr-only",children:"Temizle"})]}):null]});case"relation":return x.jsx(CX,{field:t,value:e,onChange:n});case"image":return x.jsx(EX,{value:e,onChange:s=>n(o,s)});default:return x.jsx(ar,{value:e??"",onChange:s=>n(o,s.target.value)})}}function CX({field:t,value:e,onChange:n}){const[r,o]=C.useState([]),s=Array.isArray(e)?e:[];C.useEffect(()=>{t.to&&_Y(t.to).then(o).catch(()=>o([]))},[t.to]);const i=u=>n(t.key,u.length?u:""),l=u=>{i(s.includes(u)?s.filter(d=>d!==u):[...s,u])};return r.length===0?x.jsxs("p",{className:"rounded-lg border border-dashed bg-muted/30 px-3 py-2.5 text-sm text-muted-foreground",children:["“",t.to,"” içinde kayıt yok."]}):x.jsxs("div",{className:"space-y-2.5",children:[s.length>0&&x.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(u=>x.jsxs(Yi,{variant:"secondary",className:"gap-1 pr-1 font-mono",children:[u,x.jsx("button",{type:"button",onClick:()=>l(u),className:"rounded-full text-muted-foreground transition-colors hover:text-destructive","aria-label":`${u} bağlantısını kaldır`,children:x.jsx(bp,{className:"h-3 w-3"})})]},u))}),x.jsxs(o_,{children:[x.jsx(s_,{asChild:!0,children:x.jsxs(ze,{variant:"outline",children:[x.jsx(QE,{})," Bağlantı ekle"]})}),x.jsxs(i_,{align:"start",className:"max-h-72 w-56 overflow-y-auto",children:[x.jsxs(a_,{children:["“",t.to,"” kayıtları"]}),x.jsx(Df,{}),r.map(u=>x.jsx(T9,{checked:s.includes(u),onCheckedChange:()=>l(u),onSelect:d=>d.preventDefault(),className:"font-mono text-xs",children:u},u))]})]})]})}async function SX(t,e=1600){const n=await createImageBitmap(t),r=Math.min(1,e/n.width),o=Math.round(n.width*r),s=Math.round(n.height*r),i=document.createElement("canvas");i.width=o,i.height=s;const l=i.getContext("2d");if(!l)throw new Error("canvas yok");l.drawImage(n,0,0,o,s);const u=await new Promise(p=>i.toBlob(p,"image/webp",.85));if(!u)throw new Error("dönüştürülemedi");const d=new Uint8Array(await u.arrayBuffer());let f="";for(const p of d)f+=String.fromCharCode(p);return btoa(f)}function EX({value:t,onChange:e}){const[n,r]=C.useState(!1),o=typeof t=="string"?t:"",s=o?`/media/${o.split("/").pop()}`:null,i=async l=>{r(!0);try{e(await AY(await SX(l),l.name)),Zt.success("Görsel yüklendi")}finally{r(!1)}};return x.jsxs("div",{className:"flex items-center gap-4 rounded-lg border bg-muted/30 p-3",children:[x.jsx("div",{className:De("flex h-24 w-24 shrink-0 items-center justify-center overflow-hidden rounded-lg border bg-card",!s&&"border-dashed"),children:s?x.jsx("img",{src:s,alt:"",className:"h-full w-full object-cover"}):x.jsx(XE,{className:"h-6 w-6 text-muted-foreground/60"})}),x.jsxs("div",{className:"min-w-0 space-y-2",children:[x.jsxs("label",{className:De(Xy({variant:"outline"}),"cursor-pointer bg-card"),children:[x.jsx(r_,{}),n?"Yükleniyor…":"Görsel yükle",x.jsx("input",{type:"file",accept:"image/*",hidden:!0,onChange:l=>{var d;const u=(d=l.target.files)==null?void 0:d[0];u&&i(u)}})]}),o&&x.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[x.jsx("span",{className:"truncate font-mono text-xs text-muted-foreground",children:o}),x.jsx(ze,{type:"button",variant:"ghost",size:"xs",onClick:()=>e(""),className:"text-muted-foreground hover:text-destructive",children:"kaldır"})]})]})]})}const VM=document.getElementById("root");if(!VM)throw new Error("root yok");HN.createRoot(VM).render(x.jsx(C.StrictMode,{children:x.jsx(iX,{})}));