@kdrgny/justjson 1.4.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/dist/cli.js +394 -25
- package/dist/editor/assets/index-DFUrgJEm.js +646 -0
- package/dist/editor/assets/index-Dy62f11G.css +1 -0
- package/dist/editor/index.html +2 -2
- package/package.json +1 -1
- package/dist/editor/assets/index-B7tRIQcy.js +0 -632
- package/dist/editor/assets/index-GwsCiKhf.css +0 -1
|
@@ -0,0 +1,646 @@
|
|
|
1
|
+
var d2=t=>{throw TypeError(t)};var f2=(t,e,n)=>e.has(t)||d2("Cannot "+n);var Tn=(t,e,n)=>(f2(t,e,"read from private field"),n?n.call(t):e.get(t)),h2=(t,e,n)=>e.has(t)?d2("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),V0=(t,e,n,r)=>(f2(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);function YM(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 Ay(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var H0={exports:{}},du={},U0={exports:{}},Ke={};/**
|
|
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 p2;function XM(){if(p2)return Ke;p2=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"),a=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),f=Symbol.iterator;function m(L){return L===null||typeof L!="object"?null:(L=f&&L[f]||L["@@iterator"],typeof L=="function"?L:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,b={};function k(L,V,re){this.props=L,this.context=V,this.refs=b,this.updater=re||x}k.prototype.isReactComponent={},k.prototype.setState=function(L,V){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,V,"setState")},k.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function S(){}S.prototype=k.prototype;function _(L,V,re){this.props=L,this.context=V,this.refs=b,this.updater=re||x}var T=_.prototype=new S;T.constructor=_,v(T,k.prototype),T.isPureReactComponent=!0;var A=Array.isArray,M=Object.prototype.hasOwnProperty,D={current:null},P={key:!0,ref:!0,__self:!0,__source:!0};function j(L,V,re){var he,ce={},pe=null,De=null;if(V!=null)for(he in V.ref!==void 0&&(De=V.ref),V.key!==void 0&&(pe=""+V.key),V)M.call(V,he)&&!P.hasOwnProperty(he)&&(ce[he]=V[he]);var Q=arguments.length-2;if(Q===1)ce.children=re;else if(1<Q){for(var de=Array(Q),me=0;me<Q;me++)de[me]=arguments[me+2];ce.children=de}if(L&&L.defaultProps)for(he in Q=L.defaultProps,Q)ce[he]===void 0&&(ce[he]=Q[he]);return{$$typeof:t,type:L,key:pe,ref:De,props:ce,_owner:D.current}}function I(L,V){return{$$typeof:t,type:L.type,key:V,ref:L.ref,props:L.props,_owner:L._owner}}function W(L){return typeof L=="object"&&L!==null&&L.$$typeof===t}function Z(L){var V={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(re){return V[re]})}var J=/\/+/g;function K(L,V){return typeof L=="object"&&L!==null&&L.key!=null?Z(""+L.key):V.toString(36)}function Y(L,V,re,he,ce){var pe=typeof L;(pe==="undefined"||pe==="boolean")&&(L=null);var De=!1;if(L===null)De=!0;else switch(pe){case"string":case"number":De=!0;break;case"object":switch(L.$$typeof){case t:case e:De=!0}}if(De)return De=L,ce=ce(De),L=he===""?"."+K(De,0):he,A(ce)?(re="",L!=null&&(re=L.replace(J,"$&/")+"/"),Y(ce,V,re,"",function(me){return me})):ce!=null&&(W(ce)&&(ce=I(ce,re+(!ce.key||De&&De.key===ce.key?"":(""+ce.key).replace(J,"$&/")+"/")+L)),V.push(ce)),1;if(De=0,he=he===""?".":he+":",A(L))for(var Q=0;Q<L.length;Q++){pe=L[Q];var de=he+K(pe,Q);De+=Y(pe,V,re,de,ce)}else if(de=m(L),typeof de=="function")for(L=de.call(L),Q=0;!(pe=L.next()).done;)pe=pe.value,de=he+K(pe,Q++),De+=Y(pe,V,re,de,ce);else if(pe==="object")throw V=String(L),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.");return De}function ee(L,V,re){if(L==null)return L;var he=[],ce=0;return Y(L,he,"","",function(pe){return V.call(re,pe,ce++)}),he}function G(L){if(L._status===-1){var V=L._result;V=V(),V.then(function(re){(L._status===0||L._status===-1)&&(L._status=1,L._result=re)},function(re){(L._status===0||L._status===-1)&&(L._status=2,L._result=re)}),L._status===-1&&(L._status=0,L._result=V)}if(L._status===1)return L._result.default;throw L._result}var X={current:null},q={transition:null},te={ReactCurrentDispatcher:X,ReactCurrentBatchConfig:q,ReactCurrentOwner:D};function F(){throw Error("act(...) is not supported in production builds of React.")}return Ke.Children={map:ee,forEach:function(L,V,re){ee(L,function(){V.apply(this,arguments)},re)},count:function(L){var V=0;return ee(L,function(){V++}),V},toArray:function(L){return ee(L,function(V){return V})||[]},only:function(L){if(!W(L))throw Error("React.Children.only expected to receive a single React element child.");return L}},Ke.Component=k,Ke.Fragment=n,Ke.Profiler=o,Ke.PureComponent=_,Ke.StrictMode=r,Ke.Suspense=u,Ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=te,Ke.act=F,Ke.cloneElement=function(L,V,re){if(L==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+L+".");var he=v({},L.props),ce=L.key,pe=L.ref,De=L._owner;if(V!=null){if(V.ref!==void 0&&(pe=V.ref,De=D.current),V.key!==void 0&&(ce=""+V.key),L.type&&L.type.defaultProps)var Q=L.type.defaultProps;for(de in V)M.call(V,de)&&!P.hasOwnProperty(de)&&(he[de]=V[de]===void 0&&Q!==void 0?Q[de]:V[de])}var de=arguments.length-2;if(de===1)he.children=re;else if(1<de){Q=Array(de);for(var me=0;me<de;me++)Q[me]=arguments[me+2];he.children=Q}return{$$typeof:t,type:L.type,key:ce,ref:pe,props:he,_owner:De}},Ke.createContext=function(L){return L={$$typeof:i,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},L.Provider={$$typeof:s,_context:L},L.Consumer=L},Ke.createElement=j,Ke.createFactory=function(L){var V=j.bind(null,L);return V.type=L,V},Ke.createRef=function(){return{current:null}},Ke.forwardRef=function(L){return{$$typeof:a,render:L}},Ke.isValidElement=W,Ke.lazy=function(L){return{$$typeof:h,_payload:{_status:-1,_result:L},_init:G}},Ke.memo=function(L,V){return{$$typeof:d,type:L,compare:V===void 0?null:V}},Ke.startTransition=function(L){var V=q.transition;q.transition={};try{L()}finally{q.transition=V}},Ke.unstable_act=F,Ke.useCallback=function(L,V){return X.current.useCallback(L,V)},Ke.useContext=function(L){return X.current.useContext(L)},Ke.useDebugValue=function(){},Ke.useDeferredValue=function(L){return X.current.useDeferredValue(L)},Ke.useEffect=function(L,V){return X.current.useEffect(L,V)},Ke.useId=function(){return X.current.useId()},Ke.useImperativeHandle=function(L,V,re){return X.current.useImperativeHandle(L,V,re)},Ke.useInsertionEffect=function(L,V){return X.current.useInsertionEffect(L,V)},Ke.useLayoutEffect=function(L,V){return X.current.useLayoutEffect(L,V)},Ke.useMemo=function(L,V){return X.current.useMemo(L,V)},Ke.useReducer=function(L,V,re){return X.current.useReducer(L,V,re)},Ke.useRef=function(L){return X.current.useRef(L)},Ke.useState=function(L){return X.current.useState(L)},Ke.useSyncExternalStore=function(L,V,re){return X.current.useSyncExternalStore(L,V,re)},Ke.useTransition=function(){return X.current.useTransition()},Ke.version="18.3.1",Ke}var m2;function Sc(){return m2||(m2=1,U0.exports=XM()),U0.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 g2;function QM(){if(g2)return du;g2=1;var t=Sc(),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(a,u,d){var h,f={},m=null,x=null;d!==void 0&&(m=""+d),u.key!==void 0&&(m=""+u.key),u.ref!==void 0&&(x=u.ref);for(h in u)r.call(u,h)&&!s.hasOwnProperty(h)&&(f[h]=u[h]);if(a&&a.defaultProps)for(h in u=a.defaultProps,u)f[h]===void 0&&(f[h]=u[h]);return{$$typeof:e,type:a,key:m,ref:x,props:f,_owner:o.current}}return du.Fragment=n,du.jsx=i,du.jsxs=i,du}var y2;function e5(){return y2||(y2=1,H0.exports=QM()),H0.exports}var g=e5(),C=Sc();const ne=Ay(C),vl=YM({__proto__:null,default:ne},[C]);var nf={},W0={exports:{}},Zn={},q0={exports:{}},K0={};/**
|
|
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 x2;function t5(){return x2||(x2=1,(function(t){function e(q,te){var F=q.length;q.push(te);e:for(;0<F;){var L=F-1>>>1,V=q[L];if(0<o(V,te))q[L]=te,q[F]=V,F=L;else break e}}function n(q){return q.length===0?null:q[0]}function r(q){if(q.length===0)return null;var te=q[0],F=q.pop();if(F!==te){q[0]=F;e:for(var L=0,V=q.length,re=V>>>1;L<re;){var he=2*(L+1)-1,ce=q[he],pe=he+1,De=q[pe];if(0>o(ce,F))pe<V&&0>o(De,ce)?(q[L]=De,q[pe]=F,L=pe):(q[L]=ce,q[he]=F,L=he);else if(pe<V&&0>o(De,F))q[L]=De,q[pe]=F,L=pe;else break e}}return te}function o(q,te){var F=q.sortIndex-te.sortIndex;return F!==0?F:q.id-te.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var i=Date,a=i.now();t.unstable_now=function(){return i.now()-a}}var u=[],d=[],h=1,f=null,m=3,x=!1,v=!1,b=!1,k=typeof setTimeout=="function"?setTimeout:null,S=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(q){for(var te=n(d);te!==null;){if(te.callback===null)r(d);else if(te.startTime<=q)r(d),te.sortIndex=te.expirationTime,e(u,te);else break;te=n(d)}}function A(q){if(b=!1,T(q),!v)if(n(u)!==null)v=!0,G(M);else{var te=n(d);te!==null&&X(A,te.startTime-q)}}function M(q,te){v=!1,b&&(b=!1,S(j),j=-1),x=!0;var F=m;try{for(T(te),f=n(u);f!==null&&(!(f.expirationTime>te)||q&&!Z());){var L=f.callback;if(typeof L=="function"){f.callback=null,m=f.priorityLevel;var V=L(f.expirationTime<=te);te=t.unstable_now(),typeof V=="function"?f.callback=V:f===n(u)&&r(u),T(te)}else r(u);f=n(u)}if(f!==null)var re=!0;else{var he=n(d);he!==null&&X(A,he.startTime-te),re=!1}return re}finally{f=null,m=F,x=!1}}var D=!1,P=null,j=-1,I=5,W=-1;function Z(){return!(t.unstable_now()-W<I)}function J(){if(P!==null){var q=t.unstable_now();W=q;var te=!0;try{te=P(!0,q)}finally{te?K():(D=!1,P=null)}}else D=!1}var K;if(typeof _=="function")K=function(){_(J)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,ee=Y.port2;Y.port1.onmessage=J,K=function(){ee.postMessage(null)}}else K=function(){k(J,0)};function G(q){P=q,D||(D=!0,K())}function X(q,te){j=k(function(){q(t.unstable_now())},te)}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(q){q.callback=null},t.unstable_continueExecution=function(){v||x||(v=!0,G(M))},t.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<q?Math.floor(1e3/q):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_getFirstCallbackNode=function(){return n(u)},t.unstable_next=function(q){switch(m){case 1:case 2:case 3:var te=3;break;default:te=m}var F=m;m=te;try{return q()}finally{m=F}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(q,te){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var F=m;m=q;try{return te()}finally{m=F}},t.unstable_scheduleCallback=function(q,te,F){var L=t.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?L+F:L):F=L,q){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=F+V,q={id:h++,callback:te,priorityLevel:q,startTime:F,expirationTime:V,sortIndex:-1},F>L?(q.sortIndex=F,e(d,q),n(u)===null&&q===n(d)&&(b?(S(j),j=-1):b=!0,X(A,F-L))):(q.sortIndex=V,e(u,q),v||x||(v=!0,G(M))),q},t.unstable_shouldYield=Z,t.unstable_wrapCallback=function(q){var te=m;return function(){var F=m;m=te;try{return q.apply(this,arguments)}finally{m=F}}}})(K0)),K0}var v2;function n5(){return v2||(v2=1,q0.exports=t5()),q0.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 b2;function r5(){if(b2)return Zn;b2=1;var t=Sc(),e=n5();function n(l){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+l,p=1;p<arguments.length;p++)c+="&args[]="+encodeURIComponent(arguments[p]);return"Minified React error #"+l+"; 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(l,c){i(l,c),i(l+"Capture",c)}function i(l,c){for(o[l]=c,l=0;l<c.length;l++)r.add(c[l])}var a=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,h={},f={};function m(l){return u.call(f,l)?!0:u.call(h,l)?!1:d.test(l)?f[l]=!0:(h[l]=!0,!1)}function x(l,c,p,y){if(p!==null&&p.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return y?!1:p!==null?!p.acceptsBooleans:(l=l.toLowerCase().slice(0,5),l!=="data-"&&l!=="aria-");default:return!1}}function v(l,c,p,y){if(c===null||typeof c>"u"||x(l,c,p,y))return!0;if(y)return!1;if(p!==null)switch(p.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(l,c,p,y,w,E,N){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=y,this.attributeNamespace=w,this.mustUseProperty=p,this.propertyName=l,this.type=c,this.sanitizeURL=E,this.removeEmptyString=N}var k={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(l){k[l]=new b(l,0,!1,l,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(l){var c=l[0];k[c]=new b(c,1,!1,l[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){k[l]=new b(l,2,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){k[l]=new b(l,2,!1,l,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(l){k[l]=new b(l,3,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){k[l]=new b(l,3,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){k[l]=new b(l,4,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){k[l]=new b(l,6,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){k[l]=new b(l,5,!1,l.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function _(l){return l[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(l){var c=l.replace(S,_);k[c]=new b(c,1,!1,l,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(l){var c=l.replace(S,_);k[c]=new b(c,1,!1,l,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(l){var c=l.replace(S,_);k[c]=new b(c,1,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){k[l]=new b(l,1,!1,l.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(l){k[l]=new b(l,1,!1,l.toLowerCase(),null,!0,!0)});function T(l,c,p,y){var w=k.hasOwnProperty(c)?k[c]:null;(w!==null?w.type!==0:y||!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(v(c,p,w,y)&&(p=null),y||w===null?m(c)&&(p===null?l.removeAttribute(c):l.setAttribute(c,""+p)):w.mustUseProperty?l[w.propertyName]=p===null?w.type===3?!1:"":p:(c=w.attributeName,y=w.attributeNamespace,p===null?l.removeAttribute(c):(w=w.type,p=w===3||w===4&&p===!0?"":""+p,y?l.setAttributeNS(y,c,p):l.setAttribute(c,p))))}var A=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,M=Symbol.for("react.element"),D=Symbol.for("react.portal"),P=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),I=Symbol.for("react.profiler"),W=Symbol.for("react.provider"),Z=Symbol.for("react.context"),J=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),Y=Symbol.for("react.suspense_list"),ee=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),X=Symbol.for("react.offscreen"),q=Symbol.iterator;function te(l){return l===null||typeof l!="object"?null:(l=q&&l[q]||l["@@iterator"],typeof l=="function"?l:null)}var F=Object.assign,L;function V(l){if(L===void 0)try{throw Error()}catch(p){var c=p.stack.trim().match(/\n( *(at )?)/);L=c&&c[1]||""}return`
|
|
34
|
+
`+L+l}var re=!1;function he(l,c){if(!l||re)return"";re=!0;var p=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(U){var y=U}Reflect.construct(l,[],c)}else{try{c.call()}catch(U){y=U}l.call(c.prototype)}else{try{throw Error()}catch(U){y=U}l()}}catch(U){if(U&&y&&typeof U.stack=="string"){for(var w=U.stack.split(`
|
|
35
|
+
`),E=y.stack.split(`
|
|
36
|
+
`),N=w.length-1,O=E.length-1;1<=N&&0<=O&&w[N]!==E[O];)O--;for(;1<=N&&0<=O;N--,O--)if(w[N]!==E[O]){if(N!==1||O!==1)do if(N--,O--,0>O||w[N]!==E[O]){var z=`
|
|
37
|
+
`+w[N].replace(" at new "," at ");return l.displayName&&z.includes("<anonymous>")&&(z=z.replace("<anonymous>",l.displayName)),z}while(1<=N&&0<=O);break}}}finally{re=!1,Error.prepareStackTrace=p}return(l=l?l.displayName||l.name:"")?V(l):""}function ce(l){switch(l.tag){case 5:return V(l.type);case 16:return V("Lazy");case 13:return V("Suspense");case 19:return V("SuspenseList");case 0:case 2:case 15:return l=he(l.type,!1),l;case 11:return l=he(l.type.render,!1),l;case 1:return l=he(l.type,!0),l;default:return""}}function pe(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case P:return"Fragment";case D:return"Portal";case I:return"Profiler";case j:return"StrictMode";case K:return"Suspense";case Y:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case Z:return(l.displayName||"Context")+".Consumer";case W:return(l._context.displayName||"Context")+".Provider";case J:var c=l.render;return l=l.displayName,l||(l=c.displayName||c.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case ee:return c=l.displayName||null,c!==null?c:pe(l.type)||"Memo";case G:c=l._payload,l=l._init;try{return pe(l(c))}catch{}}return null}function De(l){var c=l.type;switch(l.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 l=c.render,l=l.displayName||l.name||"",c.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return pe(c);case 8:return c===j?"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 Q(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function de(l){var c=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function me(l){var c=de(l)?"checked":"value",p=Object.getOwnPropertyDescriptor(l.constructor.prototype,c),y=""+l[c];if(!l.hasOwnProperty(c)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var w=p.get,E=p.set;return Object.defineProperty(l,c,{configurable:!0,get:function(){return w.call(this)},set:function(N){y=""+N,E.call(this,N)}}),Object.defineProperty(l,c,{enumerable:p.enumerable}),{getValue:function(){return y},setValue:function(N){y=""+N},stopTracking:function(){l._valueTracker=null,delete l[c]}}}}function Fe(l){l._valueTracker||(l._valueTracker=me(l))}function Re(l){if(!l)return!1;var c=l._valueTracker;if(!c)return!0;var p=c.getValue(),y="";return l&&(y=de(l)?l.checked?"true":"false":l.value),l=y,l!==p?(c.setValue(l),!0):!1}function Be(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}function Ye(l,c){var p=c.checked;return F({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:p??l._wrapperState.initialChecked})}function At(l,c){var p=c.defaultValue==null?"":c.defaultValue,y=c.checked!=null?c.checked:c.defaultChecked;p=Q(c.value!=null?c.value:p),l._wrapperState={initialChecked:y,initialValue:p,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function zt(l,c){c=c.checked,c!=null&&T(l,"checked",c,!1)}function qt(l,c){zt(l,c);var p=Q(c.value),y=c.type;if(p!=null)y==="number"?(p===0&&l.value===""||l.value!=p)&&(l.value=""+p):l.value!==""+p&&(l.value=""+p);else if(y==="submit"||y==="reset"){l.removeAttribute("value");return}c.hasOwnProperty("value")?Kt(l,c.type,p):c.hasOwnProperty("defaultValue")&&Kt(l,c.type,Q(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(l.defaultChecked=!!c.defaultChecked)}function $n(l,c,p){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var y=c.type;if(!(y!=="submit"&&y!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+l._wrapperState.initialValue,p||c===l.value||(l.value=c),l.defaultValue=c}p=l.name,p!==""&&(l.name=""),l.defaultChecked=!!l._wrapperState.initialChecked,p!==""&&(l.name=p)}function Kt(l,c,p){(c!=="number"||Be(l.ownerDocument)!==l)&&(p==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+p&&(l.defaultValue=""+p))}var nn=Array.isArray;function Dn(l,c,p,y){if(l=l.options,c){c={};for(var w=0;w<p.length;w++)c["$"+p[w]]=!0;for(p=0;p<l.length;p++)w=c.hasOwnProperty("$"+l[p].value),l[p].selected!==w&&(l[p].selected=w),w&&y&&(l[p].defaultSelected=!0)}else{for(p=""+Q(p),c=null,w=0;w<l.length;w++){if(l[w].value===p){l[w].selected=!0,y&&(l[w].defaultSelected=!0);return}c!==null||l[w].disabled||(c=l[w])}c!==null&&(c.selected=!0)}}function pt(l,c){if(c.dangerouslySetInnerHTML!=null)throw Error(n(91));return F({},c,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function pr(l,c){var p=c.value;if(p==null){if(p=c.children,c=c.defaultValue,p!=null){if(c!=null)throw Error(n(92));if(nn(p)){if(1<p.length)throw Error(n(93));p=p[0]}c=p}c==null&&(c=""),p=c}l._wrapperState={initialValue:Q(p)}}function bi(l,c){var p=Q(c.value),y=Q(c.defaultValue);p!=null&&(p=""+p,p!==l.value&&(l.value=p),c.defaultValue==null&&l.defaultValue!==p&&(l.defaultValue=p)),y!=null&&(l.defaultValue=""+y)}function ma(l){var c=l.textContent;c===l._wrapperState.initialValue&&c!==""&&c!==null&&(l.value=c)}function Mo(l){switch(l){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 mr(l,c){return l==null||l==="http://www.w3.org/1999/xhtml"?Mo(c):l==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var Bn,gr=(function(l){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,p,y,w){MSApp.execUnsafeLocalFunction(function(){return l(c,p,y,w)})}:l})(function(l,c){if(l.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in l)l.innerHTML=c;else{for(Bn=Bn||document.createElement("div"),Bn.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=Bn.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;c.firstChild;)l.appendChild(c.firstChild)}});function Rn(l,c){if(c){var p=l.firstChild;if(p&&p===l.lastChild&&p.nodeType===3){p.nodeValue=c;return}}l.textContent=c}var mn={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},Or=["Webkit","ms","Moz","O"];Object.keys(mn).forEach(function(l){Or.forEach(function(c){c=c+l.charAt(0).toUpperCase()+l.substring(1),mn[c]=mn[l]})});function ga(l,c,p){return c==null||typeof c=="boolean"||c===""?"":p||typeof c!="number"||c===0||mn.hasOwnProperty(l)&&mn[l]?(""+c).trim():c+"px"}function ya(l,c){l=l.style;for(var p in c)if(c.hasOwnProperty(p)){var y=p.indexOf("--")===0,w=ga(p,c[p],y);p==="float"&&(p="cssFloat"),y?l.setProperty(p,w):l[p]=w}}var gs=F({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 Do(l,c){if(c){if(gs[l]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(n(137,l));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 ki(l,c){if(l.indexOf("-")===-1)return typeof c.is=="string";switch(l){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 eo=null;function Vn(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var wi=null,to=null,gt=null;function Gt(l){if(l=Zl(l)){if(typeof wi!="function")throw Error(n(280));var c=l.stateNode;c&&(c=yd(c),wi(l.stateNode,l.type,c))}}function Ae(l){to?gt?gt.push(l):gt=[l]:to=l}function it(){if(to){var l=to,c=gt;if(gt=to=null,Gt(l),c)for(l=0;l<c.length;l++)Gt(c[l])}}function tt(l,c){return l(c)}function at(){}var Jt=!1;function mt(l,c,p){if(Jt)return l(c,p);Jt=!0;try{return tt(l,c,p)}finally{Jt=!1,(to!==null||gt!==null)&&(at(),it())}}function Je(l,c){var p=l.stateNode;if(p===null)return null;var y=yd(p);if(y===null)return null;p=y[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":(y=!y.disabled)||(l=l.type,y=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!y;break e;default:l=!1}if(l)return null;if(p&&typeof p!="function")throw Error(n(231,c,typeof p));return p}var gn=!1;if(a)try{var ft={};Object.defineProperty(ft,"passive",{get:function(){gn=!0}}),window.addEventListener("test",ft,ft),window.removeEventListener("test",ft,ft)}catch{gn=!1}function _t(l,c,p,y,w,E,N,O,z){var U=Array.prototype.slice.call(arguments,3);try{c.apply(p,U)}catch(ie){this.onError(ie)}}var Hn=!1,rn=null,Un=!1,Ro=null,Dl={onError:function(l){Hn=!0,rn=l}};function sA(l,c,p,y,w,E,N,O,z){Hn=!1,rn=null,_t.apply(Dl,arguments)}function iA(l,c,p,y,w,E,N,O,z){if(sA.apply(this,arguments),Hn){if(Hn){var U=rn;Hn=!1,rn=null}else throw Error(n(198));Un||(Un=!0,Ro=U)}}function Ci(l){var c=l,p=l;if(l.alternate)for(;c.return;)c=c.return;else{l=c;do c=l,(c.flags&4098)!==0&&(p=c.return),l=c.return;while(l)}return c.tag===3?p:null}function Iv(l){if(l.tag===13){var c=l.memoizedState;if(c===null&&(l=l.alternate,l!==null&&(c=l.memoizedState)),c!==null)return c.dehydrated}return null}function Pv(l){if(Ci(l)!==l)throw Error(n(188))}function aA(l){var c=l.alternate;if(!c){if(c=Ci(l),c===null)throw Error(n(188));return c!==l?null:l}for(var p=l,y=c;;){var w=p.return;if(w===null)break;var E=w.alternate;if(E===null){if(y=w.return,y!==null){p=y;continue}break}if(w.child===E.child){for(E=w.child;E;){if(E===p)return Pv(w),l;if(E===y)return Pv(w),c;E=E.sibling}throw Error(n(188))}if(p.return!==y.return)p=w,y=E;else{for(var N=!1,O=w.child;O;){if(O===p){N=!0,p=w,y=E;break}if(O===y){N=!0,y=w,p=E;break}O=O.sibling}if(!N){for(O=E.child;O;){if(O===p){N=!0,p=E,y=w;break}if(O===y){N=!0,y=E,p=w;break}O=O.sibling}if(!N)throw Error(n(189))}}if(p.alternate!==y)throw Error(n(190))}if(p.tag!==3)throw Error(n(188));return p.stateNode.current===p?l:c}function jv(l){return l=aA(l),l!==null?Lv(l):null}function Lv(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var c=Lv(l);if(c!==null)return c;l=l.sibling}return null}var zv=e.unstable_scheduleCallback,Fv=e.unstable_cancelCallback,lA=e.unstable_shouldYield,uA=e.unstable_requestPaint,Pt=e.unstable_now,cA=e.unstable_getCurrentPriorityLevel,lm=e.unstable_ImmediatePriority,$v=e.unstable_UserBlockingPriority,Yc=e.unstable_NormalPriority,dA=e.unstable_LowPriority,Bv=e.unstable_IdlePriority,Xc=null,no=null;function fA(l){if(no&&typeof no.onCommitFiberRoot=="function")try{no.onCommitFiberRoot(Xc,l,void 0,(l.current.flags&128)===128)}catch{}}var Ir=Math.clz32?Math.clz32:mA,hA=Math.log,pA=Math.LN2;function mA(l){return l>>>=0,l===0?32:31-(hA(l)/pA|0)|0}var Qc=64,ed=4194304;function Rl(l){switch(l&-l){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 l&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return l&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return l}}function td(l,c){var p=l.pendingLanes;if(p===0)return 0;var y=0,w=l.suspendedLanes,E=l.pingedLanes,N=p&268435455;if(N!==0){var O=N&~w;O!==0?y=Rl(O):(E&=N,E!==0&&(y=Rl(E)))}else N=p&~w,N!==0?y=Rl(N):E!==0&&(y=Rl(E));if(y===0)return 0;if(c!==0&&c!==y&&(c&w)===0&&(w=y&-y,E=c&-c,w>=E||w===16&&(E&4194240)!==0))return c;if((y&4)!==0&&(y|=p&16),c=l.entangledLanes,c!==0)for(l=l.entanglements,c&=y;0<c;)p=31-Ir(c),w=1<<p,y|=l[p],c&=~w;return y}function gA(l,c){switch(l){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 yA(l,c){for(var p=l.suspendedLanes,y=l.pingedLanes,w=l.expirationTimes,E=l.pendingLanes;0<E;){var N=31-Ir(E),O=1<<N,z=w[N];z===-1?((O&p)===0||(O&y)!==0)&&(w[N]=gA(O,c)):z<=c&&(l.expiredLanes|=O),E&=~O}}function um(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function Vv(){var l=Qc;return Qc<<=1,(Qc&4194240)===0&&(Qc=64),l}function cm(l){for(var c=[],p=0;31>p;p++)c.push(l);return c}function Ol(l,c,p){l.pendingLanes|=c,c!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,c=31-Ir(c),l[c]=p}function xA(l,c){var p=l.pendingLanes&~c;l.pendingLanes=c,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=c,l.mutableReadLanes&=c,l.entangledLanes&=c,c=l.entanglements;var y=l.eventTimes;for(l=l.expirationTimes;0<p;){var w=31-Ir(p),E=1<<w;c[w]=0,y[w]=-1,l[w]=-1,p&=~E}}function dm(l,c){var p=l.entangledLanes|=c;for(l=l.entanglements;p;){var y=31-Ir(p),w=1<<y;w&c|l[y]&c&&(l[y]|=c),p&=~w}}var ct=0;function Hv(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var Uv,fm,Wv,qv,Kv,hm=!1,nd=[],ys=null,xs=null,vs=null,Il=new Map,Pl=new Map,bs=[],vA="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 Gv(l,c){switch(l){case"focusin":case"focusout":ys=null;break;case"dragenter":case"dragleave":xs=null;break;case"mouseover":case"mouseout":vs=null;break;case"pointerover":case"pointerout":Il.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pl.delete(c.pointerId)}}function jl(l,c,p,y,w,E){return l===null||l.nativeEvent!==E?(l={blockedOn:c,domEventName:p,eventSystemFlags:y,nativeEvent:E,targetContainers:[w]},c!==null&&(c=Zl(c),c!==null&&fm(c)),l):(l.eventSystemFlags|=y,c=l.targetContainers,w!==null&&c.indexOf(w)===-1&&c.push(w),l)}function bA(l,c,p,y,w){switch(c){case"focusin":return ys=jl(ys,l,c,p,y,w),!0;case"dragenter":return xs=jl(xs,l,c,p,y,w),!0;case"mouseover":return vs=jl(vs,l,c,p,y,w),!0;case"pointerover":var E=w.pointerId;return Il.set(E,jl(Il.get(E)||null,l,c,p,y,w)),!0;case"gotpointercapture":return E=w.pointerId,Pl.set(E,jl(Pl.get(E)||null,l,c,p,y,w)),!0}return!1}function Jv(l){var c=Si(l.target);if(c!==null){var p=Ci(c);if(p!==null){if(c=p.tag,c===13){if(c=Iv(p),c!==null){l.blockedOn=c,Kv(l.priority,function(){Wv(p)});return}}else if(c===3&&p.stateNode.current.memoizedState.isDehydrated){l.blockedOn=p.tag===3?p.stateNode.containerInfo:null;return}}}l.blockedOn=null}function rd(l){if(l.blockedOn!==null)return!1;for(var c=l.targetContainers;0<c.length;){var p=mm(l.domEventName,l.eventSystemFlags,c[0],l.nativeEvent);if(p===null){p=l.nativeEvent;var y=new p.constructor(p.type,p);eo=y,p.target.dispatchEvent(y),eo=null}else return c=Zl(p),c!==null&&fm(c),l.blockedOn=p,!1;c.shift()}return!0}function Zv(l,c,p){rd(l)&&p.delete(c)}function kA(){hm=!1,ys!==null&&rd(ys)&&(ys=null),xs!==null&&rd(xs)&&(xs=null),vs!==null&&rd(vs)&&(vs=null),Il.forEach(Zv),Pl.forEach(Zv)}function Ll(l,c){l.blockedOn===c&&(l.blockedOn=null,hm||(hm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,kA)))}function zl(l){function c(w){return Ll(w,l)}if(0<nd.length){Ll(nd[0],l);for(var p=1;p<nd.length;p++){var y=nd[p];y.blockedOn===l&&(y.blockedOn=null)}}for(ys!==null&&Ll(ys,l),xs!==null&&Ll(xs,l),vs!==null&&Ll(vs,l),Il.forEach(c),Pl.forEach(c),p=0;p<bs.length;p++)y=bs[p],y.blockedOn===l&&(y.blockedOn=null);for(;0<bs.length&&(p=bs[0],p.blockedOn===null);)Jv(p),p.blockedOn===null&&bs.shift()}var xa=A.ReactCurrentBatchConfig,od=!0;function wA(l,c,p,y){var w=ct,E=xa.transition;xa.transition=null;try{ct=1,pm(l,c,p,y)}finally{ct=w,xa.transition=E}}function CA(l,c,p,y){var w=ct,E=xa.transition;xa.transition=null;try{ct=4,pm(l,c,p,y)}finally{ct=w,xa.transition=E}}function pm(l,c,p,y){if(od){var w=mm(l,c,p,y);if(w===null)Rm(l,c,y,sd,p),Gv(l,y);else if(bA(w,l,c,p,y))y.stopPropagation();else if(Gv(l,y),c&4&&-1<vA.indexOf(l)){for(;w!==null;){var E=Zl(w);if(E!==null&&Uv(E),E=mm(l,c,p,y),E===null&&Rm(l,c,y,sd,p),E===w)break;w=E}w!==null&&y.stopPropagation()}else Rm(l,c,y,null,p)}}var sd=null;function mm(l,c,p,y){if(sd=null,l=Vn(y),l=Si(l),l!==null)if(c=Ci(l),c===null)l=null;else if(p=c.tag,p===13){if(l=Iv(c),l!==null)return l;l=null}else if(p===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;l=null}else c!==l&&(l=null);return sd=l,null}function Yv(l){switch(l){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(cA()){case lm:return 1;case $v:return 4;case Yc:case dA:return 16;case Bv:return 536870912;default:return 16}default:return 16}}var ks=null,gm=null,id=null;function Xv(){if(id)return id;var l,c=gm,p=c.length,y,w="value"in ks?ks.value:ks.textContent,E=w.length;for(l=0;l<p&&c[l]===w[l];l++);var N=p-l;for(y=1;y<=N&&c[p-y]===w[E-y];y++);return id=w.slice(l,1<y?1-y:void 0)}function ad(l){var c=l.keyCode;return"charCode"in l?(l=l.charCode,l===0&&c===13&&(l=13)):l=c,l===10&&(l=13),32<=l||l===13?l:0}function ld(){return!0}function Qv(){return!1}function rr(l){function c(p,y,w,E,N){this._reactName=p,this._targetInst=w,this.type=y,this.nativeEvent=E,this.target=N,this.currentTarget=null;for(var O in l)l.hasOwnProperty(O)&&(p=l[O],this[O]=p?p(E):E[O]);return this.isDefaultPrevented=(E.defaultPrevented!=null?E.defaultPrevented:E.returnValue===!1)?ld:Qv,this.isPropagationStopped=Qv,this}return F(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var p=this.nativeEvent;p&&(p.preventDefault?p.preventDefault():typeof p.returnValue!="unknown"&&(p.returnValue=!1),this.isDefaultPrevented=ld)},stopPropagation:function(){var p=this.nativeEvent;p&&(p.stopPropagation?p.stopPropagation():typeof p.cancelBubble!="unknown"&&(p.cancelBubble=!0),this.isPropagationStopped=ld)},persist:function(){},isPersistent:ld}),c}var va={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ym=rr(va),Fl=F({},va,{view:0,detail:0}),SA=rr(Fl),xm,vm,$l,ud=F({},Fl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:km,button:0,buttons:0,relatedTarget:function(l){return l.relatedTarget===void 0?l.fromElement===l.srcElement?l.toElement:l.fromElement:l.relatedTarget},movementX:function(l){return"movementX"in l?l.movementX:(l!==$l&&($l&&l.type==="mousemove"?(xm=l.screenX-$l.screenX,vm=l.screenY-$l.screenY):vm=xm=0,$l=l),xm)},movementY:function(l){return"movementY"in l?l.movementY:vm}}),eb=rr(ud),EA=F({},ud,{dataTransfer:0}),_A=rr(EA),TA=F({},Fl,{relatedTarget:0}),bm=rr(TA),NA=F({},va,{animationName:0,elapsedTime:0,pseudoElement:0}),AA=rr(NA),MA=F({},va,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),DA=rr(MA),RA=F({},va,{data:0}),tb=rr(RA),OA={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},IA={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"},PA={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function jA(l){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(l):(l=PA[l])?!!c[l]:!1}function km(){return jA}var LA=F({},Fl,{key:function(l){if(l.key){var c=OA[l.key]||l.key;if(c!=="Unidentified")return c}return l.type==="keypress"?(l=ad(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?IA[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:km,charCode:function(l){return l.type==="keypress"?ad(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?ad(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),zA=rr(LA),FA=F({},ud,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nb=rr(FA),$A=F({},Fl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:km}),BA=rr($A),VA=F({},va,{propertyName:0,elapsedTime:0,pseudoElement:0}),HA=rr(VA),UA=F({},ud,{deltaX:function(l){return"deltaX"in l?l.deltaX:"wheelDeltaX"in l?-l.wheelDeltaX:0},deltaY:function(l){return"deltaY"in l?l.deltaY:"wheelDeltaY"in l?-l.wheelDeltaY:"wheelDelta"in l?-l.wheelDelta:0},deltaZ:0,deltaMode:0}),WA=rr(UA),qA=[9,13,27,32],wm=a&&"CompositionEvent"in window,Bl=null;a&&"documentMode"in document&&(Bl=document.documentMode);var KA=a&&"TextEvent"in window&&!Bl,rb=a&&(!wm||Bl&&8<Bl&&11>=Bl),ob=" ",sb=!1;function ib(l,c){switch(l){case"keyup":return qA.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ab(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var ba=!1;function GA(l,c){switch(l){case"compositionend":return ab(c);case"keypress":return c.which!==32?null:(sb=!0,ob);case"textInput":return l=c.data,l===ob&&sb?null:l;default:return null}}function JA(l,c){if(ba)return l==="compositionend"||!wm&&ib(l,c)?(l=Xv(),id=gm=ks=null,ba=!1,l):null;switch(l){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 rb&&c.locale!=="ko"?null:c.data;default:return null}}var ZA={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 lb(l){var c=l&&l.nodeName&&l.nodeName.toLowerCase();return c==="input"?!!ZA[l.type]:c==="textarea"}function ub(l,c,p,y){Ae(y),c=pd(c,"onChange"),0<c.length&&(p=new ym("onChange","change",null,p,y),l.push({event:p,listeners:c}))}var Vl=null,Hl=null;function YA(l){Tb(l,0)}function cd(l){var c=Ea(l);if(Re(c))return l}function XA(l,c){if(l==="change")return c}var cb=!1;if(a){var Cm;if(a){var Sm="oninput"in document;if(!Sm){var db=document.createElement("div");db.setAttribute("oninput","return;"),Sm=typeof db.oninput=="function"}Cm=Sm}else Cm=!1;cb=Cm&&(!document.documentMode||9<document.documentMode)}function fb(){Vl&&(Vl.detachEvent("onpropertychange",hb),Hl=Vl=null)}function hb(l){if(l.propertyName==="value"&&cd(Hl)){var c=[];ub(c,Hl,l,Vn(l)),mt(YA,c)}}function QA(l,c,p){l==="focusin"?(fb(),Vl=c,Hl=p,Vl.attachEvent("onpropertychange",hb)):l==="focusout"&&fb()}function eM(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return cd(Hl)}function tM(l,c){if(l==="click")return cd(c)}function nM(l,c){if(l==="input"||l==="change")return cd(c)}function rM(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}var Pr=typeof Object.is=="function"?Object.is:rM;function Ul(l,c){if(Pr(l,c))return!0;if(typeof l!="object"||l===null||typeof c!="object"||c===null)return!1;var p=Object.keys(l),y=Object.keys(c);if(p.length!==y.length)return!1;for(y=0;y<p.length;y++){var w=p[y];if(!u.call(c,w)||!Pr(l[w],c[w]))return!1}return!0}function pb(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function mb(l,c){var p=pb(l);l=0;for(var y;p;){if(p.nodeType===3){if(y=l+p.textContent.length,l<=c&&y>=c)return{node:p,offset:c-l};l=y}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=pb(p)}}function gb(l,c){return l&&c?l===c?!0:l&&l.nodeType===3?!1:c&&c.nodeType===3?gb(l,c.parentNode):"contains"in l?l.contains(c):l.compareDocumentPosition?!!(l.compareDocumentPosition(c)&16):!1:!1}function yb(){for(var l=window,c=Be();c instanceof l.HTMLIFrameElement;){try{var p=typeof c.contentWindow.location.href=="string"}catch{p=!1}if(p)l=c.contentWindow;else break;c=Be(l.document)}return c}function Em(l){var c=l&&l.nodeName&&l.nodeName.toLowerCase();return c&&(c==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||c==="textarea"||l.contentEditable==="true")}function oM(l){var c=yb(),p=l.focusedElem,y=l.selectionRange;if(c!==p&&p&&p.ownerDocument&&gb(p.ownerDocument.documentElement,p)){if(y!==null&&Em(p)){if(c=y.start,l=y.end,l===void 0&&(l=c),"selectionStart"in p)p.selectionStart=c,p.selectionEnd=Math.min(l,p.value.length);else if(l=(c=p.ownerDocument||document)&&c.defaultView||window,l.getSelection){l=l.getSelection();var w=p.textContent.length,E=Math.min(y.start,w);y=y.end===void 0?E:Math.min(y.end,w),!l.extend&&E>y&&(w=y,y=E,E=w),w=mb(p,E);var N=mb(p,y);w&&N&&(l.rangeCount!==1||l.anchorNode!==w.node||l.anchorOffset!==w.offset||l.focusNode!==N.node||l.focusOffset!==N.offset)&&(c=c.createRange(),c.setStart(w.node,w.offset),l.removeAllRanges(),E>y?(l.addRange(c),l.extend(N.node,N.offset)):(c.setEnd(N.node,N.offset),l.addRange(c)))}}for(c=[],l=p;l=l.parentNode;)l.nodeType===1&&c.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<c.length;p++)l=c[p],l.element.scrollLeft=l.left,l.element.scrollTop=l.top}}var sM=a&&"documentMode"in document&&11>=document.documentMode,ka=null,_m=null,Wl=null,Tm=!1;function xb(l,c,p){var y=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;Tm||ka==null||ka!==Be(y)||(y=ka,"selectionStart"in y&&Em(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),Wl&&Ul(Wl,y)||(Wl=y,y=pd(_m,"onSelect"),0<y.length&&(c=new ym("onSelect","select",null,c,p),l.push({event:c,listeners:y}),c.target=ka)))}function dd(l,c){var p={};return p[l.toLowerCase()]=c.toLowerCase(),p["Webkit"+l]="webkit"+c,p["Moz"+l]="moz"+c,p}var wa={animationend:dd("Animation","AnimationEnd"),animationiteration:dd("Animation","AnimationIteration"),animationstart:dd("Animation","AnimationStart"),transitionend:dd("Transition","TransitionEnd")},Nm={},vb={};a&&(vb=document.createElement("div").style,"AnimationEvent"in window||(delete wa.animationend.animation,delete wa.animationiteration.animation,delete wa.animationstart.animation),"TransitionEvent"in window||delete wa.transitionend.transition);function fd(l){if(Nm[l])return Nm[l];if(!wa[l])return l;var c=wa[l],p;for(p in c)if(c.hasOwnProperty(p)&&p in vb)return Nm[l]=c[p];return l}var bb=fd("animationend"),kb=fd("animationiteration"),wb=fd("animationstart"),Cb=fd("transitionend"),Sb=new Map,Eb="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 ws(l,c){Sb.set(l,c),s(c,[l])}for(var Am=0;Am<Eb.length;Am++){var Mm=Eb[Am],iM=Mm.toLowerCase(),aM=Mm[0].toUpperCase()+Mm.slice(1);ws(iM,"on"+aM)}ws(bb,"onAnimationEnd"),ws(kb,"onAnimationIteration"),ws(wb,"onAnimationStart"),ws("dblclick","onDoubleClick"),ws("focusin","onFocus"),ws("focusout","onBlur"),ws(Cb,"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 ql="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(" "),lM=new Set("cancel close invalid load scroll toggle".split(" ").concat(ql));function _b(l,c,p){var y=l.type||"unknown-event";l.currentTarget=p,iA(y,c,void 0,l),l.currentTarget=null}function Tb(l,c){c=(c&4)!==0;for(var p=0;p<l.length;p++){var y=l[p],w=y.event;y=y.listeners;e:{var E=void 0;if(c)for(var N=y.length-1;0<=N;N--){var O=y[N],z=O.instance,U=O.currentTarget;if(O=O.listener,z!==E&&w.isPropagationStopped())break e;_b(w,O,U),E=z}else for(N=0;N<y.length;N++){if(O=y[N],z=O.instance,U=O.currentTarget,O=O.listener,z!==E&&w.isPropagationStopped())break e;_b(w,O,U),E=z}}}if(Un)throw l=Ro,Un=!1,Ro=null,l}function bt(l,c){var p=c[zm];p===void 0&&(p=c[zm]=new Set);var y=l+"__bubble";p.has(y)||(Nb(c,l,2,!1),p.add(y))}function Dm(l,c,p){var y=0;c&&(y|=4),Nb(p,l,y,c)}var hd="_reactListening"+Math.random().toString(36).slice(2);function Kl(l){if(!l[hd]){l[hd]=!0,r.forEach(function(p){p!=="selectionchange"&&(lM.has(p)||Dm(p,!1,l),Dm(p,!0,l))});var c=l.nodeType===9?l:l.ownerDocument;c===null||c[hd]||(c[hd]=!0,Dm("selectionchange",!1,c))}}function Nb(l,c,p,y){switch(Yv(c)){case 1:var w=wA;break;case 4:w=CA;break;default:w=pm}p=w.bind(null,c,p,l),w=void 0,!gn||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(w=!0),y?w!==void 0?l.addEventListener(c,p,{capture:!0,passive:w}):l.addEventListener(c,p,!0):w!==void 0?l.addEventListener(c,p,{passive:w}):l.addEventListener(c,p,!1)}function Rm(l,c,p,y,w){var E=y;if((c&1)===0&&(c&2)===0&&y!==null)e:for(;;){if(y===null)return;var N=y.tag;if(N===3||N===4){var O=y.stateNode.containerInfo;if(O===w||O.nodeType===8&&O.parentNode===w)break;if(N===4)for(N=y.return;N!==null;){var z=N.tag;if((z===3||z===4)&&(z=N.stateNode.containerInfo,z===w||z.nodeType===8&&z.parentNode===w))return;N=N.return}for(;O!==null;){if(N=Si(O),N===null)return;if(z=N.tag,z===5||z===6){y=E=N;continue e}O=O.parentNode}}y=y.return}mt(function(){var U=E,ie=Vn(p),ae=[];e:{var se=Sb.get(l);if(se!==void 0){var ge=ym,Ce=l;switch(l){case"keypress":if(ad(p)===0)break e;case"keydown":case"keyup":ge=zA;break;case"focusin":Ce="focus",ge=bm;break;case"focusout":Ce="blur",ge=bm;break;case"beforeblur":case"afterblur":ge=bm;break;case"click":if(p.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ge=eb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ge=_A;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ge=BA;break;case bb:case kb:case wb:ge=AA;break;case Cb:ge=HA;break;case"scroll":ge=SA;break;case"wheel":ge=WA;break;case"copy":case"cut":case"paste":ge=DA;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ge=nb}var Se=(c&4)!==0,jt=!Se&&l==="scroll",B=Se?se!==null?se+"Capture":null:se;Se=[];for(var $=U,H;$!==null;){H=$;var fe=H.stateNode;if(H.tag===5&&fe!==null&&(H=fe,B!==null&&(fe=Je($,B),fe!=null&&Se.push(Gl($,fe,H)))),jt)break;$=$.return}0<Se.length&&(se=new ge(se,Ce,null,p,ie),ae.push({event:se,listeners:Se}))}}if((c&7)===0){e:{if(se=l==="mouseover"||l==="pointerover",ge=l==="mouseout"||l==="pointerout",se&&p!==eo&&(Ce=p.relatedTarget||p.fromElement)&&(Si(Ce)||Ce[Oo]))break e;if((ge||se)&&(se=ie.window===ie?ie:(se=ie.ownerDocument)?se.defaultView||se.parentWindow:window,ge?(Ce=p.relatedTarget||p.toElement,ge=U,Ce=Ce?Si(Ce):null,Ce!==null&&(jt=Ci(Ce),Ce!==jt||Ce.tag!==5&&Ce.tag!==6)&&(Ce=null)):(ge=null,Ce=U),ge!==Ce)){if(Se=eb,fe="onMouseLeave",B="onMouseEnter",$="mouse",(l==="pointerout"||l==="pointerover")&&(Se=nb,fe="onPointerLeave",B="onPointerEnter",$="pointer"),jt=ge==null?se:Ea(ge),H=Ce==null?se:Ea(Ce),se=new Se(fe,$+"leave",ge,p,ie),se.target=jt,se.relatedTarget=H,fe=null,Si(ie)===U&&(Se=new Se(B,$+"enter",Ce,p,ie),Se.target=H,Se.relatedTarget=jt,fe=Se),jt=fe,ge&&Ce)t:{for(Se=ge,B=Ce,$=0,H=Se;H;H=Ca(H))$++;for(H=0,fe=B;fe;fe=Ca(fe))H++;for(;0<$-H;)Se=Ca(Se),$--;for(;0<H-$;)B=Ca(B),H--;for(;$--;){if(Se===B||B!==null&&Se===B.alternate)break t;Se=Ca(Se),B=Ca(B)}Se=null}else Se=null;ge!==null&&Ab(ae,se,ge,Se,!1),Ce!==null&&jt!==null&&Ab(ae,jt,Ce,Se,!0)}}e:{if(se=U?Ea(U):window,ge=se.nodeName&&se.nodeName.toLowerCase(),ge==="select"||ge==="input"&&se.type==="file")var Te=XA;else if(lb(se))if(cb)Te=nM;else{Te=eM;var je=QA}else(ge=se.nodeName)&&ge.toLowerCase()==="input"&&(se.type==="checkbox"||se.type==="radio")&&(Te=tM);if(Te&&(Te=Te(l,U))){ub(ae,Te,p,ie);break e}je&&je(l,se,U),l==="focusout"&&(je=se._wrapperState)&&je.controlled&&se.type==="number"&&Kt(se,"number",se.value)}switch(je=U?Ea(U):window,l){case"focusin":(lb(je)||je.contentEditable==="true")&&(ka=je,_m=U,Wl=null);break;case"focusout":Wl=_m=ka=null;break;case"mousedown":Tm=!0;break;case"contextmenu":case"mouseup":case"dragend":Tm=!1,xb(ae,p,ie);break;case"selectionchange":if(sM)break;case"keydown":case"keyup":xb(ae,p,ie)}var Le;if(wm)e:{switch(l){case"compositionstart":var $e="onCompositionStart";break e;case"compositionend":$e="onCompositionEnd";break e;case"compositionupdate":$e="onCompositionUpdate";break e}$e=void 0}else ba?ib(l,p)&&($e="onCompositionEnd"):l==="keydown"&&p.keyCode===229&&($e="onCompositionStart");$e&&(rb&&p.locale!=="ko"&&(ba||$e!=="onCompositionStart"?$e==="onCompositionEnd"&&ba&&(Le=Xv()):(ks=ie,gm="value"in ks?ks.value:ks.textContent,ba=!0)),je=pd(U,$e),0<je.length&&($e=new tb($e,l,null,p,ie),ae.push({event:$e,listeners:je}),Le?$e.data=Le:(Le=ab(p),Le!==null&&($e.data=Le)))),(Le=KA?GA(l,p):JA(l,p))&&(U=pd(U,"onBeforeInput"),0<U.length&&(ie=new tb("onBeforeInput","beforeinput",null,p,ie),ae.push({event:ie,listeners:U}),ie.data=Le))}Tb(ae,c)})}function Gl(l,c,p){return{instance:l,listener:c,currentTarget:p}}function pd(l,c){for(var p=c+"Capture",y=[];l!==null;){var w=l,E=w.stateNode;w.tag===5&&E!==null&&(w=E,E=Je(l,p),E!=null&&y.unshift(Gl(l,E,w)),E=Je(l,c),E!=null&&y.push(Gl(l,E,w))),l=l.return}return y}function Ca(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5);return l||null}function Ab(l,c,p,y,w){for(var E=c._reactName,N=[];p!==null&&p!==y;){var O=p,z=O.alternate,U=O.stateNode;if(z!==null&&z===y)break;O.tag===5&&U!==null&&(O=U,w?(z=Je(p,E),z!=null&&N.unshift(Gl(p,z,O))):w||(z=Je(p,E),z!=null&&N.push(Gl(p,z,O)))),p=p.return}N.length!==0&&l.push({event:c,listeners:N})}var uM=/\r\n?/g,cM=/\u0000|\uFFFD/g;function Mb(l){return(typeof l=="string"?l:""+l).replace(uM,`
|
|
38
|
+
`).replace(cM,"")}function md(l,c,p){if(c=Mb(c),Mb(l)!==c&&p)throw Error(n(425))}function gd(){}var Om=null,Im=null;function Pm(l,c){return l==="textarea"||l==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var jm=typeof setTimeout=="function"?setTimeout:void 0,dM=typeof clearTimeout=="function"?clearTimeout:void 0,Db=typeof Promise=="function"?Promise:void 0,fM=typeof queueMicrotask=="function"?queueMicrotask:typeof Db<"u"?function(l){return Db.resolve(null).then(l).catch(hM)}:jm;function hM(l){setTimeout(function(){throw l})}function Lm(l,c){var p=c,y=0;do{var w=p.nextSibling;if(l.removeChild(p),w&&w.nodeType===8)if(p=w.data,p==="/$"){if(y===0){l.removeChild(w),zl(c);return}y--}else p!=="$"&&p!=="$?"&&p!=="$!"||y++;p=w}while(p);zl(c)}function Cs(l){for(;l!=null;l=l.nextSibling){var c=l.nodeType;if(c===1||c===3)break;if(c===8){if(c=l.data,c==="$"||c==="$!"||c==="$?")break;if(c==="/$")return null}}return l}function Rb(l){l=l.previousSibling;for(var c=0;l;){if(l.nodeType===8){var p=l.data;if(p==="$"||p==="$!"||p==="$?"){if(c===0)return l;c--}else p==="/$"&&c++}l=l.previousSibling}return null}var Sa=Math.random().toString(36).slice(2),ro="__reactFiber$"+Sa,Jl="__reactProps$"+Sa,Oo="__reactContainer$"+Sa,zm="__reactEvents$"+Sa,pM="__reactListeners$"+Sa,mM="__reactHandles$"+Sa;function Si(l){var c=l[ro];if(c)return c;for(var p=l.parentNode;p;){if(c=p[Oo]||p[ro]){if(p=c.alternate,c.child!==null||p!==null&&p.child!==null)for(l=Rb(l);l!==null;){if(p=l[ro])return p;l=Rb(l)}return c}l=p,p=l.parentNode}return null}function Zl(l){return l=l[ro]||l[Oo],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function Ea(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(n(33))}function yd(l){return l[Jl]||null}var Fm=[],_a=-1;function Ss(l){return{current:l}}function kt(l){0>_a||(l.current=Fm[_a],Fm[_a]=null,_a--)}function yt(l,c){_a++,Fm[_a]=l.current,l.current=c}var Es={},Cn=Ss(Es),Wn=Ss(!1),Ei=Es;function Ta(l,c){var p=l.type.contextTypes;if(!p)return Es;var y=l.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===c)return y.__reactInternalMemoizedMaskedChildContext;var w={},E;for(E in p)w[E]=c[E];return y&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=c,l.__reactInternalMemoizedMaskedChildContext=w),w}function qn(l){return l=l.childContextTypes,l!=null}function xd(){kt(Wn),kt(Cn)}function Ob(l,c,p){if(Cn.current!==Es)throw Error(n(168));yt(Cn,c),yt(Wn,p)}function Ib(l,c,p){var y=l.stateNode;if(c=c.childContextTypes,typeof y.getChildContext!="function")return p;y=y.getChildContext();for(var w in y)if(!(w in c))throw Error(n(108,De(l)||"Unknown",w));return F({},p,y)}function vd(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||Es,Ei=Cn.current,yt(Cn,l),yt(Wn,Wn.current),!0}function Pb(l,c,p){var y=l.stateNode;if(!y)throw Error(n(169));p?(l=Ib(l,c,Ei),y.__reactInternalMemoizedMergedChildContext=l,kt(Wn),kt(Cn),yt(Cn,l)):kt(Wn),yt(Wn,p)}var Io=null,bd=!1,$m=!1;function jb(l){Io===null?Io=[l]:Io.push(l)}function gM(l){bd=!0,jb(l)}function _s(){if(!$m&&Io!==null){$m=!0;var l=0,c=ct;try{var p=Io;for(ct=1;l<p.length;l++){var y=p[l];do y=y(!0);while(y!==null)}Io=null,bd=!1}catch(w){throw Io!==null&&(Io=Io.slice(l+1)),zv(lm,_s),w}finally{ct=c,$m=!1}}return null}var Na=[],Aa=0,kd=null,wd=0,yr=[],xr=0,_i=null,Po=1,jo="";function Ti(l,c){Na[Aa++]=wd,Na[Aa++]=kd,kd=l,wd=c}function Lb(l,c,p){yr[xr++]=Po,yr[xr++]=jo,yr[xr++]=_i,_i=l;var y=Po;l=jo;var w=32-Ir(y)-1;y&=~(1<<w),p+=1;var E=32-Ir(c)+w;if(30<E){var N=w-w%5;E=(y&(1<<N)-1).toString(32),y>>=N,w-=N,Po=1<<32-Ir(c)+w|p<<w|y,jo=E+l}else Po=1<<E|p<<w|y,jo=l}function Bm(l){l.return!==null&&(Ti(l,1),Lb(l,1,0))}function Vm(l){for(;l===kd;)kd=Na[--Aa],Na[Aa]=null,wd=Na[--Aa],Na[Aa]=null;for(;l===_i;)_i=yr[--xr],yr[xr]=null,jo=yr[--xr],yr[xr]=null,Po=yr[--xr],yr[xr]=null}var or=null,sr=null,Et=!1,jr=null;function zb(l,c){var p=wr(5,null,null,0);p.elementType="DELETED",p.stateNode=c,p.return=l,c=l.deletions,c===null?(l.deletions=[p],l.flags|=16):c.push(p)}function Fb(l,c){switch(l.tag){case 5:var p=l.type;return c=c.nodeType!==1||p.toLowerCase()!==c.nodeName.toLowerCase()?null:c,c!==null?(l.stateNode=c,or=l,sr=Cs(c.firstChild),!0):!1;case 6:return c=l.pendingProps===""||c.nodeType!==3?null:c,c!==null?(l.stateNode=c,or=l,sr=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(p=_i!==null?{id:Po,overflow:jo}:null,l.memoizedState={dehydrated:c,treeContext:p,retryLane:1073741824},p=wr(18,null,null,0),p.stateNode=c,p.return=l,l.child=p,or=l,sr=null,!0):!1;default:return!1}}function Hm(l){return(l.mode&1)!==0&&(l.flags&128)===0}function Um(l){if(Et){var c=sr;if(c){var p=c;if(!Fb(l,c)){if(Hm(l))throw Error(n(418));c=Cs(p.nextSibling);var y=or;c&&Fb(l,c)?zb(y,p):(l.flags=l.flags&-4097|2,Et=!1,or=l)}}else{if(Hm(l))throw Error(n(418));l.flags=l.flags&-4097|2,Et=!1,or=l}}}function $b(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;or=l}function Cd(l){if(l!==or)return!1;if(!Et)return $b(l),Et=!0,!1;var c;if((c=l.tag!==3)&&!(c=l.tag!==5)&&(c=l.type,c=c!=="head"&&c!=="body"&&!Pm(l.type,l.memoizedProps)),c&&(c=sr)){if(Hm(l))throw Bb(),Error(n(418));for(;c;)zb(l,c),c=Cs(c.nextSibling)}if($b(l),l.tag===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(n(317));e:{for(l=l.nextSibling,c=0;l;){if(l.nodeType===8){var p=l.data;if(p==="/$"){if(c===0){sr=Cs(l.nextSibling);break e}c--}else p!=="$"&&p!=="$!"&&p!=="$?"||c++}l=l.nextSibling}sr=null}}else sr=or?Cs(l.stateNode.nextSibling):null;return!0}function Bb(){for(var l=sr;l;)l=Cs(l.nextSibling)}function Ma(){sr=or=null,Et=!1}function Wm(l){jr===null?jr=[l]:jr.push(l)}var yM=A.ReactCurrentBatchConfig;function Yl(l,c,p){if(l=p.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(p._owner){if(p=p._owner,p){if(p.tag!==1)throw Error(n(309));var y=p.stateNode}if(!y)throw Error(n(147,l));var w=y,E=""+l;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===E?c.ref:(c=function(N){var O=w.refs;N===null?delete O[E]:O[E]=N},c._stringRef=E,c)}if(typeof l!="string")throw Error(n(284));if(!p._owner)throw Error(n(290,l))}return l}function Sd(l,c){throw l=Object.prototype.toString.call(c),Error(n(31,l==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":l))}function Vb(l){var c=l._init;return c(l._payload)}function Hb(l){function c(B,$){if(l){var H=B.deletions;H===null?(B.deletions=[$],B.flags|=16):H.push($)}}function p(B,$){if(!l)return null;for(;$!==null;)c(B,$),$=$.sibling;return null}function y(B,$){for(B=new Map;$!==null;)$.key!==null?B.set($.key,$):B.set($.index,$),$=$.sibling;return B}function w(B,$){return B=Is(B,$),B.index=0,B.sibling=null,B}function E(B,$,H){return B.index=H,l?(H=B.alternate,H!==null?(H=H.index,H<$?(B.flags|=2,$):H):(B.flags|=2,$)):(B.flags|=1048576,$)}function N(B){return l&&B.alternate===null&&(B.flags|=2),B}function O(B,$,H,fe){return $===null||$.tag!==6?($=j0(H,B.mode,fe),$.return=B,$):($=w($,H),$.return=B,$)}function z(B,$,H,fe){var Te=H.type;return Te===P?ie(B,$,H.props.children,fe,H.key):$!==null&&($.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===G&&Vb(Te)===$.type)?(fe=w($,H.props),fe.ref=Yl(B,$,H),fe.return=B,fe):(fe=Gd(H.type,H.key,H.props,null,B.mode,fe),fe.ref=Yl(B,$,H),fe.return=B,fe)}function U(B,$,H,fe){return $===null||$.tag!==4||$.stateNode.containerInfo!==H.containerInfo||$.stateNode.implementation!==H.implementation?($=L0(H,B.mode,fe),$.return=B,$):($=w($,H.children||[]),$.return=B,$)}function ie(B,$,H,fe,Te){return $===null||$.tag!==7?($=Pi(H,B.mode,fe,Te),$.return=B,$):($=w($,H),$.return=B,$)}function ae(B,$,H){if(typeof $=="string"&&$!==""||typeof $=="number")return $=j0(""+$,B.mode,H),$.return=B,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case M:return H=Gd($.type,$.key,$.props,null,B.mode,H),H.ref=Yl(B,null,$),H.return=B,H;case D:return $=L0($,B.mode,H),$.return=B,$;case G:var fe=$._init;return ae(B,fe($._payload),H)}if(nn($)||te($))return $=Pi($,B.mode,H,null),$.return=B,$;Sd(B,$)}return null}function se(B,$,H,fe){var Te=$!==null?$.key:null;if(typeof H=="string"&&H!==""||typeof H=="number")return Te!==null?null:O(B,$,""+H,fe);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case M:return H.key===Te?z(B,$,H,fe):null;case D:return H.key===Te?U(B,$,H,fe):null;case G:return Te=H._init,se(B,$,Te(H._payload),fe)}if(nn(H)||te(H))return Te!==null?null:ie(B,$,H,fe,null);Sd(B,H)}return null}function ge(B,$,H,fe,Te){if(typeof fe=="string"&&fe!==""||typeof fe=="number")return B=B.get(H)||null,O($,B,""+fe,Te);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case M:return B=B.get(fe.key===null?H:fe.key)||null,z($,B,fe,Te);case D:return B=B.get(fe.key===null?H:fe.key)||null,U($,B,fe,Te);case G:var je=fe._init;return ge(B,$,H,je(fe._payload),Te)}if(nn(fe)||te(fe))return B=B.get(H)||null,ie($,B,fe,Te,null);Sd($,fe)}return null}function Ce(B,$,H,fe){for(var Te=null,je=null,Le=$,$e=$=0,an=null;Le!==null&&$e<H.length;$e++){Le.index>$e?(an=Le,Le=null):an=Le.sibling;var nt=se(B,Le,H[$e],fe);if(nt===null){Le===null&&(Le=an);break}l&&Le&&nt.alternate===null&&c(B,Le),$=E(nt,$,$e),je===null?Te=nt:je.sibling=nt,je=nt,Le=an}if($e===H.length)return p(B,Le),Et&&Ti(B,$e),Te;if(Le===null){for(;$e<H.length;$e++)Le=ae(B,H[$e],fe),Le!==null&&($=E(Le,$,$e),je===null?Te=Le:je.sibling=Le,je=Le);return Et&&Ti(B,$e),Te}for(Le=y(B,Le);$e<H.length;$e++)an=ge(Le,B,$e,H[$e],fe),an!==null&&(l&&an.alternate!==null&&Le.delete(an.key===null?$e:an.key),$=E(an,$,$e),je===null?Te=an:je.sibling=an,je=an);return l&&Le.forEach(function(Ps){return c(B,Ps)}),Et&&Ti(B,$e),Te}function Se(B,$,H,fe){var Te=te(H);if(typeof Te!="function")throw Error(n(150));if(H=Te.call(H),H==null)throw Error(n(151));for(var je=Te=null,Le=$,$e=$=0,an=null,nt=H.next();Le!==null&&!nt.done;$e++,nt=H.next()){Le.index>$e?(an=Le,Le=null):an=Le.sibling;var Ps=se(B,Le,nt.value,fe);if(Ps===null){Le===null&&(Le=an);break}l&&Le&&Ps.alternate===null&&c(B,Le),$=E(Ps,$,$e),je===null?Te=Ps:je.sibling=Ps,je=Ps,Le=an}if(nt.done)return p(B,Le),Et&&Ti(B,$e),Te;if(Le===null){for(;!nt.done;$e++,nt=H.next())nt=ae(B,nt.value,fe),nt!==null&&($=E(nt,$,$e),je===null?Te=nt:je.sibling=nt,je=nt);return Et&&Ti(B,$e),Te}for(Le=y(B,Le);!nt.done;$e++,nt=H.next())nt=ge(Le,B,$e,nt.value,fe),nt!==null&&(l&&nt.alternate!==null&&Le.delete(nt.key===null?$e:nt.key),$=E(nt,$,$e),je===null?Te=nt:je.sibling=nt,je=nt);return l&&Le.forEach(function(ZM){return c(B,ZM)}),Et&&Ti(B,$e),Te}function jt(B,$,H,fe){if(typeof H=="object"&&H!==null&&H.type===P&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case M:e:{for(var Te=H.key,je=$;je!==null;){if(je.key===Te){if(Te=H.type,Te===P){if(je.tag===7){p(B,je.sibling),$=w(je,H.props.children),$.return=B,B=$;break e}}else if(je.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===G&&Vb(Te)===je.type){p(B,je.sibling),$=w(je,H.props),$.ref=Yl(B,je,H),$.return=B,B=$;break e}p(B,je);break}else c(B,je);je=je.sibling}H.type===P?($=Pi(H.props.children,B.mode,fe,H.key),$.return=B,B=$):(fe=Gd(H.type,H.key,H.props,null,B.mode,fe),fe.ref=Yl(B,$,H),fe.return=B,B=fe)}return N(B);case D:e:{for(je=H.key;$!==null;){if($.key===je)if($.tag===4&&$.stateNode.containerInfo===H.containerInfo&&$.stateNode.implementation===H.implementation){p(B,$.sibling),$=w($,H.children||[]),$.return=B,B=$;break e}else{p(B,$);break}else c(B,$);$=$.sibling}$=L0(H,B.mode,fe),$.return=B,B=$}return N(B);case G:return je=H._init,jt(B,$,je(H._payload),fe)}if(nn(H))return Ce(B,$,H,fe);if(te(H))return Se(B,$,H,fe);Sd(B,H)}return typeof H=="string"&&H!==""||typeof H=="number"?(H=""+H,$!==null&&$.tag===6?(p(B,$.sibling),$=w($,H),$.return=B,B=$):(p(B,$),$=j0(H,B.mode,fe),$.return=B,B=$),N(B)):p(B,$)}return jt}var Da=Hb(!0),Ub=Hb(!1),Ed=Ss(null),_d=null,Ra=null,qm=null;function Km(){qm=Ra=_d=null}function Gm(l){var c=Ed.current;kt(Ed),l._currentValue=c}function Jm(l,c,p){for(;l!==null;){var y=l.alternate;if((l.childLanes&c)!==c?(l.childLanes|=c,y!==null&&(y.childLanes|=c)):y!==null&&(y.childLanes&c)!==c&&(y.childLanes|=c),l===p)break;l=l.return}}function Oa(l,c){_d=l,qm=Ra=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&c)!==0&&(Kn=!0),l.firstContext=null)}function vr(l){var c=l._currentValue;if(qm!==l)if(l={context:l,memoizedValue:c,next:null},Ra===null){if(_d===null)throw Error(n(308));Ra=l,_d.dependencies={lanes:0,firstContext:l}}else Ra=Ra.next=l;return c}var Ni=null;function Zm(l){Ni===null?Ni=[l]:Ni.push(l)}function Wb(l,c,p,y){var w=c.interleaved;return w===null?(p.next=p,Zm(c)):(p.next=w.next,w.next=p),c.interleaved=p,Lo(l,y)}function Lo(l,c){l.lanes|=c;var p=l.alternate;for(p!==null&&(p.lanes|=c),p=l,l=l.return;l!==null;)l.childLanes|=c,p=l.alternate,p!==null&&(p.childLanes|=c),p=l,l=l.return;return p.tag===3?p.stateNode:null}var Ts=!1;function Ym(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function qb(l,c){l=l.updateQueue,c.updateQueue===l&&(c.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function zo(l,c){return{eventTime:l,lane:c,tag:0,payload:null,callback:null,next:null}}function Ns(l,c,p){var y=l.updateQueue;if(y===null)return null;if(y=y.shared,(Xe&2)!==0){var w=y.pending;return w===null?c.next=c:(c.next=w.next,w.next=c),y.pending=c,Lo(l,p)}return w=y.interleaved,w===null?(c.next=c,Zm(y)):(c.next=w.next,w.next=c),y.interleaved=c,Lo(l,p)}function Td(l,c,p){if(c=c.updateQueue,c!==null&&(c=c.shared,(p&4194240)!==0)){var y=c.lanes;y&=l.pendingLanes,p|=y,c.lanes=p,dm(l,p)}}function Kb(l,c){var p=l.updateQueue,y=l.alternate;if(y!==null&&(y=y.updateQueue,p===y)){var w=null,E=null;if(p=p.firstBaseUpdate,p!==null){do{var N={eventTime:p.eventTime,lane:p.lane,tag:p.tag,payload:p.payload,callback:p.callback,next:null};E===null?w=E=N:E=E.next=N,p=p.next}while(p!==null);E===null?w=E=c:E=E.next=c}else w=E=c;p={baseState:y.baseState,firstBaseUpdate:w,lastBaseUpdate:E,shared:y.shared,effects:y.effects},l.updateQueue=p;return}l=p.lastBaseUpdate,l===null?p.firstBaseUpdate=c:l.next=c,p.lastBaseUpdate=c}function Nd(l,c,p,y){var w=l.updateQueue;Ts=!1;var E=w.firstBaseUpdate,N=w.lastBaseUpdate,O=w.shared.pending;if(O!==null){w.shared.pending=null;var z=O,U=z.next;z.next=null,N===null?E=U:N.next=U,N=z;var ie=l.alternate;ie!==null&&(ie=ie.updateQueue,O=ie.lastBaseUpdate,O!==N&&(O===null?ie.firstBaseUpdate=U:O.next=U,ie.lastBaseUpdate=z))}if(E!==null){var ae=w.baseState;N=0,ie=U=z=null,O=E;do{var se=O.lane,ge=O.eventTime;if((y&se)===se){ie!==null&&(ie=ie.next={eventTime:ge,lane:0,tag:O.tag,payload:O.payload,callback:O.callback,next:null});e:{var Ce=l,Se=O;switch(se=c,ge=p,Se.tag){case 1:if(Ce=Se.payload,typeof Ce=="function"){ae=Ce.call(ge,ae,se);break e}ae=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=Se.payload,se=typeof Ce=="function"?Ce.call(ge,ae,se):Ce,se==null)break e;ae=F({},ae,se);break e;case 2:Ts=!0}}O.callback!==null&&O.lane!==0&&(l.flags|=64,se=w.effects,se===null?w.effects=[O]:se.push(O))}else ge={eventTime:ge,lane:se,tag:O.tag,payload:O.payload,callback:O.callback,next:null},ie===null?(U=ie=ge,z=ae):ie=ie.next=ge,N|=se;if(O=O.next,O===null){if(O=w.shared.pending,O===null)break;se=O,O=se.next,se.next=null,w.lastBaseUpdate=se,w.shared.pending=null}}while(!0);if(ie===null&&(z=ae),w.baseState=z,w.firstBaseUpdate=U,w.lastBaseUpdate=ie,c=w.shared.interleaved,c!==null){w=c;do N|=w.lane,w=w.next;while(w!==c)}else E===null&&(w.shared.lanes=0);Di|=N,l.lanes=N,l.memoizedState=ae}}function Gb(l,c,p){if(l=c.effects,c.effects=null,l!==null)for(c=0;c<l.length;c++){var y=l[c],w=y.callback;if(w!==null){if(y.callback=null,y=p,typeof w!="function")throw Error(n(191,w));w.call(y)}}}var Xl={},oo=Ss(Xl),Ql=Ss(Xl),eu=Ss(Xl);function Ai(l){if(l===Xl)throw Error(n(174));return l}function Xm(l,c){switch(yt(eu,c),yt(Ql,l),yt(oo,Xl),l=c.nodeType,l){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:mr(null,"");break;default:l=l===8?c.parentNode:c,c=l.namespaceURI||null,l=l.tagName,c=mr(c,l)}kt(oo),yt(oo,c)}function Ia(){kt(oo),kt(Ql),kt(eu)}function Jb(l){Ai(eu.current);var c=Ai(oo.current),p=mr(c,l.type);c!==p&&(yt(Ql,l),yt(oo,p))}function Qm(l){Ql.current===l&&(kt(oo),kt(Ql))}var Tt=Ss(0);function Ad(l){for(var c=l;c!==null;){if(c.tag===13){var p=c.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||p.data==="$?"||p.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===l)break;for(;c.sibling===null;){if(c.return===null||c.return===l)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var e0=[];function t0(){for(var l=0;l<e0.length;l++)e0[l]._workInProgressVersionPrimary=null;e0.length=0}var Md=A.ReactCurrentDispatcher,n0=A.ReactCurrentBatchConfig,Mi=0,Nt=null,Zt=null,on=null,Dd=!1,tu=!1,nu=0,xM=0;function Sn(){throw Error(n(321))}function r0(l,c){if(c===null)return!1;for(var p=0;p<c.length&&p<l.length;p++)if(!Pr(l[p],c[p]))return!1;return!0}function o0(l,c,p,y,w,E){if(Mi=E,Nt=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,Md.current=l===null||l.memoizedState===null?wM:CM,l=p(y,w),tu){E=0;do{if(tu=!1,nu=0,25<=E)throw Error(n(301));E+=1,on=Zt=null,c.updateQueue=null,Md.current=SM,l=p(y,w)}while(tu)}if(Md.current=Id,c=Zt!==null&&Zt.next!==null,Mi=0,on=Zt=Nt=null,Dd=!1,c)throw Error(n(300));return l}function s0(){var l=nu!==0;return nu=0,l}function so(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return on===null?Nt.memoizedState=on=l:on=on.next=l,on}function br(){if(Zt===null){var l=Nt.alternate;l=l!==null?l.memoizedState:null}else l=Zt.next;var c=on===null?Nt.memoizedState:on.next;if(c!==null)on=c,Zt=l;else{if(l===null)throw Error(n(310));Zt=l,l={memoizedState:Zt.memoizedState,baseState:Zt.baseState,baseQueue:Zt.baseQueue,queue:Zt.queue,next:null},on===null?Nt.memoizedState=on=l:on=on.next=l}return on}function ru(l,c){return typeof c=="function"?c(l):c}function i0(l){var c=br(),p=c.queue;if(p===null)throw Error(n(311));p.lastRenderedReducer=l;var y=Zt,w=y.baseQueue,E=p.pending;if(E!==null){if(w!==null){var N=w.next;w.next=E.next,E.next=N}y.baseQueue=w=E,p.pending=null}if(w!==null){E=w.next,y=y.baseState;var O=N=null,z=null,U=E;do{var ie=U.lane;if((Mi&ie)===ie)z!==null&&(z=z.next={lane:0,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null}),y=U.hasEagerState?U.eagerState:l(y,U.action);else{var ae={lane:ie,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null};z===null?(O=z=ae,N=y):z=z.next=ae,Nt.lanes|=ie,Di|=ie}U=U.next}while(U!==null&&U!==E);z===null?N=y:z.next=O,Pr(y,c.memoizedState)||(Kn=!0),c.memoizedState=y,c.baseState=N,c.baseQueue=z,p.lastRenderedState=y}if(l=p.interleaved,l!==null){w=l;do E=w.lane,Nt.lanes|=E,Di|=E,w=w.next;while(w!==l)}else w===null&&(p.lanes=0);return[c.memoizedState,p.dispatch]}function a0(l){var c=br(),p=c.queue;if(p===null)throw Error(n(311));p.lastRenderedReducer=l;var y=p.dispatch,w=p.pending,E=c.memoizedState;if(w!==null){p.pending=null;var N=w=w.next;do E=l(E,N.action),N=N.next;while(N!==w);Pr(E,c.memoizedState)||(Kn=!0),c.memoizedState=E,c.baseQueue===null&&(c.baseState=E),p.lastRenderedState=E}return[E,y]}function Zb(){}function Yb(l,c){var p=Nt,y=br(),w=c(),E=!Pr(y.memoizedState,w);if(E&&(y.memoizedState=w,Kn=!0),y=y.queue,l0(ek.bind(null,p,y,l),[l]),y.getSnapshot!==c||E||on!==null&&on.memoizedState.tag&1){if(p.flags|=2048,ou(9,Qb.bind(null,p,y,w,c),void 0,null),sn===null)throw Error(n(349));(Mi&30)!==0||Xb(p,c,w)}return w}function Xb(l,c,p){l.flags|=16384,l={getSnapshot:c,value:p},c=Nt.updateQueue,c===null?(c={lastEffect:null,stores:null},Nt.updateQueue=c,c.stores=[l]):(p=c.stores,p===null?c.stores=[l]:p.push(l))}function Qb(l,c,p,y){c.value=p,c.getSnapshot=y,tk(c)&&nk(l)}function ek(l,c,p){return p(function(){tk(c)&&nk(l)})}function tk(l){var c=l.getSnapshot;l=l.value;try{var p=c();return!Pr(l,p)}catch{return!0}}function nk(l){var c=Lo(l,1);c!==null&&$r(c,l,1,-1)}function rk(l){var c=so();return typeof l=="function"&&(l=l()),c.memoizedState=c.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ru,lastRenderedState:l},c.queue=l,l=l.dispatch=kM.bind(null,Nt,l),[c.memoizedState,l]}function ou(l,c,p,y){return l={tag:l,create:c,destroy:p,deps:y,next:null},c=Nt.updateQueue,c===null?(c={lastEffect:null,stores:null},Nt.updateQueue=c,c.lastEffect=l.next=l):(p=c.lastEffect,p===null?c.lastEffect=l.next=l:(y=p.next,p.next=l,l.next=y,c.lastEffect=l)),l}function ok(){return br().memoizedState}function Rd(l,c,p,y){var w=so();Nt.flags|=l,w.memoizedState=ou(1|c,p,void 0,y===void 0?null:y)}function Od(l,c,p,y){var w=br();y=y===void 0?null:y;var E=void 0;if(Zt!==null){var N=Zt.memoizedState;if(E=N.destroy,y!==null&&r0(y,N.deps)){w.memoizedState=ou(c,p,E,y);return}}Nt.flags|=l,w.memoizedState=ou(1|c,p,E,y)}function sk(l,c){return Rd(8390656,8,l,c)}function l0(l,c){return Od(2048,8,l,c)}function ik(l,c){return Od(4,2,l,c)}function ak(l,c){return Od(4,4,l,c)}function lk(l,c){if(typeof c=="function")return l=l(),c(l),function(){c(null)};if(c!=null)return l=l(),c.current=l,function(){c.current=null}}function uk(l,c,p){return p=p!=null?p.concat([l]):null,Od(4,4,lk.bind(null,c,l),p)}function u0(){}function ck(l,c){var p=br();c=c===void 0?null:c;var y=p.memoizedState;return y!==null&&c!==null&&r0(c,y[1])?y[0]:(p.memoizedState=[l,c],l)}function dk(l,c){var p=br();c=c===void 0?null:c;var y=p.memoizedState;return y!==null&&c!==null&&r0(c,y[1])?y[0]:(l=l(),p.memoizedState=[l,c],l)}function fk(l,c,p){return(Mi&21)===0?(l.baseState&&(l.baseState=!1,Kn=!0),l.memoizedState=p):(Pr(p,c)||(p=Vv(),Nt.lanes|=p,Di|=p,l.baseState=!0),c)}function vM(l,c){var p=ct;ct=p!==0&&4>p?p:4,l(!0);var y=n0.transition;n0.transition={};try{l(!1),c()}finally{ct=p,n0.transition=y}}function hk(){return br().memoizedState}function bM(l,c,p){var y=Rs(l);if(p={lane:y,action:p,hasEagerState:!1,eagerState:null,next:null},pk(l))mk(c,p);else if(p=Wb(l,c,p,y),p!==null){var w=In();$r(p,l,y,w),gk(p,c,y)}}function kM(l,c,p){var y=Rs(l),w={lane:y,action:p,hasEagerState:!1,eagerState:null,next:null};if(pk(l))mk(c,w);else{var E=l.alternate;if(l.lanes===0&&(E===null||E.lanes===0)&&(E=c.lastRenderedReducer,E!==null))try{var N=c.lastRenderedState,O=E(N,p);if(w.hasEagerState=!0,w.eagerState=O,Pr(O,N)){var z=c.interleaved;z===null?(w.next=w,Zm(c)):(w.next=z.next,z.next=w),c.interleaved=w;return}}catch{}finally{}p=Wb(l,c,w,y),p!==null&&(w=In(),$r(p,l,y,w),gk(p,c,y))}}function pk(l){var c=l.alternate;return l===Nt||c!==null&&c===Nt}function mk(l,c){tu=Dd=!0;var p=l.pending;p===null?c.next=c:(c.next=p.next,p.next=c),l.pending=c}function gk(l,c,p){if((p&4194240)!==0){var y=c.lanes;y&=l.pendingLanes,p|=y,c.lanes=p,dm(l,p)}}var Id={readContext:vr,useCallback:Sn,useContext:Sn,useEffect:Sn,useImperativeHandle:Sn,useInsertionEffect:Sn,useLayoutEffect:Sn,useMemo:Sn,useReducer:Sn,useRef:Sn,useState:Sn,useDebugValue:Sn,useDeferredValue:Sn,useTransition:Sn,useMutableSource:Sn,useSyncExternalStore:Sn,useId:Sn,unstable_isNewReconciler:!1},wM={readContext:vr,useCallback:function(l,c){return so().memoizedState=[l,c===void 0?null:c],l},useContext:vr,useEffect:sk,useImperativeHandle:function(l,c,p){return p=p!=null?p.concat([l]):null,Rd(4194308,4,lk.bind(null,c,l),p)},useLayoutEffect:function(l,c){return Rd(4194308,4,l,c)},useInsertionEffect:function(l,c){return Rd(4,2,l,c)},useMemo:function(l,c){var p=so();return c=c===void 0?null:c,l=l(),p.memoizedState=[l,c],l},useReducer:function(l,c,p){var y=so();return c=p!==void 0?p(c):c,y.memoizedState=y.baseState=c,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:c},y.queue=l,l=l.dispatch=bM.bind(null,Nt,l),[y.memoizedState,l]},useRef:function(l){var c=so();return l={current:l},c.memoizedState=l},useState:rk,useDebugValue:u0,useDeferredValue:function(l){return so().memoizedState=l},useTransition:function(){var l=rk(!1),c=l[0];return l=vM.bind(null,l[1]),so().memoizedState=l,[c,l]},useMutableSource:function(){},useSyncExternalStore:function(l,c,p){var y=Nt,w=so();if(Et){if(p===void 0)throw Error(n(407));p=p()}else{if(p=c(),sn===null)throw Error(n(349));(Mi&30)!==0||Xb(y,c,p)}w.memoizedState=p;var E={value:p,getSnapshot:c};return w.queue=E,sk(ek.bind(null,y,E,l),[l]),y.flags|=2048,ou(9,Qb.bind(null,y,E,p,c),void 0,null),p},useId:function(){var l=so(),c=sn.identifierPrefix;if(Et){var p=jo,y=Po;p=(y&~(1<<32-Ir(y)-1)).toString(32)+p,c=":"+c+"R"+p,p=nu++,0<p&&(c+="H"+p.toString(32)),c+=":"}else p=xM++,c=":"+c+"r"+p.toString(32)+":";return l.memoizedState=c},unstable_isNewReconciler:!1},CM={readContext:vr,useCallback:ck,useContext:vr,useEffect:l0,useImperativeHandle:uk,useInsertionEffect:ik,useLayoutEffect:ak,useMemo:dk,useReducer:i0,useRef:ok,useState:function(){return i0(ru)},useDebugValue:u0,useDeferredValue:function(l){var c=br();return fk(c,Zt.memoizedState,l)},useTransition:function(){var l=i0(ru)[0],c=br().memoizedState;return[l,c]},useMutableSource:Zb,useSyncExternalStore:Yb,useId:hk,unstable_isNewReconciler:!1},SM={readContext:vr,useCallback:ck,useContext:vr,useEffect:l0,useImperativeHandle:uk,useInsertionEffect:ik,useLayoutEffect:ak,useMemo:dk,useReducer:a0,useRef:ok,useState:function(){return a0(ru)},useDebugValue:u0,useDeferredValue:function(l){var c=br();return Zt===null?c.memoizedState=l:fk(c,Zt.memoizedState,l)},useTransition:function(){var l=a0(ru)[0],c=br().memoizedState;return[l,c]},useMutableSource:Zb,useSyncExternalStore:Yb,useId:hk,unstable_isNewReconciler:!1};function Lr(l,c){if(l&&l.defaultProps){c=F({},c),l=l.defaultProps;for(var p in l)c[p]===void 0&&(c[p]=l[p]);return c}return c}function c0(l,c,p,y){c=l.memoizedState,p=p(y,c),p=p==null?c:F({},c,p),l.memoizedState=p,l.lanes===0&&(l.updateQueue.baseState=p)}var Pd={isMounted:function(l){return(l=l._reactInternals)?Ci(l)===l:!1},enqueueSetState:function(l,c,p){l=l._reactInternals;var y=In(),w=Rs(l),E=zo(y,w);E.payload=c,p!=null&&(E.callback=p),c=Ns(l,E,w),c!==null&&($r(c,l,w,y),Td(c,l,w))},enqueueReplaceState:function(l,c,p){l=l._reactInternals;var y=In(),w=Rs(l),E=zo(y,w);E.tag=1,E.payload=c,p!=null&&(E.callback=p),c=Ns(l,E,w),c!==null&&($r(c,l,w,y),Td(c,l,w))},enqueueForceUpdate:function(l,c){l=l._reactInternals;var p=In(),y=Rs(l),w=zo(p,y);w.tag=2,c!=null&&(w.callback=c),c=Ns(l,w,y),c!==null&&($r(c,l,y,p),Td(c,l,y))}};function yk(l,c,p,y,w,E,N){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(y,E,N):c.prototype&&c.prototype.isPureReactComponent?!Ul(p,y)||!Ul(w,E):!0}function xk(l,c,p){var y=!1,w=Es,E=c.contextType;return typeof E=="object"&&E!==null?E=vr(E):(w=qn(c)?Ei:Cn.current,y=c.contextTypes,E=(y=y!=null)?Ta(l,w):Es),c=new c(p,E),l.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Pd,l.stateNode=c,c._reactInternals=l,y&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=w,l.__reactInternalMemoizedMaskedChildContext=E),c}function vk(l,c,p,y){l=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(p,y),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(p,y),c.state!==l&&Pd.enqueueReplaceState(c,c.state,null)}function d0(l,c,p,y){var w=l.stateNode;w.props=p,w.state=l.memoizedState,w.refs={},Ym(l);var E=c.contextType;typeof E=="object"&&E!==null?w.context=vr(E):(E=qn(c)?Ei:Cn.current,w.context=Ta(l,E)),w.state=l.memoizedState,E=c.getDerivedStateFromProps,typeof E=="function"&&(c0(l,c,E,p),w.state=l.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&&Pd.enqueueReplaceState(w,w.state,null),Nd(l,p,w,y),w.state=l.memoizedState),typeof w.componentDidMount=="function"&&(l.flags|=4194308)}function Pa(l,c){try{var p="",y=c;do p+=ce(y),y=y.return;while(y);var w=p}catch(E){w=`
|
|
39
|
+
Error generating stack: `+E.message+`
|
|
40
|
+
`+E.stack}return{value:l,source:c,stack:w,digest:null}}function f0(l,c,p){return{value:l,source:null,stack:p??null,digest:c??null}}function h0(l,c){try{console.error(c.value)}catch(p){setTimeout(function(){throw p})}}var EM=typeof WeakMap=="function"?WeakMap:Map;function bk(l,c,p){p=zo(-1,p),p.tag=3,p.payload={element:null};var y=c.value;return p.callback=function(){Vd||(Vd=!0,N0=y),h0(l,c)},p}function kk(l,c,p){p=zo(-1,p),p.tag=3;var y=l.type.getDerivedStateFromError;if(typeof y=="function"){var w=c.value;p.payload=function(){return y(w)},p.callback=function(){h0(l,c)}}var E=l.stateNode;return E!==null&&typeof E.componentDidCatch=="function"&&(p.callback=function(){h0(l,c),typeof y!="function"&&(Ms===null?Ms=new Set([this]):Ms.add(this));var N=c.stack;this.componentDidCatch(c.value,{componentStack:N!==null?N:""})}),p}function wk(l,c,p){var y=l.pingCache;if(y===null){y=l.pingCache=new EM;var w=new Set;y.set(c,w)}else w=y.get(c),w===void 0&&(w=new Set,y.set(c,w));w.has(p)||(w.add(p),l=FM.bind(null,l,c,p),c.then(l,l))}function Ck(l){do{var c;if((c=l.tag===13)&&(c=l.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return l;l=l.return}while(l!==null);return null}function Sk(l,c,p,y,w){return(l.mode&1)===0?(l===c?l.flags|=65536:(l.flags|=128,p.flags|=131072,p.flags&=-52805,p.tag===1&&(p.alternate===null?p.tag=17:(c=zo(-1,1),c.tag=2,Ns(p,c,1))),p.lanes|=1),l):(l.flags|=65536,l.lanes=w,l)}var _M=A.ReactCurrentOwner,Kn=!1;function On(l,c,p,y){c.child=l===null?Ub(c,null,p,y):Da(c,l.child,p,y)}function Ek(l,c,p,y,w){p=p.render;var E=c.ref;return Oa(c,w),y=o0(l,c,p,y,E,w),p=s0(),l!==null&&!Kn?(c.updateQueue=l.updateQueue,c.flags&=-2053,l.lanes&=~w,Fo(l,c,w)):(Et&&p&&Bm(c),c.flags|=1,On(l,c,y,w),c.child)}function _k(l,c,p,y,w){if(l===null){var E=p.type;return typeof E=="function"&&!P0(E)&&E.defaultProps===void 0&&p.compare===null&&p.defaultProps===void 0?(c.tag=15,c.type=E,Tk(l,c,E,y,w)):(l=Gd(p.type,null,y,c,c.mode,w),l.ref=c.ref,l.return=c,c.child=l)}if(E=l.child,(l.lanes&w)===0){var N=E.memoizedProps;if(p=p.compare,p=p!==null?p:Ul,p(N,y)&&l.ref===c.ref)return Fo(l,c,w)}return c.flags|=1,l=Is(E,y),l.ref=c.ref,l.return=c,c.child=l}function Tk(l,c,p,y,w){if(l!==null){var E=l.memoizedProps;if(Ul(E,y)&&l.ref===c.ref)if(Kn=!1,c.pendingProps=y=E,(l.lanes&w)!==0)(l.flags&131072)!==0&&(Kn=!0);else return c.lanes=l.lanes,Fo(l,c,w)}return p0(l,c,p,y,w)}function Nk(l,c,p){var y=c.pendingProps,w=y.children,E=l!==null?l.memoizedState:null;if(y.mode==="hidden")if((c.mode&1)===0)c.memoizedState={baseLanes:0,cachePool:null,transitions:null},yt(La,ir),ir|=p;else{if((p&1073741824)===0)return l=E!==null?E.baseLanes|p:p,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:l,cachePool:null,transitions:null},c.updateQueue=null,yt(La,ir),ir|=l,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=E!==null?E.baseLanes:p,yt(La,ir),ir|=y}else E!==null?(y=E.baseLanes|p,c.memoizedState=null):y=p,yt(La,ir),ir|=y;return On(l,c,w,p),c.child}function Ak(l,c){var p=c.ref;(l===null&&p!==null||l!==null&&l.ref!==p)&&(c.flags|=512,c.flags|=2097152)}function p0(l,c,p,y,w){var E=qn(p)?Ei:Cn.current;return E=Ta(c,E),Oa(c,w),p=o0(l,c,p,y,E,w),y=s0(),l!==null&&!Kn?(c.updateQueue=l.updateQueue,c.flags&=-2053,l.lanes&=~w,Fo(l,c,w)):(Et&&y&&Bm(c),c.flags|=1,On(l,c,p,w),c.child)}function Mk(l,c,p,y,w){if(qn(p)){var E=!0;vd(c)}else E=!1;if(Oa(c,w),c.stateNode===null)Ld(l,c),xk(c,p,y),d0(c,p,y,w),y=!0;else if(l===null){var N=c.stateNode,O=c.memoizedProps;N.props=O;var z=N.context,U=p.contextType;typeof U=="object"&&U!==null?U=vr(U):(U=qn(p)?Ei:Cn.current,U=Ta(c,U));var ie=p.getDerivedStateFromProps,ae=typeof ie=="function"||typeof N.getSnapshotBeforeUpdate=="function";ae||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(O!==y||z!==U)&&vk(c,N,y,U),Ts=!1;var se=c.memoizedState;N.state=se,Nd(c,y,N,w),z=c.memoizedState,O!==y||se!==z||Wn.current||Ts?(typeof ie=="function"&&(c0(c,p,ie,y),z=c.memoizedState),(O=Ts||yk(c,p,O,y,se,z,U))?(ae||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(c.flags|=4194308)):(typeof N.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=y,c.memoizedState=z),N.props=y,N.state=z,N.context=U,y=O):(typeof N.componentDidMount=="function"&&(c.flags|=4194308),y=!1)}else{N=c.stateNode,qb(l,c),O=c.memoizedProps,U=c.type===c.elementType?O:Lr(c.type,O),N.props=U,ae=c.pendingProps,se=N.context,z=p.contextType,typeof z=="object"&&z!==null?z=vr(z):(z=qn(p)?Ei:Cn.current,z=Ta(c,z));var ge=p.getDerivedStateFromProps;(ie=typeof ge=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(O!==ae||se!==z)&&vk(c,N,y,z),Ts=!1,se=c.memoizedState,N.state=se,Nd(c,y,N,w);var Ce=c.memoizedState;O!==ae||se!==Ce||Wn.current||Ts?(typeof ge=="function"&&(c0(c,p,ge,y),Ce=c.memoizedState),(U=Ts||yk(c,p,U,y,se,Ce,z)||!1)?(ie||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(y,Ce,z),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(y,Ce,z)),typeof N.componentDidUpdate=="function"&&(c.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof N.componentDidUpdate!="function"||O===l.memoizedProps&&se===l.memoizedState||(c.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||O===l.memoizedProps&&se===l.memoizedState||(c.flags|=1024),c.memoizedProps=y,c.memoizedState=Ce),N.props=y,N.state=Ce,N.context=z,y=U):(typeof N.componentDidUpdate!="function"||O===l.memoizedProps&&se===l.memoizedState||(c.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||O===l.memoizedProps&&se===l.memoizedState||(c.flags|=1024),y=!1)}return m0(l,c,p,y,E,w)}function m0(l,c,p,y,w,E){Ak(l,c);var N=(c.flags&128)!==0;if(!y&&!N)return w&&Pb(c,p,!1),Fo(l,c,E);y=c.stateNode,_M.current=c;var O=N&&typeof p.getDerivedStateFromError!="function"?null:y.render();return c.flags|=1,l!==null&&N?(c.child=Da(c,l.child,null,E),c.child=Da(c,null,O,E)):On(l,c,O,E),c.memoizedState=y.state,w&&Pb(c,p,!0),c.child}function Dk(l){var c=l.stateNode;c.pendingContext?Ob(l,c.pendingContext,c.pendingContext!==c.context):c.context&&Ob(l,c.context,!1),Xm(l,c.containerInfo)}function Rk(l,c,p,y,w){return Ma(),Wm(w),c.flags|=256,On(l,c,p,y),c.child}var g0={dehydrated:null,treeContext:null,retryLane:0};function y0(l){return{baseLanes:l,cachePool:null,transitions:null}}function Ok(l,c,p){var y=c.pendingProps,w=Tt.current,E=!1,N=(c.flags&128)!==0,O;if((O=N)||(O=l!==null&&l.memoizedState===null?!1:(w&2)!==0),O?(E=!0,c.flags&=-129):(l===null||l.memoizedState!==null)&&(w|=1),yt(Tt,w&1),l===null)return Um(c),l=c.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?((c.mode&1)===0?c.lanes=1:l.data==="$!"?c.lanes=8:c.lanes=1073741824,null):(N=y.children,l=y.fallback,E?(y=c.mode,E=c.child,N={mode:"hidden",children:N},(y&1)===0&&E!==null?(E.childLanes=0,E.pendingProps=N):E=Jd(N,y,0,null),l=Pi(l,y,p,null),E.return=c,l.return=c,E.sibling=l,c.child=E,c.child.memoizedState=y0(p),c.memoizedState=g0,l):x0(c,N));if(w=l.memoizedState,w!==null&&(O=w.dehydrated,O!==null))return TM(l,c,N,y,O,w,p);if(E){E=y.fallback,N=c.mode,w=l.child,O=w.sibling;var z={mode:"hidden",children:y.children};return(N&1)===0&&c.child!==w?(y=c.child,y.childLanes=0,y.pendingProps=z,c.deletions=null):(y=Is(w,z),y.subtreeFlags=w.subtreeFlags&14680064),O!==null?E=Is(O,E):(E=Pi(E,N,p,null),E.flags|=2),E.return=c,y.return=c,y.sibling=E,c.child=y,y=E,E=c.child,N=l.child.memoizedState,N=N===null?y0(p):{baseLanes:N.baseLanes|p,cachePool:null,transitions:N.transitions},E.memoizedState=N,E.childLanes=l.childLanes&~p,c.memoizedState=g0,y}return E=l.child,l=E.sibling,y=Is(E,{mode:"visible",children:y.children}),(c.mode&1)===0&&(y.lanes=p),y.return=c,y.sibling=null,l!==null&&(p=c.deletions,p===null?(c.deletions=[l],c.flags|=16):p.push(l)),c.child=y,c.memoizedState=null,y}function x0(l,c){return c=Jd({mode:"visible",children:c},l.mode,0,null),c.return=l,l.child=c}function jd(l,c,p,y){return y!==null&&Wm(y),Da(c,l.child,null,p),l=x0(c,c.pendingProps.children),l.flags|=2,c.memoizedState=null,l}function TM(l,c,p,y,w,E,N){if(p)return c.flags&256?(c.flags&=-257,y=f0(Error(n(422))),jd(l,c,N,y)):c.memoizedState!==null?(c.child=l.child,c.flags|=128,null):(E=y.fallback,w=c.mode,y=Jd({mode:"visible",children:y.children},w,0,null),E=Pi(E,w,N,null),E.flags|=2,y.return=c,E.return=c,y.sibling=E,c.child=y,(c.mode&1)!==0&&Da(c,l.child,null,N),c.child.memoizedState=y0(N),c.memoizedState=g0,E);if((c.mode&1)===0)return jd(l,c,N,null);if(w.data==="$!"){if(y=w.nextSibling&&w.nextSibling.dataset,y)var O=y.dgst;return y=O,E=Error(n(419)),y=f0(E,y,void 0),jd(l,c,N,y)}if(O=(N&l.childLanes)!==0,Kn||O){if(y=sn,y!==null){switch(N&-N){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&(y.suspendedLanes|N))!==0?0:w,w!==0&&w!==E.retryLane&&(E.retryLane=w,Lo(l,w),$r(y,l,w,-1))}return I0(),y=f0(Error(n(421))),jd(l,c,N,y)}return w.data==="$?"?(c.flags|=128,c.child=l.child,c=$M.bind(null,l),w._reactRetry=c,null):(l=E.treeContext,sr=Cs(w.nextSibling),or=c,Et=!0,jr=null,l!==null&&(yr[xr++]=Po,yr[xr++]=jo,yr[xr++]=_i,Po=l.id,jo=l.overflow,_i=c),c=x0(c,y.children),c.flags|=4096,c)}function Ik(l,c,p){l.lanes|=c;var y=l.alternate;y!==null&&(y.lanes|=c),Jm(l.return,c,p)}function v0(l,c,p,y,w){var E=l.memoizedState;E===null?l.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:y,tail:p,tailMode:w}:(E.isBackwards=c,E.rendering=null,E.renderingStartTime=0,E.last=y,E.tail=p,E.tailMode=w)}function Pk(l,c,p){var y=c.pendingProps,w=y.revealOrder,E=y.tail;if(On(l,c,y.children,p),y=Tt.current,(y&2)!==0)y=y&1|2,c.flags|=128;else{if(l!==null&&(l.flags&128)!==0)e:for(l=c.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&Ik(l,p,c);else if(l.tag===19)Ik(l,p,c);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===c)break e;for(;l.sibling===null;){if(l.return===null||l.return===c)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}y&=1}if(yt(Tt,y),(c.mode&1)===0)c.memoizedState=null;else switch(w){case"forwards":for(p=c.child,w=null;p!==null;)l=p.alternate,l!==null&&Ad(l)===null&&(w=p),p=p.sibling;p=w,p===null?(w=c.child,c.child=null):(w=p.sibling,p.sibling=null),v0(c,!1,w,p,E);break;case"backwards":for(p=null,w=c.child,c.child=null;w!==null;){if(l=w.alternate,l!==null&&Ad(l)===null){c.child=w;break}l=w.sibling,w.sibling=p,p=w,w=l}v0(c,!0,p,null,E);break;case"together":v0(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function Ld(l,c){(c.mode&1)===0&&l!==null&&(l.alternate=null,c.alternate=null,c.flags|=2)}function Fo(l,c,p){if(l!==null&&(c.dependencies=l.dependencies),Di|=c.lanes,(p&c.childLanes)===0)return null;if(l!==null&&c.child!==l.child)throw Error(n(153));if(c.child!==null){for(l=c.child,p=Is(l,l.pendingProps),c.child=p,p.return=c;l.sibling!==null;)l=l.sibling,p=p.sibling=Is(l,l.pendingProps),p.return=c;p.sibling=null}return c.child}function NM(l,c,p){switch(c.tag){case 3:Dk(c),Ma();break;case 5:Jb(c);break;case 1:qn(c.type)&&vd(c);break;case 4:Xm(c,c.stateNode.containerInfo);break;case 10:var y=c.type._context,w=c.memoizedProps.value;yt(Ed,y._currentValue),y._currentValue=w;break;case 13:if(y=c.memoizedState,y!==null)return y.dehydrated!==null?(yt(Tt,Tt.current&1),c.flags|=128,null):(p&c.child.childLanes)!==0?Ok(l,c,p):(yt(Tt,Tt.current&1),l=Fo(l,c,p),l!==null?l.sibling:null);yt(Tt,Tt.current&1);break;case 19:if(y=(p&c.childLanes)!==0,(l.flags&128)!==0){if(y)return Pk(l,c,p);c.flags|=128}if(w=c.memoizedState,w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),yt(Tt,Tt.current),y)break;return null;case 22:case 23:return c.lanes=0,Nk(l,c,p)}return Fo(l,c,p)}var jk,b0,Lk,zk;jk=function(l,c){for(var p=c.child;p!==null;){if(p.tag===5||p.tag===6)l.appendChild(p.stateNode);else if(p.tag!==4&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===c)break;for(;p.sibling===null;){if(p.return===null||p.return===c)return;p=p.return}p.sibling.return=p.return,p=p.sibling}},b0=function(){},Lk=function(l,c,p,y){var w=l.memoizedProps;if(w!==y){l=c.stateNode,Ai(oo.current);var E=null;switch(p){case"input":w=Ye(l,w),y=Ye(l,y),E=[];break;case"select":w=F({},w,{value:void 0}),y=F({},y,{value:void 0}),E=[];break;case"textarea":w=pt(l,w),y=pt(l,y),E=[];break;default:typeof w.onClick!="function"&&typeof y.onClick=="function"&&(l.onclick=gd)}Do(p,y);var N;p=null;for(U in w)if(!y.hasOwnProperty(U)&&w.hasOwnProperty(U)&&w[U]!=null)if(U==="style"){var O=w[U];for(N in O)O.hasOwnProperty(N)&&(p||(p={}),p[N]="")}else U!=="dangerouslySetInnerHTML"&&U!=="children"&&U!=="suppressContentEditableWarning"&&U!=="suppressHydrationWarning"&&U!=="autoFocus"&&(o.hasOwnProperty(U)?E||(E=[]):(E=E||[]).push(U,null));for(U in y){var z=y[U];if(O=w!=null?w[U]:void 0,y.hasOwnProperty(U)&&z!==O&&(z!=null||O!=null))if(U==="style")if(O){for(N in O)!O.hasOwnProperty(N)||z&&z.hasOwnProperty(N)||(p||(p={}),p[N]="");for(N in z)z.hasOwnProperty(N)&&O[N]!==z[N]&&(p||(p={}),p[N]=z[N])}else p||(E||(E=[]),E.push(U,p)),p=z;else U==="dangerouslySetInnerHTML"?(z=z?z.__html:void 0,O=O?O.__html:void 0,z!=null&&O!==z&&(E=E||[]).push(U,z)):U==="children"?typeof z!="string"&&typeof z!="number"||(E=E||[]).push(U,""+z):U!=="suppressContentEditableWarning"&&U!=="suppressHydrationWarning"&&(o.hasOwnProperty(U)?(z!=null&&U==="onScroll"&&bt("scroll",l),E||O===z||(E=[])):(E=E||[]).push(U,z))}p&&(E=E||[]).push("style",p);var U=E;(c.updateQueue=U)&&(c.flags|=4)}},zk=function(l,c,p,y){p!==y&&(c.flags|=4)};function su(l,c){if(!Et)switch(l.tailMode){case"hidden":c=l.tail;for(var p=null;c!==null;)c.alternate!==null&&(p=c),c=c.sibling;p===null?l.tail=null:p.sibling=null;break;case"collapsed":p=l.tail;for(var y=null;p!==null;)p.alternate!==null&&(y=p),p=p.sibling;y===null?c||l.tail===null?l.tail=null:l.tail.sibling=null:y.sibling=null}}function En(l){var c=l.alternate!==null&&l.alternate.child===l.child,p=0,y=0;if(c)for(var w=l.child;w!==null;)p|=w.lanes|w.childLanes,y|=w.subtreeFlags&14680064,y|=w.flags&14680064,w.return=l,w=w.sibling;else for(w=l.child;w!==null;)p|=w.lanes|w.childLanes,y|=w.subtreeFlags,y|=w.flags,w.return=l,w=w.sibling;return l.subtreeFlags|=y,l.childLanes=p,c}function AM(l,c,p){var y=c.pendingProps;switch(Vm(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return En(c),null;case 1:return qn(c.type)&&xd(),En(c),null;case 3:return y=c.stateNode,Ia(),kt(Wn),kt(Cn),t0(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(l===null||l.child===null)&&(Cd(c)?c.flags|=4:l===null||l.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,jr!==null&&(D0(jr),jr=null))),b0(l,c),En(c),null;case 5:Qm(c);var w=Ai(eu.current);if(p=c.type,l!==null&&c.stateNode!=null)Lk(l,c,p,y,w),l.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!y){if(c.stateNode===null)throw Error(n(166));return En(c),null}if(l=Ai(oo.current),Cd(c)){y=c.stateNode,p=c.type;var E=c.memoizedProps;switch(y[ro]=c,y[Jl]=E,l=(c.mode&1)!==0,p){case"dialog":bt("cancel",y),bt("close",y);break;case"iframe":case"object":case"embed":bt("load",y);break;case"video":case"audio":for(w=0;w<ql.length;w++)bt(ql[w],y);break;case"source":bt("error",y);break;case"img":case"image":case"link":bt("error",y),bt("load",y);break;case"details":bt("toggle",y);break;case"input":At(y,E),bt("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!E.multiple},bt("invalid",y);break;case"textarea":pr(y,E),bt("invalid",y)}Do(p,E),w=null;for(var N in E)if(E.hasOwnProperty(N)){var O=E[N];N==="children"?typeof O=="string"?y.textContent!==O&&(E.suppressHydrationWarning!==!0&&md(y.textContent,O,l),w=["children",O]):typeof O=="number"&&y.textContent!==""+O&&(E.suppressHydrationWarning!==!0&&md(y.textContent,O,l),w=["children",""+O]):o.hasOwnProperty(N)&&O!=null&&N==="onScroll"&&bt("scroll",y)}switch(p){case"input":Fe(y),$n(y,E,!0);break;case"textarea":Fe(y),ma(y);break;case"select":case"option":break;default:typeof E.onClick=="function"&&(y.onclick=gd)}y=w,c.updateQueue=y,y!==null&&(c.flags|=4)}else{N=w.nodeType===9?w:w.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=Mo(p)),l==="http://www.w3.org/1999/xhtml"?p==="script"?(l=N.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof y.is=="string"?l=N.createElement(p,{is:y.is}):(l=N.createElement(p),p==="select"&&(N=l,y.multiple?N.multiple=!0:y.size&&(N.size=y.size))):l=N.createElementNS(l,p),l[ro]=c,l[Jl]=y,jk(l,c,!1,!1),c.stateNode=l;e:{switch(N=ki(p,y),p){case"dialog":bt("cancel",l),bt("close",l),w=y;break;case"iframe":case"object":case"embed":bt("load",l),w=y;break;case"video":case"audio":for(w=0;w<ql.length;w++)bt(ql[w],l);w=y;break;case"source":bt("error",l),w=y;break;case"img":case"image":case"link":bt("error",l),bt("load",l),w=y;break;case"details":bt("toggle",l),w=y;break;case"input":At(l,y),w=Ye(l,y),bt("invalid",l);break;case"option":w=y;break;case"select":l._wrapperState={wasMultiple:!!y.multiple},w=F({},y,{value:void 0}),bt("invalid",l);break;case"textarea":pr(l,y),w=pt(l,y),bt("invalid",l);break;default:w=y}Do(p,w),O=w;for(E in O)if(O.hasOwnProperty(E)){var z=O[E];E==="style"?ya(l,z):E==="dangerouslySetInnerHTML"?(z=z?z.__html:void 0,z!=null&&gr(l,z)):E==="children"?typeof z=="string"?(p!=="textarea"||z!=="")&&Rn(l,z):typeof z=="number"&&Rn(l,""+z):E!=="suppressContentEditableWarning"&&E!=="suppressHydrationWarning"&&E!=="autoFocus"&&(o.hasOwnProperty(E)?z!=null&&E==="onScroll"&&bt("scroll",l):z!=null&&T(l,E,z,N))}switch(p){case"input":Fe(l),$n(l,y,!1);break;case"textarea":Fe(l),ma(l);break;case"option":y.value!=null&&l.setAttribute("value",""+Q(y.value));break;case"select":l.multiple=!!y.multiple,E=y.value,E!=null?Dn(l,!!y.multiple,E,!1):y.defaultValue!=null&&Dn(l,!!y.multiple,y.defaultValue,!0);break;default:typeof w.onClick=="function"&&(l.onclick=gd)}switch(p){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}}y&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return En(c),null;case 6:if(l&&c.stateNode!=null)zk(l,c,l.memoizedProps,y);else{if(typeof y!="string"&&c.stateNode===null)throw Error(n(166));if(p=Ai(eu.current),Ai(oo.current),Cd(c)){if(y=c.stateNode,p=c.memoizedProps,y[ro]=c,(E=y.nodeValue!==p)&&(l=or,l!==null))switch(l.tag){case 3:md(y.nodeValue,p,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&md(y.nodeValue,p,(l.mode&1)!==0)}E&&(c.flags|=4)}else y=(p.nodeType===9?p:p.ownerDocument).createTextNode(y),y[ro]=c,c.stateNode=y}return En(c),null;case 13:if(kt(Tt),y=c.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(Et&&sr!==null&&(c.mode&1)!==0&&(c.flags&128)===0)Bb(),Ma(),c.flags|=98560,E=!1;else if(E=Cd(c),y!==null&&y.dehydrated!==null){if(l===null){if(!E)throw Error(n(318));if(E=c.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(n(317));E[ro]=c}else Ma(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;En(c),E=!1}else jr!==null&&(D0(jr),jr=null),E=!0;if(!E)return c.flags&65536?c:null}return(c.flags&128)!==0?(c.lanes=p,c):(y=y!==null,y!==(l!==null&&l.memoizedState!==null)&&y&&(c.child.flags|=8192,(c.mode&1)!==0&&(l===null||(Tt.current&1)!==0?Yt===0&&(Yt=3):I0())),c.updateQueue!==null&&(c.flags|=4),En(c),null);case 4:return Ia(),b0(l,c),l===null&&Kl(c.stateNode.containerInfo),En(c),null;case 10:return Gm(c.type._context),En(c),null;case 17:return qn(c.type)&&xd(),En(c),null;case 19:if(kt(Tt),E=c.memoizedState,E===null)return En(c),null;if(y=(c.flags&128)!==0,N=E.rendering,N===null)if(y)su(E,!1);else{if(Yt!==0||l!==null&&(l.flags&128)!==0)for(l=c.child;l!==null;){if(N=Ad(l),N!==null){for(c.flags|=128,su(E,!1),y=N.updateQueue,y!==null&&(c.updateQueue=y,c.flags|=4),c.subtreeFlags=0,y=p,p=c.child;p!==null;)E=p,l=y,E.flags&=14680066,N=E.alternate,N===null?(E.childLanes=0,E.lanes=l,E.child=null,E.subtreeFlags=0,E.memoizedProps=null,E.memoizedState=null,E.updateQueue=null,E.dependencies=null,E.stateNode=null):(E.childLanes=N.childLanes,E.lanes=N.lanes,E.child=N.child,E.subtreeFlags=0,E.deletions=null,E.memoizedProps=N.memoizedProps,E.memoizedState=N.memoizedState,E.updateQueue=N.updateQueue,E.type=N.type,l=N.dependencies,E.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),p=p.sibling;return yt(Tt,Tt.current&1|2),c.child}l=l.sibling}E.tail!==null&&Pt()>za&&(c.flags|=128,y=!0,su(E,!1),c.lanes=4194304)}else{if(!y)if(l=Ad(N),l!==null){if(c.flags|=128,y=!0,p=l.updateQueue,p!==null&&(c.updateQueue=p,c.flags|=4),su(E,!0),E.tail===null&&E.tailMode==="hidden"&&!N.alternate&&!Et)return En(c),null}else 2*Pt()-E.renderingStartTime>za&&p!==1073741824&&(c.flags|=128,y=!0,su(E,!1),c.lanes=4194304);E.isBackwards?(N.sibling=c.child,c.child=N):(p=E.last,p!==null?p.sibling=N:c.child=N,E.last=N)}return E.tail!==null?(c=E.tail,E.rendering=c,E.tail=c.sibling,E.renderingStartTime=Pt(),c.sibling=null,p=Tt.current,yt(Tt,y?p&1|2:p&1),c):(En(c),null);case 22:case 23:return O0(),y=c.memoizedState!==null,l!==null&&l.memoizedState!==null!==y&&(c.flags|=8192),y&&(c.mode&1)!==0?(ir&1073741824)!==0&&(En(c),c.subtreeFlags&6&&(c.flags|=8192)):En(c),null;case 24:return null;case 25:return null}throw Error(n(156,c.tag))}function MM(l,c){switch(Vm(c),c.tag){case 1:return qn(c.type)&&xd(),l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 3:return Ia(),kt(Wn),kt(Cn),t0(),l=c.flags,(l&65536)!==0&&(l&128)===0?(c.flags=l&-65537|128,c):null;case 5:return Qm(c),null;case 13:if(kt(Tt),l=c.memoizedState,l!==null&&l.dehydrated!==null){if(c.alternate===null)throw Error(n(340));Ma()}return l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 19:return kt(Tt),null;case 4:return Ia(),null;case 10:return Gm(c.type._context),null;case 22:case 23:return O0(),null;case 24:return null;default:return null}}var zd=!1,_n=!1,DM=typeof WeakSet=="function"?WeakSet:Set,be=null;function ja(l,c){var p=l.ref;if(p!==null)if(typeof p=="function")try{p(null)}catch(y){Mt(l,c,y)}else p.current=null}function k0(l,c,p){try{p()}catch(y){Mt(l,c,y)}}var Fk=!1;function RM(l,c){if(Om=od,l=yb(),Em(l)){if("selectionStart"in l)var p={start:l.selectionStart,end:l.selectionEnd};else e:{p=(p=l.ownerDocument)&&p.defaultView||window;var y=p.getSelection&&p.getSelection();if(y&&y.rangeCount!==0){p=y.anchorNode;var w=y.anchorOffset,E=y.focusNode;y=y.focusOffset;try{p.nodeType,E.nodeType}catch{p=null;break e}var N=0,O=-1,z=-1,U=0,ie=0,ae=l,se=null;t:for(;;){for(var ge;ae!==p||w!==0&&ae.nodeType!==3||(O=N+w),ae!==E||y!==0&&ae.nodeType!==3||(z=N+y),ae.nodeType===3&&(N+=ae.nodeValue.length),(ge=ae.firstChild)!==null;)se=ae,ae=ge;for(;;){if(ae===l)break t;if(se===p&&++U===w&&(O=N),se===E&&++ie===y&&(z=N),(ge=ae.nextSibling)!==null)break;ae=se,se=ae.parentNode}ae=ge}p=O===-1||z===-1?null:{start:O,end:z}}else p=null}p=p||{start:0,end:0}}else p=null;for(Im={focusedElem:l,selectionRange:p},od=!1,be=c;be!==null;)if(c=be,l=c.child,(c.subtreeFlags&1028)!==0&&l!==null)l.return=c,be=l;else for(;be!==null;){c=be;try{var Ce=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(Ce!==null){var Se=Ce.memoizedProps,jt=Ce.memoizedState,B=c.stateNode,$=B.getSnapshotBeforeUpdate(c.elementType===c.type?Se:Lr(c.type,Se),jt);B.__reactInternalSnapshotBeforeUpdate=$}break;case 3:var H=c.stateNode.containerInfo;H.nodeType===1?H.textContent="":H.nodeType===9&&H.documentElement&&H.removeChild(H.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(fe){Mt(c,c.return,fe)}if(l=c.sibling,l!==null){l.return=c.return,be=l;break}be=c.return}return Ce=Fk,Fk=!1,Ce}function iu(l,c,p){var y=c.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var w=y=y.next;do{if((w.tag&l)===l){var E=w.destroy;w.destroy=void 0,E!==void 0&&k0(c,p,E)}w=w.next}while(w!==y)}}function Fd(l,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var p=c=c.next;do{if((p.tag&l)===l){var y=p.create;p.destroy=y()}p=p.next}while(p!==c)}}function w0(l){var c=l.ref;if(c!==null){var p=l.stateNode;switch(l.tag){case 5:l=p;break;default:l=p}typeof c=="function"?c(l):c.current=l}}function $k(l){var c=l.alternate;c!==null&&(l.alternate=null,$k(c)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(c=l.stateNode,c!==null&&(delete c[ro],delete c[Jl],delete c[zm],delete c[pM],delete c[mM])),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function Bk(l){return l.tag===5||l.tag===3||l.tag===4}function Vk(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||Bk(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function C0(l,c,p){var y=l.tag;if(y===5||y===6)l=l.stateNode,c?p.nodeType===8?p.parentNode.insertBefore(l,c):p.insertBefore(l,c):(p.nodeType===8?(c=p.parentNode,c.insertBefore(l,p)):(c=p,c.appendChild(l)),p=p._reactRootContainer,p!=null||c.onclick!==null||(c.onclick=gd));else if(y!==4&&(l=l.child,l!==null))for(C0(l,c,p),l=l.sibling;l!==null;)C0(l,c,p),l=l.sibling}function S0(l,c,p){var y=l.tag;if(y===5||y===6)l=l.stateNode,c?p.insertBefore(l,c):p.appendChild(l);else if(y!==4&&(l=l.child,l!==null))for(S0(l,c,p),l=l.sibling;l!==null;)S0(l,c,p),l=l.sibling}var yn=null,zr=!1;function As(l,c,p){for(p=p.child;p!==null;)Hk(l,c,p),p=p.sibling}function Hk(l,c,p){if(no&&typeof no.onCommitFiberUnmount=="function")try{no.onCommitFiberUnmount(Xc,p)}catch{}switch(p.tag){case 5:_n||ja(p,c);case 6:var y=yn,w=zr;yn=null,As(l,c,p),yn=y,zr=w,yn!==null&&(zr?(l=yn,p=p.stateNode,l.nodeType===8?l.parentNode.removeChild(p):l.removeChild(p)):yn.removeChild(p.stateNode));break;case 18:yn!==null&&(zr?(l=yn,p=p.stateNode,l.nodeType===8?Lm(l.parentNode,p):l.nodeType===1&&Lm(l,p),zl(l)):Lm(yn,p.stateNode));break;case 4:y=yn,w=zr,yn=p.stateNode.containerInfo,zr=!0,As(l,c,p),yn=y,zr=w;break;case 0:case 11:case 14:case 15:if(!_n&&(y=p.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){w=y=y.next;do{var E=w,N=E.destroy;E=E.tag,N!==void 0&&((E&2)!==0||(E&4)!==0)&&k0(p,c,N),w=w.next}while(w!==y)}As(l,c,p);break;case 1:if(!_n&&(ja(p,c),y=p.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=p.memoizedProps,y.state=p.memoizedState,y.componentWillUnmount()}catch(O){Mt(p,c,O)}As(l,c,p);break;case 21:As(l,c,p);break;case 22:p.mode&1?(_n=(y=_n)||p.memoizedState!==null,As(l,c,p),_n=y):As(l,c,p);break;default:As(l,c,p)}}function Uk(l){var c=l.updateQueue;if(c!==null){l.updateQueue=null;var p=l.stateNode;p===null&&(p=l.stateNode=new DM),c.forEach(function(y){var w=BM.bind(null,l,y);p.has(y)||(p.add(y),y.then(w,w))})}}function Fr(l,c){var p=c.deletions;if(p!==null)for(var y=0;y<p.length;y++){var w=p[y];try{var E=l,N=c,O=N;e:for(;O!==null;){switch(O.tag){case 5:yn=O.stateNode,zr=!1;break e;case 3:yn=O.stateNode.containerInfo,zr=!0;break e;case 4:yn=O.stateNode.containerInfo,zr=!0;break e}O=O.return}if(yn===null)throw Error(n(160));Hk(E,N,w),yn=null,zr=!1;var z=w.alternate;z!==null&&(z.return=null),w.return=null}catch(U){Mt(w,c,U)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)Wk(c,l),c=c.sibling}function Wk(l,c){var p=l.alternate,y=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(Fr(c,l),io(l),y&4){try{iu(3,l,l.return),Fd(3,l)}catch(Se){Mt(l,l.return,Se)}try{iu(5,l,l.return)}catch(Se){Mt(l,l.return,Se)}}break;case 1:Fr(c,l),io(l),y&512&&p!==null&&ja(p,p.return);break;case 5:if(Fr(c,l),io(l),y&512&&p!==null&&ja(p,p.return),l.flags&32){var w=l.stateNode;try{Rn(w,"")}catch(Se){Mt(l,l.return,Se)}}if(y&4&&(w=l.stateNode,w!=null)){var E=l.memoizedProps,N=p!==null?p.memoizedProps:E,O=l.type,z=l.updateQueue;if(l.updateQueue=null,z!==null)try{O==="input"&&E.type==="radio"&&E.name!=null&&zt(w,E),ki(O,N);var U=ki(O,E);for(N=0;N<z.length;N+=2){var ie=z[N],ae=z[N+1];ie==="style"?ya(w,ae):ie==="dangerouslySetInnerHTML"?gr(w,ae):ie==="children"?Rn(w,ae):T(w,ie,ae,U)}switch(O){case"input":qt(w,E);break;case"textarea":bi(w,E);break;case"select":var se=w._wrapperState.wasMultiple;w._wrapperState.wasMultiple=!!E.multiple;var ge=E.value;ge!=null?Dn(w,!!E.multiple,ge,!1):se!==!!E.multiple&&(E.defaultValue!=null?Dn(w,!!E.multiple,E.defaultValue,!0):Dn(w,!!E.multiple,E.multiple?[]:"",!1))}w[Jl]=E}catch(Se){Mt(l,l.return,Se)}}break;case 6:if(Fr(c,l),io(l),y&4){if(l.stateNode===null)throw Error(n(162));w=l.stateNode,E=l.memoizedProps;try{w.nodeValue=E}catch(Se){Mt(l,l.return,Se)}}break;case 3:if(Fr(c,l),io(l),y&4&&p!==null&&p.memoizedState.isDehydrated)try{zl(c.containerInfo)}catch(Se){Mt(l,l.return,Se)}break;case 4:Fr(c,l),io(l);break;case 13:Fr(c,l),io(l),w=l.child,w.flags&8192&&(E=w.memoizedState!==null,w.stateNode.isHidden=E,!E||w.alternate!==null&&w.alternate.memoizedState!==null||(T0=Pt())),y&4&&Uk(l);break;case 22:if(ie=p!==null&&p.memoizedState!==null,l.mode&1?(_n=(U=_n)||ie,Fr(c,l),_n=U):Fr(c,l),io(l),y&8192){if(U=l.memoizedState!==null,(l.stateNode.isHidden=U)&&!ie&&(l.mode&1)!==0)for(be=l,ie=l.child;ie!==null;){for(ae=be=ie;be!==null;){switch(se=be,ge=se.child,se.tag){case 0:case 11:case 14:case 15:iu(4,se,se.return);break;case 1:ja(se,se.return);var Ce=se.stateNode;if(typeof Ce.componentWillUnmount=="function"){y=se,p=se.return;try{c=y,Ce.props=c.memoizedProps,Ce.state=c.memoizedState,Ce.componentWillUnmount()}catch(Se){Mt(y,p,Se)}}break;case 5:ja(se,se.return);break;case 22:if(se.memoizedState!==null){Gk(ae);continue}}ge!==null?(ge.return=se,be=ge):Gk(ae)}ie=ie.sibling}e:for(ie=null,ae=l;;){if(ae.tag===5){if(ie===null){ie=ae;try{w=ae.stateNode,U?(E=w.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none"):(O=ae.stateNode,z=ae.memoizedProps.style,N=z!=null&&z.hasOwnProperty("display")?z.display:null,O.style.display=ga("display",N))}catch(Se){Mt(l,l.return,Se)}}}else if(ae.tag===6){if(ie===null)try{ae.stateNode.nodeValue=U?"":ae.memoizedProps}catch(Se){Mt(l,l.return,Se)}}else if((ae.tag!==22&&ae.tag!==23||ae.memoizedState===null||ae===l)&&ae.child!==null){ae.child.return=ae,ae=ae.child;continue}if(ae===l)break e;for(;ae.sibling===null;){if(ae.return===null||ae.return===l)break e;ie===ae&&(ie=null),ae=ae.return}ie===ae&&(ie=null),ae.sibling.return=ae.return,ae=ae.sibling}}break;case 19:Fr(c,l),io(l),y&4&&Uk(l);break;case 21:break;default:Fr(c,l),io(l)}}function io(l){var c=l.flags;if(c&2){try{e:{for(var p=l.return;p!==null;){if(Bk(p)){var y=p;break e}p=p.return}throw Error(n(160))}switch(y.tag){case 5:var w=y.stateNode;y.flags&32&&(Rn(w,""),y.flags&=-33);var E=Vk(l);S0(l,E,w);break;case 3:case 4:var N=y.stateNode.containerInfo,O=Vk(l);C0(l,O,N);break;default:throw Error(n(161))}}catch(z){Mt(l,l.return,z)}l.flags&=-3}c&4096&&(l.flags&=-4097)}function OM(l,c,p){be=l,qk(l)}function qk(l,c,p){for(var y=(l.mode&1)!==0;be!==null;){var w=be,E=w.child;if(w.tag===22&&y){var N=w.memoizedState!==null||zd;if(!N){var O=w.alternate,z=O!==null&&O.memoizedState!==null||_n;O=zd;var U=_n;if(zd=N,(_n=z)&&!U)for(be=w;be!==null;)N=be,z=N.child,N.tag===22&&N.memoizedState!==null?Jk(w):z!==null?(z.return=N,be=z):Jk(w);for(;E!==null;)be=E,qk(E),E=E.sibling;be=w,zd=O,_n=U}Kk(l)}else(w.subtreeFlags&8772)!==0&&E!==null?(E.return=w,be=E):Kk(l)}}function Kk(l){for(;be!==null;){var c=be;if((c.flags&8772)!==0){var p=c.alternate;try{if((c.flags&8772)!==0)switch(c.tag){case 0:case 11:case 15:_n||Fd(5,c);break;case 1:var y=c.stateNode;if(c.flags&4&&!_n)if(p===null)y.componentDidMount();else{var w=c.elementType===c.type?p.memoizedProps:Lr(c.type,p.memoizedProps);y.componentDidUpdate(w,p.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var E=c.updateQueue;E!==null&&Gb(c,E,y);break;case 3:var N=c.updateQueue;if(N!==null){if(p=null,c.child!==null)switch(c.child.tag){case 5:p=c.child.stateNode;break;case 1:p=c.child.stateNode}Gb(c,N,p)}break;case 5:var O=c.stateNode;if(p===null&&c.flags&4){p=O;var z=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":z.autoFocus&&p.focus();break;case"img":z.src&&(p.src=z.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var U=c.alternate;if(U!==null){var ie=U.memoizedState;if(ie!==null){var ae=ie.dehydrated;ae!==null&&zl(ae)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}_n||c.flags&512&&w0(c)}catch(se){Mt(c,c.return,se)}}if(c===l){be=null;break}if(p=c.sibling,p!==null){p.return=c.return,be=p;break}be=c.return}}function Gk(l){for(;be!==null;){var c=be;if(c===l){be=null;break}var p=c.sibling;if(p!==null){p.return=c.return,be=p;break}be=c.return}}function Jk(l){for(;be!==null;){var c=be;try{switch(c.tag){case 0:case 11:case 15:var p=c.return;try{Fd(4,c)}catch(z){Mt(c,p,z)}break;case 1:var y=c.stateNode;if(typeof y.componentDidMount=="function"){var w=c.return;try{y.componentDidMount()}catch(z){Mt(c,w,z)}}var E=c.return;try{w0(c)}catch(z){Mt(c,E,z)}break;case 5:var N=c.return;try{w0(c)}catch(z){Mt(c,N,z)}}}catch(z){Mt(c,c.return,z)}if(c===l){be=null;break}var O=c.sibling;if(O!==null){O.return=c.return,be=O;break}be=c.return}}var IM=Math.ceil,$d=A.ReactCurrentDispatcher,E0=A.ReactCurrentOwner,kr=A.ReactCurrentBatchConfig,Xe=0,sn=null,Ft=null,xn=0,ir=0,La=Ss(0),Yt=0,au=null,Di=0,Bd=0,_0=0,lu=null,Gn=null,T0=0,za=1/0,$o=null,Vd=!1,N0=null,Ms=null,Hd=!1,Ds=null,Ud=0,uu=0,A0=null,Wd=-1,qd=0;function In(){return(Xe&6)!==0?Pt():Wd!==-1?Wd:Wd=Pt()}function Rs(l){return(l.mode&1)===0?1:(Xe&2)!==0&&xn!==0?xn&-xn:yM.transition!==null?(qd===0&&(qd=Vv()),qd):(l=ct,l!==0||(l=window.event,l=l===void 0?16:Yv(l.type)),l)}function $r(l,c,p,y){if(50<uu)throw uu=0,A0=null,Error(n(185));Ol(l,p,y),((Xe&2)===0||l!==sn)&&(l===sn&&((Xe&2)===0&&(Bd|=p),Yt===4&&Os(l,xn)),Jn(l,y),p===1&&Xe===0&&(c.mode&1)===0&&(za=Pt()+500,bd&&_s()))}function Jn(l,c){var p=l.callbackNode;yA(l,c);var y=td(l,l===sn?xn:0);if(y===0)p!==null&&Fv(p),l.callbackNode=null,l.callbackPriority=0;else if(c=y&-y,l.callbackPriority!==c){if(p!=null&&Fv(p),c===1)l.tag===0?gM(Yk.bind(null,l)):jb(Yk.bind(null,l)),fM(function(){(Xe&6)===0&&_s()}),p=null;else{switch(Hv(y)){case 1:p=lm;break;case 4:p=$v;break;case 16:p=Yc;break;case 536870912:p=Bv;break;default:p=Yc}p=s2(p,Zk.bind(null,l))}l.callbackPriority=c,l.callbackNode=p}}function Zk(l,c){if(Wd=-1,qd=0,(Xe&6)!==0)throw Error(n(327));var p=l.callbackNode;if(Fa()&&l.callbackNode!==p)return null;var y=td(l,l===sn?xn:0);if(y===0)return null;if((y&30)!==0||(y&l.expiredLanes)!==0||c)c=Kd(l,y);else{c=y;var w=Xe;Xe|=2;var E=Qk();(sn!==l||xn!==c)&&($o=null,za=Pt()+500,Oi(l,c));do try{LM();break}catch(O){Xk(l,O)}while(!0);Km(),$d.current=E,Xe=w,Ft!==null?c=0:(sn=null,xn=0,c=Yt)}if(c!==0){if(c===2&&(w=um(l),w!==0&&(y=w,c=M0(l,w))),c===1)throw p=au,Oi(l,0),Os(l,y),Jn(l,Pt()),p;if(c===6)Os(l,y);else{if(w=l.current.alternate,(y&30)===0&&!PM(w)&&(c=Kd(l,y),c===2&&(E=um(l),E!==0&&(y=E,c=M0(l,E))),c===1))throw p=au,Oi(l,0),Os(l,y),Jn(l,Pt()),p;switch(l.finishedWork=w,l.finishedLanes=y,c){case 0:case 1:throw Error(n(345));case 2:Ii(l,Gn,$o);break;case 3:if(Os(l,y),(y&130023424)===y&&(c=T0+500-Pt(),10<c)){if(td(l,0)!==0)break;if(w=l.suspendedLanes,(w&y)!==y){In(),l.pingedLanes|=l.suspendedLanes&w;break}l.timeoutHandle=jm(Ii.bind(null,l,Gn,$o),c);break}Ii(l,Gn,$o);break;case 4:if(Os(l,y),(y&4194240)===y)break;for(c=l.eventTimes,w=-1;0<y;){var N=31-Ir(y);E=1<<N,N=c[N],N>w&&(w=N),y&=~E}if(y=w,y=Pt()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*IM(y/1960))-y,10<y){l.timeoutHandle=jm(Ii.bind(null,l,Gn,$o),y);break}Ii(l,Gn,$o);break;case 5:Ii(l,Gn,$o);break;default:throw Error(n(329))}}}return Jn(l,Pt()),l.callbackNode===p?Zk.bind(null,l):null}function M0(l,c){var p=lu;return l.current.memoizedState.isDehydrated&&(Oi(l,c).flags|=256),l=Kd(l,c),l!==2&&(c=Gn,Gn=p,c!==null&&D0(c)),l}function D0(l){Gn===null?Gn=l:Gn.push.apply(Gn,l)}function PM(l){for(var c=l;;){if(c.flags&16384){var p=c.updateQueue;if(p!==null&&(p=p.stores,p!==null))for(var y=0;y<p.length;y++){var w=p[y],E=w.getSnapshot;w=w.value;try{if(!Pr(E(),w))return!1}catch{return!1}}}if(p=c.child,c.subtreeFlags&16384&&p!==null)p.return=c,c=p;else{if(c===l)break;for(;c.sibling===null;){if(c.return===null||c.return===l)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Os(l,c){for(c&=~_0,c&=~Bd,l.suspendedLanes|=c,l.pingedLanes&=~c,l=l.expirationTimes;0<c;){var p=31-Ir(c),y=1<<p;l[p]=-1,c&=~y}}function Yk(l){if((Xe&6)!==0)throw Error(n(327));Fa();var c=td(l,0);if((c&1)===0)return Jn(l,Pt()),null;var p=Kd(l,c);if(l.tag!==0&&p===2){var y=um(l);y!==0&&(c=y,p=M0(l,y))}if(p===1)throw p=au,Oi(l,0),Os(l,c),Jn(l,Pt()),p;if(p===6)throw Error(n(345));return l.finishedWork=l.current.alternate,l.finishedLanes=c,Ii(l,Gn,$o),Jn(l,Pt()),null}function R0(l,c){var p=Xe;Xe|=1;try{return l(c)}finally{Xe=p,Xe===0&&(za=Pt()+500,bd&&_s())}}function Ri(l){Ds!==null&&Ds.tag===0&&(Xe&6)===0&&Fa();var c=Xe;Xe|=1;var p=kr.transition,y=ct;try{if(kr.transition=null,ct=1,l)return l()}finally{ct=y,kr.transition=p,Xe=c,(Xe&6)===0&&_s()}}function O0(){ir=La.current,kt(La)}function Oi(l,c){l.finishedWork=null,l.finishedLanes=0;var p=l.timeoutHandle;if(p!==-1&&(l.timeoutHandle=-1,dM(p)),Ft!==null)for(p=Ft.return;p!==null;){var y=p;switch(Vm(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&xd();break;case 3:Ia(),kt(Wn),kt(Cn),t0();break;case 5:Qm(y);break;case 4:Ia();break;case 13:kt(Tt);break;case 19:kt(Tt);break;case 10:Gm(y.type._context);break;case 22:case 23:O0()}p=p.return}if(sn=l,Ft=l=Is(l.current,null),xn=ir=c,Yt=0,au=null,_0=Bd=Di=0,Gn=lu=null,Ni!==null){for(c=0;c<Ni.length;c++)if(p=Ni[c],y=p.interleaved,y!==null){p.interleaved=null;var w=y.next,E=p.pending;if(E!==null){var N=E.next;E.next=w,y.next=N}p.pending=y}Ni=null}return l}function Xk(l,c){do{var p=Ft;try{if(Km(),Md.current=Id,Dd){for(var y=Nt.memoizedState;y!==null;){var w=y.queue;w!==null&&(w.pending=null),y=y.next}Dd=!1}if(Mi=0,on=Zt=Nt=null,tu=!1,nu=0,E0.current=null,p===null||p.return===null){Yt=1,au=c,Ft=null;break}e:{var E=l,N=p.return,O=p,z=c;if(c=xn,O.flags|=32768,z!==null&&typeof z=="object"&&typeof z.then=="function"){var U=z,ie=O,ae=ie.tag;if((ie.mode&1)===0&&(ae===0||ae===11||ae===15)){var se=ie.alternate;se?(ie.updateQueue=se.updateQueue,ie.memoizedState=se.memoizedState,ie.lanes=se.lanes):(ie.updateQueue=null,ie.memoizedState=null)}var ge=Ck(N);if(ge!==null){ge.flags&=-257,Sk(ge,N,O,E,c),ge.mode&1&&wk(E,U,c),c=ge,z=U;var Ce=c.updateQueue;if(Ce===null){var Se=new Set;Se.add(z),c.updateQueue=Se}else Ce.add(z);break e}else{if((c&1)===0){wk(E,U,c),I0();break e}z=Error(n(426))}}else if(Et&&O.mode&1){var jt=Ck(N);if(jt!==null){(jt.flags&65536)===0&&(jt.flags|=256),Sk(jt,N,O,E,c),Wm(Pa(z,O));break e}}E=z=Pa(z,O),Yt!==4&&(Yt=2),lu===null?lu=[E]:lu.push(E),E=N;do{switch(E.tag){case 3:E.flags|=65536,c&=-c,E.lanes|=c;var B=bk(E,z,c);Kb(E,B);break e;case 1:O=z;var $=E.type,H=E.stateNode;if((E.flags&128)===0&&(typeof $.getDerivedStateFromError=="function"||H!==null&&typeof H.componentDidCatch=="function"&&(Ms===null||!Ms.has(H)))){E.flags|=65536,c&=-c,E.lanes|=c;var fe=kk(E,O,c);Kb(E,fe);break e}}E=E.return}while(E!==null)}t2(p)}catch(Te){c=Te,Ft===p&&p!==null&&(Ft=p=p.return);continue}break}while(!0)}function Qk(){var l=$d.current;return $d.current=Id,l===null?Id:l}function I0(){(Yt===0||Yt===3||Yt===2)&&(Yt=4),sn===null||(Di&268435455)===0&&(Bd&268435455)===0||Os(sn,xn)}function Kd(l,c){var p=Xe;Xe|=2;var y=Qk();(sn!==l||xn!==c)&&($o=null,Oi(l,c));do try{jM();break}catch(w){Xk(l,w)}while(!0);if(Km(),Xe=p,$d.current=y,Ft!==null)throw Error(n(261));return sn=null,xn=0,Yt}function jM(){for(;Ft!==null;)e2(Ft)}function LM(){for(;Ft!==null&&!lA();)e2(Ft)}function e2(l){var c=o2(l.alternate,l,ir);l.memoizedProps=l.pendingProps,c===null?t2(l):Ft=c,E0.current=null}function t2(l){var c=l;do{var p=c.alternate;if(l=c.return,(c.flags&32768)===0){if(p=AM(p,c,ir),p!==null){Ft=p;return}}else{if(p=MM(p,c),p!==null){p.flags&=32767,Ft=p;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{Yt=6,Ft=null;return}}if(c=c.sibling,c!==null){Ft=c;return}Ft=c=l}while(c!==null);Yt===0&&(Yt=5)}function Ii(l,c,p){var y=ct,w=kr.transition;try{kr.transition=null,ct=1,zM(l,c,p,y)}finally{kr.transition=w,ct=y}return null}function zM(l,c,p,y){do Fa();while(Ds!==null);if((Xe&6)!==0)throw Error(n(327));p=l.finishedWork;var w=l.finishedLanes;if(p===null)return null;if(l.finishedWork=null,l.finishedLanes=0,p===l.current)throw Error(n(177));l.callbackNode=null,l.callbackPriority=0;var E=p.lanes|p.childLanes;if(xA(l,E),l===sn&&(Ft=sn=null,xn=0),(p.subtreeFlags&2064)===0&&(p.flags&2064)===0||Hd||(Hd=!0,s2(Yc,function(){return Fa(),null})),E=(p.flags&15990)!==0,(p.subtreeFlags&15990)!==0||E){E=kr.transition,kr.transition=null;var N=ct;ct=1;var O=Xe;Xe|=4,E0.current=null,RM(l,p),Wk(p,l),oM(Im),od=!!Om,Im=Om=null,l.current=p,OM(p),uA(),Xe=O,ct=N,kr.transition=E}else l.current=p;if(Hd&&(Hd=!1,Ds=l,Ud=w),E=l.pendingLanes,E===0&&(Ms=null),fA(p.stateNode),Jn(l,Pt()),c!==null)for(y=l.onRecoverableError,p=0;p<c.length;p++)w=c[p],y(w.value,{componentStack:w.stack,digest:w.digest});if(Vd)throw Vd=!1,l=N0,N0=null,l;return(Ud&1)!==0&&l.tag!==0&&Fa(),E=l.pendingLanes,(E&1)!==0?l===A0?uu++:(uu=0,A0=l):uu=0,_s(),null}function Fa(){if(Ds!==null){var l=Hv(Ud),c=kr.transition,p=ct;try{if(kr.transition=null,ct=16>l?16:l,Ds===null)var y=!1;else{if(l=Ds,Ds=null,Ud=0,(Xe&6)!==0)throw Error(n(331));var w=Xe;for(Xe|=4,be=l.current;be!==null;){var E=be,N=E.child;if((be.flags&16)!==0){var O=E.deletions;if(O!==null){for(var z=0;z<O.length;z++){var U=O[z];for(be=U;be!==null;){var ie=be;switch(ie.tag){case 0:case 11:case 15:iu(8,ie,E)}var ae=ie.child;if(ae!==null)ae.return=ie,be=ae;else for(;be!==null;){ie=be;var se=ie.sibling,ge=ie.return;if($k(ie),ie===U){be=null;break}if(se!==null){se.return=ge,be=se;break}be=ge}}}var Ce=E.alternate;if(Ce!==null){var Se=Ce.child;if(Se!==null){Ce.child=null;do{var jt=Se.sibling;Se.sibling=null,Se=jt}while(Se!==null)}}be=E}}if((E.subtreeFlags&2064)!==0&&N!==null)N.return=E,be=N;else e:for(;be!==null;){if(E=be,(E.flags&2048)!==0)switch(E.tag){case 0:case 11:case 15:iu(9,E,E.return)}var B=E.sibling;if(B!==null){B.return=E.return,be=B;break e}be=E.return}}var $=l.current;for(be=$;be!==null;){N=be;var H=N.child;if((N.subtreeFlags&2064)!==0&&H!==null)H.return=N,be=H;else e:for(N=$;be!==null;){if(O=be,(O.flags&2048)!==0)try{switch(O.tag){case 0:case 11:case 15:Fd(9,O)}}catch(Te){Mt(O,O.return,Te)}if(O===N){be=null;break e}var fe=O.sibling;if(fe!==null){fe.return=O.return,be=fe;break e}be=O.return}}if(Xe=w,_s(),no&&typeof no.onPostCommitFiberRoot=="function")try{no.onPostCommitFiberRoot(Xc,l)}catch{}y=!0}return y}finally{ct=p,kr.transition=c}}return!1}function n2(l,c,p){c=Pa(p,c),c=bk(l,c,1),l=Ns(l,c,1),c=In(),l!==null&&(Ol(l,1,c),Jn(l,c))}function Mt(l,c,p){if(l.tag===3)n2(l,l,p);else for(;c!==null;){if(c.tag===3){n2(c,l,p);break}else if(c.tag===1){var y=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(Ms===null||!Ms.has(y))){l=Pa(p,l),l=kk(c,l,1),c=Ns(c,l,1),l=In(),c!==null&&(Ol(c,1,l),Jn(c,l));break}}c=c.return}}function FM(l,c,p){var y=l.pingCache;y!==null&&y.delete(c),c=In(),l.pingedLanes|=l.suspendedLanes&p,sn===l&&(xn&p)===p&&(Yt===4||Yt===3&&(xn&130023424)===xn&&500>Pt()-T0?Oi(l,0):_0|=p),Jn(l,c)}function r2(l,c){c===0&&((l.mode&1)===0?c=1:(c=ed,ed<<=1,(ed&130023424)===0&&(ed=4194304)));var p=In();l=Lo(l,c),l!==null&&(Ol(l,c,p),Jn(l,p))}function $M(l){var c=l.memoizedState,p=0;c!==null&&(p=c.retryLane),r2(l,p)}function BM(l,c){var p=0;switch(l.tag){case 13:var y=l.stateNode,w=l.memoizedState;w!==null&&(p=w.retryLane);break;case 19:y=l.stateNode;break;default:throw Error(n(314))}y!==null&&y.delete(c),r2(l,p)}var o2;o2=function(l,c,p){if(l!==null)if(l.memoizedProps!==c.pendingProps||Wn.current)Kn=!0;else{if((l.lanes&p)===0&&(c.flags&128)===0)return Kn=!1,NM(l,c,p);Kn=(l.flags&131072)!==0}else Kn=!1,Et&&(c.flags&1048576)!==0&&Lb(c,wd,c.index);switch(c.lanes=0,c.tag){case 2:var y=c.type;Ld(l,c),l=c.pendingProps;var w=Ta(c,Cn.current);Oa(c,p),w=o0(null,c,y,l,w,p);var E=s0();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,qn(y)?(E=!0,vd(c)):E=!1,c.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,Ym(c),w.updater=Pd,c.stateNode=w,w._reactInternals=c,d0(c,y,l,p),c=m0(null,c,y,!0,E,p)):(c.tag=0,Et&&E&&Bm(c),On(null,c,w,p),c=c.child),c;case 16:y=c.elementType;e:{switch(Ld(l,c),l=c.pendingProps,w=y._init,y=w(y._payload),c.type=y,w=c.tag=HM(y),l=Lr(y,l),w){case 0:c=p0(null,c,y,l,p);break e;case 1:c=Mk(null,c,y,l,p);break e;case 11:c=Ek(null,c,y,l,p);break e;case 14:c=_k(null,c,y,Lr(y.type,l),p);break e}throw Error(n(306,y,""))}return c;case 0:return y=c.type,w=c.pendingProps,w=c.elementType===y?w:Lr(y,w),p0(l,c,y,w,p);case 1:return y=c.type,w=c.pendingProps,w=c.elementType===y?w:Lr(y,w),Mk(l,c,y,w,p);case 3:e:{if(Dk(c),l===null)throw Error(n(387));y=c.pendingProps,E=c.memoizedState,w=E.element,qb(l,c),Nd(c,y,null,p);var N=c.memoizedState;if(y=N.element,E.isDehydrated)if(E={element:y,isDehydrated:!1,cache:N.cache,pendingSuspenseBoundaries:N.pendingSuspenseBoundaries,transitions:N.transitions},c.updateQueue.baseState=E,c.memoizedState=E,c.flags&256){w=Pa(Error(n(423)),c),c=Rk(l,c,y,p,w);break e}else if(y!==w){w=Pa(Error(n(424)),c),c=Rk(l,c,y,p,w);break e}else for(sr=Cs(c.stateNode.containerInfo.firstChild),or=c,Et=!0,jr=null,p=Ub(c,null,y,p),c.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling;else{if(Ma(),y===w){c=Fo(l,c,p);break e}On(l,c,y,p)}c=c.child}return c;case 5:return Jb(c),l===null&&Um(c),y=c.type,w=c.pendingProps,E=l!==null?l.memoizedProps:null,N=w.children,Pm(y,w)?N=null:E!==null&&Pm(y,E)&&(c.flags|=32),Ak(l,c),On(l,c,N,p),c.child;case 6:return l===null&&Um(c),null;case 13:return Ok(l,c,p);case 4:return Xm(c,c.stateNode.containerInfo),y=c.pendingProps,l===null?c.child=Da(c,null,y,p):On(l,c,y,p),c.child;case 11:return y=c.type,w=c.pendingProps,w=c.elementType===y?w:Lr(y,w),Ek(l,c,y,w,p);case 7:return On(l,c,c.pendingProps,p),c.child;case 8:return On(l,c,c.pendingProps.children,p),c.child;case 12:return On(l,c,c.pendingProps.children,p),c.child;case 10:e:{if(y=c.type._context,w=c.pendingProps,E=c.memoizedProps,N=w.value,yt(Ed,y._currentValue),y._currentValue=N,E!==null)if(Pr(E.value,N)){if(E.children===w.children&&!Wn.current){c=Fo(l,c,p);break e}}else for(E=c.child,E!==null&&(E.return=c);E!==null;){var O=E.dependencies;if(O!==null){N=E.child;for(var z=O.firstContext;z!==null;){if(z.context===y){if(E.tag===1){z=zo(-1,p&-p),z.tag=2;var U=E.updateQueue;if(U!==null){U=U.shared;var ie=U.pending;ie===null?z.next=z:(z.next=ie.next,ie.next=z),U.pending=z}}E.lanes|=p,z=E.alternate,z!==null&&(z.lanes|=p),Jm(E.return,p,c),O.lanes|=p;break}z=z.next}}else if(E.tag===10)N=E.type===c.type?null:E.child;else if(E.tag===18){if(N=E.return,N===null)throw Error(n(341));N.lanes|=p,O=N.alternate,O!==null&&(O.lanes|=p),Jm(N,p,c),N=E.sibling}else N=E.child;if(N!==null)N.return=E;else for(N=E;N!==null;){if(N===c){N=null;break}if(E=N.sibling,E!==null){E.return=N.return,N=E;break}N=N.return}E=N}On(l,c,w.children,p),c=c.child}return c;case 9:return w=c.type,y=c.pendingProps.children,Oa(c,p),w=vr(w),y=y(w),c.flags|=1,On(l,c,y,p),c.child;case 14:return y=c.type,w=Lr(y,c.pendingProps),w=Lr(y.type,w),_k(l,c,y,w,p);case 15:return Tk(l,c,c.type,c.pendingProps,p);case 17:return y=c.type,w=c.pendingProps,w=c.elementType===y?w:Lr(y,w),Ld(l,c),c.tag=1,qn(y)?(l=!0,vd(c)):l=!1,Oa(c,p),xk(c,y,w),d0(c,y,w,p),m0(null,c,y,!0,l,p);case 19:return Pk(l,c,p);case 22:return Nk(l,c,p)}throw Error(n(156,c.tag))};function s2(l,c){return zv(l,c)}function VM(l,c,p,y){this.tag=l,this.key=p,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=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wr(l,c,p,y){return new VM(l,c,p,y)}function P0(l){return l=l.prototype,!(!l||!l.isReactComponent)}function HM(l){if(typeof l=="function")return P0(l)?1:0;if(l!=null){if(l=l.$$typeof,l===J)return 11;if(l===ee)return 14}return 2}function Is(l,c){var p=l.alternate;return p===null?(p=wr(l.tag,c,l.key,l.mode),p.elementType=l.elementType,p.type=l.type,p.stateNode=l.stateNode,p.alternate=l,l.alternate=p):(p.pendingProps=c,p.type=l.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=l.flags&14680064,p.childLanes=l.childLanes,p.lanes=l.lanes,p.child=l.child,p.memoizedProps=l.memoizedProps,p.memoizedState=l.memoizedState,p.updateQueue=l.updateQueue,c=l.dependencies,p.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},p.sibling=l.sibling,p.index=l.index,p.ref=l.ref,p}function Gd(l,c,p,y,w,E){var N=2;if(y=l,typeof l=="function")P0(l)&&(N=1);else if(typeof l=="string")N=5;else e:switch(l){case P:return Pi(p.children,w,E,c);case j:N=8,w|=8;break;case I:return l=wr(12,p,c,w|2),l.elementType=I,l.lanes=E,l;case K:return l=wr(13,p,c,w),l.elementType=K,l.lanes=E,l;case Y:return l=wr(19,p,c,w),l.elementType=Y,l.lanes=E,l;case X:return Jd(p,w,E,c);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case W:N=10;break e;case Z:N=9;break e;case J:N=11;break e;case ee:N=14;break e;case G:N=16,y=null;break e}throw Error(n(130,l==null?l:typeof l,""))}return c=wr(N,p,c,w),c.elementType=l,c.type=y,c.lanes=E,c}function Pi(l,c,p,y){return l=wr(7,l,y,c),l.lanes=p,l}function Jd(l,c,p,y){return l=wr(22,l,y,c),l.elementType=X,l.lanes=p,l.stateNode={isHidden:!1},l}function j0(l,c,p){return l=wr(6,l,null,c),l.lanes=p,l}function L0(l,c,p){return c=wr(4,l.children!==null?l.children:[],l.key,c),c.lanes=p,c.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},c}function UM(l,c,p,y,w){this.tag=c,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=cm(0),this.expirationTimes=cm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=cm(0),this.identifierPrefix=y,this.onRecoverableError=w,this.mutableSourceEagerHydrationData=null}function z0(l,c,p,y,w,E,N,O,z){return l=new UM(l,c,p,O,z),c===1?(c=1,E===!0&&(c|=8)):c=0,E=wr(3,null,null,c),l.current=E,E.stateNode=l,E.memoizedState={element:y,isDehydrated:p,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ym(E),l}function WM(l,c,p){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:D,key:y==null?null:""+y,children:l,containerInfo:c,implementation:p}}function i2(l){if(!l)return Es;l=l._reactInternals;e:{if(Ci(l)!==l||l.tag!==1)throw Error(n(170));var c=l;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(qn(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(n(171))}if(l.tag===1){var p=l.type;if(qn(p))return Ib(l,p,c)}return c}function a2(l,c,p,y,w,E,N,O,z){return l=z0(p,y,!0,l,w,E,N,O,z),l.context=i2(null),p=l.current,y=In(),w=Rs(p),E=zo(y,w),E.callback=c??null,Ns(p,E,w),l.current.lanes=w,Ol(l,w,y),Jn(l,y),l}function Zd(l,c,p,y){var w=c.current,E=In(),N=Rs(w);return p=i2(p),c.context===null?c.context=p:c.pendingContext=p,c=zo(E,N),c.payload={element:l},y=y===void 0?null:y,y!==null&&(c.callback=y),l=Ns(w,c,N),l!==null&&($r(l,w,N,E),Td(l,w,N)),N}function Yd(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 5:return l.child.stateNode;default:return l.child.stateNode}}function l2(l,c){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var p=l.retryLane;l.retryLane=p!==0&&p<c?p:c}}function F0(l,c){l2(l,c),(l=l.alternate)&&l2(l,c)}function qM(){return null}var u2=typeof reportError=="function"?reportError:function(l){console.error(l)};function $0(l){this._internalRoot=l}Xd.prototype.render=$0.prototype.render=function(l){var c=this._internalRoot;if(c===null)throw Error(n(409));Zd(l,c,null,null)},Xd.prototype.unmount=$0.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var c=l.containerInfo;Ri(function(){Zd(null,l,null,null)}),c[Oo]=null}};function Xd(l){this._internalRoot=l}Xd.prototype.unstable_scheduleHydration=function(l){if(l){var c=qv();l={blockedOn:null,target:l,priority:c};for(var p=0;p<bs.length&&c!==0&&c<bs[p].priority;p++);bs.splice(p,0,l),p===0&&Jv(l)}};function B0(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function Qd(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function c2(){}function KM(l,c,p,y,w){if(w){if(typeof y=="function"){var E=y;y=function(){var U=Yd(N);E.call(U)}}var N=a2(c,y,l,0,null,!1,!1,"",c2);return l._reactRootContainer=N,l[Oo]=N.current,Kl(l.nodeType===8?l.parentNode:l),Ri(),N}for(;w=l.lastChild;)l.removeChild(w);if(typeof y=="function"){var O=y;y=function(){var U=Yd(z);O.call(U)}}var z=z0(l,0,!1,null,null,!1,!1,"",c2);return l._reactRootContainer=z,l[Oo]=z.current,Kl(l.nodeType===8?l.parentNode:l),Ri(function(){Zd(c,z,p,y)}),z}function ef(l,c,p,y,w){var E=p._reactRootContainer;if(E){var N=E;if(typeof w=="function"){var O=w;w=function(){var z=Yd(N);O.call(z)}}Zd(c,N,l,w)}else N=KM(p,c,l,w,y);return Yd(N)}Uv=function(l){switch(l.tag){case 3:var c=l.stateNode;if(c.current.memoizedState.isDehydrated){var p=Rl(c.pendingLanes);p!==0&&(dm(c,p|1),Jn(c,Pt()),(Xe&6)===0&&(za=Pt()+500,_s()))}break;case 13:Ri(function(){var y=Lo(l,1);if(y!==null){var w=In();$r(y,l,1,w)}}),F0(l,1)}},fm=function(l){if(l.tag===13){var c=Lo(l,134217728);if(c!==null){var p=In();$r(c,l,134217728,p)}F0(l,134217728)}},Wv=function(l){if(l.tag===13){var c=Rs(l),p=Lo(l,c);if(p!==null){var y=In();$r(p,l,c,y)}F0(l,c)}},qv=function(){return ct},Kv=function(l,c){var p=ct;try{return ct=l,c()}finally{ct=p}},wi=function(l,c,p){switch(c){case"input":if(qt(l,p),c=p.name,p.type==="radio"&&c!=null){for(p=l;p.parentNode;)p=p.parentNode;for(p=p.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<p.length;c++){var y=p[c];if(y!==l&&y.form===l.form){var w=yd(y);if(!w)throw Error(n(90));Re(y),qt(y,w)}}}break;case"textarea":bi(l,p);break;case"select":c=p.value,c!=null&&Dn(l,!!p.multiple,c,!1)}},tt=R0,at=Ri;var GM={usingClientEntryPoint:!1,Events:[Zl,Ea,yd,Ae,it,R0]},cu={findFiberByHostInstance:Si,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},JM={bundleType:cu.bundleType,version:cu.version,rendererPackageName:cu.rendererPackageName,rendererConfig:cu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:A.ReactCurrentDispatcher,findHostInstanceByFiber:function(l){return l=jv(l),l===null?null:l.stateNode},findFiberByHostInstance:cu.findFiberByHostInstance||qM,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 tf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tf.isDisabled&&tf.supportsFiber)try{Xc=tf.inject(JM),no=tf}catch{}}return Zn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=GM,Zn.createPortal=function(l,c){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!B0(c))throw Error(n(200));return WM(l,c,null,p)},Zn.createRoot=function(l,c){if(!B0(l))throw Error(n(299));var p=!1,y="",w=u2;return c!=null&&(c.unstable_strictMode===!0&&(p=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onRecoverableError!==void 0&&(w=c.onRecoverableError)),c=z0(l,1,!1,null,null,p,!1,y,w),l[Oo]=c.current,Kl(l.nodeType===8?l.parentNode:l),new $0(c)},Zn.findDOMNode=function(l){if(l==null)return null;if(l.nodeType===1)return l;var c=l._reactInternals;if(c===void 0)throw typeof l.render=="function"?Error(n(188)):(l=Object.keys(l).join(","),Error(n(268,l)));return l=jv(c),l=l===null?null:l.stateNode,l},Zn.flushSync=function(l){return Ri(l)},Zn.hydrate=function(l,c,p){if(!Qd(c))throw Error(n(200));return ef(null,l,c,!0,p)},Zn.hydrateRoot=function(l,c,p){if(!B0(l))throw Error(n(405));var y=p!=null&&p.hydratedSources||null,w=!1,E="",N=u2;if(p!=null&&(p.unstable_strictMode===!0&&(w=!0),p.identifierPrefix!==void 0&&(E=p.identifierPrefix),p.onRecoverableError!==void 0&&(N=p.onRecoverableError)),c=a2(c,null,l,1,p??null,w,!1,E,N),l[Oo]=c.current,Kl(l),y)for(l=0;l<y.length;l++)p=y[l],w=p._getVersion,w=w(p._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[p,w]:c.mutableSourceEagerHydrationData.push(p,w);return new Xd(c)},Zn.render=function(l,c,p){if(!Qd(c))throw Error(n(200));return ef(null,l,c,!1,p)},Zn.unmountComponentAtNode=function(l){if(!Qd(l))throw Error(n(40));return l._reactRootContainer?(Ri(function(){ef(null,null,l,!1,function(){l._reactRootContainer=null,l[Oo]=null})}),!0):!1},Zn.unstable_batchedUpdates=R0,Zn.unstable_renderSubtreeIntoContainer=function(l,c,p,y){if(!Qd(p))throw Error(n(200));if(l==null||l._reactInternals===void 0)throw Error(n(38));return ef(l,c,p,!1,y)},Zn.version="18.3.1-next-f1338f8080-20240426",Zn}var k2;function JS(){if(k2)return W0.exports;k2=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(),W0.exports=r5(),W0.exports}var w2;function o5(){if(w2)return nf;w2=1;var t=JS();return nf.createRoot=t.createRoot,nf.hydrateRoot=t.hydrateRoot,nf}var s5=o5();function ZS(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=ZS(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function YS(){for(var t,e,n=0,r="",o=arguments.length;n<o;n++)(t=arguments[n])&&(e=ZS(t))&&(r&&(r+=" "),r+=e);return r}const C2=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,S2=YS,XS=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return S2(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 h=n==null?void 0:n[d],f=s==null?void 0:s[d];if(h===null)return null;const m=C2(h)||C2(f);return o[d][m]}),a=n&&Object.entries(n).reduce((d,h)=>{let[f,m]=h;return m===void 0||(d[f]=m),d},{}),u=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((d,h)=>{let{class:f,className:m,...x}=h;return Object.entries(x).every(v=>{let[b,k]=v;return Array.isArray(k)?k.includes({...s,...a}[b]):{...s,...a}[b]===k})?[...d,f,m]:d},[]);return S2(t,i,u,n==null?void 0:n.class,n==null?void 0:n.className)};var Ur=JS();const QS=Ay(Ur);var i5=Object.defineProperty,My=(t,e)=>i5(t,"name",{value:e,configurable:!0});function u1(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}My(u1,"setRef");function e3(...t){return e=>{let n=!1;const r=t.map(o=>{const s=u1(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():u1(t[o],null)}}}}My(e3,"composeRefs");function ot(...t){return C.useCallback(e3(...t),t)}My(ot,"useComposedRefs");var a5=Object.defineProperty,Zr=(t,e)=>a5(t,"name",{value:e,configurable:!0});function wo(t){const e=C.forwardRef((n,r)=>{let{children:o,...s}=n,i=null,a=!1;const u=[];c1(o)&&typeof rf=="function"&&(o=rf(o._payload)),C.Children.forEach(o,m=>{var x;if(i3(m)){a=!0;const v=m;let b="child"in v.props?v.props.child:v.props.children;c1(b)&&typeof rf=="function"&&(b=rf(b._payload)),i=l5(v,b),u.push((x=i==null?void 0:i.props)==null?void 0:x.children)}else u.push(m)}),i?i=C.cloneElement(i,void 0,u):!a&&C.Children.count(o)===1&&C.isValidElement(o)&&(i=o);const d=i?s3(i):void 0,h=ot(r,d);if(!i){if(o||o===0)throw new Error(a?d5(t):c5(t));return o}const f=o3(s,i.props??{});return i.type!==C.Fragment&&(f.ref=r?h:d),C.cloneElement(i,f)});return e.displayName=`${t}.Slot`,e}Zr(wo,"createSlot");var t3=wo("Slot"),n3=Symbol.for("radix.slottable");function r3(t){const e=Zr(n=>"child"in n?n.children(n.child):n.children,"Slottable");return e.displayName=`${t}.Slottable`,e.__radixId=n3,e}Zr(r3,"createSlottable");var l5=Zr((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 o3(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]=(...a)=>{const u=s(...a);return o(...a),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...t,...n}}Zr(o3,"mergeProps");function s3(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)}Zr(s3,"getElementRef");function i3(t){return C.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===n3}Zr(i3,"isSlottable");var u5=Symbol.for("react.lazy");function c1(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===u5&&"_payload"in t&&a3(t._payload)}Zr(c1,"isLazyComponent");function a3(t){return typeof t=="object"&&t!==null&&"then"in t}Zr(a3,"isPromiseLike");var c5=Zr(t=>`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),d5=Zr(t=>`${t} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),rf=vl[" use ".trim().toString()],f5=Object.defineProperty,h5=(t,e)=>f5(t,"name",{value:e,configurable:!0}),p5=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],st=p5.reduce((t,e)=>{const n=wo(`Primitive.${e}`),r=C.forwardRef((o,s)=>{const{asChild:i,...a}=o,u=i?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(u,{...a,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function Dy(t,e){t&&Ur.flushSync(()=>t.dispatchEvent(e))}h5(Dy,"dispatchDiscreteCustomEvent");var m5=Object.defineProperty,g5=(t,e)=>m5(t,"name",{value:e,configurable:!0}),l3=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),y5=C.forwardRef(g5(function(e,n){return g.jsx(st.span,{...e,ref:n,style:{...l3,...e.style}})},"VisuallyHidden")),x5=y5,v5=Object.defineProperty,Tr=(t,e)=>v5(t,"name",{value:e,configurable:!0});function b5(t,e){const n=C.createContext(e);n.displayName=t+"Context";const r=Tr(s=>{const{children:i,...a}=s,u=C.useMemo(()=>a,Object.values(a));return g.jsx(n.Provider,{value:u,children:i})},"Provider");r.displayName=t+"Provider";function o(s,i={}){const{optional:a=!1}=i,u=C.useContext(n);if(u)return u;if(e!==void 0)return e;if(!a)throw new Error(`\`${s}\` must be used within \`${t}\``)}return Tr(o,"useContext"),[r,o]}Tr(b5,"createContext");function _o(t,e=[]){let n=[];function r(s,i){const a=C.createContext(i);a.displayName=s+"Context";const u=n.length;n=[...n,i];const d=Tr(f=>{var S;const{scope:m,children:x,...v}=f,b=((S=m==null?void 0:m[t])==null?void 0:S[u])||a,k=C.useMemo(()=>v,Object.values(v));return g.jsx(b.Provider,{value:k,children:x})},"Provider");d.displayName=s+"Provider";function h(f,m,x={}){var S;const{optional:v=!1}=x,b=((S=m==null?void 0:m[t])==null?void 0:S[u])||a,k=C.useContext(b);if(k)return k;if(i!==void 0)return i;if(!v)throw new Error(`\`${f}\` must be used within \`${s}\``)}return Tr(h,"useContext"),[d,h]}Tr(r,"createContext");const o=Tr(()=>{const s=n.map(i=>C.createContext(i));return Tr(function(a){const u=(a==null?void 0:a[t])||s;return C.useMemo(()=>({[`__scope${t}`]:{...a,[t]:u}}),[a,u])},"useScope")},"createScope");return o.scopeName=t,[r,u3(o,...e)]}Tr(_o,"createContextScope");function u3(...t){const e=t[0];if(t.length===1)return e;const n=Tr(()=>{const r=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return Tr(function(s){const i=r.reduce((a,{useScope:u,scopeName:d})=>{const f=u(s)[`__scope${d}`];return{...a,...f}},{});return C.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])},"useComposedScopes")},"createScope");return n.scopeName=e.scopeName,n}Tr(u3,"composeContextScopes");var k5=Object.defineProperty,dn=(t,e)=>k5(t,"name",{value:e,configurable:!0});function ip(t){const e=t+"CollectionProvider",[n,r]=_o(e),[o,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),i=dn(b=>{const{scope:k,children:S}=b,_=C.useRef(null),T=C.useRef(new Map).current;return g.jsx(o,{scope:k,itemMap:T,collectionRef:_,children:S})},"CollectionProvider");i.displayName=e;const a=t+"CollectionSlot",u=wo(a),d=C.forwardRef((b,k)=>{const{scope:S,children:_}=b,T=s(a,S),A=ot(k,T.collectionRef);return g.jsx(u,{ref:A,children:_})});d.displayName=a;const h=t+"CollectionItemSlot",f="data-radix-collection-item",m=wo(h),x=C.forwardRef((b,k)=>{const{scope:S,children:_,...T}=b,A=C.useRef(null),M=ot(k,A),D=s(h,S);return C.useEffect(()=>(D.itemMap.set(A,{ref:A,...T}),()=>void D.itemMap.delete(A))),g.jsx(m,{[f]:"",ref:M,children:_})});x.displayName=h;function v(b){const k=s(t+"CollectionConsumer",b);return C.useCallback(()=>{const _=k.collectionRef.current;if(!_)return[];const T=Array.from(_.querySelectorAll(`[${f}]`));return Array.from(k.itemMap.values()).sort((D,P)=>T.indexOf(D.ref.current)-T.indexOf(P.ref.current))},[k.collectionRef,k.itemMap])}return dn(v,"useCollection"),[{Provider:i,Slot:d,ItemSlot:x},v,r]}dn(ip,"createCollection");var E2=new WeakMap,$t,ar,G0=(ar=class extends Map{constructor(n){super(n);h2(this,$t);V0(this,$t,[...super.keys()]),E2.set(this,!0)}set(n,r){return E2.get(this)&&(this.has(n)?Tn(this,$t)[Tn(this,$t).indexOf(n)]=n:Tn(this,$t).push(n)),super.set(n,r),this}insert(n,r,o){const s=this.has(r),i=Tn(this,$t).length,a=Ry(n);let u=a>=0?a:i+a;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 h=this.size+(s?0:1);a<0&&u++;const f=[...Tn(this,$t)];let m,x=!1;for(let v=u;v<h;v++)if(u===v){let b=f[v];f[v]===r&&(b=f[v+1]),s&&this.delete(r),m=this.get(b),this.set(r,o)}else{!x&&f[v-1]===r&&(x=!0);const b=f[x?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 ar(this);return s.insert(n,r,o),s}before(n){const r=Tn(this,$t).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,o){const s=Tn(this,$t).indexOf(n);return s===-1?this:this.insert(s,r,o)}after(n){let r=Tn(this,$t).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=Tn(this,$t).indexOf(n);return s===-1?this:this.insert(s+1,r,o)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return V0(this,$t,[]),super.clear()}delete(n){const r=super.delete(n);return r&&Tn(this,$t).splice(Tn(this,$t).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=Ff(Tn(this,$t),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=Ff(Tn(this,$t),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return Tn(this,$t).indexOf(n)}keyAt(n){return Ff(Tn(this,$t),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 ar(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 ar(o)}reduce(...n){const[r,o]=n;let s=0,i=o??this.at(0);for(const a of this)s===0&&n.length===1?i=a:i=Reflect.apply(r,this,[i,a,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 a=this.at(i);i===this.size-1&&n.length===1?s=a:s=Reflect.apply(r,this,[s,a,i,this])}return s}toSorted(n){const r=[...this.entries()].sort(n);return new ar(r)}toReversed(){const n=new ar;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 ar(r)}slice(n,r){const o=new ar;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 a=this.keyAt(i),u=this.get(a);o.set(a,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}},$t=new WeakMap,dn(ar,"OrderedDict"),ar);function Ff(t,e){if("at"in Array.prototype)return Array.prototype.at.call(t,e);const n=c3(t,e);return n===-1?void 0:t[n]}dn(Ff,"at");function c3(t,e){const n=t.length,r=Ry(e),o=r>=0?r:n+r;return o<0||o>=n?-1:o}dn(c3,"toSafeIndex");function Ry(t){return t!==t||t===0?0:Math.trunc(t)}dn(Ry,"toSafeInteger");function w5(t){const e=t+"CollectionProvider",[n,r]=_o(e),[o,s]=n(e,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new G0,setItemMap:dn(()=>{},"setItemMap")}),i=dn(({state:T,...A})=>T?g.jsx(u,{...A,state:T}):g.jsx(a,{...A}),"CollectionProvider");i.displayName=e;const a=dn(T=>{const A=k();return g.jsx(u,{...T,state:A})},"CollectionInit");a.displayName=e+"Init";const u=dn(T=>{const{scope:A,children:M,state:D}=T,P=C.useRef(null),[j,I]=C.useState(null),W=ot(P,I),[Z,J]=D;return C.useEffect(()=>{if(!j)return;const K=h3(()=>{});return K.observe(j,{childList:!0,subtree:!0}),()=>{K.disconnect()}},[j]),g.jsx(o,{scope:A,itemMap:Z,setItemMap:J,collectionRef:W,collectionRefObject:P,collectionElement:j,children:M})},"CollectionProviderImpl");u.displayName=e+"Impl";const d=t+"CollectionSlot",h=wo(d),f=C.forwardRef((T,A)=>{const{scope:M,children:D}=T,P=s(d,M),j=ot(A,P.collectionRef);return g.jsx(h,{ref:j,children:D})});f.displayName=d;const m=t+"CollectionItemSlot",x="data-radix-collection-item",v=wo(m),b=C.forwardRef((T,A)=>{const{scope:M,children:D,...P}=T,j=C.useRef(null),[I,W]=C.useState(null),Z=ot(A,j,W),J=s(m,M),{setItemMap:K}=J,Y=C.useRef(P);d3(Y.current,P)||(Y.current=P);const ee=Y.current;return C.useEffect(()=>{const G=ee;return K(X=>I?X.has(I)?X.set(I,{...G,element:I}).toSorted(d1):(X.set(I,{...G,element:I}),X.toSorted(d1)):X),()=>{K(X=>!I||!X.has(I)?X:(X.delete(I),new G0(X)))}},[I,ee,K]),g.jsx(v,{[x]:"",ref:Z,children:D})});b.displayName=m;function k(){return C.useState(new G0)}dn(k,"useInitCollection");function S(T){const{itemMap:A}=s(t+"CollectionConsumer",T);return A}return dn(S,"useCollection"),[{Provider:i,Slot:f,ItemSlot:b},{createCollectionScope:r,useCollection:S,useInitCollection:k}]}dn(w5,"createCollection");function d3(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}dn(d3,"shallowEqual");function f3(t,e){return!!(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)}dn(f3,"isElementPreceding");function d1(t,e){return!t[1].element||!e[1].element?0:f3(t[1].element,e[1].element)?-1:1}dn(d1,"sortByDocumentPosition");function h3(t){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){t();return}})}dn(h3,"getChildListObserver");var C5=Object.defineProperty,bl=(t,e)=>C5(t,"name",{value:e,configurable:!0}),p3=!!(typeof window<"u"&&window.document&&window.document.createElement);function Ie(t,e,{checkForDefaultPrevented:n=!0}={}){return bl(function(o){if(t==null||t(o),n===!1||!o||!o.defaultPrevented)return e==null?void 0:e(o)},"handleEvent")}bl(Ie,"composeEventHandlers");function S5(t){var e;if(!p3)throw new Error("Cannot access window outside of the DOM");return((e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)??window}bl(S5,"getOwnerWindow");function f1(t){if(!p3)throw new Error("Cannot access document outside of the DOM");return(t==null?void 0:t.ownerDocument)??document}bl(f1,"getOwnerDocument");function m3(t,e=!1){const{activeElement:n}=f1(t);if(!(n!=null&&n.nodeName))return null;if(g3(n)&&n.contentDocument)return m3(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const o=f1(n).getElementById(r);if(o)return o}}return n}bl(m3,"getActiveElement");function g3(t){return t.tagName==="IFRAME"}bl(g3,"isFrame");var It=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{},E5=Object.defineProperty,_5=(t,e)=>E5(t,"name",{value:e,configurable:!0}),_2=vl[" useEffectEvent ".trim().toString()],T2=vl[" useInsertionEffect ".trim().toString()];function y3(t){if(typeof _2=="function")return _2(t);const e=C.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof T2=="function"?T2(()=>{e.current=t}):It(()=>{e.current=t}),C.useMemo(()=>((...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)}),[])}_5(y3,"useEffectEvent");var T5=Object.defineProperty,Ec=(t,e)=>T5(t,"name",{value:e,configurable:!0}),N5=vl[" useInsertionEffect ".trim().toString()]||It;function Yi({prop:t,defaultProp:e,onChange:n=Ec(()=>{},"onChange"),caller:r}){const[o,s,i]=x3({defaultProp:e,onChange:n}),a=t!==void 0,u=a?t:o,d=C.useCallback(h=>{var f;if(a){const m=v3(h)?h(t):h;m!==t&&((f=i.current)==null||f.call(i,m))}else s(h)},[a,t,s,i]);return[u,d]}Ec(Yi,"useControllableState");function x3({defaultProp:t,onChange:e}){const[n,r]=C.useState(t),o=C.useRef(n),s=C.useRef(e);return N5(()=>{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]}Ec(x3,"useUncontrolledState");function v3(t){return typeof t=="function"}Ec(v3,"isFunction");var N2=Symbol("RADIX:SYNC_STATE");function A5(t,e,n,r){const{prop:o,defaultProp:s,onChange:i,caller:a}=e,u=o!==void 0,d=y3(i),h=[{...n,state:s}];r&&h.push(r);const[f,m]=C.useReducer((k,S)=>{if(S.type===N2)return{...k,state:S.state};const _=t(k,S);return u&&!Object.is(_.state,k.state)&&d(_.state),_},...h),x=f.state,v=C.useRef(x);C.useEffect(()=>{v.current!==x&&(v.current=x,u||d(x))},[x,v,u]);const b=C.useMemo(()=>o!==void 0?{...f,state:o}:f,[f,o]);return C.useEffect(()=>{u&&!Object.is(o,f.state)&&m({type:N2,state:o})},[o,f.state,u]),[b,m]}Ec(A5,"useControllableStateReducer");var M5=Object.defineProperty,as=(t,e)=>M5(t,"name",{value:e,configurable:!0});function b3(t,e){return C.useReducer((n,r)=>e[n][r]??n,t)}as(b3,"useStateMachine");var ds=as(t=>{const{present:e,children:n}=t,r=k3(e),o=typeof n=="function"?n({present:r.isPresent}):C.Children.only(n),s=w3(r.ref,C3(o));return typeof n=="function"||r.isPresent?C.cloneElement(o,{ref:s}):null},"Presence");function k3(t){const[e,n]=C.useState(),r=C.useRef(null),o=C.useRef(t),s=C.useRef("none"),i=C.useRef(void 0),a=t?"mounted":"unmounted",[u,d]=b3(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{u==="mounted"?(s.current=i.current??Wa(r.current),i.current=void 0):s.current="none"},[u]),It(()=>{const h=r.current,f=o.current;if(f!==t){const x=s.current,v=Wa(h);t?(i.current=v,d("MOUNT")):v==="none"||(h==null?void 0:h.display)==="none"?d("UNMOUNT"):d(f&&x!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,d]),It(()=>{if(e){let h;const f=e.ownerDocument.defaultView??window,m=as(v=>{const k=Wa(r.current).includes(CSS.escape(v.animationName));if(v.target===e&&k&&(d("ANIMATION_END"),!o.current)){const S=e.style.animationFillMode;e.style.animationFillMode="forwards",h=f.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=S)})}},"handleAnimationEnd"),x=as(v=>{v.target===e&&(s.current=Wa(r.current))},"handleAnimationStart");return e.addEventListener("animationstart",x),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{f.clearTimeout(h),e.removeEventListener("animationstart",x),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:C.useCallback(h=>{if(h){const f=getComputedStyle(h);r.current=f,i.current=Wa(f)}else r.current=null;n(h)},[])}}as(k3,"usePresence");function h1(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}as(h1,"setRef");function w3(...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 a=h1(i,n);return!o&&typeof a=="function"&&(o=!0),a});if(o)return()=>{for(let i=0;i<s.length;i++){const a=s[i];typeof a=="function"?a():h1(r[i],null)}}},[])}as(w3,"useStableComposedRefs");function Wa(t){return(t==null?void 0:t.animationName)||"none"}as(Wa,"getAnimationName");function C3(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)}as(C3,"getElementRef");var D5=Object.defineProperty,R5=(t,e)=>D5(t,"name",{value:e,configurable:!0}),O5=vl[" useId ".trim().toString()]||(()=>{}),I5=0;function bo(t){const[e,n]=C.useState(O5());return It(()=>{t||n(r=>r??String(I5++))},[t]),t||(e?`radix-${e}`:"")}R5(bo,"useId");var P5=Object.defineProperty,j5=(t,e)=>P5(t,"name",{value:e,configurable:!0}),L5=C.createContext(void 0);function ap(t){const e=C.useContext(L5);return t||e||"ltr"}j5(ap,"useDirection");var z5=Object.defineProperty,F5=(t,e)=>z5(t,"name",{value:e,configurable:!0});function Dr(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)}),[])}F5(Dr,"useCallbackRef");var $5=Object.defineProperty,cn=(t,e)=>$5(t,"name",{value:e,configurable:!0}),p1="dismissableLayer.update",B5="dismissableLayer.pointerDownOutside",V5="dismissableLayer.focusOutside",A2,S3=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),lp=C.forwardRef(cn(function(e,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:u,onDismiss:d,...h}=e,f=C.useContext(S3),[m,x]=C.useState(null),v=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=C.useState({}),k=ot(n,x),S=Array.from(f.layers),[_]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),T=_?S.indexOf(_):-1,A=m?S.indexOf(m):-1,M=f.layersWithOutsidePointerEventsDisabled.size>0,D=A>=T,P=C.useRef(!1),j=_3(J=>{i==null||i(J),u==null||u(J),J.defaultPrevented||d==null||d()},{ownerDocument:v,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:P,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:C.useCallback(J=>{if(!(J instanceof Node))return!1;const K=[...f.branches].some(Y=>Y.contains(J));return D&&!K},[f.branches,D])}),I=T3(J=>{if(o&&P.current)return;const K=J.target;[...f.branches].some(ee=>ee.contains(K))||(a==null||a(J),u==null||u(J),J.defaultPrevented||d==null||d())},v),W=m?A===S.length-1:!1,Z=Dr(J=>{J.key==="Escape"&&(s==null||s(J),!J.defaultPrevented&&d&&(J.preventDefault(),d()))});return C.useEffect(()=>{if(W)return v.addEventListener("keydown",Z,{capture:!0}),()=>v.removeEventListener("keydown",Z,{capture:!0})},[v,W,Z]),C.useEffect(()=>{if(m)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(A2=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(m)),f.layers.add(m),m1(),()=>{r&&(f.layersWithOutsidePointerEventsDisabled.delete(m),f.layersWithOutsidePointerEventsDisabled.size===0&&(v.body.style.pointerEvents=A2))}},[m,v,r,f]),C.useEffect(()=>()=>{m&&(f.layers.delete(m),f.layersWithOutsidePointerEventsDisabled.delete(m),m1())},[m,f]),C.useEffect(()=>{const J=cn(()=>b({}),"handleUpdate");return document.addEventListener(p1,J),()=>document.removeEventListener(p1,J)},[]),g.jsx(st.div,{...h,ref:k,style:{pointerEvents:M?D?"auto":"none":void 0,...e.style},onFocusCapture:Ie(e.onFocusCapture,I.onFocusCapture),onBlurCapture:Ie(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:Ie(e.onPointerDownCapture,j.onPointerDownCapture)})},"DismissableLayer"));function E3(){const t=C.useContext(S3),[e,n]=C.useState(null);return C.useEffect(()=>{if(e)return t.dismissableSurfaces.add(e),()=>{t.dismissableSurfaces.delete(e)}},[e,t.dismissableSurfaces]),n}cn(E3,"useDismissableLayerSurface");var H5=cn(()=>!0,"IS_TRUE");function _3(t,e){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:s,shouldHandlePointerDownOutside:i=H5}=e,a=Dr(t),u=C.useRef(!1),d=C.useRef(!1),h=C.useRef(new Map),f=C.useRef(()=>{});return C.useEffect(()=>{function m(){d.current=!1,o.current=!1,h.current.clear()}cn(m,"resetOutsideInteraction");function x(){return Array.from(h.current.values()).some(Boolean)}cn(x,"isOutsideInteractionIntercepted");function v(T){if(!d.current)return;const A=T.target;A instanceof Node&&[...s].some(D=>D.contains(A))||h.current.set(T.type,!0),T.type==="click"&&window.setTimeout(()=>{d.current&&f.current()},0)}cn(v,"handleInteractionCapture");function b(T){d.current&&h.current.set(T.type,!1)}cn(b,"handleInteractionBubble");const k=cn(T=>{if(T.target&&!u.current){let A=function(){n.removeEventListener("click",f.current);const D=x();m(),D||Oy(B5,a,M,{discrete:!0})};if(cn(A,"handleAndDispatchPointerDownOutsideEvent"),!i(T.target)){n.removeEventListener("click",f.current),m(),u.current=!1;return}const M={originalEvent:T};d.current=!0,o.current=r&&T.button===0,h.current.clear(),!r||T.button!==0?A():(n.removeEventListener("click",f.current),f.current=A,n.addEventListener("click",f.current,{once:!0}))}else n.removeEventListener("click",f.current),m();u.current=!1},"handlePointerDown"),S=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const T of S)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",f.current);for(const T of S)n.removeEventListener(T,v,!0),n.removeEventListener(T,b)}},[n,a,r,o,s,i]),{onPointerDownCapture:cn(()=>u.current=!0,"onPointerDownCapture")}}cn(_3,"usePointerDownOutside");function T3(t,e=globalThis==null?void 0:globalThis.document){const n=Dr(t),r=C.useRef(!1);return C.useEffect(()=>{const o=cn(s=>{s.target&&!r.current&&Oy(V5,n,{originalEvent:s},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,n]),{onFocusCapture:cn(()=>r.current=!0,"onFocusCapture"),onBlurCapture:cn(()=>r.current=!1,"onBlurCapture")}}cn(T3,"useFocusOutside");function m1(){const t=new CustomEvent(p1);document.dispatchEvent(t)}cn(m1,"dispatchUpdate");function Oy(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?Dy(o,s):o.dispatchEvent(s)}cn(Oy,"handleAndDispatchCustomEvent");var U5=Object.defineProperty,Pn=(t,e)=>U5(t,"name",{value:e,configurable:!0}),J0="focusScope.autoFocusOnMount",Z0="focusScope.autoFocusOnUnmount",M2={bubbles:!1,cancelable:!0},Iy=C.forwardRef(Pn(function(e,n){const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=e,[u,d]=C.useState(null),h=Dr(s),f=Dr(i),m=C.useRef(null),x=ot(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 M=A.target;u.contains(M)?m.current=M:Ko(m.current,{select:!0})},S=function(A){if(v.paused||!u)return;const M=A.relatedTarget;M!==null&&(u.contains(M)||Ko(m.current,{select:!0}))},_=function(A){if(document.activeElement===document.body)for(const D of A)D.removedNodes.length>0&&Ko(u)};Pn(k,"handleFocusIn"),Pn(S,"handleFocusOut"),Pn(_,"handleMutations"),document.addEventListener("focusin",k),document.addEventListener("focusout",S);const T=new MutationObserver(_);return u&&T.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",k),document.removeEventListener("focusout",S),T.disconnect()}}},[o,u,v.paused]),C.useEffect(()=>{if(u){D2.add(v);const k=document.activeElement;if(!u.contains(k)){const _=new CustomEvent(J0,M2);u.addEventListener(J0,h),u.dispatchEvent(_),_.defaultPrevented||(N3(O3(Py(u)),{select:!0}),document.activeElement===k&&Ko(u))}return()=>{u.removeEventListener(J0,h),setTimeout(()=>{const _=new CustomEvent(Z0,M2);u.addEventListener(Z0,f),u.dispatchEvent(_),_.defaultPrevented||Ko(k??document.body,{select:!0}),u.removeEventListener(Z0,f),D2.remove(v)},0)}}},[u,h,f,v]);const b=C.useCallback(k=>{if(!r&&!o||v.paused)return;const S=k.key==="Tab"&&!k.altKey&&!k.ctrlKey&&!k.metaKey,_=document.activeElement;if(S&&_){const T=k.currentTarget,[A,M]=A3(T);A&&M?!k.shiftKey&&_===M?(k.preventDefault(),r&&Ko(A,{select:!0})):k.shiftKey&&_===A&&(k.preventDefault(),r&&Ko(M,{select:!0})):_===T&&k.preventDefault()}},[r,o,v.paused]);return g.jsx(st.div,{tabIndex:-1,...a,ref:x,onKeyDown:b})},"FocusScope"));function N3(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Ko(r,{select:e}),document.activeElement!==n)return}Pn(N3,"focusFirst");function A3(t){const e=Py(t),n=g1(e,t),r=g1(e.reverse(),t);return[n,r]}Pn(A3,"getTabbableEdges");function Py(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:Pn(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}Pn(Py,"getTabbableCandidates");function g1(t,e){const n=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const r of t)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):M3(r,{upTo:e})))return r}Pn(g1,"findVisible");function M3(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}Pn(M3,"isHidden");function D3(t){return t instanceof HTMLInputElement&&"select"in t}Pn(D3,"isSelectableInput");function Ko(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&D3(t)&&e&&t.select()}}Pn(Ko,"focus");var D2=R3();function R3(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=y1(t,e),t.unshift(e)},remove(e){var n;t=y1(t,e),(n=t[0])==null||n.resume()}}}Pn(R3,"createFocusScopesStack");function y1(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}Pn(y1,"arrayRemove");function O3(t){return t.filter(e=>e.tagName!=="A")}Pn(O3,"removeLinks");var W5=Object.defineProperty,q5=(t,e)=>W5(t,"name",{value:e,configurable:!0}),up=C.forwardRef(q5(function(e,n){var u;const{container:r,...o}=e,[s,i]=C.useState(!1);It(()=>i(!0),[]);const a=r||s&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return a?Ur.createPortal(g.jsx(st.div,{...o,ref:n}),a):null},"Portal")),K5=Object.defineProperty,jy=(t,e)=>K5(t,"name",{value:e,configurable:!0}),of=0,ao=null;function G5(t){return _c(),t.children}jy(G5,"FocusGuards");function _c(){C.useEffect(()=>{ao||(ao={start:x1(),end:x1()});const{start:t,end:e}=ao;return document.body.firstElementChild!==t&&document.body.insertAdjacentElement("afterbegin",t),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),of++,()=>{of===1&&(ao==null||ao.start.remove(),ao==null||ao.end.remove(),ao=null),of=Math.max(0,of-1)}},[])}jy(_c,"useFocusGuards");function x1(){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}jy(x1,"createFocusGuard");var mo=function(){return mo=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},mo.apply(this,arguments)};function I3(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 J5(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 $f="right-scroll-bar-position",Bf="width-before-scroll-bar",Z5="with-scroll-bars-hidden",Y5="--removed-body-scroll-bar-size";function Y0(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function X5(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 Q5=typeof window<"u"?C.useLayoutEffect:C.useEffect,R2=new WeakMap;function eD(t,e){var n=X5(null,function(r){return t.forEach(function(o){return Y0(o,r)})});return Q5(function(){var r=R2.get(n);if(r){var o=new Set(r),s=new Set(t),i=n.current;o.forEach(function(a){s.has(a)||Y0(a,null)}),s.forEach(function(a){o.has(a)||Y0(a,i)})}R2.set(n,t)},[t]),n}function tD(t){return t}function nD(t,e){e===void 0&&(e=tD);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(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var u=function(){var h=i;i=[],h.forEach(s)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(h){i.push(h),d()},filter:function(h){return i=i.filter(h),n}}}};return o}function rD(t){t===void 0&&(t={});var e=nD(null);return e.options=mo({async:!0,ssr:!1},t),e}var P3=function(t){var e=t.sideCar,n=I3(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,mo({},n))};P3.isSideCarExport=!0;function oD(t,e){return t.useMedium(e),P3}var j3=rD(),X0=function(){},cp=C.forwardRef(function(t,e){var n=C.useRef(null),r=C.useState({onScrollCapture:X0,onWheelCapture:X0,onTouchMoveCapture:X0}),o=r[0],s=r[1],i=t.forwardProps,a=t.children,u=t.className,d=t.removeScrollBar,h=t.enabled,f=t.shards,m=t.sideCar,x=t.noRelative,v=t.noIsolation,b=t.inert,k=t.allowPinchZoom,S=t.as,_=S===void 0?"div":S,T=t.gapMode,A=I3(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),M=m,D=eD([n,e]),P=mo(mo({},A),o);return C.createElement(C.Fragment,null,h&&C.createElement(M,{sideCar:j3,removeScrollBar:d,shards:f,noRelative:x,noIsolation:v,inert:b,setCallbacks:s,allowPinchZoom:!!k,lockRef:n,gapMode:T}),i?C.cloneElement(C.Children.only(a),mo(mo({},P),{ref:D})):C.createElement(_,mo({},P,{className:u,ref:D}),a))});cp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};cp.classNames={fullWidth:Bf,zeroRight:$f};var sD=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function iD(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=sD();return e&&t.setAttribute("nonce",e),t}function aD(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function lD(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var uD=function(){var t=0,e=null;return{add:function(n){t==0&&(e=iD())&&(aD(e,n),lD(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},cD=function(){var t=uD();return function(e,n){C.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},L3=function(){var t=cD(),e=function(n){var r=n.styles,o=n.dynamic;return t(r,o),null};return e},dD={left:0,top:0,right:0,gap:0},Q0=function(t){return parseInt(t||"",10)||0},fD=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[Q0(n),Q0(r),Q0(o)]},hD=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return dD;var e=fD(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])}},pD=L3(),Ya="data-scroll-locked",mD=function(t,e,n,r){var o=t.left,s=t.top,i=t.right,a=t.gap;return n===void 0&&(n="margin"),`
|
|
41
|
+
.`.concat(Z5,` {
|
|
42
|
+
overflow: hidden `).concat(r,`;
|
|
43
|
+
padding-right: `).concat(a,"px ").concat(r,`;
|
|
44
|
+
}
|
|
45
|
+
body[`).concat(Ya,`] {
|
|
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(a,"px ").concat(r,`;
|
|
55
|
+
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.`).concat($f,` {
|
|
59
|
+
right: `).concat(a,"px ").concat(r,`;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.`).concat(Bf,` {
|
|
63
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.`).concat($f," .").concat($f,` {
|
|
67
|
+
right: 0 `).concat(r,`;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.`).concat(Bf," .").concat(Bf,` {
|
|
71
|
+
margin-right: 0 `).concat(r,`;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
body[`).concat(Ya,`] {
|
|
75
|
+
`).concat(Y5,": ").concat(a,`px;
|
|
76
|
+
}
|
|
77
|
+
`)},O2=function(){var t=parseInt(document.body.getAttribute(Ya)||"0",10);return isFinite(t)?t:0},gD=function(){C.useEffect(function(){return document.body.setAttribute(Ya,(O2()+1).toString()),function(){var t=O2()-1;t<=0?document.body.removeAttribute(Ya):document.body.setAttribute(Ya,t.toString())}},[])},yD=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,o=r===void 0?"margin":r;gD();var s=C.useMemo(function(){return hD(o)},[o]);return C.createElement(pD,{styles:mD(s,!e,o,n?"":"!important")})},v1=!1;if(typeof window<"u")try{var sf=Object.defineProperty({},"passive",{get:function(){return v1=!0,!0}});window.addEventListener("test",sf,sf),window.removeEventListener("test",sf,sf)}catch{v1=!1}var $a=v1?{passive:!1}:!1,xD=function(t){return t.tagName==="TEXTAREA"},z3=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!xD(t)&&n[e]==="visible")},vD=function(t){return z3(t,"overflowY")},bD=function(t){return z3(t,"overflowX")},I2=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=F3(t,r);if(o){var s=$3(t,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},kD=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},wD=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},F3=function(t,e){return t==="v"?vD(e):bD(e)},$3=function(t,e){return t==="v"?kD(e):wD(e)},CD=function(t,e){return t==="h"&&e==="rtl"?-1:1},SD=function(t,e,n,r,o){var s=CD(t,window.getComputedStyle(e).direction),i=s*r,a=n.target,u=e.contains(a),d=!1,h=i>0,f=0,m=0;do{if(!a)break;var x=$3(t,a),v=x[0],b=x[1],k=x[2],S=b-k-s*v;(v||S)&&F3(t,a)&&(f+=S,m+=v);var _=a.parentNode;a=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!u&&a!==document.body||u&&(e.contains(a)||e===a));return(h&&Math.abs(f)<1||!h&&Math.abs(m)<1)&&(d=!0),d},af=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},P2=function(t){return[t.deltaX,t.deltaY]},j2=function(t){return t&&"current"in t?t.current:t},ED=function(t,e){return t[0]===e[0]&&t[1]===e[1]},_D=function(t){return`
|
|
78
|
+
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
79
|
+
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
80
|
+
`)},TD=0,Ba=[];function ND(t){var e=C.useRef([]),n=C.useRef([0,0]),r=C.useRef(),o=C.useState(TD++)[0],s=C.useState(L3)[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=J5([t.lockRef.current],(t.shards||[]).map(j2),!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 a=C.useCallback(function(b,k){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!i.current.allowPinchZoom;var S=af(b),_=n.current,T="deltaX"in b?b.deltaX:_[0]-S[0],A="deltaY"in b?b.deltaY:_[1]-S[1],M,D=b.target,P=Math.abs(T)>Math.abs(A)?"h":"v";if("touches"in b&&P==="h"&&D.type==="range")return!1;var j=window.getSelection(),I=j&&j.anchorNode,W=I?I===D||I.contains(D):!1;if(W)return!1;var Z=I2(P,D);if(!Z)return!0;if(Z?M=P:(M=P==="v"?"h":"v",Z=I2(P,D)),!Z)return!1;if(!r.current&&"changedTouches"in b&&(T||A)&&(r.current=M),!M)return!0;var J=r.current||M;return SD(J,k,b,J==="h"?T:A)},[]),u=C.useCallback(function(b){var k=b;if(!(!Ba.length||Ba[Ba.length-1]!==s)){var S="deltaY"in k?P2(k):af(k),_=e.current.filter(function(M){return M.name===k.type&&(M.target===k.target||k.target===M.shadowParent)&&ED(M.delta,S)})[0];if(_&&_.should){k.cancelable&&k.preventDefault();return}if(!_){var T=(i.current.shards||[]).map(j2).filter(Boolean).filter(function(M){return M.contains(k.target)}),A=T.length>0?a(k,T[0]):!i.current.noIsolation;A&&k.cancelable&&k.preventDefault()}}},[]),d=C.useCallback(function(b,k,S,_){var T={name:b,delta:k,target:S,should:_,shadowParent:AD(S)};e.current.push(T),setTimeout(function(){e.current=e.current.filter(function(A){return A!==T})},1)},[]),h=C.useCallback(function(b){n.current=af(b),r.current=void 0},[]),f=C.useCallback(function(b){d(b.type,P2(b),b.target,a(b,t.lockRef.current))},[]),m=C.useCallback(function(b){d(b.type,af(b),b.target,a(b,t.lockRef.current))},[]);C.useEffect(function(){return Ba.push(s),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:m}),document.addEventListener("wheel",u,$a),document.addEventListener("touchmove",u,$a),document.addEventListener("touchstart",h,$a),function(){Ba=Ba.filter(function(b){return b!==s}),document.removeEventListener("wheel",u,$a),document.removeEventListener("touchmove",u,$a),document.removeEventListener("touchstart",h,$a)}},[]);var x=t.removeScrollBar,v=t.inert;return C.createElement(C.Fragment,null,v?C.createElement(s,{styles:_D(o)}):null,x?C.createElement(yD,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function AD(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const MD=oD(j3,ND);var dp=C.forwardRef(function(t,e){return C.createElement(cp,mo({},t,{ref:e,sideCar:MD}))});dp.classNames=cp.classNames;var DD=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Va=new WeakMap,lf=new WeakMap,uf={},eg=0,B3=function(t){return t&&(t.host||B3(t.parentNode))},RD=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=B3(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})},OD=function(t,e,n,r){var o=RD(e,Array.isArray(t)?t:[t]);uf[n]||(uf[n]=new WeakMap);var s=uf[n],i=[],a=new Set,u=new Set(o),d=function(f){!f||a.has(f)||(a.add(f),d(f.parentNode))};o.forEach(d);var h=function(f){!f||u.has(f)||Array.prototype.forEach.call(f.children,function(m){if(a.has(m))h(m);else try{var x=m.getAttribute(r),v=x!==null&&x!=="false",b=(Va.get(m)||0)+1,k=(s.get(m)||0)+1;Va.set(m,b),s.set(m,k),i.push(m),b===1&&v&&lf.set(m,!0),k===1&&m.setAttribute(n,"true"),v||m.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",m,S)}})};return h(e),a.clear(),eg++,function(){i.forEach(function(f){var m=Va.get(f)-1,x=s.get(f)-1;Va.set(f,m),s.set(f,x),m||(lf.has(f)||f.removeAttribute(r),lf.delete(f)),x||f.removeAttribute(n)}),eg--,eg||(Va=new WeakMap,Va=new WeakMap,lf=new WeakMap,uf={})}},Ly=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),o=DD(t);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),OD(r,o,n,"aria-hidden")):function(){return null}},ID=Object.defineProperty,fr=(t,e)=>ID(t,"name",{value:e,configurable:!0}),zy="Dialog",[V3,IQ]=_o(zy),[PD,Yr]=V3(zy),jD=fr(t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=t,a=C.useRef(null),u=C.useRef(null),[d,h]=Yi({prop:r,defaultProp:o??!1,onChange:s,caller:zy}),[f,m]=C.useState(0),[x,v]=C.useState(0);return g.jsx(PD,{scope:e,triggerRef:a,contentRef:u,contentId:bo(),titleId:bo(),descriptionId:bo(),titlePresent:f>0,descriptionPresent:x>0,setTitleCount:m,setDescriptionCount:v,open:d,onOpenChange:h,onOpenToggle:C.useCallback(()=>h(b=>!b),[h]),modal:i,children:n})},"Dialog"),LD="DialogTrigger",zD=C.forwardRef(fr(function(e,n){const{__scopeDialog:r,...o}=e,s=Yr(LD,r),i=ot(n,s.triggerRef);return g.jsx(st.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":fp(s.open),...o,ref:i,onClick:Ie(e.onClick,s.onOpenToggle)})},"DialogTrigger")),H3="DialogPortal",[FD,U3]=V3(H3,{forceMount:void 0}),$D=fr(t=>{const{__scopeDialog:e,forceMount:n,children:r,container:o}=t,s=Yr(H3,e);return g.jsx(FD,{scope:e,forceMount:n,children:C.Children.map(r,i=>g.jsx(ds,{present:n||s.open,children:g.jsx(up,{asChild:!0,container:o,children:i})}))})},"DialogPortal"),b1="DialogOverlay",BD=C.forwardRef(fr(function(e,n){const r=U3(b1,e.__scopeDialog),{forceMount:o=r.forceMount,...s}=e,i=Yr(b1,e.__scopeDialog);return i.modal?g.jsx(ds,{present:o||i.open,children:g.jsx(HD,{...s,ref:n})}):null},"DialogOverlay")),VD=wo("DialogOverlay.RemoveScroll"),HD=C.forwardRef(fr(function(e,n){const{__scopeDialog:r,...o}=e,s=Yr(b1,r),i=E3(),a=ot(n,i);return g.jsx(dp,{as:VD,allowPinchZoom:!0,shards:[s.contentRef],children:g.jsx(st.div,{"data-state":fp(s.open),...o,ref:a,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),Hu="DialogContent",UD=C.forwardRef(fr(function(e,n){const r=U3(Hu,e.__scopeDialog),{forceMount:o=r.forceMount,...s}=e,i=Yr(Hu,e.__scopeDialog);return g.jsx(ds,{present:o||i.open,children:i.modal?g.jsx(WD,{...s,ref:n}):g.jsx(qD,{...s,ref:n})})},"DialogContent")),WD=C.forwardRef(fr(function(e,n){const r=Yr(Hu,e.__scopeDialog),o=C.useRef(null),s=ot(n,r.contentRef,o);return C.useEffect(()=>{const i=o.current;if(i)return Ly(i)},[]),g.jsx(W3,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Ie(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Ie(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,u=a.button===0&&a.ctrlKey===!0;(a.button===2||u)&&i.preventDefault()}),onFocusOutside:Ie(e.onFocusOutside,i=>i.preventDefault())})},"DialogContentModal")),qD=C.forwardRef(fr(function(e,n){const r=Yr(Hu,e.__scopeDialog),o=C.useRef(!1),s=C.useRef(!1);return g.jsx(W3,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,u;(a=e.onCloseAutoFocus)==null||a.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,h;(d=e.onInteractOutside)==null||d.call(e,i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((h=r.triggerRef.current)==null?void 0:h.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})},"DialogContentNonModal")),W3=C.forwardRef(fr(function(e,n){const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,...a}=e,u=Yr(Hu,r);return _c(),g.jsx(g.Fragment,{children:g.jsx(Iy,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:i,children:g.jsx(lp,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionPresent?u.descriptionId:void 0,"aria-labelledby":u.titlePresent?u.titleId:void 0,"data-state":fp(u.open),...a,ref:n,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1)})})})},"DialogContentImpl")),KD="DialogTitle",GD=C.forwardRef(fr(function(e,n){const{__scopeDialog:r,...o}=e,s=Yr(KD,r),{setTitleCount:i}=s;return It(()=>(i(a=>a+1),()=>i(a=>a-1)),[i]),g.jsx(st.h2,{id:s.titleId,...o,ref:n})},"DialogTitle")),JD="DialogDescription",ZD=C.forwardRef(fr(function(e,n){const{__scopeDialog:r,...o}=e,s=Yr(JD,r),{setDescriptionCount:i}=s;return It(()=>(i(a=>a+1),()=>i(a=>a-1)),[i]),g.jsx(st.p,{id:s.descriptionId,...o,ref:n})},"DialogDescription")),YD="DialogClose",Fy=C.forwardRef(fr(function(e,n){const{__scopeDialog:r,...o}=e,s=Yr(YD,r);return g.jsx(st.button,{type:"button",...o,ref:n,onClick:Ie(e.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function fp(t){return t?"open":"closed"}fr(fp,"getState");var XD=Object.defineProperty,QD=(t,e)=>XD(t,"name",{value:e,configurable:!0});function q3(t){const[e,n]=C.useState(void 0);return It(()=>{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,a;if("borderBoxSize"in s){const u=s.borderBoxSize,d=Array.isArray(u)?u[0]:u;i=d.inlineSize,a=d.blockSize}else i=t.offsetWidth,a=t.offsetHeight;n({width:i,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}QD(q3,"useSize");const eR=["top","right","bottom","left"],si=Math.min,Xo=Math.max,Zf=Math.round,cf=Math.floor,Qo=t=>({x:t,y:t}),tR={left:"right",right:"left",bottom:"top",top:"bottom"};function K3(t,e,n){return Xo(t,si(e,n))}function ls(t,e){return typeof t=="function"?t(e):t}function ii(t){return t.split("-")[0]}function kl(t){return t.split("-")[1]}function $y(t){return t==="x"?"y":"x"}function By(t){return t==="y"?"height":"width"}function go(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Vy(t){return $y(go(t))}function nR(t,e,n){n===void 0&&(n=!1);const r=kl(t),o=Vy(t),s=By(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(i=Yf(i)),[i,Yf(i)]}function rR(t){const e=Yf(t);return[k1(t),e,k1(e)]}function k1(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const L2=["left","right"],z2=["right","left"],oR=["top","bottom"],sR=["bottom","top"];function iR(t,e,n){switch(t){case"top":case"bottom":return n?e?z2:L2:e?L2:z2;case"left":case"right":return e?oR:sR;default:return[]}}function aR(t,e,n,r){const o=kl(t);let s=iR(ii(t),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),e&&(s=s.concat(s.map(k1)))),s}function Yf(t){const e=ii(t);return tR[e]+t.slice(e.length)}function lR(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 G3(t){return typeof t!="number"?lR(t):{top:t,right:t,bottom:t,left:t}}function Xf(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 F2(t,e,n){let{reference:r,floating:o}=t;const s=go(e),i=Vy(e),a=By(i),u=ii(e),d=s==="y",h=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,m=r[a]/2-o[a]/2;let x;switch(u){case"top":x={x:h,y:r.y-o.height};break;case"bottom":x={x:h,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:f};break;case"left":x={x:r.x-o.width,y:f};break;default:x={x:r.x,y:r.y}}const v=kl(e);return v&&(x[i]+=m*(v==="end"?1:-1)*(n&&d?-1:1)),x}async function uR(t,e){var n;e===void 0&&(e={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:u}=t,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:f="floating",altBoundary:m=!1,padding:x=0}=ls(e,t),v=G3(x),k=a[m?f==="floating"?"reference":"floating":f],S=Xf(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(a.floating)),boundary:d,rootBoundary:h,strategy:u})),_=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),A=await(s.isElement==null?void 0:s.isElement(T))&&await(s.getScale==null?void 0:s.getScale(T))||{x:1,y:1},M=Xf(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:_,offsetParent:T,strategy:u}):_);return{top:(S.top-M.top+v.top)/A.y,bottom:(M.bottom-S.bottom+v.bottom)/A.y,left:(S.left-M.left+v.left)/A.x,right:(M.right-S.right+v.right)/A.x}}const cR=50,dR=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:uR},u=await(i.isRTL==null?void 0:i.isRTL(e));let d=await i.getElementRects({reference:t,floating:e,strategy:o}),{x:h,y:f}=F2(d,r,u),m=r,x=0;const v={};for(let b=0;b<s.length;b++){const k=s[b];if(!k)continue;const{name:S,fn:_}=k,{x:T,y:A,data:M,reset:D}=await _({x:h,y:f,initialPlacement:r,placement:m,strategy:o,middlewareData:v,rects:d,platform:a,elements:{reference:t,floating:e}});h=T??h,f=A??f,v[S]={...v[S],...M},D&&x<cR&&(x++,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:h,y:f}=F2(d,m,u)),b=-1)}return{x:h,y:f,placement:m,strategy:o,middlewareData:v}},fR=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:u}=e,{element:d,padding:h=0}=ls(t,e)||{};if(d==null)return{};const f=G3(h),m={x:n,y:r},x=Vy(o),v=By(x),b=await i.getDimensions(d),k=x==="y",S=k?"top":"left",_=k?"bottom":"right",T=k?"clientHeight":"clientWidth",A=s.reference[v]+s.reference[x]-m[x]-s.floating[v],M=m[x]-s.reference[x],D=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let P=D?D[T]:0;(!P||!await(i.isElement==null?void 0:i.isElement(D)))&&(P=a.floating[T]||s.floating[v]);const j=A/2-M/2,I=P/2-b[v]/2-1,W=si(f[S],I),Z=si(f[_],I),J=P-b[v]-Z,K=P/2-b[v]/2+j,Y=K3(W,K,J),ee=!u.arrow&&kl(o)!=null&&K!==Y&&s.reference[v]/2-(K<W?W:Z)-b[v]/2<0,G=ee?K<W?K-W:K-J:0;return{[x]:m[x]+G,data:{[x]:Y,centerOffset:K-Y-G,...ee&&{alignmentOffset:G}},reset:ee}}}),hR=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:a,platform:u,elements:d}=e,{mainAxis:h=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:b=!0,...k}=ls(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const S=ii(o),_=go(a),T=ii(a)===a,A=await(u.isRTL==null?void 0:u.isRTL(d.floating)),M=m||(T||!b?[Yf(a)]:rR(a)),D=v!=="none";!m&&D&&M.push(...aR(a,b,v,A));const P=[a,...M],j=await u.detectOverflow(e,k),I=[];let W=((r=s.flip)==null?void 0:r.overflows)||[];if(h&&I.push(j[S]),f){const Y=nR(o,i,A);I.push(j[Y[0]],j[Y[1]])}if(W=[...W,{placement:o,overflows:I}],!I.every(Y=>Y<=0)){var Z,J;const Y=(((Z=s.flip)==null?void 0:Z.index)||0)+1,ee=P[Y];if(ee&&(!(f==="alignment"?_!==go(ee):!1)||W.every(q=>go(q.placement)===_?q.overflows[0]>0:!0)))return{data:{index:Y,overflows:W},reset:{placement:ee}};let G=(J=W.filter(X=>X.overflows[0]<=0).sort((X,q)=>X.overflows[1]-q.overflows[1])[0])==null?void 0:J.placement;if(!G)switch(x){case"bestFit":{var K;const X=(K=W.filter(q=>{if(D){const te=go(q.placement);return te===_||te==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(te=>te>0).reduce((te,F)=>te+F,0)]).sort((q,te)=>q[1]-te[1])[0])==null?void 0:K[0];X&&(G=X);break}case"initialPlacement":G=a;break}if(o!==G)return{reset:{placement:G}}}return{}}}};function $2(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function B2(t){return eR.some(e=>t[e]>=0)}const pR=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:o="referenceHidden",...s}=ls(t,e);switch(o){case"referenceHidden":{const i=await r.detectOverflow(e,{...s,elementContext:"reference"}),a=$2(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:B2(a)}}}case"escaped":{const i=await r.detectOverflow(e,{...s,altBoundary:!0}),a=$2(i,n.floating);return{data:{escapedOffsets:a,escaped:B2(a)}}}default:return{}}}}},J3=new Set(["left","top"]);async function mR(t,e){const{placement:n,platform:r,elements:o}=t,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=ii(n),a=kl(n),u=go(n)==="y",d=J3.has(i)?-1:1,h=s&&u?-1:1,f=ls(e,t);let{mainAxis:m,crossAxis:x,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof v=="number"&&(x=a==="end"?v*-1:v),u?{x:x*h,y:m*d}:{x:m*d,y:x*h}}const gR=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:a}=e,u=await mR(e,t);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:s+u.y,data:{...u,placement:i}}}}},yR=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:a=!1,limiter:u={fn:_=>{let{x:T,y:A}=_;return{x:T,y:A}}},...d}=ls(t,e),h={x:n,y:r},f=await s.detectOverflow(e,d),m=go(o),x=$y(m);let v=h[x],b=h[m];const k=(_,T)=>K3(T+f[_==="y"?"top":"left"],T,T-f[_==="y"?"bottom":"right"]);i&&(v=k(x,v)),a&&(b=k(m,b));const S=u.fn({...e,[x]:v,[m]:b});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[x]:i,[m]:a}}}}}},xR=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,r;const{x:o,y:s,placement:i,rects:a,middlewareData:u}=e,{offset:d=0,mainAxis:h=!0,crossAxis:f=!0}=ls(t,e),m={x:o,y:s},x=go(i),v=$y(x);let b=m[v],k=m[x];const S=ls(d,e),_=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:(n=S.mainAxis)!=null?n:0,crossAxis:(r=S.crossAxis)!=null?r:0};if(h){const M=v==="y"?"height":"width",D=a.reference[v]-a.floating[M]+_.mainAxis,P=a.reference[v]+a.reference[M]-_.mainAxis;b<D?b=D:b>P&&(b=P)}if(f){var T,A;const M=v==="y"?"width":"height",D=J3.has(ii(i)),P=a.reference[x]-a.floating[M]+(D&&((T=u.offset)==null?void 0:T[x])||0)+(D?0:_.crossAxis),j=a.reference[x]+a.reference[M]+(D?0:((A=u.offset)==null?void 0:A[x])||0)-(D?_.crossAxis:0);k<P?k=P:k>j&&(k=j)}return{[v]:b,[x]:k}}}},vR=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=()=>{},...a}=ls(t,e),u=await o.detectOverflow(e,a),d=ii(n),h=kl(n),f=go(n)==="y",{width:m,height:x}=r.floating;let v,b;d==="top"||d==="bottom"?(v=d,b=h===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(b=d,v=h==="end"?"top":"bottom");const k=x-u.top-u.bottom,S=m-u.left-u.right,_=si(x-u[v],k),T=si(m-u[b],S),A=e.middlewareData.shift,M=!A;let D=_,P=T;A!=null&&A.enabled.x&&(P=S),A!=null&&A.enabled.y&&(D=k),M&&!h&&(f?P=m-2*Xo(u.left,u.right):D=x-2*Xo(u.top,u.bottom)),await i({...e,availableWidth:P,availableHeight:D});const j=await o.getDimensions(s.floating);return m!==j.width||x!==j.height?{reset:{rects:!0}}:{}}}};function hp(){return typeof window<"u"}function wl(t){return Z3(t)?(t.nodeName||"").toLowerCase():"#document"}function Qn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function fs(t){var e;return(e=(Z3(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Z3(t){return hp()?t instanceof Node||t instanceof Qn(t).Node:!1}function Co(t){return hp()?t instanceof Element||t instanceof Qn(t).Element:!1}function pi(t){return hp()?t instanceof HTMLElement||t instanceof Qn(t).HTMLElement:!1}function V2(t){return!hp()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Qn(t).ShadowRoot}function pp(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=So(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&o!=="inline"&&o!=="contents"}function bR(t){return/^(table|td|th)$/.test(wl(t))}function mp(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const kR=/transform|translate|scale|rotate|perspective|filter/,wR=/paint|layout|strict|content/,ji=t=>!!t&&t!=="none";let tg;function Hy(t){const e=Co(t)?So(t):t;return ji(e.transform)||ji(e.translate)||ji(e.scale)||ji(e.rotate)||ji(e.perspective)||!Uy()&&(ji(e.backdropFilter)||ji(e.filter))||kR.test(e.willChange||"")||wR.test(e.contain||"")}function CR(t){let e=Xi(t);for(;pi(e)&&!Uu(e);){if(Hy(e))return e;if(mp(e))return null;e=Xi(e)}return null}function Uy(){return tg==null&&(tg=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),tg}function Uu(t){return/^(html|body|#document)$/.test(wl(t))}function So(t){return Qn(t).getComputedStyle(t)}function gp(t){return Co(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Xi(t){if(wl(t)==="html")return t;const e=t.assignedSlot||t.parentNode||V2(t)&&t.host||fs(t);return V2(e)?e.host:e}function Y3(t){const e=Xi(t);return Uu(e)?(t.ownerDocument||t).body:pi(e)&&pp(e)?e:Y3(e)}function Wu(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const o=Y3(t),s=o===((r=t.ownerDocument)==null?void 0:r.body),i=Qn(o);if(s){const a=w1(i);return e.concat(i,i.visualViewport||[],pp(o)?o:[],a&&n?Wu(a):[])}else return e.concat(o,Wu(o,[],n))}function w1(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function X3(t){const e=So(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=pi(t),s=o?t.offsetWidth:n,i=o?t.offsetHeight:r,a=Zf(n)!==s||Zf(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Wy(t){return Co(t)?t:t.contextElement}function Xa(t){const e=Wy(t);if(!pi(e))return Qo(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:s}=X3(e);let i=(s?Zf(n.width):n.width)/r,a=(s?Zf(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const SR=Qo(0);function Q3(t){const e=Qn(t);return!Uy()||!e.visualViewport?SR:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ER(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===Qn(t)}function Qi(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),s=Wy(t);let i=Qo(1);e&&(r?Co(r)&&(i=Xa(r)):i=Xa(t));const a=ER(s,n,r)?Q3(s):Qo(0);let u=(o.left+a.x)/i.x,d=(o.top+a.y)/i.y,h=o.width/i.x,f=o.height/i.y;if(s&&r){const m=Qn(s),x=Co(r)?Qn(r):r;let v=m,b=w1(v);for(;b&&x!==v;){const k=Xa(b),S=b.getBoundingClientRect(),_=So(b),T=S.left+(b.clientLeft+parseFloat(_.paddingLeft))*k.x,A=S.top+(b.clientTop+parseFloat(_.paddingTop))*k.y;u*=k.x,d*=k.y,h*=k.x,f*=k.y,u+=T,d+=A,v=Qn(b),b=w1(v)}}return Xf({width:h,height:f,x:u,y:d})}function yp(t,e){const n=gp(t).scrollLeft;return e?e.left+n:Qi(fs(t)).left+n}function eE(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-yp(t,n),o=n.top+e.scrollTop;return{x:r,y:o}}function _R(t){let{elements:e,rect:n,offsetParent:r,strategy:o}=t;const s=o==="fixed",i=fs(r),a=e?mp(e.floating):!1;if(r===i||a&&s)return n;let u={scrollLeft:0,scrollTop:0},d=Qo(1);const h=Qo(0),f=pi(r);if((f||!s)&&((wl(r)!=="body"||pp(i))&&(u=gp(r)),f)){const x=Qi(r);d=Xa(r),h.x=x.x+r.clientLeft,h.y=x.y+r.clientTop}const m=i&&!f&&!s?eE(i,u):Qo(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+h.x+m.x,y:n.y*d.y-u.scrollTop*d.y+h.y+m.y}}function TR(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function NR(t){const e=gp(t),n=t.ownerDocument.body,r=Xo(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=Xo(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-e.scrollLeft+yp(t);const i=-e.scrollTop;return So(n).direction==="rtl"&&(s+=Xo(t.clientWidth,n.clientWidth)-r),{width:r,height:o,x:s,y:i}}const AR=25;function MR(t,e,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",o=Qn(t),s=fs(t),i=o.visualViewport;let a=s.clientWidth,u=s.clientHeight,d=0,h=0;if(i){const m=!Uy()||e==="fixed";r?m||(d=-i.offsetLeft,h=-i.offsetTop):(a=i.width,u=i.height,m&&(d=i.offsetLeft,h=i.offsetTop))}if(yp(s)<=0){const m=s.ownerDocument,x=m.body,v=getComputedStyle(x),b=m.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,k=Math.abs(s.clientWidth-x.clientWidth-b),S=getComputedStyle(s).scrollbarGutter==="stable both-edges"?k/2:k;S<=AR&&(a-=S)}return{width:a,height:u,x:d,y:h}}function DR(t,e){const n=Qi(t,!0,e==="fixed"),r=n.top+t.clientTop,o=n.left+t.clientLeft,s=Xa(t),i=t.clientWidth*s.x,a=t.clientHeight*s.y,u=o*s.x,d=r*s.y;return{width:i,height:a,x:u,y:d}}function H2(t,e,n){let r;if(e==="viewport"||e==="layoutViewport")r=MR(t,n,e);else if(e==="document")r=NR(fs(t));else if(Co(e))r=DR(e,n);else{const o=Q3(t);r={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return Xf(r)}function RR(t,e){const n=e.get(t);if(n)return n;let r=Wu(t,[],!1).filter(a=>Co(a)&&wl(a)!=="body"),o=null;const s=So(t).position==="fixed";let i=s?Xi(t):t;for(;Co(i)&&!Uu(i);){const a=So(i),u=Hy(i),d=o?o.position:s?"fixed":"";!u&&(d==="fixed"||d==="absolute"&&a.position==="static")?r=r.filter(f=>f!==i):o=a,i=Xi(i)}return e.set(t,r),r}function OR(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const i=[...n==="clippingAncestors"?mp(e)?[]:RR(e,this._c):[].concat(n),r],a=H2(e,i[0],o);let u=a.top,d=a.right,h=a.bottom,f=a.left;for(let m=1;m<i.length;m++){const x=H2(e,i[m],o);u=Xo(x.top,u),d=si(x.right,d),h=si(x.bottom,h),f=Xo(x.left,f)}return{width:d-f,height:h-u,x:f,y:u}}function IR(t){const{width:e,height:n}=X3(t);return{width:e,height:n}}function PR(t,e,n){const r=pi(e),o=fs(e),s=n==="fixed",i=Qi(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const u=Qo(0);if((r||!s)&&((wl(e)!=="body"||pp(o))&&(a=gp(e)),r)){const m=Qi(e,!0,s,e);u.x=m.x+e.clientLeft,u.y=m.y+e.clientTop}!r&&o&&(u.x=yp(o));const d=o&&!r&&!s?eE(o,a):Qo(0),h=i.left+a.scrollLeft-u.x-d.x,f=i.top+a.scrollTop-u.y-d.y;return{x:h,y:f,width:i.width,height:i.height}}function ng(t){return So(t).position==="static"}function U2(t,e){if(!pi(t)||So(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return fs(t)===n&&(n=n.ownerDocument.body),n}function tE(t,e){const n=Qn(t);if(mp(t))return n;if(!pi(t)){let o=Xi(t);for(;o&&!Uu(o);){if(Co(o)&&!ng(o))return o;o=Xi(o)}return n}let r=U2(t,e);for(;r&&bR(r)&&ng(r);)r=U2(r,e);return r&&Uu(r)&&ng(r)&&!Hy(r)?n:r||CR(t)||n}const jR=async function(t){const e=this.getOffsetParent||tE,n=this.getDimensions,r=await n(t.floating);return{reference:PR(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function LR(t){return So(t).direction==="rtl"}const zR={convertOffsetParentRelativeRectToViewportRelativeRect:_R,getDocumentElement:fs,getClippingRect:OR,getOffsetParent:tE,getElementRects:jR,getClientRects:TR,getDimensions:IR,getScale:Xa,isElement:Co,isRTL:LR};function nE(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function FR(t,e,n){let r=null,o;const s=fs(t);function i(){var h;clearTimeout(o),(h=r)==null||h.disconnect(),r=null}function a(h,f){h===void 0&&(h=!1),f===void 0&&(f=1),i();const m=t.getBoundingClientRect(),{left:x,top:v,width:b,height:k}=m;if(h||e(),!b||!k)return;const S=cf(v),_=cf(s.clientWidth-(x+b)),T=cf(s.clientHeight-(v+k)),A=cf(x),D={rootMargin:-S+"px "+-_+"px "+-T+"px "+-A+"px",threshold:Xo(0,si(1,f))||1};let P=!0;function j(I){const W=I[0].intersectionRatio;if(!nE(m,t.getBoundingClientRect()))return a();if(W!==f){if(!P)return a();W?a(!1,W):o=setTimeout(()=>{a(!1,1e-7)},1e3)}P=!1}try{r=new IntersectionObserver(j,{...D,root:s.ownerDocument})}catch{r=new IntersectionObserver(j,D)}r.observe(t)}const u=Qn(t),d=()=>a(n);return u.addEventListener("resize",d),a(!0),()=>{u.removeEventListener("resize",d),i()}}function $R(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=Wy(t),h=o||s?[...d?Wu(d):[],...e?Wu(e):[]]:[];h.forEach(S=>{o&&S.addEventListener("scroll",n),s&&S.addEventListener("resize",n)});const f=d&&a?FR(d,n,s):null;let m=-1,x=null;i&&(x=new ResizeObserver(S=>{let[_]=S;_&&_.target===d&&x&&e&&(x.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var T;(T=x)==null||T.observe(e)})),n()}),d&&!u&&x.observe(d),e&&x.observe(e));let v,b=u?Qi(t):null;u&&k();function k(){const S=Qi(t);b&&!nE(b,S)&&n(),b=S,v=requestAnimationFrame(k)}return n(),()=>{var S;h.forEach(_=>{o&&_.removeEventListener("scroll",n),s&&_.removeEventListener("resize",n)}),f==null||f(),(S=x)==null||S.disconnect(),x=null,u&&cancelAnimationFrame(v)}}const BR=gR,VR=yR,HR=hR,UR=vR,WR=pR,W2=fR,qR=xR,KR=(t,e,n)=>{const r=new Map,o=n??{},s={...zR,...o.platform,_c:r};return dR(t,e,{...o,platform:s})};var GR=typeof document<"u",JR=function(){},Vf=GR?C.useLayoutEffect:JR;function Qf(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(!Qf(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)&&!Qf(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function rE(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function q2(t,e){const n=rE(t);return Math.round(e*n)/n}function rg(t){const e=C.useRef(t);return Vf(()=>{e.current=t}),e}function ZR(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:u,open:d}=t,[h,f]=C.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,x]=C.useState(r);Qf(m,r)||x(r);const[v,b]=C.useState(null),[k,S]=C.useState(null),_=C.useCallback(q=>{q!==D.current&&(D.current=q,b(q))},[]),T=C.useCallback(q=>{q!==P.current&&(P.current=q,S(q))},[]),A=s||v,M=i||k,D=C.useRef(null),P=C.useRef(null),j=C.useRef(h),I=u!=null,W=rg(u),Z=rg(o),J=rg(d),K=C.useCallback(()=>{if(!D.current||!P.current)return;const q={placement:e,strategy:n,middleware:m};Z.current&&(q.platform=Z.current),KR(D.current,P.current,q).then(te=>{const F={...te,isPositioned:J.current!==!1};Y.current&&!Qf(j.current,F)&&(j.current=F,Ur.flushSync(()=>{f(F)}))})},[m,e,n,Z,J]);Vf(()=>{d===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,f(q=>({...q,isPositioned:!1})))},[d]);const Y=C.useRef(!1);Vf(()=>(Y.current=!0,()=>{Y.current=!1}),[]),Vf(()=>{if(A&&(D.current=A),M&&(P.current=M),A&&M){if(W.current)return W.current(A,M,K);K()}},[A,M,K,W,I]);const ee=C.useMemo(()=>({reference:D,floating:P,setReference:_,setFloating:T}),[_,T]),G=C.useMemo(()=>({reference:A,floating:M}),[A,M]),X=C.useMemo(()=>{const q={position:n,left:0,top:0};if(!G.floating)return q;const te=q2(G.floating,h.x),F=q2(G.floating,h.y);return a?{...q,transform:"translate("+te+"px, "+F+"px)",...rE(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:te,top:F}},[n,a,G.floating,h.x,h.y]);return C.useMemo(()=>({...h,update:K,refs:ee,elements:G,floatingStyles:X}),[h,K,ee,G,X])}const YR=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?W2({element:r.current,padding:o}).fn(n):{}:r?W2({element:r,padding:o}).fn(n):{}}}},XR=(t,e)=>{const n=BR(t);return{name:n.name,fn:n.fn,options:[t,e]}},QR=(t,e)=>{const n=VR(t);return{name:n.name,fn:n.fn,options:[t,e]}},e8=(t,e)=>({fn:qR(t).fn,options:[t,e]}),t8=(t,e)=>{const n=HR(t);return{name:n.name,fn:n.fn,options:[t,e]}},n8=(t,e)=>{const n=UR(t);return{name:n.name,fn:n.fn,options:[t,e]}},r8=(t,e)=>{const n=WR(t);return{name:n.name,fn:n.fn,options:[t,e]}},o8=(t,e)=>{const n=YR(t);return{name:n.name,fn:n.fn,options:[t,e]}};var s8=Object.defineProperty,i8=(t,e)=>s8(t,"name",{value:e,configurable:!0}),a8=C.forwardRef(i8(function(e,n){const{children:r,width:o=10,height:s=5,...i}=e;return g.jsx(st.svg,{...i,ref:n,width:o,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:g.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),l8=a8,u8=Object.defineProperty,es=(t,e)=>u8(t,"name",{value:e,configurable:!0}),oE="Popper",[sE,Cl]=_o(oE),[c8,iE]=sE(oE),d8=es(t=>{const{__scopePopper:e,children:n}=t,[r,o]=C.useState(null),[s,i]=C.useState(void 0);return g.jsx(c8,{scope:e,anchor:r,onAnchorChange:o,placementState:s,setPlacementState:i,children:n})},"Popper"),f8="PopperAnchor",h8=C.forwardRef(es(function(e,n){const{__scopePopper:r,virtualRef:o,...s}=e,i=iE(f8,r),a=C.useRef(null),u=i.onAnchorChange,d=C.useCallback(b=>{a.current=b,b&&u(b)},[u]),h=ot(n,d),f=C.useRef(null);C.useEffect(()=>{if(!o)return;const b=f.current;f.current=o.current,b!==f.current&&u(f.current)});const m=i.placementState&&xp(i.placementState),x=m==null?void 0:m[0],v=m==null?void 0:m[1];return o?null:g.jsx(st.div,{"data-radix-popper-side":x,"data-radix-popper-align":v,...s,ref:h})},"PopperAnchor")),aE="PopperContent",[p8,m8]=sE(aE),g8=C.forwardRef(es(function(e,n){var de,me,Fe,Re,Be,Ye,At;const{__scopePopper:r,side:o="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:h=[],collisionPadding:f=0,sticky:m="partial",hideWhenDetached:x=!1,updatePositionStrategy:v="optimized",onPlaced:b,...k}=e,S=iE(aE,r),[_,T]=C.useState(null),A=ot(n,T),[M,D]=C.useState(null),P=q3(M),j=(P==null?void 0:P.width)??0,I=(P==null?void 0:P.height)??0,W=o+(i!=="center"?"-"+i:""),Z=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},J=Array.isArray(h)?h:[h],K=J.length>0,Y={padding:Z,boundary:J.filter(lE),altBoundary:K},{refs:ee,floatingStyles:G,placement:X,isPositioned:q,middlewareData:te}=ZR({strategy:"fixed",placement:W,whileElementsMounted:es((...zt)=>$R(...zt,{animationFrame:v==="always"}),"whileElementsMounted"),elements:{reference:S.anchor},middleware:[XR({mainAxis:s+I,alignmentAxis:a}),d&&QR({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?e8():void 0,...Y}),d&&t8({...Y}),n8({...Y,apply:es(({elements:zt,rects:qt,availableWidth:$n,availableHeight:Kt})=>{const{width:nn,height:Dn}=qt.reference,pt=zt.floating.style;pt.setProperty("--radix-popper-available-width",`${$n}px`),pt.setProperty("--radix-popper-available-height",`${Kt}px`),pt.setProperty("--radix-popper-anchor-width",`${nn}px`),pt.setProperty("--radix-popper-anchor-height",`${Dn}px`)},"apply")}),M&&o8({element:M,padding:u}),b8({arrowWidth:j,arrowHeight:I}),x&&r8({strategy:"referenceHidden",...Y,boundary:K?Y.boundary:void 0})]}),F=S.setPlacementState;It(()=>(F(X),()=>{F(void 0)}),[X,F]);const[L,V]=xp(X),re=Dr(b);It(()=>{q&&(re==null||re())},[q,re]);const he=(de=te.arrow)==null?void 0:de.x,ce=(me=te.arrow)==null?void 0:me.y,pe=((Fe=te.arrow)==null?void 0:Fe.centerOffset)!==0,[De,Q]=C.useState();return It(()=>{_&&Q(window.getComputedStyle(_).zIndex)},[_]),g.jsx("div",{ref:ee.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:q?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:De,"--radix-popper-transform-origin":[(Re=te.transformOrigin)==null?void 0:Re.x,(Be=te.transformOrigin)==null?void 0:Be.y].join(" "),...((Ye=te.hide)==null?void 0:Ye.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(p8,{scope:r,placedSide:L,placedAlign:V,onArrowChange:D,arrowX:he,arrowY:ce,shouldHideArrow:pe,children:g.jsx(st.div,{"data-side":L,"data-align":V,...k,ref:A,style:{...k.style,animation:q?(At=k.style)==null?void 0:At.animation:"none"}})})})},"PopperContent")),y8="PopperArrow",x8={top:"bottom",right:"left",bottom:"top",left:"right"},v8=C.forwardRef(es(function(e,n){const{__scopePopper:r,...o}=e,s=m8(y8,r),i=x8[s.placedSide];return g.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:g.jsx(l8,{...o,ref:n,style:{...o.style,display:"block"}})})},"PopperArrow"));function lE(t){return t!==null}es(lE,"isNotNull");var b8=es(t=>({name:"transformOrigin",options:t,fn(e){var k,S,_;const{placement:n,rects:r,middlewareData:o}=e,i=((k=o.arrow)==null?void 0:k.centerOffset)!==0,a=i?0:t.arrowWidth,u=i?0:t.arrowHeight,[d,h]=xp(n),f={start:"0%",center:"50%",end:"100%"}[h],m=(((S=o.arrow)==null?void 0:S.x)??0)+a/2,x=(((_=o.arrow)==null?void 0:_.y)??0)+u/2;let v="",b="";return d==="bottom"?(v=i?f:`${m}px`,b=`${-u}px`):d==="top"?(v=i?f:`${m}px`,b=`${r.floating.height+u}px`):d==="right"?(v=`${-u}px`,b=i?f:`${x}px`):d==="left"&&(v=`${r.floating.width+u}px`,b=i?f:`${x}px`),{data:{x:v,y:b}}}}),"transformOrigin");function xp(t){const[e,n="center"]=t.split("-");return[e,n]}es(xp,"getSideAndAlignFromPlacement");var qy=d8,Ky=h8,Gy=g8,k8=v8,w8=Object.defineProperty,Jy=(t,e)=>w8(t,"name",{value:e,configurable:!0}),og=!1;function uE(){const[t,e]=C.useState(og);return C.useEffect(()=>{og||(og=!0,e(!0))},[]),t}Jy(uE,"useIsHydrated");var cE=vl[" useSyncExternalStore ".trim().toString()];function dE(){return()=>{}}Jy(dE,"subscribe");function fE(){return cE(dE,()=>!0,()=>!1)}Jy(fE,"useIsHydratedModern");var C8=typeof cE=="function"?fE:uE,S8=Object.defineProperty,aa=(t,e)=>S8(t,"name",{value:e,configurable:!0}),sg="rovingFocusGroup.onEntryFocus",E8={bubbles:!1,cancelable:!0},vp="RovingFocusGroup",[C1,hE,_8]=ip(vp),[T8,pE]=_o(vp,[_8]),[N8,A8]=T8(vp),M8=C.forwardRef(aa(function(e,n){return g.jsx(C1.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(C1.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(D8,{...e,ref:n})})})},"RovingFocusGroup")),D8=C.forwardRef(aa(function(e,n){const{__scopeRovingFocusGroup:r,orientation:o,loop:s=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:d,onEntryFocus:h,preventScrollOnEntryFocus:f=!1,...m}=e,x=C.useRef(null),v=ot(n,x),b=ap(i),[k,S]=Yi({prop:a,defaultProp:u??null,onChange:d,caller:vp}),[_,T]=C.useState(!1),A=Dr(h),M=hE(r),D=C.useRef(!1),[P,j]=C.useState(0);return C.useEffect(()=>{const I=x.current;if(I)return I.addEventListener(sg,A),()=>I.removeEventListener(sg,A)},[A]),g.jsx(N8,{scope:r,orientation:o,dir:b,loop:s,currentTabStopId:k,onItemFocus:C.useCallback(I=>S(I),[S]),onItemShiftTab:C.useCallback(()=>T(!0),[]),onFocusableItemAdd:C.useCallback(()=>j(I=>I+1),[]),onFocusableItemRemove:C.useCallback(()=>j(I=>I-1),[]),children:g.jsx(st.div,{tabIndex:_||P===0?-1:0,"data-orientation":o,...m,ref:v,style:{outline:"none",...e.style},onMouseDown:Ie(e.onMouseDown,()=>{D.current=!0}),onFocus:Ie(e.onFocus,I=>{const W=!D.current;if(I.target===I.currentTarget&&W&&!_){const Z=new CustomEvent(sg,E8);if(I.currentTarget.dispatchEvent(Z),!Z.defaultPrevented){const J=M().filter(X=>X.focusable),K=J.find(X=>X.active),Y=J.find(X=>X.id===k),G=[K,Y,...J].filter(Boolean).map(X=>X.ref.current);Zy(G,f)}}D.current=!1}),onBlur:Ie(e.onBlur,()=>T(!1))})})},"RovingFocusGroupImpl")),R8="RovingFocusGroupItem",O8=C.forwardRef(aa(function(e,n){const{__scopeRovingFocusGroup:r,focusable:o=!0,active:s=!1,tabStopId:i,children:a,...u}=e,d=bo(),h=i||d,f=A8(R8,r),m=f.currentTabStopId===h,x=hE(r),{onFocusableItemAdd:v,onFocusableItemRemove:b,currentTabStopId:k}=f,S=C8();return It(()=>{if(!(!S||!o))return v(),()=>b()},[S,o,v,b]),C.useEffect(()=>{if(!(S||!o))return v(),()=>b()},[S,o,v,b]),g.jsx(C1.ItemSlot,{scope:r,id:h,focusable:o,active:s,children:g.jsx(st.span,{tabIndex:m?0:-1,"data-orientation":f.orientation,...u,ref:n,onMouseDown:Ie(e.onMouseDown,_=>{o?f.onItemFocus(h):_.preventDefault()}),onFocus:Ie(e.onFocus,()=>f.onItemFocus(h)),onKeyDown:Ie(e.onKeyDown,_=>{if(_.key==="Tab"&&_.shiftKey){f.onItemShiftTab();return}if(_.target!==_.currentTarget)return;const T=gE(_,f.orientation,f.dir);if(T!==void 0){if(_.metaKey||_.ctrlKey||_.altKey||_.shiftKey)return;_.preventDefault();let M=x().filter(D=>D.focusable).map(D=>D.ref.current);if(T==="last")M.reverse();else if(T==="prev"||T==="next"){T==="prev"&&M.reverse();const D=M.indexOf(_.currentTarget);M=f.loop?yE(M,D+1):M.slice(D+1)}setTimeout(()=>Zy(M))}}),children:typeof a=="function"?a({isCurrentTabStop:m,hasTabStop:k!=null}):a})})},"RovingFocusGroupItem")),I8={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function mE(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}aa(mE,"getDirectionAwareKey");function gE(t,e,n){const r=mE(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return I8[r]}aa(gE,"getFocusIntent");function Zy(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}aa(Zy,"focusFirst");function yE(t,e){return t.map((n,r)=>t[(e+r)%t.length])}aa(yE,"wrapArray");var P8=M8,j8=O8,L8=Object.defineProperty,dt=(t,e)=>L8(t,"name",{value:e,configurable:!0}),z8=["Enter"," "],F8=["ArrowDown","PageUp","Home"],xE=["ArrowUp","PageDown","End"],$8=[...F8,...xE],bp="Menu",[S1,B8,V8]=ip(bp),[la,vE]=_o(bp,[V8,Cl,pE]),Yy=Cl(),bE=pE(),[H8,Tc]=la(bp),[U8,Xy]=la(bp),W8=dt(t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=t,a=Yy(e),[u,d]=C.useState(null),h=C.useRef(!1),f=Dr(s),m=ap(o);return C.useEffect(()=>{const x=dt(()=>{h.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},"handleKeyDown"),v=dt(()=>h.current=!1,"handlePointer");return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),C.useEffect(()=>{if(!n)return;const x=dt(()=>f(!1),"handleBlur");return window.addEventListener("blur",x),()=>window.removeEventListener("blur",x)},[n,f]),g.jsx(qy,{...a,children:g.jsx(H8,{scope:e,open:n,onOpenChange:f,content:u,onContentChange:d,children:g.jsx(U8,{scope:e,onClose:C.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:h,dir:m,modal:i,children:r})})})},"Menu"),q8=C.forwardRef(dt(function(e,n){const{__scopeMenu:r,...o}=e,s=Yy(r);return g.jsx(Ky,{...s,...o,ref:n})},"MenuAnchor")),kE="MenuPortal",[K8,G8]=la(kE,{forceMount:void 0}),J8=dt(t=>{const{__scopeMenu:e,forceMount:n,children:r,container:o}=t,s=Tc(kE,e);return g.jsx(K8,{scope:e,forceMount:n,children:g.jsx(ds,{present:n||s.open,children:g.jsx(up,{asChild:!0,container:o,children:r})})})},"MenuPortal"),Xs="MenuContent",[Z8,wE]=la(Xs),Y8=C.forwardRef(dt(function(e,n){const r=G8(Xs,e.__scopeMenu),{forceMount:o=r.forceMount,...s}=e,i=Tc(Xs,e.__scopeMenu),a=Xy(Xs,e.__scopeMenu);return g.jsx(S1.Provider,{scope:e.__scopeMenu,children:g.jsx(ds,{present:o||i.open,children:g.jsx(S1.Slot,{scope:e.__scopeMenu,children:a.modal?g.jsx(X8,{...s,ref:n}):g.jsx(Q8,{...s,ref:n})})})})},"MenuContent")),X8=C.forwardRef(dt(function(e,n){const r=Tc(Xs,e.__scopeMenu),o=C.useRef(null),s=ot(n,o);return C.useEffect(()=>{const i=o.current;if(i)return Ly(i)},[]),g.jsx(CE,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Ie(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),Q8=C.forwardRef(dt(function(e,n){const r=Tc(Xs,e.__scopeMenu);return g.jsx(CE,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),eO=wo("MenuContent.ScrollLock"),CE=C.forwardRef(dt(function(e,n){const{__scopeMenu:r,loop:o=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:u,onEntryFocus:d,onEscapeKeyDown:h,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:x,onDismiss:v,disableOutsideScroll:b,...k}=e,S=Tc(Xs,r),_=Xy(Xs,r),T=Yy(r),A=bE(r),M=B8(r),[D,P]=C.useState(null),j=C.useRef(null),I=ot(n,j,S.onContentChange),W=C.useRef(0),Z=C.useRef(""),J=C.useRef(0),K=C.useRef(null),Y=C.useRef("right"),ee=C.useRef(0),G=b?dp:C.Fragment,X=b?{as:eO,allowPinchZoom:!0}:void 0,q=dt(F=>{var Q,de;const L=Z.current+F,V=M().filter(me=>!me.disabled),re=document.activeElement,he=(Q=V.find(me=>me.ref.current===re))==null?void 0:Q.textValue,ce=V.map(me=>me.textValue),pe=AE(ce,L,he),De=(de=V.find(me=>me.textValue===pe))==null?void 0:de.ref.current;dt((function me(Fe){Z.current=Fe,window.clearTimeout(W.current),Fe!==""&&(W.current=window.setTimeout(()=>me(""),1e3))}),"updateSearch")(L),De&&setTimeout(()=>De.focus())},"handleTypeaheadSearch");C.useEffect(()=>()=>window.clearTimeout(W.current),[]),_c();const te=C.useCallback(F=>{var V,re;return Y.current===((V=K.current)==null?void 0:V.side)&&DE(F,(re=K.current)==null?void 0:re.area)},[]);return g.jsx(Z8,{scope:r,searchRef:Z,onItemEnter:C.useCallback(F=>{te(F)&&F.preventDefault()},[te]),onItemLeave:C.useCallback(F=>{var L;te(F)||((L=j.current)==null||L.focus(),P(null))},[te]),onTriggerLeave:C.useCallback(F=>{te(F)&&F.preventDefault()},[te]),pointerGraceTimerRef:J,onPointerGraceIntentChange:C.useCallback(F=>{K.current=F},[]),children:g.jsx(G,{...X,children:g.jsx(Iy,{asChild:!0,trapped:s,onMountAutoFocus:Ie(i,F=>{var L;F.preventDefault(),(L=j.current)==null||L.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:g.jsx(lp,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:h,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:x,onDismiss:v,children:g.jsx(P8,{asChild:!0,...A,dir:_.dir,orientation:"vertical",loop:o,currentTabStopId:D,onCurrentTabStopIdChange:P,onEntryFocus:Ie(d,F=>{_.isUsingKeyboardRef.current||F.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(Gy,{role:"menu","aria-orientation":"vertical","data-state":_E(S.open),"data-radix-menu-content":"",dir:_.dir,...T,...k,ref:I,style:{outline:"none",...k.style},onKeyDown:Ie(k.onKeyDown,F=>{const V=F.target.closest("[data-radix-menu-content]")===F.currentTarget,re=F.ctrlKey||F.altKey||F.metaKey,he=F.key.length===1;V&&(F.key==="Tab"&&F.preventDefault(),!re&&he&&q(F.key));const ce=j.current;if(F.target!==ce||!$8.includes(F.key))return;F.preventDefault();const De=M().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);xE.includes(F.key)&&De.reverse(),TE(De)}),onBlur:Ie(e.onBlur,F=>{F.currentTarget.contains(F.target)||(window.clearTimeout(W.current),Z.current="")}),onPointerMove:Ie(e.onPointerMove,eh(F=>{const L=F.target,V=ee.current!==F.clientX;if(F.currentTarget.contains(L)&&V){const re=F.clientX>ee.current?"right":"left";Y.current=re,ee.current=F.clientX}}))})})})})})})},"MenuContentImpl")),tO=C.forwardRef(dt(function(e,n){const{__scopeMenu:r,...o}=e;return g.jsx(st.div,{...o,ref:n})},"MenuLabel")),E1="MenuItem",K2="menu.itemSelect",SE=C.forwardRef(dt(function(e,n){const{disabled:r=!1,onSelect:o,...s}=e,i=C.useRef(null),a=Xy(E1,e.__scopeMenu),u=wE(E1,e.__scopeMenu),d=ot(n,i),h=C.useRef(!1),f=dt(()=>{const m=i.current;if(!r&&m){const x=new CustomEvent(K2,{bubbles:!0,cancelable:!0});m.addEventListener(K2,v=>o==null?void 0:o(v),{once:!0}),Dy(m,x),x.defaultPrevented?h.current=!1:a.onClose()}},"handleSelect");return g.jsx(nO,{...s,ref:d,disabled:r,onClick:Ie(e.onClick,f),onPointerDown:m=>{var x;(x=e.onPointerDown)==null||x.call(e,m),h.current=!0},onPointerUp:Ie(e.onPointerUp,m=>{var x;h.current||(x=m.currentTarget)==null||x.click()}),onKeyDown:Ie(e.onKeyDown,m=>{r||m.target!==m.currentTarget||u.searchRef.current!==""&&m.key===" "||z8.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})},"MenuItem")),nO=C.forwardRef(dt(function(e,n){const{__scopeMenu:r,disabled:o=!1,textValue:s,...i}=e,a=wE(E1,r),u=bE(r),d=C.useRef(null),h=ot(n,d),[f,m]=C.useState(!1),[x,v]=C.useState("");return C.useEffect(()=>{const b=d.current;b&&v((b.textContent??"").trim())},[i.children]),g.jsx(S1.ItemSlot,{scope:r,disabled:o,textValue:s??x,children:g.jsx(j8,{asChild:!0,...u,focusable:!o,children:g.jsx(st.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...i,ref:h,onPointerMove:Ie(e.onPointerMove,eh(b=>{o?a.onItemLeave(b):(a.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ie(e.onPointerLeave,eh(b=>a.onItemLeave(b))),onFocus:Ie(e.onFocus,()=>m(!0)),onBlur:Ie(e.onBlur,()=>m(!1))})})})},"MenuItemImpl")),rO=C.forwardRef(dt(function(e,n){const{checked:r=!1,onCheckedChange:o,...s}=e;return g.jsx(sO,{scope:e.__scopeMenu,checked:r,children:g.jsx(SE,{role:"menuitemcheckbox","aria-checked":qu(r)?"mixed":r,...s,ref:n,"data-state":Qy(r),onSelect:Ie(s.onSelect,()=>o==null?void 0:o(qu(r)?!0:!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),oO="MenuRadioGroup",[PQ,jQ]=la(oO,{value:void 0,onValueChange:dt(()=>{},"onValueChange")}),EE="MenuItemIndicator",[sO,iO]=la(EE,{checked:!1}),aO=C.forwardRef(dt(function(e,n){const{__scopeMenu:r,forceMount:o,...s}=e,i=iO(EE,r);return g.jsx(ds,{present:o||qu(i.checked)||i.checked===!0,children:g.jsx(st.span,{...s,ref:n,"data-state":Qy(i.checked)})})},"MenuItemIndicator")),lO=C.forwardRef(dt(function(e,n){const{__scopeMenu:r,...o}=e;return g.jsx(st.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})},"MenuSeparator")),uO="MenuSub",[LQ,zQ]=la(uO);function _E(t){return t?"open":"closed"}dt(_E,"getOpenState");function qu(t){return t==="indeterminate"}dt(qu,"isIndeterminate");function Qy(t){return qu(t)?"indeterminate":t?"checked":"unchecked"}dt(Qy,"getCheckedState");function TE(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}dt(TE,"focusFirst");function NE(t,e){return t.map((n,r)=>t[(e+r)%t.length])}dt(NE,"wrapArray");function AE(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=NE(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}dt(AE,"getNextMatch");function ME(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 a=e[s],u=e[i],d=a.x,h=a.y,f=u.x,m=u.y;h>r!=m>r&&n<(f-d)*(r-h)/(m-h)+d&&(o=!o)}return o}dt(ME,"isPointInPolygon");function DE(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return ME(n,e)}dt(DE,"isPointerInGraceArea");function eh(t){return e=>e.pointerType==="mouse"?t(e):void 0}dt(eh,"whenMouse");var cO=W8,dO=q8,fO=J8,hO=Y8,pO=tO,mO=SE,gO=rO,yO=aO,xO=lO,vO=Object.defineProperty,hs=(t,e)=>vO(t,"name",{value:e,configurable:!0}),ex="DropdownMenu",[bO,FQ]=_o(ex,[vE]),ps=vE(),[kO,RE]=bO(ex),wO=hs(t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=t,u=ps(e),d=C.useRef(null),[h,f]=Yi({prop:o,defaultProp:s??!1,onChange:i,caller:ex});return g.jsx(kO,{scope:e,triggerId:bo(),triggerRef:d,contentId:bo(),open:h,onOpenChange:f,onOpenToggle:C.useCallback(()=>f(m=>!m),[f]),modal:a,children:g.jsx(cO,{...u,open:h,onOpenChange:f,dir:r,modal:a,children:n})})},"DropdownMenu"),CO="DropdownMenuTrigger",SO=C.forwardRef(hs(function(e,n){const{__scopeDropdownMenu:r,disabled:o=!1,...s}=e,i=RE(CO,r),a=ps(r),u=ot(n,i.triggerRef);return g.jsx(dO,{asChild:!0,...a,children:g.jsx(st.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:Ie(e.onPointerDown,d=>{!o&&d.button===0&&d.ctrlKey===!1&&(i.onOpenToggle(),i.open||d.preventDefault())}),onKeyDown:Ie(e.onKeyDown,d=>{o||(["Enter"," "].includes(d.key)&&i.onOpenToggle(),d.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(d.key)&&d.preventDefault())})})})},"DropdownMenuTrigger")),EO=hs(t=>{const{__scopeDropdownMenu:e,...n}=t,r=ps(e);return g.jsx(fO,{...r,...n})},"DropdownMenuPortal"),_O="DropdownMenuContent",TO=C.forwardRef(hs(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=RE(_O,r),i=ps(r),a=C.useRef(!1);return g.jsx(hO,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...o,ref:n,onCloseAutoFocus:Ie(e.onCloseAutoFocus,u=>{var d;a.current||(d=s.triggerRef.current)==null||d.focus(),a.current=!1,u.preventDefault()}),onInteractOutside:Ie(e.onInteractOutside,u=>{const d=u.detail.originalEvent,h=d.button===0&&d.ctrlKey===!0,f=d.button===2||h;(!s.modal||f)&&(a.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")),NO=C.forwardRef(hs(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=ps(r);return g.jsx(pO,{...s,...o,ref:n})},"DropdownMenuLabel")),AO=C.forwardRef(hs(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=ps(r);return g.jsx(mO,{...s,...o,ref:n})},"DropdownMenuItem")),MO=C.forwardRef(hs(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=ps(r);return g.jsx(gO,{...s,...o,ref:n})},"DropdownMenuCheckboxItem")),DO=C.forwardRef(hs(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=ps(r);return g.jsx(yO,{...s,...o,ref:n})},"DropdownMenuItemIndicator")),RO=C.forwardRef(hs(function(e,n){const{__scopeDropdownMenu:r,...o}=e,s=ps(r);return g.jsx(xO,{...s,...o,ref:n})},"DropdownMenuSeparator")),OO=wO,IO=SO,PO=EO,jO=TO,LO=NO,zO=AO,FO=MO,$O=DO,BO=RO,VO=Object.defineProperty,HO=(t,e)=>VO(t,"name",{value:e,configurable:!0}),UO=C.forwardRef(HO(function(e,n){return g.jsx(st.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")),WO=UO,qO=Object.defineProperty,KO=(t,e)=>qO(t,"name",{value:e,configurable:!0});function OE(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])}KO(OE,"usePrevious");var GO=Object.defineProperty,JO=(t,e)=>GO(t,"name",{value:e,configurable:!0});function _1(t,[e,n]){return Math.min(n,Math.max(e,t))}JO(_1,"clamp");var ZO=Object.defineProperty,Qe=(t,e)=>ZO(t,"name",{value:e,configurable:!0}),YO=[" ","Enter","ArrowUp","ArrowDown"],XO=[" ","Enter"],rl="Select",[kp,wp,QO]=ip(rl),[ua,$Q]=_o(rl,[QO,Cl]),tx=Cl(),[eI,mi]=ua(rl),[tI,nI]=ua(rl);function IE(t){const{__scopeSelect:e,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:u,dir:d,name:h,autoComplete:f,disabled:m,required:x,form:v,internal_do_not_use_render:b}=t,k=tx(e),[S,_]=C.useState(null),[T,A]=C.useState(null),[M,D]=C.useState(!1),P=ap(d),[j,I]=Yi({prop:r,defaultProp:o??!1,onChange:s,caller:rl}),[W,Z]=Yi({prop:i,defaultProp:a,onChange:u,caller:rl}),J=C.useRef(null),K=C.useRef(W);C.useEffect(()=>{const V=v?S==null?void 0:S.ownerDocument.getElementById(v):S==null?void 0:S.form;if(V instanceof HTMLFormElement){const re=Qe(()=>Z(K.current),"reset");return V.addEventListener("reset",re),()=>V.removeEventListener("reset",re)}},[v,S,Z]);const Y=S?!!v||!!S.closest("form"):!0,[ee,G]=C.useState(new Set),X=bo(),q=Array.from(ee).map(V=>V.props.value).join(";"),te=C.useCallback(V=>{G(re=>new Set(re).add(V))},[]),F=C.useCallback(V=>{G(re=>{const he=new Set(re);return he.delete(V),he})},[]),L={required:x,trigger:S,onTriggerChange:_,valueNode:T,onValueNodeChange:A,valueNodeHasChildren:M,onValueNodeHasChildrenChange:D,contentId:X,value:W,onValueChange:Z,open:j,onOpenChange:I,dir:P,triggerPointerDownPosRef:J,disabled:m,name:h,autoComplete:f,form:v,nativeOptions:ee,nativeSelectKey:q,isFormControl:Y};return g.jsx(qy,{...k,children:g.jsx(eI,{scope:e,...L,children:g.jsx(kp.Provider,{scope:e,children:g.jsx(tI,{scope:e,onNativeOptionAdd:te,onNativeOptionRemove:F,children:zE(b)?b(L):n})})})})}Qe(IE,"SelectProvider");var rI=Qe(t=>{const{__scopeSelect:e,children:n,...r}=t;return g.jsx(IE,{__scopeSelect:e,...r,internal_do_not_use_render:({isFormControl:o})=>g.jsxs(g.Fragment,{children:[n,o?g.jsx(AI,{__scopeSelect:e}):null]})})},"Select"),oI="SelectTrigger",sI=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,disabled:o=!1,...s}=e,i=tx(r),a=mi(oI,r),u=a.disabled||o,d=ot(n,a.onTriggerChange),h=wp(r),f=C.useRef("touch"),[m,x,v]=rx(k=>{const S=h().filter(A=>!A.disabled),_=S.find(A=>A.value===a.value),T=ox(S,k,_);T!==void 0&&a.onValueChange(T.value)}),b=Qe(k=>{u||(a.onOpenChange(!0),v()),k&&(a.triggerPointerDownPosRef.current={x:Math.round(k.pageX),y:Math.round(k.pageY)})},"handleOpen");return g.jsx(Ky,{asChild:!0,...i,children:g.jsx(st.button,{type:"button",role:"combobox","aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":Nc(a.value)?"":void 0,...s,ref:d,onClick:Ie(s.onClick,k=>{k.currentTarget.focus(),f.current!=="mouse"&&b(k)}),onPointerDown:Ie(s.onPointerDown,k=>{f.current=k.pointerType;const S=k.target;S.hasPointerCapture(k.pointerId)&&S.releasePointerCapture(k.pointerId),k.button===0&&k.ctrlKey===!1&&k.pointerType==="mouse"&&(b(k),k.preventDefault())}),onKeyDown:Ie(s.onKeyDown,k=>{const S=m.current!=="";!(k.ctrlKey||k.altKey||k.metaKey)&&k.key.length===1&&x(k.key),!(S&&k.key===" ")&&YO.includes(k.key)&&(b(),k.preventDefault())})})})},"SelectTrigger")),iI="SelectValue",aI=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,className:o,style:s,children:i,placeholder:a="",...u}=e,d=mi(iI,r),{onValueNodeHasChildrenChange:h}=d,f=i!==void 0,m=ot(n,d.onValueNodeChange);It(()=>{h(f)},[h,f]);const x=Nc(d.value);return g.jsx(st.span,{...u,asChild:x?!1:u.asChild,ref:m,style:{pointerEvents:"none"},children:g.jsx(C.Fragment,{children:x?a:i},x?"placeholder":"value")})},"SelectValue")),lI=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,children:o,...s}=e;return g.jsx(st.span,{"aria-hidden":!0,...s,ref:n,children:o||"▼"})},"SelectIcon")),uI="SelectPortal",[cI,dI]=ua(uI,{forceMount:void 0}),fI=Qe(t=>{const{__scopeSelect:e,forceMount:n,...r}=t;return g.jsx(cI,{scope:t.__scopeSelect,forceMount:n,children:g.jsx(up,{asChild:!0,...r})})},"SelectPortal"),ea="SelectContent",hI=C.forwardRef(Qe(function(e,n){const r=dI(ea,e.__scopeSelect),{forceMount:o=r.forceMount,...s}=e,i=mi(ea,e.__scopeSelect),[a,u]=C.useState();return It(()=>{u(new DocumentFragment)},[]),g.jsx(ds,{present:o||i.open,children:({present:d})=>d?g.jsx(gI,{...s,ref:n}):g.jsx(pI,{...s,fragment:a})})},"SelectContent")),pI=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,children:o,fragment:s}=e;return s?Ur.createPortal(g.jsx(PE,{scope:r,children:g.jsx(kp.Slot,{scope:r,children:g.jsx("div",{ref:n,children:o})})}),s):null},"SelectContentFragment")),Br=10,[PE,ca]=ua(ea),mI=wo("SelectContent.RemoveScroll"),gI=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r}=e,{position:o="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:a,side:u,sideOffset:d,align:h,alignOffset:f,arrowPadding:m,collisionBoundary:x,collisionPadding:v,sticky:b,hideWhenDetached:k,avoidCollisions:S,..._}=e,T=mi(ea,r),[A,M]=C.useState(null),[D,P]=C.useState(null),j=ot(n,M),[I,W]=C.useState(null),[Z,J]=C.useState(null),K=wp(r),[Y,ee]=C.useState(!1),G=C.useRef(!1);C.useEffect(()=>{if(A)return Ly(A)},[A]),_c();const X=C.useCallback(Q=>{const[de,...me]=K().map(Be=>Be.ref.current),[Fe]=me.slice(-1),Re=document.activeElement;for(const Be of Q)if(Be===Re||(Be==null||Be.scrollIntoView({block:"nearest"}),Be===de&&D&&(D.scrollTop=0),Be===Fe&&D&&(D.scrollTop=D.scrollHeight),Be==null||Be.focus(),document.activeElement!==Re))return},[K,D]),q=C.useCallback(()=>X([I,A]),[X,I,A]);C.useEffect(()=>{Y&&q()},[Y,q]);const{onOpenChange:te,triggerPointerDownPosRef:F}=T;C.useEffect(()=>{if(A){let Q={x:0,y:0};const de=Qe(Fe=>{var Re,Be;Q={x:Math.abs(Math.round(Fe.pageX)-(((Re=F.current)==null?void 0:Re.x)??0)),y:Math.abs(Math.round(Fe.pageY)-(((Be=F.current)==null?void 0:Be.y)??0))}},"handlePointerMove"),me=Qe(Fe=>{Q.x<=10&&Q.y<=10?Fe.preventDefault():Fe.composedPath().includes(A)||te(!1),document.removeEventListener("pointermove",de),F.current=null},"handlePointerUp");return F.current!==null&&(document.addEventListener("pointermove",de),document.addEventListener("pointerup",me,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",de),document.removeEventListener("pointerup",me,{capture:!0})}}},[A,te,F]),C.useEffect(()=>{const Q=Qe(()=>te(!1),"close");return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[te]);const[L,V]=rx(Q=>{const de=K().filter(Re=>!Re.disabled),me=de.find(Re=>Re.ref.current===document.activeElement),Fe=ox(de,Q,me);Fe&&setTimeout(()=>{var Re;return(Re=Fe.ref.current)==null?void 0:Re.focus()})}),re=C.useCallback((Q,de,me)=>{const Fe=!G.current&&!me;(T.value!==void 0&&T.value===de||Fe)&&(W(Q),Fe&&(G.current=!0))},[T.value]),he=C.useCallback(()=>A==null?void 0:A.focus(),[A]),ce=C.useCallback((Q,de,me)=>{const Fe=!G.current&&!me;(T.value!==void 0&&T.value===de||Fe)&&J(Q)},[T.value]),pe=o==="popper"?G2:yI,De=pe===G2?{side:u,sideOffset:d,align:h,alignOffset:f,arrowPadding:m,collisionBoundary:x,collisionPadding:v,sticky:b,hideWhenDetached:k,avoidCollisions:S}:{};return g.jsx(PE,{scope:r,content:A,viewport:D,onViewportChange:P,itemRefCallback:re,selectedItem:I,onItemLeave:he,itemTextRefCallback:ce,focusSelectedItem:q,selectedItemText:Z,position:o,isPositioned:Y,searchRef:L,children:g.jsx(dp,{as:mI,allowPinchZoom:!0,children:g.jsx(Iy,{asChild:!0,trapped:T.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:Ie(s,Q=>{var de;(de=T.trigger)==null||de.focus({preventScroll:!0}),Q.preventDefault()}),children:g.jsx(lp,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:g.jsx(pe,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:Q=>Q.preventDefault(),..._,...De,onPlaced:()=>ee(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",..._.style},onKeyDown:Ie(_.onKeyDown,Q=>{const de=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!de&&Q.key.length===1&&V(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let Fe=K().filter(Re=>!Re.disabled).map(Re=>Re.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(Fe=Fe.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const Re=Q.target,Be=Fe.indexOf(Re);Fe=Fe.slice(Be+1)}setTimeout(()=>X(Fe)),Q.preventDefault()}})})})})})})},"SelectContentImpl")),yI=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,onPlaced:o,...s}=e,i=mi(ea,r),a=ca(ea,r),[u,d]=C.useState(null),[h,f]=C.useState(null),m=ot(n,f),x=wp(r),v=C.useRef(!1),b=C.useRef(!0),{viewport:k,selectedItem:S,selectedItemText:_,focusSelectedItem:T}=a,A=C.useCallback(()=>{if(i.trigger&&i.valueNode&&u&&h&&k&&S&&_){const j=i.trigger.getBoundingClientRect(),I=h.getBoundingClientRect(),W=i.valueNode.getBoundingClientRect(),Z=_.getBoundingClientRect();if(i.dir!=="rtl"){const Re=Z.left-I.left,Be=W.left-Re,Ye=j.left-Be,At=j.width+Ye,zt=Math.max(At,I.width),qt=window.innerWidth-Br,$n=_1(Be,[Br,Math.max(Br,qt-zt)]);u.style.minWidth=At+"px",u.style.left=$n+"px"}else{const Re=I.right-Z.right,Be=window.innerWidth-W.right-Re,Ye=window.innerWidth-j.right-Be,At=j.width+Ye,zt=Math.max(At,I.width),qt=window.innerWidth-Br,$n=_1(Be,[Br,Math.max(Br,qt-zt)]);u.style.minWidth=At+"px",u.style.right=$n+"px"}const J=x(),K=window.innerHeight-Br*2,Y=k.scrollHeight,ee=window.getComputedStyle(h),G=parseInt(ee.borderTopWidth,10),X=parseInt(ee.paddingTop,10),q=parseInt(ee.borderBottomWidth,10),te=parseInt(ee.paddingBottom,10),F=G+X+Y+te+q,L=Math.min(S.offsetHeight*5,F),V=window.getComputedStyle(k),re=parseInt(V.paddingTop,10),he=parseInt(V.paddingBottom,10),ce=j.top+j.height/2-Br,pe=K-ce,De=S.offsetHeight/2,Q=S.offsetTop+De,de=G+X+Q,me=F-de;if(de<=ce){const Re=J.length>0&&S===J[J.length-1].ref.current;u.style.bottom="0px";const Be=h.clientHeight-k.offsetTop-k.offsetHeight,Ye=Math.max(pe,De+(Re?he:0)+Be+q),At=de+Ye;u.style.height=At+"px"}else{const Re=J.length>0&&S===J[0].ref.current;u.style.top="0px";const Ye=Math.max(ce,G+k.offsetTop+(Re?re:0)+De)+me;u.style.height=Ye+"px",k.scrollTop=de-ce+k.offsetTop}u.style.margin=`${Br}px 0`,u.style.minHeight=L+"px",u.style.maxHeight=K+"px",o==null||o(),requestAnimationFrame(()=>v.current=!0)}},[x,i.trigger,i.valueNode,u,h,k,S,_,i.dir,o]);It(()=>A(),[A]);const[M,D]=C.useState();It(()=>{h&&D(window.getComputedStyle(h).zIndex)},[h]);const P=C.useCallback(j=>{j&&b.current===!0&&(A(),T==null||T(),b.current=!1)},[A,T]);return g.jsx(xI,{scope:r,contentWrapper:u,shouldExpandOnScrollRef:v,onScrollButtonChange:P,children:g.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:g.jsx(st.div,{...s,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})},"SelectItemAlignedPosition")),G2=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,align:o="start",collisionPadding:s=Br,...i}=e,a=tx(r);return g.jsx(Gy,{...a,...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")),[xI,nx]=ua(ea,{}),J2="SelectViewport",vI=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,nonce:o,...s}=e,i=ca(J2,r),a=nx(J2,r),u=ot(n,i.onViewportChange),d=C.useRef(0);return g.jsxs(g.Fragment,{children:[g.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}),g.jsx(kp.Slot,{scope:r,children:g.jsx(st.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Ie(s.onScroll,h=>{const f=h.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:x}=a;if(x!=null&&x.current&&m){const v=Math.abs(d.current-f.scrollTop);if(v>0){const b=window.innerHeight-Br*2,k=parseFloat(m.style.minHeight),S=parseFloat(m.style.height),_=Math.max(k,S);if(_<b){const T=_+v,A=Math.min(b,T),M=T-A;m.style.height=A+"px",m.style.bottom==="0px"&&(f.scrollTop=M>0?M:0,m.style.justifyContent="flex-end")}}}d.current=f.scrollTop})})})]})},"SelectViewport")),bI="SelectGroup",[BQ,VQ]=ua(bI),T1="SelectItem",[kI,jE]=ua(T1),wI=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,value:o,disabled:s=!1,textValue:i,...a}=e,u=mi(T1,r),d=ca(T1,r),h=u.value===o,[f,m]=C.useState(i??""),[x,v]=C.useState(!1),b=Dr(A=>{var M;return(M=d.itemRefCallback)==null?void 0:M.call(d,A,o,s)}),k=ot(n,b),S=bo(),_=C.useRef("touch"),T=Qe(()=>{s||(u.onValueChange(o),u.onOpenChange(!1))},"handleSelect");return g.jsx(kI,{scope:r,value:o,disabled:s,textId:S,isSelected:h,onItemTextChange:C.useCallback(A=>{m(M=>M||((A==null?void 0:A.textContent)??"").trim())},[]),children:g.jsx(kp.ItemSlot,{scope:r,value:o,disabled:s,textValue:f,children:g.jsx(st.div,{role:"option","aria-labelledby":S,"data-highlighted":x?"":void 0,"aria-selected":h&&x,"data-state":h?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:k,onFocus:Ie(a.onFocus,()=>v(!0)),onBlur:Ie(a.onBlur,()=>v(!1)),onClick:Ie(a.onClick,()=>{_.current!=="mouse"&&T()}),onPointerUp:Ie(a.onPointerUp,()=>{_.current==="mouse"&&T()}),onPointerDown:Ie(a.onPointerDown,A=>{_.current=A.pointerType}),onPointerMove:Ie(a.onPointerMove,A=>{var M;_.current=A.pointerType,s?(M=d.onItemLeave)==null||M.call(d):_.current==="mouse"&&A.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ie(a.onPointerLeave,A=>{var M;A.currentTarget===document.activeElement&&((M=d.onItemLeave)==null||M.call(d))}),onKeyDown:Ie(a.onKeyDown,A=>{var D;s||A.target!==A.currentTarget||((D=d.searchRef)==null?void 0:D.current)!==""&&A.key===" "||(XO.includes(A.key)&&T(),A.key===" "&&A.preventDefault())})})})})},"SelectItem")),df="SelectItemText",CI=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,className:o,style:s,...i}=e,a=mi(df,r),u=ca(df,r),d=jE(df,r),h=nI(df,r),[f,m]=C.useState(null),x=Dr(T=>{var A;return(A=u.itemTextRefCallback)==null?void 0:A.call(u,T,d.value,d.disabled)}),v=ot(n,m,d.onItemTextChange,x),b=f==null?void 0:f.textContent,k=C.useMemo(()=>g.jsx("option",{value:d.value,disabled:d.disabled,children:b},d.value),[d.disabled,d.value,b]),{onNativeOptionAdd:S,onNativeOptionRemove:_}=h;return It(()=>(S(k),()=>_(k)),[S,_,k]),g.jsxs(g.Fragment,{children:[g.jsx(st.span,{id:d.textId,...i,ref:v}),d.isSelected&&a.valueNode&&!a.valueNodeHasChildren&&!Nc(a.value)?Ur.createPortal(i.children,a.valueNode):null]})},"SelectItemText")),SI="SelectItemIndicator",EI=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,...o}=e;return jE(SI,r).isSelected?g.jsx(st.span,{"aria-hidden":!0,...o,ref:n}):null},"SelectItemIndicator")),Z2="SelectScrollUpButton",_I=C.forwardRef(Qe(function(e,n){const r=ca(Z2,e.__scopeSelect),o=nx(Z2,e.__scopeSelect),[s,i]=C.useState(!1),a=ot(n,o.onScrollButtonChange);return It(()=>{if(r.viewport&&r.isPositioned){let u=function(){const h=d.scrollTop>0;i(h)};Qe(u,"handleScroll");const d=r.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),s?g.jsx(LE,{...e,ref:a,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=r;u&&d&&(u.scrollTop=u.scrollTop-d.offsetHeight)}}):null},"SelectScrollUpButton")),Y2="SelectScrollDownButton",TI=C.forwardRef(Qe(function(e,n){const r=ca(Y2,e.__scopeSelect),o=nx(Y2,e.__scopeSelect),[s,i]=C.useState(!1),a=ot(n,o.onScrollButtonChange);return It(()=>{if(r.viewport&&r.isPositioned){let u=function(){const h=d.scrollHeight-d.clientHeight,f=Math.ceil(d.scrollTop)<h;i(f)};Qe(u,"handleScroll");const d=r.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),s?g.jsx(LE,{...e,ref:a,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=r;u&&d&&(u.scrollTop=u.scrollTop+d.offsetHeight)}}):null},"SelectScrollDownButton")),LE=C.forwardRef(Qe(function(e,n){const{__scopeSelect:r,onAutoScroll:o,...s}=e,i=ca("SelectScrollButton",r),a=C.useRef(null),u=wp(r),d=C.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return C.useEffect(()=>()=>d(),[d]),It(()=>{var f;const h=u().find(m=>m.ref.current===document.activeElement);(f=h==null?void 0:h.ref.current)==null||f.scrollIntoView({block:"nearest"})},[u]),g.jsx(st.div,{"aria-hidden":!0,...s,ref:n,style:{flexShrink:0,...s.style},onPointerDown:Ie(s.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(o,50))}),onPointerMove:Ie(s.onPointerMove,()=>{var h;(h=i.onItemLeave)==null||h.call(i),a.current===null&&(a.current=window.setInterval(o,50))}),onPointerLeave:Ie(s.onPointerLeave,()=>{d()})})},"SelectScrollButtonImpl")),NI="SelectBubbleInput",AI=C.forwardRef(Qe(function({__scopeSelect:e,...n},r){const o=mi(NI,e),{value:s,onValueChange:i,required:a,disabled:u,name:d,autoComplete:h,form:f}=o,{nativeOptions:m,nativeSelectKey:x}=o,v=C.useRef(null),b=ot(r,v),k=s??"",S=OE(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(S!==k&&D){const P=new Event("change",{bubbles:!0});D.call(T,k),T.dispatchEvent(P)}},[S,k]),g.jsxs(st.select,{"aria-hidden":!0,required:a,tabIndex:-1,name:d,autoComplete:h,disabled:u,form:f,onChange:T=>i(T.target.value),...n,style:{...l3,...n.style},ref:b,defaultValue:k,children:[Nc(s)&&!_?g.jsx("option",{value:""}):null,Array.from(m)]},x)},"SelectBubbleInput"));function zE(t){return typeof t=="function"}Qe(zE,"isFunction");function Nc(t){return t===""||t===void 0}Qe(Nc,"shouldShowPlaceholder");function rx(t){const e=Dr(t),n=C.useRef(""),r=C.useRef(0),o=C.useCallback(i=>{const a=n.current+i;e(a),Qe((function u(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>u(""),1e3))}),"updateSearch")(a)},[e]),s=C.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return C.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}Qe(rx,"useTypeaheadSearch");function ox(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=FE(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}Qe(ox,"findNextItem");function FE(t,e){return t.map((n,r)=>t[(e+r)%t.length])}Qe(FE,"wrapArray");var MI=Object.defineProperty,en=(t,e)=>MI(t,"name",{value:e,configurable:!0}),[sx,HQ]=_o("Tooltip",[Cl]),Cp=Cl(),DI="TooltipProvider",RI=700,N1="tooltip.open",[OI,ix]=sx(DI),II=en(t=>{const{__scopeTooltip:e,delayDuration:n=RI,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=t,i=C.useRef(!0),a=C.useRef(!1),u=C.useRef(0);return C.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),g.jsx(OI,{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:a,onPointerInTransitChange:C.useCallback(d=>{a.current=d},[]),disableHoverableContent:o,children:s})},"TooltipProvider"),A1="Tooltip",[PI,Ac]=sx(A1),jI=en(t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=t,u=ix(A1,t.__scopeTooltip),d=Cp(e),[h,f]=C.useState(null),[m,x]=C.useState(void 0),v=bo(),b=C.useRef(0),k=i??u.disableHoverableContent,S=a??u.delayDuration,_=C.useRef(!1),[T,A]=Yi({prop:r,defaultProp:o??!1,onChange:en(W=>{W?(u.onOpen(),document.dispatchEvent(new CustomEvent(N1))):u.onClose(),s==null||s(W)},"onChange"),caller:A1}),M=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]),P=C.useCallback(()=>{window.clearTimeout(b.current),b.current=0,A(!1)},[A]),j=C.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{_.current=!0,A(!0),b.current=0},S)},[S,A]);C.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]);const I=m??v;return g.jsx(qy,{...d,children:g.jsx(PI,{scope:e,contentId:I,setContentId:x,open:T,stateAttribute:M,trigger:h,onTriggerChange:f,onTriggerEnter:C.useCallback(()=>{u.isOpenDelayedRef.current?j():D()},[u.isOpenDelayedRef,j,D]),onTriggerLeave:C.useCallback(()=>{k?P():(window.clearTimeout(b.current),b.current=0)},[P,k]),onOpen:D,onClose:P,disableHoverableContent:k,children:n})})},"Tooltip"),X2="TooltipTrigger",LI=C.forwardRef(en(function(e,n){const{__scopeTooltip:r,...o}=e,s=Ac(X2,r),i=ix(X2,r),a=Cp(r),u=C.useRef(null),d=ot(n,u,s.onTriggerChange),h=C.useRef(!1),f=C.useRef(!1),m=C.useCallback(()=>h.current=!1,[]);return C.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),g.jsx(Ky,{asChild:!0,...a,children:g.jsx(st.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...o,ref:d,onPointerMove:Ie(e.onPointerMove,x=>{x.pointerType!=="touch"&&!f.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:Ie(e.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:Ie(e.onPointerDown,()=>{s.open&&s.onClose(),h.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:Ie(e.onFocus,()=>{h.current||s.onOpen()}),onBlur:Ie(e.onBlur,s.onClose),onClick:Ie(e.onClick,s.onClose)})})},"TooltipTrigger")),$E="TooltipPortal",[zI,FI]=sx($E,{forceMount:void 0}),$I=en(t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:o}=t,s=Ac($E,e);return g.jsx(zI,{scope:e,forceMount:n,children:g.jsx(ds,{present:n||s.open,children:g.jsx(up,{asChild:!0,container:o,children:r})})})},"TooltipPortal"),Ku="TooltipContent",BI=C.forwardRef(en(function(e,n){const r=FI(Ku,e.__scopeTooltip),{forceMount:o=r.forceMount,side:s="top",...i}=e,a=Ac(Ku,e.__scopeTooltip);return g.jsx(ds,{present:o||a.open,children:a.disableHoverableContent?g.jsx(BE,{side:s,...i,ref:n}):g.jsx(VI,{side:s,...i,ref:n})})},"TooltipContent")),VI=C.forwardRef(en(function(e,n){const r=Ac(Ku,e.__scopeTooltip),o=ix(Ku,e.__scopeTooltip),s=C.useRef(null),i=ot(n,s),[a,u]=C.useState(null),{trigger:d,onClose:h}=r,f=s.current,{onPointerInTransitChange:m}=o,x=C.useCallback(()=>{u(null),m(!1)},[m]),v=C.useCallback((b,k)=>{const S=b.currentTarget,_={x:b.clientX,y:b.clientY},T=VE(_,S.getBoundingClientRect()),A=HE(_,T),M=UE(k.getBoundingClientRect()),D=qE([...A,...M]);u(D),m(!0)},[m]);return C.useEffect(()=>()=>x(),[x]),C.useEffect(()=>{if(d&&f){const b=en(S=>v(S,f),"handleTriggerLeave"),k=en(S=>v(S,d),"handleContentLeave");return d.addEventListener("pointerleave",b),f.addEventListener("pointerleave",k),()=>{d.removeEventListener("pointerleave",b),f.removeEventListener("pointerleave",k)}}},[d,f,v,x]),C.useEffect(()=>{if(a){const b=en(k=>{const S=k.target,_={x:k.clientX,y:k.clientY},T=(d==null?void 0:d.contains(S))||(f==null?void 0:f.contains(S)),A=!WE(_,a);T?x():A&&(x(),h())},"handleTrackPointerGrace");return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[d,f,a,h,x]),g.jsx(BE,{...e,ref:i})},"TooltipContentHoverable")),HI=r3("TooltipContent"),BE=C.forwardRef(en(function(e,n){const{__scopeTooltip:r,children:o,"aria-label":s,id:i,onEscapeKeyDown:a,onPointerDownOutside:u,...d}=e,h=Ac(Ku,r),f=Cp(r),{onClose:m}=h;C.useEffect(()=>(document.addEventListener(N1,m),()=>document.removeEventListener(N1,m)),[m]),C.useEffect(()=>{if(h.trigger){const v=en(b=>{b.target instanceof Node&&b.target.contains(h.trigger)&&m()},"handleScroll");return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[h.trigger,m]);const{setContentId:x}=h;return It(()=>(x(i),()=>{x(void 0)}),[i,x]),g.jsx(lp,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:u,onFocusOutside:v=>v.preventDefault(),onDismiss:m,children:g.jsxs(Gy,{"data-state":h.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:h.contentId,...f,...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:[g.jsx(HI,{children:o}),s?g.jsx(x5,{id:h.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl")),UI=C.forwardRef(en(function(e,n){const{__scopeTooltip:r,...o}=e,s=Cp(r);return g.jsx(k8,{...s,...o,ref:n})},"TooltipArrow"));function VE(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")}}en(VE,"getExitSideFromRect");function HE(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}en(HE,"getPaddedExitPoints");function UE(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}]}en(UE,"getPointsFromRect");function WE(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 a=e[s],u=e[i],d=a.x,h=a.y,f=u.x,m=u.y;h>r!=m>r&&n<(f-d)*(r-h)/(m-h)+d&&(o=!o)}return o}en(WE,"isPointInPolygon");function qE(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),KE(e)}en(qE,"getHull");function KE(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)}en(KE,"getHullPresorted");var WI=II,qI=jI,KI=LI,GI=$I,JI=BI,ZI=UI;const YI=(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},XI=(t,e)=>({classGroupId:t,validator:e}),GE=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),th="-",Q2=[],QI="arbitrary..",eP=t=>{const e=nP(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return tP(i);const a=i.split(th),u=a[0]===""&&a.length>1?1:0;return JE(a,u,e)},getConflictingClassGroupIds:(i,a)=>{if(a){const u=r[i],d=n[i];return u?d?YI(d,u):u:d||Q2}return n[i]||Q2}}},JE=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const o=t[e],s=n.nextPart.get(o);if(s){const d=JE(t,e+1,s);if(d)return d}const i=n.validators;if(i===null)return;const a=e===0?t.join(th):t.slice(e).join(th),u=i.length;for(let d=0;d<u;d++){const h=i[d];if(h.validator(a))return h.classGroupId}},tP=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?QI+r:void 0})(),nP=t=>{const{theme:e,classGroups:n}=t;return rP(n,e)},rP=(t,e)=>{const n=GE();for(const r in t){const o=t[r];ax(o,n,r,e)}return n},ax=(t,e,n,r)=>{const o=t.length;for(let s=0;s<o;s++){const i=t[s];oP(i,e,n,r)}},oP=(t,e,n,r)=>{if(typeof t=="string"){sP(t,e,n);return}if(typeof t=="function"){iP(t,e,n,r);return}aP(t,e,n,r)},sP=(t,e,n)=>{const r=t===""?e:ZE(e,t);r.classGroupId=n},iP=(t,e,n,r)=>{if(lP(t)){ax(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(XI(n,t))},aP=(t,e,n,r)=>{const o=Object.entries(t),s=o.length;for(let i=0;i<s;i++){const[a,u]=o[i];ax(u,ZE(e,a),n,r)}},ZE=(t,e)=>{let n=t;const r=e.split(th),o=r.length;for(let s=0;s<o;s++){const i=r[s];let a=n.nextPart.get(i);a||(a=GE(),n.nextPart.set(i,a)),n=a}return n},lP=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,uP=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)}}},M1="!",ew=":",cP=[],tw=(t,e,n,r,o)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),dP=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=o=>{const s=[];let i=0,a=0,u=0,d;const h=o.length;for(let b=0;b<h;b++){const k=o[b];if(i===0&&a===0){if(k===ew){s.push(o.slice(u,b)),u=b+1;continue}if(k==="/"){d=b;continue}}k==="["?i++:k==="]"?i--:k==="("?a++:k===")"&&a--}const f=s.length===0?o:o.slice(u);let m=f,x=!1;f.endsWith(M1)?(m=f.slice(0,-1),x=!0):f.startsWith(M1)&&(m=f.slice(1),x=!0);const v=d&&d>u?d-u:void 0;return tw(s,x,m,v)};if(e){const o=e+ew,s=r;r=i=>i.startsWith(o)?s(i.slice(o.length)):tw(cP,!1,i,void 0,!0)}if(n){const o=r;r=s=>n({className:s,parseClassName:o})}return r},fP=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],a=i[0]==="[",u=e.has(i);a||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}},hP=t=>({cache:uP(t.cacheSize),parseClassName:dP(t),sortModifiers:fP(t),postfixLookupClassGroupIds:pP(t),...eP(t)}),pP=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},mP=/\s+/,gP=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:s,postfixLookupClassGroupIds:i}=e,a=[],u=t.trim().split(mP);let d="";for(let h=u.length-1;h>=0;h-=1){const f=u[h],{isExternal:m,modifiers:x,hasImportantModifier:v,baseClassName:b,maybePostfixModifierPosition:k}=n(f);if(m){d=f+(d.length>0?" "+d:d);continue}let S=!!k,_;if(S){const P=b.substring(0,k);_=r(P);const j=_&&i[_]?r(b):void 0;j&&j!==_&&(_=j,S=!1)}else _=r(b);if(!_){if(!S){d=f+(d.length>0?" "+d:d);continue}if(_=r(b),!_){d=f+(d.length>0?" "+d:d);continue}S=!1}const T=x.length===0?"":x.length===1?x[0]:s(x).join(":"),A=v?T+M1:T,M=A+_;if(a.indexOf(M)>-1)continue;a.push(M);const D=o(_,S);for(let P=0;P<D.length;++P){const j=D[P];a.push(A+j)}d=f+(d.length>0?" "+d:d)}return d},yP=(...t)=>{let e=0,n,r,o="";for(;e<t.length;)(n=t[e++])&&(r=YE(n))&&(o&&(o+=" "),o+=r);return o},YE=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=YE(t[r]))&&(n&&(n+=" "),n+=e);return n},xP=(t,...e)=>{let n,r,o,s;const i=u=>{const d=e.reduce((h,f)=>f(h),t());return n=hP(d),r=n.cache.get,o=n.cache.set,s=a,a(u)},a=u=>{const d=r(u);if(d)return d;const h=gP(u,n);return o(u,h),h};return s=i,(...u)=>s(yP(...u))},vP=[],Xt=t=>{const e=n=>n[t]||vP;return e.isThemeGetter=!0,e},XE=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,QE=/^\((?:(\w[\w-]*):)?(.+)\)$/i,bP=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,kP=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wP=/\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$/,CP=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,SP=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,EP=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,js=t=>bP.test(t),qe=t=>!!t&&!Number.isNaN(Number(t)),lo=t=>!!t&&Number.isInteger(Number(t)),ig=t=>t.endsWith("%")&&qe(t.slice(0,-1)),Bo=t=>kP.test(t),e_=()=>!0,_P=t=>wP.test(t)&&!CP.test(t),lx=()=>!1,TP=t=>SP.test(t),NP=t=>EP.test(t),AP=t=>!ve(t)&&!ke(t),MP=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)),DP=t=>gi(t,r_,lx),ve=t=>XE.test(t),Li=t=>gi(t,o_,_P),nw=t=>gi(t,FP,qe),RP=t=>gi(t,i_,e_),OP=t=>gi(t,s_,lx),rw=t=>gi(t,t_,lx),IP=t=>gi(t,n_,NP),ff=t=>gi(t,a_,TP),ke=t=>QE.test(t),fu=t=>da(t,o_),PP=t=>da(t,s_),ow=t=>da(t,t_),jP=t=>da(t,r_),LP=t=>da(t,n_),hf=t=>da(t,a_,!0),zP=t=>da(t,i_,!0),gi=(t,e,n)=>{const r=XE.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},da=(t,e,n=!1)=>{const r=QE.exec(t);return r?r[1]?e(r[1]):n:!1},t_=t=>t==="position"||t==="percentage",n_=t=>t==="image"||t==="url",r_=t=>t==="length"||t==="size"||t==="bg-size",o_=t=>t==="length",FP=t=>t==="number",s_=t=>t==="family-name",i_=t=>t==="number"||t==="weight",a_=t=>t==="shadow",$P=()=>{const t=Xt("color"),e=Xt("font"),n=Xt("text"),r=Xt("font-weight"),o=Xt("tracking"),s=Xt("leading"),i=Xt("breakpoint"),a=Xt("container"),u=Xt("spacing"),d=Xt("radius"),h=Xt("shadow"),f=Xt("inset-shadow"),m=Xt("text-shadow"),x=Xt("drop-shadow"),v=Xt("blur"),b=Xt("perspective"),k=Xt("aspect"),S=Xt("ease"),_=Xt("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"],M=()=>[...A(),ke,ve],D=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto","contain","none"],j=()=>[ke,ve,u],I=()=>[js,"full","auto",...j()],W=()=>[lo,"none","subgrid",ke,ve],Z=()=>["auto",{span:["full",lo,ke,ve]},lo,ke,ve],J=()=>[lo,"auto",ke,ve],K=()=>["auto","min","max","fr",ke,ve],Y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ee=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...j()],X=()=>[js,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],q=()=>[js,"screen","full","dvw","lvw","svw","min","max","fit",...j()],te=()=>[js,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],F=()=>[t,ke,ve],L=()=>[...A(),ow,rw,{position:[ke,ve]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],re=()=>["auto","cover","contain",jP,DP,{size:[ke,ve]}],he=()=>[ig,fu,Li],ce=()=>["","none","full",d,ke,ve],pe=()=>["",qe,fu,Li],De=()=>["solid","dashed","dotted","double"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],de=()=>[qe,ig,ow,rw],me=()=>["","none",v,ke,ve],Fe=()=>["none",qe,ke,ve],Re=()=>["none",qe,ke,ve],Be=()=>[qe,ke,ve],Ye=()=>[js,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Bo],breakpoint:[Bo],color:[e_],container:[Bo],"drop-shadow":[Bo],ease:["in","out","in-out"],font:[AP],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Bo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Bo],shadow:[Bo],spacing:["px",qe],text:[Bo],"text-shadow":[Bo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",js,ve,ke,k]}],container:["container"],"container-type":[{"@container":["","normal","size",ke,ve]}],"container-named":[MP],columns:[{columns:[qe,ve,ke,a]}],"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:M()}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{"inset-s":I(),start:I()}],end:[{"inset-e":I(),end:I()}],"inset-bs":[{"inset-bs":I()}],"inset-be":[{"inset-be":I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[lo,"auto",ke,ve]}],basis:[{basis:[js,"full","auto",a,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qe,js,"auto","initial","none",ve]}],grow:[{grow:["",qe,ke,ve]}],shrink:[{shrink:["",qe,ke,ve]}],order:[{order:[lo,"first","last","none",ke,ve]}],"grid-cols":[{"grid-cols":W()}],"col-start-end":[{col:Z()}],"col-start":[{"col-start":J()}],"col-end":[{"col-end":J()}],"grid-rows":[{"grid-rows":W()}],"row-start-end":[{row:Z()}],"row-start":[{"row-start":J()}],"row-end":[{"row-end":J()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":K()}],"auto-rows":[{"auto-rows":K()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...Y(),"normal"]}],"justify-items":[{"justify-items":[...ee(),"normal"]}],"justify-self":[{"justify-self":["auto",...ee()]}],"align-content":[{content:["normal",...Y()]}],"align-items":[{items:[...ee(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ee(),{baseline:["","last"]}]}],"place-content":[{"place-content":Y()}],"place-items":[{"place-items":[...ee(),"baseline"]}],"place-self":[{"place-self":["auto",...ee()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],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":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...q()]}],"min-inline-size":[{"min-inline":["auto",...q()]}],"max-inline-size":[{"max-inline":["none",...q()]}],"block-size":[{block:["auto",...te()]}],"min-block-size":[{"min-block":["auto",...te()]}],"max-block-size":[{"max-block":["none",...te()]}],w:[{w:[a,"screen",...X()]}],"min-w":[{"min-w":[a,"screen","none",...X()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",n,fu,Li]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,zP,RP]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ig,ve]}],"font-family":[{font:[PP,OP,e]}],"font-features":[{"font-features":[ve]}],"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,ke,ve]}],"line-clamp":[{"line-clamp":[qe,"none",ke,nw]}],leading:[{leading:[s,...j()]}],"list-image":[{"list-image":["none",ke,ve]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ke,ve]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...De(),"wavy"]}],"text-decoration-thickness":[{decoration:[qe,"from-font","auto",ke,Li]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[qe,"auto",ke,ve]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"tab-size":[{tab:[lo,ke,ve]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ke,ve]}],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",ke,ve]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:V()}],"bg-size":[{bg:re()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},lo,ke,ve],radial:["",ke,ve],conic:[lo,ke,ve]},LP,IP]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:he()}],"gradient-via-pos":[{via:he()}],"gradient-to-pos":[{to:he()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:ce()}],"rounded-s":[{"rounded-s":ce()}],"rounded-e":[{"rounded-e":ce()}],"rounded-t":[{"rounded-t":ce()}],"rounded-r":[{"rounded-r":ce()}],"rounded-b":[{"rounded-b":ce()}],"rounded-l":[{"rounded-l":ce()}],"rounded-ss":[{"rounded-ss":ce()}],"rounded-se":[{"rounded-se":ce()}],"rounded-ee":[{"rounded-ee":ce()}],"rounded-es":[{"rounded-es":ce()}],"rounded-tl":[{"rounded-tl":ce()}],"rounded-tr":[{"rounded-tr":ce()}],"rounded-br":[{"rounded-br":ce()}],"rounded-bl":[{"rounded-bl":ce()}],"border-w":[{border:pe()}],"border-w-x":[{"border-x":pe()}],"border-w-y":[{"border-y":pe()}],"border-w-s":[{"border-s":pe()}],"border-w-e":[{"border-e":pe()}],"border-w-bs":[{"border-bs":pe()}],"border-w-be":[{"border-be":pe()}],"border-w-t":[{"border-t":pe()}],"border-w-r":[{"border-r":pe()}],"border-w-b":[{"border-b":pe()}],"border-w-l":[{"border-l":pe()}],"divide-x":[{"divide-x":pe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":pe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...De(),"hidden","none"]}],"divide-style":[{divide:[...De(),"hidden","none"]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-bs":[{"border-bs":F()}],"border-color-be":[{"border-be":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...De(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qe,ke,ve]}],"outline-w":[{outline:["",qe,fu,Li]}],"outline-color":[{outline:F()}],shadow:[{shadow:["","none",h,hf,ff]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":["none",f,hf,ff]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:pe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[qe,Li]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":pe()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":["none",m,hf,ff]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[qe,ke,ve]}],"mix-blend":[{"mix-blend":[...Q(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Q()}],"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":[qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":de()}],"mask-image-linear-to-pos":[{"mask-linear-to":de()}],"mask-image-linear-from-color":[{"mask-linear-from":F()}],"mask-image-linear-to-color":[{"mask-linear-to":F()}],"mask-image-t-from-pos":[{"mask-t-from":de()}],"mask-image-t-to-pos":[{"mask-t-to":de()}],"mask-image-t-from-color":[{"mask-t-from":F()}],"mask-image-t-to-color":[{"mask-t-to":F()}],"mask-image-r-from-pos":[{"mask-r-from":de()}],"mask-image-r-to-pos":[{"mask-r-to":de()}],"mask-image-r-from-color":[{"mask-r-from":F()}],"mask-image-r-to-color":[{"mask-r-to":F()}],"mask-image-b-from-pos":[{"mask-b-from":de()}],"mask-image-b-to-pos":[{"mask-b-to":de()}],"mask-image-b-from-color":[{"mask-b-from":F()}],"mask-image-b-to-color":[{"mask-b-to":F()}],"mask-image-l-from-pos":[{"mask-l-from":de()}],"mask-image-l-to-pos":[{"mask-l-to":de()}],"mask-image-l-from-color":[{"mask-l-from":F()}],"mask-image-l-to-color":[{"mask-l-to":F()}],"mask-image-x-from-pos":[{"mask-x-from":de()}],"mask-image-x-to-pos":[{"mask-x-to":de()}],"mask-image-x-from-color":[{"mask-x-from":F()}],"mask-image-x-to-color":[{"mask-x-to":F()}],"mask-image-y-from-pos":[{"mask-y-from":de()}],"mask-image-y-to-pos":[{"mask-y-to":de()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[ke,ve]}],"mask-image-radial-from-pos":[{"mask-radial-from":de()}],"mask-image-radial-to-pos":[{"mask-radial-to":de()}],"mask-image-radial-from-color":[{"mask-radial-from":F()}],"mask-image-radial-to-color":[{"mask-radial-to":F()}],"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":[qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":de()}],"mask-image-conic-to-pos":[{"mask-conic-to":de()}],"mask-image-conic-from-color":[{"mask-conic-from":F()}],"mask-image-conic-to-color":[{"mask-conic-to":F()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:V()}],"mask-size":[{mask:re()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ke,ve]}],filter:[{filter:["","none",ke,ve]}],blur:[{blur:me()}],brightness:[{brightness:[qe,ke,ve]}],contrast:[{contrast:[qe,ke,ve]}],"drop-shadow":[{"drop-shadow":["","none",x,hf,ff]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:["",qe,ke,ve]}],"hue-rotate":[{"hue-rotate":[qe,ke,ve]}],invert:[{invert:["",qe,ke,ve]}],saturate:[{saturate:[qe,ke,ve]}],sepia:[{sepia:["",qe,ke,ve]}],"backdrop-filter":[{"backdrop-filter":["","none",ke,ve]}],"backdrop-blur":[{"backdrop-blur":me()}],"backdrop-brightness":[{"backdrop-brightness":[qe,ke,ve]}],"backdrop-contrast":[{"backdrop-contrast":[qe,ke,ve]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qe,ke,ve]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qe,ke,ve]}],"backdrop-invert":[{"backdrop-invert":["",qe,ke,ve]}],"backdrop-opacity":[{"backdrop-opacity":[qe,ke,ve]}],"backdrop-saturate":[{"backdrop-saturate":[qe,ke,ve]}],"backdrop-sepia":[{"backdrop-sepia":["",qe,ke,ve]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ke,ve]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qe,"initial",ke,ve]}],ease:[{ease:["linear","initial",S,ke,ve]}],delay:[{delay:[qe,ke,ve]}],animate:[{animate:["none",_,ke,ve]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,ke,ve]}],"perspective-origin":[{"perspective-origin":M()}],rotate:[{rotate:Fe()}],"rotate-x":[{"rotate-x":Fe()}],"rotate-y":[{"rotate-y":Fe()}],"rotate-z":[{"rotate-z":Fe()}],scale:[{scale:Re()}],"scale-x":[{"scale-x":Re()}],"scale-y":[{"scale-y":Re()}],"scale-z":[{"scale-z":Re()}],"scale-3d":["scale-3d"],skew:[{skew:Be()}],"skew-x":[{"skew-x":Be()}],"skew-y":[{"skew-y":Be()}],transform:[{transform:[ke,ve,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ye()}],"translate-x":[{"translate-x":Ye()}],"translate-y":[{"translate-y":Ye()}],"translate-z":[{"translate-z":Ye()}],"translate-none":["translate-none"],zoom:[{zoom:[lo,ke,ve]}],accent:[{accent:F()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:F()}],"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",ke,ve]}],"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":F()}],"scrollbar-track-color":[{"scrollbar-track":F()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",ke,ve]}],fill:[{fill:["none",...F()]}],"stroke-w":[{stroke:[qe,fu,Li,nw]}],stroke:[{stroke:["none",...F()]}],"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"]}},BP=xP($P);function _e(...t){return BP(YS(t))}const VP=XS("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 Sl({className:t,variant:e="default",asChild:n=!1,...r}){const o=n?t3:"span";return g.jsx(o,{"data-slot":"badge","data-variant":e,className:_e(VP({variant:e}),t),...r})}const ux=XS("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"}}),Oe=C.forwardRef(({className:t,variant:e="default",size:n="default",asChild:r=!1,...o},s)=>{const i=r?t3:"button";return g.jsx(i,{ref:s,"data-slot":"button","data-variant":e,"data-size":n,className:_e(ux({variant:e,size:n,className:t})),...o})});Oe.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 l_=(...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 HP=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 UP=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 sw=t=>{const e=UP(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 ag={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 WP=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},qP=C.createContext({}),KP=()=>C.useContext(qP),GP=C.forwardRef(({color:t,size:e,strokeWidth:n,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},u)=>{const{size:d=24,strokeWidth:h=2,absoluteStrokeWidth:f=!1,color:m="currentColor",className:x=""}=KP()??{},v=r??f?Number(n??h)*24/Number(e??d):n??h;return C.createElement("svg",{ref:u,...ag,width:e??d??ag.width,height:e??d??ag.height,stroke:t??m,strokeWidth:v,className:l_("lucide",x,o),...!s&&!WP(a)&&{"aria-hidden":"true"},...a},[...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 we=(t,e)=>{const n=C.forwardRef(({className:r,...o},s)=>C.createElement(GP,{ref:s,iconNode:e,className:l_(`lucide-${HP(sw(t))}`,`lucide-${t}`,r),...o}));return n.displayName=sw(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 JP=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],ZP=we("arrow-right",JP);/**
|
|
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 YP=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]],XP=we("at-sign",YP);/**
|
|
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 QP=[["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"}]],ej=we("bold",QP);/**
|
|
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 tj=[["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"}]],nj=we("book-open",tj);/**
|
|
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 rj=[["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"}]],Mc=we("boxes",rj);/**
|
|
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 oj=[["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"}]],El=we("braces",oj);/**
|
|
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 sj=[["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"}]],ij=we("calendar-days",sj);/**
|
|
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 aj=[["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"}]],lj=we("calendar",aj);/**
|
|
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 uj=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Sp=we("check",uj);/**
|
|
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 cj=[["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"}]],dj=we("chef-hat",cj);/**
|
|
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 fj=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],cx=we("chevron-down",fj);/**
|
|
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 hj=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],pj=we("chevron-left",hj);/**
|
|
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 mj=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ep=we("chevron-right",mj);/**
|
|
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 gj=[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]],yj=we("chevrons-down-up",gj);/**
|
|
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 xj=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],vj=we("chevron-up",xj);/**
|
|
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 bj=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],u_=we("chevrons-up-down",bj);/**
|
|
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 kj=[["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"}]],dx=we("circle-alert",kj);/**
|
|
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 wj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Cj=we("circle-check",wj);/**
|
|
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 Sj=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],Ej=we("code",Sj);/**
|
|
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 _j=[["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"}]],c_=we("copy",_j);/**
|
|
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 Tj=[["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"}]],Nj=we("download",Tj);/**
|
|
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 Aj=[["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"}]],Mj=we("file-braces-corner",Aj);/**
|
|
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 Dj=[["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"}]],Rj=we("file-cog",Dj);/**
|
|
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 Oj=[["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"}]],Ij=we("file-stack",Oj);/**
|
|
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 Pj=[["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"}]],jj=we("file-text",Pj);/**
|
|
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 Lj=[["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"}]],d_=we("folder-git-2",Lj);/**
|
|
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 zj=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],Fj=we("git-branch",zj);/**
|
|
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 $j=[["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"}]],fx=we("grip-vertical",$j);/**
|
|
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 Bj=[["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"}]],Vj=we("hash",Bj);/**
|
|
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 Hj=[["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"}]],Uj=we("heading-2",Hj);/**
|
|
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 Wj=[["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"}]],qj=we("heading-3",Wj);/**
|
|
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 Kj=[["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"}]],f_=we("image",Kj);/**
|
|
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 Gj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Jj=we("info",Gj);/**
|
|
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 Zj=[["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"}]],Yj=we("italic",Zj);/**
|
|
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 Xj=[["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"}]],Qj=we("key-round",Xj);/**
|
|
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 e9=[["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"}]],t9=we("layout-grid",e9);/**
|
|
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 n9=[["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"}]],h_=we("link-2",n9);/**
|
|
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 r9=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],o9=we("link",r9);/**
|
|
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 s9=[["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"}]],i9=we("list-ordered",s9);/**
|
|
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 a9=[["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"}]],p_=we("list",a9);/**
|
|
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 l9=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Wr=we("loader-circle",l9);/**
|
|
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 u9=[["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"}]],c9=we("newspaper",u9);/**
|
|
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 d9=[["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"}]],f9=we("octagon-x",d9);/**
|
|
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 h9=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],p9=we("palette",h9);/**
|
|
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 m9=[["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"}]],m_=we("pencil-ruler",m9);/**
|
|
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 g9=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ai=we("plus",g9);/**
|
|
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 y9=[["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"}]],x9=we("quote",y9);/**
|
|
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 v9=[["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"}]],b9=we("redo-2",v9);/**
|
|
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 k9=[["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"}]],w9=we("refresh-cw",k9);/**
|
|
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 C9=[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]],S9=we("rocket",C9);/**
|
|
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 E9=[["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"}]],_9=we("rotate-ccw-clock",E9);/**
|
|
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 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=we("rotate-ccw",T9);/**
|
|
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 A9=[["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"}]],M9=we("search-x",A9);/**
|
|
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 D9=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],R9=we("search",D9);/**
|
|
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 O9=[["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"}]],I9=we("shopping-bag",O9);/**
|
|
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 P9=[["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"}]],ol=we("sparkles",P9);/**
|
|
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 j9=[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]],L9=we("tags",j9);/**
|
|
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 z9=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],F9=we("terminal",z9);/**
|
|
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 $9=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],B9=we("toggle-left",$9);/**
|
|
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 V9=[["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"}]],g_=we("trash-2",V9);/**
|
|
416
|
+
* @license lucide-react v1.27.0 - ISC
|
|
417
|
+
*
|
|
418
|
+
* This source code is licensed under the ISC license.
|
|
419
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
420
|
+
*/const H9=[["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"}]],_p=we("triangle-alert",H9);/**
|
|
421
|
+
* @license lucide-react v1.27.0 - ISC
|
|
422
|
+
*
|
|
423
|
+
* This source code is licensed under the ISC license.
|
|
424
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
425
|
+
*/const U9=[["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"}]],W9=we("type",U9);/**
|
|
426
|
+
* @license lucide-react v1.27.0 - ISC
|
|
427
|
+
*
|
|
428
|
+
* This source code is licensed under the ISC license.
|
|
429
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
430
|
+
*/const q9=[["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"}]],K9=we("undo-2",q9);/**
|
|
431
|
+
* @license lucide-react v1.27.0 - ISC
|
|
432
|
+
*
|
|
433
|
+
* This source code is licensed under the ISC license.
|
|
434
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
435
|
+
*/const G9=[["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"}]],Gu=we("upload",G9);/**
|
|
436
|
+
* @license lucide-react v1.27.0 - ISC
|
|
437
|
+
*
|
|
438
|
+
* This source code is licensed under the ISC license.
|
|
439
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
440
|
+
*/const J9=[["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"}]],Z9=we("user",J9);/**
|
|
441
|
+
* @license lucide-react v1.27.0 - ISC
|
|
442
|
+
*
|
|
443
|
+
* This source code is licensed under the ISC license.
|
|
444
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
445
|
+
*/const Y9=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],fa=we("x",Y9);function Dc({...t}){return g.jsx(jD,{"data-slot":"dialog",...t})}function X9({...t}){return g.jsx(zD,{"data-slot":"dialog-trigger",...t})}function Q9({...t}){return g.jsx($D,{"data-slot":"dialog-portal",...t})}function Tp({...t}){return g.jsx(Fy,{"data-slot":"dialog-close",...t})}function eL({className:t,...e}){return g.jsx(BD,{"data-slot":"dialog-overlay",className:_e("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 Rc({className:t,children:e,showCloseButton:n=!0,...r}){return g.jsxs(Q9,{children:[g.jsx(eL,{}),g.jsxs(UD,{"data-slot":"dialog-content",className:_e("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&&g.jsx(Fy,{"data-slot":"dialog-close",asChild:!0,children:g.jsxs(Oe,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm",children:[g.jsx(fa,{}),g.jsx("span",{className:"sr-only",children:"Close"})]})})]})]})}function Oc({className:t,...e}){return g.jsx("div",{"data-slot":"dialog-header",className:_e("flex flex-col gap-2",t),...e})}function Np({className:t,showCloseButton:e=!1,children:n,...r}){return g.jsxs("div",{"data-slot":"dialog-footer",className:_e("-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&&g.jsx(Fy,{asChild:!0,children:g.jsx(Oe,{variant:"outline",children:"Close"})})]})}function Ic({className:t,...e}){return g.jsx(GD,{"data-slot":"dialog-title",className:_e("font-heading text-base leading-none font-medium",t),...e})}function Pc({className:t,...e}){return g.jsx(ZD,{"data-slot":"dialog-description",className:_e("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",t),...e})}function y_({...t}){return g.jsx(OO,{"data-slot":"dropdown-menu",...t})}function x_({...t}){return g.jsx(IO,{"data-slot":"dropdown-menu-trigger",...t})}function v_({className:t,align:e="start",sideOffset:n=4,...r}){return g.jsx(PO,{children:g.jsx(jO,{"data-slot":"dropdown-menu-content",sideOffset:n,align:e,className:_e("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 lg({className:t,inset:e,variant:n="default",...r}){return g.jsx(zO,{"data-slot":"dropdown-menu-item","data-inset":e,"data-variant":n,className:_e("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 b_({className:t,children:e,checked:n,inset:r,...o}){return g.jsxs(FO,{"data-slot":"dropdown-menu-checkbox-item","data-inset":r,className:_e("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:[g.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center","data-slot":"dropdown-menu-checkbox-item-indicator",children:g.jsx($O,{children:g.jsx(Sp,{})})}),e]})}function D1({className:t,inset:e,...n}){return g.jsx(LO,{"data-slot":"dropdown-menu-label","data-inset":e,className:_e("px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7",t),...n})}function xu({className:t,...e}){return g.jsx(BO,{"data-slot":"dropdown-menu-separator",className:_e("-mx-1 my-1 h-px bg-border",t),...e})}function Lt({className:t,type:e,...n}){return g.jsx("input",{type:e,"data-slot":"input",className:_e("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 Za({className:t,...e}){return g.jsx(WO,{"data-slot":"label",className:_e("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 Ju({...t}){return g.jsx(rI,{"data-slot":"select",...t})}function Zu({...t}){return g.jsx(aI,{"data-slot":"select-value",...t})}function Yu({className:t,size:e="default",children:n,...r}){return g.jsxs(sI,{"data-slot":"select-trigger","data-size":e,className:_e("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,g.jsx(lI,{asChild:!0,children:g.jsx(cx,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function Xu({className:t,children:e,position:n="item-aligned",align:r="center",...o}){return g.jsx(fI,{children:g.jsxs(hI,{"data-slot":"select-content","data-align-trigger":n==="item-aligned",className:_e("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:[g.jsx(tL,{}),g.jsx(vI,{"data-position":n,className:_e("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}),g.jsx(nL,{})]})})}function Qu({className:t,children:e,...n}){return g.jsxs(wI,{"data-slot":"select-item",className:_e("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:[g.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center",children:g.jsx(EI,{children:g.jsx(Sp,{className:"pointer-events-none"})})}),g.jsx(CI,{children:e})]})}function tL({className:t,...e}){return g.jsx(_I,{"data-slot":"select-scroll-up-button",className:_e("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",t),...e,children:g.jsx(vj,{})})}function nL({className:t,...e}){return g.jsx(TI,{"data-slot":"select-scroll-down-button",className:_e("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",t),...e,children:g.jsx(cx,{})})}var rL=(t,e,n,r,o,s,i,a)=>{let u=document.documentElement,d=["light","dark"];function h(x){(Array.isArray(t)?t:[t]).forEach(v=>{let b=v==="class",k=b&&s?o.map(S=>s[S]||S):o;b?(u.classList.remove(...k),u.classList.add(s&&s[x]?s[x]:x)):u.setAttribute(v,x)}),f(x)}function f(x){a&&d.includes(x)&&(u.style.colorScheme=x)}function m(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)h(r);else try{let x=localStorage.getItem(e)||n,v=i&&x==="system"?m():x;h(v)}catch{}},oL=C.createContext(void 0),sL={setTheme:t=>{},themes:[]},iL=()=>{var t;return(t=C.useContext(oL))!=null?t:sL};C.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:r,enableColorScheme:o,defaultTheme:s,value:i,themes:a,nonce:u,scriptProps:d})=>{let h=JSON.stringify([n,e,s,t,a,i,r,o]).slice(1,-1);return C.createElement("script",{...d,suppressHydrationWarning:!0,nonce:typeof window>"u"?u:"",dangerouslySetInnerHTML:{__html:`(${rL.toString()})(${h})`}})});function aL(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 lL=t=>{switch(t){case"success":return dL;case"info":return hL;case"warning":return fL;case"error":return pL;default:return null}},uL=Array(12).fill(0),cL=({visible:t,className:e})=>ne.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},ne.createElement("div",{className:"sonner-spinner"},uL.map((n,r)=>ne.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),dL=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.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"})),fL=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ne.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"})),hL=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.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"})),pL=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.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"})),mL=ne.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"},ne.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ne.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),gL=()=>{const[t,e]=ne.useState(document.hidden);return ne.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t};let R1=1;class yL{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:R1++,i=this.toasts.find(u=>u.id===s),a=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:a,title:r}):u):this.addToast({title:r,...o,dismissible:a,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 a=o.then(async d=>{if(i=["resolve",d],ne.isValidElement(d))s=!1,this.create({id:r,type:"default",message:d});else if(vL(d)&&!d.ok){s=!1;const f=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 f=="object"&&!ne.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:m,...v})}else if(d instanceof Error){s=!1;const f=typeof n.error=="function"?await n.error(d):n.error,m=typeof n.description=="function"?await n.description(d):n.description,v=typeof f=="object"&&!ne.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:m,...v})}else if(n.success!==void 0){s=!1;const f=typeof n.success=="function"?await n.success(d):n.success,m=typeof n.description=="function"?await n.description(d):n.description,v=typeof f=="object"&&!ne.isValidElement(f)?f:{message:f};this.create({id:r,type:"success",description:m,...v})}}).catch(async d=>{if(i=["reject",d],n.error!==void 0){s=!1;const h=typeof n.error=="function"?await n.error(d):n.error,f=typeof n.description=="function"?await n.description(d):n.description,x=typeof h=="object"&&!ne.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:f,...x})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),u=()=>new Promise((d,h)=>a.then(()=>i[0]==="reject"?h(i[1]):d(i[1])).catch(h));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)||R1++;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 Yn=new yL,xL=(t,e)=>{const n=(e==null?void 0:e.id)||R1++;return Yn.addToast({title:t,...e,id:n}),n},vL=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",bL=xL,kL=()=>Yn.toasts,wL=()=>Yn.getActiveToasts(),Rt=Object.assign(bL,{success:Yn.success,info:Yn.info,warning:Yn.warning,error:Yn.error,custom:Yn.custom,message:Yn.message,promise:Yn.promise,dismiss:Yn.dismiss,loading:Yn.loading},{getHistory:kL,getToasts:wL});aL("[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 pf(t){return t.label!==void 0}const CL=3,SL="24px",EL="16px",iw=4e3,_L=356,TL=14,NL=45,AL=200;function uo(...t){return t.filter(Boolean).join(" ")}function ML(t){const[e,n]=t.split("-"),r=[];return e&&r.push(e),n&&r.push(n),r}const DL=t=>{var e,n,r,o,s,i,a,u,d;const{invert:h,toast:f,unstyled:m,interacting:x,setHeights:v,visibleToasts:b,heights:k,index:S,toasts:_,expanded:T,removeToast:A,defaultRichColors:M,closeButton:D,style:P,cancelButtonStyle:j,actionButtonStyle:I,className:W="",descriptionClassName:Z="",duration:J,position:K,gap:Y,expandByDefault:ee,classNames:G,icons:X,closeButtonAriaLabel:q="Close toast"}=t,[te,F]=ne.useState(null),[L,V]=ne.useState(null),[re,he]=ne.useState(!1),[ce,pe]=ne.useState(!1),[De,Q]=ne.useState(!1),[de,me]=ne.useState(!1),[Fe,Re]=ne.useState(!1),[Be,Ye]=ne.useState(0),[At,zt]=ne.useState(0),qt=ne.useRef(f.duration||J||iw),$n=ne.useRef(null),Kt=ne.useRef(null),nn=S===0,Dn=S+1<=b,pt=f.type,pr=f.dismissible!==!1,bi=f.className||"",ma=f.descriptionClassName||"",Mo=ne.useMemo(()=>k.findIndex(Ae=>Ae.toastId===f.id)||0,[k,f.id]),mr=ne.useMemo(()=>{var Ae;return(Ae=f.closeButton)!=null?Ae:D},[f.closeButton,D]),Bn=ne.useMemo(()=>f.duration||J||iw,[f.duration,J]),gr=ne.useRef(0),Rn=ne.useRef(0),mn=ne.useRef(0),Or=ne.useRef(null),[ga,ya]=K.split("-"),gs=ne.useMemo(()=>k.reduce((Ae,it,tt)=>tt>=Mo?Ae:Ae+it.height,0),[k,Mo]),Do=gL(),ki=f.invert||h,eo=pt==="loading";Rn.current=ne.useMemo(()=>Mo*Y+gs,[Mo,gs]),ne.useEffect(()=>{qt.current=Bn},[Bn]),ne.useEffect(()=>{he(!0)},[]),ne.useEffect(()=>{const Ae=Kt.current;if(Ae){const it=Ae.getBoundingClientRect().height;return zt(it),v(tt=>[{toastId:f.id,height:it,position:f.position},...tt]),()=>v(tt=>tt.filter(at=>at.toastId!==f.id))}},[v,f.id]),ne.useLayoutEffect(()=>{if(!re)return;const Ae=Kt.current,it=Ae.style.height;Ae.style.height="auto";const tt=Ae.getBoundingClientRect().height;Ae.style.height=it,zt(tt),v(at=>at.find(mt=>mt.toastId===f.id)?at.map(mt=>mt.toastId===f.id?{...mt,height:tt}:mt):[{toastId:f.id,height:tt,position:f.position},...at])},[re,f.title,f.description,v,f.id,f.jsx,f.action,f.cancel]);const Vn=ne.useCallback(()=>{pe(!0),Ye(Rn.current),v(Ae=>Ae.filter(it=>it.toastId!==f.id)),setTimeout(()=>{A(f)},AL)},[f,A,v,Rn]);ne.useEffect(()=>{if(f.promise&&pt==="loading"||f.duration===1/0||f.type==="loading")return;let Ae;return T||x||Do?(()=>{if(mn.current<gr.current){const at=new Date().getTime()-gr.current;qt.current=qt.current-at}mn.current=new Date().getTime()})():(()=>{qt.current!==1/0&&(gr.current=new Date().getTime(),Ae=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),Vn()},qt.current))})(),()=>clearTimeout(Ae)},[T,x,f,pt,Do,Vn]),ne.useEffect(()=>{f.delete&&(Vn(),f.onDismiss==null||f.onDismiss.call(f,f))},[Vn,f.delete]);function wi(){var Ae;if(X!=null&&X.loading){var it;return ne.createElement("div",{className:uo(G==null?void 0:G.loader,f==null||(it=f.classNames)==null?void 0:it.loader,"sonner-loader"),"data-visible":pt==="loading"},X.loading)}return ne.createElement(cL,{className:uo(G==null?void 0:G.loader,f==null||(Ae=f.classNames)==null?void 0:Ae.loader),visible:pt==="loading"})}const to=f.icon||(X==null?void 0:X[pt])||lL(pt);var gt,Gt;return ne.createElement("li",{tabIndex:0,ref:Kt,className:uo(W,bi,G==null?void 0:G.toast,f==null||(e=f.classNames)==null?void 0:e.toast,G==null?void 0:G.default,G==null?void 0:G[pt],f==null||(n=f.classNames)==null?void 0:n[pt]),"data-sonner-toast":"","data-rich-colors":(gt=f.richColors)!=null?gt:M,"data-styled":!(f.jsx||f.unstyled||m),"data-mounted":re,"data-promise":!!f.promise,"data-swiped":Fe,"data-removed":ce,"data-visible":Dn,"data-y-position":ga,"data-x-position":ya,"data-index":S,"data-front":nn,"data-swiping":De,"data-dismissible":pr,"data-type":pt,"data-invert":ki,"data-swipe-out":de,"data-swipe-direction":L,"data-expanded":!!(T||ee&&re),"data-testid":f.testId,style:{"--index":S,"--toasts-before":S,"--z-index":_.length-S,"--offset":`${ce?Be:Rn.current}px`,"--initial-height":ee?"auto":`${At}px`,...P,...f.style},onDragEnd:()=>{Q(!1),F(null),Or.current=null},onPointerDown:Ae=>{Ae.button!==2&&(eo||!pr||($n.current=new Date,Ye(Rn.current),Ae.target.setPointerCapture(Ae.pointerId),Ae.target.tagName!=="BUTTON"&&(Q(!0),Or.current={x:Ae.clientX,y:Ae.clientY})))},onPointerUp:()=>{var Ae,it,tt;if(de||!pr)return;Or.current=null;const at=Number(((Ae=Kt.current)==null?void 0:Ae.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Jt=Number(((it=Kt.current)==null?void 0:it.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),mt=new Date().getTime()-((tt=$n.current)==null?void 0:tt.getTime()),Je=te==="x"?at:Jt,gn=Math.abs(Je)/mt;if(Math.abs(Je)>=NL||gn>.11){Ye(Rn.current),f.onDismiss==null||f.onDismiss.call(f,f),V(te==="x"?at>0?"right":"left":Jt>0?"down":"up"),Vn(),me(!0);return}else{var ft,_t;(ft=Kt.current)==null||ft.style.setProperty("--swipe-amount-x","0px"),(_t=Kt.current)==null||_t.style.setProperty("--swipe-amount-y","0px")}Re(!1),Q(!1),F(null)},onPointerMove:Ae=>{var it,tt,at;if(!Or.current||!pr||((it=window.getSelection())==null?void 0:it.toString().length)>0)return;const mt=Ae.clientY-Or.current.y,Je=Ae.clientX-Or.current.x;var gn;const ft=(gn=t.swipeDirections)!=null?gn:ML(K);!te&&(Math.abs(Je)>1||Math.abs(mt)>1)&&F(Math.abs(Je)>Math.abs(mt)?"x":"y");let _t={x:0,y:0};const Hn=rn=>1/(1.5+Math.abs(rn)/20);if(te==="y"){if(ft.includes("top")||ft.includes("bottom"))if(ft.includes("top")&&mt<0||ft.includes("bottom")&&mt>0)_t.y=mt;else{const rn=mt*Hn(mt);_t.y=Math.abs(rn)<Math.abs(mt)?rn:mt}}else if(te==="x"&&(ft.includes("left")||ft.includes("right")))if(ft.includes("left")&&Je<0||ft.includes("right")&&Je>0)_t.x=Je;else{const rn=Je*Hn(Je);_t.x=Math.abs(rn)<Math.abs(Je)?rn:Je}(Math.abs(_t.x)>0||Math.abs(_t.y)>0)&&Re(!0),(tt=Kt.current)==null||tt.style.setProperty("--swipe-amount-x",`${_t.x}px`),(at=Kt.current)==null||at.style.setProperty("--swipe-amount-y",`${_t.y}px`)}},mr&&!f.jsx&&pt!=="loading"?ne.createElement("button",{"aria-label":q,"data-disabled":eo,"data-close-button":!0,onClick:eo||!pr?()=>{}:()=>{Vn(),f.onDismiss==null||f.onDismiss.call(f,f)},className:uo(G==null?void 0:G.closeButton,f==null||(r=f.classNames)==null?void 0:r.closeButton)},(Gt=X==null?void 0:X.close)!=null?Gt:mL):null,(pt||f.icon||f.promise)&&f.icon!==null&&((X==null?void 0:X[pt])!==null||f.icon)?ne.createElement("div",{"data-icon":"",className:uo(G==null?void 0:G.icon,f==null||(o=f.classNames)==null?void 0:o.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||wi():null,f.type!=="loading"?to:null):null,ne.createElement("div",{"data-content":"",className:uo(G==null?void 0:G.content,f==null||(s=f.classNames)==null?void 0:s.content)},ne.createElement("div",{"data-title":"",className:uo(G==null?void 0:G.title,f==null||(i=f.classNames)==null?void 0:i.title)},f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title),f.description?ne.createElement("div",{"data-description":"",className:uo(Z,ma,G==null?void 0:G.description,f==null||(a=f.classNames)==null?void 0:a.description)},typeof f.description=="function"?f.description():f.description):null),ne.isValidElement(f.cancel)?f.cancel:f.cancel&&pf(f.cancel)?ne.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||j,onClick:Ae=>{pf(f.cancel)&&pr&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,Ae),Vn())},className:uo(G==null?void 0:G.cancelButton,f==null||(u=f.classNames)==null?void 0:u.cancelButton)},f.cancel.label):null,ne.isValidElement(f.action)?f.action:f.action&&pf(f.action)?ne.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||I,onClick:Ae=>{pf(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,Ae),!Ae.defaultPrevented&&Vn())},className:uo(G==null?void 0:G.actionButton,f==null||(d=f.classNames)==null?void 0:d.actionButton)},f.action.label):null)};function aw(){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 RL(t,e){const n={};return[t,e].forEach((r,o)=>{const s=o===1,i=s?"--mobile-offset":"--offset",a=s?EL:SL;function u(d){["top","right","bottom","left"].forEach(h=>{n[`${i}-${h}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?u(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${i}-${d}`]=a:n[`${i}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):u(a)}),n}const OL=ne.forwardRef(function(e,n){const{id:r,invert:o,position:s="bottom-right",hotkey:i=["altKey","KeyT"],expand:a,closeButton:u,className:d,offset:h,mobileOffset:f,theme:m="light",richColors:x,duration:v,style:b,visibleToasts:k=CL,toastOptions:S,dir:_=aw(),gap:T=TL,icons:A,containerAriaLabel:M="Notifications"}=e,[D,P]=ne.useState([]),j=ne.useMemo(()=>r?D.filter(re=>re.toasterId===r):D.filter(re=>!re.toasterId),[D,r]),I=ne.useMemo(()=>Array.from(new Set([s].concat(j.filter(re=>re.position).map(re=>re.position)))),[j,s]),[W,Z]=ne.useState([]),[J,K]=ne.useState(!1),[Y,ee]=ne.useState(!1),[G,X]=ne.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),q=ne.useRef(null),te=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=ne.useRef(null),L=ne.useRef(!1),V=ne.useCallback(re=>{P(he=>{var ce;return(ce=he.find(pe=>pe.id===re.id))!=null&&ce.delete||Yn.dismiss(re.id),he.filter(({id:pe})=>pe!==re.id)})},[]);return ne.useEffect(()=>Yn.subscribe(re=>{if(re.dismiss){requestAnimationFrame(()=>{P(he=>he.map(ce=>ce.id===re.id?{...ce,delete:!0}:ce))});return}setTimeout(()=>{QS.flushSync(()=>{P(he=>{const ce=he.findIndex(pe=>pe.id===re.id);return ce!==-1?[...he.slice(0,ce),{...he[ce],...re},...he.slice(ce+1)]:[re,...he]})})})}),[D]),ne.useEffect(()=>{if(m!=="system"){X(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?X("dark"):X("light")),typeof window>"u")return;const re=window.matchMedia("(prefers-color-scheme: dark)");try{re.addEventListener("change",({matches:he})=>{X(he?"dark":"light")})}catch{re.addListener(({matches:ce})=>{try{X(ce?"dark":"light")}catch(pe){console.error(pe)}})}},[m]),ne.useEffect(()=>{D.length<=1&&K(!1)},[D]),ne.useEffect(()=>{const re=he=>{var ce;if(i.every(Q=>he[Q]||he.code===Q)){var De;K(!0),(De=q.current)==null||De.focus()}he.code==="Escape"&&(document.activeElement===q.current||(ce=q.current)!=null&&ce.contains(document.activeElement))&&K(!1)};return document.addEventListener("keydown",re),()=>document.removeEventListener("keydown",re)},[i]),ne.useEffect(()=>{if(q.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,L.current=!1)}},[q.current]),ne.createElement("section",{ref:n,"aria-label":`${M} ${te}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},I.map((re,he)=>{var ce;const[pe,De]=re.split("-");return j.length?ne.createElement("ol",{key:re,dir:_==="auto"?aw():_,tabIndex:-1,ref:q,className:d,"data-sonner-toaster":!0,"data-sonner-theme":G,"data-y-position":pe,"data-x-position":De,style:{"--front-toast-height":`${((ce=W[0])==null?void 0:ce.height)||0}px`,"--width":`${_L}px`,"--gap":`${T}px`,...b,...RL(h,f)},onBlur:Q=>{L.current&&!Q.currentTarget.contains(Q.relatedTarget)&&(L.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:Q=>{Q.target instanceof HTMLElement&&Q.target.dataset.dismissible==="false"||L.current||(L.current=!0,F.current=Q.relatedTarget)},onMouseEnter:()=>K(!0),onMouseMove:()=>K(!0),onMouseLeave:()=>{Y||K(!1)},onDragEnd:()=>K(!1),onPointerDown:Q=>{Q.target instanceof HTMLElement&&Q.target.dataset.dismissible==="false"||ee(!0)},onPointerUp:()=>ee(!1)},j.filter(Q=>!Q.position&&he===0||Q.position===re).map((Q,de)=>{var me,Fe;return ne.createElement(DL,{key:Q.id,icons:A,index:de,toast:Q,defaultRichColors:x,duration:(me=S==null?void 0:S.duration)!=null?me:v,className:S==null?void 0:S.className,descriptionClassName:S==null?void 0:S.descriptionClassName,invert:o,visibleToasts:k,closeButton:(Fe=S==null?void 0:S.closeButton)!=null?Fe:u,interacting:Y,position:re,style:S==null?void 0:S.style,unstyled:S==null?void 0:S.unstyled,classNames:S==null?void 0:S.classNames,cancelButtonStyle:S==null?void 0:S.cancelButtonStyle,actionButtonStyle:S==null?void 0:S.actionButtonStyle,closeButtonAriaLabel:S==null?void 0:S.closeButtonAriaLabel,removeToast:V,toasts:j.filter(Re=>Re.position==Q.position),heights:W.filter(Re=>Re.position==Q.position),setHeights:Z,expandByDefault:a,gap:T,expanded:J,swipeDirections:e.swipeDirections})})):null}))}),IL=({...t})=>{const{theme:e="system"}=iL();return g.jsx(OL,{theme:e,className:"toaster group",icons:{success:g.jsx(Cj,{className:"size-4"}),info:g.jsx(Jj,{className:"size-4"}),warning:g.jsx(_p,{className:"size-4"}),error:g.jsx(f9,{className:"size-4"}),loading:g.jsx(Wr,{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 PL({className:t,...e}){return g.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:g.jsx("table",{"data-slot":"table",className:_e("w-full caption-bottom text-sm",t),...e})})}function jL({className:t,...e}){return g.jsx("thead",{"data-slot":"table-header",className:_e("[&_tr]:border-b",t),...e})}function LL({className:t,...e}){return g.jsx("tbody",{"data-slot":"table-body",className:_e("[&_tr:last-child]:border-0",t),...e})}function ug({className:t,...e}){return g.jsx("tr",{"data-slot":"table-row",className:_e("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",t),...e})}function mf({className:t,...e}){return g.jsx("th",{"data-slot":"table-head",className:_e("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",t),...e})}function Ls({className:t,...e}){return g.jsx("td",{"data-slot":"table-cell",className:_e("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",t),...e})}function zL({delayDuration:t=0,...e}){return g.jsx(WI,{"data-slot":"tooltip-provider",delayDuration:t,...e})}function hx({...t}){return g.jsx(qI,{"data-slot":"tooltip",...t})}function px({...t}){return g.jsx(KI,{"data-slot":"tooltip-trigger",...t})}function mx({className:t,sideOffset:e=0,children:n,...r}){return g.jsx(GI,{children:g.jsxs(JI,{"data-slot":"tooltip-content",sideOffset:e,className:_e("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,g.jsx(ZI,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}var rt;(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(a=>typeof o[o[a]]!="number"),i={};for(const a of s)i[a]=o[a];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})(rt||(rt={}));var lw;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(lw||(lw={}));const Ee=rt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$s=t=>{switch(typeof t){case"undefined":return Ee.undefined;case"string":return Ee.string;case"number":return Number.isNaN(t)?Ee.nan:Ee.number;case"boolean":return Ee.boolean;case"function":return Ee.function;case"bigint":return Ee.bigint;case"symbol":return Ee.symbol;case"object":return Array.isArray(t)?Ee.array:t===null?Ee.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Ee.promise:typeof Map<"u"&&t instanceof Map?Ee.map:typeof Set<"u"&&t instanceof Set?Ee.set:typeof Date<"u"&&t instanceof Date?Ee.date:Ee.object;default:return Ee.unknown}},le=rt.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 us 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 a=r,u=0;for(;u<i.path.length;){const d=i.path[u];u===i.path.length-1?(a[d]=a[d]||{_errors:[]},a[d]._errors.push(n(i))):a[d]=a[d]||{_errors:[]},a=a[d],u++}}};return o(this),r}static assert(e){if(!(e instanceof us))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,rt.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()}}us.create=t=>new us(t);const O1=(t,e)=>{let n;switch(t.code){case le.invalid_type:t.received===Ee.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case le.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,rt.jsonStringifyReplacer)}`;break;case le.unrecognized_keys:n=`Unrecognized key(s) in object: ${rt.joinValues(t.keys,", ")}`;break;case le.invalid_union:n="Invalid input";break;case le.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${rt.joinValues(t.options)}`;break;case le.invalid_enum_value:n=`Invalid enum value. Expected ${rt.joinValues(t.options)}, received '${t.received}'`;break;case le.invalid_arguments:n="Invalid function arguments";break;case le.invalid_return_type:n="Invalid function return type";break;case le.invalid_date:n="Invalid date";break;case le.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}"`:rt.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case le.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 le.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 le.custom:n="Invalid input";break;case le.invalid_intersection_types:n="Intersection results could not be merged";break;case le.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case le.not_finite:n="Number must be finite";break;default:n=e.defaultError,rt.assertNever(t)}return{message:n}};let FL=O1;function $L(){return FL}const BL=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 a="";const u=r.filter(d=>!!d).slice().reverse();for(const d of u)a=d(i,{data:e,defaultError:a}).message;return{...o,path:s,message:a}};function ye(t,e){const n=$L(),r=BL({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===O1?void 0:O1].filter(o=>!!o)});t.common.issues.push(r)}class cr{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 Ve;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 cr.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 Ve;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 Ve=Object.freeze({status:"aborted"}),vu=t=>({status:"dirty",value:t}),Rr=t=>({status:"valid",value:t}),uw=t=>t.status==="aborted",cw=t=>t.status==="dirty",sl=t=>t.status==="valid",nh=t=>typeof Promise<"u"&&t instanceof Promise;var Ne;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Ne||(Ne={}));class li{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 dw=(t,e)=>{if(sl(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 us(t.common.issues);return this._error=n,this._error}}};function Ge(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,a)=>{const{message:u}=t;return i.code==="invalid_enum_value"?{message:u??a.defaultError}:typeof a.data>"u"?{message:u??r??a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:u??n??a.defaultError}},description:o}}class et{get description(){return this._def.description}_getType(e){return $s(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:$s(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new cr,ctx:{common:e.parent.common,data:e.data,parsedType:$s(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(nh(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:$s(e)},o=this._parseSync({data:e,path:r.path,parent:r});return dw(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:$s(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:n});return sl(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=>sl(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:$s(e)},o=this._parse({data:e,path:r.path,parent:r}),s=await(nh(o)?o:Promise.resolve(o));return dw(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),a=()=>s.addIssue({code:le.custom,...r(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(u=>u?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,o)=>e(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(e){return new al({schema:this,typeName:He.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 Qs.create(this,this._def)}nullable(){return ll.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ko.create(this)}promise(){return ih.create(this,this._def)}or(e){return oh.create([this,e],this._def)}and(e){return sh.create(this,e,this._def)}transform(e){return new al({...Ge(this._def),schema:this,typeName:He.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new z1({...Ge(this._def),innerType:this,defaultValue:n,typeName:He.ZodDefault})}brand(){return new c7({typeName:He.ZodBranded,type:this,...Ge(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new F1({...Ge(this._def),innerType:this,catchValue:n,typeName:He.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return gx.create(this,e)}readonly(){return $1.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const VL=/^c[^\s-]{8,}$/i,HL=/^[0-9a-z]+$/,UL=/^[0-9A-HJKMNP-TV-Z]{26}$/i,WL=/^[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,qL=/^[a-z0-9_-]{21}$/i,KL=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,GL=/^[-+]?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)?)??$/,JL=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ZL="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let cg;const YL=/^(?:(?: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])$/,XL=/^(?:(?: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])$/,QL=/^(([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]))$/,e7=/^(([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])$/,t7=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,n7=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,k_="((\\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])))",r7=new RegExp(`^${k_}$`);function w_(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 o7(t){return new RegExp(`^${w_(t)}$`)}function s7(t){let e=`${k_}T${w_(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 i7(t,e){return!!((e==="v4"||!e)&&YL.test(t)||(e==="v6"||!e)&&QL.test(t))}function a7(t,e){if(!KL.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 l7(t,e){return!!((e==="v4"||!e)&&XL.test(t)||(e==="v6"||!e)&&e7.test(t))}class Gs extends et{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Ee.string){const s=this._getOrReturnCtx(e);return ye(s,{code:le.invalid_type,expected:Ee.string,received:s.parsedType}),Ve}const r=new cr;let o;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(o=this._getOrReturnCtx(e,o),ye(o,{code:le.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),ye(o,{code:le.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,a=e.data.length<s.value;(i||a)&&(o=this._getOrReturnCtx(e,o),i?ye(o,{code:le.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&ye(o,{code:le.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")JL.test(e.data)||(o=this._getOrReturnCtx(e,o),ye(o,{validation:"email",code:le.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")cg||(cg=new RegExp(ZL,"u")),cg.test(e.data)||(o=this._getOrReturnCtx(e,o),ye(o,{validation:"emoji",code:le.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")WL.test(e.data)||(o=this._getOrReturnCtx(e,o),ye(o,{validation:"uuid",code:le.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")qL.test(e.data)||(o=this._getOrReturnCtx(e,o),ye(o,{validation:"nanoid",code:le.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")VL.test(e.data)||(o=this._getOrReturnCtx(e,o),ye(o,{validation:"cuid",code:le.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")HL.test(e.data)||(o=this._getOrReturnCtx(e,o),ye(o,{validation:"cuid2",code:le.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")UL.test(e.data)||(o=this._getOrReturnCtx(e,o),ye(o,{validation:"ulid",code:le.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),ye(o,{validation:"url",code:le.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),ye(o,{validation:"regex",code:le.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),ye(o,{code:le.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),ye(o,{code:le.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(o=this._getOrReturnCtx(e,o),ye(o,{code:le.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?s7(s).test(e.data)||(o=this._getOrReturnCtx(e,o),ye(o,{code:le.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?r7.test(e.data)||(o=this._getOrReturnCtx(e,o),ye(o,{code:le.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?o7(s).test(e.data)||(o=this._getOrReturnCtx(e,o),ye(o,{code:le.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?GL.test(e.data)||(o=this._getOrReturnCtx(e,o),ye(o,{validation:"duration",code:le.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?i7(e.data,s.version)||(o=this._getOrReturnCtx(e,o),ye(o,{validation:"ip",code:le.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?a7(e.data,s.alg)||(o=this._getOrReturnCtx(e,o),ye(o,{validation:"jwt",code:le.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?l7(e.data,s.version)||(o=this._getOrReturnCtx(e,o),ye(o,{validation:"cidr",code:le.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?t7.test(e.data)||(o=this._getOrReturnCtx(e,o),ye(o,{validation:"base64",code:le.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?n7.test(e.data)||(o=this._getOrReturnCtx(e,o),ye(o,{validation:"base64url",code:le.invalid_string,message:s.message}),r.dirty()):rt.assertNever(s);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(o=>e.test(o),{validation:n,code:le.invalid_string,...Ne.errToObj(r)})}_addCheck(e){return new Gs({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ne.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ne.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Ne.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ne.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Ne.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ne.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ne.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Ne.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Ne.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Ne.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Ne.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Ne.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Ne.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,...Ne.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,...Ne.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Ne.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Ne.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...Ne.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Ne.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Ne.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Ne.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Ne.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Ne.errToObj(n)})}nonempty(e){return this.min(1,Ne.errToObj(e))}trim(){return new Gs({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Gs({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Gs({...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}}Gs.create=t=>new Gs({checks:[],typeName:He.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...Ge(t)});function u7(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 ec extends et{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)!==Ee.number){const s=this._getOrReturnCtx(e);return ye(s,{code:le.invalid_type,expected:Ee.number,received:s.parsedType}),Ve}let r;const o=new cr;for(const s of this._def.checks)s.kind==="int"?rt.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{code:le.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),ye(r,{code:le.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),ye(r,{code:le.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?u7(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),ye(r,{code:le.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{code:le.not_finite,message:s.message}),o.dirty()):rt.assertNever(s);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Ne.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ne.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ne.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ne.toString(n))}setLimit(e,n,r,o){return new ec({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ne.toString(o)}]})}_addCheck(e){return new ec({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ne.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ne.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ne.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ne.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ne.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ne.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Ne.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ne.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ne.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"&&rt.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)}}ec.create=t=>new ec({checks:[],typeName:He.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ge(t)});class tc extends et{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)!==Ee.bigint)return this._getInvalidInput(e);let r;const o=new cr;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),ye(r,{code:le.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),ye(r,{code:le.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),ye(r,{code:le.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):rt.assertNever(s);return{status:o.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return ye(n,{code:le.invalid_type,expected:Ee.bigint,received:n.parsedType}),Ve}gte(e,n){return this.setLimit("min",e,!0,Ne.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ne.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ne.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ne.toString(n))}setLimit(e,n,r,o){return new tc({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ne.toString(o)}]})}_addCheck(e){return new tc({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ne.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ne.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ne.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ne.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ne.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}}tc.create=t=>new tc({checks:[],typeName:He.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...Ge(t)});class I1 extends et{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Ee.boolean){const r=this._getOrReturnCtx(e);return ye(r,{code:le.invalid_type,expected:Ee.boolean,received:r.parsedType}),Ve}return Rr(e.data)}}I1.create=t=>new I1({typeName:He.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ge(t)});class rh extends et{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Ee.date){const s=this._getOrReturnCtx(e);return ye(s,{code:le.invalid_type,expected:Ee.date,received:s.parsedType}),Ve}if(Number.isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return ye(s,{code:le.invalid_date}),Ve}const r=new cr;let o;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(o=this._getOrReturnCtx(e,o),ye(o,{code:le.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),ye(o,{code:le.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):rt.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new rh({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Ne.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Ne.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}}rh.create=t=>new rh({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:He.ZodDate,...Ge(t)});class fw extends et{_parse(e){if(this._getType(e)!==Ee.symbol){const r=this._getOrReturnCtx(e);return ye(r,{code:le.invalid_type,expected:Ee.symbol,received:r.parsedType}),Ve}return Rr(e.data)}}fw.create=t=>new fw({typeName:He.ZodSymbol,...Ge(t)});class hw extends et{_parse(e){if(this._getType(e)!==Ee.undefined){const r=this._getOrReturnCtx(e);return ye(r,{code:le.invalid_type,expected:Ee.undefined,received:r.parsedType}),Ve}return Rr(e.data)}}hw.create=t=>new hw({typeName:He.ZodUndefined,...Ge(t)});class pw extends et{_parse(e){if(this._getType(e)!==Ee.null){const r=this._getOrReturnCtx(e);return ye(r,{code:le.invalid_type,expected:Ee.null,received:r.parsedType}),Ve}return Rr(e.data)}}pw.create=t=>new pw({typeName:He.ZodNull,...Ge(t)});class mw extends et{constructor(){super(...arguments),this._any=!0}_parse(e){return Rr(e.data)}}mw.create=t=>new mw({typeName:He.ZodAny,...Ge(t)});class gw extends et{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Rr(e.data)}}gw.create=t=>new gw({typeName:He.ZodUnknown,...Ge(t)});class ui extends et{_parse(e){const n=this._getOrReturnCtx(e);return ye(n,{code:le.invalid_type,expected:Ee.never,received:n.parsedType}),Ve}}ui.create=t=>new ui({typeName:He.ZodNever,...Ge(t)});class yw extends et{_parse(e){if(this._getType(e)!==Ee.undefined){const r=this._getOrReturnCtx(e);return ye(r,{code:le.invalid_type,expected:Ee.void,received:r.parsedType}),Ve}return Rr(e.data)}}yw.create=t=>new yw({typeName:He.ZodVoid,...Ge(t)});class ko extends et{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),o=this._def;if(n.parsedType!==Ee.array)return ye(n,{code:le.invalid_type,expected:Ee.array,received:n.parsedType}),Ve;if(o.exactLength!==null){const i=n.data.length>o.exactLength.value,a=n.data.length<o.exactLength.value;(i||a)&&(ye(n,{code:i?le.too_big:le.too_small,minimum:a?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&&(ye(n,{code:le.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&&(ye(n,{code:le.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,a)=>o.type._parseAsync(new li(n,i,n.path,a)))).then(i=>cr.mergeArray(r,i));const s=[...n.data].map((i,a)=>o.type._parseSync(new li(n,i,n.path,a)));return cr.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new ko({...this._def,minLength:{value:e,message:Ne.toString(n)}})}max(e,n){return new ko({...this._def,maxLength:{value:e,message:Ne.toString(n)}})}length(e,n){return new ko({...this._def,exactLength:{value:e,message:Ne.toString(n)}})}nonempty(e){return this.min(1,e)}}ko.create=(t,e)=>new ko({type:t,minLength:null,maxLength:null,exactLength:null,typeName:He.ZodArray,...Ge(e)});function qa(t){if(t instanceof Bt){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Qs.create(qa(r))}return new Bt({...t._def,shape:()=>e})}else return t instanceof ko?new ko({...t._def,type:qa(t.element)}):t instanceof Qs?Qs.create(qa(t.unwrap())):t instanceof ll?ll.create(qa(t.unwrap())):t instanceof ta?ta.create(t.items.map(e=>qa(e))):t}class Bt extends et{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=rt.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==Ee.object){const d=this._getOrReturnCtx(e);return ye(d,{code:le.invalid_type,expected:Ee.object,received:d.parsedType}),Ve}const{status:r,ctx:o}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof ui&&this._def.unknownKeys==="strip"))for(const d in o.data)i.includes(d)||a.push(d);const u=[];for(const d of i){const h=s[d],f=o.data[d];u.push({key:{status:"valid",value:d},value:h._parse(new li(o,f,o.path,d)),alwaysSet:d in o.data})}if(this._def.catchall instanceof ui){const d=this._def.unknownKeys;if(d==="passthrough")for(const h of a)u.push({key:{status:"valid",value:h},value:{status:"valid",value:o.data[h]}});else if(d==="strict")a.length>0&&(ye(o,{code:le.unrecognized_keys,keys:a}),r.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const h of a){const f=o.data[h];u.push({key:{status:"valid",value:h},value:d._parse(new li(o,f,o.path,h)),alwaysSet:h in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const d=[];for(const h of u){const f=await h.key,m=await h.value;d.push({key:f,value:m,alwaysSet:h.alwaysSet})}return d}).then(d=>cr.mergeObjectSync(r,d)):cr.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(e){return Ne.errToObj,new Bt({...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:Ne.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new Bt({...this._def,unknownKeys:"strip"})}passthrough(){return new Bt({...this._def,unknownKeys:"passthrough"})}extend(e){return new Bt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Bt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:He.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Bt({...this._def,catchall:e})}pick(e){const n={};for(const r of rt.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Bt({...this._def,shape:()=>n})}omit(e){const n={};for(const r of rt.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new Bt({...this._def,shape:()=>n})}deepPartial(){return qa(this)}partial(e){const n={};for(const r of rt.objectKeys(this.shape)){const o=this.shape[r];e&&!e[r]?n[r]=o:n[r]=o.optional()}return new Bt({...this._def,shape:()=>n})}required(e){const n={};for(const r of rt.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Qs;)s=s._def.innerType;n[r]=s}return new Bt({...this._def,shape:()=>n})}keyof(){return C_(rt.objectKeys(this.shape))}}Bt.create=(t,e)=>new Bt({shape:()=>t,unknownKeys:"strip",catchall:ui.create(),typeName:He.ZodObject,...Ge(e)});Bt.strictCreate=(t,e)=>new Bt({shape:()=>t,unknownKeys:"strict",catchall:ui.create(),typeName:He.ZodObject,...Ge(e)});Bt.lazycreate=(t,e)=>new Bt({shape:t,unknownKeys:"strip",catchall:ui.create(),typeName:He.ZodObject,...Ge(e)});class oh extends et{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function o(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const i=s.map(a=>new us(a.ctx.common.issues));return ye(n,{code:le.invalid_union,unionErrors:i}),Ve}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},h=u._parseSync({data:n.data,path:n.path,parent:d});if(h.status==="valid")return h;h.status==="dirty"&&!s&&(s={result:h,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 a=i.map(u=>new us(u));return ye(n,{code:le.invalid_union,unionErrors:a}),Ve}}get options(){return this._def.options}}oh.create=(t,e)=>new oh({options:t,typeName:He.ZodUnion,...Ge(e)});function P1(t,e){const n=$s(t),r=$s(e);if(t===e)return{valid:!0,data:t};if(n===Ee.object&&r===Ee.object){const o=rt.objectKeys(e),s=rt.objectKeys(t).filter(a=>o.indexOf(a)!==-1),i={...t,...e};for(const a of s){const u=P1(t[a],e[a]);if(!u.valid)return{valid:!1};i[a]=u.data}return{valid:!0,data:i}}else if(n===Ee.array&&r===Ee.array){if(t.length!==e.length)return{valid:!1};const o=[];for(let s=0;s<t.length;s++){const i=t[s],a=e[s],u=P1(i,a);if(!u.valid)return{valid:!1};o.push(u.data)}return{valid:!0,data:o}}else return n===Ee.date&&r===Ee.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class sh extends et{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),o=(s,i)=>{if(uw(s)||uw(i))return Ve;const a=P1(s.value,i.value);return a.valid?((cw(s)||cw(i))&&n.dirty(),{status:n.value,value:a.data}):(ye(r,{code:le.invalid_intersection_types}),Ve)};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}))}}sh.create=(t,e,n)=>new sh({left:t,right:e,typeName:He.ZodIntersection,...Ge(n)});class ta extends et{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ee.array)return ye(r,{code:le.invalid_type,expected:Ee.array,received:r.parsedType}),Ve;if(r.data.length<this._def.items.length)return ye(r,{code:le.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ve;!this._def.rest&&r.data.length>this._def.items.length&&(ye(r,{code:le.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((i,a)=>{const u=this._def.items[a]||this._def.rest;return u?u._parse(new li(r,i,r.path,a)):null}).filter(i=>!!i);return r.common.async?Promise.all(s).then(i=>cr.mergeArray(n,i)):cr.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new ta({...this._def,rest:e})}}ta.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ta({items:t,typeName:He.ZodTuple,rest:null,...Ge(e)})};class xw extends et{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!==Ee.map)return ye(r,{code:le.invalid_type,expected:Ee.map,received:r.parsedType}),Ve;const o=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([a,u],d)=>({key:o._parse(new li(r,a,r.path,[d,"key"])),value:s._parse(new li(r,u,r.path,[d,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const u of i){const d=await u.key,h=await u.value;if(d.status==="aborted"||h.status==="aborted")return Ve;(d.status==="dirty"||h.status==="dirty")&&n.dirty(),a.set(d.value,h.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const u of i){const d=u.key,h=u.value;if(d.status==="aborted"||h.status==="aborted")return Ve;(d.status==="dirty"||h.status==="dirty")&&n.dirty(),a.set(d.value,h.value)}return{status:n.value,value:a}}}}xw.create=(t,e,n)=>new xw({valueType:e,keyType:t,typeName:He.ZodMap,...Ge(n)});class nc extends et{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ee.set)return ye(r,{code:le.invalid_type,expected:Ee.set,received:r.parsedType}),Ve;const o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(ye(r,{code:le.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&&(ye(r,{code:le.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 h of u){if(h.status==="aborted")return Ve;h.status==="dirty"&&n.dirty(),d.add(h.value)}return{status:n.value,value:d}}const a=[...r.data.values()].map((u,d)=>s._parse(new li(r,u,r.path,d)));return r.common.async?Promise.all(a).then(u=>i(u)):i(a)}min(e,n){return new nc({...this._def,minSize:{value:e,message:Ne.toString(n)}})}max(e,n){return new nc({...this._def,maxSize:{value:e,message:Ne.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}nc.create=(t,e)=>new nc({valueType:t,minSize:null,maxSize:null,typeName:He.ZodSet,...Ge(e)});class j1 extends et{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})}}j1.create=(t,e)=>new j1({getter:t,typeName:He.ZodLazy,...Ge(e)});class L1 extends et{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ye(n,{received:n.data,code:le.invalid_literal,expected:this._def.value}),Ve}return{status:"valid",value:e.data}}get value(){return this._def.value}}L1.create=(t,e)=>new L1({value:t,typeName:He.ZodLiteral,...Ge(e)});function C_(t,e){return new il({values:t,typeName:He.ZodEnum,...Ge(e)})}class il extends et{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return ye(n,{expected:rt.joinValues(r),received:n.parsedType,code:le.invalid_type}),Ve}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 ye(n,{received:n.data,code:le.invalid_enum_value,options:r}),Ve}return Rr(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 il.create(e,{...this._def,...n})}exclude(e,n=this._def){return il.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}il.create=C_;class vw extends et{_parse(e){const n=rt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Ee.string&&r.parsedType!==Ee.number){const o=rt.objectValues(n);return ye(r,{expected:rt.joinValues(o),received:r.parsedType,code:le.invalid_type}),Ve}if(this._cache||(this._cache=new Set(rt.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const o=rt.objectValues(n);return ye(r,{received:r.data,code:le.invalid_enum_value,options:o}),Ve}return Rr(e.data)}get enum(){return this._def.values}}vw.create=(t,e)=>new vw({values:t,typeName:He.ZodNativeEnum,...Ge(e)});class ih extends et{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Ee.promise&&n.common.async===!1)return ye(n,{code:le.invalid_type,expected:Ee.promise,received:n.parsedType}),Ve;const r=n.parsedType===Ee.promise?n.data:Promise.resolve(n.data);return Rr(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}ih.create=(t,e)=>new ih({type:t,typeName:He.ZodPromise,...Ge(e)});class al extends et{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===He.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=>{ye(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 a=>{if(n.value==="aborted")return Ve;const u=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return u.status==="aborted"?Ve:u.status==="dirty"||n.value==="dirty"?vu(u.value):u});{if(n.value==="aborted")return Ve;const a=this._def.schema._parseSync({data:i,path:r.path,parent:r});return a.status==="aborted"?Ve:a.status==="dirty"||n.value==="dirty"?vu(a.value):a}}if(o.type==="refinement"){const i=a=>{const u=o.refinement(a,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 a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Ve:(a.status==="dirty"&&n.dirty(),i(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Ve:(a.status==="dirty"&&n.dirty(),i(a.value).then(()=>({status:n.value,value:a.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(!sl(i))return Ve;const a=o.transform(i.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>sl(i)?Promise.resolve(o.transform(i.value,s)).then(a=>({status:n.value,value:a})):Ve);rt.assertNever(o)}}al.create=(t,e,n)=>new al({schema:t,typeName:He.ZodEffects,effect:e,...Ge(n)});al.createWithPreprocess=(t,e,n)=>new al({schema:e,effect:{type:"preprocess",transform:t},typeName:He.ZodEffects,...Ge(n)});class Qs extends et{_parse(e){return this._getType(e)===Ee.undefined?Rr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Qs.create=(t,e)=>new Qs({innerType:t,typeName:He.ZodOptional,...Ge(e)});class ll extends et{_parse(e){return this._getType(e)===Ee.null?Rr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ll.create=(t,e)=>new ll({innerType:t,typeName:He.ZodNullable,...Ge(e)});class z1 extends et{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===Ee.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}z1.create=(t,e)=>new z1({innerType:t,typeName:He.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ge(e)});class F1 extends et{_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 nh(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new us(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new us(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}F1.create=(t,e)=>new F1({innerType:t,typeName:He.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ge(e)});class bw extends et{_parse(e){if(this._getType(e)!==Ee.nan){const r=this._getOrReturnCtx(e);return ye(r,{code:le.invalid_type,expected:Ee.nan,received:r.parsedType}),Ve}return{status:"valid",value:e.data}}}bw.create=t=>new bw({typeName:He.ZodNaN,...Ge(t)});class c7 extends et{_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 gx extends et{_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"?Ve:s.status==="dirty"?(n.dirty(),vu(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"?Ve: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 gx({in:e,out:n,typeName:He.ZodPipeline})}}class $1 extends et{_parse(e){const n=this._def.innerType._parse(e),r=o=>(sl(o)&&(o.value=Object.freeze(o.value)),o);return nh(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}}$1.create=(t,e)=>new $1({innerType:t,typeName:He.ZodReadonly,...Ge(e)});var He;(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"})(He||(He={}));const yo=Gs.create,d7=I1.create;ui.create;const ul=ko.create,Ap=Bt.create;oh.create;sh.create;ta.create;const f7=j1.create,h7=L1.create,p7=il.create;ih.create;Qs.create;ll.create;var m7=["text","richtext","number","boolean","date","select","relation","image","url","email","list","color","group"],yx=f7(()=>Ap({key:yo().min(1),label:yo().optional(),type:p7(m7),required:d7().optional(),options:ul(yo()).optional(),to:yo().optional(),fields:ul(yx).optional()}).superRefine((t,e)=>{t.type==="select"&&(!t.options||t.options.length===0)&&e.addIssue({code:le.custom,message:"a select field requires options"}),t.type==="relation"&&!t.to&&e.addIssue({code:le.custom,message:'a relation field requires "to"'}),t.type==="group"&&(!t.fields||t.fields.length===0)&&e.addIssue({code:le.custom,message:"a group field requires fields"})})),g7=Ap({name:yo().min(1),label:yo().optional(),path:yo().min(1),fields:ul(yx)}),y7=Ap({name:yo().min(1),label:yo().optional(),path:yo().min(1),fields:ul(yx)});Ap({version:h7(1),collections:ul(g7),singletons:ul(y7)}).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:le.custom,message:`duplicate name: ${i.name}`}),n.add(i.name),(i.path.includes("..")||i.path.startsWith("/")||i.path.includes("\\"))&&e.addIssue({code:le.custom,message:`unsafe path: ${i.path}`}),r.has(i.path)&&e.addIssue({code:le.custom,message:`duplicate path: ${i.path}`}),r.add(i.path);const a=new Set;for(const u of i.fields)a.has(u.key)&&e.addIssue({code:le.custom,message:`duplicate field key: ${u.key}`}),a.add(u.key),u.type==="relation"&&u.to&&!o.has(u.to)&&e.addIssue({code:le.custom,message:`relation target does not exist: ${u.to}`})}});var x7={ç:"c",ğ:"g",ı:"i",ö:"o",ş:"s",ü:"u",Ç:"c",Ğ:"g",İ:"i",Ö:"o",Ş:"s",Ü:"u",I:"i"};function Mp(t){return t.replace(/[çğıöşüÇĞİÖŞÜI]/g,r=>x7[r]??r).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"content"}var S_="_status";function kw(t){return t[S_]==="draft"?"draft":"published"}function v7(t){return t==null||t===""}var b7=/^[a-z][a-z0-9+.-]*:\/\/.+/i,k7=/^[^@\s]+@[^@\s]+\.[^@\s]+$/,w7=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i;function C7(t,e){var n;switch(t.type){case"text":case"richtext":case"date":case"image":return typeof e=="string"?null:"expected text";case"url":return typeof e!="string"?"expected text":b7.test(e)?null:"expected a valid URL";case"email":return typeof e!="string"?"expected text":k7.test(e)?null:"expected a valid email address";case"color":return typeof e!="string"?"expected text":w7.test(e)?null:"expected a hex color (e.g. #ff0000)";case"list":return!Array.isArray(e)||e.some(r=>typeof r!="string")?"expected a list of text":null;case"relation":return!Array.isArray(e)||e.some(r=>typeof r!="string")?"expected a list of slugs":null;case"group":return typeof e!="object"||e===null||Array.isArray(e)?"expected an object":null;case"number":return typeof e=="number"?null:"expected a number";case"boolean":return typeof e=="boolean"?null:"expected true or false";case"select":return typeof e!="string"?"expected text":(n=t.options)!=null&&n.includes(e)?null:"not one of the options"}}function E_(t,e){const n=[],r=new Set(t.map(o=>o.key));for(const o of t){const s=e[o.key];if(v7(s)){o.required&&n.push({key:o.key,level:"warning",kind:"required",message:"required field is empty"});continue}const i=C7(o,s);i&&n.push({key:o.key,level:"error",kind:"type",message:i})}for(const o of Object.keys(e))o.startsWith("_")||r.has(o)||n.push({key:o,level:"warning",kind:"unknown-key",message:"key is not in the schema"});return{ok:n.every(o=>o.level!=="error"),issues:n}}var dg={exports:{}},fg={};/**
|
|
446
|
+
* @license React
|
|
447
|
+
* use-sync-external-store-shim.production.js
|
|
448
|
+
*
|
|
449
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
450
|
+
*
|
|
451
|
+
* This source code is licensed under the MIT license found in the
|
|
452
|
+
* LICENSE file in the root directory of this source tree.
|
|
453
|
+
*/var ww;function S7(){if(ww)return fg;ww=1;var t=Sc();function e(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,o=t.useEffect,s=t.useLayoutEffect,i=t.useDebugValue;function a(f,m){var x=m(),v=r({inst:{value:x,getSnapshot:m}}),b=v[0].inst,k=v[1];return s(function(){b.value=x,b.getSnapshot=m,u(b)&&k({inst:b})},[f,x,m]),o(function(){return u(b)&&k({inst:b}),f(function(){u(b)&&k({inst:b})})},[f]),i(x),x}function u(f){var m=f.getSnapshot;f=f.value;try{var x=m();return!n(f,x)}catch{return!0}}function d(f,m){return m()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:a;return fg.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:h,fg}var Cw;function __(){return Cw||(Cw=1,dg.exports=S7()),dg.exports}var T_=__();function vn(t){this.content=t}vn.prototype={constructor:vn,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 vn(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 vn(n)},addToStart:function(t,e){return new vn([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new vn(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 vn(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=vn.from(t),t.size?new vn(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=vn.from(t),t.size?new vn(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=vn.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}};vn.from=function(t){if(t instanceof vn)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new vn(e)};function N_(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,a=s.text,u=0;for(;i[u]==a[u];u++)n++;return u&&u<i.length&&u<a.length&&D_(i.charCodeAt(u-1))&&M_(i.charCodeAt(u))&&n--,n}if(o.content.size||s.content.size){let i=N_(o.content,s.content,n+1);if(i!=null)return i}n+=o.nodeSize}}function A_(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),a=e.child(--s),u=i.nodeSize;if(i==a){n-=u,r-=u;continue}if(!i.sameMarkup(a))return{a:n,b:r};if(i.isText&&i.text!=a.text){let d=i.text,h=a.text,f=d.length,m=h.length;for(;f>0&&m>0&&d[f-1]==h[m-1];)f--,m--,n--,r--;return f&&m&&f<d.length&&D_(d.charCodeAt(f-1))&&M_(d.charCodeAt(f))&&(n++,r++),{a:n,b:r}}if(i.content.size||a.content.size){let d=A_(i.content,a.content,n-1,r-1);if(d)return d}n-=u,r-=u}}function M_(t){return t>=56320&&t<57344}function D_(t){return t>=55296&&t<56320}class oe{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,a=0;a<n;i++){let u=this.content[i],d=a+u.nodeSize;if(d>e&&r(u,o+a,s||null,i)!==!1&&u.content.size){let h=a+1;u.nodesBetween(Math.max(0,e-h),Math.min(u.content.size,n-h),r,o+h)}a=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let s="",i=!0;return this.nodesBetween(e,n,(a,u)=>{let d=a.isText?a.text.slice(Math.max(e,u)-u,n-u):a.isLeaf?o?typeof o=="function"?o(a):o:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&d||a.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 oe(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 a=this.content[s],u=i+a.nodeSize;u>e&&((i<e||u>n)&&(a.isText?a=a.cut(Math.max(0,e-i),Math.min(a.text.length,n-i)):a=a.cut(Math.max(0,e-i-1),Math.min(a.content.size,n-i-1))),r.push(a),o+=a.nodeSize),i=u}return new oe(r,o)}cutByIndex(e,n){return e==n?oe.empty:e==0&&n==this.content.length?this:new oe(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 oe(o,s)}addToStart(e){return new oe([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new oe(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 N_(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return A_(this,e,n,r)}findIndex(e){if(e==0)return gf(0,e);if(e==this.size)return gf(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?gf(n+1,s):gf(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 oe.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return oe.fromArray(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return oe.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 oe(n||e,r)}static from(e){if(!e)return oe.empty;if(e instanceof oe)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new oe([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}oe.empty=new oe([],0);const hg={index:0,offset:0};function gf(t,e){return hg.index=t,hg.offset=e,hg}function ah(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(!ah(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!ah(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let ut=class B1{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&&ah(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 B1.none;if(e instanceof B1)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};ut.none=[];class rc extends Error{}class xe{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=O_(this.content,e+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new xe(r,this.openStart,this.openEnd)}removeBetween(e,n){return new xe(R_(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 xe.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 xe(oe.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 xe(e,r,o)}}xe.empty=new xe(oe.empty,0,0);function R_(t,e,n){let{index:r,offset:o}=t.findIndex(e),s=t.maybeChild(r),{index:i,offset:a}=t.findIndex(n);if(o==e||s.isText){if(a!=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(R_(s.content,e-o-1,n-o-1)))}function O_(t,e,n,r,o,s){let{index:i,offset:a}=t.findIndex(e),u=t.maybeChild(i);if(a==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=O_(u.content,e-a-1,n,i==0?r-1:0,i==t.childCount-1?o-1:0,u);return d&&t.replaceChild(i,u.copy(d))}function E7(t,e,n){if(n.openStart>t.depth)throw new rc("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new rc("Inconsistent open depths");return I_(t,e,n,0)}function I_(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=I_(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,a=i.content;return Ki(i,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:i,end:a}=_7(n,t);return Ki(s,j_(t,i,a,e,r))}else return Ki(s,lh(t,e,r))}function P_(t,e){if(!e.type.compatibleContent(t.type))throw new rc("Cannot join "+e.type.name+" onto "+t.type.name)}function V1(t,e,n){let r=t.node(n);return P_(r,e.node(n)),r}function qi(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 _u(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&&(qi(t.nodeAfter,r),s++));for(let a=s;a<i;a++)qi(o.child(a),r);e&&e.depth==n&&e.textOffset&&qi(e.nodeBefore,r)}function Ki(t,e){if(!t.type.validContent(e))throw new rc("Invalid content for node "+t.type.name);return t.copy(e)}function j_(t,e,n,r,o){let s=t.depth>o&&V1(t,e,o+1),i=r.depth>o&&V1(n,r,o+1),a=[];return _u(null,t,o,a),s&&i&&e.index(o)==n.index(o)?(P_(s,i),qi(Ki(s,j_(t,e,n,r,o+1)),a)):(s&&qi(Ki(s,lh(t,e,o+1)),a),_u(e,n,o,a),i&&qi(Ki(i,lh(n,r,o+1)),a)),_u(r,null,o,a),new oe(a)}function lh(t,e,n){let r=[];if(_u(null,t,n,r),t.depth>n){let o=V1(t,e,n+1);qi(Ki(o,lh(t,e,n+1)),r)}return _u(e,null,n,r),new oe(r)}function _7(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(oe.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}class oc{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 ut.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),o=e.maybeChild(n);if(!r){let a=r;r=o,o=a}let 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 uh(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:a,offset:u}=i.content.findIndex(s),d=s-u;if(r.push(i,a,o+u),!d||(i=i.child(a),i.isText))break;s=d-1,o+=u+1}return new oc(n,r,s)}static resolveCached(e,n){let r=Sw.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 Sw.set(e,r=new T7);let o=r.elts[r.i]=oc.resolve(e,n);return r.i=(r.i+1)%N7,o}}class T7{constructor(){this.elts=[],this.i=0}}const N7=12,Sw=new WeakMap;class uh{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 A7=Object.create(null);let ei=class H1{constructor(e,n,r,o=ut.none){this.type=e,this.attrs=n,this.marks=o,this.content=r||oe.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&&ah(this.attrs,n||e.defaultAttrs||A7)&&ut.sameSet(this.marks,r||ut.none)}copy(e=null){return e==this.content?this:new H1(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new H1(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 xe.empty;let o=this.resolve(e),s=this.resolve(n),i=r?0:o.sharedDepth(n),a=o.start(i),d=o.node(i).content.cut(o.pos-a,s.pos-a);return new xe(d,o.depth-i,s.depth-i)}replace(e,n,r){return E7(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 oc.resolveCached(this,e)}resolveNoCache(e){return oc.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()+")"),L_(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=oe.empty,o=0,s=r.childCount){let i=this.contentMatchAt(e).matchFragment(r,o,s),a=i&&i.matchFragment(this.content,n);if(!a||!a.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=ut.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(!ut.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=oe.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,o,r);return s.type.checkAttrs(s.attrs),s}};ei.prototype.text=void 0;class ch extends ei{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):L_(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 ch(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ch(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 L_(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class na{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new M7(e,n);if(r.next==null)return na.empty;let o=z_(r);r.next&&r.err("Unexpected trailing text");let s=L7(j7(o));return z7(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,a){let u=i.matchFragment(e,r);if(u&&(!n||u.validEnd))return oe.from(a.map(d=>d.createAndFill()));for(let d=0;d<i.next.length;d++){let{type:h,next:f}=i.next[d];if(!(h.isText||h.hasRequiredAttrs())&&o.indexOf(f)==-1){o.push(f);let m=s(f,a.concat(h));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 a=o;a.type;a=a.via)i.push(a.type);return i.reverse()}for(let i=0;i<s.next.length;i++){let{type:a,next:u}=s.next[i];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!o.type||u.validEnd)&&(r.push({match:a.contentMatch,type:a,via:o}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let o=0;o<r.next.length;o++)e.indexOf(r.next[o].next)==-1&&n(r.next[o].next)}return n(this),e.map((r,o)=>{let 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(`
|
|
454
|
+
`)}}na.empty=new na(!0);class M7{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 z_(t){let e=[];do e.push(D7(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function D7(t){let e=[];do e.push(R7(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function R7(t){let e=P7(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=O7(t,e);else break;return e}function Ew(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function O7(t,e){let n=Ew(t),r=n;return t.eat(",")&&(t.next!="}"?r=Ew(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function I7(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 P7(t){if(t.eat("(")){let e=z_(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=I7(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 j7(t){let e=[[]];return o(s(t,0),n()),e;function n(){return e.push([])-1}function r(i,a,u){let d={term:u,to:a};return e[i].push(d),d}function o(i,a){i.forEach(u=>u.to=a)}function s(i,a){if(i.type=="choice")return i.exprs.reduce((u,d)=>u.concat(s(d,a)),[]);if(i.type=="seq")for(let u=0;;u++){let d=s(i.exprs[u],a);if(u==i.exprs.length-1)return d;o(d,a=n())}else if(i.type=="star"){let u=n();return r(a,u),o(s(i.expr,u),u),[r(u)]}else if(i.type=="plus"){let u=n();return o(s(i.expr,a),u),o(s(i.expr,u),u),[r(u)]}else{if(i.type=="opt")return[r(a)].concat(s(i.expr,a));if(i.type=="range"){let u=a;for(let d=0;d<i.min;d++){let h=n();o(s(i.expr,u),h),u=h}if(i.max==-1)o(s(i.expr,u),u);else for(let d=i.min;d<i.max;d++){let h=n();r(u,h),o(s(i.expr,u),h),u=h}return[r(u)]}else{if(i.type=="name")return[r(a,void 0,i.value)];throw new Error("Unknown expr type")}}}}function F_(t,e){return e-t}function _w(t,e){let n=[];return r(e),n.sort(F_);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:a,to:u}=s[i];!a&&n.indexOf(u)==-1&&r(u)}}}function L7(t){let e=Object.create(null);return n(_w(t,0));function n(r){let o=[];r.forEach(i=>{t[i].forEach(({term:a,to:u})=>{if(!a)return;let d;for(let h=0;h<o.length;h++)o[h][0]==a&&(d=o[h][1]);_w(t,u).forEach(h=>{d||o.push([a,d=[]]),d.indexOf(h)==-1&&d.push(h)})})});let s=e[r.join(",")]=new na(r.indexOf(t.length-1)>-1);for(let i=0;i<o.length;i++){let a=o[i][1].sort(F_);s.next.push({type:o[i][0],next:e[a.join(",")]||n(a)})}return s}}function z7(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],s=!o.validEnd,i=[];for(let a=0;a<o.next.length;a++){let{type:u,next:d}=o.next[a];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){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 B_(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 V_(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 H_(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new $7(t,r,e[r]);return n}let Tw=class U_{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=H_(e,r.attrs),this.defaultAttrs=$_(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==na.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:B_(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new ei(this,this.computeAttrs(e),oe.from(n),ut.setFrom(r))}createChecked(e=null,n,r){return n=oe.from(n),this.checkContent(n),new ei(this,this.computeAttrs(e),n,ut.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=oe.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(oe.empty,!0);return s?new ei(this,e,n.append(s),ut.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){V_(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:ut.none:e}static compile(e,n){let r=Object.create(null);e.forEach((s,i)=>r[s]=new U_(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 F7(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 $7{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?F7(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Dp{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=H_(e,o.attrs),this.excluded=null;let s=$_(this.attrs);this.instance=s?new ut(this,s):null}create(e=null){return!e&&this.instance?this.instance:new ut(this,B_(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((s,i)=>r[s]=new Dp(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){V_(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class xx{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=vn.from(e.nodes),n.marks=vn.from(e.marks||{}),this.nodes=Tw.compile(this.spec.nodes,this),this.marks=Dp.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||"",a=s.spec.marks;if(s.contentMatch=r[i]||(r[i]=na.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=a=="_"?null:a?Nw(this,a.split(" ")):a==""||!s.inlineContent?[]:null}for(let o in this.marks){let s=this.marks[o],i=s.spec.excludes;s.excluded=i==null?[s]:i==""?[]:Nw(this,i.split(" "))}this.nodeFromJSON=o=>ei.fromJSON(this,o),this.markFromJSON=o=>ut.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 Tw){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 ch(r,r.defaultAttrs,e,ut.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 Nw(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 a in t.marks){let u=t.marks[a];(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 B7(t){return t.tag!=null}function V7(t){return t.style!=null}class ts{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(o=>{if(B7(o))this.tags.push(o);else if(V7(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 Mw(this,n,!1);return r.addAll(e,ut.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Mw(this,n,!0);return r.addAll(e,ut.none,n.from,n.to),xe.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(W7(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],a=i.style;if(!(a.indexOf(e)!=0||i.context&&!r.matchesContext(i.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.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 a=n[i];if((a.priority==null?50:a.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=Dw(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=Dw(i)),i.node||i.ignore||i.mark||(i.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new ts(e,ts.schemaRules(e)))}}const W_={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},H7={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},q_={ol:!0,ul:!0},sc=1,U1=2,Tu=4;function Aw(t,e,n){return e!=null?(e?sc:0)|(e==="full"?U1:0):t&&t.whitespace=="pre"?sc|U1:n&~Tu}class yf{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=ut.none,this.match=s||(i&Tu?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(oe.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&sc)){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=oe.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(oe.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&&!W_.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Mw{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=Aw(null,n.preserveWhitespace,0)|(r?Tu:0);o?s=new yf(o.type,o.attrs,ut.none,!0,n.topMatch||o.type.contentMatch,i):r?s=new yf(null,null,ut.none,!0,null,i):s=new yf(e.schema.topNodeType,null,ut.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&U1?"full":this.localPreserveWS||(o.options&sc)>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,`
|
|
455
|
+
`);else if(i.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(i.linebreakReplacement.create())){let a=r.split(/\r?\n|\r/);for(let u=0;u<a.length;u++)u&&this.insertNode(i.linebreakReplacement.create(),n,!0),a[u]&&this.insertNode(i.text(a[u]),n,!/\S/.test(a[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 a=o.content[o.content.length-1],u=e.previousSibling;(!a||u&&u.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.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(),a;q_.hasOwnProperty(i)&&this.parser.normalizeLists&&U7(e);let u=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(u?u.ignore:H7.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,h=this.needsBlock;if(W_.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 f=u&&u.skip?n:this.readStyles(e,n);f&&this.addAll(e,f),d&&this.sync(s),this.needsBlock=h}else{let d=this.readStyles(e,n);d&&this.addElementByRule(e,u,d,u.consuming===!1?a:void 0)}this.localPreserveWS=o}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
456
|
+
`),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 a=void 0;;){let u=this.parser.matchStyle(s,i,this,a);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)a=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 a=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(a)&&this.open--}addAll(e,n,r,o){let s=r||0;for(let i=r?e.childNodes[r]:e.firstChild,a=o==null?null:e.childNodes[o];i!=a;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,a=0;i>=0;i--){let u=this.nodes[i],d=u.findWrapping(e);if(d&&(!o||o.length>d.length+a)&&(o=d,s=u,!d.length))break;if(u.solid){if(r)break;a+=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=ut.none;for(let a of o.concat(e.marks))(s.type?s.type.allowsMarkType(a.type):Rw(a.type,e.type))&&(i=a.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 a=Aw(e,s,i.options);i.options&Tu&&i.content.length==0&&(a|=Tu);let u=ut.none;return r=r.filter(d=>(i.type?i.type.allowsMarkType(d.type):Rw(d.type,e))?(u=d.addToSet(u),!1):!0),this.nodes.push(new yf(e,n,u,o,null,a)),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|=sc)}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=(a,u)=>{for(;a>=0;a--){let d=n[a];if(d==""){if(a==n.length-1||a==0)continue;for(;u>=s;u--)if(i(a-1,u))return!0;return!1}else{let h=u>0||u==0&&o?this.nodes[u].type:r&&u>=s?r.node(u-s).type:null;if(!h||h.name!=d&&!h.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 U7(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&q_.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function W7(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Dw(t){let e={};for(let n in t)e[n]=t[n];return e}function Rw(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let s=[],i=a=>{s.push(a);for(let u=0;u<a.edgeCount;u++){let{type:d,next:h}=a.edge(u);if(d==e||s.indexOf(h)<0&&i(h))return!0}};if(i(o.contentMatch))return!0}}class ha{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=xf(n).createDocumentFragment());let o=r,s=[];return e.forEach(i=>{if(s.length||i.marks.length){let a=0,u=0;for(;a<s.length&&u<i.marks.length;){let d=i.marks[u];if(!this.marks[d.type.name]){u++;continue}if(!d.eq(s[a][0])||d.type.spec.spanning===!1)break;a++,u++}for(;a<s.length;)o=s.pop()[1];for(;u<i.marks.length;){let d=i.marks[u++],h=this.serializeMark(d,i.isInline,n);h&&(s.push([d,o]),o.appendChild(h.dom),o=h.contentDOM||h.dom)}}o.appendChild(this.serializeNodeInner(i,n))}),r}serializeNodeInner(e,n){if(e.isText)return xf(n).createTextNode(e.text);let{dom:r,contentDOM:o}=Hf(xf(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&&Hf(xf(r),o(e,n),null,e.attrs)}static renderSpec(e,n,r=null,o){return typeof n=="string"?{dom:e.createTextNode(n)}:Hf(e,n,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ha(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Ow(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Ow(e.marks)}}function Ow(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function xf(t){return t.document||window.document}const Iw=new WeakMap;function q7(t){let e=Iw.get(t);return e===void 0&&Iw.set(t,e=K7(t)),e}function K7(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 Hf(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=q7(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 a,u=n?t.createElementNS(n,o):t.createElement(o),d=e[1],h=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){h=2;for(let f in d)if(d[f]!=null){let m=f.indexOf(" ");m>0?u.setAttributeNS(f.slice(0,m),f.slice(m+1),d[f]):f=="style"&&u.style?u.style.cssText=d[f]:u.setAttribute(f,d[f])}}for(let f=h;f<e.length;f++){let m=e[f];if(m===0){if(f<e.length-1||f>h)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:x,contentDOM:v}=Hf(t,m,n,r);if(u.appendChild(x),v){if(a)throw new RangeError("Multiple content holes");a=v}}}return{dom:u,contentDOM:a}}const K_=65535,G_=Math.pow(2,16);function G7(t,e){return t+e*G_}function Pw(t){return t&K_}function J7(t){return(t-(t&K_))/G_}const J_=1,Z_=2,Uf=4,Y_=8;class W1{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Y_)>0}get deletedBefore(){return(this.delInfo&(J_|Uf))>0}get deletedAfter(){return(this.delInfo&(Z_|Uf))>0}get deletedAcross(){return(this.delInfo&Uf)>0}}class lr{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&lr.empty)return lr.empty}recover(e){let n=0,r=Pw(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+J7(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 a=0;a<this.ranges.length;a+=3){let u=this.ranges[a]-(this.inverted?o:0);if(u>e)break;let d=this.ranges[a+s],h=this.ranges[a+i],f=u+d;if(e<=f){let m=d?e==u?-1:e==f?1:n:n,x=u+o+(m<0?0:h);if(r)return x;let v=e==(n<0?u:f)?null:G7(a/3,e-u),b=e==u?Z_:e==f?J_:Uf;return(n<0?e!=u:e!=f)&&(b|=Y_),new W1(x,b,v)}o+=h-d}return r?e+o:new W1(e+o,0,null)}touches(e,n){let r=0,o=Pw(n),s=this.inverted?2:1,i=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let u=this.ranges[a]-(this.inverted?r:0);if(u>e)break;let d=this.ranges[a+s],h=u+d;if(e<=h&&a==o*3)return!0;r+=this.ranges[a+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],a=i-(this.inverted?s:0),u=i+(this.inverted?0:s),d=this.ranges[o+n],h=this.ranges[o+r];e(a,a+d,u,u+h),s+=h-d}}invert(){return new lr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?lr.empty:new lr(e<0?[0,-e,0]:[0,0,e])}}lr.empty=new lr([]);class ic{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 ic(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 ic;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],a=i.mapResult(e,n);if(a.recover!=null){let u=this.getMirror(s);if(u!=null&&u>s&&u<this.to){s=u,e=this._maps[u].recover(a.recover);continue}}o|=a.delInfo,e=a.pos}return r?e:new W1(e,o,null)}}const pg=Object.create(null);let Mn=class{getMap(){return lr.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=pg[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 pg)throw new RangeError("Duplicate use of step JSON ID "+e);return pg[e]=n,n.prototype.jsonID=e,n}};class Ht{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Ht(e,null)}static fail(e){return new Ht(null,e)}static fromReplace(e,n,r,o){try{return Ht.ok(e.replace(n,r,o))}catch(s){if(s instanceof rc)return Ht.fail(s.message);throw s}}}function vx(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let s=t.child(o);s.content.size&&(s=s.copy(vx(s.content,e,s))),s.isInline&&(s=e(s,n,o)),r.push(s)}return oe.fromArray(r)}class Js 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 xe(vx(n.content,(i,a)=>!i.isAtom||!a.type.allowsMarkType(this.mark.type)?i:i.mark(this.mark.addToSet(i.marks)),o),n.openStart,n.openEnd);return Ht.fromReplace(e,this.from,this.to,s)}invert(){return new qr(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 Js(n.pos,r.pos,this.mark)}merge(e){return e instanceof Js&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Js(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 Js(n.from,n.to,e.markFromJSON(n.mark))}}Mn.jsonID("addMark",Js);class qr 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 xe(vx(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return Ht.fromReplace(e,this.from,this.to,r)}invert(){return new Js(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 qr(n.pos,r.pos,this.mark)}merge(e){return e instanceof qr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new qr(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 qr(n.from,n.to,e.markFromJSON(n.mark))}}Mn.jsonID("removeMark",qr);class Zs extends Mn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ht.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Ht.fromReplace(e,this.pos,this.pos+1,new xe(oe.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 Zs(this.pos,n.marks[o]);return new Zs(this.pos,this.mark)}}return new ra(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Zs(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 Zs(n.pos,e.markFromJSON(n.mark))}}Mn.jsonID("addNodeMark",Zs);class ra extends Mn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ht.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Ht.fromReplace(e,this.pos,this.pos+1,new xe(oe.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Zs(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new ra(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 ra(n.pos,e.markFromJSON(n.mark))}}Mn.jsonID("removeNodeMark",ra);class Vt 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&&q1(e,this.from,this.to)?Ht.fail("Structure replace would overwrite content"):Ht.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new lr([this.from,this.to-this.from,this.slice.size])}invert(e){return new Vt(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&&Vt.MAP_BIAS<0?n:e.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new Vt(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Vt)||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?xe.empty:new xe(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Vt(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?xe.empty:new xe(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Vt(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 Vt(n.from,n.to,xe.fromJSON(e,n.slice),!!n.structure)}}Vt.MAP_BIAS=1;Mn.jsonID("replace",Vt);class hn extends Mn{constructor(e,n,r,o,s,i,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=s,this.insert=i,this.structure=a}apply(e){if(this.structure&&(q1(e,this.from,this.gapFrom)||q1(e,this.gapTo,this.to)))return Ht.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Ht.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Ht.fromReplace(e,this.from,this.to,r):Ht.fail("Content does not fit in gap")}getMap(){return new lr([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 hn(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 hn(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 hn(n.from,n.to,n.gapFrom,n.gapTo,xe.fromJSON(e,n.slice),n.insert,!!n.structure)}}Mn.jsonID("replaceAround",hn);function q1(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 Z7(t,e,n,r){let o=[],s=[],i,a;t.doc.nodesBetween(e,n,(u,d,h)=>{if(!u.isInline)return;let f=u.marks;if(!r.isInSet(f)&&h.type.allowsMarkType(r.type)){let m=Math.max(d,e),x=Math.min(d+u.nodeSize,n),v=r.addToSet(f);for(let b=0;b<f.length;b++)f[b].isInSet(v)||(i&&i.to==m&&i.mark.eq(f[b])?i.to=x:o.push(i=new qr(m,x,f[b])));a&&a.to==m?a.to=x:s.push(a=new Js(m,x,r))}}),o.forEach(u=>t.step(u)),s.forEach(u=>t.step(u))}function Y7(t,e,n,r){let o=[],s=0;t.doc.nodesBetween(e,n,(i,a)=>{if(!i.isInline)return;s++;let u=null;if(r instanceof Dp){let d=i.marks,h;for(;h=r.isInSet(d);)(u||(u=[])).push(h),d=h.removeFromSet(d)}else r?r.isInSet(i.marks)&&(u=[r]):u=i.marks;if(u&&u.length){let d=Math.min(a+i.nodeSize,n);for(let h=0;h<u.length;h++){let f=u[h],m;for(let x=0;x<o.length;x++){let v=o[x];v.step==s-1&&f.eq(o[x].style)&&(m=v)}m?(m.to=d,m.step=s):o.push({style:f,from:Math.max(a,e),to:d,step:s})}}}),o.forEach(i=>t.step(new qr(i.from,i.to,i.style)))}function bx(t,e,n,r=n.contentMatch,o=!0){let s=t.doc.nodeAt(e),i=[],a=e+1;for(let u=0;u<s.childCount;u++){let d=s.child(u),h=a+d.nodeSize,f=r.matchType(d.type);if(!f)i.push(new Vt(a,h,xe.empty));else{r=f;for(let m=0;m<d.marks.length;m++)n.allowsMarkType(d.marks[m].type)||t.step(new qr(a,h,d.marks[m]));if(o&&d.isText&&n.whitespace!="pre"){let m,x=/\r?\n|\r/g,v;for(;m=x.exec(d.text);)v||(v=new xe(oe.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),i.push(new Vt(a+m.index,a+m.index+m[0].length,v))}}a=h}if(!r.validEnd){let u=r.fillBefore(oe.empty,!0);t.replace(a,a,new xe(u,0,0))}for(let u=i.length-1;u>=0;u--)t.step(i[u])}function X7(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function _l(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),a=t.$from.index(r)+o,u=t.$to.indexAfter(r)-s;if(r<t.depth&&i.canReplace(a,u,n))return r;if(r==0||i.type.spec.isolating||!X7(i,a,u))break;a&&(o=1),u<i.childCount&&(s=1)}return null}function Q7(t,e,n){let{$from:r,$to:o,depth:s}=e,i=r.before(s+1),a=o.after(s+1),u=i,d=a,h=oe.empty,f=0;for(let v=s,b=!1;v>n;v--)b||r.index(v)>0?(b=!0,h=oe.from(r.node(v).copy(h)),f++):u--;let m=oe.empty,x=0;for(let v=s,b=!1;v>n;v--)b||o.after(v+1)<o.end(v)?(b=!0,m=oe.from(o.node(v).copy(m)),x++):d++;t.step(new hn(u,d,i,a,new xe(h.append(m),f,x),h.size-f,!0))}function kx(t,e,n=null,r=t){let o=ez(t,e),s=o&&tz(r,e);return s?o.map(jw).concat({type:e,attrs:n}).concat(s.map(jw)):null}function jw(t){return{type:t,attrs:null}}function ez(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 tz(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 nz(t,e,n){let r=oe.empty;for(let i=n.length-1;i>=0;i--){if(r.size){let a=n[i].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=oe.from(n[i].type.create(n[i].attrs,r))}let o=e.start,s=e.end;t.step(new hn(o,s,o,s,new xe(r,0,0),n.length,!0))}function rz(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,a)=>{let u=typeof o=="function"?o(i):o;if(i.isTextblock&&!i.hasMarkup(r,u)&&oz(t.doc,t.mapping.slice(s).map(a),r)){let d=null;if(r.schema.linebreakReplacement){let x=r.whitespace=="pre",v=!!r.contentMatch.matchType(r.schema.linebreakReplacement);x&&!v?d=!1:!x&&v&&(d=!0)}d===!1&&Q_(t,i,a,s),bx(t,t.mapping.slice(s).map(a,1),r,void 0,d===null);let h=t.mapping.slice(s),f=h.map(a,1),m=h.map(a+i.nodeSize,1);return t.step(new hn(f,m,f+1,m-1,new xe(oe.from(r.create(u,null,i.marks)),0,0),1,!0)),d===!0&&X_(t,i,a,s),!1}})}function X_(t,e,n,r){e.forEach((o,s)=>{if(o.isText){let i,a=/\r?\n|\r/g;for(;i=a.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 Q_(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(`
|
|
457
|
+
`))}})}function oz(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function sz(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 hn(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new xe(oe.from(i),0,0),1,!0))}function ns(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,h=n-2;d>s;d--,h--){let f=o.node(d),m=o.index(d);if(f.type.spec.isolating)return!1;let x=f.content.cutByIndex(m,f.childCount),v=r&&r[h+1];v&&(x=x.replaceChild(0,v.type.create(v.attrs)));let b=r&&r[h]||f;if(!f.canReplace(m+1,f.childCount)||!b.type.validContent(x))return!1}let a=o.indexAfter(s),u=r&&r[0];return o.node(s).canReplaceWith(a,a,u?u.type:o.node(s+1).type)}function iz(t,e,n=1,r){let o=t.doc.resolve(e),s=oe.empty,i=oe.empty;for(let a=o.depth,u=o.depth-n,d=n-1;a>u;a--,d--){s=oe.from(o.node(a).copy(s));let h=r&&r[d];i=oe.from(h?h.type.create(h.attrs,i):o.node(a).copy(i))}t.step(new Vt(e,e,new xe(s.append(i),n,n),!0))}function yi(t,e){let n=t.resolve(e),r=n.index();return e4(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function az(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 e4(t,e){return!!(t&&e&&!t.isLeaf&&az(t,e))}function Rp(t,e,n=-1){let r=t.resolve(e);for(let o=r.depth;;o--){let s,i,a=r.index(o);if(o==r.depth?(s=r.nodeBefore,i=r.nodeAfter):n>0?(s=r.node(o+1),a++,i=r.node(o).maybeChild(a)):(s=r.node(o).maybeChild(a-1),i=r.node(o+1)),s&&!s.isTextblock&&e4(s,i)&&r.node(o).canReplace(a,a+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function lz(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 h=i.whitespace=="pre",f=!!i.contentMatch.matchType(o);h&&!f?r=!1:!h&&f&&(r=!0)}let a=t.steps.length;if(r===!1){let h=t.doc.resolve(e+n);Q_(t,h.node(),h.before(),a)}i.inlineContent&&bx(t,e+n-1,i,s.node().contentMatchAt(s.index()),r==null);let u=t.mapping.slice(a),d=u.map(e-n);if(t.step(new Vt(d,u.map(e+n,-1),xe.empty,!0)),r===!0){let h=t.doc.resolve(d);X_(t,h.node(),h.before(),t.steps.length)}return t}function uz(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 t4(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 a=i==r.depth?0:r.pos<=(r.start(i+1)+r.end(i+1))/2?-1:1,u=r.index(i)+(a>0?1:0),d=r.node(i),h=!1;if(s==1)h=d.canReplace(u,u,o);else{let f=d.contentMatchAt(u).findWrapping(o.firstChild.type);h=f&&d.canReplaceWith(u,u,f[0])}if(h)return a==0?r.pos:a<0?r.before(i+1):r.after(i+1)}return null}function Op(t,e,n=e,r=xe.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),s=t.resolve(n);return n4(o,s,r)?new Vt(e,n,r):new cz(o,s,r).fit()}function n4(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class cz{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=oe.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=oe.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,a=o.depth;for(;i&&a&&s.childCount==1;)s=s.firstChild.content,i--,a--;let u=new xe(s,i,a);return e>-1?new hn(r.pos,e,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new Vt(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=mg(this.unplaced.content,r-1).firstChild,o=s.content):o=this.unplaced.content;let i=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:u,match:d}=this.frontier[a],h,f=null;if(n==1&&(i?d.matchType(i.type)||(f=d.fillBefore(oe.from(i),!1)):s&&u.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:a,parent:s,inject:f};if(n==2&&i&&(h=d.findWrapping(i.type)))return{sliceDepth:r,frontierDepth:a,parent:s,wrap:h};if(s&&d.matchType(s.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=mg(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new xe(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=mg(e,n);if(o.childCount<=1&&n>0){let s=e.size-n<=n+o.size;this.unplaced=new xe(bu(e,n-1,1),n-1,s?n-1:r)}else this.unplaced=new xe(bu(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,a=r?r.content:i.content,u=i.openStart-e,d=0,h=[],{match:f,type:m}=this.frontier[n];if(o){for(let b=0;b<o.childCount;b++)h.push(o.child(b));f=f.matchFragment(o)}let x=a.size+e-(i.content.size-i.openEnd);for(;d<a.childCount;){let b=a.child(d),k=f.matchType(b.type);if(!k)break;d++,(d>1||u==0||b.content.size)&&(f=k,h.push(r4(b.mark(m.allowedMarks(b.marks)),d==1?u:0,d==a.childCount?x:-1)))}let v=d==a.childCount;v||(x=-1),this.placed=ku(this.placed,n,oe.from(h)),this.frontier[n].match=f,v&&x<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let b=0,k=a;b<x;b++){let S=k.lastChild;this.frontier.push({type:S.type,match:S.contentMatchAt(S.childCount)}),k=S.content}this.unplaced=v?e==0?xe.empty:new xe(bu(i.content,e-1,1),e-1,x<0?i.openEnd:e-1):new xe(bu(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||!gg(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=gg(e,n,o,r,s);if(i){for(let a=n-1;a>=0;a--){let{match:u,type:d}=this.frontier[a],h=gg(e,a,d,u,!0);if(!h||h.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=ku(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let o=e.node(r),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=ku(this.placed,this.depth,oe.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(oe.empty,!0);n.childCount&&(this.placed=ku(this.placed,this.frontier.length,n))}}function bu(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(bu(t.firstChild.content,e-1,n)))}function ku(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(ku(t.lastChild.content,e-1,n)))}function mg(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function r4(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,r4(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(oe.empty,!0)))),t.copy(r)}function gg(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 a=r.fillBefore(s.content,!0,i);return a&&!dz(n,s.content,i)?a:null}function dz(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function fz(t){return t.spec.defining||t.spec.definingForContent}function hz(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),s=t.doc.resolve(n);if(n4(o,s,r))return t.step(new Vt(e,n,r));let i=s4(o,s);i[i.length-1]==0&&i.pop();let a=-(o.depth+1);i.unshift(a);for(let m=o.depth,x=o.pos-1;m>0;m--,x--){let v=o.node(m).type.spec;if(v.defining||v.definingAsContext||v.isolating)break;i.indexOf(m)>-1?a=m:o.before(m)==x&&i.splice(1,0,-m)}let u=i.indexOf(a),d=[],h=r.openStart;for(let m=r.content,x=0;;x++){let v=m.firstChild;if(d.push(v),x==r.openStart)break;m=v.content}for(let m=h-1;m>=0;m--){let x=d[m],v=fz(x.type);if(v&&!x.sameMarkup(o.node(Math.abs(a)-1)))h=m;else if(v||!x.type.isTextblock)break}for(let m=r.openStart;m>=0;m--){let x=(m+h+1)%(r.openStart+1),v=d[x];if(v)for(let b=0;b<i.length;b++){let k=i[(b+u)%i.length],S=!0;k<0&&(S=!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),S?s.after(k):n,new xe(o4(r.content,0,r.openStart,x),x,r.openEnd))}}let f=t.steps.length;for(let m=i.length-1;m>=0&&(t.replace(e,n,r),!(t.steps.length>f));m--){let x=i[m];x<0||(e=o.before(x),n=s.after(x))}}function o4(t,e,n,r,o){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(o4(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(oe.empty,!0))}return t}function pz(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=uz(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new xe(oe.from(r),0,0))}function mz(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),a=!1;for(let u=r.depth;u>i;u--)r.node(u).type.spec.isolating&&(a=!0);for(let u=o.depth;u>i;u--)o.node(u).type.spec.isolating&&(a=!0);if(!a){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=s4(r,o);for(let i=0;i<s.length;i++){let a=s[i],u=i==s.length-1;if(u&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),o.end(a));if(a>0&&(u||r.node(a-1).canReplace(r.index(a-1),o.indexAfter(a-1))))return t.delete(r.before(a),o.after(a))}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 s4(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 Qa 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 Ht.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 Ht.fromReplace(e,this.pos,this.pos+1,new xe(oe.from(o),0,n.isLeaf?0:1))}getMap(){return lr.empty}invert(e){return new Qa(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 Qa(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 Qa(n.pos,n.attr,n.value)}}Mn.jsonID("attr",Qa);class ac 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 Ht.ok(r)}getMap(){return lr.empty}invert(e){return new ac(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 ac(n.attr,n.value)}}Mn.jsonID("docAttr",ac);let cl=class extends Error{};cl=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};cl.prototype=Object.create(Error.prototype);cl.prototype.constructor=cl;cl.prototype.name="TransformError";class i4{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ic}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new cl(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,a,u)=>{e=Math.min(e,a),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=xe.empty){let o=Op(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new xe(oe.from(r),0,0))}delete(e,n){return this.replace(e,n,xe.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return hz(this,e,n,r),this}replaceRangeWith(e,n,r){return pz(this,e,n,r),this}deleteRange(e,n){return mz(this,e,n),this}lift(e,n){return Q7(this,e,n),this}join(e,n=1){return lz(this,e,n),this}wrap(e,n){return nz(this,e,n),this}setBlockType(e,n=e,r,o=null){return rz(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return sz(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new Qa(e,n,r)),this}setDocAttribute(e,n){return this.step(new ac(e,n)),this}addNodeMark(e,n){return this.step(new Zs(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 ut)n.isInSet(r.marks)&&this.step(new ra(e,n));else{let o=r.marks,s,i=[];for(;s=n.isInSet(o);)i.push(new ra(e,s)),o=s.removeFromSet(o);for(let a=i.length-1;a>=0;a--)this.step(i[a])}return this}split(e,n=1,r){return iz(this,e,n,r),this}addMark(e,n,r){return Z7(this,e,n,r),this}removeMark(e,n,r){return Y7(this,e,n,r),this}clearIncompatible(e,n,r){return bx(this,e,n,r),this}}const yg=Object.create(null);class Ue{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new gz(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=xe.empty){let r=n.content.lastChild,o=null;for(let a=0;a<n.openEnd;a++)o=r,r=r.lastChild;let s=e.steps.length,i=this.ranges;for(let a=0;a<i.length;a++){let{$from:u,$to:d}=i[a],h=e.mapping.slice(s);e.replaceRange(h.map(u.pos),h.map(d.pos),a?xe.empty:n),a==0&&Fw(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:a}=o[s],u=e.mapping.slice(r),d=u.map(i.pos),h=u.map(a.pos);s?e.deleteRange(d,h):(e.replaceRangeWith(d,h,n),Fw(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let o=e.parent.inlineContent?new ze(e):Ka(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?Ka(e.node(0),e.node(s),e.before(s+1),e.index(s),n,r):Ka(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 ur(e.node(0))}static atStart(e){return Ka(e,e,0,0,1)||new ur(e)}static atEnd(e){return Ka(e,e,e.content.size,e.childCount,-1)||new ur(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=yg[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 yg)throw new RangeError("Duplicate use of selection JSON ID "+e);return yg[e]=n,n.prototype.jsonID=e,n}getBookmark(){return ze.between(this.$anchor,this.$head).getBookmark()}}Ue.prototype.visible=!0;class gz{constructor(e,n){this.$from=e,this.$to=n}}let Lw=!1;function zw(t){!Lw&&!t.parent.inlineContent&&(Lw=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class ze extends Ue{constructor(e,n=e){zw(e),zw(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 Ue.near(r);let o=e.resolve(n.map(this.anchor));return new ze(o.parent.inlineContent?o:r,r)}replace(e,n=xe.empty){if(super.replace(e,n),n==xe.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof ze&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Ip(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 ze(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=Ue.findFrom(n,r,!0)||Ue.findFrom(n,-r,!0);if(s)n=s.$head;else return Ue.near(n,r)}return e.parent.inlineContent||(o==0?e=n:(e=(Ue.findFrom(e,-r,!0)||Ue.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=o<0&&(e=n))),new ze(e,n)}}Ue.jsonID("text",ze);class Ip{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Ip(e.map(this.anchor),e.map(this.head))}resolve(e){return ze.between(e.resolve(this.anchor),e.resolve(this.head))}}class Pe extends Ue{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?Ue.near(s):new Pe(s)}content(){return new xe(oe.from(this.node),0,0)}eq(e){return e instanceof Pe&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new wx(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Pe(e.resolve(n.anchor))}static create(e,n){return new Pe(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Pe.prototype.visible=!1;Ue.jsonID("node",Pe);class wx{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Ip(r,r):new wx(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&Pe.isSelectable(r)?new Pe(n):Ue.near(n)}}class ur extends Ue{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=xe.empty){if(n==xe.empty){e.delete(0,e.doc.content.size);let r=Ue.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new ur(e)}map(e){return new ur(e)}eq(e){return e instanceof ur}getBookmark(){return yz}}Ue.jsonID("all",ur);const yz={map(){return this},resolve(t){return new ur(t)}};function Ka(t,e,n,r,o,s=!1){if(e.inlineContent)return ze.create(t,n);for(let i=r-(o>0?0:1);o>0?i<e.childCount:i>=0;i+=o){let a=e.child(i);if(a.isAtom){if(!s&&Pe.isSelectable(a))return Pe.create(t,n-(o<0?a.nodeSize:0))}else{let u=Ka(t,a,n+o,o<0?a.childCount:0,o,s);if(u)return u}n+=a.nodeSize*o}return null}function Fw(t,e,n){let r=t.steps.length-1;if(r<e)return;let o=t.steps[r];if(!(o instanceof Vt||o instanceof hn))return;let s=t.mapping.maps[r],i;s.forEach((a,u,d,h)=>{i==null&&(i=h)}),t.setSelection(Ue.near(t.doc.resolve(i),n))}const $w=1,vf=2,Bw=4;class xz extends i4{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|$w)&~vf,this.storedMarks=null,this}get selectionSet(){return(this.updated&$w)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=vf,this}ensureMarks(e){return ut.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&vf)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~vf,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)||ut.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(Ue.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|=Bw,this}get scrolledIntoView(){return(this.updated&Bw)>0}}function Vw(t,e){return!e||!t?t:t.bind(e)}class wu{constructor(e,n,r){this.name=e,this.init=Vw(n.init,r),this.apply=Vw(n.apply,r)}}const vz=[new wu("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new wu("selection",{init(t,e){return t.selection||Ue.atStart(e.doc)},apply(t){return t.selection}}),new wu("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new wu("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class xg{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=vz.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 wu(r.key,r.spec.state,r))})}}class $i{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 a=this.config.plugins[i];if(a.spec.appendTransaction){let u=o?o[i].n:0,d=o?o[i].state:this,h=u<n.length&&a.spec.appendTransaction.call(a,u?n.slice(u):n,d,r);if(h&&r.filterTransaction(h,i)){if(h.setMeta("appendedTransaction",e),!o){o=[];for(let f=0;f<this.config.plugins.length;f++)o.push(f<i?{state:r,n:n.length}:{state:this,n:0})}n.push(h),r=r.applyInner(h),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 $i(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 xz(this)}static create(e){let n=new xg(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new $i(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 xg(this.schema,e.plugins),r=n.fields,o=new $i(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 xg(e.schema,e.plugins),s=new $i(o);return o.fields.forEach(i=>{if(i.name=="doc")s.doc=ei.fromJSON(e.schema,n.doc);else if(i.name=="selection")s.selection=Ue.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 a in r){let u=r[a],d=u.spec.state;if(u.key==i.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){s[i.name]=d.fromJSON.call(u,e,n[a],s);return}}s[i.name]=i.init(e,s)}}),s}}function a4(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=a4(o,e,{})),n[r]=o}return n}class Ct{constructor(e){this.spec=e,this.props={},e.props&&a4(e.props,this,this.props),this.key=e.key?e.key.key:l4("plugin")}getState(e){return e[this.key]}}const vg=Object.create(null);function l4(t){return t in vg?t+"$"+ ++vg[t]:(vg[t]=0,t+"$")}class Wt{constructor(e="key"){this.key=l4(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const u4=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function c4(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const d4=(t,e,n)=>{let r=c4(t,n);if(!r)return!1;let o=Cx(r);if(!o){let i=r.blockRange(),a=i&&_l(i);return a==null?!1:(e&&e(t.tr.lift(i,a).scrollIntoView()),!0)}let s=o.nodeBefore;if(b4(t,o,e,-1))return!0;if(r.parent.content.size==0&&(dl(s,"end")||Pe.isSelectable(s)))for(let i=r.depth;;i--){let a=Op(t.doc,r.before(i),r.after(i),xe.empty);if(a&&a.slice.size<a.to-a.from){if(e){let u=t.tr.step(a);u.setSelection(dl(s,"end")?Ue.findFrom(u.doc.resolve(u.mapping.map(o.pos,-1)),-1):Pe.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},bz=(t,e,n)=>{let r=c4(t,n);if(!r)return!1;let o=Cx(r);return o?f4(t,o,e):!1},kz=(t,e,n)=>{let r=p4(t,n);if(!r)return!1;let o=Sx(r);return o?f4(t,o,e):!1};function f4(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 h=o.lastChild;if(!h)return!1;o=h}let i=e.nodeAfter,a=i,u=e.pos+1;for(;!a.isTextblock;u++){if(a.type.spec.isolating)return!1;let h=a.firstChild;if(!h)return!1;a=h}let d=Op(t.doc,s,u,xe.empty);if(!d||d.from!=s||d instanceof Vt&&d.slice.size>=u-s)return!1;if(n){let h=t.tr.step(d);h.setSelection(ze.create(h.doc,s)),n(h.scrollIntoView())}return!0}function dl(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 h4=(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=Cx(r)}let i=s&&s.nodeBefore;return!i||!Pe.isSelectable(i)?!1:(e&&e(t.tr.setSelection(Pe.create(t.doc,s.pos-i.nodeSize)).scrollIntoView()),!0)};function Cx(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 p4(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const m4=(t,e,n)=>{let r=p4(t,n);if(!r)return!1;let o=Sx(r);if(!o)return!1;let s=o.nodeAfter;if(b4(t,o,e,1))return!0;if(r.parent.content.size==0&&(dl(s,"start")||Pe.isSelectable(s))){let i=Op(t.doc,r.before(),r.after(),xe.empty);if(i&&i.slice.size<i.to-i.from){if(e){let a=t.tr.step(i);a.setSelection(dl(s,"start")?Ue.findFrom(a.doc.resolve(a.mapping.map(o.pos)),1):Pe.create(a.doc,a.mapping.map(o.pos))),e(a.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},g4=(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=Sx(r)}let i=s&&s.nodeAfter;return!i||!Pe.isSelectable(i)?!1:(e&&e(t.tr.setSelection(Pe.create(t.doc,s.pos)).scrollIntoView()),!0)};function Sx(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 wz=(t,e)=>{let n=t.selection,r=n instanceof Pe,o;if(r){if(n.node.isTextblock||!yi(t.doc,n.from))return!1;o=n.from}else if(o=Rp(t.doc,n.from,-1),o==null)return!1;if(e){let s=t.tr.join(o);r&&s.setSelection(Pe.create(s.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},Cz=(t,e)=>{let n=t.selection,r;if(n instanceof Pe){if(n.node.isTextblock||!yi(t.doc,n.to))return!1;r=n.to}else if(r=Rp(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},Sz=(t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),s=o&&_l(o);return s==null?!1:(e&&e(t.tr.lift(o,s).scrollIntoView()),!0)},y4=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
|
|
458
|
+
`).scrollIntoView()),!0)};function Ex(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 Ez=(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=Ex(o.contentMatchAt(s));if(!i||!o.canReplaceWith(s,s,i))return!1;if(e){let a=n.after(),u=t.tr.replaceWith(a,a,i.createAndFill());u.setSelection(Ue.near(u.doc.resolve(a),1)),e(u.scrollIntoView())}return!0},x4=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof ur||r.parent.inlineContent||o.parent.inlineContent)return!1;let s=Ex(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,a=t.tr.insert(i,s.createAndFill());a.setSelection(ze.create(a.doc,i+1)),e(a.scrollIntoView())}return!0},v4=(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(ns(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),o=r&&_l(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)};function _z(t){return(e,n)=>{let{$from:r,$to:o}=e.selection;if(e.selection instanceof Pe&&e.selection.node.isBlock)return!r.parentOffset||!ns(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let s=[],i,a,u=!1,d=!1;for(let x=r.depth;;x--)if(r.node(x).isBlock){u=r.end(x)==r.pos+(r.depth-x),d=r.start(x)==r.pos-(r.depth-x),a=Ex(r.node(x-1).contentMatchAt(r.indexAfter(x-1))),s.unshift(u&&a?{type:a}:null),i=x;break}else{if(x==1)return!1;s.unshift(null)}let h=e.tr;(e.selection instanceof ze||e.selection instanceof ur)&&h.deleteSelection();let f=h.mapping.map(r.pos),m=ns(h.doc,f,s.length,s);if(m||(s[0]=a?{type:a}:null,m=ns(h.doc,f,s.length,s)),!m)return!1;if(h.split(f,s.length,s),!u&&d&&r.node(i).type!=a){let x=h.mapping.map(r.before(i)),v=h.doc.resolve(x);a&&r.node(i-1).canReplaceWith(v.index(),v.index()+1,a)&&h.setNodeMarkup(h.mapping.map(r.before(i)),a)}return n&&n(h.scrollIntoView()),!0}}const Tz=_z(),Nz=(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(Pe.create(t.doc,o))),!0)};function Az(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||yi(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function b4(t,e,n,r){let o=e.nodeBefore,s=e.nodeAfter,i,a,u=o.type.spec.isolating||s.type.spec.isolating;if(!u&&Az(t,e,n))return!0;let d=!u&&e.parent.canReplace(e.index(),e.index()+1);if(d&&(i=(a=o.contentMatchAt(o.childCount)).findWrapping(s.type))&&a.matchType(i[0]||s.type).validEnd){if(n){let x=e.pos+s.nodeSize,v=oe.empty;for(let S=i.length-1;S>=0;S--)v=oe.from(i[S].create(null,v));v=oe.from(o.copy(v));let b=t.tr.step(new hn(e.pos-1,x,e.pos,x,new xe(v,1,0),i.length,!0)),k=b.doc.resolve(x+2*i.length);k.nodeAfter&&k.nodeAfter.type==o.type&&yi(b.doc,k.pos)&&b.join(k.pos),n(b.scrollIntoView())}return!0}let h=s.type.spec.isolating||r>0&&u?null:Ue.findFrom(e,1),f=h&&h.$from.blockRange(h.$to),m=f&&_l(f);if(m!=null&&m>=e.depth)return n&&n(t.tr.lift(f,m).scrollIntoView()),!0;if(d&&dl(s,"start",!0)&&dl(o,"end")){let x=o,v=[];for(;v.push(x),!x.isTextblock;)x=x.lastChild;let b=s,k=1;for(;!b.isTextblock;b=b.firstChild)k++;if(x.canReplace(x.childCount,x.childCount,b.content)){if(n){let S=oe.empty;for(let T=v.length-1;T>=0;T--)S=oe.from(v[T].copy(S));let _=t.tr.step(new hn(e.pos-v.length,e.pos+s.nodeSize,e.pos+k,e.pos+s.nodeSize-k,new xe(S,v.length,0),0,!0));n(_.scrollIntoView())}return!0}}return!1}function k4(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(ze.create(e.doc,t<0?o.start(s):o.end(s)))),!0):!1}}const Mz=k4(-1),Dz=k4(1);function Rz(t,e=null){return function(n,r){let{$from:o,$to:s}=n.selection,i=o.blockRange(s),a=i&&kx(i,t,e);return a?(r&&r(n.tr.wrap(i,a).scrollIntoView()),!0):!1}}function Hw(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:a}}=n.selection.ranges[s];n.doc.nodesBetween(i,a,(u,d)=>{if(o)return!1;if(!(!u.isTextblock||u.hasMarkup(t,e)))if(u.type==t)o=!0;else{let h=n.doc.resolve(d),f=h.index();o=h.parent.canReplaceWith(f,f+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:a},$to:{pos:u}}=n.selection.ranges[i];s.setBlockType(a,u,t,e)}r(s.scrollIntoView())}return!0}}function _x(...t){return function(e,n,r){for(let o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}_x(u4,d4,h4);_x(u4,m4,g4);_x(y4,x4,v4,Tz);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function Oz(t,e=null){return function(n,r){let{$from:o,$to:s}=n.selection,i=o.blockRange(s);if(!i)return!1;let a=r?n.tr:null;return Iz(a,i,t,e)?(r&&r(a.scrollIntoView()),!0):!1}}function Iz(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 uh(u,u,e.depth),e.endIndex<e.parent.childCount&&(e=new uh(e.$from,i.resolve(e.$to.end(e.depth)),e.depth)),o=!0}let a=kx(s,n,r,e);return a?(t&&Pz(t,e,a,o,n),!0):!1}function Pz(t,e,n,r,o){let s=oe.empty;for(let h=n.length-1;h>=0;h--)s=oe.from(n[h].type.create(n[h].attrs,s));t.step(new hn(e.start-(r?2:0),e.end,e.start,e.end,new xe(s,0,0),n.length,!0));let i=0;for(let h=0;h<n.length;h++)n[h].type==o&&(i=h+1);let a=n.length-i,u=e.start+n.length-(r?2:0),d=e.parent;for(let h=e.startIndex,f=e.endIndex,m=!0;h<f;h++,m=!1)!m&&ns(t.doc,u,a)&&(t.split(u,a),u+=2*a),u+=d.child(h).nodeSize;return t}function jz(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?Lz(e,n,t,s):zz(e,n,s):!0:!1}}function Lz(t,e,n,r){let o=t.tr,s=r.end,i=r.$to.end(r.depth);s<i&&(o.step(new hn(s-1,i,s,i,new xe(oe.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new uh(o.doc.resolve(r.$from.pos),o.doc.resolve(i),r.depth));const a=_l(r);if(a==null)return!1;o.lift(r,a);let u=o.doc.resolve(o.mapping.map(s,-1)-1);return yi(o.doc,u.pos)&&u.nodeBefore.type==u.nodeAfter.type&&o.join(u.pos),e(o.scrollIntoView()),!0}function zz(t,e,n){let r=t.tr,o=n.parent;for(let x=n.end,v=n.endIndex-1,b=n.startIndex;v>b;v--)x-=o.child(v).nodeSize,r.delete(x-1,x+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 a=n.startIndex==0,u=n.endIndex==o.childCount,d=s.node(-1),h=s.index(-1);if(!d.canReplace(h+(a?0:1),h+1,i.content.append(u?oe.empty:oe.from(o))))return!1;let f=s.pos,m=f+i.nodeSize;return r.step(new hn(f-(a?1:0),m+(u?1:0),f+1,m-1,new xe((a?oe.empty:oe.from(o.copy(oe.empty))).append(u?oe.empty:oe.from(o.copy(oe.empty))),a?0:1,u?0:1),a?0:1)),e(r.scrollIntoView()),!0}function Fz(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 a=s.parent,u=a.child(i-1);if(u.type!=t)return!1;if(n){let d=u.lastChild&&u.lastChild.type==a.type,h=oe.from(d?t.create():null),f=new xe(oe.from(t.create(null,oe.from(a.type.create(null,h)))),d?3:1,0),m=s.start,x=s.end;n(e.tr.step(new hn(m-(d?3:1),x,m,x,f,1,!0)).scrollIntoView())}return!0}}const bn=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},fl=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let K1=null;const Go=function(t,e,n){let r=K1||(K1=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},$z=function(){K1=null},oa=function(t,e,n,r){return n&&(Uw(t,e,n,r,-1)||Uw(t,e,n,r,1))},Bz=/^(img|br|input|textarea|hr)$/i;function Uw(t,e,n,r,o){for(var s;;){if(t==n&&e==r)return!0;if(e==(o<0?0:Nr(t))){let i=t.parentNode;if(!i||i.nodeType!=1||jc(t)||Bz.test(t.nodeName)||t.contentEditable=="false")return!1;e=bn(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?Nr(t):0}else return!1}}function Nr(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Vz(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=Nr(t)}else if(t.parentNode&&!jc(t))e=bn(t),t=t.parentNode;else return null}}function Hz(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&&!jc(t))e=bn(t)+1,t=t.parentNode;else return null}}function Uz(t,e,n){for(let r=e==0,o=e==Nr(t);r||o;){if(t==n)return!0;let s=bn(t);if(t=t.parentNode,!t)return!1;r=r&&s==0,o=o&&s==Nr(t)}}function jc(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 Pp=function(t){return t.focusNode&&oa(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Fi(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function Wz(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function qz(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Nr(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Nr(r.startContainer),r.startOffset)}}}const Eo=typeof navigator<"u"?navigator:null,Ww=typeof document<"u"?document:null,xi=Eo&&Eo.userAgent||"",G1=/Edge\/(\d+)/.exec(xi),w4=/MSIE \d/.exec(xi),J1=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(xi),er=!!(w4||J1||G1),ti=w4?document.documentMode:J1?+J1[1]:G1?+G1[1]:0,Ar=!er&&/gecko\/(\d+)/i.test(xi);Ar&&+(/Firefox\/(\d+)/.exec(xi)||[0,0])[1];const Z1=!er&&/Chrome\/(\d+)/.exec(xi),wn=!!Z1,C4=Z1?+Z1[1]:0,An=!er&&!!Eo&&/Apple Computer/.test(Eo.vendor),hl=An&&(/Mobile\/\w+/.test(xi)||!!Eo&&Eo.maxTouchPoints>2),Er=hl||(Eo?/Mac/.test(Eo.platform):!1),S4=Eo?/Win/.test(Eo.platform):!1,Zo=/Android \d/.test(xi),Lc=!!Ww&&"webkitFontSmoothing"in Ww.documentElement.style,Kz=Lc?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Gz(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 Vo(t,e){return typeof t=="number"?t:t[e]}function Jz(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 qw(t,e,n){if(!Y1(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=fl(i);continue}let a=i,u=a==s.body,d=u?Gz(s):Jz(a),h=0,f=0;if(e.top<d.top+Vo(r,"top")?f=-(d.top-e.top+Vo(o,"top")):e.bottom>d.bottom-Vo(r,"bottom")&&(f=e.bottom-e.top>d.bottom-d.top?e.top+Vo(o,"top")-d.top:e.bottom-d.bottom+Vo(o,"bottom")),e.left<d.left+Vo(r,"left")?h=-(d.left-e.left+Vo(o,"left")):e.right>d.right-Vo(r,"right")&&(h=e.right-d.right+Vo(o,"right")),h||f)if(u)s.defaultView.scrollBy(h,f);else{let x=a.scrollLeft,v=a.scrollTop;f&&(a.scrollTop+=f),h&&(a.scrollLeft+=h);let b=a.scrollLeft-x,k=a.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:fl(i)}}function Zz(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 a=t.root.elementFromPoint(s,i);if(!a||a==t.dom||!t.dom.contains(a))continue;let u=a.getBoundingClientRect();if(u.top>=n-20){r=a,o=u.top;break}}return{refDOM:r,refTop:o,stack:E4(t.dom)}}function E4(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=fl(r));return e}function Yz({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;_4(n,r==0?0:r-e)}function _4(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 Ha=null;function Xz(t){if(t.setActive)return t.setActive();if(Ha)return t.focus(Ha);let e=E4(t);t.focus(Ha==null?{get preventScroll(){return Ha={preventScroll:!0},!0}}:void 0),Ha||(Ha=!1,_4(e,0))}function T4(t,e){let n,r=2e8,o,s=0,i=e.top,a=e.top,u,d;for(let h=t.firstChild,f=0;h;h=h.nextSibling,f++){let m;if(h.nodeType==1)m=h.getClientRects();else if(h.nodeType==3)m=Go(h).getClientRects();else continue;for(let x=0;x<m.length;x++){let v=m[x];if(v.top<=i&&v.bottom>=a){i=Math.max(v.bottom,i),a=Math.min(v.top,a);let b=v.left>e.left?v.left-e.left:v.right<e.left?e.left-v.right:0;if(b<r){n=h,r=b,o=b&&n.nodeType==3?{left:v.right<e.left?v.right:v.left,top:e.top}:e,h.nodeType==1&&b&&(s=f+(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=h,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=f+1)}}return!n&&u&&(n=u,o=d,r=0),n&&n.nodeType==3?Qz(n,o):!n||r&&n.nodeType==1?{node:t,offset:s}:T4(n,o)}function Qz(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=Fs(r,1);if(i.top!=i.bottom&&Tx(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 Tx(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function eF(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function tF(t,e,n){let{node:r,offset:o}=T4(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 nF(t,e,n,r){let o=-1;for(let s=e,i=!1;s!=t.dom;){let a=t.docView.nearestDesc(s,!0),u;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((u=a.dom.getBoundingClientRect()).width||u.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!i&&u.left>r.left||u.top>r.top?o=a.posBefore:(!i&&u.right<r.left||u.bottom<r.top)&&(o=a.posAfter),i=!0),!a.contentDOM&&o<0&&!a.node.isText))return(a.node.isBlock?r.top<(u.top+u.bottom)/2:r.left<(u.left+u.right)/2)?a.posBefore:a.posAfter;s=a.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,-1)}function N4(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 a=i.getClientRects();for(let u=0;u<a.length;u++){let d=a[u];if(Tx(e,d))return N4(i,e,d)}}if((s=(s+1)%r)==o)break}return t}function rF(t,e){let n=t.dom.ownerDocument,r,o=0,s=qz(n,e.left,e.top);s&&({node:r,offset:o}=s);let i=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!i||!t.dom.contains(i.nodeType!=1?i.parentNode:i)){let d=t.dom.getBoundingClientRect();if(!Tx(e,d)||(i=N4(t.dom,e,d),!i))return null}if(An)for(let d=i;r&&d;d=fl(d))d.draggable&&(r=void 0);if(i=eF(i,e),r){if(Ar&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let h=r.childNodes[o],f;h.nodeName=="IMG"&&(f=h.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&o++}let d;Lc&&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?a=t.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(a=nF(t,r,o,e))}a==null&&(a=tF(t,i,e));let u=t.docView.nearestDesc(i,!0);return{pos:a,inside:u?u.posAtStart-u.border:-1}}function Y1(t){return t.top<t.bottom||t.left<t.right}function Fs(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(Y1(r))return r}return Array.prototype.find.call(n,Y1)||t.getBoundingClientRect()}const oF=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function A4(t,e,n){let{node:r,offset:o,atom:s}=t.docView.domFromPos(e,n<0?-1:1),i=Lc||Ar;if(r.nodeType==3)if(i&&(oF.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let u=Fs(Go(r,o,o),n);if(Ar&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let d=Fs(Go(r,o-1,o-1),-1);if(d.top==u.top){let h=Fs(Go(r,o,o+1),-1);if(h.top!=u.top)return hu(h,h.left<d.left)}}return u}else{let u=o,d=o,h=n<0?1:-1;return n<0&&!o?(d++,h=-1):n>=0&&o==r.nodeValue.length?(u--,h=1):n<0?u--:d++,hu(Fs(Go(r,u,d),h),h<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&o&&(n<0||o==Nr(r))){let u=r.childNodes[o-1];if(u.nodeType==1)return bg(u.getBoundingClientRect(),!1)}if(s==null&&o<Nr(r)){let u=r.childNodes[o];if(u.nodeType==1)return bg(u.getBoundingClientRect(),!0)}return bg(r.getBoundingClientRect(),n>=0)}if(s==null&&o&&(n<0||o==Nr(r))){let u=r.childNodes[o-1],d=u.nodeType==3?Go(u,Nr(u)-(i?0:1)):u.nodeType==1&&(u.nodeName!="BR"||!u.nextSibling)?u:null;if(d)return hu(Fs(d,1),!1)}if(s==null&&o<Nr(r)){let u=r.childNodes[o];for(;u.pmViewDesc&&u.pmViewDesc.ignoreForCoords;)u=u.nextSibling;let d=u?u.nodeType==3?Go(u,0,i?0:1):u.nodeType==1?u:null:null;if(d)return hu(Fs(d,-1),!0)}return hu(Fs(r.nodeType==3?Go(r):r,-n),n>=0)}function hu(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 bg(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 M4(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 sF(t,e,n){let r=e.selection,o=n=="up"?r.$from:r.$to;return M4(t,e,()=>{let{node:s}=t.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(s,!0);if(!a)break;if(a.node.isBlock){s=a.contentDOM||a.dom;break}s=a.dom.parentNode}let i=A4(t,o.pos,1);for(let a=s.firstChild;a;a=a.nextSibling){let u;if(a.nodeType==1)u=a.getClientRects();else if(a.nodeType==3)u=Go(a,0,a.nodeValue.length).getClientRects();else continue;for(let d=0;d<u.length;d++){let h=u[d];if(h.bottom>h.top+1&&(n=="up"?i.top-h.top>(h.bottom-i.top)*2:h.bottom-i.bottom>(i.bottom-h.top)*2))return!1}}return!0})}const iF=/[\u0590-\u08ac]/;function aF(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,a=t.domSelection();return a?!iF.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?s:i:M4(t,e,()=>{let{focusNode:u,focusOffset:d,anchorNode:h,anchorOffset:f}=t.domSelectionRange(),m=a.caretBidiLevel;a.modify("move",n,"character");let x=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:v,focusOffset:b}=t.domSelectionRange(),k=v&&!x.contains(v.nodeType==1?v:v.parentNode)||u==v&&d==b;try{a.collapse(h,f),u&&(u!=h||d!=f)&&a.extend&&a.extend(u,d)}catch{}return m!=null&&(a.caretBidiLevel=m),k}):r.pos==r.start()||r.pos==r.end()}let Kw=null,Gw=null,Jw=!1;function lF(t,e,n){return Kw==e&&Gw==n?Jw:(Kw=e,Gw=n,Jw=n=="up"||n=="down"?sF(t,e,n):aF(t,e,n))}const Mr=0,Zw=1,Bi=2,Kr=3;class zc{constructor(e,n,r,o){this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=Mr,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>bn(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 a=o.children[i];if(a.size){o=a;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],a=s+i.size;if(a>e||i instanceof R4){o=e-s;break}s=a}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 D4&&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?bn(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?bn(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,a=0;;a++){let u=this.children[a],d=i+u.size;if(o==-1&&e<=d){let h=i+u.border;if(e>=h&&n<=d-u.border&&u.node&&u.contentDOM&&this.contentDOM.contains(u.contentDOM))return u.parseRange(e,n,h);e=i;for(let f=a;f>0;f--){let m=this.children[f-1];if(m.size&&m.dom.parentNode==this.contentDOM&&!m.emptyChildAt(1)){o=bn(m.dom)+1;break}e-=m.size}o==-1&&(o=0)}if(o>-1&&(d>n||a==this.children.length-1)){n=d;for(let h=a+1;h<this.children.length;h++){let f=this.children[h];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){s=bn(f.dom);break}n+=f.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 x=0,v=0;x<this.children.length;x++){let b=this.children[x],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 a=this.domFromPos(e,e?-1:1),u=n==e?a:this.domFromPos(n,n?-1:1),d=r.root.getSelection(),h=r.domSelectionRange(),f=!1;if((Ar||An)&&e==n){let{node:x,offset:v}=a;if(x.nodeType==3){if(f=!!(v&&x.nodeValue[v-1]==`
|
|
459
|
+
`),f&&v==x.nodeValue.length)for(let b=x,k;b;b=b.parentNode){if(k=b.nextSibling){k.nodeName=="BR"&&(a=u={node:k.parentNode,offset:bn(k)+1});break}let S=b.pmViewDesc;if(S&&S.node&&S.node.isBlock)break}}else{let b=x.childNodes[v-1];f=b&&(b.nodeName=="BR"||b.contentEditable=="false")}}if(Ar&&h.focusNode&&h.focusNode!=u.node&&h.focusNode.nodeType==1){let x=h.focusNode.childNodes[h.focusOffset];x&&x.contentEditable=="false"&&(o=!0)}if(!(o||f&&An)&&oa(a.node,a.offset,h.anchorNode,h.anchorOffset)&&oa(u.node,u.offset,h.focusNode,h.focusOffset))return;let m=!1;if((d.extend||e==n)&&!(f&&Ar)){d.collapse(a.node,a.offset);try{e!=n&&d.extend(u.node,u.offset),m=!0}catch{}}if(!m){if(e>n){let v=a;a=u,u=v}let x=document.createRange();x.setEnd(u.node,u.offset),x.setStart(a.node,a.offset),d.removeAllRanges(),d.addRange(x)}}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 a=r+s.border,u=i-s.border;if(e>=a&&n<=u){this.dirty=e==r||n==i?Bi:Zw,e==a&&n==u&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=Kr:s.markDirty(e-a,n-a);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?Bi:Kr}r=i}this.dirty=Bi}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Bi:Zw;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class D4 extends zc{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 a=document.createElement("span");a.appendChild(i),i=a}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==Mr&&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 uF extends zc{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 ni extends zc{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=ha.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new ni(e,n,i.dom,i.contentDOM||i.dom,i)}parseRule(){return this.dirty&Kr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Kr&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Mr){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Mr}}slice(e,n,r){let o=ni.create(this.parent,this.mark,!0,r),s=this.children,i=this.size;n<i&&(s=Q1(s,n,i,r)),e>0&&(s=Q1(s,0,e,r));for(let a=0;a<s.length;a++)s[a].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 ri extends zc{constructor(e,n,r,o,s,i,a){super(e,[],s,i),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=a}static create(e,n,r,o,s,i){let a=s.nodeViews[n.type.name],u,d=a&&a(n,s,()=>{if(!u)return i;if(u.parent)return u.parent.posBeforeChild(u)},r,o),h=d&&d.dom,f=d&&d.contentDOM;if(n.isText){if(!h)h=document.createTextNode(n.text);else if(h.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else h||({dom:h,contentDOM:f}=ha.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!f&&!n.isText&&h.nodeName!="BR"&&(h.hasAttribute("contenteditable")||(h.contentEditable="false"),n.type.spec.draggable&&(h.draggable=!0));let m=h;return h=P4(h,r,n),d?u=new cF(e,n,r,o,h,f||null,m,d):n.isText?new jp(e,n,r,o,h,m):new ri(e,n,r,o,h,f||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=()=>oe.empty}}return n}matchesNode(e,n,r){return this.dirty==Mr&&e.eq(this.node)&&dh(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,a=s&&s.pos<0,u=new fF(this,i&&i.node,e);mF(this.node,this.innerDeco,(d,h,f)=>{d.spec.marks?u.syncToMarks(d.spec.marks,r,e,h):d.type.side>=0&&!f&&u.syncToMarks(h==this.node.childCount?ut.none:this.node.child(h).marks,r,e,h),u.placeWidget(d,e,o)},(d,h,f,m)=>{u.syncToMarks(d.marks,r,e,m);let x;u.findNodeMatch(d,h,f,m)||a&&e.state.selection.from>o&&e.state.selection.to<o+d.nodeSize&&(x=u.findIndexWithChild(s.node))>-1&&u.updateNodeAt(d,h,f,x,e)||u.updateNextNode(d,h,f,e,m,o)||u.addNode(d,h,f,e,o),o+=d.nodeSize}),u.syncToMarks([],r,e,0),this.node.isTextblock&&u.addTextblockHacks(),u.destroyRest(),(u.changed||this.dirty==Bi)&&(i&&this.protectLocalComposition(e,i),O4(this.contentDOM,this.children,e),hl&&gF(this.dom))}localCompositionInfo(e,n){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof ze)||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,a=yF(this.node.content,i,r-n,o-n);return a<0?null:{node:s,pos:a,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 uF(this,s,n,o);e.input.compositionNodes.push(i),this.children=Q1(this.children,r,r+o.length,e,i)}update(e,n,r,o){return this.dirty==Kr||!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=Mr}updateOuterDeco(e){if(dh(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=I4(this.dom,this.nodeDOM,X1(this.outerDeco,this.node,n),X1(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 Yw(t,e,n,r,o){P4(r,e,t);let s=new ri(void 0,t,e,n,r,r,r);return s.contentDOM&&s.updateChildren(o,0),s}class jp extends ri{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==Kr||this.dirty!=Mr&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Mr||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=Mr,!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 jp(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=Kr)}get domAtom(){return!1}isText(e){return this.node.text==e}}class R4 extends zc{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Mr&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class cF extends ri{constructor(e,n,r,o,s,i,a,u){super(e,n,r,o,s,i,a),this.spec=u}update(e,n,r,o){if(this.dirty==Kr)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 O4(t,e,n){let r=t.firstChild,o=!1;for(let s=0;s<e.length;s++){let i=e[s],a=i.dom;if(a.parentNode==t){for(;a!=r;)r=Xw(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(a,r);if(i instanceof ni){let u=r?r.previousSibling:t.lastChild;O4(i.contentDOM,i.children,n),r=u?u.nextSibling:t.firstChild}}for(;r;)r=Xw(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}const Nu=function(t){t&&(this.nodeName=t)};Nu.prototype=Object.create(null);const Vi=[new Nu];function X1(t,e,n){if(t.length==0)return Vi;let r=n?Vi[0]:new Nu,o=[r];for(let s=0;s<t.length;s++){let i=t[s].type.attrs;if(i){i.nodeName&&o.push(r=new Nu(i.nodeName));for(let a in i){let u=i[a];u!=null&&(n&&o.length==1&&o.push(r=new Nu(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+u:a=="style"?r.style=(r.style?r.style+";":"")+u:a!="nodeName"&&(r[a]=u))}}}return o}function I4(t,e,n,r){if(n==Vi&&r==Vi)return e;let o=e;for(let s=0;s<r.length;s++){let i=r[s],a=n[s];if(s){let u;a&&a.nodeName==i.nodeName&&o!=t&&(u=o.parentNode)&&u.nodeName.toLowerCase()==i.nodeName||(u=document.createElement(i.nodeName),u.pmIsDeco=!0,u.appendChild(o),a=Vi[0]),o=u}dF(o,a||Vi[0],i)}return o}function dF(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 P4(t,e,n){return I4(t,t,Vi,X1(e,n,t.nodeType!=1))}function dh(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 Xw(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class fF{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=hF(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,a=Math.min(i,e.length);for(;s<a&&(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=Mr,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 h=this.index;h<d;h++){let f=this.top.children[h];if(f.matchesMark(e[i])&&!this.isLocked(f.dom)){u=h;break}}if(u<0&&this.index<this.top.children.length){let h=this.top.children[this.index];h instanceof ni&&h.dirty!=Kr&&h.mark.type==e[i].type&&h.spec.update&&!this.isLocked(h.dom)&&h.spec.update(e[i])&&(h.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 h=ni.create(this.top,e[i],n,r);this.top.children.splice(this.index,0,h),this.top=h,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 a=this.index,u=Math.min(this.top.children.length,a+5);a<u;a++){let d=this.top.children[a];if(d.matchesNode(e,n,r)&&!this.preMatch.matched.has(d)){s=a;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==Kr&&i.dom==i.contentDOM&&(i.dirty=Bi),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 a=this.index;a<this.top.children.length;a++){let u=this.top.children[a];if(u instanceof ri){let d=this.preMatch.matched.get(u);if(d!=null&&d!=s)return!1;let h=u.dom,f,m=this.isLocked(h)&&!(e.isText&&u.node&&u.node.isText&&u.nodeDOM.nodeValue==e.text&&u.dirty!=Kr&&dh(n,u.outerDeco));if(!m&&u.update(e,n,r,o))return this.destroyBetween(this.index,a),u.dom!=h&&(this.changed=!0),this.index++,!0;if(!m&&(f=this.recreateWrapper(u,e,n,r,o,i)))return this.destroyBetween(this.index,a),this.top.children[this.index]=f,f.contentDOM&&(f.dirty=Bi,f.updateChildren(o,i+1),f.dirty=Mr),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)||!dh(r,e.outerDeco)||!o.eq(e.innerDeco))return null;let a=ri.create(this.top,n,r,o,s,i);if(a.contentDOM){a.children=e.children,e.children=[];for(let u of a.children)u.parent=a}return e.destroy(),a}addNode(e,n,r,o,s){let i=ri.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 D4(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 ni;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof jp)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((An||wn)&&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 R4(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 hF(t,e){let n=e,r=n.children.length,o=t.childCount,s=new Map,i=[];e:for(;o>0;){let a;for(;;)if(r){let d=n.children[r-1];if(d instanceof ni)n=d,r=d.children.length;else{a=d,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let u=a.node;if(u){if(u!=t.child(o-1))break;--o,s.set(a,o),i.push(a)}}return{index:o,matched:s,matches:i.reverse()}}function pF(t,e){return t.type.side-e.type.side}function mF(t,e,n,r){let o=e.locals(t),s=0;if(o.length==0){for(let d=0;d<t.childCount;d++){let h=t.child(d);r(h,o,e.forChild(s,h),d),s+=h.nodeSize}return}let i=0,a=[],u=null;for(let d=0;;){let h,f;for(;i<o.length&&o[i].to==s;){let k=o[i++];k.widget&&(h?(f||(f=[h])).push(k):h=k)}if(h)if(f){f.sort(pF);for(let k=0;k<f.length;k++)n(f[k],d,!!u)}else n(h,d,!!u);let m,x;if(u)x=-1,m=u,u=null;else if(d<t.childCount)x=d,m=t.child(d++);else break;for(let k=0;k<a.length;k++)a[k].to<=s&&a.splice(k--,1);for(;i<o.length&&o[i].from<=s&&o[i].to>s;)a.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 S=0;S<a.length;S++)a[S].to<k&&(k=a[S].to);k<v&&(u=m.cut(k-s),m=m.cut(0,k-s),v=k,x=-1)}else for(;i<o.length&&o[i].to<v;)i++;let b=m.isInline&&!m.isLeaf?a.filter(k=>!k.inline):a.slice();r(m,b,e.forChild(s,m),x),s=v}}function gF(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 yF(t,e,n,r){for(let o=0,s=0;o<t.childCount&&s<=r;){let i=t.child(o++),a=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-a,r-a)==e)return r-e.length;let d=a<r?u.lastIndexOf(e,r-a-1):-1;if(d>=0&&d+e.length+a>=n)return a+d;if(n==r&&u.length>=r+e.length-a&&u.slice(r-a,r-a+e.length)==e)return r}}return-1}function Q1(t,e,n,r,o){let s=[];for(let i=0,a=0;i<t.length;i++){let u=t[i],d=a,h=a+=u.size;d>=n||h<=e?s.push(u):(d<e&&s.push(u.slice(0,e-d,r)),o&&(s.push(o),o=void 0),h>n&&s.push(u.slice(n-d,u.size,r)))}return s}function Nx(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 a=r.resolve(i),u,d;if(Pp(n)){for(u=i;o&&!o.node;)o=o.parent;let f=o.node;if(o&&f.isAtom&&Pe.isSelectable(f)&&o.parent&&!(f.isInline&&Uz(n.focusNode,n.focusOffset,o.dom))){let m=o.posBefore;d=new Pe(i==m?a:r.resolve(m))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let f=i,m=i;for(let x=0;x<n.rangeCount;x++){let v=n.getRangeAt(x);f=Math.min(f,t.docView.posFromDOM(v.startContainer,v.startOffset,1)),m=Math.max(m,t.docView.posFromDOM(v.endContainer,v.endOffset,-1))}if(f<0)return null;[u,i]=m==t.state.selection.anchor?[m,f]:[f,m],a=r.resolve(i)}else u=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(u<0)return null}let h=r.resolve(u);if(!d){let f=e=="pointer"||t.state.selection.head<a.pos&&!s?1:-1;d=Ax(t,h,a,f)}return d}function j4(t){return t.editable?t.hasFocus():z4(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function rs(t,e=!1){let n=t.state.selection;if(L4(t,n),!j4(t))return;let r=t.input.mouseDown;if(!e&&wn&&r){let o=t.domSelectionRange(),s=t.domObserver.currentSelection;if(o.anchorNode&&s.anchorNode&&oa(o.anchorNode,o.anchorOffset,s.anchorNode,s.anchorOffset)&&r.delaySelUpdate()){t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)vF(t);else{let{anchor:o,head:s}=n,i,a;Qw&&!(n instanceof ze)&&(n.$from.parent.inlineContent||(i=eC(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=eC(t,n.to))),t.docView.setSelection(o,s,t,e),Qw&&(i&&tC(i),a&&tC(a)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&xF(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}const Qw=An||wn&&C4<63;function eC(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(An&&o&&o.contentEditable=="false")return kg(o);if((!o||o.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(o)return kg(o);if(s)return kg(s)}}function kg(t){return t.contentEditable="true",An&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function tC(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function xF(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(()=>{(!j4(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function vF(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,bn(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&er&&ti<=11&&(n.disabled=!0,n.disabled=!1)}function L4(t,e){if(e instanceof Pe){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(nC(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else nC(t)}function nC(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Ax(t,e,n,r){return t.someProp("createSelectionBetween",o=>o(t,e,n))||ze.between(e,n,r)}function rC(t){return t.editable&&!t.hasFocus()?!1:z4(t)}function z4(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 bF(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return oa(e.node,e.offset,n.anchorNode,n.anchorOffset)}function ey(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&&Ue.findFrom(s,e)}function Bs(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function oC(t,e,n){let r=t.state.selection;if(r instanceof ze)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 Bs(t,new ze(r.$anchor,i))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let o=ey(t.state,e);return o&&o instanceof Pe?Bs(t,o):!1}else if(!(Er&&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 a=e<0?o.pos-s.nodeSize:o.pos;return s.isAtom||(i=t.docView.descAt(a))&&!i.contentDOM?Pe.isSelectable(s)?Bs(t,new Pe(e<0?t.state.doc.resolve(o.pos-s.nodeSize):o)):Lc?Bs(t,new ze(t.state.doc.resolve(e<0?a:a+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Pe&&r.node.isInline)return Bs(t,new ze(e>0?r.$to:r.$from));{let o=ey(t.state,e);return o?Bs(t,o):!1}}}function fh(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Au(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Ua(t,e){return e<0?kF(t):wF(t)}function kF(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,s,i=!1;for(Ar&&n.nodeType==1&&r<fh(n)&&Au(n.childNodes[r],-1)&&(i=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(Au(a,-1))o=n,s=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(F4(n))break;{let a=n.previousSibling;for(;a&&Au(a,-1);)o=n.parentNode,s=bn(a),a=a.previousSibling;if(a)n=a,r=fh(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}i?ty(t,n,r):o&&ty(t,o,s)}function wF(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o=fh(n),s,i;for(;;)if(r<o){if(n.nodeType!=1)break;let a=n.childNodes[r];if(Au(a,1))s=n,i=++r;else break}else{if(F4(n))break;{let a=n.nextSibling;for(;a&&Au(a,1);)s=a.parentNode,i=bn(a)+1,a=a.nextSibling;if(a)n=a,r=0,o=fh(n);else{if(n=n.parentNode,n==t.dom)break;r=o=0}}}s&&ty(t,s,i)}function F4(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function CF(t,e){for(;t&&e==t.childNodes.length&&!jc(t);)e=bn(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 SF(t,e){for(;t&&!e&&!jc(t);)e=bn(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 ty(t,e,n){if(e.nodeType!=3){let s,i;(i=CF(e,n))?(e=i,n=0):(s=SF(e,n))&&(e=s,n=s.nodeValue.length)}let r=t.domSelection();if(!r)return;if(Pp(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&&rs(t)},50)}function sC(t,e){let n=t.state.doc.resolve(e);if(!(wn||S4)&&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 iC(t,e,n){let r=t.state.selection;if(r instanceof ze&&!r.empty||n.indexOf("s")>-1||Er&&n.indexOf("m")>-1)return!1;let{$from:o,$to:s}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let i=ey(t.state,e);if(i&&i instanceof Pe)return Bs(t,i)}if(!o.parent.inlineContent){let i=e<0?o:s,a=r instanceof ur?Ue.near(i,e):Ue.findFrom(i,e);return a?Bs(t,a):!1}return!1}function aC(t,e){if(!(t.state.selection instanceof ze))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 lC(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function EF(t){if(!An||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;lC(t,r,"true"),setTimeout(()=>lC(t,r,"false"),20)}return!1}function _F(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function TF(t,e){let n=e.keyCode,r=_F(e);if(n==8||Er&&n==72&&r=="c")return aC(t,-1)||Ua(t,-1);if(n==46&&!e.shiftKey||Er&&n==68&&r=="c")return aC(t,1)||Ua(t,1);if(n==13||n==27)return!0;if(n==37||Er&&n==66&&r=="c"){let o=n==37?sC(t,t.state.selection.from)=="ltr"?-1:1:-1;return oC(t,o,r)||Ua(t,o)}else if(n==39||Er&&n==70&&r=="c"){let o=n==39?sC(t,t.state.selection.from)=="ltr"?1:-1:1;return oC(t,o,r)||Ua(t,o)}else{if(n==38||Er&&n==80&&r=="c")return iC(t,-1,r)||Ua(t,-1);if(n==40||Er&&n==78&&r=="c")return EF(t)||iC(t,1,r)||Ua(t,1);if(r==(Er?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Mx(t,e){t.someProp("transformCopied",x=>{e=x(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 x=r.firstChild;n.push(x.type.name,x.attrs!=x.type.defaultAttrs?x.attrs:null),r=x.content}let i=t.someProp("clipboardSerializer")||ha.fromSchema(t.state.schema),a=W4(),u=a.createElement("div");u.appendChild(i.serializeFragment(r,{document:a}));let d=u.firstChild,h,f=0;for(;d&&d.nodeType==1&&(h=U4[d.nodeName.toLowerCase()]);){for(let x=h.length-1;x>=0;x--){let v=a.createElement(h[x]);for(;u.firstChild;)v.appendChild(u.firstChild);u.appendChild(v),f++}d=u.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${o} ${s}${f?` -${f}`:""} ${JSON.stringify(n)}`);let m=t.someProp("clipboardTextSerializer",x=>x(e,t))||e.content.textBetween(0,e.content.size,`
|
|
460
|
+
|
|
461
|
+
`);return{dom:u,text:m,slice:e}}function $4(t,e,n,r,o){let s=o.parent.type.spec.code,i,a;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 a=new xe(oe.from(t.state.schema.text(e.replace(/\r\n?/g,`
|
|
462
|
+
`))),0,0),t.someProp("transformPasted",m=>{a=m(a,t,!0)}),a;let f=t.someProp("clipboardTextParser",m=>m(e,o,r,t));if(f)a=f;else{let m=o.marks(),{schema:x}=t.state,v=ha.fromSchema(x);i=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(b=>{let k=i.appendChild(document.createElement("p"));b&&k.appendChild(v.serializeNode(x.text(b,m)))})}}else t.someProp("transformPastedHTML",f=>{n=f(n,t)}),i=DF(n),Lc&&RF(i);let d=i&&i.querySelector("[data-pm-slice]"),h=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(h&&h[3])for(let f=+h[3];f>0;f--){let m=i.firstChild;for(;m&&m.nodeType!=1;)m=m.nextSibling;if(!m)break;i=m}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||ts.fromSchema(t.state.schema)).parseSlice(i,{preserveWhitespace:!!(u||h),context:o,ruleFromNode(m){return m.nodeName=="BR"&&!m.nextSibling&&m.parentNode&&!NF.test(m.parentNode.nodeName)?{ignore:!0}:null}})),h)a=OF(uC(a,+h[1],+h[2]),h[4]);else if(a=xe.maxOpen(AF(a.content,o),!0),a.openStart||a.openEnd){let f=0,m=0;for(let x=a.content.firstChild;f<a.openStart&&!x.type.spec.isolating;f++,x=x.firstChild);for(let x=a.content.lastChild;m<a.openEnd&&!x.type.spec.isolating;m++,x=x.lastChild);a=uC(a,f,m)}return t.someProp("transformPasted",f=>{a=f(a,t,u)}),a}const NF=/^(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 AF(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(a=>{if(!i)return;let u=o.findWrapping(a.type),d;if(!u)return i=null;if(d=i.length&&s.length&&V4(u,s,a,i[i.length-1],0))i[i.length-1]=d;else{i.length&&(i[i.length-1]=H4(i[i.length-1],s.length));let h=B4(a,u);i.push(h),o=o.matchType(h.type),s=u}}),i)return oe.from(i)}return t}function B4(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,oe.from(t));return t}function V4(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let s=V4(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(oe.from(B4(n,t,o+1))))}}function H4(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,H4(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(oe.empty,!0);return t.copy(n.append(r))}function ny(t,e,n,r,o,s){let i=e<0?t.firstChild:t.lastChild,a=i.content;return t.childCount>1&&(s=0),o<r-1&&(a=ny(a,e,n,r,o+1,s)),o>=n&&(a=e<0?i.contentMatchAt(0).fillBefore(a,s<=o).append(a):a.append(i.contentMatchAt(i.childCount).fillBefore(oe.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,i.copy(a))}function uC(t,e,n){return e<t.openStart&&(t=new xe(ny(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new xe(ny(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const U4={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 W4(){return document.implementation.createHTMLDocument("title")}let wg=null;function MF(t){let e=window.trustedTypes;return e?(wg||(wg=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),wg.createHTML(t)):t}function DF(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=W4(),r=n.body,o=/<([a-z][^>\s]+)/i.exec(t),s;if((s=o&&U4[o[1].toLowerCase()])&&(t=s.map(i=>"<"+i+">").join("")+t+s.map(i=>"</"+i+">").reverse().join("")),r.innerHTML=MF(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 a=n.styleSheets[i];for(let u=0;u<a.rules.length;u++){let d=a.rules[u];if(d instanceof CSSStyleRule){let h=r.querySelectorAll(d.selectorText);for(let f=0;f<h.length;f++)h[f].style.cssText+=d.style.cssText}}}return r}function RF(t){let e=t.querySelectorAll(wn?"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 OF(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 a=r.length-2;a>=0;a-=2){let u=n.nodes[r[a]];if(!u||u.hasRequiredAttrs())break;o=oe.from(u.create(r[a+1],o)),s++,i++}return new xe(o,s,i)}const Ln={},zn={},IF={touchstart:!0,touchmove:!0};class PF{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 jF(t){for(let e in Ln){let n=Ln[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{zF(t,r)&&!Dx(t,r)&&(t.editable||!(r.type in zn))&&n(t,r)},IF[e]?{passive:!0}:void 0)}An&&t.dom.addEventListener("input",()=>null),ry(t)}function Yo(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function LF(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 ry(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Dx(t,r))})}function Dx(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function zF(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 FF(t,e){!Dx(t,e)&&Ln[e.type]&&(t.editable||!(e.type in zn))&&Ln[e.type](t,e)}zn.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(),!(Zo&&wn&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),hl&&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,Fi(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||TF(t,n)?n.preventDefault():Yo(t,"key")};zn.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};zn.keypress=(t,e)=>{let n=e;if(J4(t)||!n.charCode||n.ctrlKey&&!n.altKey||Er&&n.metaKey)return;if(t.someProp("handleKeyPress",o=>o(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof ze)||!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 Fc(t){return{left:t.clientX,top:t.clientY}}function $F(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Rx(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,a=>i>s.depth?a(t,n,s.nodeAfter,s.before(i),o,!0):a(t,n,s.node(i),s.before(i),o,!1)))return!0;return!1}function $c(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 BF(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&Pe.isSelectable(r)?($c(t,new Pe(n)),!0):!1}function VF(t,e){if(e==-1)return!1;let n=t.state.selection,r,o;n instanceof Pe&&(r=n.node);let s=t.state.doc.resolve(e);for(let i=s.depth+1;i>0;i--){let a=i>s.depth?s.nodeAfter:s.node(i);if(Pe.isSelectable(a)){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?($c(t,Pe.create(t.state.doc,o)),!0):!1}function HF(t,e,n,r,o){return Rx(t,"handleClickOn",e,n,r)||t.someProp("handleClick",s=>s(t,e,r))||(o?VF(t,n):BF(t,n))}function UF(t,e,n,r){return Rx(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",o=>o(t,e,r))}function WF(t,e,n,r){return Rx(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",o=>o(t,e,r))||qF(t,n,r)}function qF(t,e,n){if(n.button!=0)return!1;let r=q4(t,e,!0),o=t.state.doc;return r?($c(t,r),r instanceof ze&&o.eq(t.state.doc)&&(t.input.mouseDown=new GF(t,r)),!0):!1}function q4(t,e,n){let r=t.state.doc;if(e==-1)return r.inlineContent?ze.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),a=o.before(s);if(i.inlineContent)return ze.create(r,a+1,a+1+i.content.size);if(n&&Pe.isSelectable(i))return Pe.create(r,a)}return null}function Ox(t){return hh(t)}const K4=Er?"metaKey":"ctrlKey";Ln.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Ox(t),o=Date.now(),s="singleClick";o-t.input.lastClick.time<500&&$F(n,t.input.lastClick)&&!n[K4]&&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(Fc(n));i&&(s=="singleClick"?t.input.mouseDown=new KF(t,i,n,!!r):(s=="doubleClick"?UF:WF)(t,i.pos,i.inside,n)?n.preventDefault():Yo(t,"pointer"))};class G4{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 KF extends G4{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[K4],this.allowDefault=r.shiftKey;let s,i;if(n.inside>-1)s=e.state.doc.nodeAt(n.inside),i=n.inside;else{let h=e.state.doc.resolve(n.pos);s=h.parent,i=h.depth?h.before():0}const a=o?null:r.target,u=a?e.docView.nearestDesc(a,!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 Pe&&d.from<=i&&d.to>i)&&(this.mightDrag={node:s,pos:i,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Ar&&!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()),Yo(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||rs(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(Fc(e))),this.updateAllowDefault(e),this.allowDefault||!n?Yo(this.view,"pointer"):HF(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||An&&this.mightDrag&&!this.mightDrag.node.isAtom||wn&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?($c(this.view,Ue.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Yo(this.view,"pointer")}move(e){this.updateAllowDefault(e),Yo(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 GF extends G4{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(),Yo(this.view,"pointer");let n=this.view.posAtCoords(Fc(e)),r=n&&q4(this.view,n.inside,!1);if(!r)return;let{doc:o}=this.view.state,s=this.startSelection,[i,a]=r.from<s.from?[s.to,r.from]:[s.from,r.to];$c(this.view,ze.create(o,i,a))}}Ln.touchstart=t=>{t.input.lastTouch=Date.now(),Ox(t),Yo(t,"pointer")};Ln.touchmove=t=>{t.input.lastTouch=Date.now(),Yo(t,"pointer")};Ln.contextmenu=t=>Ox(t);function J4(t,e){return t.composing?!0:An&&Math.abs(Date.now()-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const JF=Zo?5e3:-1;zn.compositionstart=zn.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof ze&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||wn&&S4&&ZF(t)))t.markCursor=t.state.storedMarks||n.marks(),hh(t,!0),t.markCursor=null;else if(hh(t,!e.selection.empty),Ar&&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 a=t.domSelection();a&&a.collapse(i,i.nodeValue.length);break}else o=i,s=-1}}t.input.composing=!0}Z4(t,JF)};function ZF(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"}zn.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++,Z4(t,20))};function Z4(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>hh(t),e))}function Y4(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function YF(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=Vz(e.focusNode,e.focusOffset),r=Hz(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 hh(t,e=!1){if(!(Zo&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Y4(t),e||t.docView&&t.docView.dirty){let n=Nx(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 XF(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 lc=er&&ti<15||hl&&Kz<604;Ln.copy=zn.cut=(t,e)=>{let n=e,r=t.state.selection,o=n.type=="cut";if(r.empty)return;let s=lc?null:n.clipboardData,i=r.content(),{dom:a,text:u}=Mx(t,i);s?(n.preventDefault(),s.clearData(),s.setData("text/html",a.innerHTML),s.setData("text/plain",u)):XF(t,a),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function QF(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function e$(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?uc(t,r.value,null,o,e):uc(t,r.textContent,r.innerHTML,o,e)},50)}function uc(t,e,n,r,o){let s=$4(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",u=>u(t,o,s||xe.empty)))return!0;if(!s)return!1;let i=QF(s),a=i?t.state.tr.replaceSelectionWith(i,r):t.state.tr.replaceSelection(s);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function X4(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," "):""}zn.paste=(t,e)=>{let n=e;if(t.composing&&!Zo)return;let r=lc?null:n.clipboardData,o=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&uc(t,X4(r),r.getData("text/html"),o,n)?n.preventDefault():e$(t,n)};class Q4{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const t$=Er?"altKey":"ctrlKey";function e6(t,e){let n;return t.someProp("dragCopies",r=>{n=n||r(e)}),n!=null?!n:!e[t$]}Ln.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(Fc(n)),i;if(!(s&&s.pos>=o.from&&s.pos<=(o instanceof Pe?o.to-1:o.to))){if(r&&r.mightDrag)i=Pe.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=t.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(i=Pe.create(t.state.doc,f.posBefore))}}let a=(i||t.state.selection).content(),{dom:u,text:d,slice:h}=Mx(t,a);(!n.dataTransfer.files.length||!wn||C4>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(lc?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",lc||n.dataTransfer.setData("text/plain",d),t.dragging=new Q4(h,e6(t,n),i)};Ln.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};zn.dragover=zn.dragenter=(t,e)=>e.preventDefault();zn.drop=(t,e)=>{try{n$(t,e,t.dragging)}finally{t.dragging=null}};function n$(t,e,n){if(!e.dataTransfer)return;let r=t.posAtCoords(Fc(e));if(!r)return;let o=t.state.doc.resolve(r.pos),s=n&&n.slice;s?t.someProp("transformPasted",x=>{s=x(s,t,!1)}):s=$4(t,X4(e.dataTransfer),lc?null:e.dataTransfer.getData("text/html"),!1,o);let i=!!(n&&e6(t,e));if(t.someProp("handleDrop",x=>x(t,e,s||xe.empty,i))){e.preventDefault();return}if(!s)return;e.preventDefault();let a=s?t4(t.state.doc,o.pos,s):o.pos;a==null&&(a=o.pos);let u=t.state.tr;if(i){let{node:x}=n;x?x.replace(u):u.deleteSelection()}let d=u.mapping.map(a),h=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=u.doc;if(h?u.replaceRangeWith(d,d,s.content.firstChild):u.replaceRange(d,d,s),u.doc.eq(f))return;let m=u.doc.resolve(d);if(h&&Pe.isSelectable(s.content.firstChild)&&m.nodeAfter&&m.nodeAfter.sameMarkup(s.content.firstChild))u.setSelection(new Pe(m));else{let x=u.mapping.map(a);u.mapping.maps[u.mapping.maps.length-1].forEach((v,b,k,S)=>x=S),u.setSelection(Ax(t,m,u.doc.resolve(x)))}t.focus(),t.dispatch(u.setMeta("uiEvent","drop"))}Ln.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())&&rs(t)},20))};Ln.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)};Ln.beforeinput=(t,e)=>{if(Zo&&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,Fi(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 zn)Ln[t]=zn[t];function cc(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 ph{constructor(e,n){this.toDOM=e,this.spec=n||Gi,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 jn(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof ph&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&cc(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class oi{constructor(e,n){this.attrs=e,this.spec=n||Gi}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 jn(s,i,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof oi&&cc(this.attrs,e.attrs)&&cc(this.spec,e.spec)}static is(e){return e.type instanceof oi}destroy(){}}class Ix{constructor(e,n){this.attrs=e,this.spec=n||Gi}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 jn(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 Ix&&cc(this.attrs,e.attrs)&&cc(this.spec,e.spec)}destroy(){}}class jn{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new jn(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 jn(e,e,new ph(n,r))}static inline(e,n,r,o){return new jn(e,n,new oi(r,o))}static node(e,n,r,o){return new jn(e,n,new Ix(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof oi}get widget(){return this.type instanceof ph}}const Ga=[],Gi={};class xt{constructor(e,n){this.local=e.length?e:Ga,this.children=n.length?n:Ga}static create(e,n){return n.length?mh(n,e,0,Gi):Nn}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 a=this.local[i];a.from<=n&&a.to>=e&&(!s||s(a.spec))&&r.push(a.copy(a.from+o,a.to+o))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<n&&this.children[i+1]>e){let a=this.children[i]+1;this.children[i+2].findInner(e-a,n-a,r,o+a,s)}}map(e,n,r){return this==Nn||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Gi)}mapInner(e,n,r,o,s){let i;for(let a=0;a<this.local.length;a++){let u=this.local[a].map(e,r,o);u&&u.type.valid(n,u)?(i||(i=[])).push(u):s.onRemove&&s.onRemove(this.local[a].spec)}return this.children.length?r$(this.children,i||[],e,n,r,o,s):i?new xt(i.sort(Ji),Ga):Nn}add(e,n){return n.length?this==Nn?xt.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let o,s=0;e.forEach((a,u)=>{let d=u+r,h;if(h=n6(n,a,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(a,h,d+1):o.splice(s,0,u,u+a.nodeSize,mh(h,a,d+1,Gi)),s+=3}});let i=t6(s?r6(n):n,-r);for(let a=0;a<i.length;a++)i[a].type.valid(e,i[a])||i.splice(a--,1);return new xt(i.length?this.local.concat(i).sort(Ji):this.local,o||this.children)}remove(e){return e.length==0||this==Nn?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,a=r[s]+n,u=r[s+1]+n;for(let h=0,f;h<e.length;h++)(f=e[h])&&f.from>a&&f.to<u&&(e[h]=null,(i||(i=[])).push(f));if(!i)continue;r==this.children&&(r=this.children.slice());let d=r[s+2].removeInner(i,a+1);d!=Nn?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 a=0;a<o.length;a++)o[a].eq(i,n)&&(o==this.local&&(o=this.local.slice()),o.splice(a--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new xt(o,r):Nn}forChild(e,n){if(this==Nn)return this;if(n.isLeaf)return xt.empty;let r,o;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let s=e+1,i=s+n.content.size;for(let a=0;a<this.local.length;a++){let u=this.local[a];if(u.from<i&&u.to>s&&u.type instanceof oi){let d=Math.max(s,u.from)-s,h=Math.min(i,u.to)-s;d<h&&(o||(o=[])).push(u.copy(d,h))}}if(o){let a=new xt(o.sort(Ji),Ga);return r?new Ks([a,r]):a}return r||Nn}eq(e){if(this==e)return!0;if(!(e instanceof xt)||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 Px(this.localsInner(e))}localsInner(e){if(this==Nn)return Ga;if(e.inlineContent||!this.local.some(oi.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof oi||n.push(this.local[r]);return n}forEachSet(e){e(this)}}xt.empty=new xt([],[]);xt.removeOverlap=Px;const Nn=xt.empty;class Ks{constructor(e){this.members=e}map(e,n){const r=this.members.map(o=>o.map(e,n,Gi));return Ks.from(r)}forChild(e,n){if(n.isLeaf)return xt.empty;let r=[];for(let o=0;o<this.members.length;o++){let s=this.members[o].forChild(e,n);s!=Nn&&(s instanceof Ks?r=r.concat(s.members):r.push(s))}return Ks.from(r)}eq(e){if(!(e instanceof Ks)||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?Px(r?n:n.sort(Ji)):Ga}static from(e){switch(e.length){case 0:return Nn;case 1:return e[0];default:return new Ks(e.every(n=>n instanceof xt)?e:e.reduce((n,r)=>n.concat(r instanceof xt?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function r$(t,e,n,r,o,s,i){let a=t.slice();for(let d=0,h=s;d<n.maps.length;d++){let f=0;n.maps[d].forEach((m,x,v,b)=>{let k=b-v-(x-m);for(let S=0;S<a.length;S+=3){let _=a[S+1];if(_<0||m>_+h-f)continue;let T=a[S]+h-f;x>=T?a[S+1]=m<=T?-2:-1:m>=h&&k&&(a[S]+=k,a[S+1]+=k)}f+=k}),h=n.maps[d].map(h,-1)}let u=!1;for(let d=0;d<a.length;d+=3)if(a[d+1]<0){if(a[d+1]==-2){u=!0,a[d+1]=-1;continue}let h=n.map(t[d]+s),f=h-o;if(f<0||f>=r.content.size){u=!0;continue}let m=n.map(t[d+1]+s,-1),x=m-o,{index:v,offset:b}=r.content.findIndex(f),k=r.maybeChild(v);if(k&&b==f&&b+k.nodeSize==x){let S=a[d+2].mapInner(n,k,h+1,t[d]+s+1,i);S!=Nn?(a[d]=f,a[d+1]=x,a[d+2]=S):(a[d+1]=-2,u=!0)}else u=!0}if(u){let d=o$(a,t,e,n,o,s,i),h=mh(d,r,0,i);e=h.local;for(let f=0;f<a.length;f+=3)a[f+1]<0&&(a.splice(f,3),f-=3);for(let f=0,m=0;f<h.children.length;f+=3){let x=h.children[f];for(;m<a.length&&a[m]<x;)m+=3;a.splice(m,0,h.children[f],h.children[f+1],h.children[f+2])}}return new xt(e.sort(Ji),a)}function t6(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 jn(o.from+e,o.to+e,o.type))}return n}function o$(t,e,n,r,o,s,i){function a(u,d){for(let h=0;h<u.local.length;h++){let f=u.local[h].map(r,o,d);f?n.push(f):i.onRemove&&i.onRemove(u.local[h].spec)}for(let h=0;h<u.children.length;h+=3)a(u.children[h+2],u.children[h]+d+1)}for(let u=0;u<t.length;u+=3)t[u+1]==-1&&a(t[u+2],e[u]+s+1);return n}function n6(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 r6(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function mh(t,e,n,r){let o=[],s=!1;e.forEach((a,u)=>{let d=n6(t,a,u+n);if(d){s=!0;let h=mh(d,a,n+u+1,r);h!=Nn&&o.push(u,u+a.nodeSize,h)}});let i=t6(s?r6(t):t,-n).sort(Ji);for(let a=0;a<i.length;a++)i[a].type.valid(e,i[a])||(r.onRemove&&r.onRemove(i[a].spec),i.splice(a--,1));return i.length||o.length?new xt(i,o):Nn}function Ji(t,e){return t.from-e.from||t.to-e.to}function Px(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),cC(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),cC(e,o,r.copy(s.from,r.to)));break}}}return e}function cC(t,e,n){for(;e<t.length&&Ji(n,t[e])>0;)e++;t.splice(e,0,n)}function Cg(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Nn&&e.push(r)}),t.cursorWrapper&&e.push(xt.create(t.state.doc,[t.cursorWrapper.deco])),Ks.from(e)}const s$={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},i$=er&&ti<=11;class a${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 l${constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new a$,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]);er&&ti<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():An&&e.composing&&r.some(o=>o.type=="childList"&&o.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),i$&&(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,s$)),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(rC(this.view)){if(this.suppressingSelectionUpdates)return rs(this.view);if(er&&ti<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&oa(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=fl(s))n.add(s);for(let s=e.anchorNode;s;s=fl(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)&&rC(e)&&!this.ignoreSelectionChange(r),s=-1,i=-1,a=!1,u=[];if(e.editable)for(let h=0;h<n.length;h++){let f=this.registerMutation(n[h],u);f&&(s=s<0?f.from:Math.min(f.from,s),i=i<0?f.to:Math.max(f.to,i),f.typeOver&&(a=!0))}if(u.some(h=>h.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||wn&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&n.some(h=>h.type=="childList"&&h.removedNodes.length))){for(let h of u)if(h.nodeName=="BR"&&h.parentNode){let f=h.nextSibling;for(;f&&f.nodeType==1;){if(f.contentEditable=="false"){h.parentNode.removeChild(h);break}f=f.firstChild}}}else if(Ar&&u.length){let h=u.filter(f=>f.nodeName=="BR");if(h.length==2){let[f,m]=h;f.parentNode&&f.parentNode.parentNode==m.parentNode?m.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let m of h){let x=m.parentNode;x&&x.nodeName=="LI"&&(!f||d$(e,f)!=x)&&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&&Pp(r)&&(d=Nx(e))&&d.eq(Ue.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,rs(e),this.currentSelection.set(r),e.scrollToSelection()):(s>-1||o)&&(s>-1&&(e.docView.markDirty(s,i),u$(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,f$(e,u)),this.handleDOMChange(s,i,a,u),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||rs(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 h=0;h<e.addedNodes.length;h++){let f=e.addedNodes[h];n.push(f),f.nodeType==3&&(this.lastChangedTextNode=f)}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(er&&ti<=11&&e.addedNodes.length)for(let h=0;h<e.addedNodes.length;h++){let{previousSibling:f,nextSibling:m}=e.addedNodes[h];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(o=f),(!m||Array.prototype.indexOf.call(e.addedNodes,m)<0)&&(s=m)}let i=o&&o.parentNode==e.target?bn(o)+1:0,a=r.localPosFromDOM(e.target,i,-1),u=s&&s.parentNode==e.target?bn(s):e.target.childNodes.length,d=r.localPosFromDOM(e.target,u,1);return{from:a,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 dC=new WeakMap,fC=!1;function u$(t){if(!dC.has(t)&&(dC.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Ar,fC)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."),fC=!0}}function hC(t,e){let n=e.startContainer,r=e.startOffset,o=e.endContainer,s=e.endOffset,i=t.domAtPos(t.state.selection.anchor);return oa(i.node,i.offset,o,s)&&([n,r,o,s]=[o,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:s}}function c$(t,e){if(e.getComposedRanges){let o=e.getComposedRanges(t.root)[0];if(o)return hC(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?hC(t,n):null}function d$(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 f$(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 a=i;for(;;){let u=a.firstChild;if(!u||u.nodeType!=1||u.contentEditable=="false"||/^(BR|IMG)$/.test(u.nodeName))break;a=u}a.insertBefore(s,a.firstChild),r==s&&t.domSelection().collapse(s,o)}else s.parentNode.removeChild(s)}}function h$(t,e,n,r){let{node:o,fromOffset:s,toOffset:i,from:a,to:u}=t.docView.parseRange(e,n),d=t.domSelectionRange(),h,f=d.anchorNode;if(f&&t.dom.contains(f.nodeType==1?f:f.parentNode)&&(h=[{node:f,offset:d.anchorOffset}],Pp(d)||h.push({node:d.focusNode,offset:d.focusOffset})),wn&&t.input.lastKeyCode===8)for(let S=i;S>s;S--){let _=o.childNodes[S-1],T=_.pmViewDesc;if(_.nodeName=="BR"&&!T){i=S;break}if(!T||T.size)break}let m=t.state.doc,x=t.someProp("domParser")||ts.fromSchema(t.state.schema),v=m.resolve(a),b=null,k=x.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:h,ruleFromNode:p$(r),context:v});if(h&&h[0].pos!=null){let S=h[0].pos,_=h[1]&&h[1].pos;_==null&&(_=S),b={anchor:S+a,head:_+a}}return{doc:k,sel:b,from:a,to:u}}const p$=t=>e=>{let n=e.pmViewDesc;if(n)return n.parseRule(t);if(e.nodeName=="BR"&&e.parentNode){if(An&&/^(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||An&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null},m$=/^(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 g$(t,e,n,r,o){let s=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let P=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,j=Nx(t,P);if(j&&!t.state.selection.eq(j)){if(wn&&Zo&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",W=>W(t,Fi(13,"Enter"))))return;let I=t.state.tr.setSelection(j);P=="pointer"?I.setMeta("pointer",!0):P=="key"&&I.scrollIntoView(),s&&I.setMeta("composition",s),t.dispatch(I)}return}let i=t.state.doc.resolve(e),a=i.sharedDepth(n);e=i.before(a+1),n=t.state.doc.resolve(n).after(a+1);let u=t.state.selection,d=h$(t,e,n,o),h=t.state.doc,f=h.slice(d.from,d.to),m,x;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(m=t.state.selection.to,x="end"):(m=t.state.selection.from,x="start"),t.input.lastKeyCode=null;let v=v$(f.content,d.doc.content,d.from,m,x);if(v&&t.input.domChangeCount++,(hl&&t.input.lastIOSEnter>Date.now()-225||Zo)&&o.some(P=>P.nodeType==1&&!m$.test(P.nodeName))&&(!v||v.endA>=v.endB)&&t.someProp("handleKeyDown",P=>P(t,Fi(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!v)if(r&&u instanceof ze&&!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 P=pC(t,t.state.doc,d.sel);if(P&&!P.eq(t.state.selection)){let j=t.state.tr.setSelection(P);s&&j.setMeta("composition",s),t.dispatch(j)}}return}t.state.selection.from<t.state.selection.to&&v.start==v.endB&&t.state.selection instanceof ze&&(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)),er&&ti<=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),S=h.resolve(v.start),_=b.sameParent(k)&&b.parent.inlineContent&&S.end()>=v.endA;if((hl&&t.input.lastIOSEnter>Date.now()-225&&(!_||o.some(P=>P.nodeName=="DIV"||P.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",P=>P(t,Fi(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>v.start&&x$(h,v.start,v.endA,b,k)&&t.someProp("handleKeyDown",P=>P(t,Fi(8,"Backspace")))){Zo&&wn&&t.domObserver.suppressSelectionUpdates();return}wn&&v.endB==v.start&&(t.input.lastChromeDelete=Date.now()),Zo&&!_&&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(P){return P(t,Fi(13,"Enter"))})},20));let T=v.start,A=v.endA,M=P=>{let j=P||t.state.tr.replace(T,A,d.doc.slice(v.start-d.from,v.endB-d.from));if(d.sel){let I=pC(t,j.doc,d.sel);I&&!(wn&&t.composing&&I.empty&&(v.start!=v.endB||t.input.lastChromeDelete<Date.now()-100)&&(I.head==T||I.head==j.mapping.map(A)-1)||er&&I.empty&&I.head==T)&&j.setSelection(I)}return s&&j.setMeta("composition",s),j.scrollIntoView()},D;if(_)if(b.pos==k.pos){er&&ti<=11&&b.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>rs(t),20));let P=M(t.state.tr.delete(T,A)),j=h.resolve(v.start).marksAcross(h.resolve(v.endA));j&&P.ensureMarks(j),t.dispatch(P)}else if(v.endA==v.endB&&(D=y$(b.parent.content.cut(b.parentOffset,k.parentOffset),S.parent.content.cut(S.parentOffset,v.endA-S.start())))){let P=M(t.state.tr);D.type=="add"?P.addMark(T,A,D.mark):P.removeMark(T,A,D.mark),t.dispatch(P)}else if(b.parent.child(b.index()).isText&&b.index()==k.index()-(k.textOffset?0:1)){let P=b.parent.textBetween(b.parentOffset,k.parentOffset),j=()=>M(t.state.tr.insertText(P,T,A));t.someProp("handleTextInput",I=>I(t,T,A,P,j))||t.dispatch(j())}else t.dispatch(M());else t.dispatch(M())}function pC(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Ax(t,e.resolve(n.anchor),e.resolve(n.head))}function y$(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,o=n,s=r,i,a,u;for(let h=0;h<r.length;h++)o=r[h].removeFromSet(o);for(let h=0;h<n.length;h++)s=n[h].removeFromSet(s);if(o.length==1&&s.length==0)a=o[0],i="add",u=h=>h.mark(a.addToSet(h.marks));else if(o.length==0&&s.length==1)a=s[0],i="remove",u=h=>h.mark(a.removeFromSet(h.marks));else return null;let d=[];for(let h=0;h<e.childCount;h++)d.push(u(e.child(h)));if(oe.from(d).eq(t))return{mark:a,type:i}}function x$(t,e,n,r,o){if(n-e<=o.pos-r.pos||Sg(r,!0,!1)<o.pos)return!1;let s=t.resolve(e);if(!r.parent.isTextblock){let a=s.nodeAfter;return a!=null&&n==e+a.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let i=t.resolve(Sg(s,!0,!0));return!i.parent.isTextblock||i.pos>n||Sg(i,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(i.parent.content)}function Sg(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 v$(t,e,n,r,o){let s=t.findDiffStart(e,n),i=n+t.size,a=n+e.size;if(s==null)return null;let{a:u,b:d}=t.findDiffEnd(e,i,a);if(o=="end"){let h=Math.max(0,s-Math.min(u,d));r-=u+h-s}if(u<s&&i<a){let h=r<=s&&r>=u?s-r:0;s-=h,d=s+(d-u),u=s}else if(d<s){let h=r<=s&&r>=d?s-r:0;s-=h,u=s+(u-d),d=s}return{start:s,endA:u,endB:d}}class o6{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 PF,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(vC),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=yC(this),gC(this),this.nodeViews=xC(this),this.docView=Yw(this.state.doc,mC(this),Cg(this),this.dom,this),this.domObserver=new l$(this,(r,o,s,i)=>g$(this,r,o,s,i)),this.domObserver.start(),jF(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&&ry(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(vC),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&&(Y4(this),i=!0),this.state=e;let a=o.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let x=xC(this);k$(x,this.nodeViews)&&(this.nodeViews=x,s=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&ry(this),this.editable=yC(this),gC(this);let u=Cg(this),d=mC(this),h=o.plugins!=e.plugins&&!o.doc.eq(e.doc)?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",f=s||!this.docView.matchesNode(e.doc,d,u);(f||!e.selection.eq(o.selection))&&(i=!0);let m=h=="preserve"&&i&&this.dom.style.overflowAnchor==null&&Zz(this);if(i){this.domObserver.stop();let x=f&&(er||wn)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&b$(o.selection,e.selection);if(f){let b=wn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=YF(this)),(s||!this.docView.update(e.doc,d,u,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=Yw(e.doc,d,u,this.dom,this)),b&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(x=!0)}let v=this.input.mouseDown;x||!(v&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&bF(this)&&v.delaySelUpdate())?rs(this,x):(L4(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),h=="reset"?this.dom.scrollTop=0:h=="to selection"?this.scrollToSelection():m&&Yz(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 Pe){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&qw(this,n.getBoundingClientRect(),e)}else qw(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 Q4(e.slice,e.move,o<0?void 0:Pe.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 a=this.directPlugins[i].props[e];if(a!=null&&(o=n?n(a):a))return o}let s=this.state.plugins;if(s)for(let i=0;i<s.length;i++){let a=s[i].props[e];if(a!=null&&(o=n?n(a):a))return o}}hasFocus(){if(er){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Xz(this.dom),rs(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 rF(this,e)}coordsAtPos(e,n=1){return A4(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 lF(this,n||this.state,e)}pasteHTML(e,n){return uc(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return uc(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return Mx(this,e)}destroy(){this.docView&&(LF(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Cg(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,$z())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return FF(this,e)}domSelectionRange(){let e=this.domSelection();return e?An&&this.root.nodeType===11&&Wz(this.dom.ownerDocument)==this.dom&&c$(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}o6.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function mC(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"),[jn.node(0,t.state.doc.content.size,e)]}function gC(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:jn.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function yC(t){return!t.someProp("editable",e=>e(t.state)===!1)}function b$(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 xC(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 k$(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 vC(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 ci={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:"'"},gh={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},w$=typeof navigator<"u"&&/Mac/.test(navigator.platform),C$=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var kn=0;kn<10;kn++)ci[48+kn]=ci[96+kn]=String(kn);for(var kn=1;kn<=24;kn++)ci[kn+111]="F"+kn;for(var kn=65;kn<=90;kn++)ci[kn]=String.fromCharCode(kn+32),gh[kn]=String.fromCharCode(kn);for(var Eg in ci)gh.hasOwnProperty(Eg)||(gh[Eg]=ci[Eg]);function S$(t){var e=w$&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||C$&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?gh:ci)[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 E$=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),_$=typeof navigator<"u"&&/Win/.test(navigator.platform);function T$(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,o,s,i;for(let a=0;a<e.length-1;a++){let u=e[a];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))E$?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 N$(t){let e=Object.create(null);for(let n in t)e[T$(n)]=t[n];return e}function _g(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 A$(t){return new Ct({props:{handleKeyDown:s6(t)}})}function s6(t){let e=N$(t);return function(n,r){let o=S$(r),s,i=e[_g(o,r)];if(i&&i(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let a=e[_g(o,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(_$&&r.ctrlKey&&r.altKey)&&(s=ci[r.keyCode])&&s!=o){let a=e[_g(s,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}var M$=Object.defineProperty,jx=(t,e)=>{for(var n in e)M$(t,n,{get:e[n],enumerable:!0})};function Lp(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 zp=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,a])=>[i,(...d)=>{const h=a(...d)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(o),h}]))}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=[],a=!!t,u=t||o.tr,d=()=>(!a&&e&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(u),i.every(f=>f===!0)),h={...Object.fromEntries(Object.entries(n).map(([f,m])=>[f,(...v)=>{const b=this.buildProps(u,e),k=m(...v)(b);return i.push(k),h}])),run:d};return h}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(([a,u])=>[a,(...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:Lp({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(([a,u])=>[a,(...d)=>u(...d)(i)]))}};return i}},i6={};jx(i6,{blur:()=>D$,clearContent:()=>R$,clearNodes:()=>O$,command:()=>I$,createParagraphNear:()=>P$,cut:()=>j$,deleteCurrentNode:()=>L$,deleteNode:()=>z$,deleteRange:()=>F$,deleteSelection:()=>V$,enter:()=>H$,exitCode:()=>U$,extendMarkRange:()=>W$,first:()=>q$,focus:()=>G$,forEach:()=>J$,insertContent:()=>Z$,insertContentAt:()=>X$,insertDefaultBlock:()=>Q$,joinBackward:()=>nB,joinDown:()=>tB,joinForward:()=>rB,joinItemBackward:()=>oB,joinItemForward:()=>sB,joinTextblockBackward:()=>iB,joinTextblockForward:()=>aB,joinUp:()=>eB,keyboardShortcut:()=>uB,lift:()=>cB,liftEmptyBlock:()=>dB,liftListItem:()=>fB,newlineInCode:()=>hB,resetAttributes:()=>pB,scrollIntoView:()=>mB,selectAll:()=>gB,selectNodeBackward:()=>yB,selectNodeForward:()=>xB,selectParentNode:()=>vB,selectTextblockEnd:()=>bB,selectTextblockStart:()=>kB,setContent:()=>wB,setMark:()=>VB,setMeta:()=>HB,setNode:()=>UB,setNodeSelection:()=>WB,setTextDirection:()=>qB,setTextSelection:()=>KB,sinkListItem:()=>GB,splitBlock:()=>JB,splitListItem:()=>ZB,toggleList:()=>XB,toggleMark:()=>QB,toggleNode:()=>eV,toggleWrap:()=>tV,undoInputRule:()=>nV,unsetAllMarks:()=>rV,unsetMark:()=>oV,unsetTextDirection:()=>sV,updateAttributes:()=>iV,wrapIn:()=>aV,wrapInList:()=>lV});var D$=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),R$=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),O$=()=>({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,(a,u)=>{if(a.type.isText)return;const{doc:d,mapping:h}=e,f=d.resolve(h.map(u)),m=d.resolve(h.map(u+a.nodeSize)),x=f.blockRange(m);if(!x)return;const v=_l(x);if(a.type.isTextblock){const{defaultType:b}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(x.start,b)}(v||v===0)&&e.lift(x,v)})}),!0},I$=t=>e=>t(e),P$=()=>({state:t,dispatch:e})=>x4(t,e),j$=(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 ze(r.doc.resolve(Math.max(i-1,0)))),!0},L$=()=>({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 a=o.before(s),u=o.after(s);t.delete(a,u).scrollIntoView()}return!0}return!1};function Ut(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 z$=t=>({tr:e,state:n,dispatch:r})=>{const o=Ut(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},F$=t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0},$$=t=>t.content?/^text(\*|\+)/.test(t.content):!1,bC=(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 $$(r)?n==="left"?t.start()-1:t.end()+1:t.pos},B$=(t,e,n)=>{const r=bC(t,n,"left"),o=bC(e,n,"right");return{from:r,to:o}},V$=()=>({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),a=n.doc.resolve(i.map(s.$from.pos)),u=n.doc.resolve(i.map(s.$to.pos)),{from:d,to:h}=B$(a,u,t.schema);n.deleteRange(d,h)}),n.selection.empty||n.setSelection(ze.near(n.doc.resolve(n.selection.from))),n.scrollIntoView(),e(n)}return!0},H$=()=>({commands:t})=>t.keyboardShortcut("Enter"),U$=()=>({state:t,dispatch:e})=>Ez(t,e);function Lx(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function yh(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(o=>n.strict?e[o]===t[o]:Lx(e[o])?e[o].test(t[o]):e[o]===t[o]):!0}function a6(t,e,n={}){return t.find(r=>r.type===e&&yh(Object.fromEntries(Object.keys(n).map(o=>[o,r.attrs[o]])),n))}function kC(t,e,n={}){return!!a6(t,e,n)}function zx(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(h=>h.type===e);d&&(n=d.attrs)}if(!a6([...r.node.marks],e,n))return;let s=r.index,i=t.start()+r.offset,a=s+1,u=i+r.node.nodeSize;for(;s>0&&kC([...t.parent.child(s-1).marks],e,n);)s-=1,i-=t.parent.child(s).nodeSize;for(;a<t.parent.childCount&&kC([...t.parent.child(a).marks],e,n);)u+=t.parent.child(a).nodeSize,a+=1;return{from:i,to:u}}function ms(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 W$=(t,e)=>({tr:n,state:r,dispatch:o})=>{const s=ms(t,r.schema),{doc:i,selection:a}=n,{$from:u,from:d,to:h}=a;if(o){const f=zx(u,s,e);if(f&&f.from<=d&&f.to>=h){const m=ze.create(i,f.from,f.to);n.setSelection(m)}}return!0},q$=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 l6(t){return t instanceof ze}function Hi(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function oy(t,e=null){if(!e)return null;const n=Ue.atStart(t),r=Ue.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const o=n.from,s=r.to;return e==="all"?ze.create(t,Hi(0,o,s),Hi(t.content.size,o,s)):ze.create(t,Hi(e,o,s),Hi(e,o,s))}function wC(){return["Android"].includes(navigator.platform)||/android/i.test(navigator.userAgent)}function xh(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function K$(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var G$=(t=null,e={})=>({editor:n,view:r,tr:o,dispatch:s})=>{e={scrollIntoView:!0,...e};const i=()=>{(xh()||wC())&&r.dom.focus(),K$()&&!xh()&&!wC()&&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&&!l6(n.state.selection))return i(),!0;const a=oy(o.doc,t)||n.state.selection,u=n.state.selection.eq(a);return s&&(u||o.setSelection(a),u&&o.storedMarks&&o.setStoredMarks(o.storedMarks),i()),!0},J$=(t,e)=>n=>t.every((r,o)=>e(r,{...n,index:o})),Z$=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),u6=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&&u6(r)}return t};function bf(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 u6(n)}function pl(t,e,n){if(t instanceof ei||t instanceof oe)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 oe.fromArray(t.map(a=>e.nodeFromJSON(a)));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),pl("",e,n)}if(o){if(n.errorOnInvalidContent){let i=!1,a="";const u=new xx({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,a=typeof d=="string"?d:d.outerHTML,null)}]}})});if(n.slice?ts.fromSchema(u).parseSlice(bf(t),n.parseOptions):ts.fromSchema(u).parse(bf(t),n.parseOptions),n.errorOnInvalidContent&&i)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const s=ts.fromSchema(e);return n.slice?s.parseSlice(bf(t),n.parseOptions).content:s.parse(bf(t),n.parseOptions)}return pl("",e,n)}function c6(t,e,n){const r=t.steps.length-1;if(r<e)return;const o=t.steps[r];if(!(o instanceof Vt||o instanceof hn))return;const s=t.mapping.maps[r];let i=0;s.forEach((a,u,d,h)=>{i===0&&(i=h)}),t.setSelection(Ue.near(t.doc.resolve(i),n))}var Y$=t=>!("type"in t),X$=(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 a;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{pl(e,s.schema,{parseOptions:d,errorOnInvalidContent:!0})}catch(k){u(k)}try{a=pl(e,s.schema,{parseOptions:d,errorOnInvalidContent:(i=n.errorOnInvalidContent)!=null?i:s.options.enableContentCheck})}catch(k){return u(k),!1}let{from:h,to:f}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},m=!0,x=!0;if((Y$(a)?a:[a]).forEach(k=>{k.check(),m=m?k.isText&&k.marks.length===0:!1,x=x?k.isBlock:!1}),h===f&&x){const{parent:k}=r.doc.resolve(h);k.isTextblock&&!k.type.spec.code&&!k.childCount&&(h-=1,f+=1)}let b;if(m){if(Array.isArray(e))b=e.map(k=>k.text||"").join("");else if(e instanceof oe){let k="";e.forEach(S=>{S.text&&(k+=S.text)}),b=k}else typeof e=="object"&&e&&e.text?b=e.text:b=e;r.insertText(b,h,f)}else{b=a;const k=r.doc.resolve(h),S=k.node(),_=k.parentOffset===0,T=S.isText||S.isTextblock,A=S.content.size>0;_&&T&&A&&x&&(h=Math.max(0,h-1)),r.replaceWith(h,f,b)}n.updateSelection&&c6(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:h,text:b}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:h,text:b})}return!0};function d6(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 Q$=(t={})=>({tr:e,dispatch:n,editor:r})=>{const{pos:o,attrs:s,content:i,updateSelection:a=!0}=t;let u;typeof o=="number"?u=e.doc.resolve(o):o?u=o:u=e.selection.$from;const d=d6(u.parent.contentMatchAt(u.index()));if(!d)return!1;const h=Object.keys(d.spec.attrs||{}),f=s?Object.fromEntries(Object.entries(s).filter(([x])=>h.includes(x))):{};let m;if(i){const x=pl(i,r.schema);m=d.createAndFill(f,x)}else m=d.createAndFill(f);return m?(n&&(e.insert(u.pos,m),a&&c6(e,e.steps.length-1,-1)),!0):!1},eB=()=>({state:t,dispatch:e})=>wz(t,e),tB=()=>({state:t,dispatch:e})=>Cz(t,e),nB=()=>({state:t,dispatch:e})=>d4(t,e),rB=()=>({state:t,dispatch:e})=>m4(t,e),oB=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Rp(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},sB=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Rp(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},iB=()=>({state:t,dispatch:e})=>bz(t,e),aB=()=>({state:t,dispatch:e})=>kz(t,e);function f6(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function lB(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,o,s,i;for(let a=0;a<e.length-1;a+=1){const u=e[a];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))xh()||f6()?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 uB=t=>({editor:e,view:n,tr:r,dispatch:o})=>{const s=lB(t).split(/-(?!$)/),i=s.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),a=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,a))});return u==null||u.steps.forEach(d=>{const h=d.map(r.mapping);h&&o&&r.maybeStep(h)}),!0};function di(t,e,n={}){const{from:r,to:o,empty:s}=t.selection,i=e?Ut(e,t.schema):null,a=[];t.doc.nodesBetween(r,o,(f,m)=>{if(f.isText)return;const x=Math.max(r,m),v=Math.min(o,m+f.nodeSize);a.push({node:f,from:x,to:v})});const u=o-r,d=a.filter(f=>i?i.name===f.node.type.name:!0).filter(f=>yh(f.node.attrs,n,{strict:!1}));return s?!!d.length:d.reduce((f,m)=>f+m.to-m.from,0)>=u}var cB=(t,e={})=>({state:n,dispatch:r})=>{const o=Ut(t,n.schema);return di(n,o,e)?Sz(n,r):!1},dB=()=>({state:t,dispatch:e})=>v4(t,e),fB=t=>({state:e,dispatch:n})=>{const r=Ut(t,e.schema);return jz(r)(e,n)},hB=()=>({state:t,dispatch:e})=>y4(t,e);function Fp(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function CC(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 pB=(t,e)=>({tr:n,state:r,dispatch:o})=>{let s=null,i=null;const a=Fp(typeof t=="string"?t:t.name,r.schema);if(!a)return!1;a==="node"&&(s=Ut(t,r.schema)),a==="mark"&&(i=ms(t,r.schema));let u=!1;return n.selection.ranges.forEach(d=>{r.doc.nodesBetween(d.$from.pos,d.$to.pos,(h,f)=>{s&&s===h.type&&(u=!0,o&&n.setNodeMarkup(f,void 0,CC(h.attrs,e))),i&&h.marks.length&&h.marks.forEach(m=>{i===m.type&&(u=!0,o&&n.addMark(f,f+h.nodeSize,i.create(CC(m.attrs,e))))})})}),u},mB=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),gB=()=>({tr:t,dispatch:e})=>{if(e){const n=new ur(t.doc);t.setSelection(n)}return!0},yB=()=>({state:t,dispatch:e})=>h4(t,e),xB=()=>({state:t,dispatch:e})=>g4(t,e),vB=()=>({state:t,dispatch:e})=>Nz(t,e),bB=()=>({state:t,dispatch:e})=>Dz(t,e),kB=()=>({state:t,dispatch:e})=>Mz(t,e);function sy(t,e,n={},r={}){return pl(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var wB=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:o,tr:s,dispatch:i,commands:a})=>{const{doc:u}=s;if(r.preserveWhitespace!=="full"){const d=sy(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),a.insertContentAt({from:0,to:u.content.size},t,{parseOptions:r,errorOnInvalidContent:e??o.options.enableContentCheck})};function h6(t,e){const n=ms(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 a=i.find(u=>u.type.name===n.name);return a?{...a.attrs}:{}}function p6(t,e){const n=new i4(t);return e.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}function CB(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(o,s)=>{n(o)&&r.push({node:o,pos:s})}),r}function SB(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 $p(t){return e=>SB(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 Fx(t){return t.map(e=>{const n={name:e.name,options:e.options,storage:e.storage},r=Me(e,"addExtensions",n);return r?[e,...Fx(r())]:e}).flat(10)}function Bc(t,e){const n=ha.fromSchema(e).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}function m6(t){return typeof t=="function"}function lt(t,e=void 0,...n){return m6(t)?e?t.bind(e)(...n):t(...n):t}function EB(t={}){return Object.keys(t).length===0&&t.constructor===Object}function ml(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 g6(t){const e=[],{nodeExtensions:n,markExtensions:r}=ml(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),a=r.map(d=>d.name),u=[...i,...a];return t.forEach(d=>{const h={name:d.name,options:d.options,storage:d.storage,extensions:o},f=Me(d,"addGlobalAttributes",h);if(!f)return;f().forEach(x=>{let v;Array.isArray(x.types)?v=x.types:x.types==="*"?v=u:x.types==="nodes"?v=i:x.types==="marks"?v=a:v=[],v.forEach(b=>{Object.entries(x.attributes).forEach(([k,S])=>{e.push({type:b,name:k,attribute:{...s,...S}})})})})}),o.forEach(d=>{const h={name:d.name,options:d.options,storage:d.storage},f=Me(d,"addAttributes",h);if(!f)return;const m=f();Object.entries(m).forEach(([x,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:x,attribute:b})})}),e}function _B(t){const e=[];let n="",r=!1,o=!1,s=0;const i=t.length;for(let a=0;a<i;a+=1){const u=t[a];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 SC(t){const e=[],n=_B(t||""),r=n.length;for(let o=0;o<r;o+=1){const s=n[o],i=s.indexOf(":");if(i===-1)continue;const a=s.slice(0,i).trim(),u=s.slice(i+1).trim();a&&u&&e.push([a,u])}return e}function tn(...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 a=s?String(s).split(" "):[],u=r[o]?r[o].split(" "):[],d=a.filter(h=>!u.includes(h));r[o]=[...u,...d].join(" ")}else if(o==="style"){const a=new Map([...SC(r[o]),...SC(s)]);r[o]=Array.from(a.entries()).map(([u,d])=>`${u}: ${d}`).join("; ")}else r[o]=s}),r},{})}function dc(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)=>tn(n,r),{})}function TB(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function EC(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 a=i.attribute.parseHTML?i.attribute.parseHTML(n):TB(n.getAttribute(i.name));return a==null?s:{...s,[i.name]:a}},{});return{...r,...o}}}}function _C(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&EB(n)?!1:n!=null))}function TC(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 NB(t,e){var n;const r=g6(t),{nodeExtensions:o,markExtensions:s}=ml(t),i=(n=o.find(d=>Me(d,"topNode")))==null?void 0:n.name,a=Object.fromEntries(o.map(d=>{const h=r.filter(S=>S.type===d.name),f={name:d.name,options:d.options,storage:d.storage,editor:e},m=t.reduce((S,_)=>{const T=Me(_,"extendNodeSchema",f);return{...S,...T?T(d):{}}},{}),x=_C({...m,content:lt(Me(d,"content",f)),marks:lt(Me(d,"marks",f)),group:lt(Me(d,"group",f)),inline:lt(Me(d,"inline",f)),atom:lt(Me(d,"atom",f)),selectable:lt(Me(d,"selectable",f)),draggable:lt(Me(d,"draggable",f)),code:lt(Me(d,"code",f)),whitespace:lt(Me(d,"whitespace",f)),linebreakReplacement:lt(Me(d,"linebreakReplacement",f)),defining:lt(Me(d,"defining",f)),isolating:lt(Me(d,"isolating",f)),attrs:Object.fromEntries(h.map(TC))}),v=lt(Me(d,"parseHTML",f));v&&(x.parseDOM=v.map(S=>EC(S,h)));const b=Me(d,"renderHTML",f);b&&(x.toDOM=S=>b({node:S,HTMLAttributes:dc(S,h)}));const k=Me(d,"renderText",f);return k&&(x.toText=k),[d.name,x]})),u=Object.fromEntries(s.map(d=>{const h=r.filter(k=>k.type===d.name),f={name:d.name,options:d.options,storage:d.storage,editor:e},m=t.reduce((k,S)=>{const _=Me(S,"extendMarkSchema",f);return{...k,..._?_(d):{}}},{}),x=_C({...m,inclusive:lt(Me(d,"inclusive",f)),excludes:lt(Me(d,"excludes",f)),group:lt(Me(d,"group",f)),spanning:lt(Me(d,"spanning",f)),code:lt(Me(d,"code",f)),attrs:Object.fromEntries(h.map(TC))}),v=lt(Me(d,"parseHTML",f));v&&(x.parseDOM=v.map(k=>EC(k,h)));const b=Me(d,"renderHTML",f);return b&&(x.toDOM=k=>b({mark:k,HTMLAttributes:dc(k,h)})),[d.name,x]}));return new xx({topNode:i,nodes:a,marks:u})}function AB(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function Mu(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 y6(t){const e=Mu(Fx(t)),n=AB(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 x6(t,e,n){const{from:r,to:o}=e,{blockSeparator:s=`
|
|
463
|
+
|
|
464
|
+
`,textSerializers:i={}}=n||{};let a="";return t.nodesBetween(r,o,(u,d,h,f)=>{var m;u.isBlock&&d>r&&(a+=s);const x=i==null?void 0:i[u.type.name];if(x)return h&&(a+=x({node:u,pos:d,parent:h,index:f,range:e})),!1;u.isText&&(a+=(m=u==null?void 0:u.text)==null?void 0:m.slice(Math.max(r,d)-d,o-d))}),a}function MB(t,e){const n={from:0,to:t.content.size};return x6(t,n,e)}function v6(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function DB(t,e){const n=Ut(e,t.schema),{from:r,to:o}=t.selection,s=[];t.doc.nodesBetween(r,o,a=>{s.push(a)});const i=s.reverse().find(a=>a.type.name===n.name);return i?{...i.attrs}:{}}function b6(t,e){const n=Fp(typeof e=="string"?e:e.name,t.schema);return n==="node"?DB(t,e):n==="mark"?h6(t,e):{}}function RB(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 OB(t){const e=RB(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 $x(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((o,s)=>{const i=[];if(o.ranges.length)o.forEach((a,u)=>{i.push({from:a,to:u})});else{const{from:a,to:u}=n[s];if(a===void 0||u===void 0)return;i.push({from:a,to:u})}i.forEach(({from:a,to:u})=>{const d=e.slice(s).map(a,-1),h=e.slice(s).map(u),f=e.invert().map(d,-1),m=e.invert().map(h);r.push({oldRange:{from:f,to:m},newRange:{from:d,to:h}})})}),OB(r)}function Bx(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(o=>{const s=n.resolve(t),i=zx(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 IB=(t,e,n,r=20)=>{const o=t.doc.resolve(n);let s=r,i=null;for(;s>0&&i===null;){const a=o.node(s);(a==null?void 0:a.type.name)===e?i=a:s-=1}return[i,s]};function pu(t,e){return e.nodes[t]||e.marks[t]||null}function Wf(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 PB=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,s,i,a)=>{var u,d;const h=((d=(u=o.type.spec).toText)==null?void 0:d.call(u,{node:o,pos:s,parent:i,index:a}))||o.textContent||"%leaf%";n+=o.isAtom&&!o.isText?h:h.slice(0,Math.max(0,r-s))}),n};function iy(t,e,n={}){const{empty:r,ranges:o}=t.selection,s=e?ms(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>s?s.name===f.type.name:!0).find(f=>yh(f.attrs,n,{strict:!1}));let i=0;const a=[];if(o.forEach(({$from:f,$to:m})=>{const x=f.pos,v=m.pos;t.doc.nodesBetween(x,v,(b,k)=>{if(s&&b.inlineContent&&!b.type.allowsMarkType(s))return!1;if(!b.isText&&!b.marks.length)return;const S=Math.max(x,k),_=Math.min(v,k+b.nodeSize),T=_-S;i+=T,a.push(...b.marks.map(A=>({mark:A,from:S,to:_})))})}),i===0)return!1;const u=a.filter(f=>s?s.name===f.mark.type.name:!0).filter(f=>yh(f.mark.attrs,n,{strict:!1})).reduce((f,m)=>f+m.to-m.from,0),d=a.filter(f=>s?f.mark.type!==s&&f.mark.type.excludes(s):!0).reduce((f,m)=>f+m.to-m.from,0);return(u>0?u+d:u)>=i}function jB(t,e,n={}){if(!e)return di(t,null,n)||iy(t,null,n);const r=Fp(e,t.schema);return r==="node"?di(t,e,n):r==="mark"?iy(t,e,n):!1}var LB=(t,e)=>{const{$from:n,$to:r,$anchor:o}=t.selection;if(e){const s=$p(a=>a.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)},zB=t=>{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function NC(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function Tg(t,e){const{nodeExtensions:n}=ml(e),r=n.find(i=>i.name===t);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},s=lt(Me(r,"group",o));return typeof s!="string"?!1:s.split(" ").includes("list")}function Vc(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&&(Vc(s,{ignoreWhitespace:n,checkChildren:e})||(o=!1))}),o}return!1}function k6(t){return t instanceof Pe}var w6=class C6{constructor(e){this.position=e}static fromJSON(e){return new C6(e.position)}toJSON(){return{position:this.position}}};function FB(t,e){const n=e.mapping.mapResult(t.position);return{position:new w6(n.pos),mapResult:n}}function $B(t){return new w6(t)}function BB(t,e,n){var r;const{selection:o}=e;let s=null;if(l6(o)&&(s=o.$cursor),s){const a=(r=t.storedMarks)!=null?r:s.marks();return s.parent.type.allowsMarkType(n)&&(!!n.isInSet(a)||!a.some(d=>d.type.excludes(n)))}const{ranges:i}=o;return i.some(({$from:a,$to:u})=>{let d=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,u.pos,(h,f,m)=>{if(d)return!1;if(h.isInline){const x=!m||m.type.allowsMarkType(n),v=!!n.isInSet(h.marks)||!h.marks.some(b=>b.type.excludes(n));d=x&&v}return!d}),d})}var VB=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:s}=n,{empty:i,ranges:a}=s,u=ms(t,r.schema);if(o)if(i){const d=h6(r,u);n.addStoredMark(u.create({...d,...e}))}else a.forEach(d=>{const h=d.$from.pos,f=d.$to.pos;r.doc.nodesBetween(h,f,(m,x)=>{const v=Math.max(x,h),b=Math.min(x+m.nodeSize,f);m.marks.find(S=>S.type===u)?m.marks.forEach(S=>{u===S.type&&n.addMark(v,b,u.create({...S.attrs,...e}))}):n.addMark(v,b,u.create(e))})});return BB(r,n,u)},HB=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),UB=(t,e={})=>({state:n,dispatch:r,chain:o})=>{const s=Ut(t,n.schema);let i;return n.selection.$anchor.sameParent(n.selection.$head)&&(i=n.selection.$anchor.parent.attrs),s.isTextblock?o().command(({commands:a})=>Hw(s,{...i,...e})(n)?!0:a.clearNodes()).command(({state:a})=>Hw(s,{...i,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},WB=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,o=Hi(t,0,r.content.size),s=Pe.create(r,o);e.setSelection(s)}return!0},qB=(t,e)=>({tr:n,state:r,dispatch:o})=>{const{selection:s}=r;let i,a;return typeof e=="number"?(i=e,a=e):e&&"from"in e&&"to"in e?(i=e.from,a=e.to):(i=s.from,a=s.to),o&&n.doc.nodesBetween(i,a,(u,d)=>{u.isText||n.setNodeMarkup(d,void 0,{...u.attrs,dir:t})}),!0},KB=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:o,to:s}=typeof t=="number"?{from:t,to:t}:t,i=ze.atStart(r).from,a=ze.atEnd(r).to,u=Hi(o,i,a),d=Hi(s,i,a),h=ze.create(r,u,d);e.setSelection(h)}return!0},GB=t=>({state:e,dispatch:n})=>{const r=Ut(t,e.schema);return Fz(r)(e,n)};function AC(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 JB=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:s,doc:i}=e,{$from:a,$to:u}=s,d=o.extensionManager.attributes,h=Wf(d,a.node().type.name,a.node().attrs);if(s instanceof Pe&&s.node.isBlock)return!a.parentOffset||!ns(i,a.pos)?!1:(r&&(t&&AC(n,o.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const f=u.parentOffset===u.parent.content.size,m=a.depth===0?void 0:d6(a.node(-1).contentMatchAt(a.indexAfter(-1)));let x=f&&m?[{type:m,attrs:h}]:void 0,v=ns(e.doc,e.mapping.map(a.pos),1,x);if(!x&&!v&&ns(e.doc,e.mapping.map(a.pos),1,m?[{type:m}]:void 0)&&(v=!0,x=m?[{type:m,attrs:h}]:void 0),r){if(v&&(s instanceof ze&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,x),m&&!f&&!a.parentOffset&&a.parent.type!==m)){const b=e.mapping.map(a.before()),k=e.doc.resolve(b);a.node(-1).canReplaceWith(k.index(),k.index()+1,m)&&e.setNodeMarkup(e.mapping.map(a.before()),m)}t&&AC(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return v},ZB=(t,e={})=>({tr:n,state:r,dispatch:o,editor:s})=>{var i;const a=Ut(t,r.schema),{$from:u,$to:d}=r.selection,h=r.selection.node;if(h&&h.isBlock||u.depth<2||!u.sameParent(d))return!1;const f=u.node(-1);if(f.type!==a)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!==a||u.index(-2)!==u.node(-2).childCount-1)return!1;if(o){let S=oe.empty;const _=u.index(-1)?1:u.index(-2)?2:3;for(let j=u.depth-_;j>=u.depth-3;j-=1)S=oe.from(u.node(j).copy(S));const T=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,A={...Wf(m,u.node().type.name,u.node().attrs),...e},M=((i=a.contentMatch.defaultType)==null?void 0:i.createAndFill(A))||void 0;S=S.append(oe.from(a.createAndFill(null,M)||void 0));const D=u.before(u.depth-(_-1));n.replace(D,u.after(-T),new xe(S,4-_,0));let P=-1;n.doc.nodesBetween(D,n.doc.content.size,(j,I)=>{if(P>-1)return!1;j.isTextblock&&j.content.size===0&&(P=I+1)}),P>-1&&n.setSelection(ze.near(n.doc.resolve(P))),n.scrollIntoView()}return!0}const x=d.pos===u.end()?f.contentMatchAt(0).defaultType:null,v={...Wf(m,f.type.name,f.attrs),...e},b={...Wf(m,u.node().type.name,u.node().attrs),...e};n.delete(u.pos,d.pos);const k=x?[{type:a,attrs:v},{type:x,attrs:b}]:[{type:a,attrs:v}];if(!ns(n.doc,u.pos,2))return!1;if(o){const{selection:S,storedMarks:_}=r,{splittableMarks:T}=s.extensionManager,A=_||S.$to.parentOffset&&S.$from.marks();if(n.split(u.pos,2,k).scrollIntoView(),!A||!o)return!0;const M=A.filter(D=>T.includes(D.type.name));n.ensureMarks(M)}return!0};function MC(t){return!t||t==="1"?null:t}function S6(t,e){return MC(t)===MC(e)}var Ng=(t,e)=>{const n=$p(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)&&yi(t.doc,n.pos))||!S6(n.node.attrs.type,o==null?void 0:o.attrs.type)||t.join(n.pos),!0},Ag=(t,e)=>{const n=$p(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)&&yi(t.doc,r))||!S6(n.node.attrs.type,o==null?void 0:o.attrs.type)||t.join(r),!0};function YB(t){const e=t.doc,n=e.firstChild;if(!n)return null;const r=e.resolve(1),o=e.resolve(n.nodeSize-1);return ze.between(r,o)}var XB=(t,e,n,r={})=>({editor:o,tr:s,state:i,dispatch:a,chain:u,commands:d,can:h})=>{const{extensions:f,splittableMarks:m}=o.extensionManager,x=Ut(t,i.schema),v=Ut(e,i.schema),{selection:b,storedMarks:k}=i,{$from:S,$to:_}=b,T=S.blockRange(_),A=k||b.$to.parentOffset&&b.$from.marks();if(!T)return!1;const M=$p(K=>Tg(K.type.name,f))(b),D=b.from===0&&b.to===i.doc.content.size,P=i.doc.content.content,j=P.length===1?P[0]:null,I=D&&j&&Tg(j.type.name,f)?{node:j,pos:0}:null,W=M??I,Z=!!M&&T.depth>=1&&T.depth-M.depth<=1,J=!!I;if((Z||J)&&W){if(W.node.type===x)return D&&J?u().command(({tr:K,dispatch:Y})=>{const ee=YB(K);return ee?(K.setSelection(ee),Y&&Y(K),!0):!1}).liftListItem(v).run():d.liftListItem(v);if(Tg(W.node.type.name,f)&&x.validContent(W.node.content))return u().command(()=>(s.setNodeMarkup(W.pos,x),!0)).command(()=>Ng(s,x)).command(()=>Ag(s,x)).run()}return!n||!A||!a?u().command(()=>h().wrapInList(x,r)?!0:d.clearNodes()).wrapInList(x,r).command(()=>Ng(s,x)).command(()=>Ag(s,x)).run():u().command(()=>{const K=h().wrapInList(x,r),Y=A.filter(ee=>m.includes(ee.type.name));return s.ensureMarks(Y),K?!0:d.clearNodes()}).wrapInList(x,r).command(()=>Ng(s,x)).command(()=>Ag(s,x)).run()},QB=(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:s=!1}=n,i=ms(t,r.schema);return iy(r,i,e)?o.unsetMark(i,{extendEmptyMarkRange:s}):o.setMark(i,e)},eV=(t,e,n={})=>({state:r,commands:o})=>{const s=Ut(t,r.schema),i=Ut(e,r.schema),a=di(r,s,n);let u;return r.selection.$anchor.sameParent(r.selection.$head)&&(u=r.selection.$anchor.parent.attrs),a?o.setNode(i,u):o.setNode(s,{...u,...n})},tV=(t,e={})=>({state:n,commands:r})=>{const o=Ut(t,n.schema);return di(n,o,e)?r.lift(o):r.wrapIn(o,e)},nV=()=>({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,a=s.transform;for(let u=a.steps.length-1;u>=0;u-=1)i.step(a.steps[u].invert(a.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},rV=(t={})=>({tr:e,dispatch:n,editor:r})=>{const{ignoreClearable:o=!1}=t,{selection:s}=e,{empty:i,ranges:a}=s;if(i)return!0;const{nonClearableMarks:u}=r.extensionManager;if(n){const d=Object.values(r.schema.marks).filter(h=>o||!u.includes(h.name));a.forEach(h=>{for(const f of d)e.removeMark(h.$from.pos,h.$to.pos,f)})}return!0},oV=(t,e={})=>({tr:n,state:r,dispatch:o})=>{var s;const{extendEmptyMarkRange:i=!1}=e,{selection:a}=n,u=ms(t,r.schema),{$from:d,empty:h,ranges:f}=a;if(!o)return!0;if(h&&i){let{from:m,to:x}=a;const v=(s=d.marks().find(k=>k.type===u))==null?void 0:s.attrs,b=zx(d,u,v);b&&(m=b.from,x=b.to),n.removeMark(m,x,u)}else f.forEach(m=>{n.removeMark(m.$from.pos,m.$to.pos,u)});return n.removeStoredMark(u),!0},sV=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,(a,u)=>{if(a.isText)return;const d={...a.attrs};delete d.dir,e.setNodeMarkup(u,void 0,d)}),!0},iV=(t,e={})=>({tr:n,state:r,dispatch:o})=>{let s=null,i=null;const a=Fp(typeof t=="string"?t:t.name,r.schema);if(!a)return!1;a==="node"&&(s=Ut(t,r.schema)),a==="mark"&&(i=ms(t,r.schema));let u=!1;return n.selection.ranges.forEach(d=>{const h=d.$from.pos,f=d.$to.pos;let m,x,v,b;n.selection.empty?r.doc.nodesBetween(h,f,(k,S)=>{s&&s===k.type&&(u=!0,v=Math.max(S,h),b=Math.min(S+k.nodeSize,f),m=S,x=k)}):r.doc.nodesBetween(h,f,(k,S)=>{S<h&&s&&s===k.type&&(u=!0,v=Math.max(S,h),b=Math.min(S+k.nodeSize,f),m=S,x=k),S>=h&&S<=f&&(s&&s===k.type&&(u=!0,o&&n.setNodeMarkup(S,void 0,{...k.attrs,...e})),i&&k.marks.length&&k.marks.forEach(_=>{if(i===_.type&&(u=!0,o)){const T=Math.max(S,h),A=Math.min(S+k.nodeSize,f);n.addMark(T,A,i.create({..._.attrs,...e}))}}))}),x&&(m!==void 0&&o&&n.setNodeMarkup(m,void 0,{...x.attrs,...e}),i&&x.marks.length&&x.marks.forEach(k=>{i===k.type&&o&&n.addMark(v,b,i.create({...k.attrs,...e}))}))}),u},aV=(t,e={})=>({state:n,dispatch:r})=>{const o=Ut(t,n.schema);return Rz(o,e)(n,r)},lV=(t,e={})=>({state:n,dispatch:r})=>{const o=Ut(t,n.schema);return Oz(o,e)(n,r)},uV=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 cV(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof Pe){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 dV(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 fV(t){return typeof t=="number"}function hV(t){return Object.prototype.toString.call(t).slice(8,-1)}function kf(t){return hV(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}var pV={};jx(pV,{createAtomBlockMarkdownSpec:()=>mV,createBlockMarkdownSpec:()=>gV,createInlineMarkdownSpec:()=>vV,parseAttributes:()=>Vx,parseIndentedBlocks:()=>ay,renderNestedMarkdownContent:()=>Ux,serializeAttributes:()=>Hx});function Vx(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(h=>h.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,h])=>{var f;const m=parseInt(((f=h.match(/__QUOTED_(\d+)__/))==null?void 0:f[1])||"0",10),x=n[m];x&&(e[d]=x.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(h=>{h.match(/^[a-zA-Z][\w-]*$/)&&(e[h]=!0)}),e}function Hx(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 mV(t){const{nodeName:e,name:n,parseAttributes:r=Vx,serializeAttributes:o=Hx,defaultAttributes:s={},requiredAttributes:i=[],allowedAttributes:a}=t,u=n||e,d=h=>{if(!a)return h;const f={};return a.forEach(m=>{m in h&&(f[m]=h[m])}),f};return{parseMarkdown:(h,f)=>{const m={...s,...h.attributes};return f.createNode(e,m,[])},markdownTokenizer:{name:e,level:"block",start(h){var f;const m=new RegExp(`^:::${u}(?:\\s|$)`,"m"),x=(f=h.match(m))==null?void 0:f.index;return x!==void 0?x:-1},tokenize(h,f,m){const x=new RegExp(`^:::${u}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),v=h.match(x);if(!v)return;const b=v[1]||"",k=r(b);if(!i.find(_=>!(_ in k)))return{type:e,raw:v[0],attributes:k}}},renderMarkdown:h=>{const f=d(h.attrs||{}),m=o(f),x=m?` {${m}}`:"";return`:::${u}${x} :::`}}}function gV(t){const{nodeName:e,name:n,getContent:r,parseAttributes:o=Vx,serializeAttributes:s=Hx,defaultAttributes:i={},content:a="block",allowedAttributes:u}=t,d=n||e,h=f=>{if(!u)return f;const m={};return u.forEach(x=>{x in f&&(m[x]=f[x])}),m};return{parseMarkdown:(f,m)=>{let x;if(r){const b=r(f);x=typeof b=="string"?[{type:"text",text:b}]:b}else a==="block"?x=m.parseChildren(f.tokens||[]):x=m.parseInline(f.tokens||[]);const v={...i,...f.attributes};return m.createNode(e,v,x)},markdownTokenizer:{name:e,level:"block",start(f){var m;const x=new RegExp(`^:::${d}`,"m"),v=(m=f.match(x))==null?void 0:m.index;return v!==void 0?v:-1},tokenize(f,m,x){var v;const b=new RegExp(`^:::${d}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),k=f.match(b);if(!k)return;const[S,_=""]=k,T=o(_);let A=1;const M=S.length;let D="";const P=/^:::([\w-]*)(\s.*)?/gm,j=f.slice(M);for(P.lastIndex=0;;){const I=P.exec(j);if(I===null)break;const W=I.index,Z=I[1];if(!((v=I[2])!=null&&v.endsWith(":::"))){if(Z)A+=1;else if(A-=1,A===0){const J=j.slice(0,W);D=J.trim();const K=f.slice(0,M+W+I[0].length);let Y=[];if(D)if(a==="block")for(Y=x.blockTokens(J),Y.forEach(ee=>{ee.text&&(!ee.tokens||ee.tokens.length===0)&&(ee.tokens=x.inlineTokens(ee.text))});Y.length>0;){const ee=Y[Y.length-1];if(ee.type==="paragraph"&&(!ee.text||ee.text.trim()===""))Y.pop();else break}else Y=x.inlineTokens(D);return{type:e,raw:K,attributes:T,content:D,tokens:Y}}}}}},renderMarkdown:(f,m)=>{const x=h(f.attrs||{}),v=s(x),b=v?` {${v}}`:"",k=m.renderChildren(f.content||[],`
|
|
465
|
+
|
|
466
|
+
`);return`:::${d}${b}
|
|
467
|
+
|
|
468
|
+
${k}
|
|
469
|
+
|
|
470
|
+
:::`}}}function yV(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 xV(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}function vV(t){const{nodeName:e,name:n,getContent:r,parseAttributes:o=yV,serializeAttributes:s=xV,defaultAttributes:i={},selfClosing:a=!1,allowedAttributes:u}=t,d=n||e,h=m=>{if(!u)return m;const x={};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 S=m[b];if(k!==void 0&&S===k)return;x[b]=S}}),x},f=d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(m,x)=>{const v={...i,...m.attributes};if(a)return x.createNode(e,v);const b=r?r(m):m.content||"";return b?x.createNode(e,v,[x.createTextNode(b)]):x.createNode(e,v,[])},markdownTokenizer:{name:e,level:"inline",start(m){const x=a?new RegExp(`\\[${f}\\s*[^\\]]*\\]`):new RegExp(`\\[${f}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${f}\\]`),v=m.match(x),b=v==null?void 0:v.index;return b!==void 0?b:-1},tokenize(m,x,v){const b=a?new RegExp(`^\\[${f}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${f}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${f}\\]`),k=m.match(b);if(!k)return;let S="",_="";if(a){const[,A]=k;_=A}else{const[,A,M]=k;_=A,S=M||""}const T=o(_.trim());return{type:e,raw:k[0],content:S.trim(),attributes:T}}},renderMarkdown:m=>{let x="";r?x=r(m):m.content&&m.content.length>0&&(x=m.content.filter(S=>S.type==="text").map(S=>S.text).join(""));const v=h(m.attrs||{}),b=s(v),k=b?` ${b}`:"";return a?`[${d}${k}]`:`[${d}${k}]${x}[/${d}]`}}}function ay(t,e,n){var r,o,s,i;const a=t.split(`
|
|
471
|
+
`),u=[];let d="",h=0;const f=e.baseIndentSize||2;for(;h<a.length;){const m=a[h],x=m.match(e.itemPattern);if(!x){if(u.length>0)break;if(m.trim()===""){h+=1,d=`${d}${m}
|
|
472
|
+
`;continue}else return}const v=e.extractItemData(x),{indentLevel:b,mainContent:k}=v;d=`${d}${m}
|
|
473
|
+
`;const S=[k];for(h+=1;h<a.length;){const M=a[h];if(M.trim()===""){const P=a.slice(h+1).findIndex(W=>W.trim()!=="");if(P===-1)break;if((((o=(r=a[h+1+P].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:o.length)||0)>b){S.push(M),d=`${d}${M}
|
|
474
|
+
`,h+=1;continue}else break}if((((i=(s=M.match(/^(\s*)/))==null?void 0:s[1])==null?void 0:i.length)||0)>b)S.push(M),d=`${d}${M}
|
|
475
|
+
`,h+=1;else break}let _;const T=S.slice(1);if(T.length>0){const M=T.map(D=>D.slice(b+f)).join(`
|
|
476
|
+
`);M.trim()&&(e.customNestedParser?_=e.customNestedParser(M):_=n.blockTokens(M))}const A=e.createToken(v,_);u.push(A)}if(u.length!==0)return{items:u,raw:d}}function Ux(t,e,n,r){if(!t||!Array.isArray(t.content))return"";const o=typeof n=="function"?n(r):n,[s,...i]=t.content,a=e.renderChildren([s]);let u=`${o}${a}`;return i&&i.length>0&&i.forEach((d,h)=>{var f,m;const x=(m=(f=e.renderChild)==null?void 0:f.call(e,d,h+1))!=null?m:e.renderChildren([d]);if(x!=null){const v=x.split(`
|
|
477
|
+
`).map(b=>b?e.indent(b):e.indent("")).join(`
|
|
478
|
+
`);u+=d.type==="paragraph"?`
|
|
479
|
+
|
|
480
|
+
${v}`:`
|
|
481
|
+
${v}`}}),u}function E6(t,e){const n={...t};return kf(t)&&kf(e)&&Object.keys(e).forEach(r=>{kf(e[r])&&kf(t[r])?n[r]=E6(t[r],e[r]):n[r]=e[r]}),n}function bV(t,e,n={}){const{state:r}=e,{doc:o,tr:s}=r,i=t;o.descendants((a,u)=>{const d=s.mapping.map(u),h=s.mapping.map(u)+a.nodeSize;let f=null;if(a.marks.forEach(x=>{if(x!==i)return!1;f=x}),!f)return;let m=!1;if(Object.keys(n).forEach(x=>{n[x]!==f.attrs[x]&&(m=!0)}),m){const x=t.type.create({...t.attrs,...n});s.removeMark(d,h,t.type),s.addMark(d,h,x)}}),s.docChanged&&e.view.dispatch(s)}var Hc=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!=null?e:!0}},kV=(t,e)=>{if(Lx(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 wf(t){var e;const{editor:n,from:r,to:o,text:s,rules:i,plugin:a}=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 h=!1;const f=PB(d)+s;return i.forEach(m=>{if(h)return;const x=kV(f,m.find);if(!x)return;const v=x[0].length-s.length;if(v>0){const D=d.parentOffset-v;if(D<0||d.parent.textBetween(D,d.parentOffset)!==x[0].slice(0,v))return}const b=u.state.tr,k=Lp({state:u.state,transaction:b}),S={from:r-(x[0].length-s.length),to:o},{commands:_,chain:T,can:A}=new zp({editor:n,state:k});m.handler({state:k,range:S,match:x,commands:_,chain:T,can:A})===null||!b.steps.length||(m.undoable&&b.setMeta(a,{transform:b,from:r,to:o,text:s}),u.dispatch(b),h=!0)}),h}function wV(t){const{editor:e,rules:n}=t,r=new Ct({state:{init(){return null},apply(o,s,i){const a=o.getMeta(r);if(a)return a;const u=o.getMeta("applyInputRules");return!!u&&setTimeout(()=>{let{text:h}=u;typeof h=="string"?h=h:h=Bc(oe.from(h),i.schema);const{from:f}=u,m=f+h.length;wf({editor:e,from:f,to:m,text:h,rules:n,plugin:r})}),o.selectionSet||o.docChanged?null:s}},props:{handleTextInput(o,s,i,a){return wf({editor:e,from:s,to:i,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:s}=o.state.selection;s&&wf({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?wf({editor:e,from:i.pos,to:i.pos,text:`
|
|
482
|
+
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var Wx=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{...lt(Me(this,"addOptions",{name:this.name}))}}get storage(){return{...lt(Me(this,"addStorage",{name:this.name,options:this.options}))}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>E6(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}},hr=class _6 extends Wx{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new _6(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)}},T6=class{constructor(t){this.find=t.find,this.handler=t.handler}},CV=(t,e,n)=>{if(Lx(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 SV(t){const{editor:e,state:n,from:r,to:o,rule:s,pasteEvent:i,dropEvent:a}=t,{commands:u,chain:d,can:h}=new zp({editor:e,state:n}),f=[];return n.doc.nodesBetween(r,o,(x,v)=>{var b,k,S,_,T;if((k=(b=x.type)==null?void 0:b.spec)!=null&&k.code||!(x.isText||x.isTextblock||x.isInline))return;const A=(T=(_=(S=x.content)==null?void 0:S.size)!=null?_:x.nodeSize)!=null?T:0,M=Math.max(r,v),D=Math.min(o,v+A);if(M>=D)return;const P=x.isText?x.text||"":x.textBetween(M-v,D-v,void 0,"");CV(P,s.find,i).forEach(I=>{if(I.index===void 0)return;const W=M+I.index+1,Z=W+I[0].length,J={from:n.tr.mapping.map(W),to:n.tr.mapping.map(Z)},K=s.handler({state:n,range:J,match:I,commands:u,chain:d,can:h,pasteEvent:i,dropEvent:a});f.push(K)})}),f.every(x=>x!==null)}var Cf=null,EV=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)==null||e.setData("text/html",t),n};function _V(t){const{editor:e,rules:n}=t;let r=null,o=!1,s=!1,i=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const u=({state:h,from:f,to:m,rule:x,pasteEvt:v})=>{const b=h.tr,k=Lp({state:h,transaction:b});if(!(!SV({editor:e,state:k,from:Math.max(f-1,0),to:m.b-1,rule:x,pasteEvent:v,dropEvent:a})||!b.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return i=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,b}};return n.map(h=>new Ct({view(f){const m=v=>{var b;r=(b=f.dom.parentElement)!=null&&b.contains(v.target)?f.dom.parentElement:null,r&&(Cf=e)},x=()=>{Cf&&(Cf=null)};return window.addEventListener("dragstart",m),window.addEventListener("dragend",x),{destroy(){window.removeEventListener("dragstart",m),window.removeEventListener("dragend",x)}}},props:{handleDOMEvents:{drop:(f,m)=>{if(s=r===f.dom.parentElement,a=m,!s){const x=Cf;x!=null&&x.isEditable&&setTimeout(()=>{const v=x.state.selection;v&&x.commands.deleteRange({from:v.from,to:v.to})},10)}return!1},paste:(f,m)=>{var x;const v=(x=m.clipboardData)==null?void 0:x.getData("text/html");return i=m,o=!!(v!=null&&v.includes("data-pm-slice")),!1}}},appendTransaction:(f,m,x)=>{const v=f[0],b=v.getMeta("uiEvent")==="paste"&&!o,k=v.getMeta("uiEvent")==="drop"&&!s,S=v.getMeta("applyPasteRules"),_=!!S;if(!b&&!k&&!_)return;if(_){let{text:M}=S;typeof M=="string"?M=M:M=Bc(oe.from(M),x.schema);const{from:D}=S,P=D+M.length,j=EV(M);return u({rule:h,state:x,from:D,to:{b:P},pasteEvt:j})}const T=m.doc.content.findDiffStart(x.doc.content),A=m.doc.content.findDiffEnd(x.doc.content);if(!(!fV(T)||!A||T===A.b))return u({rule:h,state:x,from:T,to:A,pasteEvt:i})}}))}var Bp=class{constructor(t,e){this.splittableMarks=[],this.nonClearableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=y6(t),this.schema=NB(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:pu(e.name,this.schema)},r=Me(e,"addCommands",n);return r?{...t,...r()}:t},{})}get plugins(){const{editor:t}=this;return Mu([...this.extensions].reverse()).flatMap(r=>{const o={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:pu(r.name,this.schema)},s=[],i=Me(r,"addKeyboardShortcuts",o);let a={};if(r.type==="mark"&&Me(r,"exitable",o)&&(a.ArrowRight=()=>hr.handleExit({editor:t,mark:r})),i){const m=Object.fromEntries(Object.entries(i()).map(([x,v])=>[x,()=>v({editor:t})]));a={...a,...m}}const u=A$(a);s.push(u);const d=Me(r,"addInputRules",o);if(NC(r,t.options.enableInputRules)&&d){const m=d();if(m&&m.length){const x=wV({editor:t,rules:m}),v=Array.isArray(x)?x:[x];s.push(...v)}}const h=Me(r,"addPasteRules",o);if(NC(r,t.options.enablePasteRules)&&h){const m=h();if(m&&m.length){const x=_V({editor:t,rules:m});s.push(...x)}}const f=Me(r,"addProseMirrorPlugins",o);if(f){const m=f();s.push(...m)}return s})}get attributes(){return g6(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=ml(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:Ut(n.name,this.schema)},s=Me(n,"addNodeView",o);if(!s)return[];const i=s();if(!i)return[];const a=(u,d,h,f,m)=>{const x=dc(u,r);return i({node:u,view:d,getPos:h,decorations:f,innerDecorations:m,editor:t,extension:n,HTMLAttributes:x})};return[n.name,a]}))}dispatchTransaction(t){const{editor:e}=this;return Mu([...this.extensions].reverse()).reduceRight((r,o)=>{const s={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:e,type:pu(o.name,this.schema)},i=Me(o,"dispatchTransaction",s);return i?a=>{i.call(s,{transaction:a,next:r})}:r},t)}transformPastedHTML(t){const{editor:e}=this;return Mu([...this.extensions]).reduce((r,o)=>{const s={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:e,type:pu(o.name,this.schema)},i=Me(o,"transformPastedHTML",s);return i?(a,u)=>{const d=r(a,u);return i.call(s,d)}:r},t||(r=>r))}get markViews(){const{editor:t}=this,{markExtensions:e}=ml(this.extensions);return Object.fromEntries(e.filter(n=>!!Me(n,"addMarkView")).map(n=>{const r=this.attributes.filter(a=>a.type===n.name),o={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:ms(n.name,this.schema)},s=Me(n,"addMarkView",o);if(!s)return[];const i=(a,u,d)=>{const h=dc(a,r);return s()({mark:a,view:u,inline:d,editor:t,extension:n,HTMLAttributes:h,updateAttributes:f=>{bV(a,t,f)}})};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:pu(e.name,this.schema)};e.type==="mark"&&(((n=lt(Me(e,"keepOnSplit",o)))==null||n)&&this.splittableMarks.push(e.name),(r=lt(Me(e,"clearable",o)))==null||r||this.nonClearableMarks.push(e.name));const s=Me(e,"onBeforeCreate",o),i=Me(e,"onCreate",o),a=Me(e,"onUpdate",o),u=Me(e,"onSelectionUpdate",o),d=Me(e,"onTransaction",o),h=Me(e,"onFocus",o),f=Me(e,"onBlur",o),m=Me(e,"onDestroy",o);s&&this.editor.on("beforeCreate",s),i&&this.editor.on("create",i),a&&this.editor.on("update",a),u&&this.editor.on("selectionUpdate",u),d&&this.editor.on("transaction",d),h&&this.editor.on("focus",h),f&&this.editor.on("blur",f),m&&this.editor.on("destroy",m)})}};Bp.resolve=y6;Bp.sort=Mu;Bp.flatten=Fx;var N6={};jx(N6,{ClipboardTextSerializer:()=>M6,Commands:()=>D6,Delete:()=>R6,Drop:()=>O6,Editable:()=>I6,FocusEvents:()=>j6,Keymap:()=>L6,Paste:()=>z6,Tabindex:()=>F6,TextDirection:()=>$6,focusEventsPluginKey:()=>P6});var St=class A6 extends Wx{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new A6(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},M6=St.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Ct({key:new Wt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:o}=e,s=v6(n),{blockSeparator:i}=this.options,a={...i!==void 0?{blockSeparator:i}:{},textSerializers:s};return[...o.ranges].sort((d,h)=>d.$from.pos-h.$from.pos).map(({$from:d,$to:h})=>x6(r,{from:d.pos,to:h.pos},a)).join(i??`
|
|
483
|
+
|
|
484
|
+
`)}}})]}}),D6=St.create({name:"commands",addCommands(){return{...i6}}}),R6=St.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r,o;const s=()=>{var i,a,u,d;if((d=(u=(a=(i=this.editor.options.coreExtensionOptions)==null?void 0:i.delete)==null?void 0:a.filterTransaction)==null?void 0:u.call(a,t))!=null?d:t.getMeta("y-sync$"))return;const h=p6(t.before,[t,...e]);$x(h).forEach(x=>{h.mapping.mapResult(x.oldRange.from).deletedAfter&&h.mapping.mapResult(x.oldRange.to).deletedBefore&&h.before.nodesBetween(x.oldRange.from,x.oldRange.to,(v,b)=>{const k=b+v.nodeSize-2,S=x.oldRange.from<=b&&k<=x.oldRange.to;this.editor.emit("delete",{type:"node",node:v,from:b,to:k,newFrom:h.mapping.map(b),newTo:h.mapping.map(k),deletedRange:x.oldRange,newRange:x.newRange,partial:!S,editor:this.editor,transaction:t,combinedTransform:h})})});const m=h.mapping;h.steps.forEach((x,v)=>{var b,k;if(x instanceof qr){const S=m.slice(v).map(x.from,-1),_=m.slice(v).map(x.to),T=m.invert().map(S,-1),A=m.invert().map(_),M=S>0?(b=h.doc.nodeAt(S-1))==null?void 0:b.marks.some(P=>P.eq(x.mark)):!1,D=(k=h.doc.nodeAt(_))==null?void 0:k.marks.some(P=>P.eq(x.mark));this.editor.emit("delete",{type:"mark",mark:x.mark,from:x.from,to:x.to,deletedRange:{from:T,to:A},newRange:{from:S,to:_},partial:!!(D||M),editor:this.editor,transaction:t,combinedTransform:h})}})};(o=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||o?setTimeout(s,0):s()}}),O6=St.create({name:"drop",addProseMirrorPlugins(){return[new Ct({key:new Wt("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),I6=St.create({name:"editable",addProseMirrorPlugins(){return[new Ct({key:new Wt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),P6=new Wt("focusEvents"),j6=St.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Ct({key:P6,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}}}})]}}),L6=St.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:i})=>[()=>i.undoInputRule(),()=>i.command(({tr:a})=>{const{selection:u,doc:d}=a,{empty:h,$anchor:f}=u,{pos:m,parent:x}=f,v=f.parent.isTextblock&&m>0?a.doc.resolve(m-1):f,b=v.parent.type.spec.isolating,k=f.pos-f.parentOffset,S=b&&v.parent.childCount===1?k===f.pos:Ue.atStart(d).from===m;return!h||!x.type.isTextblock||x.textContent.length||!S||S&&f.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 xh()||f6()?s:o},addProseMirrorPlugins(){return[new Ct({key:new Wt("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:a}=e.selection,u=Ue.atStart(e.doc).from,d=Ue.atEnd(e.doc).to;if(s||!(i===u&&a===d)||!Vc(n.doc))return;const m=n.tr,x=Lp({state:n,transaction:m}),{commands:v}=new zp({editor:this.editor,state:x});if(v.clearNodes(),!!m.steps.length)return m}})]}}),z6=St.create({name:"paste",addProseMirrorPlugins(){return[new Ct({key:new Wt("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),F6=St.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new Ct({key:new Wt("tabindex"),props:{attributes:()=>{var t;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(t=this.options.value)!=null?t:"0"}}}})]}}),$6=St.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=ml(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 Ct({key:new Wt("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}}),TV=class Cu{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 Cu(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 Cu(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 Cu(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,a=this.pos+r+(s?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;const u=this.resolvedPos.doc.resolve(a);if(!o&&!i&&u.depth<=this.depth)return;const d=new Cu(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 a=0;a<i.length;a+=1){const u=i[a];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)}},NV=`.ProseMirror {
|
|
485
|
+
position: relative;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
.ProseMirror {
|
|
489
|
+
word-wrap: break-word;
|
|
490
|
+
white-space: pre-wrap;
|
|
491
|
+
white-space: break-spaces;
|
|
492
|
+
-webkit-font-variant-ligatures: none;
|
|
493
|
+
font-variant-ligatures: none;
|
|
494
|
+
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
.ProseMirror [contenteditable="false"] {
|
|
498
|
+
white-space: normal;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
502
|
+
white-space: pre-wrap;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
.ProseMirror pre {
|
|
506
|
+
white-space: pre-wrap;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
img.ProseMirror-separator {
|
|
510
|
+
display: inline !important;
|
|
511
|
+
border: none !important;
|
|
512
|
+
margin: 0 !important;
|
|
513
|
+
width: 0 !important;
|
|
514
|
+
height: 0 !important;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
.ProseMirror-gapcursor {
|
|
518
|
+
display: none;
|
|
519
|
+
pointer-events: none;
|
|
520
|
+
position: absolute;
|
|
521
|
+
margin: 0;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
.ProseMirror-gapcursor:after {
|
|
525
|
+
content: "";
|
|
526
|
+
display: block;
|
|
527
|
+
position: absolute;
|
|
528
|
+
top: -2px;
|
|
529
|
+
width: 20px;
|
|
530
|
+
border-top: 1px solid black;
|
|
531
|
+
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
@keyframes ProseMirror-cursor-blink {
|
|
535
|
+
to {
|
|
536
|
+
visibility: hidden;
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
.ProseMirror-hideselection *::selection {
|
|
541
|
+
background: transparent;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
.ProseMirror-hideselection *::-moz-selection {
|
|
545
|
+
background: transparent;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
.ProseMirror-hideselection * {
|
|
549
|
+
caret-color: transparent;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
553
|
+
display: block;
|
|
554
|
+
}`,AV=class extends uV{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:FB,createMappablePosition:$B},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=oy(e,this.options.autofocus);this.editorState=$i.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=dV(NV,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=m6(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?[I6,M6.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),D6,j6,L6,F6.configure({value:(r=(n=this.options.coreExtensionOptions)==null?void 0:n.tabindex)==null?void 0:r.value}),O6,z6,R6,$6.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 Bp(s,this)}createCommandManager(){this.commandManager=new zp({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=sy(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=sy(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=$i.create({doc:n,schema:this.schema,selection:oy(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 o6(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 a=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(a),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 h;return(h=this.capturedTransaction)==null?void 0:h.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")),a=i==null?void 0:i.getMeta("focus"),u=i==null?void 0:i.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.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 b6(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return jB(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Bc(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
|
|
555
|
+
|
|
556
|
+
`,textSerializers:n={}}=t||{};return MB(this.state.doc,{blockSeparator:e,textSerializers:{...v6(this.schema),...n}})}get isEmpty(){return Vc(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 TV(e,this,!1,n)}get $doc(){return this.$pos(0)}};function sa(t){return new Hc({find:t.find,handler:({state:e,range:n,match:r})=>{const o=lt(t.getAttributes,void 0,r);if(o===!1||o===null)return null;const{tr:s}=e,i=r[r.length-1],a=r[0];if(i){const u=a.search(/\S/),d=n.from+a.indexOf(i),h=d+i.length;if(Bx(n.from,n.to,e.doc).filter(x=>x.mark.type.excluded.find(b=>b===t.type&&b!==x.mark.type)).filter(x=>x.to>d).length)return null;h<n.to&&s.delete(h,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 MV(t){return new Hc({find:t.find,handler:({state:e,range:n,match:r})=>{const o=lt(t.getAttributes,void 0,r)||{},{tr:s}=e,i=n.from;let a=n.to;const u=t.type.create(o);if(r[1]){const d=r[0].lastIndexOf(r[1]);let h=i+d;h>a?h=a:a=h+r[1].length;const f=r[0][r[0].length-1];s.insertText(f,i+r[0].length-1),s.replaceWith(h,a,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(a))}s.scrollIntoView()},undoable:t.undoable})}function ly(t){return new Hc({find:t.find,handler:({state:e,range:n,match:r})=>{const o=e.doc.resolve(n.from),s=lt(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 gl(t){return new Hc({find:t.find,handler:({state:e,range:n,match:r,chain:o})=>{const s=lt(t.getAttributes,void 0,r)||{},i=e.tr.delete(n.from,n.to),u=i.doc.resolve(n.from).blockRange(),d=u&&kx(u,t.type,s);if(!d)return null;if(i.wrap(u,d),t.keepMarks&&t.editor){const{selection:f,storedMarks:m}=e,{splittableMarks:x}=t.editor.extensionManager,v=m||f.$to.parentOffset&&f.$from.marks();if(v){const b=v.filter(k=>x.includes(k.type.name));i.ensureMarks(b)}}if(t.keepAttributes){const f=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";o().updateAttributes(f,s).run()}const h=i.doc.resolve(n.from-1).nodeBefore;h&&h.type===t.type&&yi(i.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,h))&&i.join(n.from-1)},undoable:t.undoable})}var ht=class B6 extends Wx{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new B6(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function fi(t){return new T6({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:o})=>{const s=lt(t.getAttributes,void 0,r,o);if(s===!1||s===null)return null;const{tr:i}=e,a=r[r.length-1],u=r[0];let d=n.to;if(a){const h=u.search(/\S/),f=n.from+u.indexOf(a),m=f+a.length;if(Bx(n.from,n.to,e.doc).filter(b=>b.mark.type.excluded.find(S=>S===t.type&&S!==b.mark.type)).filter(b=>b.to>f).length)return null;m<n.to&&i.delete(m,n.to),f>n.from&&i.delete(n.from+h,f),d=n.from+h+a.length,i.addMark(n.from+h,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:DV,getOwnPropertySymbols:RV}=Object,{hasOwnProperty:OV}=Object.prototype;function Mg(t,e){return function(r,o,s){return t(r,o,s)&&e(r,o,s)}}function Sf(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),a=s.get(r);if(i&&a)return i===r&&a===n;s.set(n,r),s.set(r,n);const u=t(n,r,o);return s.delete(n),s.delete(r),u}}function IV(t){return t!=null?t[Symbol.toStringTag]:void 0}function DC(t){return DV(t).concat(RV(t))}const PV=Object.hasOwn||((t,e)=>OV.call(t,e));function pa(t,e){return t===e||!t&&!e&&t!==t&&e!==e}const jV="__v",LV="__o",zV="_owner",{getOwnPropertyDescriptor:RC,keys:OC}=Object;function FV(t,e){return t.byteLength===e.byteLength&&vh(new Uint8Array(t),new Uint8Array(e))}function $V(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 BV(t,e){return t.byteLength===e.byteLength&&vh(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function VV(t,e){return pa(t.getTime(),e.getTime())}function HV(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function UV(t,e){return t===e}function IC(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,a,u=0;for(;(i=s.next())&&!i.done;){const d=e.entries();let h=!1,f=0;for(;(a=d.next())&&!a.done;){if(o[f]){f++;continue}const m=i.value,x=a.value;if(n.equals(m[0],x[0],u,f,t,e,n)&&n.equals(m[1],x[1],m[0],x[0],t,e,n)){h=o[f]=!0;break}f++}if(!h)return!1;u++}return!0}const WV=pa;function qV(t,e,n){const r=OC(t);let o=r.length;if(OC(e).length!==o)return!1;for(;o-- >0;)if(!V6(t,e,n,r[o]))return!1;return!0}function mu(t,e,n){const r=DC(t);let o=r.length;if(DC(e).length!==o)return!1;let s,i,a;for(;o-- >0;)if(s=r[o],!V6(t,e,n,s)||(i=RC(t,s),a=RC(e,s),(i||a)&&(!i||!a||i.configurable!==a.configurable||i.enumerable!==a.enumerable||i.writable!==a.writable)))return!1;return!0}function KV(t,e){return pa(t.valueOf(),e.valueOf())}function GV(t,e){return t.source===e.source&&t.flags===e.flags}function PC(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,a;for(;(i=s.next())&&!i.done;){const u=e.values();let d=!1,h=0;for(;(a=u.next())&&!a.done;){if(!o[h]&&n.equals(i.value,a.value,i.value,a.value,t,e,n)){d=o[h]=!0;break}h++}if(!d)return!1}return!0}function vh(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 JV(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 V6(t,e,n,r){return(r===zV||r===LV||r===jV)&&(t.$$typeof||e.$$typeof)?!0:PV(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}const ZV="[object ArrayBuffer]",YV="[object Arguments]",XV="[object Boolean]",QV="[object DataView]",eH="[object Date]",tH="[object Error]",nH="[object Map]",rH="[object Number]",oH="[object Object]",sH="[object RegExp]",iH="[object Set]",aH="[object String]",lH={"[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},uH="[object URL]",cH=Object.prototype.toString;function dH({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:o,areFunctionsEqual:s,areMapsEqual:i,areNumbersEqual:a,areObjectsEqual:u,arePrimitiveWrappersEqual:d,areRegExpsEqual:h,areSetsEqual:f,areTypedArraysEqual:m,areUrlsEqual:x,unknownTagComparators:v}){return function(k,S,_){if(k===S)return!0;if(k==null||S==null)return!1;const T=typeof k;if(T!==typeof S)return!1;if(T!=="object")return T==="number"?a(k,S,_):T==="function"?s(k,S,_):!1;const A=k.constructor;if(A!==S.constructor)return!1;if(A===Object)return u(k,S,_);if(Array.isArray(k))return e(k,S,_);if(A===Date)return r(k,S,_);if(A===RegExp)return h(k,S,_);if(A===Map)return i(k,S,_);if(A===Set)return f(k,S,_);const M=cH.call(k);if(M===eH)return r(k,S,_);if(M===sH)return h(k,S,_);if(M===nH)return i(k,S,_);if(M===iH)return f(k,S,_);if(M===oH)return typeof k.then!="function"&&typeof S.then!="function"&&u(k,S,_);if(M===uH)return x(k,S,_);if(M===tH)return o(k,S,_);if(M===YV)return u(k,S,_);if(lH[M])return m(k,S,_);if(M===ZV)return t(k,S,_);if(M===QV)return n(k,S,_);if(M===XV||M===rH||M===aH)return d(k,S,_);if(v){let D=v[M];if(!D){const P=IV(k);P&&(D=v[P])}if(D)return D(k,S,_)}return!1}}function fH({circular:t,createCustomConfig:e,strict:n}){let r={areArrayBuffersEqual:FV,areArraysEqual:n?mu:$V,areDataViewsEqual:BV,areDatesEqual:VV,areErrorsEqual:HV,areFunctionsEqual:UV,areMapsEqual:n?Mg(IC,mu):IC,areNumbersEqual:WV,areObjectsEqual:n?mu:qV,arePrimitiveWrappersEqual:KV,areRegExpsEqual:GV,areSetsEqual:n?Mg(PC,mu):PC,areTypedArraysEqual:n?Mg(vh,mu):vh,areUrlsEqual:JV,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),t){const o=Sf(r.areArraysEqual),s=Sf(r.areMapsEqual),i=Sf(r.areObjectsEqual),a=Sf(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:o,areMapsEqual:s,areObjectsEqual:i,areSetsEqual:a})}return r}function hH(t){return function(e,n,r,o,s,i,a){return t(e,n,a)}}function pH({circular:t,comparator:e,createState:n,equals:r,strict:o}){if(n)return function(a,u){const{cache:d=t?new WeakMap:void 0,meta:h}=n();return e(a,u,{cache:d,equals:r,meta:h,strict:o})};if(t)return function(a,u){return e(a,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(a,u){return e(a,u,s)}}const mH=vi();vi({strict:!0});vi({circular:!0});vi({circular:!0,strict:!0});vi({createInternalComparator:()=>pa});vi({strict:!0,createInternalComparator:()=>pa});vi({circular:!0,createInternalComparator:()=>pa});vi({circular:!0,createInternalComparator:()=>pa,strict:!0});function vi(t={}){const{circular:e=!1,createInternalComparator:n,createState:r,strict:o=!1}=t,s=fH(t),i=dH(s),a=n?n(i):hH(i);return pH({circular:e,comparator:i,createState:r,equals:a,strict:o})}var Dg={exports:{}},Rg={};/**
|
|
557
|
+
* @license React
|
|
558
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
559
|
+
*
|
|
560
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
561
|
+
*
|
|
562
|
+
* This source code is licensed under the MIT license found in the
|
|
563
|
+
* LICENSE file in the root directory of this source tree.
|
|
564
|
+
*/var jC;function gH(){if(jC)return Rg;jC=1;var t=Sc(),e=__();function n(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var r=typeof Object.is=="function"?Object.is:n,o=e.useSyncExternalStore,s=t.useRef,i=t.useEffect,a=t.useMemo,u=t.useDebugValue;return Rg.useSyncExternalStoreWithSelector=function(d,h,f,m,x){var v=s(null);if(v.current===null){var b={hasValue:!1,value:null};v.current=b}else b=v.current;v=a(function(){function S(D){if(!_){if(_=!0,T=D,D=m(D),x!==void 0&&b.hasValue){var P=b.value;if(x(P,D))return A=P}return A=D}if(P=A,r(T,D))return P;var j=m(D);return x!==void 0&&x(P,j)?(T=D,P):(T=D,A=j)}var _=!1,T,A,M=f===void 0?null:f;return[function(){return S(h())},M===null?void 0:function(){return S(M())}]},[h,f,m,x]);var k=o(d,v[0],v[1]);return i(function(){b.hasValue=!0,b.value=k},[k]),u(k),k},Rg}var LC;function yH(){return LC||(LC=1,Dg.exports=gH()),Dg.exports}var xH=yH(),vH=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},bH=({contentComponent:t})=>{const e=T_.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return g.jsx(g.Fragment,{children:Object.values(e)})};function kH(){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]:QS.createPortal(s.reactElement,s.element,o)},r()},removeRenderer(o){const s={...e};delete s[o],e=s,r()}}}var wH=class extends ne.Component{constructor(t){super(t),this.editorContentRef=ne.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=kH(),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 g.jsxs(g.Fragment,{children:[g.jsx("div",{ref:vH(e,this.editorContentRef),...n}),(t==null?void 0:t.contentComponent)&&g.jsx(bH,{contentComponent:t.contentComponent})]})}},CH=C.forwardRef((t,e)=>{const n=ne.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return ne.createElement(wH,{key:n,innerRef:e,...t})}),H6=ne.memo(CH),SH=typeof window<"u"?C.useLayoutEffect:C.useEffect,EH=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 _H(t){var e;const[n]=C.useState(()=>new EH(t.editor)),r=xH.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!=null?e:mH);return SH(()=>n.watch(t.editor),[t.editor,n]),C.useDebugValue(r),r}var TH=!1,U6=typeof window>"u",NH=U6||!!(typeof window<"u"&&window.next),AH=class W6{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 U6?(n&&TH&&console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"),n=!1):NH&&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 AV(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?W6.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 MH(t={},e=[]){const n=C.useRef(t);n.current=t;const[r]=C.useState(()=>new AH(n)),o=T_.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return C.useDebugValue(o),C.useEffect(r.onRender(e)),_H({editor:o,selector:({transactionNumber:s})=>t.shouldRerenderOnTransaction===!1||t.shouldRerenderOnTransaction===void 0?null:t.immediatelyRender&&s===0?0:s+1}),o}var q6=C.createContext({editor:null});q6.Consumer;var DH=C.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),RH=()=>C.useContext(DH);ne.forwardRef((t,e)=>{const{onDragStart:n}=RH(),r=t.as||"div";return g.jsx(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});ne.createContext({markViewContentRef:()=>{}});var qx=C.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});qx.displayName="TiptapContext";var OH=()=>C.useContext(qx);function K6({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 g.jsx(q6.Provider,{value:o,children:g.jsx(qx.Provider,{value:r,children:t})})}K6.displayName="Tiptap";function G6({...t}){const{editor:e}=OH();return g.jsx(H6,{editor:e,...t})}G6.displayName="Tiptap.Content";Object.assign(K6,{Content:G6});var bh=(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]},IH=(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 a=i.depth-1;if(a<0)return!1;const u=i.node(a),d=i.index(a);if(d===0)return!1;if(u.type===e)return t.commands.lift(e.name);const h=u.child(d-1);if(h.type!==e||!((n=h.lastChild)!=null&&n.isTextblock))return!1;const f=i.before(),x=f-1-1,{tr:v}=r;return v.delete(f,i.after()).insert(x,i.parent.content),v.setSelection(ze.create(v.doc,x)),o.dispatch(v.scrollIntoView()),!0},PH=/^\s*>\s$/,jH=ht.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return bh("blockquote",{...tn(this.options.HTMLAttributes,t),children:bh("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,a;const h=((a=(i=e.renderChild)==null?void 0:i.call(e,o,s))!=null?a:e.renderChildren([o])).split(`
|
|
565
|
+
`).map(f=>f.trim()===""?n:`${n} ${f}`);r.push(h.join(`
|
|
566
|
+
`))}),r.join(`
|
|
567
|
+
${n}
|
|
568
|
+
`)},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:()=>IH(this.editor,this.type)}},addInputRules(){return[gl({find:PH,type:this.type})]}}),LH=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,zH=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,FH=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,$H=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,BH=hr.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 bh("strong",{...tn(this.options.HTMLAttributes,t),children:bh("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[sa({find:LH,type:this.type}),sa({find:FH,type:this.type})]},addPasteRules(){return[fi({find:zH,type:this.type}),fi({find:$H,type:this.type})]}}),VH=t=>{const e=/`([^`]+)`(?!`)$/.exec(t);return!e||e.index>0&&t[e.index-1]==="`"?null:{index:e.index,text:e[0],replaceWith:e[1]}},HH=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},UH=hr.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",tn(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[sa({find:VH,type:this.type})]},addPasteRules(){return[fi({find:HH,type:this.type})]}}),Og=4,WH=/^```([a-z]+)?[\s\n]$/,qH=/^~~~([a-z]+)?[\s\n]$/,KH=ht.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:Og,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",tn(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(`
|
|
569
|
+
`):r=`\`\`\`${o}
|
|
570
|
+
|
|
571
|
+
\`\`\``,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:Og,{state:r}=t,{selection:o}=r,{$from:s,empty:i}=o;if(s.parent.type!==this.type)return!1;const a=" ".repeat(n);return i?t.commands.insertContent(a):t.commands.command(({tr:u})=>{const{from:d,to:h}=o,x=r.doc.textBetween(d,h,`
|
|
572
|
+
`,`
|
|
573
|
+
`).split(`
|
|
574
|
+
`).map(v=>a+v).join(`
|
|
575
|
+
`);return u.replaceWith(d,h,r.schema.text(x)),!0})},"Shift-Tab":({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:Og,{state:r}=t,{selection:o}=r,{$from:s,empty:i}=o;return s.parent.type!==this.type?!1:i?t.commands.command(({tr:a})=>{var u;const{pos:d}=s,h=s.start(),f=s.end(),x=r.doc.textBetween(h,f,`
|
|
576
|
+
`,`
|
|
577
|
+
`).split(`
|
|
578
|
+
`);let v=0,b=0;const k=d-h;for(let D=0;D<x.length;D+=1){if(b+x[D].length>=k){v=D;break}b+=x[D].length+1}const _=((u=x[v].match(/^ */))==null?void 0:u[0])||"",T=Math.min(_.length,n);if(T===0)return!0;let A=h;for(let D=0;D<v;D+=1)A+=x[D].length+1;return a.delete(A,A+T),d-A<=T&&a.setSelection(ze.create(a.doc,A)),!0}):t.commands.command(({tr:a})=>{const{from:u,to:d}=o,m=r.doc.textBetween(u,d,`
|
|
579
|
+
`,`
|
|
580
|
+
`).split(`
|
|
581
|
+
`).map(x=>{var v;const b=((v=x.match(/^ */))==null?void 0:v[0])||"",k=Math.min(b.length,n);return x.slice(k)}).join(`
|
|
582
|
+
`);return a.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(`
|
|
583
|
+
|
|
584
|
+
`);return!s||!i?!1:t.chain().command(({tr:a})=>(a.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 a=o.after();return a===void 0?!1:r.nodeAt(a)?t.commands.command(({tr:d})=>(d.setSelection(Ue.near(r.resolve(a))),!0)):t.commands.exitCode()}}},addInputRules(){return[ly({find:WH,type:this.type,getAttributes:t=>({language:t[1]})}),ly({find:qH,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Ct({key:new Wt("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:a}=t.state,u=a.text(n.replace(/\r\n?/g,`
|
|
585
|
+
`));return i.replaceSelectionWith(this.type.create({language:s},u)),i.selection.$from.parent.type!==this.type&&i.setSelection(ze.near(i.doc.resolve(Math.max(0,i.selection.from-2)))),i.setMeta("paste",!0),t.dispatch(i),!0}}})]}}),GH=ht.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
|
|
586
|
+
|
|
587
|
+
`):""}),JH=ht.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",tn(this.options.HTMLAttributes,t)]},renderText(){return`
|
|
588
|
+
`},renderMarkdown:()=>`
|
|
589
|
+
`,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:a}=r.extensionManager,u=s||o.$to.parentOffset&&o.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:h})=>{if(h&&u&&i){const f=u.filter(m=>a.includes(m.type.name));d.ensureMarks(f)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),ZH=ht.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]}`,tn(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=>ly({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),YH=ht.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",tn(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!cV(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$to:r}=n,o=t();return k6(n)?o.insertContentAt(r.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({state:s,tr:i,dispatch:a})=>{if(a){const{$to:u}=i.selection,d=u.end();if(u.nodeAfter)u.nodeAfter.isTextblock?i.setSelection(ze.create(i.doc,u.pos+1)):u.nodeAfter.isBlock?i.setSelection(Pe.create(i.doc,u.pos)):i.setSelection(ze.create(i.doc,u.pos));else{const h=s.schema.nodes[this.options.nextNodeType]||u.parent.type.contentMatch.defaultType,f=h==null?void 0:h.create();f&&(i.insert(d,f),i.setSelection(ze.create(i.doc,d+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[MV({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),XH=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,QH=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,eU=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,tU=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,nU=hr.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",tn(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[sa({find:XH,type:this.type}),sa({find:eU,type:this.type})]},addPasteRules(){return[fi({find:QH,type:this.type}),fi({find:tU,type:this.type})]}});const rU="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",oU="ελ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",uy="numeric",cy="ascii",dy="alpha",Du="asciinumeric",Su="alphanumeric",fy="domain",J6="emoji",sU="scheme",iU="slashscheme",Ig="whitespace";function aU(t,e){return t in e||(e[t]=[]),e[t]}function Ui(t,e,n){e[uy]&&(e[Du]=!0,e[Su]=!0),e[cy]&&(e[Du]=!0,e[dy]=!0),e[Du]&&(e[Su]=!0),e[dy]&&(e[Su]=!0),e[Su]&&(e[fy]=!0),e[J6]&&(e[fy]=!0);for(const r in e){const o=aU(r,n);o.indexOf(t)<0&&o.push(t)}}function lU(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function Xn(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}Xn.groups={};Xn.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||Xn.groups;let o;return e&&e.j?o=e:(o=new Xn(e),n&&r&&Ui(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||Xn.groups;const o=this;if(e&&e.j)return o.j[t]=e,e;const s=e;let i,a=o.go(t);if(a?(i=new Xn,Object.assign(i.j,a.j),i.jr.push.apply(i.jr,a.jr),i.jd=a.jd,i.t=a.t):i=new Xn,s){if(r)if(i.t&&typeof i.t=="string"){const u=Object.assign(lU(i.t,r),n);Ui(s,u,r)}else n&&Ui(s,n,r);i.t=s}return o.j[t]=i,i}};const We=(t,e,n,r,o)=>t.ta(e,n,r,o),Dt=(t,e,n,r,o)=>t.tr(e,n,r,o),zC=(t,e,n,r,o)=>t.ts(e,n,r,o),ue=(t,e,n,r,o)=>t.tt(e,n,r,o),qo="WORD",hy="UWORD",Z6="ASCIINUMERICAL",Y6="ALPHANUMERICAL",fc="LOCALHOST",py="TLD",my="UTLD",qf="SCHEME",Ja="SLASH_SCHEME",Kx="NUM",gy="WS",Gx="NL",Ru="OPENBRACE",Ou="CLOSEBRACE",kh="OPENBRACKET",wh="CLOSEBRACKET",Ch="OPENPAREN",Sh="CLOSEPAREN",Eh="OPENANGLEBRACKET",_h="CLOSEANGLEBRACKET",Th="FULLWIDTHLEFTPAREN",Nh="FULLWIDTHRIGHTPAREN",Ah="LEFTCORNERBRACKET",Mh="RIGHTCORNERBRACKET",Dh="LEFTWHITECORNERBRACKET",Rh="RIGHTWHITECORNERBRACKET",Oh="FULLWIDTHLESSTHAN",Ih="FULLWIDTHGREATERTHAN",Ph="AMPERSAND",jh="APOSTROPHE",Lh="ASTERISK",Vs="AT",zh="BACKSLASH",Fh="BACKTICK",$h="CARET",Wi="COLON",Jx="COMMA",Bh="DOLLAR",fo="DOT",Vh="EQUALS",Zx="EXCLAMATION",Sr="HYPHEN",Iu="PERCENT",Hh="PIPE",Uh="PLUS",Wh="POUND",Pu="QUERY",Yx="QUOTE",X6="FULLWIDTHMIDDLEDOT",Xx="SEMI",ho="SLASH",ju="TILDE",qh="UNDERSCORE",Q6="EMOJI",Kh="SYM";var eT=Object.freeze({__proto__:null,ALPHANUMERICAL:Y6,AMPERSAND:Ph,APOSTROPHE:jh,ASCIINUMERICAL:Z6,ASTERISK:Lh,AT:Vs,BACKSLASH:zh,BACKTICK:Fh,CARET:$h,CLOSEANGLEBRACKET:_h,CLOSEBRACE:Ou,CLOSEBRACKET:wh,CLOSEPAREN:Sh,COLON:Wi,COMMA:Jx,DOLLAR:Bh,DOT:fo,EMOJI:Q6,EQUALS:Vh,EXCLAMATION:Zx,FULLWIDTHGREATERTHAN:Ih,FULLWIDTHLEFTPAREN:Th,FULLWIDTHLESSTHAN:Oh,FULLWIDTHMIDDLEDOT:X6,FULLWIDTHRIGHTPAREN:Nh,HYPHEN:Sr,LEFTCORNERBRACKET:Ah,LEFTWHITECORNERBRACKET:Dh,LOCALHOST:fc,NL:Gx,NUM:Kx,OPENANGLEBRACKET:Eh,OPENBRACE:Ru,OPENBRACKET:kh,OPENPAREN:Ch,PERCENT:Iu,PIPE:Hh,PLUS:Uh,POUND:Wh,QUERY:Pu,QUOTE:Yx,RIGHTCORNERBRACKET:Mh,RIGHTWHITECORNERBRACKET:Rh,SCHEME:qf,SEMI:Xx,SLASH:ho,SLASH_SCHEME:Ja,SYM:Kh,TILDE:ju,TLD:py,UNDERSCORE:qh,UTLD:my,UWORD:hy,WORD:qo,WS:gy});const Ho=/[a-z]/,gu=new RegExp("\\p{L}","u"),Pg=new RegExp("\\p{Emoji}","u"),Uo=/\d/,jg=/\s/,FC="\r",Lg=`
|
|
590
|
+
`,uU="️",cU="",zg="";let Ef=null,_f=null;function dU(t=[]){const e={};Xn.groups=e;const n=new Xn;Ef==null&&(Ef=$C(rU)),_f==null&&(_f=$C(oU)),ue(n,"'",jh),ue(n,"{",Ru),ue(n,"}",Ou),ue(n,"[",kh),ue(n,"]",wh),ue(n,"(",Ch),ue(n,")",Sh),ue(n,"<",Eh),ue(n,">",_h),ue(n,"(",Th),ue(n,")",Nh),ue(n,"「",Ah),ue(n,"」",Mh),ue(n,"『",Dh),ue(n,"』",Rh),ue(n,"<",Oh),ue(n,">",Ih),ue(n,"&",Ph),ue(n,"*",Lh),ue(n,"@",Vs),ue(n,"`",Fh),ue(n,"^",$h),ue(n,":",Wi),ue(n,",",Jx),ue(n,"$",Bh),ue(n,".",fo),ue(n,"=",Vh),ue(n,"!",Zx),ue(n,"-",Sr),ue(n,"%",Iu),ue(n,"|",Hh),ue(n,"+",Uh),ue(n,"#",Wh),ue(n,"?",Pu),ue(n,'"',Yx),ue(n,"/",ho),ue(n,";",Xx),ue(n,"~",ju),ue(n,"_",qh),ue(n,"\\",zh),ue(n,"・",X6);const r=Dt(n,Uo,Kx,{[uy]:!0});Dt(r,Uo,r);const o=Dt(r,Ho,Z6,{[Du]:!0}),s=Dt(r,gu,Y6,{[Su]:!0}),i=Dt(n,Ho,qo,{[cy]:!0});Dt(i,Uo,o),Dt(i,Ho,i),Dt(o,Uo,o),Dt(o,Ho,o);const a=Dt(n,gu,hy,{[dy]:!0});Dt(a,Ho),Dt(a,Uo,s),Dt(a,gu,a),Dt(s,Uo,s),Dt(s,Ho),Dt(s,gu,s);const u=ue(n,Lg,Gx,{[Ig]:!0}),d=ue(n,FC,gy,{[Ig]:!0}),h=Dt(n,jg,gy,{[Ig]:!0});ue(n,zg,h),ue(d,Lg,u),ue(d,zg,h),Dt(d,jg,h),ue(h,FC),ue(h,Lg),Dt(h,jg,h),ue(h,zg,h);const f=Dt(n,Pg,Q6,{[J6]:!0});ue(f,"#"),Dt(f,Pg,f),ue(f,uU,f);const m=ue(f,cU);ue(m,"#"),Dt(m,Pg,f);const x=[[Ho,i],[Uo,o]],v=[[Ho,null],[gu,a],[Uo,s]];for(let b=0;b<Ef.length;b++)zs(n,Ef[b],py,qo,x);for(let b=0;b<_f.length;b++)zs(n,_f[b],my,hy,v);Ui(py,{tld:!0,ascii:!0},e),Ui(my,{utld:!0,alpha:!0},e),zs(n,"file",qf,qo,x),zs(n,"mailto",qf,qo,x),zs(n,"http",Ja,qo,x),zs(n,"https",Ja,qo,x),zs(n,"ftp",Ja,qo,x),zs(n,"ftps",Ja,qo,x),Ui(qf,{scheme:!0,ascii:!0},e),Ui(Ja,{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]?{[sU]:!0}:{[iU]:!0};k.indexOf("-")>=0?_[fy]=!0:Ho.test(k)?Uo.test(k)?_[Du]=!0:_[cy]=!0:_[uy]=!0,zC(n,k,k,_)}return zC(n,"localhost",fc,{ascii:!0}),n.jd=new Xn(Kh),{start:n,tokens:Object.assign({groups:e},eT)}}function tT(t,e){const n=fU(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,o=[];let s=0,i=0;for(;i<r;){let a=t,u=null,d=0,h=null,f=-1,m=-1;for(;i<r&&(u=a.go(n[i]));)a=u,a.accepts()?(f=0,m=0,h=a):f>=0&&(f+=n[i].length,m++),d+=n[i].length,s+=n[i].length,i++;s-=f,i-=m,d-=f,o.push({t:h.t,v:e.slice(s-d,s),s:s-d,e:s})}return o}function fU(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 zs(t,e,n,r,o){let s;const i=e.length;for(let a=0;a<i-1;a++){const u=e[a];t.j[u]?s=t.j[u]:(s=new Xn(r),s.jr=o.slice(),t.j[u]=s),t=s}return s=new Xn(n),s.jr=o.slice(),t.j[e[i-1]]=s,s}function $C(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 hc={defaultProtocol:"http",events:null,format:BC,formatHref:BC,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Qx(t,e=null){let n=Object.assign({},hc);t&&(n=Object.assign(n,t instanceof Qx?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}Qx.prototype={o:hc,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]:hc[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 BC(t){return t}function nT(t,e){this.t="token",this.v=t,this.tk=e}nT.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=hc.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={},a=t.get("className",n,e),u=t.get("target",n,e),d=t.get("rel",n,e),h=t.getObj("attributes",n,e),f=t.getObj("events",n,e);return i.href=r,a&&(i.class=a),u&&(i.target=u),d&&(i.rel=d),h&&Object.assign(i,h),{tagName:o,attributes:i,content:s,eventListeners:f}}};function Vp(t,e){class n extends nT{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 hU=Vp("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),VC=Vp("text"),pU=Vp("nl"),Tf=Vp("url",{isLink:!0,toHref(t=hc.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==fc&&t[1].t===Wi}}),Cr=t=>new Xn(t);function mU({groups:t}){const e=t.domain.concat([Ph,Lh,Vs,zh,Fh,$h,Bh,Vh,Sr,Kx,Iu,Hh,Uh,Wh,ho,Kh,ju,qh]),n=[jh,Wi,Jx,fo,Zx,Iu,Pu,Yx,Xx,Eh,_h,Ru,Ou,wh,kh,Ch,Sh,Th,Nh,Ah,Mh,Dh,Rh,Oh,Ih],r=[Ph,jh,Lh,zh,Fh,$h,Bh,Vh,Sr,Ru,Ou,Iu,Hh,Uh,Wh,Pu,ho,Kh,ju,qh],o=Cr(),s=ue(o,ju);We(s,r,s),We(s,t.domain,s);const i=Cr(),a=Cr(),u=Cr();We(o,t.domain,i),We(o,t.scheme,a),We(o,t.slashscheme,u),We(i,r,s),We(i,t.domain,i);const d=ue(i,Vs);ue(s,Vs,d),ue(a,Vs,d),ue(u,Vs,d);const h=ue(s,fo);We(h,r,s),We(h,t.domain,s);const f=Cr();We(d,t.domain,f),We(f,t.domain,f);const m=ue(f,fo);We(m,t.domain,f);const x=Cr(hU);We(m,t.tld,x),We(m,t.utld,x),ue(d,fc,x);const v=ue(f,Sr);ue(v,Sr,v),We(v,t.domain,f),We(x,t.domain,f),ue(x,fo,m),ue(x,Sr,v);const b=ue(i,Sr),k=ue(i,fo);ue(b,Sr,b),We(b,t.domain,i),We(k,r,s),We(k,t.domain,i);const S=Cr(Tf);We(k,t.tld,S),We(k,t.utld,S),We(S,t.domain,i),We(S,r,s),ue(S,fo,k),ue(S,Sr,b),ue(S,Vs,d);const _=ue(S,Wi),T=Cr(Tf);We(_,t.numeric,T);const A=Cr(Tf),M=Cr();We(A,e,A),We(A,n,M),We(M,e,A),We(M,n,M),ue(S,ho,A),ue(T,ho,A);const D=ue(a,Wi),P=ue(u,Wi),j=ue(P,ho),I=ue(j,ho);We(a,t.domain,i),ue(a,fo,k),ue(a,Sr,b),We(u,t.domain,i),ue(u,fo,k),ue(u,Sr,b),We(D,t.domain,A),ue(D,ho,A),ue(D,Pu,A),We(I,t.domain,A),We(I,e,A),ue(I,ho,A);const W=[[Ru,Ou],[kh,wh],[Ch,Sh],[Eh,_h],[Th,Nh],[Ah,Mh],[Dh,Rh],[Oh,Ih]];for(let Z=0;Z<W.length;Z++){const[J,K]=W[Z],Y=ue(A,J);ue(M,J,Y);const ee=Cr(Tf);We(Y,e,ee);const G=Cr();We(Y,n,G),ue(Y,K,A),We(ee,e,ee),We(ee,n,G),We(G,e,ee),We(G,n,G),ue(ee,K,A),ue(G,K,A)}return ue(o,fc,S),ue(o,Gx,pU),{start:o,tokens:eT}}function gU(t,e,n){let r=n.length,o=0,s=[],i=[];for(;o<r;){let a=t,u=null,d=null,h=0,f=null,m=-1;for(;o<r&&!(u=a.go(n[o].t));)i.push(n[o++]);for(;o<r&&(d=u||a.go(n[o].t));)u=null,a=d,a.accepts()?(m=0,f=a):m>=0&&m++,o++,h++;if(m<0)o-=h,o<r&&(i.push(n[o]),o++);else{i.length>0&&(s.push(Fg(VC,e,i)),i=[]),o-=m,h-=m;const x=f.t,v=n.slice(o-h,o);s.push(Fg(x,e,v))}}return i.length>0&&s.push(Fg(VC,e,i)),s}function Fg(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 yU=typeof console<"u"&&console&&console.warn||(()=>{}),xU="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",wt={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function vU(){return Xn.groups={},wt.scanner=null,wt.parser=null,wt.tokenQueue=[],wt.pluginQueue=[],wt.customSchemes=[],wt.initialized=!1,wt}function HC(t,e=!1){if(wt.initialized&&yU(`linkifyjs: already initialized - will not register custom scheme "${t}" ${xU}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
|
|
591
|
+
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
592
|
+
2. Cannot start or end with "-"
|
|
593
|
+
3. "-" cannot repeat`);wt.customSchemes.push([t,e])}function bU(){wt.scanner=dU(wt.customSchemes);for(let t=0;t<wt.tokenQueue.length;t++)wt.tokenQueue[t][1]({scanner:wt.scanner});wt.parser=mU(wt.scanner.tokens);for(let t=0;t<wt.pluginQueue.length;t++)wt.pluginQueue[t][1]({scanner:wt.scanner,parser:wt.parser});return wt.initialized=!0,wt}function ev(t){return wt.initialized||bU(),gU(wt.parser.start,t,tT(wt.scanner.start,t))}ev.scan=tT;function rT(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 Qx(n),o=ev(t),s=[];for(let i=0;i<o.length;i++){const a=o[i];a.isLink&&(!e||a.t===e)&&r.check(a)&&s.push(a.toFormattedObject(r))}return s}var tv="[\0- -\u2029 ]",kU=new RegExp(tv),wU=new RegExp(`${tv}$`),CU=new RegExp(tv,"g");function SU(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function EU(t){return new Ct({key:new Wt("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,a=p6(n.doc,[...e]);if($x(a).forEach(({newRange:d})=>{const h=CB(r.doc,d,x=>x.isTextblock);let f,m;if(h.length>1)f=h[0],m=r.doc.textBetween(f.pos,f.pos+f.node.nodeSize,void 0," ");else if(h.length){const x=r.doc.textBetween(d.from,d.to," "," ");if(!wU.test(x))return;f=h[0],m=r.doc.textBetween(f.pos,d.to,void 0," ")}if(f&&m){const x=m.split(kU).filter(Boolean);if(x.length<=0)return!1;const v=x[x.length-1],b=f.pos+m.lastIndexOf(v);if(!v)return!1;const k=ev(v).map(S=>S.toObject(t.defaultProtocol));if(!SU(k))return!1;k.filter(S=>S.isLink).map(S=>({...S,from:b+S.start+1,to:b+S.end+1})).filter(S=>r.schema.marks.code?!r.doc.rangeHasMark(S.from,S.to,r.schema.marks.code):!0).filter(S=>t.validate(S.value)).filter(S=>t.shouldAutoLink(S.value)).forEach(S=>{Bx(S.from,S.to,r.doc).some(_=>_.mark.type===t.type)||i.addMark(S.from,S.to,t.type.create({href:S.href}))})}}),!!i.steps.length)return i}})}function _U(t){return new Ct({key:new Wt("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 a=!1;if(t.enableClickSelection&&(a=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){const u=b6(e.state,t.type.name),d=(o=i.href)!=null?o:u.href,h=(s=i.target)!=null?s:u.target;d&&(window.open(d,h),a=!0)}return a}}})}var TU=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,NU=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function oT(t,e){let n=0;for(let r=e-1;r>=0&&t[r]==="\\";r-=1)n+=1;return n%2===1}function AU(t,e){let n=0,r=0;for(;r<e;){if(t[r]!=="`"){r+=1;continue}if(n===0&&oT(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 sT(t,e,n){var r,o;const[,s,i]=e;return(e.index?t[e.index-1]:void 0)==="!"||oT(t,(r=e.index)!=null?r:0)||AU(t,(o=e.index)!=null?o:0)?!1:!!s.trim()&&n(i)}function iT(t){var e,n;const[r,o,s,,i,a,u]=t,d=(e=i??a)!=null?e:u;return{index:(n=t.index)!=null?n:0,text:r,replaceWith:o,data:{href:s,title:d||null,markdown:!0}}}function MU(t,e){return t.index<e.index+e.text.length&&e.index<t.index+t.text.length}function aT(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 DU(t){const e=sa({find:n=>{const r=TU.exec(n);return!r||!sT(n,r,t.isAllowedHref)?null:iT(r)},type:t.type,getAttributes:aT});return new Hc({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 RU(t){const e=fi({find:n=>{var r,o;const s=[];for(const a of n.matchAll(NU))sT(n,a,t.isAllowedHref)&&s.push(iT(a));const i=((o=(r=t.findPlainUrls)==null?void 0:r.call(t,n))!=null?o:[]).filter(a=>!s.some(u=>MU(u,a)));return[...s,...i]},type:t.type,getAttributes:aT});return new T6({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 OU(t){return new Ct({key:new Wt("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{shouldAutoLink:o}=t,{state:s}=e,{selection:i}=s,{empty:a}=i;if(a)return!1;let u="";r.content.forEach(h=>{u+=h.textContent});const d=rT(u,{defaultProtocol:t.defaultProtocol}).find(h=>h.isLink&&h.value===u);return!u||!d||o!==void 0&&!o(d.value)?!1:t.editor.commands.setMark(t.type,{href:d.href})}}})}function Wo(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(CU,"").match(new RegExp(`^(?:(?:${n.map(r=>r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}var IU=hr.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"){HC(t);return}HC(t.scheme,t.optionalSlashes)})},onDestroy(){vU()},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)=>!!Wo(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=>!!Wo(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=>!!Wo(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",tn(this.options.HTMLAttributes,t),0]:["a",tn(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:"",a=(s=(o=t.attrs)==null?void 0:o.title)!=null?s:"",u=e.renderChildren(t);return a?`[${u}](${i} "${a}")`:`[${u}](${i})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Wo(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=>!!Wo(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?[DU({type:this.type,isAllowedHref:t=>this.options.isAllowedUri(t,{defaultValidate:e=>!!Wo(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;rT(e).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:a=>!!Wo(a,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?[RU({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:n=>!!Wo(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:t})]:[fi({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(EU({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!Wo(o,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),t.push(_U({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(OU({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),PU=Object.defineProperty,jU=(t,e)=>{for(var n in e)PU(t,n,{get:e[n],enumerable:!0})},LU="listItem",UC="textStyle",WC=/^\s*([-+*])\s$/,lT=ht.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",tn(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,`
|
|
594
|
+
`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(LU,this.editor.getAttributes(UC)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=gl({find:WC,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=gl({find:WC,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(UC),editor:this.editor})),[t]}}),zU=(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 x=o.depth;x>0;x-=1)if(o.node(x).type.name===e){s=x;break}if(s<0)return null;const i=o.node(s),a=o.index(s);if(a+1>=i.childCount)return null;const u=i.child(a+1);if(!n.includes(u.type.name))return null;const d=t.schema.nodes[e];let h=!1;if(u.forEach(x=>{x.type===d&&x.childCount>1&&(h=!0)}),!h)return null;const f=t.doc.resolve(o.after()).nodeAfter;if(!f||!n.includes(f.type.name))return null;const m=[];return f.forEach(x=>{m.push(x)}),m.length===0?null:{listItemDepth:s,nestedList:f,nestedListPos:o.after(),insertPos:o.after(s),items:m}},FU=(t,e,n,r)=>{const o=zU(t,n,r);if(!o)return!1;const{selection:s}=t,{nestedList:i,nestedListPos:a,insertPos:u,items:d}=o,h=t.tr;h.delete(a,a+i.nodeSize);const f=h.mapping.map(u);return h.insert(f,oe.from(d)),h.setSelection(s.map(h.doc,h.mapping)),e&&e(h),!0},$U=(t,e,n)=>FU(t.state,t.view.dispatch,e,n),uT=(t,e)=>St.create({name:`${t}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){const n=()=>$U(this.editor,t,e);return{Delete:n,"Mod-Delete":n}}}),cT=[[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"]],Nf="abcdefghijklmnopqrstuvwxyz",BU="[a-zA-Z]{1,2}",dT=String.raw`\d+|[ivxlcdmIVXLCDM]+|${BU}`;function Hp(t){let e=t,n="";for(const[r,o]of cT)for(;e>=r;)n+=o,e-=r;return n}function nv(t){return Hp(t).toUpperCase()}function fT(t){const e=t.toLowerCase();let n=0,r=0;for(;n<e.length;){let o=!1;for(const[s,i]of cT)if(e.startsWith(i,n)){r+=s,n+=i.length,o=!0;break}if(!o)return 0}return r}function VU(t){if(!/^[ivxlcdmIVXLCDM]+$/.test(t))return!1;const e=fT(t);return e<=0?!1:(t===t.toLowerCase()?Hp(e):nv(e))===t}function HU(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 Gh(t){if(t<=26)return Nf[t-1];const e=Math.floor((t-1)/26)-1,n=(t-1)%26;return e<0?Nf[n]:Nf[e]+Nf[n]}function Up(t){if(!(!t||/^\d+$/.test(t))){if(VU(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 rv(t){if(/^\d+$/.test(t))return parseInt(t,10);const e=Up(t);if(e==="i"||e==="I")return fT(t);if(e==="a"||e==="A"){const r=HU(t);return r>0?r:1}const n=parseInt(t,10);return Number.isNaN(n)?1:n}function UU(t,e){if(t==="numeric")return String(e);switch(t){case"a":return Gh(e);case"A":return Gh(e).toUpperCase();case"i":return Hp(e);case"I":return nv(e);default:return String(e)}}function WU(t){var e;if(t.length===0)return!1;const n=(e=Up(t[0]))!=null?e:"numeric",r=rv(t[0]);if(r<1)return!1;for(let o=0;o<t.length;o++){const s=UU(n,r+o);if(t[o]!==s)return!1}return!0}function qU(t){return{type:Up(t),start:rv(t)}}function KU(t){const{type:e,start:n}=qU(t),r={};return e&&(r.type=e),n!==1&&(r.start=n),r}function GU(t,e,n=". "){const r=e+1;if(!t||t==="1")return`${r}${n}`;switch(t){case"a":return`${Gh(r)}${n}`;case"A":return`${Gh(r).toUpperCase()}${n}`;case"i":return`${Hp(r)}${n}`;case"I":return`${nv(r)}${n}`;default:return`${r}${n}`}}function JU(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 ZU(t,e){return e.tokenizeInline?e.parseInline(e.tokenizeInline(t)):e.parseInline([{type:"text",raw:t,text:t}])}var hT=ht.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",tn(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(JU(t))return{type:"listItem",content:[{type:"paragraph",content:ZU(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)=>Ux(t,e,r=>{var o,s,i,a;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=(a=(i=r.meta)==null?void 0:i.parentAttrs)==null?void 0:a.type,h=u-1+(r.index||0);return GU(d,h,". ")}return"- "},n),addExtensions(){return[uT(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)}}}),YU={};jU(YU,{findListItemPos:()=>Wp,getNextListDepth:()=>ov,handleBackspace:()=>yy,handleDelete:()=>xy,hasListBefore:()=>pT,hasListItemAfter:()=>XU,hasListItemBefore:()=>QU,listItemHasSubList:()=>eW,nextListIsDeeper:()=>mT,nextListIsHigher:()=>gT});var Wp=(t,e)=>{const{$from:n}=e.selection,r=Ut(t,e.schema);let o=null,s=n.depth,i=n.pos,a=null;for(;s>0&&a===null;)o=n.node(s),o.type===r?a=s:(s-=1,i-=1);return a===null?null:{$pos:e.doc.resolve(i),depth:a}},ov=(t,e)=>{const n=Wp(t,e);if(!n)return!1;const[,r]=IB(e,t,n.$pos.pos+4);return r},pT=(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))},yy=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!di(t.state,e)&&pT(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 a=t.state.doc.resolve(o.start()+i.pos+1);return t.chain().cut({from:r.start()-1,to:r.end()+1},a.end()).joinForward().run()}return!di(t.state,e)||!zB(t.state)?!1:t.chain().liftListItem(e).run()},mT=(t,e)=>{const n=ov(t,e),r=Wp(t,e);return!r||!n?!1:n>r.depth},gT=(t,e)=>{const n=ov(t,e),r=Wp(t,e);return!r||!n?!1:n<r.depth},xy=(t,e)=>{if(!di(t.state,e)||!LB(t.state,e))return!1;const{selection:n}=t.state,{$from:r,$to:o}=n;return!n.empty&&r.sameParent(o)?!1:mT(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():gT(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},XU=(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)},QU=(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)},eW=(t,e,n)=>{if(!n)return!1;const r=Ut(t,e.schema);let o=!1;return n.descendants(s=>{s.type===r&&(o=!0)}),o},yT=St.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&&xy(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&&xy(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&&yy(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&&yy(t,n,r)&&(e=!0)}),e}}}}),vy=new RegExp(`^(\\s*)(${dT})([.)])\\s+(.*)$`),tW=/^\s/,Eu={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function nW(t){return vy.test(t.trimStart())}function rW(t){const e=t.trimStart();return Eu.bulletItem.test(e)||nW(e)||Eu.heading.test(e)||Eu.thematicBreak.test(e)&&!e.startsWith("-")||/^>\s?/.test(e)||Eu.codeFence.test(e)}function oW(t){return Object.values(Eu).some(e=>e.test(t))}function sW(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&&rW(o)){r=!0,n.push(o);return}e.push(o)}),{paragraphLines:e,blockLines:n}}function iW(t){const e=[];let n=0,r=0;for(;n<t.length;){const o=t[n],s=o.match(vy);if(!s)break;const[,i,a,u,d]=s,h=i.length,f=parseInt(a,10),m=isNaN(f)?Up(a):void 0,x=isNaN(f)?rv(a):f,v=[d];let b=n+1;const k=[o];let S=!1;for(;b<t.length;){const _=t[b];if(_.match(vy))break;if(_.trim()==="")k.push(_),v.push(""),S=!0,b+=1;else if(_.match(tW)){const A=_.length-_.trimStart().length,M=h+a.length+1;k.push(_),v.push(_.slice(Math.min(A,M))),b+=1}else{if(S||oW(_))break;k.push(_),v.push(_),b+=1}}e.push({indent:h,number:x,type:m,content:v.join(`
|
|
595
|
+
`).trim(),contentLines:v,raw:k.join(`
|
|
596
|
+
`)}),r=b,n=b}return[e,r]}var aW=new RegExp(`^(${dT})([.)])\\s+(.+)$`);function lW(t){const e=t.split(`
|
|
597
|
+
`).filter(s=>s.trim().length>0);if(e.length===0)return null;const n=[];for(const s of e){const i=s.trim().match(aW);if(!i)return null;n.push({marker:i[1],content:i[3]})}const r=n.map(s=>s.marker);return WU(r)?{type:"orderedList",attrs:KU(n[0].marker),content:n.map(s=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:s.content}]}]}))}:null}function xT(t,e,n){const r=[];let o=0;for(;o<t.length;){const s=t[o];if(s.indent===e){const{paragraphLines:i,blockLines:a}=sW(s.contentLines),u=i.join(`
|
|
598
|
+
`).trim(),d=[];u&&d.push({type:"paragraph",raw:u,tokens:n.inlineTokens(u)});const h=a.join(`
|
|
599
|
+
`).trim();if(h){const x=n.blockTokens(h);d.push(...x)}let f=o+1;const m=[];for(;f<t.length&&t[f].indent>e;)m.push(t[f]),f+=1;if(m.length>0){const x=Math.min(...m.map(b=>b.indent)),v=xT(m,x,n);d.push({type:"list",ordered:!0,start:m[0].number,typeMarker:m[0].type,items:v,raw:m.map(b=>b.raw).join(`
|
|
600
|
+
`)})}r.push({type:"list_item",raw:s.raw,tokens:d}),o=f}else o+=1}return r}function uW(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 cW="listItem",qC="textStyle",KC=/^(\d+)\.\s$/;function GC(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 vT=ht.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=GC(n);if(o)return o}const r=t.querySelector("li");if(r){const o=r.getAttribute("style");if(o){const s=GC(o);if(s)return s}}return null}}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,type:n,...r}=t,o=tn(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?uW(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,`
|
|
601
|
+
`):"",markdownTokenizer:{name:"orderedList",level:"block",start:()=>-1,tokenize:(t,e,n)=>{var r,o;const s=t.split(`
|
|
602
|
+
`),[i,a]=iW(s);if(i.length===0)return;const u=xT(i,i[0].indent,n);if(u.length===0)return;const d=((r=i[0])==null?void 0:r.number)||1,h=(o=i[0])==null?void 0:o.type;return{type:"list",ordered:!0,start:d,typeMarker:h,items:u,raw:s.slice(0,a).join(`
|
|
603
|
+
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(cW,this.editor.getAttributes(qC)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new Ct({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=lW(s);if(!i)return!1;try{const a=t.state.schema.nodeFromJSON(i),u=t.state.tr.replaceSelectionWith(a);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=gl({find:KC,type:this.type,getAttributes:n=>({start:+n[1]}),joinPredicate:t});return(this.options.keepMarks||this.options.keepAttributes)&&(e=gl({find:KC,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:n=>({start:+n[1],...this.editor.getAttributes(qC)}),joinPredicate:t,editor:this.editor})),[e]}}),dW=/^\s*(\[([( |x])?\])\s$/,fW=ht.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",tn(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 Ux(t,e,o)},addExtensions(){return this.options.nested?[uT(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"),a=document.createElement("input"),u=document.createElement("div"),d=f=>{var m,x;a.ariaLabel=((x=(m=this.options.a11y)==null?void 0:m.checkboxLabel)==null?void 0:x.call(m,f,a.checked))||`Task item checkbox for ${f.textContent||"empty task item"}`};d(t),s.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",f=>f.preventDefault()),a.addEventListener("change",f=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:m}=f.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:x})=>{const v=n();if(typeof v!="number")return!1;const b=x.doc.nodeAt(v);return x.setNodeMarkup(v,void 0,{...b==null?void 0:b.attrs,checked:m}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,m)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([f,m])=>{o.setAttribute(f,m)}),o.dataset.checked=t.attrs.checked,a.checked=t.attrs.checked,s.append(a,i),o.append(s,u),Object.entries(e).forEach(([f,m])=>{o.setAttribute(f,m)});let h=new Set(Object.keys(e));return{dom:o,contentDOM:u,update:f=>{if(f.type!==this.type)return!1;o.dataset.checked=f.attrs.checked,a.checked=f.attrs.checked,d(f);const m=r.extensionManager.attributes,x=dc(f,m),v=new Set(Object.keys(x)),b=this.options.HTMLAttributes;return h.forEach(k=>{v.has(k)||(k in b?o.setAttribute(k,b[k]):o.removeAttribute(k))}),Object.entries(x).forEach(([k,S])=>{S==null?k in b?o.setAttribute(k,b[k]):o.removeAttribute(k):o.setAttribute(k,S)}),h=v,!0}}}},addInputRules(){return[gl({find:dW,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),hW=ht.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",tn(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,`
|
|
604
|
+
`):"",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=ay(s,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,u)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:n.inlineTokens(a.mainContent),nestedTokens:u}),customNestedParser:r},n);if(i){const a={type:"taskList",raw:i.raw,items:i.items},u=s.slice(i.raw.length);return u.trim()?[a,...n.blockTokens(u)]:[a]}return n.blockTokens(s)},o=ay(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()}}});St.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(lT.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(hT.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(yT.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(vT.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(fW.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(hW.configure(this.options.taskList)),t}});var Af=" ",$g=" ",pW=ht.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",tn(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===Af||n[0].text===Af||n[0].raw===$g||n[0].text===$g)&&r.length===1&&r[0].type==="text"&&(r[0].text===Af||r[0].text===$g)?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?Af:""}return e.renderChildren(s)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),mW=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,gW=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,yW=hr.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",tn(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[sa({find:mW,type:this.type})]},addPasteRules(){return[fi({find:gW,type:this.type})]}}),xW=ht.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),vW=hr.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",tn(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 bW(t={}){return new Ct({view(e){return new kW(e,t)}})}class kW{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,a=s.height/o.offsetHeight;if(n){let f=e.nodeBefore,m=e.nodeAfter;if(f||m){let x=this.editorView.nodeDOM(this.cursorPos-(f?f.nodeSize:0));if(x){let v=x.getBoundingClientRect(),b=f?v.bottom:v.top;f&&m&&(b=(b+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let k=this.width/2*a;r={left:v.left,right:v.right,top:b-k,bottom:b+k}}}}if(!r){let f=this.editorView.coordsAtPos(this.cursorPos),m=this.width/2*i;r={left:f.left-m,right:f.left+m,top:f.top,bottom:f.bottom}}let u=this.editorView.dom.offsetParent;this.element||(this.element=u.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let d,h;if(!u||u==document.body&&getComputedStyle(u).position=="static")d=-pageXOffset,h=-pageYOffset;else{let f=u.getBoundingClientRect(),m=f.width/u.offsetWidth,x=f.height/u.offsetHeight;d=f.left-u.scrollLeft*m,h=f.top-u.scrollTop*x}this.element.style.left=(r.left-d)/i+"px",this.element.style.top=(r.top-h)/a+"px",this.element.style.width=(r.right-r.left)/i+"px",this.element.style.height=(r.bottom-r.top)/a+"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 a=t4(this.editorView.state.doc,i,this.editorView.dragging.slice);a!=null&&(i=a)}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 Ot extends Ue{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Ot.valid(r)?new Ot(r):Ue.near(r)}content(){return xe.empty}eq(e){return e instanceof Ot&&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 Ot(e.resolve(n.pos))}getBookmark(){return new sv(this.anchor)}static valid(e){let n=e.parent;if(n.inlineContent||!wW(e)||!CW(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&&Ot.valid(e))return e;let o=e.pos,s=null;for(let i=e.depth;;i--){let a=e.node(i);if(n>0?e.indexAfter(i)<a.childCount:e.index(i)>0){s=a.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(Ot.valid(u))return u}for(;;){let i=n>0?s.firstChild:s.lastChild;if(!i){if(s.isAtom&&!s.isText&&!Pe.isSelectable(s)){e=e.doc.resolve(o+s.nodeSize*n),r=!1;continue e}break}s=i,o+=n;let a=e.doc.resolve(o);if(Ot.valid(a))return a}return null}}}Ot.prototype.visible=!1;Ot.findFrom=Ot.findGapCursorFrom;Ue.jsonID("gapcursor",Ot);class sv{constructor(e){this.pos=e}map(e){return new sv(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Ot.valid(n)?new Ot(n):Ue.near(n)}}function bT(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function wW(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||bT(o.type))return!0;if(o.inlineContent)return!1}}return!0}function CW(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||bT(o.type))return!0;if(o.inlineContent)return!1}}return!0}function SW(){return new Ct({props:{decorations:NW,createSelectionBetween(t,e,n){return e.pos==n.pos&&Ot.valid(n)?new Ot(n):null},handleClick:_W,handleKeyDown:EW,handleDOMEvents:{beforeinput:TW}}})}const EW=s6({ArrowLeft:Mf("horiz",-1),ArrowRight:Mf("horiz",1),ArrowUp:Mf("vert",-1),ArrowDown:Mf("vert",1)});function Mf(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,o,s){let i=r.selection,a=e>0?i.$to:i.$from,u=i.empty;if(i instanceof ze){if(!s.endOfTextblock(n)||a.depth==0)return!1;u=!1,a=r.doc.resolve(e>0?a.after():a.before())}let d=Ot.findGapCursorFrom(a,e,u);return d?(o&&o(r.tr.setSelection(new Ot(d))),!0):!1}}function _W(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Ot.valid(r))return!1;let o=t.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&Pe.isSelectable(t.state.doc.nodeAt(o.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Ot(r))),!0)}function TW(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Ot))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=oe.empty;for(let i=r.length-1;i>=0;i--)o=oe.from(r[i].createAndFill(null,o));let s=t.state.tr.replace(n.pos,n.pos,new xe(o,0,0));return s.setSelection(ze.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function NW(t){if(!(t.selection instanceof Ot))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",xt.create(t.doc,[jn.widget(t.selection.head,e,{key:"gapcursor"})])}var Jh=200,pn=function(){};pn.prototype.append=function(e){return e.length?(e=pn.from(e),!this.length&&e||e.length<Jh&&this.leafAppend(e)||this.length<Jh&&e.leafPrepend(this)||this.appendInner(e)):this};pn.prototype.prepend=function(e){return e.length?pn.from(e).append(this):this};pn.prototype.appendInner=function(e){return new AW(this,e)};pn.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?pn.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};pn.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};pn.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)};pn.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};pn.from=function(e){return e instanceof pn?e:e&&e.length?new kT(e):pn.empty};var kT=(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,a){for(var u=s;u<i;u++)if(o(this.values[u],a+u)===!1)return!1},e.prototype.forEachInvertedInner=function(o,s,i,a){for(var u=s-1;u>=i;u--)if(o(this.values[u],a+u)===!1)return!1},e.prototype.leafAppend=function(o){if(this.length+o.length<=Jh)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=Jh)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})(pn);pn.empty=new kT([]);var AW=(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 a=this.left.length;if(o<a&&this.left.forEachInner(r,o,Math.min(s,a),i)===!1||s>a&&this.right.forEachInner(r,Math.max(o-a,0),Math.min(this.length,s)-a,i+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,s,i){var a=this.left.length;if(o>a&&this.right.forEachInvertedInner(r,o-a,Math.max(s,a)-a,i+a)===!1||s<a&&this.left.forEachInvertedInner(r,Math.min(o,a),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})(pn);const MW=500;class Hr{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,a,u,d=[],h=[];return this.items.forEach((f,m)=>{if(!f.step){o||(o=this.remapping(r,m+1),s=o.maps.length),s--,h.push(f);return}if(o){h.push(new po(f.map));let x=f.step.map(o.slice(s)),v;x&&i.maybeStep(x).doc&&(v=i.mapping.maps[i.mapping.maps.length-1],d.push(new po(v,void 0,void 0,d.length+h.length))),s--,v&&o.appendMap(v,s)}else i.maybeStep(f.step);if(f.selection)return a=o?f.selection.map(o.slice(s)):f.selection,u=new Hr(this.items.slice(0,r).append(h.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:u,transform:i,selection:a}}addTransform(e,n,r,o){let s=[],i=this.eventCount,a=this.items,u=!o&&a.length?a.get(a.length-1):null;for(let h=0;h<e.steps.length;h++){let f=e.steps[h].invert(e.docs[h]),m=new po(e.mapping.maps[h],f,n),x;(x=u&&u.merge(m))&&(m=x,h?s.pop():a=a.slice(0,a.length-1)),s.push(m),n&&(i++,n=void 0),o||(u=m)}let d=i-r.depth;return d>RW&&(a=DW(a,d),i-=d),new Hr(a.append(s),i)}remapping(e,n){let r=new ic;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 Hr(this.items.append(e.map(n=>new po(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,a=this.eventCount;this.items.forEach(m=>{m.selection&&a--},o);let u=n;this.items.forEach(m=>{let x=s.getMirror(--u);if(x==null)return;i=Math.min(i,x);let v=s.maps[x];if(m.step){let b=e.steps[x].invert(e.docs[x]),k=m.selection&&m.selection.map(s.slice(u+1,x));k&&a++,r.push(new po(v,b,k))}else r.push(new po(v))},o);let d=[];for(let m=n;m<i;m++)d.push(new po(s.maps[m]));let h=this.items.slice(0,o).append(d).append(r),f=new Hr(h,a);return f.emptyItemCount()>MW&&(f=f.compress(this.items.length-r.length)),f}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,a)=>{if(a>=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 h=i.selection&&i.selection.map(n.slice(r));h&&s++;let f=new po(d.invert(),u,h),m,x=o.length-1;(m=o.length&&o[x].merge(f))?o[x]=m:o.push(f)}}else i.map&&r--},this.items.length,0),new Hr(pn.from(o.reverse()),s)}}Hr.empty=new Hr(pn.empty,0);function DW(t,e){let n;return t.forEach((r,o)=>{if(r.selection&&e--==0)return n=o,!1}),t.slice(n)}class po{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 po(n.getMap().invert(),n,this.selection)}}}class Hs{constructor(e,n,r,o,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=s}}const RW=20;function OW(t,e,n,r){let o=n.getMeta(Zi),s;if(o)return o.historyState;n.getMeta(jW)&&(t=new Hs(t.done,t.undone,null,0,-1));let i=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(i&&i.getMeta(Zi))return i.getMeta(Zi).redo?new Hs(t.done.addTransform(n,void 0,r,Kf(e)),t.undone,JC(n.mapping.maps),t.prevTime,t.prevComposition):new Hs(t.done,t.undone.addTransform(n,void 0,r,Kf(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(i&&i.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),u=t.prevTime==0||!i&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!IW(n,t.prevRanges)),d=i?Bg(t.prevRanges,n.mapping):JC(n.mapping.maps);return new Hs(t.done.addTransform(n,u?e.selection.getBookmark():void 0,r,Kf(e)),Hr.empty,d,n.time,a??t.prevComposition)}else return(s=n.getMeta("rebased"))?new Hs(t.done.rebased(n,s),t.undone.rebased(n,s),Bg(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Hs(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Bg(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function IW(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 JC(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 Bg(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 PW(t,e,n){let r=Kf(e),o=Zi.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),a=(n?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),o,r),u=new Hs(n?a:s.remaining,n?s.remaining:a,null,0,-1);return s.transform.setSelection(i).setMeta(Zi,{redo:n,historyState:u})}let Vg=!1,ZC=null;function Kf(t){let e=t.plugins;if(ZC!=e){Vg=!1,ZC=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Vg=!0;break}}return Vg}const Zi=new Wt("history"),jW=new Wt("closeHistory");function LW(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Ct({key:Zi,state:{init(){return new Hs(Hr.empty,Hr.empty,null,0,-1)},apply(e,n,r){return OW(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,o=r=="historyUndo"?CT:r=="historyRedo"?ST:null;return!o||!e.editable?!1:(n.preventDefault(),o(e.state,e.dispatch))}}}})}function wT(t,e){return(n,r)=>{let o=Zi.getState(n);if(!o||(t?o.undone:o.done).eventCount==0)return!1;if(r){let s=PW(o,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}const CT=wT(!1,!0),ST=wT(!0,!0);St.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 Ct({key:new Wt("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 a=i-o,u=0,d=a;console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);const h=r.tr.deleteRange(u,d);return t=!0,h}t=!0},filterTransaction:(e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const o=this.storage.characters({node:n.doc}),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 a=e.selection.$head.pos,u=s-r,d=a-u,h=a;return e.deleteRange(d,h),!(this.storage.characters({node:e.doc})>r)}})]}});var zW=St.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[bW(this.options)]}});St.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Ct({key:new Wt("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:o}=e,s=[];if(!n||!r)return xt.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 a=0;return t.descendants((u,d)=>{if(u.isText||!(o>=d&&o<=d+u.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&i-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";s.push(jn.node(d,d+u.nodeSize,{class:this.options.className}))}),xt.create(t,s)}}})]}});var FW=St.create({name:"gapCursor",addProseMirrorPlugins(){return[SW()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=lt(Me(t,"allowGapCursor",n)))!=null?e:null}}}),ET="placeholder",YC=new Wt("tiptap__placeholder");function _T(t){const{editor:e,placeholder:n,dataAttribute:r,pos:o,node:s,isEmptyDoc:i,hasAnchor:a,classes:{emptyNode:u,emptyEditor:d}}=t,h=[u];return i&&h.push(d),jn.node(o,o+s.nodeSize,{class:h.join(" "),[r]:typeof n=="function"?n({editor:e,node:s,pos:o,hasAnchor:a}):n})}function TT(t,e){return typeof t=="function"?t(e):t}function NT({editor:t,options:e,dataAttribute:n,doc:r,selection:o,from:s,to:i}){const{anchor:a}=o,u=[],d=t.isEmpty;return r.nodesBetween(s,i,(h,f)=>{const m=a>=f&&a<=f+h.nodeSize,x=!h.isLeaf&&Vc(h);return h.type.isTextblock&&(m||!e.showOnlyCurrent)&&x&&u.push(_T({editor:t,isEmptyDoc:d,dataAttribute:n,hasAnchor:m,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:TT(e.emptyNodeClass,{editor:t,node:h,pos:f,hasAnchor:m})},node:h,pos:f})),e.includeChildren}),u}function AT({editor:t,options:e,dataAttribute:n,doc:r,selection:o}){if(!(t.isEditable||!e.showOnlyWhenEditable))return null;const{anchor:i}=o,a=[],u=t.isEmpty;if(e.showOnlyCurrent&&!e.includeChildren){const h=r.resolve(i),f=h.depth>0?h.node(1):h.nodeAfter,m=h.depth>0?h.before(1):i;if(f&&f.type.isTextblock&&Vc(f)){const x=i>=m&&i<=m+f.nodeSize;a.push(_T({editor:t,isEmptyDoc:u,dataAttribute:n,hasAnchor:x,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:TT(e.emptyNodeClass,{editor:t,node:f,pos:m,hasAnchor:x})},node:f,pos:m}))}}else a.push(...NT({editor:t,options:e,dataAttribute:n,doc:r,selection:o,from:0,to:r.content.size}));return xt.create(r,a)}function Lu(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 a=r.nodeAfter?e:e-i.nodeSize;return{from:a,to:a+i.nodeSize}}const o=r.before(1),s=r.node(1);return{from:o,to:o+s.nodeSize}}function zu(t,e){return{from:Math.max(0,e.from-1),to:Math.min(t.content.size,e.to-1)}}function $W(t,e,n){const r=[];return t.forEach((o,s)=>{const i=s,a=i+o.nodeSize,u=i+1,d=a+1;u<n&&d>e&&r.push({from:i,to:a})}),r}function BW(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 VW(t,e){const n=$W(t,e.from,e.to);return n.push(zu(t,Lu(t,e.from))),e.to>e.from?n.push(zu(t,Lu(t,Math.min(e.to,t.content.size+1)-1))):e.from<t.content.size+1&&n.push(zu(t,Lu(t,Math.min(e.from+1,t.content.size)))),n}function HW(t,e,n){const r=[];if(t.docChanged){const o=$x(t);for(const s of o)r.push(...VW(n.doc,s.newRange))}return t.selectionSet&&(r.push(zu(n.doc,Lu(n.doc,t.mapping.map(e.selection.anchor)))),r.push(zu(n.doc,Lu(n.doc,n.selection.anchor)))),BW(r)}function UW(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 WW({decorations:t,ranges:e,editor:n,options:r,dataAttribute:o,doc:s,selection:i}){let a=t;for(const u of e){const{from:d,to:h}=UW(u.from,u.to,s),f=a.find(d,h).filter(x=>x.from>=d&&x.to<=h);f.length&&(a=a.remove(f));const m=NT({editor:n,options:r,dataAttribute:o,doc:s,selection:i,from:d,to:h});m.length&&(a=a.add(s,m))}return a}function qW({editor:t,options:e,dataAttribute:n}){return{init(r,o){const s=AT({editor:t,options:e,dataAttribute:n,doc:o.doc,selection:o.selection});return s??xt.empty},apply(r,o,s,i){if(!r.docChanged&&!r.selectionSet)return o;const a=o.map(r.mapping,r.doc),u=HW(r,s,i);return WW({decorations:a,ranges:u,editor:t,options:e,dataAttribute:n,doc:i.doc,selection:i.selection})}}}function KW(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}function GW({editor:t,options:e}){const n=e.dataAttribute?`data-${KW(e.dataAttribute)}`:`data-${ET}`,r=e.showOnlyCurrent&&!e.includeChildren;return new Ct({key:YC,...r?{}:{state:qW({editor:t,options:e,dataAttribute:n})},props:{decorations:r?({doc:o,selection:s})=>AT({editor:t,options:e,dataAttribute:n,doc:o,selection:s}):o=>{var s;return e.showOnlyWhenEditable&&!t.isEditable?xt.empty:(s=YC.getState(o))!=null?s:xt.empty}}})}St.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:ET,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[GW({editor:this.editor,options:this.options})]}});function by(t,e){return!t.selection.empty&&!k6(t.selection)&&e.isEditable}function JW(t,e){return by(t,e)&&!e.isFocused&&!e.view.dragging}function ZW(){var t;(t=window.getSelection())==null||t.removeAllRanges()}function YW(t){t.focus()}St.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new Ct({key:new Wt("selection"),props:{decorations(n){return JW(n,t)?xt.create(n.doc,[jn.inline(n.selection.from,n.selection.to,{class:e.className})]):null},handleDOMEvents:{blur(n){return by(n.state,t)&&ZW(),!1},focus(n){return by(n.state,t)&&requestAnimationFrame(()=>{!t.isDestroyed&&n.hasFocus()&&YW(n)}),!1}}}})]}});var XW="skipTrailingNode";function XC({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(e==null?void 0:e.type)===t}var QW=St.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new Wt(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 Ct({key:e,appendTransaction:(o,s,i)=>{const{doc:a,tr:u,schema:d}=i,h=e.getState(i),f=a.content.size,m=d.nodes[n];if(!o.some(x=>x.getMeta(XW))&&h)return u.insert(f,m.create())},state:{init:(o,s)=>{const i=s.tr.doc.lastChild;return!XC({node:i,types:r})},apply:(o,s)=>{if(!o.docChanged||o.getMeta("__uniqueIDTransaction"))return s;const i=o.doc.lastChild;return!XC({node:i,types:r})}}})]}}),eq=St.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>CT(t,e),redo:()=>({state:t,dispatch:e})=>ST(t,e)}},addProseMirrorPlugins(){return[LW(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()}}}),tq=St.create({name:"starterKit",addExtensions(){var t,e,n,r;const o=[];return this.options.bold!==!1&&o.push(BH.configure(this.options.bold)),this.options.blockquote!==!1&&o.push(jH.configure(this.options.blockquote)),this.options.bulletList!==!1&&o.push(lT.configure(this.options.bulletList)),this.options.code!==!1&&o.push(UH.configure(this.options.code)),this.options.codeBlock!==!1&&o.push(KH.configure(this.options.codeBlock)),this.options.document!==!1&&o.push(GH.configure(this.options.document)),this.options.dropcursor!==!1&&o.push(zW.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&o.push(FW.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&o.push(JH.configure(this.options.hardBreak)),this.options.heading!==!1&&o.push(ZH.configure(this.options.heading)),this.options.undoRedo!==!1&&o.push(eq.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&o.push(YH.configure(this.options.horizontalRule)),this.options.italic!==!1&&o.push(nU.configure(this.options.italic)),this.options.listItem!==!1&&o.push(hT.configure(this.options.listItem)),this.options.listKeymap!==!1&&o.push(yT.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&o.push(IU.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&o.push(vT.configure(this.options.orderedList)),this.options.paragraph!==!1&&o.push(pW.configure(this.options.paragraph)),this.options.strike!==!1&&o.push(yW.configure(this.options.strike)),this.options.text!==!1&&o.push(xW.configure(this.options.text)),this.options.underline!==!1&&o.push(vW.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&o.push(QW.configure((r=this.options)==null?void 0:r.trailingNode)),o}}),nq=tq;const QC={};function rq(t){let e=QC[t];if(e)return e;e=QC[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 yl(t,e){typeof e!="string"&&(e=yl.defaultChars);const n=rq(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 a=parseInt(r.slice(s+1,s+3),16);if(a<128){o+=n[a];continue}if((a&224)===192&&s+3<i){const u=parseInt(r.slice(s+4,s+6),16);if((u&192)===128){const d=a<<6&1984|u&63;d<128?o+="��":o+=String.fromCharCode(d),s+=3;continue}}if((a&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 h=a<<12&61440|u<<6&4032|d&63;h<2048||h>=55296&&h<=57343?o+="���":o+=String.fromCharCode(h),s+=6;continue}}if((a&248)===240&&s+9<i){const u=parseInt(r.slice(s+4,s+6),16),d=parseInt(r.slice(s+7,s+9),16),h=parseInt(r.slice(s+10,s+12),16);if((u&192)===128&&(d&192)===128&&(h&192)===128){let f=a<<18&1835008|u<<12&258048|d<<6&4032|h&63;f<65536||f>1114111?o+="����":(f-=65536,o+=String.fromCharCode(55296+(f>>10),56320+(f&1023))),s+=9;continue}}o+="�"}return o})}yl.defaultChars=";/?:@&=+$,#";yl.componentChars="";const eS={};function oq(t){let e=eS[t];if(e)return e;e=eS[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 Uc(t,e,n){typeof e!="string"&&(n=e,e=Uc.defaultChars),typeof n>"u"&&(n=!0);const r=oq(e);let o="";for(let s=0,i=t.length;s<i;s++){const a=t.charCodeAt(s);if(n&&a===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(a<128){o+=r[a];continue}if(a>=55296&&a<=57343){if(a>=55296&&a<=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}Uc.defaultChars=";/?:@&=+$,-_.!~*'()#";Uc.componentChars="-_.!~*'()";function iv(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 Zh(){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 sq=/^([a-z0-9.+-]+:)/i,iq=/:[0-9]*$/,aq=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,lq=["<",">",'"',"`"," ","\r",`
|
|
605
|
+
`," "],uq=["{","}","|","\\","^","`"].concat(lq),cq=["'"].concat(uq),tS=["%","/","?",";","#"].concat(cq),nS=["/","?","#"],dq=255,rS=/^[+a-z0-9A-Z_-]{0,63}$/,fq=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,oS={javascript:!0,"javascript:":!0},sS={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function av(t,e){if(t&&t instanceof Zh)return t;const n=new Zh;return n.parse(t,e),n}Zh.prototype.parse=function(t,e){let n,r,o,s=t;if(s=s.trim(),!e&&t.split("#").length===1){const d=aq.exec(s);if(d)return this.pathname=d[1],d[2]&&(this.search=d[2]),this}let i=sq.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&&oS[i])&&(s=s.substr(2),this.slashes=!0)),!oS[i]&&(o||i&&!sS[i])){let d=-1;for(let v=0;v<nS.length;v++)r=s.indexOf(nS[v]),r!==-1&&(d===-1||r<d)&&(d=r);let h,f;d===-1?f=s.lastIndexOf("@"):f=s.lastIndexOf("@",d),f!==-1&&(h=s.slice(0,f),s=s.slice(f+1),this.auth=h),d=-1;for(let v=0;v<tS.length;v++)r=s.indexOf(tS[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 x=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!x){const v=this.hostname.split(/\./);for(let b=0,k=v.length;b<k;b++){const S=v[b];if(S&&!S.match(rS)){let _="";for(let T=0,A=S.length;T<A;T++)S.charCodeAt(T)>127?_+="x":_+=S[T];if(!_.match(rS)){const T=v.slice(0,b),A=v.slice(b+1),M=S.match(fq);M&&(T.push(M[1]),A.unshift(M[2])),A.length&&(s=A.join(".")+s),this.hostname=T.join(".");break}}}}this.hostname.length>dq&&(this.hostname=""),x&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const a=s.indexOf("#");a!==-1&&(this.hash=s.substr(a),s=s.slice(0,a));const u=s.indexOf("?");return u!==-1&&(this.search=s.substr(u),s=s.slice(0,u)),s&&(this.pathname=s),sS[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Zh.prototype.parseHost=function(t){let e=iq.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 hq=Object.freeze(Object.defineProperty({__proto__:null,decode:yl,encode:Uc,format:iv,parse:av},Symbol.toStringTag,{value:"Module"})),MT=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,DT=/[\0-\x1F\x7F-\x9F]/,pq=/[\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]/,lv=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,RT=/[\$\+<->\^`\|~\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]/,OT=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,mq=Object.freeze(Object.defineProperty({__proto__:null,Any:MT,Cc:DT,Cf:pq,P:lv,S:RT,Z:OT},Symbol.toStringTag,{value:"Module"})),gq=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),yq=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(t=>t.charCodeAt(0)));var Hg;const xq=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]]),vq=(Hg=String.fromCodePoint)!==null&&Hg!==void 0?Hg: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 bq(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=xq.get(t))!==null&&e!==void 0?e:t}var fn;(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"})(fn||(fn={}));const kq=32;var Ys;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Ys||(Ys={}));function ky(t){return t>=fn.ZERO&&t<=fn.NINE}function wq(t){return t>=fn.UPPER_A&&t<=fn.UPPER_F||t>=fn.LOWER_A&&t<=fn.LOWER_F}function Cq(t){return t>=fn.UPPER_A&&t<=fn.UPPER_Z||t>=fn.LOWER_A&&t<=fn.LOWER_Z||ky(t)}function Sq(t){return t===fn.EQUALS||Cq(t)}var ln;(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"})(ln||(ln={}));var Jo;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(Jo||(Jo={}));class Eq{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=ln.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Jo.Strict}startEntity(e){this.decodeMode=e,this.state=ln.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case ln.EntityStart:return e.charCodeAt(n)===fn.NUM?(this.state=ln.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=ln.NamedEntity,this.stateNamedEntity(e,n));case ln.NumericStart:return this.stateNumericStart(e,n);case ln.NumericDecimal:return this.stateNumericDecimal(e,n);case ln.NumericHex:return this.stateNumericHex(e,n);case ln.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|kq)===fn.LOWER_X?(this.state=ln.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=ln.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(ky(o)||wq(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(ky(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===fn.SEMI)this.consumed+=1;else if(this.decodeMode===Jo.Strict)return 0;return this.emitCodePoint(bq(this.result),this.consumed),this.errors&&(e!==fn.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&Ys.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const i=e.charCodeAt(n);if(this.treeIndex=_q(r,o,this.treeIndex+Math.max(1,s),i),this.treeIndex<0)return this.result===0||this.decodeMode===Jo.Attribute&&(s===0||Sq(i))?0:this.emitNotTerminatedNamedEntity();if(o=r[this.treeIndex],s=(o&Ys.VALUE_LENGTH)>>14,s!==0){if(i===fn.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Jo.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]&Ys.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]&~Ys.VALUE_LENGTH:o[e+1],r),n===3&&this.emitCodePoint(o[e+2],r),r}end(){var e;switch(this.state){case ln.NamedEntity:return this.result!==0&&(this.decodeMode!==Jo.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ln.NumericDecimal:return this.emitNumericEntity(0,2);case ln.NumericHex:return this.emitNumericEntity(0,3);case ln.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ln.EntityStart:return 0}}}function IT(t){let e="";const n=new Eq(t,r=>e+=vq(r));return function(o,s){let i=0,a=0;for(;(a=o.indexOf("&",a))>=0;){e+=o.slice(i,a),n.startEntity(s);const d=n.write(o,a+1);if(d<0){i=a+n.end();break}i=a+d,a=d===0?i+1:i}const u=e+o.slice(i);return e="",u}}function _q(t,e,n,r){const o=(e&Ys.BRANCH_LENGTH)>>7,s=e&Ys.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,a=i+o-1;for(;i<=a;){const u=i+a>>>1,d=t[u];if(d<r)i=u+1;else if(d>r)a=u-1;else return t[u+o]}return-1}const PT=IT(gq);IT(yq);function Tq(t,e=Jo.Legacy){return PT(t,e)}function Nq(t){return PT(t,Jo.Strict)}function Aq(t){return Object.prototype.toString.call(t)}function uv(t){return Aq(t)==="[object String]"}const Mq=Object.prototype.hasOwnProperty;function Dq(t,e){return Mq.call(t,e)}function qp(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 jT(t,e,n){return[].concat(t.slice(0,e),n,t.slice(e+1))}function cv(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 pc(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 LT=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Rq=/&([a-z#][a-z0-9]{1,31});/gi,Oq=new RegExp(LT.source+"|"+Rq.source,"gi"),Iq=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Pq(t,e){if(e.charCodeAt(0)===35&&Iq.test(e)){const r=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return cv(r)?pc(r):t}const n=Tq(t);return n!==t?n:t}function jq(t){return t.indexOf("\\")<0?t:t.replace(LT,"$1")}function xl(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(Oq,function(e,n,r){return n||Pq(e,r)})}const Lq=/[&<>"]/,zq=/[&<>"]/g,Fq={"&":"&","<":"<",">":">",'"':"""};function $q(t){return Fq[t]}function hi(t){return Lq.test(t)?t.replace(zq,$q):t}const Bq=/[.?*+^$[\]\\(){}|-]/g;function Vq(t){return t.replace(Bq,"\\$&")}function vt(t){switch(t){case 9:case 32:return!0}return!1}function mc(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 zT(t){return lv.test(t)||RT.test(t)}function gc(t){return zT(pc(t))}function yc(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 Kp(t){return t=t.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(t=t.replace(/ẞ/g,"ß")),t.toLowerCase().toUpperCase()}function iS(t){return t===32||t===9||t===10||t===13}function Gp(t){let e=0;for(;e<t.length&&iS(t.charCodeAt(e));e++);let n=t.length-1;for(;n>=e&&iS(t.charCodeAt(n));n--);return t.slice(e,n+1)}const Hq={mdurl:hq,ucmicro:mq},Uq=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:jT,asciiTrim:Gp,assign:qp,escapeHtml:hi,escapeRE:Vq,fromCodePoint:pc,has:Dq,isMdAsciiPunct:yc,isPunctChar:zT,isPunctCharCode:gc,isSpace:vt,isString:uv,isValidEntityCode:cv,isWhiteSpace:mc,lib:Hq,normalizeReference:Kp,unescapeAll:xl,unescapeMd:jq},Symbol.toStringTag,{value:"Module"}));function Wq(t,e,n){let r,o,s,i;const a=t.posMax,u=t.pos;for(t.pos=e+1,r=1;t.pos<a;){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 qq(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=xl(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=xl(t.slice(e,o)),s.pos=o,s.ok=!0),s}function Kq(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 a=t.charCodeAt(s);if(a!==34&&a!==39&&a!==40)return i;e++,s++,a===40&&(a=41),i.marker=a}for(;s<n;){if(o=t.charCodeAt(s),o===i.marker)return i.pos=s+1,i.str+=xl(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+=xl(t.slice(e,s)),i}const Gq=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:qq,parseLinkLabel:Wq,parseLinkTitle:Kq},Symbol.toStringTag,{value:"Module"})),To={};To.code_inline=function(t,e,n,r,o){const s=t[e];return"<code"+o.renderAttrs(s)+">"+hi(s.content)+"</code>"};To.code_block=function(t,e,n,r,o){const s=t[e];return"<pre"+o.renderAttrs(s)+"><code>"+hi(t[e].content)+`</code></pre>
|
|
606
|
+
`};To.fence=function(t,e,n,r,o){const s=t[e],i=s.info?xl(s.info).trim():"";let a="",u="";if(i){const h=i.split(/(\s+)/g);a=h[0],u=h.slice(2).join("")}let d;if(n.highlight?d=n.highlight(s.content,a,u)||hi(s.content):d=hi(s.content),d.indexOf("<pre")===0)return d+`
|
|
607
|
+
`;if(i){const h=s.attrIndex("class"),f=s.attrs?s.attrs.slice():[];h<0?f.push(["class",n.langPrefix+a]):(f[h]=f[h].slice(),f[h][1]+=" "+n.langPrefix+a);const m={attrs:f};return`<pre><code${o.renderAttrs(m)}>${d}</code></pre>
|
|
608
|
+
`}return`<pre><code${o.renderAttrs(s)}>${d}</code></pre>
|
|
609
|
+
`};To.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)};To.hardbreak=function(t,e,n){return n.xhtmlOut?`<br />
|
|
610
|
+
`:`<br>
|
|
611
|
+
`};To.softbreak=function(t,e,n){return n.breaks?n.xhtmlOut?`<br />
|
|
612
|
+
`:`<br>
|
|
613
|
+
`:`
|
|
614
|
+
`};To.text=function(t,e){return hi(t[e].content)};To.html_block=function(t,e){return t[e].content};To.html_inline=function(t,e){return t[e].content};function Tl(){this.rules=qp({},To)}Tl.prototype.renderAttrs=function(e){let n,r,o;if(!e.attrs)return"";for(o="",n=0,r=e.attrs.length;n<r;n++)o+=" "+hi(e.attrs[n][0])+'="'+hi(e.attrs[n][1])+'"';return o};Tl.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+=`
|
|
615
|
+
`),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 a=e[n+1];(a.type==="inline"||a.hidden||a.nesting===-1&&a.tag===o.tag)&&(i=!1)}return s+=i?`>
|
|
616
|
+
`:">",s};Tl.prototype.renderInline=function(t,e,n){let r="";const o=this.rules;for(let s=0,i=t.length;s<i;s++){const a=t[s].type;typeof o[a]<"u"?r+=o[a](t,s,e,n,this):r+=this.renderToken(t,s,e)}return r};Tl.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+=`
|
|
617
|
+
`;break}return r};Tl.prototype.render=function(t,e,n){let r="";const o=this.rules;for(let s=0,i=t.length;s<i;s++){const a=t[s].type;a==="inline"?r+=this.renderInline(t[s].children,e,n):typeof o[a]<"u"?r+=o[a](t,s,e,n,this):r+=this.renderToken(t,s,e,n)}return r};function tr(){this.__rules__=[],this.__cache__=null}tr.prototype.__find__=function(t){for(let e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===t)return e;return-1};tr.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))})})};tr.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};tr.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};tr.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};tr.prototype.push=function(t,e,n){const r=n||{};this.__rules__.push({name:t,enabled:!0,fn:e,alt:r.alt||[]}),this.__cache__=null};tr.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};tr.prototype.enableOnly=function(t,e){Array.isArray(t)||(t=[t]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(t,e)};tr.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};tr.prototype.getRules=function(t){return this.__cache__===null&&this.__compile__(),this.__cache__[t]||[]};function Xr(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}Xr.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};Xr.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]};Xr.prototype.attrSet=function(e,n){const r=this.attrIndex(e),o=[e,n];r<0?this.attrPush(o):this.attrs[r]=o};Xr.prototype.attrGet=function(e){const n=this.attrIndex(e);let r=null;return n>=0&&(r=this.attrs[n][1]),r};Xr.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 FT(t,e,n){this.src=t,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=e}FT.prototype.Token=Xr;const Jq=/\r\n?|\n/g,Zq=/\0/g;function Yq(t){let e;e=t.src.replace(Jq,`
|
|
618
|
+
`),e=e.replace(Zq,"�"),t.src=e}function Xq(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 Qq(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 eK(t){return/^<a[>\s]/i.test(t)}function tK(t){return/^<\/a\s*>/i.test(t)}function nK(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 a=o[i];if(a.type==="link_close"){for(i--;o[i].level!==a.level&&o[i].type!=="link_open";)i--;continue}if(a.type==="html_inline"&&(eK(a.content)&&s>0&&s--,tK(a.content)&&s++),!(s>0)&&a.type==="text"&&t.md.linkify.test(a.content)){const u=a.content;let d=t.md.linkify.match(u);const h=[];let f=a.level,m=0;d.length>0&&d[0].index===0&&i>0&&o[i-1].type==="text_special"&&(d=d.slice(1));for(let x=0;x<d.length;x++){const v=d[x].url,b=t.md.normalizeLink(v);if(!t.md.validateLink(b))continue;let k=d[x].text;d[x].schema?d[x].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 S=d[x].index;if(S>m){const M=new t.Token("text","",0);M.content=u.slice(m,S),M.level=f,h.push(M)}const _=new t.Token("link_open","a",1);_.attrs=[["href",b]],_.level=f++,_.markup="linkify",_.info="auto",h.push(_);const T=new t.Token("text","",0);T.content=k,T.level=f,h.push(T);const A=new t.Token("link_close","a",-1);A.level=--f,A.markup="linkify",A.info="auto",h.push(A),m=d[x].lastIndex}if(m<u.length){const x=new t.Token("text","",0);x.content=u.slice(m),x.level=f,h.push(x)}e[n].children=o=jT(o,i,h)}}}}const $T=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,rK=/\((c|tm|r)\)/i,oK=/\((c|tm|r)\)/ig,sK={c:"©",r:"®",tm:"™"};function iK(t,e){return sK[e.toLowerCase()]}function aK(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(oK,iK)),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function lK(t){let e=0;for(let n=t.length-1;n>=0;n--){const r=t[n];r.type==="text"&&!e&&$T.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 uK(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(rK.test(t.tokens[e].content)&&aK(t.tokens[e].children),$T.test(t.tokens[e].content)&&lK(t.tokens[e].children))}const cK=/['"]/,aS=/['"]/g,lS="’";function Df(t,e,n,r){t[e]||(t[e]=[]),t[e].push({pos:n,ch:r})}function dK(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 fK(t,e){let n;const r=[],o={};for(let s=0;s<t.length;s++){const i=t[s],a=t[s].level;for(n=r.length-1;n>=0&&!(r[n].level<=a);n--);if(r.length=n+1,i.type!=="text")continue;const u=i.content;let d=0;const h=u.length;e:for(;d<h;){aS.lastIndex=d;const f=aS.exec(u);if(!f)break;let m=!0,x=!0;d=f.index+1;const v=f[0]==="'";let b=32;if(f.index-1>=0)b=u.charCodeAt(f.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<h)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 S=yc(b)||gc(b),_=yc(k)||gc(k),T=mc(b),A=mc(k);if(A?m=!1:_&&(T||S||(m=!1)),T?x=!1:S&&(A||_||(x=!1)),k===34&&f[0]==='"'&&b>=48&&b<=57&&(x=m=!1),m&&x&&(m=S,x=_),!m&&!x){v&&Df(o,s,f.index,lS);continue}if(x)for(n=r.length-1;n>=0;n--){let M=r[n];if(r[n].level<a)break;if(M.single===v&&r[n].level===a){M=r[n];let D,P;v?(D=e.md.options.quotes[2],P=e.md.options.quotes[3]):(D=e.md.options.quotes[0],P=e.md.options.quotes[1]),Df(o,s,f.index,P),Df(o,M.token,M.pos,D),r.length=n;continue e}}m?r.push({token:s,pos:f.index,single:v,level:a}):x&&v&&Df(o,s,f.index,lS)}}Object.keys(o).forEach(function(s){t[s].content=dK(t[s].content,o[s])})}function hK(t){if(t.md.options.typographer)for(let e=t.tokens.length-1;e>=0;e--)t.tokens[e].type!=="inline"||!cK.test(t.tokens[e].content)||fK(t.tokens[e].children,t)}function pK(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,a=i.length;for(e=0;e<a;e++)i[e].type==="text_special"&&(i[e].type="text");for(e=n=0;e<a;e++)i[e].type==="text"&&e+1<a&&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 Ug=[["normalize",Yq],["block",Xq],["inline",Qq],["linkify",nK],["replacements",uK],["smartquotes",hK],["text_join",pK]];function dv(){this.ruler=new tr;for(let t=0;t<Ug.length;t++)this.ruler.push(Ug[t][0],Ug[t][1])}dv.prototype.process=function(t){const e=this.ruler.getRules("");for(let n=0,r=e.length;n<r;n++)e[n](t)};dv.prototype.State=FT;function No(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,a=0,u=0,d=o.length,h=!1;i<d;i++){const f=o.charCodeAt(i);if(!h)if(vt(f)){a++,f===9?u+=4-u%4:u++;continue}else h=!0;(f===10||i===d-1)&&(f!==10&&i++,this.bMarks.push(s),this.eMarks.push(i),this.tShift.push(a),this.sCount.push(u),this.bsCount.push(0),h=!1,a=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}No.prototype.push=function(t,e,n){const r=new Xr(t,e,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r};No.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]};No.prototype.skipEmptyLines=function(e){for(let n=this.lineMax;e<n&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e};No.prototype.skipSpaces=function(e){for(let n=this.src.length;e<n;e++){const r=this.src.charCodeAt(e);if(!vt(r))break}return e};No.prototype.skipSpacesBack=function(e,n){if(e<=n)return e;for(;e>n;)if(!vt(this.src.charCodeAt(--e)))return e+1;return e};No.prototype.skipChars=function(e,n){for(let r=this.src.length;e<r&&this.src.charCodeAt(e)===n;e++);return e};No.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};No.prototype.getLines=function(e,n,r,o){if(e>=n)return"";const s=new Array(n-e);for(let i=0,a=e;a<n;a++,i++){let u=0;const d=this.bMarks[a];let h=d,f;for(a+1<n||o?f=this.eMarks[a]+1:f=this.eMarks[a];h<f&&u<r;){const m=this.src.charCodeAt(h);if(vt(m))m===9?u+=4-(u+this.bsCount[a])%4:u++;else if(h-d<this.tShift[a])u++;else break;h++}u>r?s[i]=new Array(u-r+1).join(" ")+this.src.slice(h,f):s[i]=this.src.slice(h,f)}return s.join("")};No.prototype.Token=Xr;const mK=65536;function Wg(t,e){const n=t.bMarks[e]+t.tShift[e],r=t.eMarks[e];return t.src.slice(n,r)}function uS(t){const e=[],n=t.length;let r=0,o=t.charCodeAt(r),s=!1,i=0,a="";for(;r<n;)o===124&&(s?(a+=t.substring(i,r-1),i=r):(e.push(a+t.substring(i,r)),a="",i=r+1)),s=o===92,r++,o=t.charCodeAt(r);return e.push(a+t.substring(i)),e}function gK(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 a=t.src.charCodeAt(s++);if(a!==124&&a!==45&&a!==58&&!vt(a)||i===45&&vt(a))return!1;for(;s<t.eMarks[o];){const A=t.src.charCodeAt(s);if(A!==124&&A!==45&&A!==58&&!vt(A))return!1;s++}let u=Wg(t,e+1),d=u.split("|");const h=[];for(let A=0;A<d.length;A++){const M=d[A].trim();if(!M){if(A===0||A===d.length-1)continue;return!1}if(!/^:?-+:?$/.test(M))return!1;M.charCodeAt(M.length-1)===58?h.push(M.charCodeAt(0)===58?"center":"right"):M.charCodeAt(0)===58?h.push("left"):h.push("")}if(u=Wg(t,e).trim(),u.indexOf("|")===-1||t.sCount[e]-t.blkIndent>=4)return!1;d=uS(u),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop();const f=d.length;if(f===0||f!==h.length)return!1;if(r)return!0;const m=t.parentType;t.parentType="table";const x=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 S=t.push("tr_open","tr",1);S.map=[e,e+1];for(let A=0;A<d.length;A++){const M=t.push("th_open","th",1);h[A]&&(M.attrs=[["style","text-align:"+h[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,P=x.length;D<P;D++)if(x[D](t,o,n,!0)){A=!0;break}if(A||(u=Wg(t,o).trim(),!u)||t.sCount[o]-t.blkIndent>=4||(d=uS(u),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop(),T+=f-d.length,T>mK))break;if(o===e+2){const D=t.push("tbody_open","tbody",1);D.map=_=[e+2,0]}const M=t.push("tr_open","tr",1);M.map=[o,o+1];for(let D=0;D<f;D++){const P=t.push("td_open","td",1);h[D]&&(P.attrs=[["style","text-align:"+h[D]]]);const j=t.push("inline","",0);j.content=d[D]?d[D].trim():"",j.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 yK(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)+`
|
|
619
|
+
`,s.map=[e,t.line],!0}function xK(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 a=o;o=t.skipChars(o,i);let u=o-a;if(u<3)return!1;const d=t.src.slice(a,o),h=t.src.slice(o,s);if(i===96&&h.indexOf(String.fromCharCode(i))>=0)return!1;if(r)return!0;let f=e,m=!1;for(;f++,!(f>=n||(o=a=t.bMarks[f]+t.tShift[f],s=t.eMarks[f],o<s&&t.sCount[f]<t.blkIndent));)if(t.src.charCodeAt(o)===i&&!(t.sCount[f]-t.blkIndent>=4)&&(o=t.skipChars(o,i),!(o-a<u)&&(o=t.skipSpaces(o),!(o<s)))){m=!0;break}u=t.sCount[e],t.line=f+(m?1:0);const x=t.push("fence","code",0);return x.info=h,x.content=t.getLines(e+1,f,u,!0),x.markup=d,x.map=[e,t.line],!0}function vK(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 a=[],u=[],d=[],h=[],f=t.md.block.ruler.getRules("blockquote"),m=t.parentType;t.parentType="blockquote";let x=!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 M=t.sCount[v]+1,D,P;t.src.charCodeAt(o)===32?(o++,M++,P=!1,D=!0):t.src.charCodeAt(o)===9?(D=!0,(t.bsCount[v]+M)%4===3?(o++,M++,P=!1):P=!0):D=!1;let j=M;for(a.push(t.bMarks[v]),t.bMarks[v]=o;o<s;){const I=t.src.charCodeAt(o);if(vt(I))I===9?j+=4-(j+t.bsCount[v]+(P?1:0))%4:j++;else break;o++}x=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]=j-M,h.push(t.tShift[v]),t.tShift[v]=o-t.bMarks[v];continue}if(x)break;let A=!1;for(let M=0,D=f.length;M<D;M++)if(f[M](t,v,n,!0)){A=!0;break}if(A){t.lineMax=v,t.blkIndent!==0&&(a.push(t.bMarks[v]),u.push(t.bsCount[v]),h.push(t.tShift[v]),d.push(t.sCount[v]),t.sCount[v]-=t.blkIndent);break}a.push(t.bMarks[v]),u.push(t.bsCount[v]),h.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 S=[e,0];k.map=S,t.md.block.tokenize(t,e,v);const _=t.push("blockquote_close","blockquote",-1);_.markup=">",t.lineMax=i,t.parentType=m,S[1]=t.line;for(let T=0;T<h.length;T++)t.bMarks[T+e]=a[T],t.tShift[T+e]=h[T],t.sCount[T+e]=d[T],t.bsCount[T+e]=u[T];return t.blkIndent=b,!0}function bK(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 a=1;for(;s<o;){const d=t.src.charCodeAt(s++);if(d!==i&&!vt(d))return!1;d===i&&a++}if(a<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(a+1).join(String.fromCharCode(i)),!0}function cS(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(!vt(s))return-1}return r}function dS(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),!vt(s))?-1:o}function kK(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 wK(t,e,n,r){let o,s,i,a,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 h=!1;r&&t.parentType==="paragraph"&&t.sCount[u]>=t.blkIndent&&(h=!0);let f,m,x;if((x=dS(t,u))>=0){if(f=!0,i=t.bMarks[u]+t.tShift[u],m=Number(t.src.slice(i,x-1)),h&&m!==1)return!1}else if((x=cS(t,u))>=0)f=!1;else return!1;if(h&&t.skipSpaces(x)>=t.eMarks[u])return!1;if(r)return!0;const v=t.src.charCodeAt(x-1),b=t.tokens.length;f?(a=t.push("ordered_list_open","ol",1),m!==1&&(a.attrs=[["start",m]])):a=t.push("bullet_list_open","ul",1);const k=[u,0];a.map=k,a.markup=String.fromCharCode(v);let S=!1;const _=t.md.block.ruler.getRules("list"),T=t.parentType;for(t.parentType="list";u<n;){s=x,o=t.eMarks[u];const A=t.sCount[u]+x-(t.bMarks[u]+t.tShift[u]);let M=A;for(;s<o;){const ee=t.src.charCodeAt(s);if(ee===9)M+=4-(M+t.bsCount[u])%4;else if(ee===32)M++;else break;s++}const D=s;let P;D>=o?P=1:P=M-A,P>4&&(P=1);const j=A+P;a=t.push("list_item_open","li",1),a.markup=String.fromCharCode(v);const I=[u,0];a.map=I,f&&(a.info=t.src.slice(i,x-1));const W=t.tight,Z=t.tShift[u],J=t.sCount[u],K=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=j,t.tight=!0,t.tShift[u]=D-t.bMarks[u],t.sCount[u]=M,D>=o&&t.isEmpty(u+1)?t.line=Math.min(t.line+2,n):t.md.block.tokenize(t,u,n,!0),(!t.tight||S)&&(d=!1),S=t.line-u>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=K,t.tShift[u]=Z,t.sCount[u]=J,t.tight=W,a=t.push("list_item_close","li",-1),a.markup=String.fromCharCode(v),u=t.line,I[1]=u,u>=n||t.sCount[u]<t.blkIndent||t.sCount[u]-t.blkIndent>=4)break;let Y=!1;for(let ee=0,G=_.length;ee<G;ee++)if(_[ee](t,u,n,!0)){Y=!0;break}if(Y)break;if(f){if(x=dS(t,u),x<0)break;i=t.bMarks[u]+t.tShift[u]}else if(x=cS(t,u),x<0)break;if(v!==t.src.charCodeAt(x-1))break}return f?a=t.push("ordered_list_close","ol",-1):a=t.push("bullet_list_close","ul",-1),a.markup=String.fromCharCode(v),k[1]=u,t.line=u,t.parentType=T,d&&kK(t,b),!0}function CK(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 a(_){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 P=t.md.block.ruler.getRules("reference"),j=t.parentType;t.parentType="reference";let I=!1;for(let W=0,Z=P.length;W<Z;W++)if(P[W](t,_,T,!0)){I=!0;break}if(t.parentType=j,I)return null}const M=t.bMarks[_]+t.tShift[_],D=t.eMarks[_];return t.src.slice(M,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=a(i);T!==null&&(u+=T,s=u.length,i++)}else if(_===92&&(o++,o<s&&u.charCodeAt(o)===10)){const T=a(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=a(i);T!==null&&(u+=T,s=u.length,i++)}else if(!vt(_))break}const h=t.md.helpers.parseLinkDestination(u,o,s);if(!h.ok)return!1;const f=t.md.normalizeLink(h.str);if(!t.md.validateLink(f))return!1;o=h.pos;const m=o,x=i,v=o;for(;o<s;o++){const _=u.charCodeAt(o);if(_===10){const T=a(i);T!==null&&(u+=T,s=u.length,i++)}else if(!vt(_))break}let b=t.md.helpers.parseLinkTitle(u,o,s);for(;b.can_continue;){const _=a(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=x);o<s;){const _=u.charCodeAt(o);if(!vt(_))break;o++}if(o<s&&u.charCodeAt(o)!==10&&k)for(k="",o=m,i=x;o<s;){const _=u.charCodeAt(o);if(!vt(_))break;o++}if(o<s&&u.charCodeAt(o)!==10)return!1;const S=Kp(u.slice(1,d));return S?(r||(typeof t.env.references>"u"&&(t.env.references={}),typeof t.env.references[S]>"u"&&(t.env.references[S]={title:k,href:f}),t.line=i),!0):!1}const SK=["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"],EK="[a-zA-Z_:][a-zA-Z0-9:._-]*",_K="[^\"'=<>`\\x00-\\x20]+",TK="'[^']*'",NK='"[^"]*"',AK="(?:"+_K+"|"+TK+"|"+NK+")",MK="(?:\\s+"+EK+"(?:\\s*=\\s*"+AK+")?)",BT="<[A-Za-z][A-Za-z0-9\\-]*"+MK+"*\\s*\\/?>",VT="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",DK="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",RK="<[?][\\s\\S]*?[?]>",OK="<![A-Za-z][^>]*>",IK="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",PK=new RegExp("^(?:"+BT+"|"+VT+"|"+DK+"|"+RK+"|"+OK+"|"+IK+")"),jK=new RegExp("^(?:"+BT+"|"+VT+")"),zi=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+SK.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(jK.source+"\\s*$"),/^$/,!1]];function LK(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),a=0;for(;a<zi.length&&!zi[a][0].test(i);a++);if(a===zi.length)return!1;if(r)return zi[a][2];let u=e+1;const d=zi[a][1].test("");if(!zi[a][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),zi[a][1].test(i)){i.length!==0&&u++;break}}t.line=u;const h=t.push("html_block","",0);return h.map=[e,u],h.content=t.getLines(e,u,t.blkIndent,!0),!0}function zK(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 a=1;for(i=t.src.charCodeAt(++o);i===35&&o<s&&a<=6;)a++,i=t.src.charCodeAt(++o);if(a>6||o<s&&!vt(i))return!1;if(r)return!0;s=t.skipSpacesBack(s,o);const u=t.skipCharsBack(s,35,o);u>o&&vt(t.src.charCodeAt(u-1))&&(s=u),t.line=e+1;const d=t.push("heading_open","h"+String(a),1);d.markup="########".slice(0,a),d.map=[e,t.line];const h=t.push("inline","",0);h.content=Gp(t.src.slice(o,s)),h.map=[e,t.line],h.children=[];const f=t.push("heading_close","h"+String(a),-1);return f.markup="########".slice(0,a),!0}function FK(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,a=e+1;for(;a<n&&!t.isEmpty(a);a++){if(t.sCount[a]-t.blkIndent>3)continue;if(t.sCount[a]>=t.blkIndent){let x=t.bMarks[a]+t.tShift[a];const v=t.eMarks[a];if(x<v&&(i=t.src.charCodeAt(x),(i===45||i===61)&&(x=t.skipChars(x,i),x=t.skipSpaces(x),x>=v))){s=i===61?1:2;break}}if(t.sCount[a]<0)continue;let m=!1;for(let x=0,v=r.length;x<v;x++)if(r[x](t,a,n,!0)){m=!0;break}if(m)break}if(!s)return t.parentType=o,!1;const u=Gp(t.getLines(e,a,t.blkIndent,!1));t.line=a+1;const d=t.push("heading_open","h"+String(s),1);d.markup=String.fromCharCode(i),d.map=[e,t.line];const h=t.push("inline","",0);h.content=u,h.map=[e,t.line-1],h.children=[];const f=t.push("heading_close","h"+String(s),-1);return f.markup=String.fromCharCode(i),t.parentType=o,!0}function $K(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 h=0,f=r.length;h<f;h++)if(r[h](t,s,n,!0)){d=!0;break}if(d)break}const i=Gp(t.getLines(e,s,t.blkIndent,!1));t.line=s;const a=t.push("paragraph_open","p",1);a.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 Rf=[["table",gK,["paragraph","reference"]],["code",yK],["fence",xK,["paragraph","reference","blockquote","list"]],["blockquote",vK,["paragraph","reference","blockquote","list"]],["hr",bK,["paragraph","reference","blockquote","list"]],["list",wK,["paragraph","reference","blockquote"]],["reference",CK],["html_block",LK,["paragraph","reference","blockquote"]],["heading",zK,["paragraph","reference","blockquote"]],["lheading",FK],["paragraph",$K]];function Jp(){this.ruler=new tr;for(let t=0;t<Rf.length;t++)this.ruler.push(Rf[t][0],Rf[t][1],{alt:(Rf[t][2]||[]).slice()})}Jp.prototype.tokenize=function(t,e,n){const r=this.ruler.getRules(""),o=r.length,s=t.md.options.maxNesting;let i=e,a=!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 h=0;h<o;h++)if(d=r[h](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=!a,t.isEmpty(t.line-1)&&(a=!0),i=t.line,i<n&&t.isEmpty(i)&&(a=!0,i++,t.line=i)}};Jp.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)};Jp.prototype.State=No;function Wc(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}Wc.prototype.pushPending=function(){const t=new Xr("text","",0);return t.content=this.pending,t.level=this.pendingLevel,this.tokens.push(t),this.pending="",t};Wc.prototype.push=function(t,e,n){this.pending&&this.pushPending();const r=new Xr(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};Wc.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 a=s<n?this.src.charCodeAt(s):32;if((a&64512)===55296){const k=this.src.charCodeAt(s+1);a=(k&64512)===56320?65536+(a-55296<<10)+(k-56320):65533}else(a&64512)===56320&&(a=65533);const u=yc(o)||gc(o),d=yc(a)||gc(a),h=mc(o),f=mc(a),m=!f&&(!d||h||u),x=!h&&(!u||f||d);return{can_open:m&&(e||!x||u),can_close:x&&(e||!m||d),length:i}};Wc.prototype.Token=Xr;function BK(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 VK(t,e){let n=t.pos;for(;n<t.posMax&&!BK(t.src.charCodeAt(n));)n++;return n===t.pos?!1:(e||(t.pending+=t.src.slice(t.pos,n)),t.pos=n,!0)}const HK=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function UK(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(HK);if(!o)return!1;const s=o[1],i=t.md.linkify.matchAtStart(t.src.slice(n-s.length));if(!i)return!1;let a=i.url;if(a.length<=s.length)return!1;let u=a.length;for(;u>0&&a.charCodeAt(u-1)===42;)u--;u!==a.length&&(a=a.slice(0,u));const d=t.md.normalizeLink(a);if(!t.md.validateLink(d))return!1;if(!e){t.pending=t.pending.slice(0,-s.length);const h=t.push("link_open","a",1);h.attrs=[["href",d]],h.markup="linkify",h.info="auto";const f=t.push("text","",0);f.content=t.md.normalizeLinkText(a);const m=t.push("link_close","a",-1);m.markup="linkify",m.info="auto"}return t.pos+=a.length-s.length,!0}function WK(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&&vt(t.src.charCodeAt(n));)n++;return t.pos=n,!0}const fv=[];for(let t=0;t<256;t++)fv.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(t){fv[t.charCodeAt(0)]=1});function qK(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),!!vt(o));)n++;return t.pos=n,!0}if(o===32){if(!e){const a=t.push("text_special","",0);a.content="\\",a.markup="\\",a.info="escape"}return t.pos=n,!0}let s=t.src[n];if(o>=55296&&o<=56319&&n+1<r){const a=t.src.charCodeAt(n+1);a>=56320&&a<=57343&&(s+=t.src[n+1],n++)}const i="\\"+s;if(!e){const a=t.push("text_special","",0);o<256&&fv[o]!==0?a.content=s:a.content=i,a.markup=i,a.info="escape"}return t.pos=n+1,!0}function KK(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),a=i.length;if(t.backticksScanned&&(t.backticks[a]||0)<=o)return e||(t.pending+=i),t.pos+=a,!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 h=u-d;if(h===a){if(!e){const f=t.push("code_inline","code",0);f.markup=i,f.content=t.src.slice(n,d).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return t.pos=u,!0}t.backticks[h]=d}return t.backticksScanned=!0,e||(t.pending+=i),t.pos+=a,!0}function GK(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 a;s%2&&(a=t.push("text","",0),a.content=i,s--);for(let u=0;u<s;u+=2)a=t.push("text","",0),a.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 fS(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 a=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[a.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",t.tokens[a.token-1].type==="text"&&t.tokens[a.token-1].content==="~"&&r.push(a.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 JK(t){const e=t.tokens_meta,n=t.tokens_meta.length;fS(t,t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&fS(t,e[r].delimiters)}const HT={tokenize:GK,postProcess:JK};function ZK(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 hS(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,a=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?a+a:a,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?a+a:a,d.content="",i&&(t.tokens[e[r-1].token].content="",t.tokens[e[o.end+1].token].content="",r--)}}function YK(t){const e=t.tokens_meta,n=t.tokens_meta.length;hS(t,t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&hS(t,e[r].delimiters)}const UT={tokenize:ZK,postProcess:YK};function XK(t,e){let n,r,o,s,i="",a="",u=t.pos,d=!0;if(t.src.charCodeAt(t.pos)!==91)return!1;const h=t.pos,f=t.posMax,m=t.pos+1,x=t.md.helpers.parseLinkLabel(t,t.pos,!0);if(x<0)return!1;let v=x+1;if(v<f&&t.src.charCodeAt(v)===40){for(d=!1,v++;v<f&&(n=t.src.charCodeAt(v),!(!vt(n)&&n!==10));v++);if(v>=f)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<f&&(n=t.src.charCodeAt(v),!(!vt(n)&&n!==10));v++);if(o=t.md.helpers.parseLinkTitle(t.src,v,t.posMax),v<f&&u!==v&&o.ok)for(a=o.str,v=o.pos;v<f&&(n=t.src.charCodeAt(v),!(!vt(n)&&n!==10));v++);}(v>=f||t.src.charCodeAt(v)!==41)&&(d=!0),v++}if(d){if(typeof t.env.references>"u")return!1;if(v<f&&t.src.charCodeAt(v)===91?(u=v+1,v=t.md.helpers.parseLinkLabel(t,v),v>=0?r=t.src.slice(u,v++):v=x+1):v=x+1,r||(r=t.src.slice(m,x)),s=t.env.references[Kp(r)],!s)return t.pos=h,!1;i=s.href,a=s.title}if(!e){t.pos=m,t.posMax=x;const b=t.push("link_open","a",1),k=[["href",i]];b.attrs=k,a&&k.push(["title",a]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,t.push("link_close","a",-1)}return t.pos=v,t.posMax=f,!0}function QK(t,e){let n,r,o,s,i,a,u,d,h="";const f=t.pos,m=t.posMax;if(t.src.charCodeAt(t.pos)!==33||t.src.charCodeAt(t.pos+1)!==91)return!1;const x=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),!(!vt(n)&&n!==10));s++);if(s>=m)return!1;for(d=s,a=t.md.helpers.parseLinkDestination(t.src,s,t.posMax),a.ok&&(h=t.md.normalizeLink(a.str),t.md.validateLink(h)?s=a.pos:h=""),d=s;s<m&&(n=t.src.charCodeAt(s),!(!vt(n)&&n!==10));s++);if(a=t.md.helpers.parseLinkTitle(t.src,s,t.posMax),s<m&&d!==s&&a.ok)for(u=a.str,s=a.pos;s<m&&(n=t.src.charCodeAt(s),!(!vt(n)&&n!==10));s++);else u="";if(s>=m||t.src.charCodeAt(s)!==41)return t.pos=f,!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(x,v)),i=t.env.references[Kp(o)],!i)return t.pos=f,!1;h=i.href,u=i.title}if(!e){r=t.src.slice(x,v);const b=[];t.md.inline.parse(r,t.md,t.env,b);const k=t.push("image","img",0),S=[["src",h],["alt",""]];k.attrs=S,k.children=b,k.content=r,u&&S.push(["title",u])}return t.pos=s,t.posMax=m,!0}const eG=/^([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])?)*)$/,tG=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function nG(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(tG.test(s)){const i=t.md.normalizeLink(s);if(!t.md.validateLink(i))return!1;if(!e){const a=t.push("link_open","a",1);a.attrs=[["href",i]],a.markup="autolink",a.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(eG.test(s)){const i=t.md.normalizeLink("mailto:"+s);if(!t.md.validateLink(i))return!1;if(!e){const a=t.push("link_open","a",1);a.attrs=[["href",i]],a.markup="autolink",a.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 rG(t){return/^<a[>\s]/i.test(t)}function oG(t){return/^<\/a\s*>/i.test(t)}function sG(t){const e=t|32;return e>=97&&e<=122}function iG(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&&!sG(o))return!1;const s=t.src.slice(r).match(PK);if(!s)return!1;if(!e){const i=t.push("html_inline","",0);i.content=s[0],rG(i.content)&&t.linkLevel++,oG(i.content)&&t.linkLevel--}return t.pos+=s[0].length,!0}const aG=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,lG=/^&([a-z][a-z0-9]{1,31});/i;function uG(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(aG);if(s){if(!e){const i=s[1][0].toLowerCase()==="x"?parseInt(s[1].slice(1),16):parseInt(s[1],10),a=t.push("text_special","",0);a.content=cv(i)?pc(i):pc(65533),a.markup=s[0],a.info="entity"}return t.pos+=s[0].length,!0}}else{const s=t.src.slice(n).match(lG);if(s){const i=Nq(s[0]);if(i!==s[0]){if(!e){const a=t.push("text_special","",0);a.content=i,a.markup=s[0],a.info="entity"}return t.pos+=s[0].length,!0}}}return!1}function pS(t){const e={},n=t.length;if(!n)return;let r=0,o=-2;const s=[];for(let i=0;i<n;i++){const a=t[i];if(s.push(0),(t[r].marker!==a.marker||o!==a.token-1)&&(r=i),o=a.token,a.length=a.length||0,!a.close)continue;e.hasOwnProperty(a.marker)||(e[a.marker]=[-1,-1,-1,-1,-1,-1]);const u=e[a.marker][(a.open?3:0)+a.length%3];let d=r-s[r]-1,h=d;for(;d>u;d-=s[d]+1){const f=t[d];if(f.marker===a.marker&&f.open&&f.end<0){let m=!1;if((f.close||a.open)&&(f.length+a.length)%3===0&&(f.length%3!==0||a.length%3!==0)&&(m=!0),!m){const x=d>0&&!t[d-1].open?s[d-1]+1:0;s[i]=i-d+x,s[d]=x,a.open=!1,f.end=i,f.close=!1,h=-1,o=-2;break}}}h!==-1&&(e[a.marker][(a.open?3:0)+(a.length||0)%3]=h)}}function cG(t){const e=t.tokens_meta,n=t.tokens_meta.length;pS(t.delimiters);for(let r=0;r<n;r++)e[r]&&e[r].delimiters&&pS(e[r].delimiters)}function dG(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 qg=[["text",VK],["linkify",UK],["newline",WK],["escape",qK],["backticks",KK],["strikethrough",HT.tokenize],["emphasis",UT.tokenize],["link",XK],["image",QK],["autolink",nG],["html_inline",iG],["entity",uG]],Kg=[["balance_pairs",cG],["strikethrough",HT.postProcess],["emphasis",UT.postProcess],["fragments_join",dG]];function qc(){this.ruler=new tr;for(let t=0;t<qg.length;t++)this.ruler.push(qg[t][0],qg[t][1]);this.ruler2=new tr;for(let t=0;t<Kg.length;t++)this.ruler2.push(Kg[t][0],Kg[t][1])}qc.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 a=0;a<r;a++)if(t.level++,i=n[a](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};qc.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 a=0;a<n;a++)if(i=e[a](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()};qc.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 a=0;a<i;a++)s[a](o)};qc.prototype.State=Wc;function fG(t){const e={};t=t||{},e.src_Any=MT.source,e.src_Cc=DT.source,e.src_Z=OT.source,e.src_P=lv.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 wy(t){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(r){t[r]=n[r]})}),t}function Zp(t){return Object.prototype.toString.call(t)}function hG(t){return Zp(t)==="[object String]"}function pG(t){return Zp(t)==="[object Object]"}function mG(t){return Zp(t)==="[object RegExp]"}function mS(t){return Zp(t)==="[object Function]"}function gG(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const WT={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function yG(t){return Object.keys(t||{}).reduce(function(e,n){return e||WT.hasOwnProperty(n)},!1)}const xG={"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}}},vG="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]",bG="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function kG(t){return function(e,n){const r=e.slice(n);return t.test(r)?r.match(t)[0].length:0}}function gS(){return function(t,e){e.normalize(t)}}function Yh(t){const e=t.re=fG(t.__opts__),n=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||n.push(vG),n.push(e.src_xn),e.src_tlds=n.join("|");function r(a){return a.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(a,u){throw new Error(`(LinkifyIt) Invalid schema "${a}": ${u}`)}Object.keys(t.__schemas__).forEach(function(a){const u=t.__schemas__[a];if(u===null)return;const d={validate:null,link:null};if(t.__compiled__[a]=d,pG(u)){mG(u.validate)?d.validate=kG(u.validate):mS(u.validate)?d.validate=u.validate:s(a,u),mS(u.normalize)?d.normalize=u.normalize:u.normalize?s(a,u):d.normalize=gS();return}if(hG(u)){o.push(a);return}s(a,u)}),o.forEach(function(a){t.__compiled__[t.__schemas__[a]]&&(t.__compiled__[a].validate=t.__compiled__[t.__schemas__[a]].validate,t.__compiled__[a].normalize=t.__compiled__[t.__schemas__[a]].normalize)}),t.__compiled__[""]={validate:null,normalize:gS()};const i=Object.keys(t.__compiled__).filter(function(a){return a.length>0&&t.__compiled__[a]}).map(gG).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 qT(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 dr(t,e){if(!(this instanceof dr))return new dr(t,e);e||yG(t)&&(e=t,t={}),this.__opts__=wy({},WT,e),this.__schemas__=wy({},xG,t),this.__compiled__={},this.__tlds__=bG,this.__tlds_replaced__=!1,this.re={},Yh(this)}dr.prototype.add=function(e,n){return this.__schemas__[e]=n,Yh(this),this};dr.prototype.set=function(e){return this.__opts__=wy(this.__opts__,e),this};dr.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)};dr.prototype.pretest=function(e){return this.re.pretest.test(e)};dr.prototype.testSchemaAt=function(e,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(e,r,this):0};dr.prototype.match=function(e){const n=[],r=[],o=[],s=[];let i,a,u;function d(m,x){return m?x?m.index!==x.index?m.index<x.index?m:x:m.lastIndex>=x.lastIndex?m:x:m:x}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;)a=this.testSchemaAt(e,i[2],u.lastIndex),a&&r.push({schema:i[2],index:i.index+i[1].length,lastIndex:i.index+i[0].length+a});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 h=[0,0,0];let f=0;for(;;){const m=[r[h[0]],s[h[1]],o[h[2]]],x=d(d(m[0],m[1]),m[2]);if(!x)break;if(x===m[0]?h[0]++:x===m[1]?h[1]++:h[2]++,x.index<f)continue;const v=new qT(e,x.schema,x.index,x.lastIndex);this.__compiled__[v.schema].normalize(v,this),n.push(v),f=x.lastIndex}return n.length?n:null};dr.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 qT(e,n[2],n.index+n[1].length,n.index+n[0].length+r);return this.__compiled__[o.schema].normalize(o,this),o};dr.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(),Yh(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,Yh(this),this)};dr.prototype.normalize=function(e){e.schema||(e.url=`http://${e.url}`),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)};dr.prototype.onCompile=function(){};const el=2147483647,xo=36,hv=1,xc=26,wG=38,CG=700,KT=72,GT=128,JT="-",SG=/^xn--/,EG=/[^\0-\x7F]/,_G=/[\x2E\u3002\uFF0E\uFF61]/g,TG={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Gg=xo-hv,vo=Math.floor,Jg=String.fromCharCode;function Us(t){throw new RangeError(TG[t])}function NG(t,e){const n=[];let r=t.length;for(;r--;)n[r]=e(t[r]);return n}function ZT(t,e){const n=t.split("@");let r="";n.length>1&&(r=n[0]+"@",t=n[1]),t=t.replace(_G,".");const o=t.split("."),s=NG(o,e).join(".");return r+s}function YT(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 AG=t=>String.fromCodePoint(...t),MG=function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:xo},yS=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},XT=function(t,e,n){let r=0;for(t=n?vo(t/CG):t>>1,t+=vo(t/e);t>Gg*xc>>1;r+=xo)t=vo(t/Gg);return vo(r+(Gg+1)*t/(t+wG))},QT=function(t){const e=[],n=t.length;let r=0,o=GT,s=KT,i=t.lastIndexOf(JT);i<0&&(i=0);for(let a=0;a<i;++a)t.charCodeAt(a)>=128&&Us("not-basic"),e.push(t.charCodeAt(a));for(let a=i>0?i+1:0;a<n;){const u=r;for(let h=1,f=xo;;f+=xo){a>=n&&Us("invalid-input");const m=MG(t.charCodeAt(a++));m>=xo&&Us("invalid-input"),m>vo((el-r)/h)&&Us("overflow"),r+=m*h;const x=f<=s?hv:f>=s+xc?xc:f-s;if(m<x)break;const v=xo-x;h>vo(el/v)&&Us("overflow"),h*=v}const d=e.length+1;s=XT(r-u,d,u==0),vo(r/d)>el-o&&Us("overflow"),o+=vo(r/d),r%=d,e.splice(r++,0,o)}return String.fromCodePoint(...e)},eN=function(t){const e=[];t=YT(t);const n=t.length;let r=GT,o=0,s=KT;for(const u of t)u<128&&e.push(Jg(u));const i=e.length;let a=i;for(i&&e.push(JT);a<n;){let u=el;for(const h of t)h>=r&&h<u&&(u=h);const d=a+1;u-r>vo((el-o)/d)&&Us("overflow"),o+=(u-r)*d,r=u;for(const h of t)if(h<r&&++o>el&&Us("overflow"),h===r){let f=o;for(let m=xo;;m+=xo){const x=m<=s?hv:m>=s+xc?xc:m-s;if(f<x)break;const v=f-x,b=xo-x;e.push(Jg(yS(x+v%b,0))),f=vo(v/b)}e.push(Jg(yS(f,0))),s=XT(o,d,a===i),o=0,++a}++o,++r}return e.join("")},DG=function(t){return ZT(t,function(e){return SG.test(e)?QT(e.slice(4).toLowerCase()):e})},RG=function(t){return ZT(t,function(e){return EG.test(e)?"xn--"+eN(e):e})},tN={version:"2.3.1",ucs2:{decode:YT,encode:AG},decode:QT,encode:eN,toASCII:RG,toUnicode:DG},OG={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},IG={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"]}}},PG={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"]}}},jG={default:OG,zero:IG,commonmark:PG},LG=/^(vbscript|javascript|file|data):/,zG=/^data:image\/(gif|png|jpeg|webp);/;function FG(t){const e=t.trim().toLowerCase();return LG.test(e)?zG.test(e):!0}const nN=["http:","https:","mailto:"];function $G(t){const e=av(t,!0);if(e.hostname&&(!e.protocol||nN.indexOf(e.protocol)>=0))try{e.hostname=tN.toASCII(e.hostname)}catch{}return Uc(iv(e))}function BG(t){const e=av(t,!0);if(e.hostname&&(!e.protocol||nN.indexOf(e.protocol)>=0))try{e.hostname=tN.toUnicode(e.hostname)}catch{}return yl(iv(e),yl.defaultChars+"%")}function nr(t,e){if(!(this instanceof nr))return new nr(t,e);e||uv(t)||(e=t||{},t="default"),this.inline=new qc,this.block=new Jp,this.core=new dv,this.renderer=new Tl,this.linkify=new dr,this.validateLink=FG,this.normalizeLink=$G,this.normalizeLinkText=BG,this.utils=Uq,this.helpers=qp({},Gq),this.options={},this.configure(t),e&&this.set(e)}nr.prototype.set=function(t){return qp(this.options,t),this};nr.prototype.configure=function(t){const e=this;if(uv(t)){const n=t;if(t=jG[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};nr.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};nr.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};nr.prototype.use=function(t){const e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this};nr.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};nr.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)};nr.prototype.parseInline=function(t,e){const n=new this.core.State(t,this,e);return n.inlineMode=!0,this.core.process(n),n.tokens};nr.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};const VG=new xx({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 HG(t,e){if(t.isText&&e.isText&&ut.sameSet(t.marks,e.marks))return t.withText(t.text+e.text)}class UG{constructor(e,n){this.schema=e,this.tokenHandlers=n,this.stack=[{type:e.topNodeType,attrs:null,content:[],marks:ut.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=HG(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:ut.none})}closeNode(){let e=this.stack.pop();return this.addNode(e.type,e.attrs,e.content)}}function yu(t,e,n,r){return t.getAttrs?t.getAttrs(e,n,r):t.attrs instanceof Function?t.attrs(e):t.attrs}function Zg(t,e){return t.noCloseToken||e=="code_inline"||e=="code_block"||e=="fence"}function xS(t){return t[t.length-1]==`
|
|
620
|
+
`?t.slice(0,t.length-1):t}function Yg(){}function WG(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);Zg(o,r)?n[r]=(i,a,u,d)=>{i.openNode(s,yu(o,a,u,d)),i.addText(xS(a.content)),i.closeNode()}:(n[r+"_open"]=(i,a,u,d)=>i.openNode(s,yu(o,a,u,d)),n[r+"_close"]=i=>i.closeNode())}else if(o.node){let s=t.nodeType(o.node);n[r]=(i,a,u,d)=>i.addNode(s,yu(o,a,u,d))}else if(o.mark){let s=t.marks[o.mark];Zg(o,r)?n[r]=(i,a,u,d)=>{i.openMark(s.create(yu(o,a,u,d))),i.addText(xS(a.content)),i.closeMark(s)}:(n[r+"_open"]=(i,a,u,d)=>i.openMark(s.create(yu(o,a,u,d))),n[r+"_close"]=i=>i.closeMark(s))}else if(o.ignore)Zg(o,r)?n[r]=Yg:(n[r+"_open"]=Yg,n[r+"_close"]=Yg);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 qG=class{constructor(e,n,r){this.schema=e,this.tokenizer=n,this.tokens=r,this.tokenHandlers=WG(e,r)}parse(e,n={}){let r=new UG(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 vS(t,e){for(;++e<t.length;)if(t[e].type!="list_item_open")return t[e].hidden;return!1}new qG(VG,nr("commonmark",{html:!1}),{blockquote:{block:"blockquote"},paragraph:{block:"paragraph"},list_item:{block:"list_item"},bullet_list:{block:"bullet_list",getAttrs:(t,e,n)=>({tight:vS(e,n)})},ordered_list:{block:"ordered_list",getAttrs:(t,e,n)=>({order:+t.attrGet("start")||1,tight:vS(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 KG={open:"",close:"",mixable:!0};let GG=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 rN(this.nodes,this.marks,n);return r.renderContent(e),r.out}};const Ao=new GG({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||"")+`
|
|
621
|
+
`),t.text(e.textContent,!1),t.write(`
|
|
622
|
+
`),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 a=String(r+i);return t.repeat(" ",o-a.length)+a+". "})},list_item(t,e){t.renderContent(e)},paragraph(t,e){t.renderInline(e),t.closeBlock(e)},image(t,e){t.write("]/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(`\\
|
|
623
|
+
`);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=JG(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 bS(n.child(r),-1)},close(t,e,n,r){return bS(n.child(r-1),1)},escape:!1}});function bS(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 JG(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 rN=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+=`
|
|
624
|
+
`),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+`
|
|
625
|
+
`}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=KG}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+=`
|
|
626
|
+
`)}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(`
|
|
627
|
+
`);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+=`
|
|
628
|
+
`)}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,a,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 h=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,S]=/^(\s*)(.*)$/m.exec(i.text);k&&(h+=k,i=S?i.withText(S):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,S]=/^(.*?)(\s*)$/m.exec(i.text);S&&(o=S,i=k?i.withText(k):null,i||(d=r))}let f=d.length?d[d.length-1]:null,m=f&&this.getMark(f.type.name).escape===!1,x=d.length-(m?1:0);e:for(let b=0;b<x;b++){let k=d[b];if(!this.getMark(k.type.name).mixable)break;for(let S=0;S<r.length;S++){let _=r[S];if(!this.getMark(_.type.name).mixable)break;if(k.eq(_)){b>S?d=d.slice(0,S).concat(k).concat(d.slice(S,b)).concat(d.slice(b+1,x)):S>b&&(d=d.slice(0,b).concat(d.slice(b+1,S)).concat(k).concat(d.slice(S,x)));continue e}}}let v=0;for(;v<Math.min(r.length,x)&&d[v].eq(r[v]);)++v;for(;v<r.length;)this.text(this.markString(r.pop(),!1,e,u),!1);if(h&&this.text(h),i){for(;r.length<x;){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(f,!0,e,u)+i.text+this.markString(f,!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,a,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 Xg,kS;function ZG(){if(kS)return Xg;kS=1;var t=!0,e=!1,n=!1;Xg=function(b,k){k&&(t=!k.enabled,e=!!k.label,n=!!k.labelAfter),b.core.ruler.after("inline","github-task-lists",function(S){for(var _=S.tokens,T=2;T<_.length;T++)s(_,T)&&(i(_[T],S.Token),r(_[T-2],"class","task-list-item"+(t?"":" enabled")),r(_[o(_,T-2)],"class","contains-task-list"))})};function r(b,k,S){var _=b.attrIndex(k),T=[k,S];_<0?b.attrPush(T):b.attrs[_]=T}function o(b,k){for(var S=b[k].level-1,_=k-1;_>=0;_--)if(b[_].level===S)return _;return-1}function s(b,k){return f(b[k])&&m(b[k-1])&&x(b[k-2])&&v(b[k])}function i(b,k){if(b.children.unshift(a(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 S="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);b.children[0].content=b.children[0].content.slice(0,-1)+' id="'+S+'">',b.children.push(h(b.content,S,k))}else b.children.unshift(u(k)),b.children.push(d(k))}function a(b,k){var S=new k("html_inline","",0),_=t?' disabled="" ':"";return b.content.indexOf("[ ] ")===0?S.content='<input class="task-list-item-checkbox"'+_+'type="checkbox">':(b.content.indexOf("[x] ")===0||b.content.indexOf("[X] ")===0)&&(S.content='<input class="task-list-item-checkbox" checked=""'+_+'type="checkbox">'),S}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 h(b,k,S){var _=new S("html_inline","",0);return _.content='<label class="task-list-item-label" for="'+k+'">'+b+"</label>",_.attrs=[{for:k}],_}function f(b){return b.type==="inline"}function m(b){return b.type==="paragraph_open"}function x(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 Xg}var YG=ZG();const XG=Ay(YG);var QG=Object.defineProperty,eJ=(t,e,n)=>e in t?QG(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Xh=(t,e,n)=>(eJ(t,typeof e!="symbol"?e+"":e,n),n);const tJ=St.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 a=r.getAttributes(i);return o.updateAttributes(i,{tight:e??!(a!=null&&a.tight)})}return t.options.listTypes.some(i=>s(i))}}}}}),wS=nr();function oN(t,e){return wS.inline.State.prototype.scanDelims.call({src:t,posMax:t.length}),new wS.inline.State(t,null,null,[]).scanDelims(e,!0)}function sN(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 nJ(t,e,n,r){let o=n,s=t;for(;o<r&&!oN(s,o).can_open;)s=sN(s,e,o,1),o++;return{text:s,from:o,to:r}}function rJ(t,e,n,r){let o=r,s=t;for(;o>n&&!oN(s,o).can_close;)s=sN(s,e,o,-1),o--;return{text:s,from:n,to:o}}function oJ(t,e,n,r){let o={text:t,from:n,to:r};return o=nJ(o.text,e,o.from,o.to),o=rJ(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 sJ extends rN{constructor(e,n,r){super(e,n,r??{}),Xh(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:a}=this.normalizeInline(o);this.out=oJ(this.out,s,i,a),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 iN=hr.create({name:"markdownHTMLMark",addStorage(){return{markdown:{serialize:{open(t,e){var n,r;return this.editor.storage.markdown.options.html?(n=(r=CS(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=CS(e))===null||r===void 0?void 0:r[1])!==null&&n!==void 0?n:""}},parse:{}}}}});function CS(t){const e=t.type.schema,n=e.text(" ",[t]),o=Bc(oe.from(n),e).match(/^(<.*?>) (<\/.*?>)$/);return o?[o[1],o[2]]:null}function pv(t){const e=`<body>${t}</body>`;return new window.DOMParser().parseFromString(e,"text/html").body}function iJ(t){return t==null?void 0:t.replace(/</g,"<").replace(/>/g,">")}function aJ(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 lJ(t){const e=t.parentNode;for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}const Yp=ht.create({name:"markdownHTMLNode",addStorage(){return{markdown:{serialize(t,e,n){this.editor.storage.markdown.options.html?t.write(uJ(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 uJ(t,e){const n=t.type.schema,r=Bc(oe.from(t),n);return t.isBlock&&(e instanceof oe||e.type.name===n.topNodeType.name)?cJ(r):r}function cJ(t){const n=pv(t).firstElementChild;return n.innerHTML=n.innerHTML.trim()?`
|
|
629
|
+
${n.innerHTML}
|
|
630
|
+
`:`
|
|
631
|
+
`,n.outerHTML}const dJ=ht.create({name:"blockquote"}),fJ=dJ.extend({addStorage(){return{markdown:{serialize:Ao.nodes.blockquote,parse:{}}}}}),hJ=ht.create({name:"bulletList"}),aN=hJ.extend({addStorage(){return{markdown:{serialize(t,e){return t.renderList(e," ",()=>(this.editor.storage.markdown.options.bulletListMarker||"-")+" ")},parse:{}}}}}),pJ=ht.create({name:"codeBlock"}),mJ=pJ.extend({addStorage(){return{markdown:{serialize(t,e){t.write("```"+(e.attrs.language||"")+`
|
|
632
|
+
`),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>")}}}}}}),gJ=ht.create({name:"hardBreak"}),lN=gJ.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?Yp.storage.markdown.serialize.call(this,t,e,n):`\\
|
|
633
|
+
`);return}},parse:{}}}}}),yJ=ht.create({name:"heading"}),xJ=yJ.extend({addStorage(){return{markdown:{serialize:Ao.nodes.heading,parse:{}}}}}),vJ=ht.create({name:"horizontalRule"}),bJ=vJ.extend({addStorage(){return{markdown:{serialize:Ao.nodes.horizontal_rule,parse:{}}}}}),kJ=ht.create({name:"image"}),wJ=kJ.extend({addStorage(){return{markdown:{serialize:Ao.nodes.image,parse:{}}}}}),CJ=ht.create({name:"listItem"}),SJ=CJ.extend({addStorage(){return{markdown:{serialize:Ao.nodes.list_item,parse:{}}}}}),EJ=ht.create({name:"orderedList"});function _J(t,e,n){let r=0;for(;n-r>0&&e.child(n-r-1).type.name===t.type.name;r++);return r}const TJ=EJ.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=_J(e,n,r)%2?") ":". ";t.renderList(e,i,d=>{const h=String(o+d);return t.repeat(" ",s-h.length)+h+u})},parse:{}}}}}),NJ=ht.create({name:"paragraph"}),AJ=NJ.extend({addStorage(){return{markdown:{serialize:Ao.nodes.paragraph,parse:{}}}}});function Qg(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 MJ=ht.create({name:"table"}),DJ=MJ.extend({addStorage(){return{markdown:{serialize(t,e,n){if(!RJ(e)){Yp.storage.markdown.serialize.call(this,t,e,n);return}t.inTable=!0,e.forEach((r,o,s)=>{if(t.write("| "),r.forEach((i,a,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 SS(t){return t.attrs.colspan>1||t.attrs.rowspan>1}function RJ(t){const e=Qg(t),n=e[0],r=e.slice(1);return!(Qg(n).some(o=>o.type.name!=="tableHeader"||SS(o)||o.childCount>1)||r.some(o=>Qg(o).some(s=>s.type.name==="tableHeader"||SS(s)||s.childCount>1)))}const OJ=ht.create({name:"taskItem"}),IJ=OJ.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())})}}}}}}),PJ=ht.create({name:"taskList"}),jJ=PJ.extend({addStorage(){return{markdown:{serialize:aN.storage.markdown.serialize,parse:{setup(t){t.use(XG)},updateDOM(t){[...t.querySelectorAll(".contains-task-list")].forEach(e=>{e.setAttribute("data-type","taskList")})}}}}}}),LJ=ht.create({name:"text"}),zJ=LJ.extend({addStorage(){return{markdown:{serialize(t,e){t.text(iJ(e.text))},parse:{}}}}}),FJ=hr.create({name:"bold"}),$J=FJ.extend({addStorage(){return{markdown:{serialize:Ao.marks.strong,parse:{}}}}}),BJ=hr.create({name:"code"}),VJ=BJ.extend({addStorage(){return{markdown:{serialize:Ao.marks.code,parse:{}}}}}),HJ=hr.create({name:"italic"}),UJ=HJ.extend({addStorage(){return{markdown:{serialize:Ao.marks.em,parse:{}}}}}),WJ=hr.create({name:"link"}),qJ=WJ.extend({addStorage(){return{markdown:{serialize:Ao.marks.link,parse:{}}}}}),KJ=hr.create({name:"strike"}),GJ=KJ.extend({addStorage(){return{markdown:{serialize:{open:"~~",close:"~~",expelEnclosingWhitespace:!0},parse:{}}}}}),JJ=[fJ,aN,mJ,lN,xJ,bJ,Yp,wJ,SJ,TJ,AJ,DJ,IJ,jJ,zJ,$J,VJ,iN,UJ,qJ,GJ];function Qh(t){var e,n;const r=(e=t.storage)===null||e===void 0?void 0:e.markdown,o=(n=JJ.find(s=>s.name===t.name))===null||n===void 0?void 0:n.storage.markdown;return r||o?{...o,...r}:null}class ZJ{constructor(e){Xh(this,"editor",null),this.editor=e}serialize(e){const n=new sJ(this.nodes,this.marks,{hardBreakNodeName:lN.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(Yp)])),...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(iN)])),...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=Qh(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=Qh(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 YJ{constructor(e,n){Xh(this,"editor",null),Xh(this,"md",null);let{html:r,linkify:o,breaks:s}=n;this.editor=e,this.md=this.withPatchedRenderer(nr({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=Qh(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=pv(r);return this.editor.extensionManager.extensions.forEach(s=>{var i;return(i=Qh(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")&&aJ(o)})}normalizeInline(e,n){var r;if((r=e.firstElementChild)!==null&&r!==void 0&&r.matches("p")){var o,s,i,a;const u=e.firstElementChild,{nextElementSibling:d}=u,h=(o=(s=n.match(/^\s+/))===null||s===void 0?void 0:s[0])!==null&&o!==void 0?o:"",f=d?"":(i=(a=n.match(/\s+$/))===null||a===void 0?void 0:a[0])!==null&&i!==void 0?i:"";if(n.match(/^\n\n/)){u.innerHTML=`${u.innerHTML}${f}`;return}lJ(u),e.innerHTML=`${h}${e.innerHTML}${f}`}}withPatchedRenderer(e){const n=r=>function(){const o=r(...arguments);return o===`
|
|
634
|
+
`?o:o[o.length-1]===`
|
|
635
|
+
`?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 XJ=St.create({name:"markdownClipboard",addOptions(){return{transformPastedText:!1,transformCopiedText:!1}},addProseMirrorPlugins(){return[new Ct({key:new Wt("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 ts.fromSchema(this.editor.schema).parseSlice(pv(r),{preserveWhitespace:!0,context:e})},clipboardTextSerializer:t=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(t.content):null}})]}}),QJ=St.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=N6.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 YJ(this.editor,this.options),serializer:new ZJ(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[tJ.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),XJ.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}}),eZ={Save:"Kaydet","Saving…":"Kaydediliyor…",Cancel:"Vazgeç",Delete:"Sil",Add:"Ekle",Open:"Aç",Clear:"Temizle","Loading…":"Yükleniyor…","Try again":"Tekrar dene",Yes:"Evet",No:"Hayır",Language:"Dil",Title:"Başlık",File:"Dosya",Updated:"Güncellendi",remove:"kaldır",new:"yeni",optional:"opsiyonel",connected:"bağlı",key:"anahtar",automatic:"otomatik","Select…":"Seç…","Could not load":"Yüklenemedi","Could not save":"Kaydedilemedi",Schema:"Şema","Content structure":"İçerik yapısı","Raw JSON":"Ham JSON",Collections:"Koleksiyonlar",Singletons:"Tekil",singleton:"tekil","Add collection":"Koleksiyon ekle","Add singleton":"Tekil ekle","Add a singleton":"Tekil kayıt ekle","Export (.zip)":"Dışa aktar (.zip)","Downloading export":"Dışa aktarma indiriliyor","Start over (reset)":"Baştan başla (sıfırla)","Reset the schema?":"Şemayı sıfırla?","Your content files stay on disk, but the schema is cleared so you can pick a template or JSON again.":"İçerik dosyaların diskte kalır ama şema temizlenir, baştan şablon/JSON seçebilirsin.",Reset:"Sıfırla","Resetting…":"Sıfırlanıyor…","Schema reset":"Şema sıfırlandı","Could not load the schema. Is `justjson serve` running?":"Şema yüklenemedi. `justjson serve` çalışıyor mu?","Start on the left":"Soldan başla","Pick a collection or singleton to start editing. To change the structure, go to Schema.":"Bir koleksiyon ya da tekil kayıt seçerek düzenlemeye başla. Yapıyı değiştirmek istersen Şema’ya git.","Open schema":"Şemayı aç","This collection no longer exists.":"Bu koleksiyon artık yok.","This singleton no longer exists.":"Bu tekil kayıt artık yok.","New entry":"Yeni kayıt","{n} entry":"{n} kayıt","{n} entries":"{n} kayıt","{n} result":"{n} sonuç","{n} results":"{n} sonuç","{n} field":"{n} alan","{n} fields":"{n} alan","{n} file":"{n} dosya","{n} files":"{n} dosya","{n} collection":"{n} koleksiyon","{n} collections":"{n} koleksiyon","{n} singleton":"{n} tekil","{n} singletons":"{n} tekil","Loading entries…":"Kayıtlar yükleniyor…","Search by title or slug…":"Başlık veya slug ara…","No entries yet":"Henüz kayıt yok","Add the first piece of content to this collection.":"Bu koleksiyona ilk içeriği ekleyerek başla.","Create the first entry":"İlk kaydı oluştur","No matching entries":"Eşleşen kayıt yok","Nothing found for “{q}”. Change the search or clear it.":"“{q}” için sonuç bulunamadı. Aramayı değiştir ya da temizle.","Clear search":"Aramayı temizle",Draft:"Taslak",Published:"Yayında","Draft — publish it":"Taslak — yayına al","Published — move back to draft":"Yayında — taslağa çevir","File name":"Dosya adı","Leave it empty to derive it from the title. It cannot change after saving.":"Boş bırakırsan başlıktan üretilir. Kaydettikten sonra değişmez.",'"{slug}" already exists — pick a different slug.':"“{slug}” zaten var — farklı bir slug seç.",'"{slug}" saved':"“{slug}” kaydedildi",'"{slug}" deleted':"“{slug}” silindi","{name} saved":"{name} kaydedildi","Could not load the entry":"Kayıt yüklenemedi","The file could not be read, or it may have been deleted. Editing is disabled so an empty form does not overwrite it.":"Dosya okunamadı ya da silinmiş olabilir. Boş bir formla üzerine yazmamak için düzenleme kapatıldı.","Back to the list":"Listeye dön","Fix these before saving":"Kaydetmeden önce düzeltilecekler",Warnings:"Uyarılar","Pick a color":"Renk seç","Type and press Enter…":"Yaz ve Enter’a bas…","Remove {item}":"{item} kaldır","Add link":"Bağlantı ekle","No entries in “{name}”.":"“{name}” içinde kayıt yok.","Entries in “{name}”":"“{name}” kayıtları","Remove the link to {slug}":"{slug} bağlantısını kaldır","Upload image":"Görsel yükle","Uploading…":"Yükleniyor…","Image uploaded":"Görsel yüklendi",Bold:"Kalın",Italic:"İtalik","Heading 2":"Başlık 2","Heading 3":"Başlık 3","Ordered list":"Sıralı liste",Quote:"Alıntı","Bullet list":"Madde listesi",Code:"Kod",Undo:"Geri al",Redo:"Yinele",Copy:"Kopyala","JSON copied":"JSON kopyalandı","No fields filled in yet.":"Henüz alan doldurulmadı.","Every file in content/, exactly as written to disk":"content/ klasöründeki her dosya, diske yazıldığı hâliyle","Design your collections and fields.":"Koleksiyonlarını ve alanlarını tasarla.","Save schema":"Şemayı kaydet","Content with many entries (posts, products…)":"Çok kayıtlı içerik (yazılar, ürünler…)","A single record (site settings, profile…)":"Tek kayıt (site ayarları, profil…)","Expand all":"Tümünü genişlet","Collapse all":"Tümünü daralt",Expand:"Genişlet",Collapse:"Daralt","Your schema is empty":"Şeman boş","A collection describes one type of your content — posts, products, projects. Start by adding the first one.":"Koleksiyon, içeriğinin bir tipini tanımlar — yazılar, ürünler, projeler. İlkini ekleyerek başla.","or start from a template":"veya bir template’den başla","New collection":"Yeni koleksiyon","New singleton":"Yeni tekil","Collection name":"Koleksiyon adı","Singleton name":"Tekil ad","No fields yet. Add the first one below.":"Henüz alan yok. Aşağıdan ilk alanı ekle.","Add field":"Alan ekle","Field name":"Alan adı","Display name":"Görünen ad",Required:"Zorunlu","Required field":"Zorunlu alan","Make it required":"Zorunlu yap","Change type":"Tipi değiştir","change type":"tipi değiştir","Pick a field type":"Alan tipi seç","Choose what kind of data this field holds.":"Bu alanın hangi türde veri tutacağını belirle.","options (comma separated)":"seçenekler (virgülle ayır)","pick a target collection…":"hedef koleksiyon seç…","Add sub-field":"Alt alan ekle","Delete sub-field":"Alt alanı sil","Drag to reorder":"Sürükleyerek sırala","Item picked up. Use the arrow keys to move it, space to drop it.":"Öğe kaldırıldı. Ok tuşlarıyla taşı, boşluk tuşuyla bırak.","Moving to position {n}.":"{n}. sıraya taşınıyor.","Dropped at position {n}.":"{n}. sıraya bırakıldı.","The item is outside the list.":"Öğe listenin dışında.","The item returned to its original place.":"Öğe eski yerine döndü.","Move cancelled.":"Taşıma iptal edildi.",Text:"Metin","Single line of text":"Tek satır metin","Rich text":"Zengin metin","Markdown content":"Markdown içerik",Number:"Sayı","Numeric value":"Sayısal değer","Yes / No":"Evet / Hayır","True or false":"Doğru veya yanlış",Date:"Tarih","Calendar date":"Takvim tarihi",Select:"Seçim","A fixed list of options":"Sabit seçenekler listesi",Relation:"İlişki","Link to another collection":"Başka koleksiyona bağla",Image:"Görsel","Image URL or path":"Resim URL veya yolu","Web address":"Web adresi",Email:"E-posta","Email address":"E-posta adresi",List:"Liste","Free-text tags":"Serbest metin etiketleri",Color:"Renk","Hex color picker":"Hex renk seçici",Group:"Grup","Nested fields":"İç içe alanlar","required field is empty":"zorunlu alan boş","key is not in the schema":"anahtar şemada yok","expected text":"metin bekleniyor","expected a number":"sayı bekleniyor","expected true or false":"boolean bekleniyor","expected a valid URL":"geçerli bir URL bekleniyor","expected a valid email address":"geçerli bir e-posta bekleniyor","expected a hex color (e.g. #ff0000)":"hex renk bekleniyor (ör. #ff0000)","expected a list of text":"metin dizisi bekleniyor","expected a list of slugs":"slug dizisi bekleniyor","expected an object":"nesne bekleniyor","not one of the options":"seçenek dışı değer","Pick a template":"Bir şablon seç","Template catalog":"Şablon kataloğu","Previous templates":"Önceki şablonlar","Next templates":"Sonraki şablonlar","+{n} more":"+{n} daha","Edit your content visually; everything stays in your folder as plain JSON — no server, no account.":"İçeriğini görsel olarak düzenle; her şey klasöründe düz JSON olarak kalır — sunucu yok, hesap yok.","Could not load the template list.":"Şablon listesi yüklenemedi.","Applying…":"Uygulanıyor…","Start from scratch":"Sıfırdan başla","Begin with an empty schema and define your own collections and fields.":"Boş bir şemayla başla, koleksiyonlarını ve alanlarını kendin tanımla.","Continue with an empty project":"Boş projeyle devam et","Or start on your own":"Ya da kendin başla","Import your own JSON":"Kendi JSON’unu içe aktar","Drop a JSON file here, or":"Bir JSON dosyasını buraya bırak ya da","Release to read this file":"Dosyayı okumak için bırak","Browse files":"Dosyalara göz at","That file is not JSON — drop a .json file instead.":"Bu dosya JSON değil — bir .json dosyası bırak.","Paste your content JSON or choose a file, and JustJSON works out the collections and singletons for you.":"İçerik JSON’unu yapıştır ya da bir dosya seç; JustJSON koleksiyon ve tekil yapısını senin için çıkarsın.","An exported schema file works too:":"Dışa aktarılmış bir şema dosyası da olur:",Import:"İçe aktar","Importing…":"İçe aktarılıyor…","Choose a file":"Dosya seç","Could not read the file.":"Dosya okunamadı.","Invalid JSON":"Geçersiz JSON","Generate with AI":"AI ile oluştur","Connect a provider":"Sağlayıcı bağla","Describe what you want to manage and let it design the schema":"Ne yöneteceğini anlat, şemayı senin için tasarlasın","Runs on your own API key — entirely optional, nothing reaches us. It only creates collections and fields; the content is yours to write.":"Kendi API key’inle çalışır — tamamen opsiyonel, hiçbir şey bize gitmez. Sadece koleksiyon ve alanları üretir; içeriği sen girersin.",'e.g. "a blog where I share recipes, with category, difficulty and cooking time"':"Örn. “Tarif paylaştığım bir blog; kategori, zorluk seviyesi ve pişirme süresi olsun”","Generate schema":"Şema oluştur","Generating…":"Oluşturuluyor…","No AI provider connected yet — the settings open when you press the button.":"Henüz bir AI sağlayıcı bağlamadın — butona basınca ayarlar açılacak.","The AI did not return valid JSON — try again.":"AI geçerli bir JSON döndürmedi, tekrar dene.","Fill with AI":"AI ile doldur","Say what you want in a sentence; the model fills it in using {context} as context.":"Ne istediğini kısaca yaz, model {context} bağlamına göre dolduracak.","The current text is sent along as context.":"Mevcut metin bağlam olarak gönderilecek.",'e.g. "write a short, friendly {field}"':"Örn. “{field} için kısa ve samimi bir metin yaz”",Generate:"Oluştur","Content generated":"İçerik üretildi","AI settings":"AI ayarları","AI settings saved":"AI ayarları kaydedildi","AI disconnected":"AI bağlantısı kaldırıldı",Disconnect:"Bağlantıyı kaldır",Provider:"Sağlayıcı","Base URL":"Taban URL","Entirely optional. Your key is stored in this browser only and goes straight to the provider — nothing reaches us.":"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.","Get a free key":"Ücretsiz key al","Load models":"Modelleri yükle","Loading models…":"Modeller yükleniyor…","Pick a model…":"Model seç…","Refresh models":"Modelleri yenile","Type the model manually":"Modeli elle gir","Enter an API key first":"Önce API key gir","Enter a base URL first":"Önce taban URL gir","No models found — you can type one in":"Model bulunamadı — elle girebilirsin","A model name is required":"Model adı gerekli","A base URL is required":"Taban URL gerekli","An API key is required":"API key gerekli","Custom (OpenAI-compatible)":"Özel (OpenAI uyumlu)","Has a free tier — use your own Gemini API key.":"Ücretsiz katmanı var — kendi Gemini API key’ini kullan.","Has a free tier — fast open models.":"Ücretsiz katmanı var — hızlı açık modeller.","Plenty of free models (their names end in :free).":"Birçok ücretsiz model (isimleri :free ile biter).","Your own server, or a local service like Ollama.":"Kendi sunucun ya da Ollama gibi yerel bir servis.","Ship it":"Yayına al","Your content is on disk. Here is what comes next.":"İçeriğin diskte. Sıradaki adımlar şunlar.","Use it in {framework}":"{framework} içinde kullan","Give your content a site":"İçeriğine bir site ver","There is no site in this folder yet. JustJSON can generate a small Astro site wired to your content — a home page listing every collection, and a page per entry.":"Bu klasörde henüz bir site yok. JustJSON, içeriğine bağlı küçük bir Astro sitesi üretebilir — koleksiyonları listeleyen bir ana sayfa ve her kayıt için bir sayfa.","Create an Astro site":"Astro sitesi oluştur","Created {n} file(s).":"{n} dosya oluşturuldu.","Created {n} file(s); kept {k} of your own.":"{n} dosya oluşturuldu; senin {k} dosyana dokunulmadı.","Now start it:":"Şimdi başlat:","Nothing you already have is overwritten.":"Var olan hiçbir dosyanın üzerine yazılmaz.","{framework} project detected":"{framework} projesi algılandı",Project:"Proje",Copied:"Kopyalandı","Commit your content":"İçeriğini commit et","This folder is not a git repository yet.":"Bu klasör henüz bir git deposu değil.","{n} file(s) waiting on branch {branch}.":"{branch} dalında {n} dosya bekliyor.","Everything is committed.":"Her şey commit edilmiş.",Commit:"Commit et","Committed {n} file(s).":"{n} dosya commit edildi.","Nothing to commit — content is up to date.":"Commit edilecek bir şey yok — içerik güncel.","Pushed {branch} to origin.":"{branch} dalı origin'e gönderildi.","Created {name} on GitHub and pushed it.":"{name} GitHub'da oluşturuldu ve gönderildi.","Send it to GitHub":"GitHub'a gönder",Push:"Gönder","Create a private repository":"Gizli bir depo oluştur","Create & push":"Oluştur ve gönder","Uses the GitHub CLI already signed in on this machine — no token is stored.":"Bu makinede zaten giriş yapılmış GitHub CLI kullanılır — hiçbir token saklanmaz.","Add a remote yourself, then come back to push:":"Uzak sunucuyu kendin ekle, sonra göndermek için buraya dön:"},tZ=[{code:"en",label:"English"},{code:"tr",label:"Türkçe"}],uN="justjson.lang";function nZ(t){return t==="en"||t==="tr"}function rZ(){if(typeof localStorage>"u")return"en";const t=localStorage.getItem(uN);return nZ(t)?t:"en"}let Xp=rZ();const Cy=new Set;typeof document<"u"&&(document.documentElement.lang=Xp);function vc(){return Xp}function oZ(t){Xp=t,typeof localStorage<"u"&&localStorage.setItem(uN,t),typeof document<"u"&&(document.documentElement.lang=t);for(const e of Cy)e()}function sZ(t){return Cy.add(t),()=>{Cy.delete(t)}}function cN(){return C.useSyncExternalStore(sZ,vc,vc)}function R(t,e){const n=Xp==="tr"?eZ[t]??t:t;return e?n.replace(/\{(\w+)\}/g,(r,o)=>o in e?String(e[o]):r):n}function bc(t,e,n,r){return R(t===1?e:n,{n:t,...r})}function iZ({value:t,onChange:e}){const n=MH({extensions:[nq,QJ],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?g.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:[g.jsxs("div",{className:"flex flex-wrap items-center gap-0.5 border-b border-border bg-muted/50 px-2 py-1.5",children:[g.jsx(co,{editor:n,on:"bold",cmd:r=>r.toggleBold(),title:R("Bold"),children:g.jsx(ej,{className:"h-4 w-4"})}),g.jsx(co,{editor:n,on:"italic",cmd:r=>r.toggleItalic(),title:R("Italic"),children:g.jsx(Yj,{className:"h-4 w-4"})}),g.jsx(e1,{}),g.jsx(co,{editor:n,on:"heading",attrs:{level:2},cmd:r=>r.toggleHeading({level:2}),title:R("Heading 2"),children:g.jsx(Uj,{className:"h-4 w-4"})}),g.jsx(co,{editor:n,on:"heading",attrs:{level:3},cmd:r=>r.toggleHeading({level:3}),title:R("Heading 3"),children:g.jsx(qj,{className:"h-4 w-4"})}),g.jsx(e1,{}),g.jsx(co,{editor:n,on:"bulletList",cmd:r=>r.toggleBulletList(),title:R("Bullet list"),children:g.jsx(p_,{className:"h-4 w-4"})}),g.jsx(co,{editor:n,on:"orderedList",cmd:r=>r.toggleOrderedList(),title:R("Ordered list"),children:g.jsx(i9,{className:"h-4 w-4"})}),g.jsx(co,{editor:n,on:"blockquote",cmd:r=>r.toggleBlockquote(),title:R("Quote"),children:g.jsx(x9,{className:"h-4 w-4"})}),g.jsx(co,{editor:n,on:"codeBlock",cmd:r=>r.toggleCodeBlock(),title:R("Code"),children:g.jsx(Ej,{className:"h-4 w-4"})}),g.jsx(e1,{}),g.jsx(co,{editor:n,cmd:r=>r.undo(),title:R("Undo"),children:g.jsx(K9,{className:"h-4 w-4"})}),g.jsx(co,{editor:n,cmd:r=>r.redo(),title:R("Redo"),children:g.jsx(b9,{className:"h-4 w-4"})})]}),g.jsx(H6,{editor:n})]}):null}function co({editor:t,on:e,attrs:n,cmd:r,title:o,children:s}){const i=e?t.isActive(e,n):!1;return g.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 e1(){return g.jsx("span",{className:"mx-1 h-5 w-px bg-border"})}function aZ(){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 Qp=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Nl(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function mv(t){return"nodeType"in t}function Fn(t){var e,n;return t?Nl(t)?t:mv(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function gv(t){const{Document:e}=Fn(t);return t instanceof e}function Kc(t){return Nl(t)?!1:t instanceof Fn(t).HTMLElement}function dN(t){return t instanceof Fn(t).SVGElement}function Al(t){return t?Nl(t)?t.document:mv(t)?gv(t)?t:Kc(t)||dN(t)?t.ownerDocument:document:document:document}const Gr=Qp?C.useLayoutEffect:C.useEffect;function em(t){const e=C.useRef(t);return Gr(()=>{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 lZ(){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 kc(t,e){e===void 0&&(e=[t]);const n=C.useRef(t);return Gr(()=>{n.current!==t&&(n.current=t)},e),n}function Gc(t,e){const n=C.useRef();return C.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function ep(t){const e=em(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 tp(t){const e=C.useRef();return C.useEffect(()=>{e.current=t},[t]),e.current}let t1={};function Jc(t,e){return C.useMemo(()=>{if(e)return e;const n=t1[t]==null?0:t1[t]+1;return t1[t]=n,t+"-"+n},[t,e])}function fN(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 a=Object.entries(i);for(const[u,d]of a){const h=s[u];h!=null&&(s[u]=h+t*d)}return s},{...e})}}const tl=fN(1),wc=fN(-1);function uZ(t){return"clientX"in t&&"clientY"in t}function tm(t){if(!t)return!1;const{KeyboardEvent:e}=Fn(t.target);return e&&t instanceof e}function cZ(t){if(!t)return!1;const{TouchEvent:e}=Fn(t.target);return e&&t instanceof e}function np(t){if(cZ(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 uZ(t)?{x:t.clientX,y:t.clientY}:null}const cs=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[cs.Translate.toString(t),cs.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),ES="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function dZ(t){return t.matches(ES)?t:t.querySelector(ES)}const fZ={display:"none"};function hZ(t){let{id:e,value:n}=t;return ne.createElement("div",{id:e,style:fZ},n)}function pZ(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 ne.createElement("div",{id:e,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function mZ(){const[t,e]=C.useState("");return{announce:C.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const hN=C.createContext(null);function gZ(t){const e=C.useContext(hN);C.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(t)},[t,e])}function yZ(){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 a;return(a=i[o])==null?void 0:a.call(i,s)})},[t]),e]}const xZ={draggable:`
|
|
636
|
+
To pick up a draggable item, press the space bar.
|
|
637
|
+
While dragging, use the arrow keys to move the item.
|
|
638
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
639
|
+
`},vZ={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 bZ(t){let{announcements:e=vZ,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=xZ}=t;const{announce:s,announcement:i}=mZ(),a=Jc("DndLiveRegion"),[u,d]=C.useState(!1);if(C.useEffect(()=>{d(!0)},[]),gZ(C.useMemo(()=>({onDragStart(f){let{active:m}=f;s(e.onDragStart({active:m}))},onDragMove(f){let{active:m,over:x}=f;e.onDragMove&&s(e.onDragMove({active:m,over:x}))},onDragOver(f){let{active:m,over:x}=f;s(e.onDragOver({active:m,over:x}))},onDragEnd(f){let{active:m,over:x}=f;s(e.onDragEnd({active:m,over:x}))},onDragCancel(f){let{active:m,over:x}=f;s(e.onDragCancel({active:m,over:x}))}}),[s,e])),!u)return null;const h=ne.createElement(ne.Fragment,null,ne.createElement(hZ,{id:r,value:o.draggable}),ne.createElement(pZ,{id:a,announcement:i}));return n?Ur.createPortal(h,n):h}var Qt;(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"})(Qt||(Qt={}));function rp(){}function _S(t,e){return C.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function kZ(){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 Jr=Object.freeze({x:0,y:0});function pN(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function wZ(t,e){const n=np(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 mN(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function CZ(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function TS(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 gN(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function NS(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 SZ=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const o=NS(e,e.left,e.top),s=[];for(const i of r){const{id:a}=i,u=n.get(a);if(u){const d=pN(NS(u),o);s.push({id:a,data:{droppableContainer:i,value:d}})}}return s.sort(mN)},EZ=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const o=TS(e),s=[];for(const i of r){const{id:a}=i,u=n.get(a);if(u){const d=TS(u),h=o.reduce((m,x,v)=>m+pN(d[v],x),0),f=Number((h/4).toFixed(4));s.push({id:a,data:{droppableContainer:i,value:f}})}}return s.sort(mN)};function _Z(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,a=s-n;if(r<o&&n<s){const u=e.width*e.height,d=t.width*t.height,h=i*a,f=h/(u+d-h);return Number(f.toFixed(4))}return 0}const TZ=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const o=[];for(const s of r){const{id:i}=s,a=n.get(i);if(a){const u=_Z(a,e);u>0&&o.push({id:i,data:{droppableContainer:s,value:u}})}}return o.sort(CZ)};function NZ(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function yN(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:Jr}function AZ(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,a)=>({...i,top:i.top+t*a.y,bottom:i.bottom+t*a.y,left:i.left+t*a.x,right:i.right+t*a.x}),{...n})}}const MZ=AZ(1);function xN(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 DZ(t,e,n){const r=xN(e);if(!r)return t;const{scaleX:o,scaleY:s,x:i,y:a}=r,u=t.left-i-(1-o)*parseFloat(n),d=t.top-a-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),h=o?t.width/o:t.width,f=s?t.height/s:t.height;return{width:h,height:f,top:d,right:u+h,bottom:d+f,left:u}}const RZ={ignoreTransform:!1};function Ml(t,e){e===void 0&&(e=RZ);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:d,transformOrigin:h}=Fn(t).getComputedStyle(t);d&&(n=DZ(n,d,h))}const{top:r,left:o,width:s,height:i,bottom:a,right:u}=n;return{top:r,left:o,width:s,height:i,bottom:a,right:u}}function AS(t){return Ml(t,{ignoreTransform:!0})}function OZ(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function IZ(t,e){return e===void 0&&(e=Fn(t).getComputedStyle(t)),e.position==="fixed"}function PZ(t,e){e===void 0&&(e=Fn(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 nm(t,e){const n=[];function r(o){if(e!=null&&n.length>=e||!o)return n;if(gv(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Kc(o)||dN(o)||n.includes(o))return n;const s=Fn(t).getComputedStyle(o);return o!==t&&PZ(o,s)&&n.push(o),IZ(o,s)?n:r(o.parentNode)}return t?r(t):n}function vN(t){const[e]=nm(t,1);return e??null}function n1(t){return!Qp||!t?null:Nl(t)?t:mv(t)?gv(t)||t===Al(t).scrollingElement?window:Kc(t)?t:null:null}function bN(t){return Nl(t)?t.scrollX:t.scrollLeft}function kN(t){return Nl(t)?t.scrollY:t.scrollTop}function Sy(t){return{x:bN(t),y:kN(t)}}var un;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(un||(un={}));function wN(t){return!Qp||!t?!1:t===document.scrollingElement}function CN(t){const e={x:0,y:0},n=wN(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,a=t.scrollLeft>=r.x;return{isTop:o,isLeft:s,isBottom:i,isRight:a,maxScroll:r,minScroll:e}}const jZ={x:.2,y:.2};function LZ(t,e,n,r,o){let{top:s,left:i,right:a,bottom:u}=n;r===void 0&&(r=10),o===void 0&&(o=jZ);const{isTop:d,isBottom:h,isLeft:f,isRight:m}=CN(t),x={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?(x.y=un.Backward,v.y=r*Math.abs((e.top+b.height-s)/b.height)):!h&&u>=e.bottom-b.height&&(x.y=un.Forward,v.y=r*Math.abs((e.bottom-b.height-u)/b.height)),!m&&a>=e.right-b.width?(x.x=un.Forward,v.x=r*Math.abs((e.right-b.width-a)/b.width)):!f&&i<=e.left+b.width&&(x.x=un.Backward,v.x=r*Math.abs((e.left+b.width-i)/b.width)),{direction:x,speed:v}}function zZ(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 SN(t){return t.reduce((e,n)=>tl(e,Sy(n)),Jr)}function FZ(t){return t.reduce((e,n)=>e+bN(n),0)}function $Z(t){return t.reduce((e,n)=>e+kN(n),0)}function EN(t,e){if(e===void 0&&(e=Ml),!t)return;const{top:n,left:r,bottom:o,right:s}=e(t);vN(t)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const BZ=[["x",["left","right"],FZ],["y",["top","bottom"],$Z]];class yv{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=nm(n),o=SN(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[s,i,a]of BZ)for(const u of i)Object.defineProperty(this,u,{get:()=>{const d=a(r),h=o[s]-d;return this.rect[u]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Fu{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 VZ(t){const{EventTarget:e}=Fn(t);return t instanceof e?t:Al(t)}function r1(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 _r;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(_r||(_r={}));function MS(t){t.preventDefault()}function HZ(t){t.stopPropagation()}var Ze;(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"})(Ze||(Ze={}));const _N={start:[Ze.Space,Ze.Enter],cancel:[Ze.Esc],end:[Ze.Space,Ze.Enter,Ze.Tab]},UZ=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case Ze.Right:return{...n,x:n.x+25};case Ze.Left:return{...n,x:n.x-25};case Ze.Down:return{...n,y:n.y+25};case Ze.Up:return{...n,y:n.y-25}}};class xv{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 Fu(Al(n)),this.windowListeners=new Fu(Fn(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(_r.Resize,this.handleCancel),this.windowListeners.add(_r.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(_r.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&EN(r),n(Jr)}handleKeyDown(e){if(tm(e)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=_N,coordinateGetter:i=UZ,scrollBehavior:a="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,h=d?{x:d.left,y:d.top}:Jr;this.referenceCoordinates||(this.referenceCoordinates=h);const f=i(e,{active:n,context:r.current,currentCoordinates:h});if(f){const m=wc(f,h),x={x:0,y:0},{scrollableAncestors:v}=r.current;for(const b of v){const k=e.code,{isTop:S,isRight:_,isLeft:T,isBottom:A,maxScroll:M,minScroll:D}=CN(b),P=zZ(b),j={x:Math.min(k===Ze.Right?P.right-P.width/2:P.right,Math.max(k===Ze.Right?P.left:P.left+P.width/2,f.x)),y:Math.min(k===Ze.Down?P.bottom-P.height/2:P.bottom,Math.max(k===Ze.Down?P.top:P.top+P.height/2,f.y))},I=k===Ze.Right&&!_||k===Ze.Left&&!T,W=k===Ze.Down&&!A||k===Ze.Up&&!S;if(I&&j.x!==f.x){const Z=b.scrollLeft+m.x,J=k===Ze.Right&&Z<=M.x||k===Ze.Left&&Z>=D.x;if(J&&!m.y){b.scrollTo({left:Z,behavior:a});return}J?x.x=b.scrollLeft-Z:x.x=k===Ze.Right?b.scrollLeft-M.x:b.scrollLeft-D.x,x.x&&b.scrollBy({left:-x.x,behavior:a});break}else if(W&&j.y!==f.y){const Z=b.scrollTop+m.y,J=k===Ze.Down&&Z<=M.y||k===Ze.Up&&Z>=D.y;if(J&&!m.x){b.scrollTo({top:Z,behavior:a});return}J?x.y=b.scrollTop-Z:x.y=k===Ze.Down?b.scrollTop-M.y:b.scrollTop-D.y,x.y&&b.scrollBy({top:-x.y,behavior:a});break}}this.handleMove(e,tl(wc(f,this.referenceCoordinates),x))}}}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()}}xv.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=_N,onActivation:o}=e,{active:s}=n;const{code:i}=t.nativeEvent;if(r.start.includes(i)){const a=s.activatorNode.current;return a&&t.target!==a?!1:(t.preventDefault(),o==null||o({event:t.nativeEvent}),!0)}return!1}}];function DS(t){return!!(t&&"distance"in t)}function RS(t){return!!(t&&"delay"in t)}class vv{constructor(e,n,r){var o;r===void 0&&(r=VZ(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=Al(i),this.documentListeners=new Fu(this.document),this.listeners=new Fu(r),this.windowListeners=new Fu(Fn(i)),this.initialCoordinates=(o=np(s))!=null?o:Jr,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(_r.Resize,this.handleCancel),this.windowListeners.add(_r.DragStart,MS),this.windowListeners.add(_r.VisibilityChange,this.handleCancel),this.windowListeners.add(_r.ContextMenu,MS),this.documentListeners.add(_r.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(RS(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(DS(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(_r.Click,HZ,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(_r.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:o,props:s}=this,{onMove:i,options:{activationConstraint:a}}=s;if(!o)return;const u=(n=np(e))!=null?n:Jr,d=wc(o,u);if(!r&&a){if(DS(a)){if(a.tolerance!=null&&r1(d,a.tolerance))return this.handleCancel();if(r1(d,a.distance))return this.handleStart()}if(RS(a)&&r1(d,a.tolerance))return this.handleCancel();this.handlePending(a,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===Ze.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const WZ={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class bv extends vv{constructor(e){const{event:n}=e,r=Al(n.target);super(e,WZ,r)}}bv.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 qZ={move:{name:"mousemove"},end:{name:"mouseup"}};var Ey;(function(t){t[t.RightClick=2]="RightClick"})(Ey||(Ey={}));class KZ extends vv{constructor(e){super(e,qZ,Al(e.event.target))}}KZ.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===Ey.RightClick?!1:(r==null||r({event:n}),!0)}}];const o1={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class GZ extends vv{constructor(e){super(e,o1)}static setup(){return window.addEventListener(o1.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(o1.move.name,e)};function e(){}}}GZ.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 $u;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})($u||($u={}));var op;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(op||(op={}));function JZ(t){let{acceleration:e,activator:n=$u.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:i=5,order:a=op.TreeOrder,pointerCoordinates:u,scrollableAncestors:d,scrollableAncestorRects:h,delta:f,threshold:m}=t;const x=YZ({delta:f,disabled:!s}),[v,b]=lZ(),k=C.useRef({x:0,y:0}),S=C.useRef({x:0,y:0}),_=C.useMemo(()=>{switch(n){case $u.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case $u.DraggableRect:return o}},[n,o,u]),T=C.useRef(null),A=C.useCallback(()=>{const D=T.current;if(!D)return;const P=k.current.x*S.current.x,j=k.current.y*S.current.y;D.scrollBy(P,j)},[]),M=C.useMemo(()=>a===op.TreeOrder?[...d].reverse():d,[a,d]);C.useEffect(()=>{if(!s||!d.length||!_){b();return}for(const D of M){if((r==null?void 0:r(D))===!1)continue;const P=d.indexOf(D),j=h[P];if(!j)continue;const{direction:I,speed:W}=LZ(D,j,_,e,m);for(const Z of["x","y"])x[Z][I[Z]]||(W[Z]=0,I[Z]=0);if(W.x>0||W.y>0){b(),T.current=D,v(A,i),k.current=W,S.current=I;return}}k.current={x:0,y:0},S.current={x:0,y:0},b()},[e,A,r,b,s,i,JSON.stringify(_),JSON.stringify(x),v,d,M,h,JSON.stringify(m)])}const ZZ={x:{[un.Backward]:!1,[un.Forward]:!1},y:{[un.Backward]:!1,[un.Forward]:!1}};function YZ(t){let{delta:e,disabled:n}=t;const r=tp(e);return Gc(o=>{if(n||!r||!o)return ZZ;const s={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[un.Backward]:o.x[un.Backward]||s.x===-1,[un.Forward]:o.x[un.Forward]||s.x===1},y:{[un.Backward]:o.y[un.Backward]||s.y===-1,[un.Forward]:o.y[un.Forward]||s.y===1}}},[n,e,r])}function XZ(t,e){const n=e!=null?t.get(e):void 0,r=n?n.node.current:null;return Gc(o=>{var s;return e==null?null:(s=r??o)!=null?s:null},[r,e])}function QZ(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 Cc;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(Cc||(Cc={}));var _y;(function(t){t.Optimized="optimized"})(_y||(_y={}));const OS=new Map;function eY(t,e){let{dragging:n,dependencies:r,config:o}=e;const[s,i]=C.useState(null),{frequency:a,measure:u,strategy:d}=o,h=C.useRef(t),f=k(),m=kc(f),x=C.useCallback(function(S){S===void 0&&(S=[]),!m.current&&i(_=>_===null?S:_.concat(S.filter(T=>!_.includes(T))))},[m]),v=C.useRef(null),b=Gc(S=>{if(f&&!n)return OS;if(!S||S===OS||h.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,M=A?new yv(u(A),A):null;T.rect.current=M,M&&_.set(T.id,M)}return _}return S},[t,s,n,f,u]);return C.useEffect(()=>{h.current=t},[t]),C.useEffect(()=>{f||x()},[n,f]),C.useEffect(()=>{s&&s.length>0&&i(null)},[JSON.stringify(s)]),C.useEffect(()=>{f||typeof a!="number"||v.current!==null||(v.current=setTimeout(()=>{x(),v.current=null},a))},[a,f,x,...r]),{droppableRects:b,measureDroppableContainers:x,measuringScheduled:s!=null};function k(){switch(d){case Cc.Always:return!1;case Cc.BeforeDragging:return n;default:return!n}}}function kv(t,e){return Gc(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function tY(t,e){return kv(t,e)}function nY(t){let{callback:e,disabled:n}=t;const r=em(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 rm(t){let{callback:e,disabled:n}=t;const r=em(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 rY(t){return new yv(Ml(t),t)}function IS(t,e,n){e===void 0&&(e=rY);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 h=e(t);return JSON.stringify(u)===JSON.stringify(h)?u:h})}const i=nY({callback(u){if(t)for(const d of u){const{type:h,target:f}=d;if(h==="childList"&&f instanceof HTMLElement&&f.contains(t)){s();break}}}}),a=rm({callback:s});return Gr(()=>{s(),t?(a==null||a.observe(t),i==null||i.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),i==null||i.disconnect())},[t]),r}function oY(t){const e=kv(t);return yN(t,e)}const PS=[];function sY(t){const e=C.useRef(t),n=Gc(r=>t?r&&r!==PS&&t&&e.current&&t.parentNode===e.current.parentNode?r:nm(t):PS,[t]);return C.useEffect(()=>{e.current=t},[t]),n}function iY(t){const[e,n]=C.useState(null),r=C.useRef(t),o=C.useCallback(s=>{const i=n1(s.target);i&&n(a=>a?(a.set(i,Sy(i)),new Map(a)):null)},[]);return C.useEffect(()=>{const s=r.current;if(t!==s){i(s);const a=t.map(u=>{const d=n1(u);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,Sy(d)]):null}).filter(u=>u!=null);n(a.length?new Map(a):null),r.current=t}return()=>{i(t),i(s)};function i(a){a.forEach(u=>{const d=n1(u);d==null||d.removeEventListener("scroll",o)})}},[o,t]),C.useMemo(()=>t.length?e?Array.from(e.values()).reduce((s,i)=>tl(s,i),Jr):SN(t):Jr,[t,e])}function jS(t,e){e===void 0&&(e=[]);const n=C.useRef(null);return C.useEffect(()=>{n.current=null},e),C.useEffect(()=>{const r=t!==Jr;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?wc(t,n.current):Jr}function aY(t){C.useEffect(()=>{if(!Qp)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 lY(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 TN(t){return C.useMemo(()=>t?OZ(t):null,[t])}const LS=[];function uY(t,e){e===void 0&&(e=Ml);const[n]=t,r=TN(n?Fn(n):null),[o,s]=C.useState(LS);function i(){s(()=>t.length?t.map(u=>wN(u)?r:new yv(e(u),u)):LS)}const a=rm({callback:i});return Gr(()=>{a==null||a.disconnect(),i(),t.forEach(u=>a==null?void 0:a.observe(u))},[t]),o}function NN(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return Kc(e)?e:t}function cY(t){let{measure:e}=t;const[n,r]=C.useState(null),o=C.useCallback(d=>{for(const{target:h}of d)if(Kc(h)){r(f=>{const m=e(h);return f?{...f,width:m.width,height:m.height}:m});break}},[e]),s=rm({callback:o}),i=C.useCallback(d=>{const h=NN(d);s==null||s.disconnect(),h&&(s==null||s.observe(h)),r(h?e(h):null)},[e,s]),[a,u]=ep(i);return C.useMemo(()=>({nodeRef:a,rect:n,setRef:u}),[n,a,u])}const dY=[{sensor:bv,options:{}},{sensor:xv,options:{}}],fY={current:{}},Gf={draggable:{measure:AS},droppable:{measure:AS,strategy:Cc.WhileDragging,frequency:_y.Optimized},dragOverlay:{measure:Ml}};class Bu 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 hY={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Bu,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:rp},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Gf,measureDroppableContainers:rp,windowRect:null,measuringScheduled:!1},AN={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:rp,draggableNodes:new Map,over:null,measureDroppableContainers:rp},Zc=C.createContext(AN),MN=C.createContext(hY);function pY(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Bu}}}function mY(t,e){switch(e.type){case Qt.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case Qt.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 Qt.DragEnd:case Qt.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Qt.RegisterDroppable:{const{element:n}=e,{id:r}=n,o=new Bu(t.droppable.containers);return o.set(r,n),{...t,droppable:{...t.droppable,containers:o}}}case Qt.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 Bu(t.droppable.containers);return i.set(n,{...s,disabled:o}),{...t,droppable:{...t.droppable,containers:i}}}case Qt.UnregisterDroppable:{const{id:n,key:r}=e,o=t.droppable.containers.get(n);if(!o||r!==o.key)return t;const s=new Bu(t.droppable.containers);return s.delete(n),{...t,droppable:{...t.droppable,containers:s}}}default:return t}}function gY(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:o}=C.useContext(Zc),s=tp(r),i=tp(n==null?void 0:n.id);return C.useEffect(()=>{if(!e&&!r&&s&&i!=null){if(!tm(s)||document.activeElement===s.target)return;const a=o.get(i);if(!a)return;const{activatorNode:u,node:d}=a;if(!u.current&&!d.current)return;requestAnimationFrame(()=>{for(const h of[u.current,d.current]){if(!h)continue;const f=dZ(h);if(f){f.focus();break}}})}},[r,e,o,i,s]),null}function DN(t,e){let{transform:n,...r}=e;return t!=null&&t.length?t.reduce((o,s)=>s({transform:o,...r}),n):n}function yY(t){return C.useMemo(()=>({draggable:{...Gf.draggable,...t==null?void 0:t.draggable},droppable:{...Gf.droppable,...t==null?void 0:t.droppable},dragOverlay:{...Gf.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 xY(t){let{activeNode:e,measure:n,initialRect:r,config:o=!0}=t;const s=C.useRef(!1),{x:i,y:a}=typeof o=="boolean"?{x:o,y:o}:o;Gr(()=>{if(!i&&!a||!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 h=n(d),f=yN(h,r);if(i||(f.x=0),a||(f.y=0),s.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const m=vN(d);m&&m.scrollBy({top:f.y,left:f.x})}},[e,i,a,r,n])}const om=C.createContext({...Jr,scaleX:1,scaleY:1});var Ws;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Ws||(Ws={}));const vY=C.memo(function(e){var n,r,o,s;let{id:i,accessibility:a,autoScroll:u=!0,children:d,sensors:h=dY,collisionDetection:f=TZ,measuring:m,modifiers:x,...v}=e;const b=C.useReducer(mY,void 0,pY),[k,S]=b,[_,T]=yZ(),[A,M]=C.useState(Ws.Uninitialized),D=A===Ws.Initialized,{draggable:{active:P,nodes:j,translate:I},droppable:{containers:W}}=k,Z=P!=null?j.get(P):null,J=C.useRef({initial:null,translated:null}),K=C.useMemo(()=>{var gt;return P!=null?{id:P,data:(gt=Z==null?void 0:Z.data)!=null?gt:fY,rect:J}:null},[P,Z]),Y=C.useRef(null),[ee,G]=C.useState(null),[X,q]=C.useState(null),te=kc(v,Object.values(v)),F=Jc("DndDescribedBy",i),L=C.useMemo(()=>W.getEnabled(),[W]),V=yY(m),{droppableRects:re,measureDroppableContainers:he,measuringScheduled:ce}=eY(L,{dragging:D,dependencies:[I.x,I.y],config:V.droppable}),pe=XZ(j,P),De=C.useMemo(()=>X?np(X):null,[X]),Q=to(),de=tY(pe,V.draggable.measure);xY({activeNode:P!=null?j.get(P):null,config:Q.layoutShiftCompensation,initialRect:de,measure:V.draggable.measure});const me=IS(pe,V.draggable.measure,de),Fe=IS(pe?pe.parentElement:null),Re=C.useRef({activatorEvent:null,active:null,activeNode:pe,collisionRect:null,collisions:null,droppableRects:re,draggableNodes:j,draggingNode:null,draggingNodeRect:null,droppableContainers:W,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Be=W.getNodeFor((n=Re.current.over)==null?void 0:n.id),Ye=cY({measure:V.dragOverlay.measure}),At=(r=Ye.nodeRef.current)!=null?r:pe,zt=D?(o=Ye.rect)!=null?o:me:null,qt=!!(Ye.nodeRef.current&&Ye.rect),$n=oY(qt?null:me),Kt=TN(At?Fn(At):null),nn=sY(D?Be??pe:null),Dn=uY(nn),pt=DN(x,{transform:{x:I.x-$n.x,y:I.y-$n.y,scaleX:1,scaleY:1},activatorEvent:X,active:K,activeNodeRect:me,containerNodeRect:Fe,draggingNodeRect:zt,over:Re.current.over,overlayNodeRect:Ye.rect,scrollableAncestors:nn,scrollableAncestorRects:Dn,windowRect:Kt}),pr=De?tl(De,I):null,bi=iY(nn),ma=jS(bi),Mo=jS(bi,[me]),mr=tl(pt,ma),Bn=zt?MZ(zt,pt):null,gr=K&&Bn?f({active:K,collisionRect:Bn,droppableRects:re,droppableContainers:L,pointerCoordinates:pr}):null,Rn=gN(gr,"id"),[mn,Or]=C.useState(null),ga=qt?pt:tl(pt,Mo),ya=NZ(ga,(s=mn==null?void 0:mn.rect)!=null?s:null,me),gs=C.useRef(null),Do=C.useCallback((gt,Gt)=>{let{sensor:Ae,options:it}=Gt;if(Y.current==null)return;const tt=j.get(Y.current);if(!tt)return;const at=gt.nativeEvent,Jt=new Ae({active:Y.current,activeNode:tt,event:at,options:it,context:Re,onAbort(Je){if(!j.get(Je))return;const{onDragAbort:ft}=te.current,_t={id:Je};ft==null||ft(_t),_({type:"onDragAbort",event:_t})},onPending(Je,gn,ft,_t){if(!j.get(Je))return;const{onDragPending:rn}=te.current,Un={id:Je,constraint:gn,initialCoordinates:ft,offset:_t};rn==null||rn(Un),_({type:"onDragPending",event:Un})},onStart(Je){const gn=Y.current;if(gn==null)return;const ft=j.get(gn);if(!ft)return;const{onDragStart:_t}=te.current,Hn={activatorEvent:at,active:{id:gn,data:ft.data,rect:J}};Ur.unstable_batchedUpdates(()=>{_t==null||_t(Hn),M(Ws.Initializing),S({type:Qt.DragStart,initialCoordinates:Je,active:gn}),_({type:"onDragStart",event:Hn}),G(gs.current),q(at)})},onMove(Je){S({type:Qt.DragMove,coordinates:Je})},onEnd:mt(Qt.DragEnd),onCancel:mt(Qt.DragCancel)});gs.current=Jt;function mt(Je){return async function(){const{active:ft,collisions:_t,over:Hn,scrollAdjustedTranslate:rn}=Re.current;let Un=null;if(ft&&rn){const{cancelDrop:Ro}=te.current;Un={activatorEvent:at,active:ft,collisions:_t,delta:rn,over:Hn},Je===Qt.DragEnd&&typeof Ro=="function"&&await Promise.resolve(Ro(Un))&&(Je=Qt.DragCancel)}Y.current=null,Ur.unstable_batchedUpdates(()=>{S({type:Je}),M(Ws.Uninitialized),Or(null),G(null),q(null),gs.current=null;const Ro=Je===Qt.DragEnd?"onDragEnd":"onDragCancel";if(Un){const Dl=te.current[Ro];Dl==null||Dl(Un),_({type:Ro,event:Un})}})}}},[j]),ki=C.useCallback((gt,Gt)=>(Ae,it)=>{const tt=Ae.nativeEvent,at=j.get(it);if(Y.current!==null||!at||tt.dndKit||tt.defaultPrevented)return;const Jt={active:at};gt(Ae,Gt.options,Jt)===!0&&(tt.dndKit={capturedBy:Gt.sensor},Y.current=it,Do(Ae,Gt))},[j,Do]),eo=QZ(h,ki);aY(h),Gr(()=>{me&&A===Ws.Initializing&&M(Ws.Initialized)},[me,A]),C.useEffect(()=>{const{onDragMove:gt}=te.current,{active:Gt,activatorEvent:Ae,collisions:it,over:tt}=Re.current;if(!Gt||!Ae)return;const at={active:Gt,activatorEvent:Ae,collisions:it,delta:{x:mr.x,y:mr.y},over:tt};Ur.unstable_batchedUpdates(()=>{gt==null||gt(at),_({type:"onDragMove",event:at})})},[mr.x,mr.y]),C.useEffect(()=>{const{active:gt,activatorEvent:Gt,collisions:Ae,droppableContainers:it,scrollAdjustedTranslate:tt}=Re.current;if(!gt||Y.current==null||!Gt||!tt)return;const{onDragOver:at}=te.current,Jt=it.get(Rn),mt=Jt&&Jt.rect.current?{id:Jt.id,rect:Jt.rect.current,data:Jt.data,disabled:Jt.disabled}:null,Je={active:gt,activatorEvent:Gt,collisions:Ae,delta:{x:tt.x,y:tt.y},over:mt};Ur.unstable_batchedUpdates(()=>{Or(mt),at==null||at(Je),_({type:"onDragOver",event:Je})})},[Rn]),Gr(()=>{Re.current={activatorEvent:X,active:K,activeNode:pe,collisionRect:Bn,collisions:gr,droppableRects:re,draggableNodes:j,draggingNode:At,draggingNodeRect:zt,droppableContainers:W,over:mn,scrollableAncestors:nn,scrollAdjustedTranslate:mr},J.current={initial:zt,translated:Bn}},[K,pe,gr,Bn,j,At,zt,re,W,mn,nn,mr]),JZ({...Q,delta:I,draggingRect:Bn,pointerCoordinates:pr,scrollableAncestors:nn,scrollableAncestorRects:Dn});const Vn=C.useMemo(()=>({active:K,activeNode:pe,activeNodeRect:me,activatorEvent:X,collisions:gr,containerNodeRect:Fe,dragOverlay:Ye,draggableNodes:j,droppableContainers:W,droppableRects:re,over:mn,measureDroppableContainers:he,scrollableAncestors:nn,scrollableAncestorRects:Dn,measuringConfiguration:V,measuringScheduled:ce,windowRect:Kt}),[K,pe,me,X,gr,Fe,Ye,j,W,re,mn,he,nn,Dn,V,ce,Kt]),wi=C.useMemo(()=>({activatorEvent:X,activators:eo,active:K,activeNodeRect:me,ariaDescribedById:{draggable:F},dispatch:S,draggableNodes:j,over:mn,measureDroppableContainers:he}),[X,eo,K,me,S,F,j,mn,he]);return ne.createElement(hN.Provider,{value:T},ne.createElement(Zc.Provider,{value:wi},ne.createElement(MN.Provider,{value:Vn},ne.createElement(om.Provider,{value:ya},d)),ne.createElement(gY,{disabled:(a==null?void 0:a.restoreFocus)===!1})),ne.createElement(bZ,{...a,hiddenTextDescribedById:F}));function to(){const gt=(ee==null?void 0:ee.autoScrollEnabled)===!1,Gt=typeof u=="object"?u.enabled===!1:u===!1,Ae=D&&!gt&&!Gt;return typeof u=="object"?{...u,enabled:Ae}:{enabled:Ae}}}),bY=C.createContext(null),zS="button",kY="Draggable";function wY(t){let{id:e,data:n,disabled:r=!1,attributes:o}=t;const s=Jc(kY),{activators:i,activatorEvent:a,active:u,activeNodeRect:d,ariaDescribedById:h,draggableNodes:f,over:m}=C.useContext(Zc),{role:x=zS,roleDescription:v="draggable",tabIndex:b=0}=o??{},k=(u==null?void 0:u.id)===e,S=C.useContext(k?om:bY),[_,T]=ep(),[A,M]=ep(),D=lY(i,e),P=kc(n);Gr(()=>(f.set(e,{id:e,key:s,node:_,activatorNode:A,data:P}),()=>{const I=f.get(e);I&&I.key===s&&f.delete(e)}),[f,e]);const j=C.useMemo(()=>({role:x,tabIndex:b,"aria-disabled":r,"aria-pressed":k&&x===zS?!0:void 0,"aria-roledescription":v,"aria-describedby":h.draggable}),[r,x,b,k,v,h.draggable]);return{active:u,activatorEvent:a,activeNodeRect:d,attributes:j,isDragging:k,listeners:r?void 0:D,node:_,over:m,setNodeRef:T,setActivatorNodeRef:M,transform:S}}function RN(){return C.useContext(MN)}const CY="Droppable",SY={timeout:25};function EY(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:o}=t;const s=Jc(CY),{active:i,dispatch:a,over:u,measureDroppableContainers:d}=C.useContext(Zc),h=C.useRef({disabled:n}),f=C.useRef(!1),m=C.useRef(null),x=C.useRef(null),{disabled:v,updateMeasurementsFor:b,timeout:k}={...SY,...o},S=kc(b??r),_=C.useCallback(()=>{if(!f.current){f.current=!0;return}x.current!=null&&clearTimeout(x.current),x.current=setTimeout(()=>{d(Array.isArray(S.current)?S.current:[S.current]),x.current=null},k)},[k]),T=rm({callback:_,disabled:v||!i}),A=C.useCallback((j,I)=>{T&&(I&&(T.unobserve(I),f.current=!1),j&&T.observe(j))},[T]),[M,D]=ep(A),P=kc(e);return C.useEffect(()=>{!T||!M.current||(T.disconnect(),f.current=!1,T.observe(M.current))},[M,T]),C.useEffect(()=>(a({type:Qt.RegisterDroppable,element:{id:r,key:s,disabled:n,node:M,rect:m,data:P}}),()=>a({type:Qt.UnregisterDroppable,key:s,id:r})),[r]),C.useEffect(()=>{n!==h.current.disabled&&(a({type:Qt.SetDroppableDisabled,id:r,key:s,disabled:n}),h.current.disabled=n)},[r,s,n,a]),{active:i,rect:m,isOver:(u==null?void 0:u.id)===r,node:M,over:u,setNodeRef:D}}function _Y(t){let{animation:e,children:n}=t;const[r,o]=C.useState(null),[s,i]=C.useState(null),a=tp(n);return!n&&!r&&a&&o(a),Gr(()=>{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]),ne.createElement(ne.Fragment,null,n,r?C.cloneElement(r,{ref:i}):null)}const TY={x:0,y:0,scaleX:1,scaleY:1};function NY(t){let{children:e}=t;return ne.createElement(Zc.Provider,{value:AN},ne.createElement(om.Provider,{value:TY},e))}const AY={position:"fixed",touchAction:"none"},MY=t=>tm(t)?"transform 250ms ease":void 0,DY=C.forwardRef((t,e)=>{let{as:n,activatorEvent:r,adjustScale:o,children:s,className:i,rect:a,style:u,transform:d,transition:h=MY}=t;if(!a)return null;const f=o?d:{...d,scaleX:1,scaleY:1},m={...AY,width:a.width,height:a.height,top:a.top,left:a.left,transform:cs.Transform.toString(f),transformOrigin:o&&r?wZ(r,a):void 0,transition:typeof h=="function"?h(r):h,...u};return ne.createElement(n,{className:i,style:m,ref:e},s)}),RY=t=>e=>{let{active:n,dragOverlay:r}=e;const o={},{styles:s,className:i}=t;if(s!=null&&s.active)for(const[a,u]of Object.entries(s.active))u!==void 0&&(o[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,u));if(s!=null&&s.dragOverlay)for(const[a,u]of Object.entries(s.dragOverlay))u!==void 0&&r.node.style.setProperty(a,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)}},OY=t=>{let{transform:{initial:e,final:n}}=t;return[{transform:cs.Transform.toString(e)},{transform:cs.Transform.toString(n)}]},IY={duration:250,easing:"ease",keyframes:OY,sideEffects:RY({styles:{active:{opacity:"0"}}})};function PY(t){let{config:e,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=t;return em((s,i)=>{if(e===null)return;const a=n.get(s);if(!a)return;const u=a.node.current;if(!u)return;const d=NN(i);if(!d)return;const{transform:h}=Fn(i).getComputedStyle(i),f=xN(h);if(!f)return;const m=typeof e=="function"?e:jY(e);return EN(u,o.draggable.measure),m({active:{id:s,data:a.data,node:u,rect:o.draggable.measure(u)},draggableNodes:n,dragOverlay:{node:i,rect:o.dragOverlay.measure(d)},droppableContainers:r,measuringConfiguration:o,transform:f})})}function jY(t){const{duration:e,easing:n,sideEffects:r,keyframes:o}={...IY,...t};return s=>{let{active:i,dragOverlay:a,transform:u,...d}=s;if(!e)return;const h={x:a.rect.left-i.rect.left,y:a.rect.top-i.rect.top},f={scaleX:u.scaleX!==1?i.rect.width*u.scaleX/a.rect.width:1,scaleY:u.scaleY!==1?i.rect.height*u.scaleY/a.rect.height:1},m={x:u.x-h.x,y:u.y-h.y,...f},x=o({...d,active:i,dragOverlay:a,transform:{initial:u,final:m}}),[v]=x,b=x[x.length-1];if(JSON.stringify(v)===JSON.stringify(b))return;const k=r==null?void 0:r({active:i,dragOverlay:a,...d}),S=a.node.animate(x,{duration:e,easing:n,fill:"forwards"});return new Promise(_=>{S.onfinish=()=>{k==null||k(),_()}})}}let FS=0;function LY(t){return C.useMemo(()=>{if(t!=null)return FS++,FS},[t])}const zY=ne.memo(t=>{let{adjustScale:e=!1,children:n,dropAnimation:r,style:o,transition:s,modifiers:i,wrapperElement:a="div",className:u,zIndex:d=999}=t;const{activatorEvent:h,active:f,activeNodeRect:m,containerNodeRect:x,draggableNodes:v,droppableContainers:b,dragOverlay:k,over:S,measuringConfiguration:_,scrollableAncestors:T,scrollableAncestorRects:A,windowRect:M}=RN(),D=C.useContext(om),P=LY(f==null?void 0:f.id),j=DN(i,{activatorEvent:h,active:f,activeNodeRect:m,containerNodeRect:x,draggingNodeRect:k.rect,over:S,overlayNodeRect:k.rect,scrollableAncestors:T,scrollableAncestorRects:A,transform:D,windowRect:M}),I=kv(m),W=PY({config:r,draggableNodes:v,droppableContainers:b,measuringConfiguration:_}),Z=I?k.setRef:void 0;return ne.createElement(NY,null,ne.createElement(_Y,{animation:W},f&&P?ne.createElement(DY,{key:P,id:f.id,ref:Z,as:a,activatorEvent:h,adjustScale:e,className:u,transition:s,rect:I,style:{zIndex:d,...o},transform:j},n):null))});function FY(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 $Y=t=>{let{containerNodeRect:e,draggingNodeRect:n,transform:r}=t;return!n||!e?r:FY(r,n,e)},BY=t=>{let{transform:e}=t;return{...e,x:0}};function qs(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function VY(t,e){return t.reduce((n,r,o)=>{const s=e.get(r);return s&&(n[o]=s),n},Array(t.length))}function Of(t){return t!==null&&t>=0}function HY(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 UY(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}const ON=t=>{let{rects:e,activeIndex:n,overIndex:r,index:o}=t;const s=qs(e,r,n),i=e[o],a=s[o];return!a||!i?null:{x:a.left-i.left,y:a.top-i.top,scaleX:a.width/i.width,scaleY:a.height/i.height}},If={scaleX:1,scaleY:1},WY=t=>{var e;let{activeIndex:n,activeNodeRect:r,index:o,rects:s,overIndex:i}=t;const a=(e=s[n])!=null?e:r;if(!a)return null;if(o===n){const d=s[i];return d?{x:0,y:n<i?d.top+d.height-(a.top+a.height):d.top-a.top,...If}:null}const u=qY(s,o,n);return o>n&&o<=i?{x:0,y:-a.height-u,...If}:o<n&&o>=i?{x:0,y:a.height+u,...If}:{x:0,y:0,...If}};function qY(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 IN="Sortable",PN=ne.createContext({activeIndex:-1,containerId:IN,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:ON,disabled:{draggable:!1,droppable:!1}});function KY(t){let{children:e,id:n,items:r,strategy:o=ON,disabled:s=!1}=t;const{active:i,dragOverlay:a,droppableRects:u,over:d,measureDroppableContainers:h}=RN(),f=Jc(IN,n),m=a.rect!==null,x=C.useMemo(()=>r.map(D=>typeof D=="object"&&"id"in D?D.id:D),[r]),v=i!=null,b=i?x.indexOf(i.id):-1,k=d?x.indexOf(d.id):-1,S=C.useRef(x),_=!HY(x,S.current),T=k!==-1&&b===-1||_,A=UY(s);Gr(()=>{_&&v&&h(x)},[_,x,v,h]),C.useEffect(()=>{S.current=x},[x]);const M=C.useMemo(()=>({activeIndex:b,containerId:f,disabled:A,disableTransforms:T,items:x,overIndex:k,useDragOverlay:m,sortedRects:VY(x,u),strategy:o}),[b,f,A.draggable,A.droppable,T,x,k,u,m,o]);return ne.createElement(PN.Provider,{value:M},e)}const GY=t=>{let{id:e,items:n,activeIndex:r,overIndex:o}=t;return qs(n,r,o).indexOf(e)},JY=t=>{let{containerId:e,isSorting:n,wasDragging:r,index:o,items:s,newIndex:i,previousItems:a,previousContainerId:u,transition:d}=t;return!d||!r||a!==s&&o===i?!1:n?!0:i!==o&&e===u},ZY={duration:200,easing:"ease"},jN="transform",YY=cs.Transition.toString({property:jN,duration:0,easing:"linear"}),XY={roleDescription:"sortable"};function QY(t){let{disabled:e,index:n,node:r,rect:o}=t;const[s,i]=C.useState(null),a=C.useRef(n);return Gr(()=>{if(!e&&n!==a.current&&r.current){const u=o.current;if(u){const d=Ml(r.current,{ignoreTransform:!0}),h={x:u.left-d.left,y:u.top-d.top,scaleX:u.width/d.width,scaleY:u.height/d.height};(h.x||h.y)&&i(h)}}n!==a.current&&(a.current=n)},[e,n,r,o]),C.useEffect(()=>{s&&i(null)},[s]),s}function LN(t){let{animateLayoutChanges:e=JY,attributes:n,disabled:r,data:o,getNewIndex:s=GY,id:i,strategy:a,resizeObserverConfig:u,transition:d=ZY}=t;const{items:h,containerId:f,activeIndex:m,disabled:x,disableTransforms:v,sortedRects:b,overIndex:k,useDragOverlay:S,strategy:_}=C.useContext(PN),T=eX(r,x),A=h.indexOf(i),M=C.useMemo(()=>({sortable:{containerId:f,index:A,items:h},...o}),[f,o,A,h]),D=C.useMemo(()=>h.slice(h.indexOf(i)),[h,i]),{rect:P,node:j,isOver:I,setNodeRef:W}=EY({id:i,data:M,disabled:T.droppable,resizeObserverConfig:{updateMeasurementsFor:D,...u}}),{active:Z,activatorEvent:J,activeNodeRect:K,attributes:Y,setNodeRef:ee,listeners:G,isDragging:X,over:q,setActivatorNodeRef:te,transform:F}=wY({id:i,data:M,attributes:{...XY,...n},disabled:T.draggable}),L=aZ(W,ee),V=!!Z,re=V&&!v&&Of(m)&&Of(k),he=!S&&X,ce=he&&re?F:null,De=re?ce??(a??_)({rects:b,activeNodeRect:K,activeIndex:m,overIndex:k,index:A}):null,Q=Of(m)&&Of(k)?s({id:i,items:h,activeIndex:m,overIndex:k}):A,de=Z==null?void 0:Z.id,me=C.useRef({activeId:de,items:h,newIndex:Q,containerId:f}),Fe=h!==me.current.items,Re=e({active:Z,containerId:f,isDragging:X,isSorting:V,id:i,index:A,items:h,newIndex:me.current.newIndex,previousItems:me.current.items,previousContainerId:me.current.containerId,transition:d,wasDragging:me.current.activeId!=null}),Be=QY({disabled:!Re,index:A,node:j,rect:P});return C.useEffect(()=>{V&&me.current.newIndex!==Q&&(me.current.newIndex=Q),f!==me.current.containerId&&(me.current.containerId=f),h!==me.current.items&&(me.current.items=h)},[V,Q,f,h]),C.useEffect(()=>{if(de===me.current.activeId)return;if(de!=null&&me.current.activeId==null){me.current.activeId=de;return}const At=setTimeout(()=>{me.current.activeId=de},50);return()=>clearTimeout(At)},[de]),{active:Z,activeIndex:m,attributes:Y,data:M,rect:P,index:A,newIndex:Q,items:h,isOver:I,isSorting:V,isDragging:X,listeners:G,node:j,overIndex:k,over:q,setNodeRef:L,setActivatorNodeRef:te,setDroppableNodeRef:W,setDraggableNodeRef:ee,transform:Be??De,transition:Ye()};function Ye(){if(Be||Fe&&me.current.newIndex===A)return YY;if(!(he&&!tm(J)||!d)&&(V||Re))return cs.Transition.toString({...d,property:jN})}}function eX(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 sp(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 tX=[Ze.Down,Ze.Right,Ze.Up,Ze.Left],nX=(t,e)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:s,over:i,scrollableAncestors:a}}=e;if(tX.includes(t.code)){if(t.preventDefault(),!n||!r)return;const u=[];s.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const m=o.get(f.id);if(m)switch(t.code){case Ze.Down:r.top<m.top&&u.push(f);break;case Ze.Up:r.top>m.top&&u.push(f);break;case Ze.Left:r.left>m.left&&u.push(f);break;case Ze.Right:r.left<m.left&&u.push(f);break}});const d=EZ({collisionRect:r,droppableRects:o,droppableContainers:u});let h=gN(d,"id");if(h===(i==null?void 0:i.id)&&d.length>1&&(h=d[1].id),h!=null){const f=s.get(n.id),m=s.get(h),x=m?o.get(m.id):null,v=m==null?void 0:m.node.current;if(v&&x&&f&&m){const k=nm(v).some((D,P)=>a[P]!==D),S=zN(f,m),_=rX(f,m),T=k||!S?{x:0,y:0}:{x:_?r.width-x.width:0,y:_?r.height-x.height:0},A={x:x.left,y:x.top};return T.x&&T.y?A:wc(A,T)}}}};function zN(t,e){return!sp(t)||!sp(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function rX(t,e){return!sp(t)||!sp(e)||!zN(t,e)?!1:t.data.current.sortable.index<e.data.current.sortable.index}const wv=C.forwardRef(({label:t,className:e,...n},r)=>g.jsx(Oe,{ref:r,type:"button",variant:"ghost",size:"icon-xs","aria-label":t,title:t,className:_e("cursor-grab touch-none text-muted-foreground/50 hover:bg-transparent hover:text-foreground active:cursor-grabbing",e),...n,children:g.jsx(fx,{})}));wv.displayName="DragHandle";function FN({ids:t,onReorder:e,renderOverlay:n,children:r}){const[o,s]=C.useState(null),i=kZ(_S(bv,{activationConstraint:{distance:4}}),_S(xv,{coordinateGetter:nX})),a=d=>t.indexOf(String(d))+1,u={onDragStart:()=>R("Item picked up. Use the arrow keys to move it, space to drop it."),onDragOver:({over:d})=>d?R("Moving to position {n}.",{n:a(d.id)}):R("The item is outside the list."),onDragEnd:({over:d})=>d?R("Dropped at position {n}.",{n:a(d.id)}):R("The item returned to its original place."),onDragCancel:()=>R("Move cancelled.")};return g.jsxs(vY,{accessibility:{announcements:u},sensors:i,collisionDetection:SZ,modifiers:[BY,$Y],onDragStart:({active:d})=>s(String(d.id)),onDragCancel:()=>s(null),onDragEnd:({active:d,over:h})=>{if(s(null),!h||d.id===h.id)return;const f=t.indexOf(String(d.id)),m=t.indexOf(String(h.id));f<0||m<0||e(f,m)},children:[g.jsx(KY,{items:t,strategy:WY,children:r}),g.jsx(zY,{children:o?n(o):null})]})}function $N({className:t,size:e="default",...n}){return g.jsx("div",{"data-slot":"card","data-size":e,className:_e("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 oX({className:t,...e}){return g.jsx("div",{"data-slot":"card-header",className:_e("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 BN({className:t,...e}){return g.jsx("div",{"data-slot":"card-content",className:_e("px-(--card-spacing)",t),...e})}async function Qr(t){if(!t.ok)throw new Error(`Request failed: ${t.status}`);return t}async function VN(){return(await Qr(await fetch("/api/_project"))).json()}async function $S(){return(await Qr(await fetch("/api/_schema"))).json()}async function sX(){return(await(await Qr(await fetch("/api/_templates"))).json()).items}async function iX(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??`Could not apply the template: ${e.status}`)}}async function HN(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??`Import failed: ${e.status}`)}}const aX="/api/_export";function lX(){const t=document.createElement("a");t.href=aX,t.download="justjson-export.zip",document.body.appendChild(t),t.click(),t.remove()}async function UN(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??`Could not save the schema: ${e.status}`)}}async function Cv(t){return(await(await Qr(await fetch(`/api/${encodeURIComponent(t)}`))).json()).items}async function uX(t){return(await Cv(t)).map(e=>e.slug)}async function Ty(t,e){const n=await fetch(`/api/${encodeURIComponent(t)}/${encodeURIComponent(e)}`);return n.status===404?null:(await Qr(n),n.json())}async function cX(t,e,n){return(await(await Qr(await fetch(`/api/${encodeURIComponent(t)}/${encodeURIComponent(e)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(n)}))).json()).slug}async function dX(t,e){await Qr(await fetch(`/api/${encodeURIComponent(t)}/${encodeURIComponent(e)}`,{method:"DELETE"}))}async function fX(t,e){return(await(await Qr(await fetch("/api/_media",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({dataBase64:t,filename:e})}))).json()).path}async function WN(t){return(await Qr(await fetch(`/api/_singleton/${encodeURIComponent(t)}`))).json()}async function hX(t,e){await Qr(await fetch(`/api/_singleton/${encodeURIComponent(t)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(e)}))}async function qN(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||`The AI request failed (${r.status})`);return o.text}async function pX(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||`Could not fetch models (${e.status})`);return n.models}async function KN(){return(await Qr(await fetch("/api/_ship"))).json()}async function sm(t,e){const n=await fetch(`/api/_ship/${t}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),r=await n.json();if(!n.ok)throw new Error(r.error??`Request failed: ${n.status}`);return r}const mX=()=>sm("scaffold",{}),gX=t=>sm("commit",{message:t}),yX=()=>sm("push",{}),xX=(t,e)=>sm("repo",{name:t,private:e}),Sv=[{type:"text",label:"Text",desc:"Single line of text",icon:W9},{type:"richtext",label:"Rich text",desc:"Markdown content",icon:jj},{type:"number",label:"Number",desc:"Numeric value",icon:Vj},{type:"boolean",label:"Yes / No",desc:"True or false",icon:B9},{type:"date",label:"Date",desc:"Calendar date",icon:lj},{type:"select",label:"Select",desc:"A fixed list of options",icon:p_},{type:"relation",label:"Relation",desc:"Link to another collection",icon:h_},{type:"image",label:"Image",desc:"Image URL or path",icon:f_},{type:"url",label:"URL",desc:"Web address",icon:o9},{type:"email",label:"Email",desc:"Email address",icon:XP},{type:"list",label:"List",desc:"Free-text tags",icon:L9},{type:"color",label:"Color",desc:"Hex color picker",icon:p9},{type:"group",label:"Group",desc:"Nested fields",icon:Mc}],Ev=Object.fromEntries(Sv.map(t=>[t.type,t]));let BS=0;function ia(t){return BS+=1,`${t}${BS}`}function s1(t){return JSON.parse(JSON.stringify(t))}function vX(t){const e=(n,r)=>n.map(o=>({id:ia(r),fields:o.fields.map(()=>ia("f"))}));return{collections:e(t.collections,"c"),singletons:e(t.singletons,"s")}}function bX(t){const e=n=>n.map(r=>({id:r.id,fields:[...r.fields]}));return{collections:e(t.collections),singletons:e(t.singletons)}}function kX(t,e){const n=(r,o,s)=>r.map((i,a)=>{const u=o[a];return{id:(u==null?void 0:u.id)??ia(s),fields:i.fields.map((d,h)=>(u==null?void 0:u.fields[h])??ia("f"))}});return{collections:n(t.collections,e.collections,"c"),singletons:n(t.singletons,e.singletons,"s")}}function VS(){return{fields:[{key:"field1",label:"",type:"text"}]}}function im(t,e){let n=1;for(;e.includes(`${t}${n}`);)n+=1;return`${t}${n}`}function i1(t,e){const n=im("collection",t.collections.map(r=>r.name));t.collections.push({name:n,label:R("New collection"),path:n,fields:[]}),e.collections.push({id:ia("c"),fields:[]})}function a1(t,e){const n=im("singleton",t.singletons.map(r=>r.name));t.singletons.push({name:n,label:R("New singleton"),path:`${n}.json`,fields:[]}),e.singletons.push({id:ia("s"),fields:[]})}function wX({schema:t,onSaved:e,onBrowseTemplates:n,initialAdd:r}){const[o,s]=C.useState(()=>{const I=s1(t),W=vX(I);return r==="collection"?i1(I,W):r==="singleton"&&a1(I,W),{schema:I,ids:W}}),[i,a]=C.useState(()=>{const I=[...o.ids.collections,...o.ids.singletons];return I.length<=5?{}:Object.fromEntries(I.map(W=>[W.id,!0]))}),[u,d]=C.useState(!1),[h,f]=C.useState(null),[m,x]=C.useState(null),v=o.schema,b=o.ids,k=v.collections.map(I=>I.name),S=I=>s(W=>{const Z=s1(W.schema);return I(Z),{schema:Z,ids:W.ids}}),_=I=>s(W=>{const Z=s1(W.schema),J=bX(W.ids);return I(Z,J),{schema:Z,ids:kX(Z,J)}}),T=(I,W)=>a(Z=>({...Z,[I]:W})),A=(I,W)=>a(Z=>{const J={...Z};for(const K of I)J[K.id]=W;return J}),M=v.collections.length===0&&v.singletons.length===0,D=I=>{m&&(_((W,Z)=>{var ee;const J=m.kind==="collection"?W.collections:W.singletons,K=m.kind==="collection"?Z.collections:Z.singletons,Y=J[m.ci];if(Y)if(m.fi===null){const G=im("field",Y.fields.map(X=>X.key));Y.fields.push({key:G,label:"",type:I,...I==="group"?VS():{}}),(ee=K[m.ci])==null||ee.fields.push(ia("f"))}else{const G=Y.fields[m.fi];if(!G)return;G.type=I,I!=="select"&&(G.options=void 0),I!=="relation"&&(G.to=void 0),I!=="group"?G.fields=void 0:(!G.fields||G.fields.length===0)&&(G.fields=VS().fields)}}),x(null))},P=async()=>{f(null),d(!0);try{await UN(v),e()}catch(I){f(I.message)}finally{d(!1)}},j=I=>{const W=I==="collection"?v.collections:v.singletons,Z=I==="collection"?b.collections:b.singletons;return g.jsx(FN,{ids:Z.map(J=>J.id),onReorder:(J,K)=>_((Y,ee)=>{I==="collection"?(Y.collections=qs(Y.collections,J,K),ee.collections=qs(ee.collections,J,K)):(Y.singletons=qs(Y.singletons,J,K),ee.singletons=qs(ee.singletons,J,K))}),renderOverlay:J=>{const K=Z.findIndex(ee=>ee.id===J),Y=W[K];return Y?g.jsx(_X,{container:Y}):null},children:W.map((J,K)=>{const Y=Z[K];return Y?g.jsx(SX,{id:Y.id,container:J,kind:I,collectionNames:k,fieldIds:Y.fields,collapsed:i[Y.id]??!1,onToggleCollapse:()=>T(Y.id,!i[Y.id]),onChange:ee=>S(G=>{const q=(I==="collection"?G.collections:G.singletons)[K];q&&ee(q)}),onRemove:()=>_((ee,G)=>{I==="collection"?(ee.collections.splice(K,1),G.collections.splice(K,1)):(ee.singletons.splice(K,1),G.singletons.splice(K,1))}),onRemoveField:ee=>_((G,X)=>{var F,L;const q=I==="collection"?G.collections:G.singletons,te=I==="collection"?X.collections:X.singletons;(F=q[K])==null||F.fields.splice(ee,1),(L=te[K])==null||L.fields.splice(ee,1)}),onReorderFields:(ee,G)=>_((X,q)=>{const te=I==="collection"?X.collections:X.singletons,F=I==="collection"?q.collections:q.singletons,L=te[K],V=F[K];!L||!V||(L.fields=qs(L.fields,ee,G),V.fields=qs(V.fields,ee,G))}),onAddField:()=>x({kind:I,ci:K,fi:null}),onChangeType:ee=>x({kind:I,ci:K,fi:ee})},Y.id):null})})};return g.jsxs("div",{className:"flex h-full flex-col",children:[g.jsx("header",{className:"sticky top-0 z-10 shrink-0 border-b bg-card px-8 py-4",children:g.jsxs("div",{className:"mx-auto flex w-full max-w-4xl items-center justify-between",children:[g.jsxs("div",{children:[g.jsx("h1",{className:"font-heading text-lg font-semibold text-foreground",children:R("Schema")}),g.jsx("p",{className:"text-sm text-muted-foreground",children:R("Design your collections and fields.")})]}),g.jsxs(Oe,{type:"button",onClick:P,disabled:u,children:[g.jsx(Sp,{}),R(u?"Saving…":"Save schema")]})]})}),g.jsx("div",{className:"flex-1 overflow-y-auto px-8 py-6",children:g.jsxs("div",{className:"mx-auto w-full max-w-4xl",children:[h&&g.jsx("p",{className:"mb-5 rounded-lg border border-destructive/20 bg-destructive/10 px-4 py-3 text-sm text-destructive",children:h}),M?g.jsx(CX,{onAddCollection:()=>_(i1),onAddSingleton:()=>_(a1),onBrowseTemplates:n}):g.jsxs("div",{className:"space-y-10",children:[g.jsx(HS,{title:R("Collections"),hint:R("Content with many entries (posts, products…)"),onAdd:()=>_(i1),allCollapsed:b.collections.length>0&&b.collections.every(I=>i[I.id]),onToggleAll:b.collections.length>1?I=>A(b.collections,I):void 0,children:j("collection")}),g.jsx(HS,{title:R("Singletons"),hint:R("A single record (site settings, profile…)"),onAdd:()=>_(a1),allCollapsed:b.singletons.length>0&&b.singletons.every(I=>i[I.id]),onToggleAll:b.singletons.length>1?I=>A(b.singletons,I):void 0,children:j("singleton")})]})]})}),g.jsx(RX,{open:m!==null,onPick:D,onClose:()=>x(null)})]})}function HS({title:t,hint:e,onAdd:n,allCollapsed:r,onToggleAll:o,children:s}){return g.jsxs("section",{children:[g.jsxs("div",{className:"mb-3 flex items-end justify-between gap-3",children:[g.jsxs("div",{children:[g.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:t}),g.jsx("p",{className:"text-xs text-muted-foreground/70",children:e})]}),g.jsxs("div",{className:"flex items-center gap-1.5",children:[o&&g.jsxs(Oe,{type:"button",variant:"ghost",size:"sm",onClick:()=>o(!r),className:"text-muted-foreground",children:[r?g.jsx(u_,{}):g.jsx(yj,{}),R(r?"Expand all":"Collapse all")]}),g.jsxs(Oe,{type:"button",variant:"outline",size:"sm",onClick:n,children:[g.jsx(ai,{})," ",R("Add")]})]})]}),g.jsx("div",{className:"space-y-3",children:s})]})}function CX({onAddCollection:t,onAddSingleton:e,onBrowseTemplates:n}){return g.jsx($N,{className:"mx-auto max-w-md",children:g.jsxs(BN,{className:"flex flex-col items-center px-8 py-10 text-center",children:[g.jsx("div",{className:"mb-4 flex size-14 items-center justify-center rounded-2xl bg-primary/10 text-primary",children:g.jsx(Mc,{className:"size-7"})}),g.jsx("h2",{className:"font-heading text-lg font-semibold text-foreground",children:R("Your schema is empty")}),g.jsx("p",{className:"mt-1.5 text-sm text-muted-foreground",children:R("A collection describes one type of your content — posts, products, projects. Start by adding the first one.")}),g.jsxs(Oe,{type:"button",size:"lg",onClick:t,className:"mt-6",children:[g.jsx(ai,{})," ",R("Add collection")]}),g.jsxs("div",{className:"mt-3 flex items-center gap-3 text-sm",children:[g.jsx(Oe,{type:"button",variant:"link",onClick:e,className:"h-auto p-0 text-muted-foreground hover:text-foreground",children:R("Add a singleton")}),n&&g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"text-border",children:"·"}),g.jsx(Oe,{type:"button",variant:"link",onClick:n,className:"h-auto p-0",children:R("or start from a template")})]})]})]})})}function SX({id:t,...e}){const{attributes:n,listeners:r,setNodeRef:o,setActivatorNodeRef:s,transform:i,transition:a,isDragging:u}=LN({id:t});return g.jsx("div",{ref:o,style:{transform:cs.Translate.toString(i),transition:a},className:_e(u&&"opacity-40"),children:g.jsx(EX,{...e,dragHandle:g.jsx(wv,{ref:s,label:R("Drag to reorder"),...n,...r})})})}function EX({container:t,kind:e,collectionNames:n,fieldIds:r,collapsed:o,onToggleCollapse:s,onChange:i,onRemove:a,onRemoveField:u,onReorderFields:d,onAddField:h,onChangeType:f,dragHandle:m}){const x=b=>{const k=Mp(b);i(S=>{S.name=k,S.path=e==="collection"?k:`${k}.json`})},v=t.fields.length;return g.jsxs($N,{className:"gap-0 overflow-hidden py-0 shadow-sm",children:[g.jsxs(oX,{className:_e("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:[g.jsx("button",{type:"button","aria-hidden":"true",tabIndex:-1,onClick:s,className:"absolute inset-0 cursor-pointer"}),g.jsx("div",{className:"relative opacity-0 transition group-focus-within/card:opacity-100 group-hover/card:opacity-100 focus-within:opacity-100",children:m}),g.jsx(Oe,{type:"button",variant:"ghost",size:"icon-sm",onClick:s,"aria-expanded":!o,"aria-label":R(o?"Expand":"Collapse"),className:"relative text-muted-foreground",children:g.jsx(cx,{className:_e("transition-transform",o&&"-rotate-90")})}),g.jsx(Lt,{className:"relative h-8 border-transparent bg-transparent font-medium shadow-none focus-visible:border-input focus-visible:bg-background",value:t.label??"",placeholder:R(e==="collection"?"Collection name":"Singleton name"),onChange:b=>i(k=>{k.label=b.target.value})}),g.jsxs("div",{className:"relative flex items-center gap-2",children:[o&&g.jsx("span",{className:"whitespace-nowrap rounded-full bg-foreground/5 px-2 py-0.5 text-xs text-muted-foreground",children:bc(v,"{n} field","{n} fields")}),g.jsx(Lt,{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-name",onChange:b=>x(b.target.value)})]}),g.jsx(_v,{label:R("Delete"),danger:!0,onClick:a,className:"relative",children:g.jsx(g_,{})})]}),!o&&g.jsxs(g.Fragment,{children:[g.jsxs(BN,{className:"px-0",children:[v===0&&g.jsx("p",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:R("No fields yet. Add the first one below.")}),g.jsx(FN,{ids:r,onReorder:d,renderOverlay:b=>{const k=r.indexOf(b),S=t.fields[k];return S?g.jsx(DX,{field:S}):null},children:g.jsx("div",{className:"divide-y divide-border/60",children:t.fields.map((b,k)=>{const S=r[k];return S?g.jsx(TX,{id:S,field:b,collectionNames:n,onChange:_=>i(T=>_(T.fields[k])),onRemove:()=>u(k),onChangeType:()=>f(k)},S):null})})})]}),g.jsxs(Oe,{type:"button",variant:"ghost",onClick:h,className:"h-11 w-full justify-center gap-1.5 rounded-none border-t text-primary hover:bg-primary/5 hover:text-primary",children:[g.jsx(ai,{})," ",R("Add field")]})]})]})}function _X({container:t}){return g.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:[g.jsx(fx,{className:"size-4 shrink-0 text-muted-foreground"}),g.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:t.label||t.name}),g.jsx("span",{className:"truncate font-mono text-xs text-primary",children:t.name}),g.jsx("span",{className:"ml-auto shrink-0 text-xs text-muted-foreground",children:bc(t.fields.length,"{n} field","{n} fields")})]})}function TX({id:t,...e}){const{attributes:n,listeners:r,setNodeRef:o,setActivatorNodeRef:s,transform:i,transition:a,isDragging:u}=LN({id:t});return g.jsx(NX,{...e,rowRef:o,style:{transform:cs.Translate.toString(i),transition:a},dragging:u,dragHandle:g.jsx(wv,{ref:s,label:R("Drag to reorder"),...n,...r})})}function NX({field:t,collectionNames:e,onChange:n,onRemove:r,onChangeType:o,rowRef:s,style:i,dragging:a,dragHandle:u}){const d=Ev[t.type],h=d.icon,f="opacity-0 transition group-focus-within/row:opacity-100 group-hover/row:opacity-100 focus-within:opacity-100";return g.jsxs("div",{ref:s,style:i,className:_e("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]",a&&"opacity-40"),children:[g.jsx("div",{className:f,children:u}),g.jsxs(hx,{children:[g.jsx(px,{asChild:!0,children:g.jsx(Oe,{type:"button",variant:"ghost",size:"icon",onClick:o,"aria-label":R("Change type"),className:"bg-primary/10 text-primary hover:bg-primary/15 hover:text-primary",children:g.jsx(h,{})})}),g.jsxs(mx,{children:[R(d.label)," · ",R("change type")]})]}),g.jsx(Lt,{className:"h-8 border-transparent bg-transparent font-medium shadow-none focus-visible:border-input focus-visible:bg-background",value:t.label??"",placeholder:R("Field name"),onChange:m=>n(x=>{x.label=m.target.value})}),g.jsx(Lt,{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:R("key"),onChange:m=>n(x=>{x.key=Mp(m.target.value)})}),g.jsx(Oe,{type:"button",size:"xs",variant:t.required?"default":"ghost","aria-pressed":t.required??!1,title:t.required?R("Required field"):R("Make it required"),onClick:()=>n(m=>{m.required=!m.required}),className:_e("w-full rounded-full",!t.required&&`border-dashed border-border text-muted-foreground ${f}`),children:R("Required")}),g.jsx(_v,{label:R("Delete"),danger:!0,onClick:r,className:f,children:g.jsx(fa,{})}),t.type==="select"&&g.jsx(Lt,{className:"col-start-3 col-end-[-1] row-start-2 mt-1",value:(t.options??[]).join(", "),placeholder:R("options (comma separated)"),onChange:m=>n(x=>{x.options=m.target.value.split(",").map(v=>v.trim()).filter(Boolean)})}),t.type==="relation"&&g.jsx("div",{className:"col-start-3 col-end-[-1] row-start-2 mt-1",children:g.jsxs(Ju,{value:t.to||void 0,onValueChange:m=>n(x=>{x.to=m}),children:[g.jsx(Yu,{className:"w-full",children:g.jsx(Zu,{placeholder:R("pick a target collection…")})}),g.jsx(Xu,{children:e.map(m=>g.jsx(Qu,{value:m,children:m},m))})]})}),t.type==="group"&&g.jsx("div",{className:"col-start-3 col-end-[-1] row-start-2 mt-1",children:g.jsx(MX,{field:t,onChange:n})})]})}const AX=Sv.filter(t=>t.type!=="group");function MX({field:t,onChange:e}){const n=t.fields??[];return g.jsxs("div",{className:"space-y-1.5 rounded-lg border border-dashed bg-muted/20 p-2.5",children:[n.map((r,o)=>g.jsxs("div",{className:"flex items-center gap-1.5",children:[g.jsxs(Ju,{value:r.type,onValueChange:s=>e(i=>{var u;const a=(u=i.fields)==null?void 0:u[o];a&&(a.type=s)}),children:[g.jsx(Yu,{className:"h-8 w-[7.5rem] shrink-0",children:g.jsx(Zu,{})}),g.jsx(Xu,{children:AX.map(({type:s,label:i})=>g.jsx(Qu,{value:s,children:R(i)},s))})]}),g.jsx(Lt,{className:"h-8 flex-1 font-mono text-xs",value:r.key,placeholder:R("key"),onChange:s=>e(i=>{var u;const a=(u=i.fields)==null?void 0:u[o];a&&(a.key=Mp(s.target.value))})}),g.jsx(Lt,{className:"h-8 flex-1",value:r.label??"",placeholder:R("Display name"),onChange:s=>e(i=>{var u;const a=(u=i.fields)==null?void 0:u[o];a&&(a.label=s.target.value)})}),g.jsx(_v,{label:R("Delete sub-field"),danger:!0,onClick:()=>e(s=>{s.fields&&(s.fields=s.fields.filter((i,a)=>a!==o))}),children:g.jsx(fa,{})})]},o)),g.jsxs(Oe,{type:"button",size:"xs",variant:"ghost",className:"text-muted-foreground",onClick:()=>e(r=>{const o=(r.fields??[]).map(s=>s.key);r.fields=[...r.fields??[],{key:im("field",o),label:"",type:"text"}]}),children:[g.jsx(ai,{})," ",R("Add sub-field")]})]})}function DX({field:t}){const e=Ev[t.type],n=e.icon;return g.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:[g.jsx(fx,{className:"size-4 shrink-0 text-muted-foreground"}),g.jsx("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:g.jsx(n,{className:"size-4"})}),g.jsx("span",{className:"truncate text-sm font-medium text-foreground",children:t.label||R(e.label)}),g.jsx("span",{className:"ml-auto shrink-0 font-mono text-xs text-muted-foreground",children:t.key})]})}function RX({open:t,onPick:e,onClose:n}){return g.jsx(Dc,{open:t,onOpenChange:r=>{r||n()},children:g.jsxs(Rc,{className:"sm:max-w-lg",children:[g.jsxs(Oc,{children:[g.jsx(Ic,{children:R("Pick a field type")}),g.jsx(Pc,{children:R("Choose what kind of data this field holds.")})]}),g.jsx("div",{className:"grid grid-cols-2 gap-2.5",children:Sv.map(({type:r,label:o,desc:s,icon:i})=>g.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:[g.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:g.jsx(i,{className:"size-4"})}),g.jsxs("span",{children:[g.jsx("span",{className:"block text-sm font-medium text-foreground",children:R(o)}),g.jsx("span",{className:"block text-xs text-muted-foreground",children:R(s)})]})]},r))})]})})}function _v({children:t,label:e,danger:n,onClick:r,className:o}){return g.jsxs(hx,{children:[g.jsx(px,{asChild:!0,children:g.jsx(Oe,{type:"button",variant:"ghost",size:"icon-sm",onClick:r,"aria-label":e,className:_e("text-muted-foreground",n&&"hover:bg-destructive/10 hover:text-destructive",o),children:t})}),g.jsx(mx,{children:e})]})}function ss({children:t}){return g.jsx("div",{className:"flex h-full min-h-0 flex-col",children:t})}function is({title:t,badge:e,subtitle:n,actions:r,toolbar:o}){return g.jsxs("header",{className:"sticky top-0 z-20 shrink-0 border-b bg-card px-8 pt-4 pb-3.5",children:[g.jsxs("div",{className:"flex items-start justify-between gap-6",children:[g.jsxs("div",{className:"min-w-0",children:[g.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[g.jsx("h1",{className:"truncate text-lg font-semibold leading-tight tracking-tight text-foreground",children:t}),e]}),n&&g.jsx("div",{className:"mt-1.5 flex min-w-0 items-center gap-2 text-xs text-muted-foreground",children:n})]}),r&&g.jsx("div",{className:"flex shrink-0 items-center gap-2",children:r})]}),o&&g.jsx("div",{className:"mt-3.5",children:o})]})}function Tv({children:t}){return g.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:t})}function OX({children:t}){return g.jsx("div",{className:"min-h-0 flex-1 overflow-hidden px-8 py-6",children:t})}function IX({className:t,children:e}){return g.jsx("div",{className:_e("overflow-hidden rounded-xl border bg-card shadow-sm",t),children:e})}function Jf({children:t}){return g.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:[g.jsx(Mj,{className:"h-3 w-3 shrink-0 text-muted-foreground/70"}),g.jsx("span",{className:"truncate",children:t})]})}function US({icon:t,title:e,hint:n,action:r}){return g.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center px-6 py-16 text-center",children:[g.jsx("div",{className:"mb-3 flex h-12 w-12 items-center justify-center rounded-xl bg-muted text-muted-foreground",children:t}),g.jsx("p",{className:"text-sm font-medium text-foreground",children:e}),n&&g.jsx("p",{className:"mt-1 max-w-xs text-sm text-muted-foreground",children:n}),r&&g.jsx("div",{className:"mt-5",children:r})]})}function WS(t){return t.split(/[^a-zA-Z0-9]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("")}function PX(t,e){if(t==="astro")return{install:"npm install @kdrgny/justjson-astro",file:"src/content.config.ts",code:["import { justjsonCollections } from '@kdrgny/justjson-astro'","","export const collections = await justjsonCollections()"].join(`
|
|
640
|
+
`)};const n=[...e.collections.map(o=>`load${WS(o.name)}`),...e.singletons.map(o=>`load${WS(o.name)}`)].slice(0,3),r=n[0]??"loadPosts";return{install:"npx @kdrgny/justjson types",file:"anywhere in your build",code:[`import { ${n.join(", ")||"loadPosts"} } from './content'`,"",`const items = await ${r}()`].join(`
|
|
641
|
+
`)}}const jX={astro:"Astro",next:"Next.js",nuxt:"Nuxt",sveltekit:"SvelteKit",vite:"Vite",node:"Node",unknown:"this project"};function Pf({code:t}){const e=()=>{navigator.clipboard&&navigator.clipboard.writeText(t),Rt.success(R("Copied"))};return g.jsxs("div",{className:"overflow-hidden rounded-lg border",children:[g.jsxs("div",{className:"flex items-center gap-2 border-b bg-muted/60 px-3 py-1.5",children:[g.jsx(F9,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),g.jsxs(Oe,{variant:"ghost",size:"xs",onClick:e,className:"ml-auto text-muted-foreground hover:text-primary",children:[g.jsx(c_,{})," ",R("Copy")]})]}),g.jsx("pre",{className:"overflow-x-auto px-3 py-2.5 font-mono text-xs leading-relaxed text-foreground",children:t})]})}function jf({index:t,title:e,done:n,children:r}){return g.jsxs("section",{className:"rounded-xl border bg-card p-5 shadow-sm",children:[g.jsxs("div",{className:"mb-3 flex items-center gap-2.5",children:[g.jsx("span",{className:_e("flex size-6 shrink-0 items-center justify-center rounded-full text-xs font-medium",n?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"),children:n?g.jsx(Sp,{className:"size-3.5"}):t}),g.jsx("h2",{className:"font-medium text-foreground",children:e})]}),g.jsx("div",{className:"space-y-3 pl-8.5",children:r})]})}function LX({schema:t}){const[e,n]=C.useState(null),[r,o]=C.useState("content: update"),[s,i]=C.useState(""),[a,u]=C.useState(null),[d,h]=C.useState(!1),f=C.useCallback(async()=>{try{n(await KN())}catch{n(null)}},[]);C.useEffect(()=>{f()},[f]);const m=async(M,D)=>{u(M);try{Rt.success(await D()),await f()}catch(P){Rt.error(P.message)}finally{u(null)}},x=async()=>{const{committed:M,count:D}=await gX(r);return M?R("Committed {n} file(s).",{n:D}):R("Nothing to commit — content is up to date.")},v=async()=>{const{branch:M}=await yX();return R("Pushed {branch} to origin.",{branch:M})},b=async()=>{const{written:M,skipped:D}=await mX();return h(!0),D.length>0?R("Created {n} file(s); kept {k} of your own.",{n:M.length,k:D.length}):R("Created {n} file(s).",{n:M.length})},k=async()=>{const M=await xX(s,!0);return R("Created {name} on GitHub and pushed it.",{name:M.name})},S=e==null?void 0:e.git,_=PX((e==null?void 0:e.framework)??"unknown",t),T=(S==null?void 0:S.pendingFiles)??0,A=e!==null&&(e.framework==="unknown"||d);return g.jsxs(ss,{children:[g.jsx(is,{title:R("Ship it"),subtitle:R("Your content is on disk. Here is what comes next.")}),g.jsx(Tv,{children:g.jsxs("div",{className:"mx-auto max-w-2xl space-y-4 px-8 py-6",children:[A?g.jsxs(jf,{index:1,title:R("Give your content a site"),done:d,children:[g.jsx("p",{className:"text-sm text-muted-foreground",children:R("There is no site in this folder yet. JustJSON can generate a small Astro site wired to your content — a home page listing every collection, and a page per entry.")}),g.jsxs(Oe,{onClick:()=>m("scaffold",b),disabled:a!==null,children:[a==="scaffold"?g.jsx(Wr,{className:"animate-spin"}):g.jsx(ol,{}),R("Create an Astro site")]}),d&&g.jsxs(g.Fragment,{children:[g.jsx("p",{className:"text-sm text-muted-foreground",children:R("Now start it:")}),g.jsx(Pf,{code:`npm install
|
|
642
|
+
npm run dev`})]}),g.jsx("p",{className:"text-xs text-muted-foreground",children:R("Nothing you already have is overwritten.")})]}):g.jsxs(jf,{index:1,title:R("Use it in {framework}",{framework:jX[(e==null?void 0:e.framework)??"unknown"]}),children:[_.install&&g.jsx(Pf,{code:_.install}),g.jsx("p",{className:"text-xs text-muted-foreground",children:_.file}),g.jsx(Pf,{code:_.code})]}),g.jsx(jf,{index:2,title:R("Commit your content"),done:!!(S!=null&&S.isRepo)&&T===0,children:S!=null&&S.isRepo?g.jsxs(g.Fragment,{children:[g.jsx("p",{className:"text-sm text-muted-foreground",children:T>0?R("{n} file(s) waiting on branch {branch}.",{n:T,branch:S.branch??"—"}):R("Everything is committed.")}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(Lt,{value:r,onChange:M=>o(M.target.value),className:"font-mono text-xs",disabled:T===0}),g.jsxs(Oe,{onClick:()=>m("commit",x),disabled:T===0||a!==null,children:[a==="commit"?g.jsx(Wr,{className:"animate-spin"}):g.jsx(Fj,{}),R("Commit")]})]})]}):g.jsxs("div",{className:"flex items-start gap-2.5 rounded-lg border border-border bg-muted/40 px-3 py-2.5 text-sm text-muted-foreground",children:[g.jsx(_p,{className:"mt-0.5 size-4 shrink-0"}),g.jsx("span",{children:R("This folder is not a git repository yet.")})]})}),g.jsx(jf,{index:3,title:R("Send it to GitHub"),done:!!(S!=null&&S.hasRemote),children:S!=null&&S.hasRemote?g.jsxs(g.Fragment,{children:[g.jsx("p",{className:"truncate font-mono text-xs text-muted-foreground",children:S.remoteUrl}),g.jsxs(Oe,{variant:"outline",onClick:()=>m("push",v),disabled:a!==null,children:[a==="push"?g.jsx(Wr,{className:"animate-spin"}):g.jsx(Gu,{}),R("Push")]})]}):S!=null&&S.hasGh?g.jsxs(g.Fragment,{children:[g.jsx(Za,{className:"text-sm",children:R("Create a private repository")}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(Lt,{value:s,onChange:M=>i(M.target.value),placeholder:"my-site",className:"font-mono text-xs"}),g.jsxs(Oe,{onClick:()=>m("repo",k),disabled:!s.trim()||a!==null,children:[a==="repo"?g.jsx(Wr,{className:"animate-spin"}):g.jsx(Gu,{}),R("Create & push")]})]}),g.jsx("p",{className:"text-xs text-muted-foreground",children:R("Uses the GitHub CLI already signed in on this machine — no token is stored.")})]}):g.jsxs(g.Fragment,{children:[g.jsx("p",{className:"text-sm text-muted-foreground",children:R("Add a remote yourself, then come back to push:")}),g.jsx(Pf,{code:`git remote add origin <url>
|
|
643
|
+
git push -u origin main`})]})})]})})]})}function Nv({className:t,...e}){return g.jsx("textarea",{"data-slot":"textarea",className:_e("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 Ny={gemini:{id:"gemini",label:"Google Gemini",hint:"Has a free tier — use your own Gemini API key.",modelPlaceholder:"gemini-2.0-flash",keyUrl:"https://aistudio.google.com/apikey"},groq:{id:"groq",label:"Groq",hint:"Has a free tier — fast open models.",modelPlaceholder:"llama-3.3-70b-versatile",keyUrl:"https://console.groq.com/keys"},openrouter:{id:"openrouter",label:"OpenRouter",hint:"Plenty of free models (their names end in :free).",modelPlaceholder:"meta-llama/llama-3.3-70b-instruct:free",keyUrl:"https://openrouter.ai/keys"},custom:{id:"custom",label:"Custom (OpenAI-compatible)",hint:"Your own server, or a local service like Ollama.",modelPlaceholder:"llama3.1",needsBaseUrl:!0,keyUrl:""}},zX=Object.values(Ny),Av="jj-ai-config";function FX(){try{const t=localStorage.getItem(Av);if(!t)return null;const e=JSON.parse(t);return!e.provider||!e.model||!e.apiKey?null:e}catch{return null}}function $X(t){localStorage.setItem(Av,JSON.stringify(t))}function BX(){localStorage.removeItem(Av)}const GN=C.createContext(null);function Mv(){const t=C.useContext(GN);if(!t)throw new Error("useAiSettings must be used inside AiSettingsProvider");return t}function VX({children:t}){const[e,n]=C.useState(()=>FX()),[r,o]=C.useState(!1),[s,i]=C.useState((e==null?void 0:e.provider)??"gemini"),[a,u]=C.useState((e==null?void 0:e.model)??""),[d,h]=C.useState((e==null?void 0:e.apiKey)??""),[f,m]=C.useState((e==null?void 0:e.baseUrl)??""),[x,v]=C.useState([]),[b,k]=C.useState(!1),[S,_]=C.useState(!1),T=C.useMemo(()=>Ny[s],[s]),A=()=>{i((e==null?void 0:e.provider)??"gemini"),u((e==null?void 0:e.model)??""),h((e==null?void 0:e.apiKey)??""),m((e==null?void 0:e.baseUrl)??""),v([]),_(!1),o(!0)},M=I=>{i(I),u(""),v([]),_(!1)},D=async()=>{var W;const I=Ny[s];if(!I.needsBaseUrl&&!d.trim()){Rt.error(R("Enter an API key first"));return}if(I.needsBaseUrl&&!f.trim()){Rt.error(R("Enter a base URL first"));return}k(!0);try{const Z=await pX({provider:s,apiKey:d.trim(),...I.needsBaseUrl?{baseUrl:f.trim()}:{}});if(Z.length===0){_(!0),Rt.error(R("No models found — you can type one in"));return}v(Z),_(!1),Z.some(J=>J.id===a)||u(((W=Z[0])==null?void 0:W.id)??"")}catch(Z){_(!0),Rt.error(Z.message)}finally{k(!1)}},P=()=>{if(!a.trim()){Rt.error(R("A model name is required"));return}if(T.needsBaseUrl&&!f.trim()){Rt.error(R("A base URL is required"));return}if(!T.needsBaseUrl&&!d.trim()){Rt.error(R("An API key is required"));return}const I={provider:s,model:a.trim(),apiKey:d.trim(),...T.needsBaseUrl?{baseUrl:f.trim()}:{}};$X(I),n(I),o(!1),Rt.success(R("AI settings saved"))},j=()=>{BX(),n(null),h(""),u(""),Rt.success(R("AI disconnected"))};return g.jsxs(GN.Provider,{value:{config:e,openSettings:A},children:[t,g.jsx(Dc,{open:r,onOpenChange:o,children:g.jsxs(Rc,{children:[g.jsxs(Oc,{children:[g.jsxs(Ic,{className:"flex items-center gap-2",children:[g.jsx(Qj,{className:"h-4 w-4 text-primary"})," ",R("AI settings")]}),g.jsx(Pc,{children:R("Entirely optional. Your key is stored in this browser only and goes straight to the provider — nothing reaches us.")})]}),g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{className:"space-y-2",children:[g.jsx(Za,{children:R("Provider")}),g.jsxs(Ju,{value:s,onValueChange:I=>M(I),children:[g.jsx(Yu,{className:"w-full",children:g.jsx(Zu,{})}),g.jsx(Xu,{children:zX.map(I=>g.jsx(Qu,{value:I.id,children:R(I.label)},I.id))})]}),g.jsx("p",{className:"text-xs text-muted-foreground",children:R(T.hint)})]}),T.needsBaseUrl&&g.jsxs("div",{className:"space-y-2",children:[g.jsx(Za,{children:R("Base URL")}),g.jsx(Lt,{value:f,onChange:I=>m(I.target.value),placeholder:"http://localhost:11434/v1",className:"font-mono"})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsxs(Za,{children:["API key",T.needsBaseUrl&&g.jsxs("span",{className:"ml-1 font-normal text-muted-foreground",children:["(",R("optional"),")"]})]}),g.jsx(Lt,{type:"password",value:d,onChange:I=>h(I.target.value),placeholder:"••••••••••••",className:"font-mono"}),T.keyUrl&&g.jsxs("a",{href:T.keyUrl,target:"_blank",rel:"noreferrer",className:"inline-block text-xs text-primary hover:underline",children:[R("Get a free key")," →"]})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(Za,{children:"Model"}),S?g.jsx(Lt,{value:a,onChange:I=>u(I.target.value),placeholder:T.modelPlaceholder,className:"font-mono"}):x.length===0?g.jsx(Oe,{type:"button",variant:"outline",className:"w-full",onClick:D,disabled:b,children:b?g.jsxs(g.Fragment,{children:[g.jsx(Wr,{className:"animate-spin"})," ",R("Loading models…")]}):R("Load models")}):g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs(Ju,{value:a,onValueChange:u,children:[g.jsx(Yu,{className:"w-full font-mono",children:g.jsx(Zu,{placeholder:R("Pick a model…")})}),g.jsx(Xu,{children:x.map(I=>g.jsx(Qu,{value:I.id,className:"font-mono",children:I.label},I.id))})]}),g.jsxs(Oe,{type:"button",variant:"ghost",size:"icon-sm",onClick:D,disabled:b,title:R("Refresh models"),className:"text-muted-foreground",children:[b?g.jsx(Wr,{className:"animate-spin"}):g.jsx(w9,{}),g.jsx("span",{className:"sr-only",children:R("Refresh models")})]})]}),!S&&x.length>0&&g.jsx("button",{type:"button",onClick:()=>_(!0),className:"text-xs text-muted-foreground hover:text-primary",children:R("Type the model manually")})]})]}),g.jsxs(Np,{className:"sm:justify-between",children:[e?g.jsx(Oe,{variant:"ghost",onClick:j,className:"text-muted-foreground",children:R("Disconnect")}):g.jsx("span",{}),g.jsxs("div",{className:"flex gap-2",children:[g.jsx(Tp,{asChild:!0,children:g.jsx(Oe,{variant:"outline",children:R("Cancel")})}),g.jsx(Oe,{onClick:P,children:R("Save")})]})]})]})})]})}function HX(t){return t.type==="application/json"||t.name.toLowerCase().endsWith(".json")}function UX({onScratch:t,disabled:e}){return g.jsxs("div",{"data-busy":e,className:"flex flex-col items-start justify-center gap-2 border-l border-border py-2 pl-5 data-[busy=true]:opacity-60",children:[g.jsx("h3",{className:"font-heading text-sm font-semibold text-foreground",children:R("Start from scratch")}),g.jsx("p",{className:"text-[13px] leading-relaxed text-muted-foreground",children:R("Begin with an empty schema and define your own collections and fields.")}),g.jsxs(Oe,{variant:"link",size:"sm",disabled:e,onClick:t,className:"h-auto px-0",children:[R("Continue with an empty project"),g.jsx(ZP,{})]})]})}function WX({onImported:t,disabled:e}){const[n,r]=C.useState(!1),[o,s]=C.useState(""),[i,a]=C.useState(null),[u,d]=C.useState(!1),[h,f]=C.useState(!1),[m,x]=C.useState(null),v=async S=>{var T;const _=(T=S.target.files)==null?void 0:T[0];if(S.target.value="",!!_){a(null);try{s(await _.text())}catch{a(R("Could not read the file."))}}},b=async S=>{if(!HX(S)){x(R("That file is not JSON — drop a .json file instead."));return}x(null);try{const _=await S.text();s(_),a(null),r(!0)}catch{x(R("Could not read the file."))}},k=async()=>{let S;try{S=JSON.parse(o)}catch{a(R("Invalid JSON"));return}const _=S&&typeof S=="object"&&"schema"in S?S.schema:S;a(null),d(!0);try{await HN(_),r(!1),t()}catch(T){a(T.message),d(!1)}};return g.jsxs(Dc,{open:n,onOpenChange:S=>{r(S),!S&&!u&&(s(""),a(null))},children:[g.jsxs("div",{"data-busy":e,"data-dragging":h,onDragOver:S=>{e||(S.preventDefault(),S.dataTransfer.dropEffect="copy",f(!0))},onDragLeave:S=>{S.currentTarget.contains(S.relatedTarget)||f(!1)},onDrop:S=>{if(S.preventDefault(),f(!1),e)return;const _=S.dataTransfer.files.item(0);_&&b(_)},className:_e("group flex flex-col items-center justify-center gap-3 rounded-xl border border-dashed border-border bg-muted/40 px-5 py-7 text-center","transition-colors motion-reduce:transition-none","data-[dragging=true]:border-primary data-[dragging=true]:bg-accent","data-[busy=true]:opacity-60"),children:[g.jsx("span",{className:"flex size-11 items-center justify-center rounded-full border border-dashed border-border bg-card text-muted-foreground transition-colors motion-reduce:transition-none group-data-[dragging=true]:border-primary group-data-[dragging=true]:text-primary",children:g.jsx(Gu,{className:"size-5"})}),g.jsxs("div",{className:"flex flex-col items-center gap-1",children:[g.jsx("h3",{className:"font-heading text-sm font-semibold text-foreground",children:R("Import your own JSON")}),g.jsx("p",{className:"text-[13px] leading-relaxed text-muted-foreground",children:R(h?"Release to read this file":"Drop a JSON file here, or")})]}),g.jsx(X9,{asChild:!0,children:g.jsx(Oe,{variant:"outline",size:"lg",disabled:e,children:R("Browse files")})}),m&&g.jsx("output",{className:"text-xs text-destructive",children:m})]}),g.jsxs(Rc,{className:"sm:max-w-lg",children:[g.jsxs(Oc,{children:[g.jsx(Ic,{children:R("Import your own JSON")}),g.jsx(Pc,{children:R("Paste your content JSON or choose a file, and JustJSON works out the collections and singletons for you.")})]}),g.jsxs("div",{className:"space-y-3",children:[g.jsxs("p",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground",children:[R("An exported schema file works too:"),g.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-foreground",children:"_schema.json"})]}),g.jsxs("div",{className:"flex items-center justify-between gap-3",children:[g.jsx("span",{className:"text-sm font-medium text-foreground",children:"JSON"}),g.jsxs("label",{className:_e(ux({variant:"outline",size:"sm"}),"cursor-pointer focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50",u&&"pointer-events-none opacity-50"),children:[g.jsx(Gu,{}),R("Choose a file"),g.jsx("input",{type:"file",accept:".json,application/json",className:"sr-only",disabled:u,onChange:v})]})]}),g.jsx(Nv,{value:o,onChange:S=>{s(S.target.value),i&&a(null)},disabled:u,spellCheck:!1,rows:10,placeholder:'{ "collections": { ... }, "singletons": { ... } }',className:"max-h-72 resize-y font-mono text-xs leading-relaxed"}),i&&g.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:[g.jsx(dx,{className:"mt-0.5 size-4 shrink-0"}),g.jsx("span",{className:"break-words",children:i})]})]}),g.jsxs(Np,{children:[g.jsx(Tp,{asChild:!0,children:g.jsx(Oe,{variant:"ghost",disabled:u,children:R("Cancel")})}),g.jsx(Oe,{disabled:u||!o.trim(),onClick:k,children:u?g.jsxs(g.Fragment,{children:[g.jsx(Wr,{className:"animate-spin"}),R("Importing…")]}):R("Import")})]})]})]})}function qX({onImported:t,onScratch:e,disabled:n}){return g.jsxs("section",{className:"mt-10",children:[g.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[g.jsx("h2",{className:"font-heading text-xs font-medium tracking-wide text-muted-foreground",children:R("Or start on your own")}),g.jsx("span",{className:"h-px flex-1 bg-border"})]}),g.jsxs("div",{className:"grid grid-cols-1 items-stretch gap-4 sm:grid-cols-[1.25fr_1fr]",children:[g.jsx(WX,{onImported:t,disabled:n}),g.jsx(UX,{onScratch:e,disabled:n})]})]})}const Dv=["a","b","c","d","e"];function Vr({className:t}){return g.jsx("div",{className:_e("animate-pulse rounded-md bg-muted",t)})}const KX={blog:c9,cv:Z9,portfolio:t9,docs:nj,changelog:_9,recipe:dj,event:ij,catalog:I9},JN="h-[168px] w-[264px] shrink-0 snap-start rounded-xl",l1=56,GX=2;function JX(){return typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function ZX(t){let e=t.parentElement;for(;e;){const{overflowY:n}=getComputedStyle(e);if(n==="auto"||n==="scroll")return e;e=e.parentElement}return document.documentElement}function YX(){const t=C.useRef(null),[e,n]=C.useState({left:0,right:0});return C.useLayoutEffect(()=>{const r=t.current;if(!r)return;const o=ZX(r),s=()=>{const a=r.getBoundingClientRect(),d=o.getBoundingClientRect().left+o.clientLeft;n({left:Math.max(0,Math.round(a.left-d)),right:Math.max(0,Math.round(d+o.clientWidth-a.right))})};s();const i=new ResizeObserver(s);return i.observe(r),i.observe(o),()=>i.disconnect()},[]),{probeRef:t,bleed:e}}function XX({tpl:t,applying:e,onPick:n}){const r=KX[t.id]??Ij,o=e===t.id,s=e!==null,i=[...t.collections.map(d=>({label:d.label,singleton:!1})),...t.singletons.map(d=>({label:d.label,singleton:!0}))],a=i.slice(0,GX),u=i.length-a.length;return g.jsxs("button",{type:"button","data-carousel-card":"",disabled:s,"aria-busy":o,onClick:()=>n(t.id),className:_e(JN,"group relative flex flex-col overflow-hidden border border-border bg-card p-4 text-left","shadow-sm outline-none transition-[box-shadow,transform,opacity,border-color] duration-200","hover:border-primary/45 hover:shadow-md motion-safe:hover:-translate-y-0.5","focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50",s&&!o&&"opacity-40",s&&"cursor-default"),children:[g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-accent text-accent-foreground transition-colors group-hover:bg-primary/25",children:g.jsx(r,{className:"size-[18px]"})}),g.jsx("span",{className:"min-w-0 flex-1 truncate font-heading text-sm font-bold tracking-tight text-foreground",children:t.title})]}),g.jsx("p",{className:"mt-3 line-clamp-2 text-[13px] leading-relaxed text-muted-foreground",children:t.description}),g.jsxs("div",{className:"mt-auto flex w-full flex-nowrap items-center gap-1 overflow-hidden pt-3",children:[a.map(d=>g.jsx("span",{className:_e("max-w-[45%] shrink-0 truncate rounded-md px-1.5 py-0.5 text-[11px] leading-5 text-muted-foreground",d.singleton?"border border-border":"bg-muted"),children:d.label},d.label)),u>0&&g.jsx("span",{className:"shrink-0 text-[11px] leading-5 text-muted-foreground/80",children:R("+{n} more",{n:u})})]}),o&&g.jsxs("span",{className:"absolute inset-0 flex items-center justify-center gap-2 rounded-xl bg-card/85 text-sm font-medium text-primary backdrop-blur-[1px]",children:[g.jsx(Wr,{className:"size-4 animate-spin"}),R("Applying…")]})]})}function QX(){return g.jsxs("div",{className:_e(JN,"flex flex-col border border-border bg-card p-4"),children:[g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx(Vr,{className:"size-9 shrink-0 rounded-lg"}),g.jsx(Vr,{className:"h-3.5 w-28"})]}),g.jsx(Vr,{className:"mt-4 h-3 w-full"}),g.jsx(Vr,{className:"mt-2 h-3 w-3/5"}),g.jsxs("div",{className:"mt-auto flex gap-1.5 pt-3",children:[g.jsx(Vr,{className:"h-5 w-20"}),g.jsx(Vr,{className:"h-5 w-14"})]})]})}function eQ({templates:t,applying:e,onPick:n}){const r=C.useRef(null),{probeRef:o,bleed:s}=YX(),[i,a]=C.useState(!1),[u,d]=C.useState(!1),h=C.useCallback(()=>{const b=r.current;if(!b)return;const k=b.scrollWidth-b.clientWidth;a(b.scrollLeft>1),d(b.scrollLeft<k-1)},[]);C.useEffect(()=>{h();const b=r.current;if(!b)return;const k=new ResizeObserver(h);return k.observe(b),()=>k.disconnect()},[h]),C.useEffect(h,[t,h]);const f=b=>{const k=r.current;if(!k)return;const S=k.querySelector("[data-carousel-card]"),_=S?S.offsetWidth+16:Math.round(k.clientWidth*.8),T=k.scrollWidth-k.clientWidth,A=k.scrollLeft,M=Math.max(0,Math.min(A+b*_,T));k.scrollTo({left:M,behavior:JX()?"auto":"smooth"}),window.setTimeout(()=>{k.scrollLeft===A&&A!==M&&(k.scrollLeft=M)},80)},v=`linear-gradient(to right, transparent 0, black ${i?l1:0}px, black calc(100% - ${u?l1:0}px), transparent 100%)`;return g.jsxs("section",{"aria-labelledby":"template-catalog-label",children:[g.jsxs("div",{className:"flex items-center justify-between gap-4",children:[g.jsx("h2",{id:"template-catalog-label",className:"font-heading text-[11px] font-bold uppercase tracking-[0.18em] text-muted-foreground",children:R("Template catalog")}),g.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[g.jsx(Oe,{variant:"outline",size:"icon-sm","aria-label":R("Previous templates"),disabled:!i,onClick:()=>f(-1),children:g.jsx(pj,{})}),g.jsx(Oe,{variant:"outline",size:"icon-sm","aria-label":R("Next templates"),disabled:!u,onClick:()=>f(1),children:g.jsx(Ep,{})})]})]}),g.jsx("div",{ref:o,"aria-hidden":"true",className:"h-0"}),g.jsx("div",{ref:r,onScroll:h,className:"flex snap-x snap-mandatory gap-4 overflow-x-auto overscroll-x-contain pt-4 pb-3 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",style:{marginLeft:-s.left,marginRight:-s.right,paddingLeft:s.left,paddingRight:s.right,scrollPaddingLeft:s.left,scrollPaddingRight:s.right+l1,maskImage:v,WebkitMaskImage:v},children:t===null?Dv.slice(0,4).map(b=>g.jsx(QX,{},b)):t.map(b=>g.jsx(XX,{tpl:b,applying:e,onPick:n},b.id))})]})}const tQ={en:"English",tr:"Turkish"};function nQ(){return["You are designing a content schema for a headless CMS.","Return ONLY valid JSON — no explanation, markdown code fence or other text.","Follow this shape exactly:",'{"version":1,"collections":[{"name":"plural-id","label":"Display name","path":"same-id","fields":[{"key":"field_key","label":"Display name","type":"text|richtext|number|boolean|date|select|relation|image|url|email|list|color","required":true}]}],"singletons":[{"name":"id","label":"Display name","path":"name.json","fields":[...]}]}',`Pick field types sensibly from what the user describes: richtext for long or formatted text, date for dates, select for a fixed set of options (add an "options" array), image for pictures, url for links, email for addresses, list for free-text tags, color for colors, and relation for a link to another collection (put the target collection's name in "to").`,"Produce at least one collection. Give every collection an identifying field like title or slug.",`Keep name and key values in English, kebab/snake-case and short. Write label values in ${tQ[vc()]??"English"}.`].join(" ")}function rQ(t){return t.trim().replace(/^```(?:json)?\s*/i,"").replace(/```\s*$/,"").trim()}function oQ({onApplied:t,disabled:e}){const{config:n,openSettings:r}=Mv(),[o,s]=C.useState(""),[i,a]=C.useState(!1),[u,d]=C.useState(null),h=async()=>{if(!n){r();return}if(o.trim()){d(null),a(!0);try{const f=await qN(n,nQ(),o.trim());let m;try{m=JSON.parse(rQ(f))}catch{throw new Error(R("The AI did not return valid JSON — try again."))}await HN(m),t()}catch(f){d(f.message),a(!1)}}};return g.jsxs("div",{className:"mb-8 rounded-2xl border border-primary/30 bg-accent/40 p-6 sm:p-8",children:[g.jsxs("div",{className:"flex items-center justify-between gap-2",children:[g.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-primary",children:[g.jsx(ol,{className:"size-4"})," ",R("Generate with AI")]}),g.jsx("button",{type:"button",onClick:r,className:"text-xs text-muted-foreground underline-offset-2 hover:text-primary hover:underline",children:R(n?"AI settings":"Connect a provider")})]}),g.jsx("h2",{className:"mt-2 font-heading text-lg font-semibold text-foreground sm:text-xl",children:R("Describe what you want to manage and let it design the schema")}),g.jsx("p",{className:"mt-1.5 text-sm text-muted-foreground",children:R("Runs on your own API key — entirely optional, nothing reaches us. It only creates collections and fields; the content is yours to write.")}),g.jsxs("div",{className:"mt-4 flex flex-col gap-3 sm:flex-row sm:items-start",children:[g.jsx(Nv,{value:o,onChange:f=>{s(f.target.value),u&&d(null)},disabled:i||e,rows:2,placeholder:R('e.g. "a blog where I share recipes, with category, difficulty and cooking time"'),className:"min-h-0 flex-1 resize-none bg-card",onKeyDown:f=>{f.key==="Enter"&&(f.metaKey||f.ctrlKey)&&h()}}),g.jsx(Oe,{onClick:h,disabled:i||e||!o.trim(),className:"shrink-0 sm:mt-0",children:i?g.jsxs(g.Fragment,{children:[g.jsx(Wr,{className:"animate-spin"})," ",R("Generating…")]}):g.jsxs(g.Fragment,{children:[g.jsx(ol,{})," ",R("Generate schema")]})})]}),!n&&g.jsx("p",{className:"mt-3 text-xs text-muted-foreground",children:R("No AI provider connected yet — the settings open when you press the button.")}),u&&g.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:[g.jsx(dx,{className:"mt-0.5 size-4 shrink-0"}),g.jsx("span",{className:"break-words",children:u})]})]})}const sQ={astro:"Astro",next:"Next.js",nuxt:"Nuxt",sveltekit:"SvelteKit",vite:"Vite"};function iQ(){const[t,e]=C.useState(null);return C.useEffect(()=>{Promise.all([VN(),KN()]).then(([n,r])=>e({project:n.name,framework:sQ[r.framework]??""})).catch(()=>e(null))},[]),t?g.jsxs("p",{className:"mb-5 text-sm text-muted-foreground",children:[t.framework?R("{framework} project detected",{framework:t.framework}):R("Project")," · ",g.jsx("span",{className:"font-mono text-foreground/80",children:t.project})]}):null}function aQ({onApplied:t,onScratch:e}){const[n,r]=C.useState(null),[o,s]=C.useState(null),[i,a]=C.useState(null);C.useEffect(()=>{sX().then(r).catch(()=>s(R("Could not load the template list.")))},[]);const u=async h=>{s(null),a(h);try{await iX(h),t()}catch(f){s(f.message),a(null)}},d=i!==null;return g.jsx("div",{className:"h-full overflow-y-auto bg-muted/30",children:g.jsxs("div",{className:"mx-auto max-w-5xl px-6 py-12 sm:px-8",children:[g.jsxs("header",{className:"mb-8 max-w-2xl",children:[g.jsxs("div",{className:"mb-5 inline-flex items-center gap-2 text-sm font-medium text-muted-foreground",children:[g.jsx("span",{className:"flex size-6 items-center justify-center rounded-md bg-primary text-primary-foreground",children:g.jsx(El,{className:"size-3.5"})}),"JustJSON"]}),g.jsx(iQ,{}),g.jsx("h1",{className:"font-heading text-2xl font-semibold tracking-tight text-foreground sm:text-3xl",children:R("Pick a template")}),g.jsx("p",{className:"mt-2 text-base leading-relaxed text-muted-foreground",children:R("Edit your content visually; everything stays in your folder as plain JSON — no server, no account.")})]}),o&&g.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:[g.jsx(dx,{className:"mt-0.5 size-4 shrink-0"}),g.jsx("span",{children:o})]}),g.jsx(oQ,{onApplied:t,disabled:d}),g.jsx(eQ,{templates:n,applying:i,onPick:u}),g.jsx(qX,{onImported:t,onScratch:e,disabled:d})]})})}const lQ={en:"Write in English.",tr:"Write in Turkish."};function uQ({context:t,fieldLabel:e,currentValue:n,richtext:r,onResult:o}){const{config:s,openSettings:i}=Mv(),[a,u]=C.useState(!1),[d,h]=C.useState(""),[f,m]=C.useState(!1),x=()=>{if(!s){i();return}h(""),u(!0)},v=async()=>{if(s){m(!0);try{const b=[`You are filling in the "${e}" field of "${t}".`,r?"Write the answer in Markdown.":"Write the answer as plain text, preferring a single line.","Return only the field value — no explanation, quotes or prefix.",lQ[vc()]].join(" "),k=[d.trim()||`Write suitable content for ${e}.`,n.trim()?`
|
|
644
|
+
|
|
645
|
+
Current text (improve on it / use as a base):
|
|
646
|
+
${n}`:""].join(""),S=await qN(s,b,k);o(S.trim()),u(!1),Rt.success(R("Content generated"))}catch(b){Rt.error(b.message)}finally{m(!1)}}};return g.jsxs(g.Fragment,{children:[g.jsxs(Oe,{type:"button",variant:"ghost",size:"icon-xs",onClick:x,className:"text-muted-foreground hover:text-primary",title:R("Fill with AI"),children:[g.jsx(ol,{className:"h-3.5 w-3.5"}),g.jsx("span",{className:"sr-only",children:R("Fill with AI")})]}),g.jsx(Dc,{open:a,onOpenChange:u,children:g.jsxs(Rc,{children:[g.jsxs(Oc,{children:[g.jsxs(Ic,{className:"flex items-center gap-2",children:[g.jsx(ol,{className:"h-4 w-4 text-primary"})," ",e]}),g.jsxs(Pc,{children:[R("Say what you want in a sentence; the model fills it in using {context} as context.",{context:t}),n.trim()?` ${R("The current text is sent along as context.")}`:""]})]}),g.jsx(Nv,{autoFocus:!0,value:d,onChange:b=>h(b.target.value),placeholder:R('e.g. "write a short, friendly {field}"',{field:e}),className:"min-h-24",onKeyDown:b=>{b.key==="Enter"&&(b.metaKey||b.ctrlKey)&&v()}}),g.jsxs(Np,{children:[g.jsx(Tp,{asChild:!0,children:g.jsx(Oe,{variant:"outline",children:R("Cancel")})}),g.jsx(Oe,{onClick:v,disabled:f,children:f?g.jsxs(g.Fragment,{children:[g.jsx(Wr,{className:"h-4 w-4 animate-spin"})," ",R("Generating…")]}):R("Generate")})]})]})})]})}function cQ(){return g.jsxs(zL,{delayDuration:300,children:[g.jsx(VX,{children:g.jsx(dQ,{})}),g.jsx(IL,{position:"bottom-right"})]})}function dQ(){cN();const[t,e]=C.useState(null),[n,r]=C.useState(null),[o,s]=C.useState(null),[i,a]=C.useState(null),[u,d]=C.useState(!1),[h,f]=C.useState(0),[m,x]=C.useState(null),v=C.useCallback(async()=>{const T=await $S();return e(T),T},[]),b=C.useCallback(T=>{T&&(x(T),f(A=>A+1)),a({kind:"schema"})},[]);if(C.useEffect(()=>{$S().then(T=>{e(T),T.collections.length===0&&T.singletons.length===0&&d(!0)}).catch(()=>s(R("Could not load the schema. Is `justjson serve` running?")))},[]),C.useEffect(()=>{VN().then(r).catch(()=>{})},[]),o)return g.jsx(Vu,{children:o});if(!t)return g.jsx(Vu,{children:R("Loading…")});if(u)return g.jsx(aQ,{onApplied:async()=>{const T=await v();d(!1),a(T.collections[0]?{kind:"collection",name:T.collections[0].name}:{kind:"schema"})},onScratch:()=>{d(!1),a({kind:"schema"})}});const k=t.collections.length===0&&t.singletons.length===0,S=()=>{lX(),Rt.success(R("Downloading export"))},_=async()=>{await UN({version:1,collections:[],singletons:[]}),await v(),a(null),d(!0),Rt.success(R("Schema reset"))};return g.jsxs("div",{className:"flex h-full bg-background",children:[g.jsx(pQ,{project:n,schema:t,selection:i,onSelect:a,onOpenSchema:b,onExport:S,onReset:_}),g.jsxs("main",{className:"flex min-w-0 flex-1 flex-col overflow-hidden bg-muted/30",children:[g.jsx(hQ,{project:n,crumbs:fQ(t,i,a)}),g.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:g.jsx(yQ,{schema:t,selection:i,onSelect:a,onReload:v,onOpenSchema:b,addSeq:h,addKind:m,onBrowseTemplates:k?()=>d(!0):void 0})})]})]})}function fQ(t,e,n){if(!e)return[];if(e.kind==="schema")return[{label:R("Schema")}];if(e.kind==="json")return[{label:R("Raw JSON")}];if(e.kind==="ship")return[{label:R("Ship it")}];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:R("New entry")}]}const r=t.singletons.find(o=>o.name===e.name);return[{label:(r==null?void 0:r.label)??e.name,tag:R("singleton")}]}function hQ({project:t,crumbs:e}){return g.jsxs("header",{className:"flex h-12 shrink-0 items-center gap-1 overflow-x-auto border-b bg-card px-8 text-xs",children:[g.jsxs("span",{title:t==null?void 0:t.path,className:"inline-flex shrink-0 items-center gap-1.5 text-muted-foreground",children:[g.jsx(d_,{className:"h-3.5 w-3.5 text-muted-foreground/70"}),(t==null?void 0:t.name)??"…"]}),e.map(n=>g.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1",children:[g.jsx(Ep,{className:"h-3.5 w-3.5 text-muted-foreground/40"}),n.onClick?g.jsx("button",{type:"button",onClick:n.onClick,className:"rounded text-muted-foreground transition-colors hover:text-primary",children:n.label}):g.jsx("span",{className:"font-medium text-foreground/80",children:n.label}),n.tag&&g.jsx(Sl,{variant:"secondary",className:"ml-0.5 font-normal",children:n.tag})]},n.label))]})}function Vu({children:t}){return g.jsx("div",{className:"flex h-full items-center justify-center text-sm text-muted-foreground",children:t})}function pQ({project:t,schema:e,selection:n,onSelect:r,onOpenSchema:o,onExport:s,onReset:i}){const a=u=>n?n.kind==="collection"?n.name===u:n.kind==="entry"||n.kind==="newEntry"?n.collection===u:!1:!1;return g.jsxs("aside",{className:"flex w-60 shrink-0 flex-col border-r bg-card",children:[g.jsx("div",{className:"flex h-12 shrink-0 items-center border-b px-5",children:g.jsxs("div",{className:"font-mono text-[15px] font-bold tracking-tight text-foreground",children:["Just",g.jsx("span",{className:"text-primary",children:"JSON"})]})}),t&&g.jsx("div",{className:"px-3 pt-3",children:g.jsx(mQ,{project:t,onExport:s,onReset:i})}),g.jsxs("nav",{className:"flex-1 space-y-1 overflow-y-auto px-3 pt-3 pb-4",children:[g.jsx(gQ,{active:(n==null?void 0:n.kind)==="schema",onClick:()=>o()}),g.jsx(Lf,{icon:g.jsx(El,{className:"h-4 w-4"}),active:(n==null?void 0:n.kind)==="json",onClick:()=>r({kind:"json"}),children:R("Raw JSON")}),g.jsx(Lf,{icon:g.jsx(S9,{className:"h-4 w-4"}),active:(n==null?void 0:n.kind)==="ship",onClick:()=>r({kind:"ship"}),children:R("Ship it")}),g.jsx(qS,{label:R("Collections"),addLabel:R("Add collection"),onAdd:()=>o("collection"),children:e.collections.length===0?g.jsx(KS,{onClick:()=>o("collection"),children:R("Add collection")}):e.collections.map(u=>g.jsx(Lf,{icon:g.jsx(Mc,{className:"h-4 w-4"}),active:a(u.name),onClick:()=>r({kind:"collection",name:u.name}),children:u.label??u.name},u.name))}),g.jsx(qS,{label:R("Singletons"),addLabel:R("Add singleton"),onAdd:()=>o("singleton"),children:e.singletons.length===0?g.jsx(KS,{onClick:()=>o("singleton"),children:R("Add singleton")}):e.singletons.map(u=>g.jsx(Lf,{icon:g.jsx(Rj,{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 mQ({project:t,onExport:e,onReset:n}){const[r,o]=C.useState(!1),[s,i]=C.useState(!1),{config:a,openSettings:u}=Mv(),d=cN(),h=async()=>{i(!0);try{await n(),o(!1)}finally{i(!1)}};return g.jsxs(g.Fragment,{children:[g.jsxs(y_,{children:[g.jsx(x_,{asChild:!0,children:g.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:[g.jsx(d_,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground/70"}),g.jsx("span",{className:"truncate",children:t.name}),g.jsx(u_,{className:"ml-auto h-3.5 w-3.5 shrink-0 text-muted-foreground/60"})]})}),g.jsxs(v_,{align:"start",className:"w-56",children:[g.jsx(D1,{className:"truncate",children:t.name}),g.jsx(xu,{}),g.jsxs(lg,{onSelect:e,children:[g.jsx(Nj,{}),R("Export (.zip)")]}),g.jsx(xu,{}),g.jsxs(lg,{onSelect:u,children:[g.jsx(ol,{}),R("AI settings"),a&&g.jsx(Sl,{variant:"secondary",className:"ml-auto font-normal",children:R("connected")})]}),g.jsx(xu,{}),g.jsx(D1,{className:"text-xs font-normal text-muted-foreground",children:R("Language")}),tZ.map(f=>g.jsx(b_,{checked:d===f.code,onCheckedChange:()=>oZ(f.code),children:f.label},f.code)),g.jsx(xu,{}),g.jsxs(lg,{variant:"destructive",onSelect:()=>o(!0),children:[g.jsx(N9,{}),R("Start over (reset)")]})]})]}),g.jsx(Dc,{open:r,onOpenChange:o,children:g.jsxs(Rc,{children:[g.jsxs(Oc,{children:[g.jsx(Ic,{children:R("Reset the schema?")}),g.jsx(Pc,{children:R("Your content files stay on disk, but the schema is cleared so you can pick a template or JSON again.")})]}),g.jsxs(Np,{children:[g.jsx(Tp,{asChild:!0,children:g.jsx(Oe,{variant:"outline",children:R("Cancel")})}),g.jsx(Oe,{variant:"destructive",onClick:h,disabled:s,children:R(s?"Resetting…":"Reset")})]})]})})]})}function gQ({active:t,onClick:e}){return g.jsxs("button",{type:"button",onClick:e,className:_e("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:[g.jsx(m_,{className:"h-4 w-4 shrink-0"}),g.jsxs("span",{className:"min-w-0",children:[g.jsx("span",{className:"block text-sm font-medium leading-tight",children:R("Schema")}),g.jsx("span",{className:_e("block text-xs leading-tight",t?"text-primary/70":"text-muted-foreground/70"),children:R("Content structure")})]})]})}function qS({label:t,addLabel:e,onAdd:n,children:r}){return g.jsxs("div",{className:"pt-4",children:[g.jsxs("div",{className:"flex items-center justify-between px-3 pb-1",children:[g.jsx("p",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground/80",children:t}),g.jsxs(hx,{children:[g.jsx(px,{asChild:!0,children:g.jsxs(Oe,{variant:"ghost",size:"icon-xs",onClick:n,className:"text-muted-foreground hover:text-primary",children:[g.jsx(ai,{}),g.jsx("span",{className:"sr-only",children:e})]})}),g.jsx(mx,{children:e})]})]}),g.jsx("div",{className:"space-y-0.5",children:r})]})}function KS({onClick:t,children:e}){return g.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:[g.jsx(ai,{className:"h-4 w-4"})," ",e]})}function Lf({children:t,icon:e,active:n,onClick:r}){return g.jsxs("button",{type:"button",onClick:r,className:_e("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&&g.jsx("span",{className:n?"text-primary":"text-muted-foreground/70",children:e}),g.jsx("span",{className:"truncate",children:t})]})}function yQ({schema:t,selection:e,onSelect:n,onReload:r,onOpenSchema:o,addSeq:s,addKind:i,onBrowseTemplates:a}){if(!e)return g.jsx(xQ,{icon:g.jsx(Mc,{className:"h-6 w-6"}),title:R("Start on the left"),hint:R("Pick a collection or singleton to start editing. To change the structure, go to Schema."),action:g.jsxs(Oe,{onClick:()=>o(),children:[g.jsx(m_,{})," ",R("Open schema")]})});if(e.kind==="schema")return g.jsx(wX,{schema:t,initialAdd:i??void 0,onSaved:()=>void r(),onBrowseTemplates:a},s);if(e.kind==="json")return g.jsx(bQ,{schema:t});if(e.kind==="ship")return g.jsx(LX,{schema:t});if(e.kind==="collection"){const d=t.collections.find(h=>h.name===e.name);return d?g.jsx(wQ,{collection:d,onOpen:h=>n({kind:"entry",collection:d.name,slug:h}),onNew:()=>n({kind:"newEntry",collection:d.name})}):g.jsx(Vu,{children:R("This collection no longer exists.")})}if(e.kind==="entry"||e.kind==="newEntry"){const d=t.collections.find(f=>f.name===e.collection);if(!d)return g.jsx(Vu,{children:R("This collection no longer exists.")});const h=e.kind==="entry"?e.slug:null;return g.jsx(SQ,{collection:d,slug:h,onSaved:f=>n({kind:"entry",collection:d.name,slug:f}),onDeleted:()=>n({kind:"collection",name:d.name})},`${d.name}/${h??"new"}`)}const u=t.singletons.find(d=>d.name===e.name);return u?g.jsx(EQ,{singleton:u},u.name):g.jsx(Vu,{children:R("This singleton no longer exists.")})}function xQ({icon:t,title:e,hint:n,action:r}){return g.jsxs("div",{className:"flex h-full flex-col items-center justify-center px-6 text-center",children:[t&&g.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}),g.jsx("p",{className:"text-base font-semibold text-foreground",children:e}),n&&g.jsx("p",{className:"mt-1.5 max-w-sm text-sm text-muted-foreground",children:n}),r&&g.jsx("div",{className:"mt-5",children:r})]})}function am({children:t}){return g.jsx("div",{className:"rounded-xl border bg-card p-6 shadow-sm",children:t})}function ZN(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").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 YN({path:t,data:e}){const n=C.useMemo(()=>JSON.stringify(e,null,2),[e]),r=n==="{}",o=()=>{navigator.clipboard&&navigator.clipboard.writeText(n),Rt.success(R("JSON copied"))};return g.jsxs("div",{className:"overflow-hidden rounded-xl border shadow-sm",children:[g.jsxs("div",{className:"flex items-center gap-2 border-b bg-muted/60 px-3 py-2",children:[g.jsx(El,{className:"h-3.5 w-3.5 shrink-0 text-primary"}),g.jsx("span",{className:"truncate font-mono text-xs text-muted-foreground",children:t}),g.jsxs(Oe,{variant:"ghost",size:"xs",onClick:o,disabled:r,className:"ml-auto text-muted-foreground hover:text-primary",children:[g.jsx(c_,{})," ",R("Copy")]})]}),r?g.jsx("p",{className:"jk-pre text-muted-foreground/70",children:R("No fields filled in yet.")}):g.jsx("pre",{className:"jk-pre overflow-x-auto",children:g.jsx("code",{dangerouslySetInnerHTML:{__html:ZN(n)}})})]})}function nl({children:t}){return g.jsx(Tv,{children:g.jsx("div",{className:"mx-auto max-w-3xl space-y-5 px-8 py-6",children:t})})}function vQ({path:t,data:e,defaultOpen:n}){const[r,o]=C.useState(n??!1),s=C.useMemo(()=>JSON.stringify(e,null,2),[e]);return g.jsxs("div",{className:"overflow-hidden rounded-lg border",children:[g.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:[g.jsx(Ep,{className:_e("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform",r&&"rotate-90")}),g.jsx(El,{className:"h-3.5 w-3.5 shrink-0 text-primary"}),g.jsx("span",{className:"truncate font-mono text-xs text-foreground/80",children:t})]}),r&&g.jsx("pre",{className:"jk-pre overflow-x-auto border-t",children:g.jsx("code",{dangerouslySetInnerHTML:{__html:ZN(s)}})})]})}function bQ({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 a of t.collections){const u=await Cv(a.name),d=await Promise.all(u.map(h=>Ty(a.name,h.slug).then(f=>({slug:h.slug,d:f}))));for(const h of d)h.d&&i.push({path:`${a.name}/${h.slug}.json`,data:h.d})}for(const a of t.singletons){const u=await WN(a.name);i.push({path:`${a.name}.json`,data:u})}s||n(i)}catch(i){s||o(i.message)}})(),()=>{s=!0}},[t]),g.jsxs(ss,{children:[g.jsx(is,{title:R("Raw JSON"),subtitle:e?`content/ • ${bc(e.length,"{n} file","{n} files")}`:R("Every file in content/, exactly as written to disk")}),g.jsx(Tv,{children:g.jsxs("div",{className:"mx-auto max-w-3xl space-y-2 px-8 py-6",children:[r&&g.jsx(Rv,{title:R("Could not load"),children:r}),e===null&&!r&&g.jsx("p",{className:"px-1 text-sm text-muted-foreground",children:R("Loading…")}),e==null?void 0:e.map((s,i)=>g.jsx(vQ,{path:s.path,data:s.data,defaultOpen:i===0},s.path))]})})]})}function XN(){return g.jsx(am,{children:g.jsx("div",{className:"space-y-6",children:Dv.slice(0,4).map(t=>g.jsxs("div",{className:"space-y-2",children:[g.jsx(Vr,{className:"h-3.5 w-28"}),g.jsx(Vr,{className:"h-8 w-full"})]},t))})})}function QN({onRetry:t,onBack:e}){return g.jsx(am,{children:g.jsxs("div",{className:"flex flex-col items-center py-8 text-center",children:[g.jsx("div",{className:"mb-3 flex size-12 items-center justify-center rounded-xl bg-destructive/10 text-destructive",children:g.jsx(_p,{className:"size-5"})}),g.jsx("p",{className:"font-medium text-foreground",children:R("Could not load the entry")}),g.jsx("p",{className:"mt-1 max-w-sm text-sm text-muted-foreground",children:R("The file could not be read, or it may have been deleted. Editing is disabled so an empty form does not overwrite it.")}),g.jsxs("div",{className:"mt-4 flex items-center gap-2",children:[g.jsx(Oe,{onClick:t,children:R("Try again")}),e&&g.jsx(Oe,{variant:"outline",onClick:e,children:R("Back to the list")})]})]})})}function kQ(t){return t?new Intl.DateTimeFormat(vc()==="tr"?"tr-TR":"en-GB",{day:"numeric",month:"short",year:"numeric"}).format(new Date(t)):"—"}function wQ({collection:t,onOpen:e,onNew:n}){const[r,o]=C.useState(null),[s,i]=C.useState("");C.useEffect(()=>{Cv(t.name).then(o)},[t.name]);const a=s.trim().toLowerCase(),u=r==null?void 0:r.filter(h=>h.title.toLowerCase().includes(a)||h.slug.includes(a)),d=!!r&&r.length>0;return g.jsxs(ss,{children:[g.jsx(is,{title:t.label??t.name,subtitle:r?bc(r.length,"{n} entry","{n} entries"):R("Loading entries…"),actions:g.jsxs(Oe,{onClick:n,children:[g.jsx(ai,{})," ",R("New entry")]}),toolbar:d?g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsxs("div",{className:"relative w-full max-w-sm",children:[g.jsx(R9,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),g.jsx(Lt,{className:"pl-9",placeholder:R("Search by title or slug…"),value:s,onChange:h=>i(h.target.value)})]}),g.jsx("span",{className:"ml-auto shrink-0 text-xs tabular-nums text-muted-foreground",children:a?bc((u==null?void 0:u.length)??0,"{n} result","{n} results"):null})]}):void 0}),g.jsx(OX,{children:g.jsxs(IX,{className:"flex h-full flex-col [&>[data-slot=table-container]]:min-h-0 [&>[data-slot=table-container]]:flex-1",children:[r===null&&g.jsx(GS,{rows:null,onOpen:e}),r!==null&&r.length===0&&g.jsx(US,{icon:g.jsx(Mc,{className:"h-6 w-6"}),title:R("No entries yet"),hint:R("Add the first piece of content to this collection."),action:g.jsxs(Oe,{onClick:n,variant:"outline",children:[g.jsx(ai,{})," ",R("Create the first entry")]})}),d&&(u==null?void 0:u.length)===0&&g.jsx(US,{icon:g.jsx(M9,{className:"h-6 w-6"}),title:R("No matching entries"),hint:R("Nothing found for “{q}”. Change the search or clear it.",{q:s.trim()}),action:g.jsx(Oe,{variant:"outline",onClick:()=>i(""),children:R("Clear search")})}),d&&u&&u.length>0&&g.jsx(GS,{rows:u,onOpen:e})]})})]})}const zf="h-9 bg-muted/50 px-4 text-xs font-medium uppercase tracking-wide text-muted-foreground";function GS({rows:t,onOpen:e}){return g.jsxs(PL,{children:[g.jsx(jL,{className:"sticky top-0 z-10",children:g.jsxs(ug,{className:"hover:bg-transparent",children:[g.jsx(mf,{className:_e(zf,"w-full"),children:R("Title")}),g.jsx(mf,{className:zf,children:R("File")}),g.jsx(mf,{className:_e(zf,"text-right"),children:R("Updated")}),g.jsx(mf,{className:_e(zf,"w-10 pl-0"),children:g.jsx("span",{className:"sr-only",children:R("Open")})})]})}),g.jsx(LL,{children:t===null?Dv.map(n=>g.jsxs(ug,{className:"hover:bg-transparent",children:[g.jsx(Ls,{className:"px-4 py-3",children:g.jsx(Vr,{className:"h-3.5 w-48"})}),g.jsx(Ls,{className:"px-4 py-3",children:g.jsx(Vr,{className:"h-3 w-24"})}),g.jsx(Ls,{className:"px-4 py-3",children:g.jsx(Vr,{className:"ml-auto h-3 w-20"})}),g.jsx(Ls,{className:"w-10 py-3 pl-0"})]},n)):t.map(n=>g.jsxs(ug,{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:[g.jsx(Ls,{className:"px-4 py-3 font-medium text-foreground",children:n.title}),g.jsx(Ls,{className:"px-4 py-3 font-mono text-xs text-muted-foreground",children:n.slug}),g.jsx(Ls,{className:"px-4 py-3 text-right text-xs tabular-nums text-muted-foreground",children:kQ(n.updatedAt)}),g.jsxs(Ls,{className:"w-10 py-3 pr-4 pl-0 text-right",children:[g.jsx(Ep,{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"}),g.jsx("span",{className:"sr-only",children:R("Open")})]})]},n.slug))})]})}function eA(t,e){const[n,r]=C.useState({}),[o,s]=C.useState(!0),[i,a]=C.useState(!1),[u,d]=C.useState(0),h=C.useRef(0);C.useEffect(()=>{const m=++h.current;s(!0),a(!1),t().then(x=>{m===h.current&&(x===null&&e?a(!0):r(x??{}),s(!1))}).catch(()=>{m===h.current&&(a(!0),s(!1))})},[u]);const f=C.useCallback(()=>d(m=>m+1),[]);return{data:n,setData:r,loading:o,failed:i,retry:f}}function CQ({status:t,onToggle:e}){const n=t==="draft";return g.jsxs(Oe,{type:"button",variant:"outline",onClick:e,title:R(n?"Draft — publish it":"Published — move back to draft"),className:_e(n&&"border-dashed text-muted-foreground"),children:[g.jsx("span",{className:_e("inline-block size-2 rounded-full",n?"bg-muted-foreground/50":"bg-primary")}),R(n?"Draft":"Published")]})}function SQ({collection:t,slug:e,onSaved:n,onDeleted:r}){const o=e===null,s=C.useCallback(()=>o?Promise.resolve({}):Ty(t.name,e),[t.name,e,o]),{data:i,setData:a,loading:u,failed:d,retry:h}=eA(s,!o),[f,m]=C.useState(""),[x,v]=C.useState(!1),[b,k]=C.useState(null),[S,_]=C.useState(!1),T=(I,W)=>a(Z=>{const J={...Z};return W===""||W===void 0?delete J[I]:J[I]=W,J}),A=C.useMemo(()=>E_(t.fields,i),[i,t.fields]),M=o?Mp(f||String(i.title??"entry")):e,D=async()=>{k(null),v(!0);try{if(o&&await Ty(t.name,M)){const W=R('"{slug}" already exists — pick a different slug.',{slug:M});k(W),Rt.error(W);return}const I=await cX(t.name,M,i);Rt.success(R('"{slug}" saved',{slug:I})),n(I)}finally{v(!1)}},P=async()=>{o||(await dX(t.name,e),Rt.success(R('"{slug}" deleted',{slug:e})),r())},j=t.label??t.name;return u?g.jsxs(ss,{children:[g.jsx(is,{title:j,subtitle:g.jsx(Jf,{children:`${t.name}/…`})}),g.jsx(nl,{children:g.jsx(XN,{})})]}):d?g.jsxs(ss,{children:[g.jsx(is,{title:j,subtitle:g.jsx(Jf,{children:`${t.name}/${e}.json`})}),g.jsx(nl,{children:g.jsx(QN,{onRetry:h,onBack:r})})]}):g.jsxs(ss,{children:[g.jsx(is,{title:j,badge:o?g.jsx(Sl,{variant:"secondary",className:"font-normal",children:R("new")}):void 0,subtitle:g.jsx(Jf,{children:`${t.name}/${M}.json`}),actions:g.jsxs(g.Fragment,{children:[g.jsx(CQ,{status:kw(i),onToggle:()=>T(S_,kw(i)==="draft"?"":"draft")}),g.jsxs(Oe,{variant:S?"secondary":"outline",onClick:()=>_(I=>!I),children:[g.jsx(El,{})," JSON"]}),!o&&g.jsxs(Oe,{variant:"destructive",onClick:P,children:[g.jsx(g_,{})," ",R("Delete")]}),g.jsx(Oe,{onClick:D,disabled:x||!A.ok,children:R(x?"Saving…":"Save")})]})}),g.jsxs(nl,{children:[b&&g.jsx(Rv,{title:R("Could not save"),children:b}),S&&g.jsx(YN,{path:`${t.name}/${M}.json`,data:i}),g.jsxs(am,{children:[o&&g.jsxs("div",{className:"mb-6 rounded-lg border bg-muted/40 p-4",children:[g.jsx(Ov,{label:R("File name"),hint:`${M}.json`,children:g.jsx(Lt,{value:f,onChange:I=>m(I.target.value),placeholder:R("automatic"),className:"bg-card font-mono"})}),g.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:R("Leave it empty to derive it from the title. It cannot change after saving.")})]}),g.jsx("div",{className:"space-y-6",children:t.fields.map(I=>g.jsx(nA,{field:I,value:i[I.key],onChange:T,context:t.label??t.name},I.key))})]}),g.jsx(tA,{result:A})]})]})}function EQ({singleton:t}){const e=C.useCallback(()=>WN(t.name),[t.name]),{data:n,setData:r,loading:o,failed:s,retry:i}=eA(e,!1),[a,u]=C.useState(!1),[d,h]=C.useState(!1),f=(k,S)=>r(_=>{const T={..._};return S===""||S===void 0?delete T[k]:T[k]=S,T}),m=C.useMemo(()=>E_(t.fields,n),[n,t.fields]),x=async()=>{u(!0);try{await hX(t.name,n),Rt.success(R("{name} saved",{name:t.label??t.name}))}finally{u(!1)}},v=t.label??t.name,b=g.jsx(Sl,{variant:"secondary",className:"font-normal",children:R("singleton")});return o?g.jsxs(ss,{children:[g.jsx(is,{title:v,badge:b}),g.jsx(nl,{children:g.jsx(XN,{})})]}):s?g.jsxs(ss,{children:[g.jsx(is,{title:v,badge:b}),g.jsx(nl,{children:g.jsx(QN,{onRetry:i})})]}):g.jsxs(ss,{children:[g.jsx(is,{title:v,badge:b,subtitle:g.jsx(Jf,{children:`${t.name}.json`}),actions:g.jsxs(g.Fragment,{children:[g.jsxs(Oe,{variant:d?"secondary":"outline",onClick:()=>h(k=>!k),children:[g.jsx(El,{})," JSON"]}),g.jsx(Oe,{onClick:x,disabled:a||!m.ok,children:R(a?"Saving…":"Save")})]})}),g.jsxs(nl,{children:[d&&g.jsx(YN,{path:`${t.name}.json`,data:n}),g.jsx(am,{children:g.jsx("div",{className:"space-y-6",children:t.fields.map(k=>g.jsx(nA,{field:k,value:n[k.key],onChange:f,context:t.label??t.name},k.key))})}),g.jsx(tA,{result:m})]})]})}function Rv({title:t,tone:e="error",children:n}){const r=e==="error";return g.jsxs("div",{className:_e("rounded-xl border p-4",r?"border-destructive/30 bg-destructive/5":"border-border bg-muted/40"),children:[g.jsxs("div",{className:_e("flex items-center gap-2 text-sm font-medium",r?"text-destructive":"text-foreground"),children:[g.jsx(_p,{className:"h-4 w-4 shrink-0"}),t]}),g.jsx("div",{className:"mt-2.5 text-sm text-muted-foreground",children:n})]})}function tA({result:t}){if(t.issues.length===0)return null;const e=t.issues.some(n=>n.level==="error");return g.jsx(Rv,{tone:e?"error":"warning",title:R(e?"Fix these before saving":"Warnings"),children:g.jsx("ul",{className:"space-y-2",children:t.issues.map(n=>g.jsxs("li",{className:"flex items-start gap-2.5",children:[g.jsx("span",{"aria-hidden":!0,className:_e("mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full",n.level==="error"?"bg-destructive":"bg-muted-foreground/50")}),g.jsx("span",{className:"rounded bg-background px-1.5 py-0.5 font-mono text-xs text-foreground",children:n.key}),g.jsx("span",{className:"min-w-0",children:R(n.message)})]},`${n.key}-${n.message}`))})})}function Ov({label:t,required:e,type:n,hint:r,actions:o,children:s}){var a;const i=n?(a=Ev[n])==null?void 0:a.icon:null;return g.jsxs("div",{className:"space-y-2",children:[g.jsxs("div",{className:"flex items-center gap-1.5",children:[i&&g.jsx(i,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground/60"}),g.jsx(Za,{className:"text-sm font-medium text-foreground",children:t}),e&&g.jsx("span",{className:"text-destructive","aria-hidden":!0,children:"*"}),r&&g.jsx("span",{className:"ml-auto truncate font-mono text-xs text-primary",children:r}),o&&g.jsx("span",{className:r?"":"ml-auto",children:o})]}),s]})}const _Q=new Set(["text","richtext"]);function nA({field:t,value:e,onChange:n,context:r}){const[o,s]=C.useState(0),i=a=>{n(t.key,a),t.type==="richtext"&&s(u=>u+1)};return g.jsx(Ov,{label:t.label||t.key,required:t.required,type:t.type,actions:_Q.has(t.type)?g.jsx(uQ,{context:r,fieldLabel:t.label||t.key,currentValue:typeof e=="string"?e:"",richtext:t.type==="richtext",onResult:i}):void 0,children:g.jsx(rA,{field:t,value:e,onChange:n,richtextKey:o})})}function rA({field:t,value:e,onChange:n,richtextKey:r}){const o=t.key;switch(t.type){case"richtext":return g.jsx(iZ,{value:e??"",onChange:s=>n(o,s)},r);case"number":return g.jsx(Lt,{type:"number",value:e===void 0?"":String(e),onChange:s=>n(o,s.target.value===""?"":Number(s.target.value))});case"boolean":return g.jsx(Oe,{type:"button",variant:e?"default":"outline",role:"switch","aria-checked":!!e,onClick:()=>n(o,!e),className:"min-w-20",children:R(e?"Yes":"No")});case"date":return g.jsx(Lt,{type:"date",className:"w-[240px]",value:e??"",onChange:s=>n(o,s.target.value)});case"select":return g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs(Ju,{value:e||void 0,onValueChange:s=>n(o,s),children:[g.jsx(Yu,{className:"w-[240px]",children:g.jsx(Zu,{placeholder:R("Select…")})}),g.jsx(Xu,{children:(t.options??[]).map(s=>g.jsx(Qu,{value:s,children:s},s))})]}),e?g.jsxs(Oe,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>n(o,""),className:"text-muted-foreground",children:[g.jsx(fa,{}),g.jsx("span",{className:"sr-only",children:R("Clear")})]}):null]});case"relation":return g.jsx(MQ,{field:t,value:e,onChange:n});case"image":return g.jsx(RQ,{value:e,onChange:s=>n(o,s)});case"url":return g.jsx(Lt,{type:"url",inputMode:"url",placeholder:"https://…",value:e??"",onChange:s=>n(o,s.target.value)});case"email":return g.jsx(Lt,{type:"email",inputMode:"email",placeholder:"name@example.com",value:e??"",onChange:s=>n(o,s.target.value)});case"color":return g.jsx(TQ,{value:e,onChange:s=>n(o,s)});case"list":return g.jsx(NQ,{value:e,onChange:s=>n(o,s)});case"group":return g.jsx(AQ,{field:t,value:e,onChange:s=>n(o,s)});default:return g.jsx(Lt,{value:e??"",onChange:s=>n(o,s.target.value)})}}function TQ({value:t,onChange:e}){const n=typeof t=="string"&&/^#[0-9a-f]{6}$/i.test(t)?t:"";return g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs("label",{className:"relative size-9 shrink-0 cursor-pointer overflow-hidden rounded-lg border shadow-sm",children:[g.jsx("span",{className:"block size-full",style:{backgroundColor:n||"#ffffff"}}),g.jsx("input",{type:"color",value:n||"#000000",onChange:r=>e(r.target.value),className:"absolute inset-0 cursor-pointer opacity-0","aria-label":R("Pick a color")})]}),g.jsx(Lt,{className:"w-[140px] font-mono",placeholder:"#000000",value:t??"",onChange:r=>e(r.target.value)}),t?g.jsxs(Oe,{type:"button",variant:"ghost",size:"icon-sm",onClick:()=>e(""),className:"text-muted-foreground",children:[g.jsx(fa,{}),g.jsx("span",{className:"sr-only",children:R("Clear")})]}):null]})}function NQ({value:t,onChange:e}){const n=Array.isArray(t)?t:[],[r,o]=C.useState(""),s=()=>{const a=r.trim();if(!a||n.includes(a)){o("");return}e([...n,a]),o("")},i=a=>{const u=n.filter((d,h)=>h!==a);e(u.length?u:"")};return g.jsxs("div",{className:"space-y-2.5",children:[n.length>0&&g.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.map((a,u)=>g.jsxs(Sl,{variant:"secondary",className:"gap-1 pr-1",children:[a,g.jsx("button",{type:"button",onClick:()=>i(u),className:"rounded-full text-muted-foreground transition-colors hover:text-destructive","aria-label":R("Remove {item}",{item:a}),children:g.jsx(fa,{className:"h-3 w-3"})})]},a))}),g.jsx(Lt,{value:r,onChange:a=>o(a.target.value),onKeyDown:a=>{(a.key==="Enter"||a.key===",")&&(a.preventDefault(),s())},onBlur:s,placeholder:R("Type and press Enter…")})]})}function AQ({field:t,value:e,onChange:n}){const r=e&&typeof e=="object"&&!Array.isArray(e)?e:{},o=(s,i)=>{const a={...r};i===""||i===void 0?delete a[s]:a[s]=i,n(Object.keys(a).length?a:"")};return g.jsx("div",{className:"space-y-5 rounded-lg border border-dashed bg-muted/20 p-4",children:(t.fields??[]).map(s=>g.jsx(Ov,{label:s.label||s.key,required:s.required,type:s.type,children:g.jsx(rA,{field:s,value:r[s.key],onChange:o})},s.key))})}function MQ({field:t,value:e,onChange:n}){const[r,o]=C.useState([]),s=Array.isArray(e)?e:[];C.useEffect(()=>{t.to&&uX(t.to).then(o).catch(()=>o([]))},[t.to]);const i=u=>n(t.key,u.length?u:""),a=u=>{i(s.includes(u)?s.filter(d=>d!==u):[...s,u])};return r.length===0?g.jsx("p",{className:"rounded-lg border border-dashed bg-muted/30 px-3 py-2.5 text-sm text-muted-foreground",children:R("No entries in “{name}”.",{name:t.to??""})}):g.jsxs("div",{className:"space-y-2.5",children:[s.length>0&&g.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(u=>g.jsxs(Sl,{variant:"secondary",className:"gap-1 pr-1 font-mono",children:[u,g.jsx("button",{type:"button",onClick:()=>a(u),className:"rounded-full text-muted-foreground transition-colors hover:text-destructive","aria-label":R("Remove the link to {slug}",{slug:u}),children:g.jsx(fa,{className:"h-3 w-3"})})]},u))}),g.jsxs(y_,{children:[g.jsx(x_,{asChild:!0,children:g.jsxs(Oe,{variant:"outline",children:[g.jsx(h_,{})," ",R("Add link")]})}),g.jsxs(v_,{align:"start",className:"max-h-72 w-56 overflow-y-auto",children:[g.jsx(D1,{children:R("Entries in “{name}”",{name:t.to??""})}),g.jsx(xu,{}),r.map(u=>g.jsx(b_,{checked:s.includes(u),onCheckedChange:()=>a(u),onSelect:d=>d.preventDefault(),className:"font-mono text-xs",children:u},u))]})]})]})}async function DQ(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 a=i.getContext("2d");if(!a)throw new Error("no canvas context");a.drawImage(n,0,0,o,s);const u=await new Promise(f=>i.toBlob(f,"image/webp",.85));if(!u)throw new Error("conversion failed");const d=new Uint8Array(await u.arrayBuffer());let h="";for(const f of d)h+=String.fromCharCode(f);return btoa(h)}function RQ({value:t,onChange:e}){const[n,r]=C.useState(!1),o=typeof t=="string"?t:"",s=o?`/media/${o.split("/").pop()}`:null,i=async a=>{r(!0);try{e(await fX(await DQ(a),a.name)),Rt.success(R("Image uploaded"))}finally{r(!1)}};return g.jsxs("div",{className:"flex items-center gap-4 rounded-lg border bg-muted/30 p-3",children:[g.jsx("div",{className:_e("flex h-24 w-24 shrink-0 items-center justify-center overflow-hidden rounded-lg border bg-card",!s&&"border-dashed"),children:s?g.jsx("img",{src:s,alt:"",className:"h-full w-full object-cover"}):g.jsx(f_,{className:"h-6 w-6 text-muted-foreground/60"})}),g.jsxs("div",{className:"min-w-0 space-y-2",children:[g.jsxs("label",{className:_e(ux({variant:"outline"}),"cursor-pointer bg-card"),children:[g.jsx(Gu,{}),R(n?"Uploading…":"Upload image"),g.jsx("input",{type:"file",accept:"image/*",hidden:!0,onChange:a=>{var d;const u=(d=a.target.files)==null?void 0:d[0];u&&i(u)}})]}),o&&g.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[g.jsx("span",{className:"truncate font-mono text-xs text-muted-foreground",children:o}),g.jsx(Oe,{type:"button",variant:"ghost",size:"xs",onClick:()=>e(""),className:"text-muted-foreground hover:text-destructive",children:R("remove")})]})]})]})}const oA=document.getElementById("root");if(!oA)throw new Error("no root element");s5.createRoot(oA).render(g.jsx(C.StrictMode,{children:g.jsx(cQ,{})}));
|