doc2vec 2.10.5 → 2.10.6
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/dist/controller/config-registry.js +277 -0
- package/dist/controller/events.js +29 -0
- package/dist/controller/index.js +139 -0
- package/dist/controller/job-runner.js +314 -0
- package/dist/controller/migrations.js +55 -0
- package/dist/controller/notifier.js +106 -0
- package/dist/controller/scheduler.js +54 -0
- package/dist/controller/server.js +288 -0
- package/dist/controller/store.js +186 -0
- package/dist/controller/types.js +25 -0
- package/dist/doc2vec.js +20 -4
- package/dist/ui/assets/index-BVg6n7Si.css +1 -0
- package/dist/ui/assets/index-D-QOw3rk.js +126 -0
- package/dist/ui/index.html +14 -0
- package/package.json +1 -1
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
function a9(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function wv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Qb={exports:{}},vf={};var B2;function l9(){if(B2)return vf;B2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,a){var l=null;if(a!==void 0&&(l=""+a),i.key!==void 0&&(l=""+i.key),"key"in i){a={};for(var s in i)s!=="key"&&(a[s]=i[s])}else a=i;return i=a.ref,{$$typeof:e,type:r,key:l,ref:i!==void 0?i:null,props:a}}return vf.Fragment=t,vf.jsx=n,vf.jsxs=n,vf}var z2;function o9(){return z2||(z2=1,Qb.exports=l9()),Qb.exports}var _=o9(),Yb={exports:{}},De={};var $2;function s9(){if($2)return De;$2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),g=Symbol.iterator;function v(N){return N===null||typeof N!="object"?null:(N=g&&N[g]||N["@@iterator"],typeof N=="function"?N:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,w={};function A(N,X,re){this.props=N,this.context=X,this.refs=w,this.updater=re||y}A.prototype.isReactComponent={},A.prototype.setState=function(N,X){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,X,"setState")},A.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function k(){}k.prototype=A.prototype;function E(N,X,re){this.props=N,this.context=X,this.refs=w,this.updater=re||y}var P=E.prototype=new k;P.constructor=E,x(P,A.prototype),P.isPureReactComponent=!0;var T=Array.isArray;function M(){}var R={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function H(N,X,re){var le=re.ref;return{$$typeof:e,type:N,key:X,ref:le!==void 0?le:null,props:re}}function K(N,X){return H(N.type,X,N.props)}function V(N){return typeof N=="object"&&N!==null&&N.$$typeof===e}function B(N){var X={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(re){return X[re]})}var ae=/\/+/g;function ie(N,X){return typeof N=="object"&&N!==null&&N.key!=null?B(""+N.key):X.toString(36)}function oe(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(M,M):(N.status="pending",N.then(function(X){N.status==="pending"&&(N.status="fulfilled",N.value=X)},function(X){N.status==="pending"&&(N.status="rejected",N.reason=X)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function z(N,X,re,le,ge){var Oe=typeof N;(Oe==="undefined"||Oe==="boolean")&&(N=null);var Pe=!1;if(N===null)Pe=!0;else switch(Oe){case"bigint":case"string":case"number":Pe=!0;break;case"object":switch(N.$$typeof){case e:case t:Pe=!0;break;case d:return Pe=N._init,z(Pe(N._payload),X,re,le,ge)}}if(Pe)return ge=ge(N),Pe=le===""?"."+ie(N,0):le,T(ge)?(re="",Pe!=null&&(re=Pe.replace(ae,"$&/")+"/"),z(ge,X,re,"",function(Te){return Te})):ge!=null&&(V(ge)&&(ge=K(ge,re+(ge.key==null||N&&N.key===ge.key?"":(""+ge.key).replace(ae,"$&/")+"/")+Pe)),X.push(ge)),1;Pe=0;var mt=le===""?".":le+":";if(T(N))for(var se=0;se<N.length;se++)le=N[se],Oe=mt+ie(le,se),Pe+=z(le,X,re,Oe,ge);else if(se=v(N),typeof se=="function")for(N=se.call(N),se=0;!(le=N.next()).done;)le=le.value,Oe=mt+ie(le,se++),Pe+=z(le,X,re,Oe,ge);else if(Oe==="object"){if(typeof N.then=="function")return z(oe(N),X,re,le,ge);throw X=String(N),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return Pe}function G(N,X,re){if(N==null)return N;var le=[],ge=0;return z(N,le,"","",function(Oe){return X.call(re,Oe,ge++)}),le}function ne(N){if(N._status===-1){var X=N._result;X=X(),X.then(function(re){(N._status===0||N._status===-1)&&(N._status=1,N._result=re)},function(re){(N._status===0||N._status===-1)&&(N._status=2,N._result=re)}),N._status===-1&&(N._status=0,N._result=X)}if(N._status===1)return N._result.default;throw N._result}var ce=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},fe={map:G,forEach:function(N,X,re){G(N,function(){X.apply(this,arguments)},re)},count:function(N){var X=0;return G(N,function(){X++}),X},toArray:function(N){return G(N,function(X){return X})||[]},only:function(N){if(!V(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return De.Activity=p,De.Children=fe,De.Component=A,De.Fragment=n,De.Profiler=i,De.PureComponent=E,De.StrictMode=r,De.Suspense=c,De.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,De.__COMPILER_RUNTIME={__proto__:null,c:function(N){return R.H.useMemoCache(N)}},De.cache=function(N){return function(){return N.apply(null,arguments)}},De.cacheSignal=function(){return null},De.cloneElement=function(N,X,re){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var le=x({},N.props),ge=N.key;if(X!=null)for(Oe in X.key!==void 0&&(ge=""+X.key),X)!L.call(X,Oe)||Oe==="key"||Oe==="__self"||Oe==="__source"||Oe==="ref"&&X.ref===void 0||(le[Oe]=X[Oe]);var Oe=arguments.length-2;if(Oe===1)le.children=re;else if(1<Oe){for(var Pe=Array(Oe),mt=0;mt<Oe;mt++)Pe[mt]=arguments[mt+2];le.children=Pe}return H(N.type,ge,le)},De.createContext=function(N){return N={$$typeof:l,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:a,_context:N},N},De.createElement=function(N,X,re){var le,ge={},Oe=null;if(X!=null)for(le in X.key!==void 0&&(Oe=""+X.key),X)L.call(X,le)&&le!=="key"&&le!=="__self"&&le!=="__source"&&(ge[le]=X[le]);var Pe=arguments.length-2;if(Pe===1)ge.children=re;else if(1<Pe){for(var mt=Array(Pe),se=0;se<Pe;se++)mt[se]=arguments[se+2];ge.children=mt}if(N&&N.defaultProps)for(le in Pe=N.defaultProps,Pe)ge[le]===void 0&&(ge[le]=Pe[le]);return H(N,Oe,ge)},De.createRef=function(){return{current:null}},De.forwardRef=function(N){return{$$typeof:s,render:N}},De.isValidElement=V,De.lazy=function(N){return{$$typeof:d,_payload:{_status:-1,_result:N},_init:ne}},De.memo=function(N,X){return{$$typeof:f,type:N,compare:X===void 0?null:X}},De.startTransition=function(N){var X=R.T,re={};R.T=re;try{var le=N(),ge=R.S;ge!==null&&ge(re,le),typeof le=="object"&&le!==null&&typeof le.then=="function"&&le.then(M,ce)}catch(Oe){ce(Oe)}finally{X!==null&&re.types!==null&&(X.types=re.types),R.T=X}},De.unstable_useCacheRefresh=function(){return R.H.useCacheRefresh()},De.use=function(N){return R.H.use(N)},De.useActionState=function(N,X,re){return R.H.useActionState(N,X,re)},De.useCallback=function(N,X){return R.H.useCallback(N,X)},De.useContext=function(N){return R.H.useContext(N)},De.useDebugValue=function(){},De.useDeferredValue=function(N,X){return R.H.useDeferredValue(N,X)},De.useEffect=function(N,X){return R.H.useEffect(N,X)},De.useEffectEvent=function(N){return R.H.useEffectEvent(N)},De.useId=function(){return R.H.useId()},De.useImperativeHandle=function(N,X,re){return R.H.useImperativeHandle(N,X,re)},De.useInsertionEffect=function(N,X){return R.H.useInsertionEffect(N,X)},De.useLayoutEffect=function(N,X){return R.H.useLayoutEffect(N,X)},De.useMemo=function(N,X){return R.H.useMemo(N,X)},De.useOptimistic=function(N,X){return R.H.useOptimistic(N,X)},De.useReducer=function(N,X,re){return R.H.useReducer(N,X,re)},De.useRef=function(N){return R.H.useRef(N)},De.useState=function(N){return R.H.useState(N)},De.useSyncExternalStore=function(N,X,re){return R.H.useSyncExternalStore(N,X,re)},De.useTransition=function(){return R.H.useTransition()},De.version="19.2.7",De}var H2;function ac(){return H2||(H2=1,Yb.exports=s9()),Yb.exports}var O=ac();const KI=wv(O),u9=a9({__proto__:null,default:KI},[O]);var Gb={exports:{}},yf={},Zb={exports:{}},Jb={};var U2;function c9(){return U2||(U2=1,(function(e){function t(z,G){var ne=z.length;z.push(G);e:for(;0<ne;){var ce=ne-1>>>1,fe=z[ce];if(0<i(fe,G))z[ce]=G,z[ne]=fe,ne=ce;else break e}}function n(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var G=z[0],ne=z.pop();if(ne!==G){z[0]=ne;e:for(var ce=0,fe=z.length,N=fe>>>1;ce<N;){var X=2*(ce+1)-1,re=z[X],le=X+1,ge=z[le];if(0>i(re,ne))le<fe&&0>i(ge,re)?(z[ce]=ge,z[le]=ne,ce=le):(z[ce]=re,z[X]=ne,ce=X);else if(le<fe&&0>i(ge,ne))z[ce]=ge,z[le]=ne,ce=le;else break e}}return G}function i(z,G){var ne=z.sortIndex-G.sortIndex;return ne!==0?ne:z.id-G.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,s=l.now();e.unstable_now=function(){return l.now()-s}}var c=[],f=[],d=1,p=null,g=3,v=!1,y=!1,x=!1,w=!1,A=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function P(z){for(var G=n(f);G!==null;){if(G.callback===null)r(f);else if(G.startTime<=z)r(f),G.sortIndex=G.expirationTime,t(c,G);else break;G=n(f)}}function T(z){if(x=!1,P(z),!y)if(n(c)!==null)y=!0,M||(M=!0,B());else{var G=n(f);G!==null&&oe(T,G.startTime-z)}}var M=!1,R=-1,L=5,H=-1;function K(){return w?!0:!(e.unstable_now()-H<L)}function V(){if(w=!1,M){var z=e.unstable_now();H=z;var G=!0;try{e:{y=!1,x&&(x=!1,k(R),R=-1),v=!0;var ne=g;try{t:{for(P(z),p=n(c);p!==null&&!(p.expirationTime>z&&K());){var ce=p.callback;if(typeof ce=="function"){p.callback=null,g=p.priorityLevel;var fe=ce(p.expirationTime<=z);if(z=e.unstable_now(),typeof fe=="function"){p.callback=fe,P(z),G=!0;break t}p===n(c)&&r(c),P(z)}else r(c);p=n(c)}if(p!==null)G=!0;else{var N=n(f);N!==null&&oe(T,N.startTime-z),G=!1}}break e}finally{p=null,g=ne,v=!1}G=void 0}}finally{G?B():M=!1}}}var B;if(typeof E=="function")B=function(){E(V)};else if(typeof MessageChannel<"u"){var ae=new MessageChannel,ie=ae.port2;ae.port1.onmessage=V,B=function(){ie.postMessage(null)}}else B=function(){A(V,0)};function oe(z,G){R=A(function(){z(e.unstable_now())},G)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(z){z.callback=null},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function(z){switch(g){case 1:case 2:case 3:var G=3;break;default:G=g}var ne=g;g=G;try{return z()}finally{g=ne}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function(z,G){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var ne=g;g=z;try{return G()}finally{g=ne}},e.unstable_scheduleCallback=function(z,G,ne){var ce=e.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?ce+ne:ce):ne=ce,z){case 1:var fe=-1;break;case 2:fe=250;break;case 5:fe=1073741823;break;case 4:fe=1e4;break;default:fe=5e3}return fe=ne+fe,z={id:d++,callback:G,priorityLevel:z,startTime:ne,expirationTime:fe,sortIndex:-1},ne>ce?(z.sortIndex=ne,t(f,z),n(c)===null&&z===n(f)&&(x?(k(R),R=-1):x=!0,oe(T,ne-ce))):(z.sortIndex=fe,t(c,z),y||v||(y=!0,M||(M=!0,B()))),z},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(z){var G=g;return function(){var ne=g;g=G;try{return z.apply(this,arguments)}finally{g=ne}}}})(Jb)),Jb}var F2;function f9(){return F2||(F2=1,Zb.exports=c9()),Zb.exports}var ex={exports:{}},Cn={};var q2;function h9(){if(q2)return Cn;q2=1;var e=ac();function t(c){var f="https://react.dev/errors/"+c;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)f+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+c+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function a(c,f,d){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:p==null?null:""+p,children:c,containerInfo:f,implementation:d}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function s(c,f){if(c==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Cn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Cn.createPortal=function(c,f){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return a(c,f,null,d)},Cn.flushSync=function(c){var f=l.T,d=r.p;try{if(l.T=null,r.p=2,c)return c()}finally{l.T=f,r.p=d,r.d.f()}},Cn.preconnect=function(c,f){typeof c=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(c,f))},Cn.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},Cn.preinit=function(c,f){if(typeof c=="string"&&f&&typeof f.as=="string"){var d=f.as,p=s(d,f.crossOrigin),g=typeof f.integrity=="string"?f.integrity:void 0,v=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;d==="style"?r.d.S(c,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:p,integrity:g,fetchPriority:v}):d==="script"&&r.d.X(c,{crossOrigin:p,integrity:g,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Cn.preinitModule=function(c,f){if(typeof c=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var d=s(f.as,f.crossOrigin);r.d.M(c,{crossOrigin:d,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(c)},Cn.preload=function(c,f){if(typeof c=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var d=f.as,p=s(d,f.crossOrigin);r.d.L(c,d,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},Cn.preloadModule=function(c,f){if(typeof c=="string")if(f){var d=s(f.as,f.crossOrigin);r.d.m(c,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:d,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(c)},Cn.requestFormReset=function(c){r.d.r(c)},Cn.unstable_batchedUpdates=function(c,f){return c(f)},Cn.useFormState=function(c,f,d){return l.H.useFormState(c,f,d)},Cn.useFormStatus=function(){return l.H.useHostTransitionStatus()},Cn.version="19.2.7",Cn}var W2;function XI(){if(W2)return ex.exports;W2=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),ex.exports=h9(),ex.exports}var V2;function d9(){if(V2)return yf;V2=1;var e=f9(),t=ac(),n=XI();function r(o){var u="https://react.dev/errors/"+o;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)u+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+o+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function a(o){var u=o,h=o;if(o.alternate)for(;u.return;)u=u.return;else{o=u;do u=o,(u.flags&4098)!==0&&(h=u.return),o=u.return;while(o)}return u.tag===3?h:null}function l(o){if(o.tag===13){var u=o.memoizedState;if(u===null&&(o=o.alternate,o!==null&&(u=o.memoizedState)),u!==null)return u.dehydrated}return null}function s(o){if(o.tag===31){var u=o.memoizedState;if(u===null&&(o=o.alternate,o!==null&&(u=o.memoizedState)),u!==null)return u.dehydrated}return null}function c(o){if(a(o)!==o)throw Error(r(188))}function f(o){var u=o.alternate;if(!u){if(u=a(o),u===null)throw Error(r(188));return u!==o?null:o}for(var h=o,m=u;;){var b=h.return;if(b===null)break;var S=b.alternate;if(S===null){if(m=b.return,m!==null){h=m;continue}break}if(b.child===S.child){for(S=b.child;S;){if(S===h)return c(b),o;if(S===m)return c(b),u;S=S.sibling}throw Error(r(188))}if(h.return!==m.return)h=b,m=S;else{for(var C=!1,D=b.child;D;){if(D===h){C=!0,h=b,m=S;break}if(D===m){C=!0,m=b,h=S;break}D=D.sibling}if(!C){for(D=S.child;D;){if(D===h){C=!0,h=S,m=b;break}if(D===m){C=!0,m=S,h=b;break}D=D.sibling}if(!C)throw Error(r(189))}}if(h.alternate!==m)throw Error(r(190))}if(h.tag!==3)throw Error(r(188));return h.stateNode.current===h?o:u}function d(o){var u=o.tag;if(u===5||u===26||u===27||u===6)return o;for(o=o.child;o!==null;){if(u=d(o),u!==null)return u;o=o.sibling}return null}var p=Object.assign,g=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),E=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),K=Symbol.for("react.memo_cache_sentinel"),V=Symbol.iterator;function B(o){return o===null||typeof o!="object"?null:(o=V&&o[V]||o["@@iterator"],typeof o=="function"?o:null)}var ae=Symbol.for("react.client.reference");function ie(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===ae?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case x:return"Fragment";case A:return"Profiler";case w:return"StrictMode";case T:return"Suspense";case M:return"SuspenseList";case H:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case y:return"Portal";case E:return o.displayName||"Context";case k:return(o._context.displayName||"Context")+".Consumer";case P:var u=o.render;return o=o.displayName,o||(o=u.displayName||u.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case R:return u=o.displayName||null,u!==null?u:ie(o.type)||"Memo";case L:u=o._payload,o=o._init;try{return ie(o(u))}catch{}}return null}var oe=Array.isArray,z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},ce=[],fe=-1;function N(o){return{current:o}}function X(o){0>fe||(o.current=ce[fe],ce[fe]=null,fe--)}function re(o,u){fe++,ce[fe]=o.current,o.current=u}var le=N(null),ge=N(null),Oe=N(null),Pe=N(null);function mt(o,u){switch(re(Oe,u),re(ge,o),re(le,null),u.nodeType){case 9:case 11:o=(o=u.documentElement)&&(o=o.namespaceURI)?o2(o):0;break;default:if(o=u.tagName,u=u.namespaceURI)u=o2(u),o=s2(u,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}X(le),re(le,o)}function se(){X(le),X(ge),X(Oe)}function Te(o){o.memoizedState!==null&&re(Pe,o);var u=le.current,h=s2(u,o.type);u!==h&&(re(ge,o),re(le,h))}function Ee(o){ge.current===o&&(X(le),X(ge)),Pe.current===o&&(X(Pe),df._currentValue=ne)}var ue,_t;function _e(o){if(ue===void 0)try{throw Error()}catch(h){var u=h.stack.trim().match(/\n( *(at )?)/);ue=u&&u[1]||"",_t=-1<h.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+ue+o+_t}var xe=!1;function gt(o,u){if(!o||xe)return"";xe=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(u){var te=function(){throw Error()};if(Object.defineProperty(te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(te,[])}catch(Q){var W=Q}Reflect.construct(o,[],te)}else{try{te.call()}catch(Q){W=Q}o.call(te.prototype)}}else{try{throw Error()}catch(Q){W=Q}(te=o())&&typeof te.catch=="function"&&te.catch(function(){})}}catch(Q){if(Q&&W&&typeof Q.stack=="string")return[Q.stack,W.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=m.DetermineComponentFrameRoot(),C=S[0],D=S[1];if(C&&D){var I=C.split(`
|
|
4
|
+
`),F=D.split(`
|
|
5
|
+
`);for(b=m=0;m<I.length&&!I[m].includes("DetermineComponentFrameRoot");)m++;for(;b<F.length&&!F[b].includes("DetermineComponentFrameRoot");)b++;if(m===I.length||b===F.length)for(m=I.length-1,b=F.length-1;1<=m&&0<=b&&I[m]!==F[b];)b--;for(;1<=m&&0<=b;m--,b--)if(I[m]!==F[b]){if(m!==1||b!==1)do if(m--,b--,0>b||I[m]!==F[b]){var Z=`
|
|
6
|
+
`+I[m].replace(" at new "," at ");return o.displayName&&Z.includes("<anonymous>")&&(Z=Z.replace("<anonymous>",o.displayName)),Z}while(1<=m&&0<=b);break}}}finally{xe=!1,Error.prepareStackTrace=h}return(h=o?o.displayName||o.name:"")?_e(h):""}function dn(o,u){switch(o.tag){case 26:case 27:case 5:return _e(o.type);case 16:return _e("Lazy");case 13:return o.child!==u&&u!==null?_e("Suspense Fallback"):_e("Suspense");case 19:return _e("SuspenseList");case 0:case 15:return gt(o.type,!1);case 11:return gt(o.type.render,!1);case 1:return gt(o.type,!0);case 31:return _e("Activity");default:return""}}function la(o){try{var u="",h=null;do u+=dn(o,h),h=o,o=o.return;while(o);return u}catch(m){return`
|
|
7
|
+
Error generating stack: `+m.message+`
|
|
8
|
+
`+m.stack}}var Ny=Object.prototype.hasOwnProperty,Iy=e.unstable_scheduleCallback,Ly=e.unstable_cancelCallback,j6=e.unstable_shouldYield,B6=e.unstable_requestPaint,hr=e.unstable_now,z6=e.unstable_getCurrentPriorityLevel,zk=e.unstable_ImmediatePriority,$k=e.unstable_UserBlockingPriority,gd=e.unstable_NormalPriority,$6=e.unstable_LowPriority,Hk=e.unstable_IdlePriority,H6=e.log,U6=e.unstable_setDisableYieldValue,Ac=null,dr=null;function rl(o){if(typeof H6=="function"&&U6(o),dr&&typeof dr.setStrictMode=="function")try{dr.setStrictMode(Ac,o)}catch{}}var pr=Math.clz32?Math.clz32:W6,F6=Math.log,q6=Math.LN2;function W6(o){return o>>>=0,o===0?32:31-(F6(o)/q6|0)|0}var vd=256,yd=262144,bd=4194304;function oo(o){var u=o&42;if(u!==0)return u;switch(o&-o){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return o&261888;case 262144:case 524288:case 1048576:case 2097152:return o&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function xd(o,u,h){var m=o.pendingLanes;if(m===0)return 0;var b=0,S=o.suspendedLanes,C=o.pingedLanes;o=o.warmLanes;var D=m&134217727;return D!==0?(m=D&~S,m!==0?b=oo(m):(C&=D,C!==0?b=oo(C):h||(h=D&~o,h!==0&&(b=oo(h))))):(D=m&~S,D!==0?b=oo(D):C!==0?b=oo(C):h||(h=m&~o,h!==0&&(b=oo(h)))),b===0?0:u!==0&&u!==b&&(u&S)===0&&(S=b&-b,h=u&-u,S>=h||S===32&&(h&4194048)!==0)?u:b}function kc(o,u){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&u)===0}function V6(o,u){switch(o){case 1:case 2:case 4:case 8:case 64:return u+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return u+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Uk(){var o=bd;return bd<<=1,(bd&62914560)===0&&(bd=4194304),o}function jy(o){for(var u=[],h=0;31>h;h++)u.push(o);return u}function Cc(o,u){o.pendingLanes|=u,u!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function K6(o,u,h,m,b,S){var C=o.pendingLanes;o.pendingLanes=h,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=h,o.entangledLanes&=h,o.errorRecoveryDisabledLanes&=h,o.shellSuspendCounter=0;var D=o.entanglements,I=o.expirationTimes,F=o.hiddenUpdates;for(h=C&~h;0<h;){var Z=31-pr(h),te=1<<Z;D[Z]=0,I[Z]=-1;var W=F[Z];if(W!==null)for(F[Z]=null,Z=0;Z<W.length;Z++){var Q=W[Z];Q!==null&&(Q.lane&=-536870913)}h&=~te}m!==0&&Fk(o,m,0),S!==0&&b===0&&o.tag!==0&&(o.suspendedLanes|=S&~(C&~u))}function Fk(o,u,h){o.pendingLanes|=u,o.suspendedLanes&=~u;var m=31-pr(u);o.entangledLanes|=u,o.entanglements[m]=o.entanglements[m]|1073741824|h&261930}function qk(o,u){var h=o.entangledLanes|=u;for(o=o.entanglements;h;){var m=31-pr(h),b=1<<m;b&u|o[m]&u&&(o[m]|=u),h&=~b}}function Wk(o,u){var h=u&-u;return h=(h&42)!==0?1:By(h),(h&(o.suspendedLanes|u))!==0?0:h}function By(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=16;break;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:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function zy(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function Vk(){var o=G.p;return o!==0?o:(o=window.event,o===void 0?32:D2(o.type))}function Kk(o,u){var h=G.p;try{return G.p=o,u()}finally{G.p=h}}var il=Math.random().toString(36).slice(2),pn="__reactFiber$"+il,Xn="__reactProps$"+il,As="__reactContainer$"+il,$y="__reactEvents$"+il,X6="__reactListeners$"+il,Q6="__reactHandles$"+il,Xk="__reactResources$"+il,Ec="__reactMarker$"+il;function Hy(o){delete o[pn],delete o[Xn],delete o[$y],delete o[X6],delete o[Q6]}function ks(o){var u=o[pn];if(u)return u;for(var h=o.parentNode;h;){if(u=h[As]||h[pn]){if(h=u.alternate,u.child!==null||h!==null&&h.child!==null)for(o=m2(o);o!==null;){if(h=o[pn])return h;o=m2(o)}return u}o=h,h=o.parentNode}return null}function Cs(o){if(o=o[pn]||o[As]){var u=o.tag;if(u===5||u===6||u===13||u===31||u===26||u===27||u===3)return o}return null}function Tc(o){var u=o.tag;if(u===5||u===26||u===27||u===6)return o.stateNode;throw Error(r(33))}function Es(o){var u=o[Xk];return u||(u=o[Xk]={hoistableStyles:new Map,hoistableScripts:new Map}),u}function en(o){o[Ec]=!0}var Qk=new Set,Yk={};function so(o,u){Ts(o,u),Ts(o+"Capture",u)}function Ts(o,u){for(Yk[o]=u,o=0;o<u.length;o++)Qk.add(u[o])}var Y6=RegExp("^[: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]*$"),Gk={},Zk={};function G6(o){return Ny.call(Zk,o)?!0:Ny.call(Gk,o)?!1:Y6.test(o)?Zk[o]=!0:(Gk[o]=!0,!1)}function Sd(o,u,h){if(G6(u))if(h===null)o.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":o.removeAttribute(u);return;case"boolean":var m=u.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){o.removeAttribute(u);return}}o.setAttribute(u,""+h)}}function wd(o,u,h){if(h===null)o.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(u);return}o.setAttribute(u,""+h)}}function oa(o,u,h,m){if(m===null)o.removeAttribute(h);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(h);return}o.setAttributeNS(u,h,""+m)}}function Nr(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function Jk(o){var u=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function Z6(o,u,h){var m=Object.getOwnPropertyDescriptor(o.constructor.prototype,u);if(!o.hasOwnProperty(u)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var b=m.get,S=m.set;return Object.defineProperty(o,u,{configurable:!0,get:function(){return b.call(this)},set:function(C){h=""+C,S.call(this,C)}}),Object.defineProperty(o,u,{enumerable:m.enumerable}),{getValue:function(){return h},setValue:function(C){h=""+C},stopTracking:function(){o._valueTracker=null,delete o[u]}}}}function Uy(o){if(!o._valueTracker){var u=Jk(o)?"checked":"value";o._valueTracker=Z6(o,u,""+o[u])}}function eC(o){if(!o)return!1;var u=o._valueTracker;if(!u)return!0;var h=u.getValue(),m="";return o&&(m=Jk(o)?o.checked?"true":"false":o.value),o=m,o!==h?(u.setValue(o),!0):!1}function Od(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var J6=/[\n"\\]/g;function Ir(o){return o.replace(J6,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function Fy(o,u,h,m,b,S,C,D){o.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?o.type=C:o.removeAttribute("type"),u!=null?C==="number"?(u===0&&o.value===""||o.value!=u)&&(o.value=""+Nr(u)):o.value!==""+Nr(u)&&(o.value=""+Nr(u)):C!=="submit"&&C!=="reset"||o.removeAttribute("value"),u!=null?qy(o,C,Nr(u)):h!=null?qy(o,C,Nr(h)):m!=null&&o.removeAttribute("value"),b==null&&S!=null&&(o.defaultChecked=!!S),b!=null&&(o.checked=b&&typeof b!="function"&&typeof b!="symbol"),D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?o.name=""+Nr(D):o.removeAttribute("name")}function tC(o,u,h,m,b,S,C,D){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(o.type=S),u!=null||h!=null){if(!(S!=="submit"&&S!=="reset"||u!=null)){Uy(o);return}h=h!=null?""+Nr(h):"",u=u!=null?""+Nr(u):h,D||u===o.value||(o.value=u),o.defaultValue=u}m=m??b,m=typeof m!="function"&&typeof m!="symbol"&&!!m,o.checked=D?o.checked:!!m,o.defaultChecked=!!m,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(o.name=C),Uy(o)}function qy(o,u,h){u==="number"&&Od(o.ownerDocument)===o||o.defaultValue===""+h||(o.defaultValue=""+h)}function Ms(o,u,h,m){if(o=o.options,u){u={};for(var b=0;b<h.length;b++)u["$"+h[b]]=!0;for(h=0;h<o.length;h++)b=u.hasOwnProperty("$"+o[h].value),o[h].selected!==b&&(o[h].selected=b),b&&m&&(o[h].defaultSelected=!0)}else{for(h=""+Nr(h),u=null,b=0;b<o.length;b++){if(o[b].value===h){o[b].selected=!0,m&&(o[b].defaultSelected=!0);return}u!==null||o[b].disabled||(u=o[b])}u!==null&&(u.selected=!0)}}function nC(o,u,h){if(u!=null&&(u=""+Nr(u),u!==o.value&&(o.value=u),h==null)){o.defaultValue!==u&&(o.defaultValue=u);return}o.defaultValue=h!=null?""+Nr(h):""}function rC(o,u,h,m){if(u==null){if(m!=null){if(h!=null)throw Error(r(92));if(oe(m)){if(1<m.length)throw Error(r(93));m=m[0]}h=m}h==null&&(h=""),u=h}h=Nr(u),o.defaultValue=h,m=o.textContent,m===h&&m!==""&&m!==null&&(o.value=m),Uy(o)}function Ps(o,u){if(u){var h=o.firstChild;if(h&&h===o.lastChild&&h.nodeType===3){h.nodeValue=u;return}}o.textContent=u}var eH=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function iC(o,u,h){var m=u.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?m?o.setProperty(u,""):u==="float"?o.cssFloat="":o[u]="":m?o.setProperty(u,h):typeof h!="number"||h===0||eH.has(u)?u==="float"?o.cssFloat=h:o[u]=(""+h).trim():o[u]=h+"px"}function aC(o,u,h){if(u!=null&&typeof u!="object")throw Error(r(62));if(o=o.style,h!=null){for(var m in h)!h.hasOwnProperty(m)||u!=null&&u.hasOwnProperty(m)||(m.indexOf("--")===0?o.setProperty(m,""):m==="float"?o.cssFloat="":o[m]="");for(var b in u)m=u[b],u.hasOwnProperty(b)&&h[b]!==m&&iC(o,b,m)}else for(var S in u)u.hasOwnProperty(S)&&iC(o,S,u[S])}function Wy(o){if(o.indexOf("-")===-1)return!1;switch(o){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 tH=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),nH=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ad(o){return nH.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function sa(){}var Vy=null;function Ky(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Ds=null,Rs=null;function lC(o){var u=Cs(o);if(u&&(o=u.stateNode)){var h=o[Xn]||null;e:switch(o=u.stateNode,u.type){case"input":if(Fy(o,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),u=h.name,h.type==="radio"&&u!=null){for(h=o;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+Ir(""+u)+'"][type="radio"]'),u=0;u<h.length;u++){var m=h[u];if(m!==o&&m.form===o.form){var b=m[Xn]||null;if(!b)throw Error(r(90));Fy(m,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(u=0;u<h.length;u++)m=h[u],m.form===o.form&&eC(m)}break e;case"textarea":nC(o,h.value,h.defaultValue);break e;case"select":u=h.value,u!=null&&Ms(o,!!h.multiple,u,!1)}}}var Xy=!1;function oC(o,u,h){if(Xy)return o(u,h);Xy=!0;try{var m=o(u);return m}finally{if(Xy=!1,(Ds!==null||Rs!==null)&&(fp(),Ds&&(u=Ds,o=Rs,Rs=Ds=null,lC(u),o)))for(u=0;u<o.length;u++)lC(o[u])}}function Mc(o,u){var h=o.stateNode;if(h===null)return null;var m=h[Xn]||null;if(m===null)return null;h=m[u];e:switch(u){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(o=o.type,m=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!m;break e;default:o=!1}if(o)return null;if(h&&typeof h!="function")throw Error(r(231,u,typeof h));return h}var ua=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qy=!1;if(ua)try{var Pc={};Object.defineProperty(Pc,"passive",{get:function(){Qy=!0}}),window.addEventListener("test",Pc,Pc),window.removeEventListener("test",Pc,Pc)}catch{Qy=!1}var al=null,Yy=null,kd=null;function sC(){if(kd)return kd;var o,u=Yy,h=u.length,m,b="value"in al?al.value:al.textContent,S=b.length;for(o=0;o<h&&u[o]===b[o];o++);var C=h-o;for(m=1;m<=C&&u[h-m]===b[S-m];m++);return kd=b.slice(o,1<m?1-m:void 0)}function Cd(o){var u=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&u===13&&(o=13)):o=u,o===10&&(o=13),32<=o||o===13?o:0}function Ed(){return!0}function uC(){return!1}function Qn(o){function u(h,m,b,S,C){this._reactName=h,this._targetInst=b,this.type=m,this.nativeEvent=S,this.target=C,this.currentTarget=null;for(var D in o)o.hasOwnProperty(D)&&(h=o[D],this[D]=h?h(S):S[D]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?Ed:uC,this.isPropagationStopped=uC,this}return p(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=Ed)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=Ed)},persist:function(){},isPersistent:Ed}),u}var uo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Td=Qn(uo),Dc=p({},uo,{view:0,detail:0}),rH=Qn(Dc),Gy,Zy,Rc,Md=p({},Dc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:e0,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==Rc&&(Rc&&o.type==="mousemove"?(Gy=o.screenX-Rc.screenX,Zy=o.screenY-Rc.screenY):Zy=Gy=0,Rc=o),Gy)},movementY:function(o){return"movementY"in o?o.movementY:Zy}}),cC=Qn(Md),iH=p({},Md,{dataTransfer:0}),aH=Qn(iH),lH=p({},Dc,{relatedTarget:0}),Jy=Qn(lH),oH=p({},uo,{animationName:0,elapsedTime:0,pseudoElement:0}),sH=Qn(oH),uH=p({},uo,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),cH=Qn(uH),fH=p({},uo,{data:0}),fC=Qn(fH),hH={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},dH={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"},pH={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function mH(o){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(o):(o=pH[o])?!!u[o]:!1}function e0(){return mH}var gH=p({},Dc,{key:function(o){if(o.key){var u=hH[o.key]||o.key;if(u!=="Unidentified")return u}return o.type==="keypress"?(o=Cd(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?dH[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:e0,charCode:function(o){return o.type==="keypress"?Cd(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?Cd(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),vH=Qn(gH),yH=p({},Md,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),hC=Qn(yH),bH=p({},Dc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:e0}),xH=Qn(bH),SH=p({},uo,{propertyName:0,elapsedTime:0,pseudoElement:0}),wH=Qn(SH),OH=p({},Md,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),AH=Qn(OH),kH=p({},uo,{newState:0,oldState:0}),CH=Qn(kH),EH=[9,13,27,32],t0=ua&&"CompositionEvent"in window,_c=null;ua&&"documentMode"in document&&(_c=document.documentMode);var TH=ua&&"TextEvent"in window&&!_c,dC=ua&&(!t0||_c&&8<_c&&11>=_c),pC=" ",mC=!1;function gC(o,u){switch(o){case"keyup":return EH.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vC(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var _s=!1;function MH(o,u){switch(o){case"compositionend":return vC(u);case"keypress":return u.which!==32?null:(mC=!0,pC);case"textInput":return o=u.data,o===pC&&mC?null:o;default:return null}}function PH(o,u){if(_s)return o==="compositionend"||!t0&&gC(o,u)?(o=sC(),kd=Yy=al=null,_s=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1<u.char.length)return u.char;if(u.which)return String.fromCharCode(u.which)}return null;case"compositionend":return dC&&u.locale!=="ko"?null:u.data;default:return null}}var DH={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 yC(o){var u=o&&o.nodeName&&o.nodeName.toLowerCase();return u==="input"?!!DH[o.type]:u==="textarea"}function bC(o,u,h,m){Ds?Rs?Rs.push(m):Rs=[m]:Ds=m,u=yp(u,"onChange"),0<u.length&&(h=new Td("onChange","change",null,h,m),o.push({event:h,listeners:u}))}var Nc=null,Ic=null;function RH(o){t2(o,0)}function Pd(o){var u=Tc(o);if(eC(u))return o}function xC(o,u){if(o==="change")return u}var SC=!1;if(ua){var n0;if(ua){var r0="oninput"in document;if(!r0){var wC=document.createElement("div");wC.setAttribute("oninput","return;"),r0=typeof wC.oninput=="function"}n0=r0}else n0=!1;SC=n0&&(!document.documentMode||9<document.documentMode)}function OC(){Nc&&(Nc.detachEvent("onpropertychange",AC),Ic=Nc=null)}function AC(o){if(o.propertyName==="value"&&Pd(Ic)){var u=[];bC(u,Ic,o,Ky(o)),oC(RH,u)}}function _H(o,u,h){o==="focusin"?(OC(),Nc=u,Ic=h,Nc.attachEvent("onpropertychange",AC)):o==="focusout"&&OC()}function NH(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Pd(Ic)}function IH(o,u){if(o==="click")return Pd(u)}function LH(o,u){if(o==="input"||o==="change")return Pd(u)}function jH(o,u){return o===u&&(o!==0||1/o===1/u)||o!==o&&u!==u}var mr=typeof Object.is=="function"?Object.is:jH;function Lc(o,u){if(mr(o,u))return!0;if(typeof o!="object"||o===null||typeof u!="object"||u===null)return!1;var h=Object.keys(o),m=Object.keys(u);if(h.length!==m.length)return!1;for(m=0;m<h.length;m++){var b=h[m];if(!Ny.call(u,b)||!mr(o[b],u[b]))return!1}return!0}function kC(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function CC(o,u){var h=kC(o);o=0;for(var m;h;){if(h.nodeType===3){if(m=o+h.textContent.length,o<=u&&m>=u)return{node:h,offset:u-o};o=m}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=kC(h)}}function EC(o,u){return o&&u?o===u?!0:o&&o.nodeType===3?!1:u&&u.nodeType===3?EC(o,u.parentNode):"contains"in o?o.contains(u):o.compareDocumentPosition?!!(o.compareDocumentPosition(u)&16):!1:!1}function TC(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var u=Od(o.document);u instanceof o.HTMLIFrameElement;){try{var h=typeof u.contentWindow.location.href=="string"}catch{h=!1}if(h)o=u.contentWindow;else break;u=Od(o.document)}return u}function i0(o){var u=o&&o.nodeName&&o.nodeName.toLowerCase();return u&&(u==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||u==="textarea"||o.contentEditable==="true")}var BH=ua&&"documentMode"in document&&11>=document.documentMode,Ns=null,a0=null,jc=null,l0=!1;function MC(o,u,h){var m=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;l0||Ns==null||Ns!==Od(m)||(m=Ns,"selectionStart"in m&&i0(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),jc&&Lc(jc,m)||(jc=m,m=yp(a0,"onSelect"),0<m.length&&(u=new Td("onSelect","select",null,u,h),o.push({event:u,listeners:m}),u.target=Ns)))}function co(o,u){var h={};return h[o.toLowerCase()]=u.toLowerCase(),h["Webkit"+o]="webkit"+u,h["Moz"+o]="moz"+u,h}var Is={animationend:co("Animation","AnimationEnd"),animationiteration:co("Animation","AnimationIteration"),animationstart:co("Animation","AnimationStart"),transitionrun:co("Transition","TransitionRun"),transitionstart:co("Transition","TransitionStart"),transitioncancel:co("Transition","TransitionCancel"),transitionend:co("Transition","TransitionEnd")},o0={},PC={};ua&&(PC=document.createElement("div").style,"AnimationEvent"in window||(delete Is.animationend.animation,delete Is.animationiteration.animation,delete Is.animationstart.animation),"TransitionEvent"in window||delete Is.transitionend.transition);function fo(o){if(o0[o])return o0[o];if(!Is[o])return o;var u=Is[o],h;for(h in u)if(u.hasOwnProperty(h)&&h in PC)return o0[o]=u[h];return o}var DC=fo("animationend"),RC=fo("animationiteration"),_C=fo("animationstart"),zH=fo("transitionrun"),$H=fo("transitionstart"),HH=fo("transitioncancel"),NC=fo("transitionend"),IC=new Map,s0="abort auxClick beforeToggle 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(" ");s0.push("scrollEnd");function li(o,u){IC.set(o,u),so(u,[o])}var Dd=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var u=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(u))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},Lr=[],Ls=0,u0=0;function Rd(){for(var o=Ls,u=u0=Ls=0;u<o;){var h=Lr[u];Lr[u++]=null;var m=Lr[u];Lr[u++]=null;var b=Lr[u];Lr[u++]=null;var S=Lr[u];if(Lr[u++]=null,m!==null&&b!==null){var C=m.pending;C===null?b.next=b:(b.next=C.next,C.next=b),m.pending=b}S!==0&&LC(h,b,S)}}function _d(o,u,h,m){Lr[Ls++]=o,Lr[Ls++]=u,Lr[Ls++]=h,Lr[Ls++]=m,u0|=m,o.lanes|=m,o=o.alternate,o!==null&&(o.lanes|=m)}function c0(o,u,h,m){return _d(o,u,h,m),Nd(o)}function ho(o,u){return _d(o,null,null,u),Nd(o)}function LC(o,u,h){o.lanes|=h;var m=o.alternate;m!==null&&(m.lanes|=h);for(var b=!1,S=o.return;S!==null;)S.childLanes|=h,m=S.alternate,m!==null&&(m.childLanes|=h),S.tag===22&&(o=S.stateNode,o===null||o._visibility&1||(b=!0)),o=S,S=S.return;return o.tag===3?(S=o.stateNode,b&&u!==null&&(b=31-pr(h),o=S.hiddenUpdates,m=o[b],m===null?o[b]=[u]:m.push(u),u.lane=h|536870912),S):null}function Nd(o){if(50<lf)throw lf=0,bb=null,Error(r(185));for(var u=o.return;u!==null;)o=u,u=o.return;return o.tag===3?o.stateNode:null}var js={};function UH(o,u,h,m){this.tag=o,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gr(o,u,h,m){return new UH(o,u,h,m)}function f0(o){return o=o.prototype,!(!o||!o.isReactComponent)}function ca(o,u){var h=o.alternate;return h===null?(h=gr(o.tag,u,o.key,o.mode),h.elementType=o.elementType,h.type=o.type,h.stateNode=o.stateNode,h.alternate=o,o.alternate=h):(h.pendingProps=u,h.type=o.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=o.flags&65011712,h.childLanes=o.childLanes,h.lanes=o.lanes,h.child=o.child,h.memoizedProps=o.memoizedProps,h.memoizedState=o.memoizedState,h.updateQueue=o.updateQueue,u=o.dependencies,h.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},h.sibling=o.sibling,h.index=o.index,h.ref=o.ref,h.refCleanup=o.refCleanup,h}function jC(o,u){o.flags&=65011714;var h=o.alternate;return h===null?(o.childLanes=0,o.lanes=u,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=h.childLanes,o.lanes=h.lanes,o.child=h.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=h.memoizedProps,o.memoizedState=h.memoizedState,o.updateQueue=h.updateQueue,o.type=h.type,u=h.dependencies,o.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),o}function Id(o,u,h,m,b,S){var C=0;if(m=o,typeof o=="function")f0(o)&&(C=1);else if(typeof o=="string")C=KU(o,h,le.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case H:return o=gr(31,h,u,b),o.elementType=H,o.lanes=S,o;case x:return po(h.children,b,S,u);case w:C=8,b|=24;break;case A:return o=gr(12,h,u,b|2),o.elementType=A,o.lanes=S,o;case T:return o=gr(13,h,u,b),o.elementType=T,o.lanes=S,o;case M:return o=gr(19,h,u,b),o.elementType=M,o.lanes=S,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case E:C=10;break e;case k:C=9;break e;case P:C=11;break e;case R:C=14;break e;case L:C=16,m=null;break e}C=29,h=Error(r(130,o===null?"null":typeof o,"")),m=null}return u=gr(C,h,u,b),u.elementType=o,u.type=m,u.lanes=S,u}function po(o,u,h,m){return o=gr(7,o,m,u),o.lanes=h,o}function h0(o,u,h){return o=gr(6,o,null,u),o.lanes=h,o}function BC(o){var u=gr(18,null,null,0);return u.stateNode=o,u}function d0(o,u,h){return u=gr(4,o.children!==null?o.children:[],o.key,u),u.lanes=h,u.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},u}var zC=new WeakMap;function jr(o,u){if(typeof o=="object"&&o!==null){var h=zC.get(o);return h!==void 0?h:(u={value:o,source:u,stack:la(u)},zC.set(o,u),u)}return{value:o,source:u,stack:la(u)}}var Bs=[],zs=0,Ld=null,Bc=0,Br=[],zr=0,ll=null,Ci=1,Ei="";function fa(o,u){Bs[zs++]=Bc,Bs[zs++]=Ld,Ld=o,Bc=u}function $C(o,u,h){Br[zr++]=Ci,Br[zr++]=Ei,Br[zr++]=ll,ll=o;var m=Ci;o=Ei;var b=32-pr(m)-1;m&=~(1<<b),h+=1;var S=32-pr(u)+b;if(30<S){var C=b-b%5;S=(m&(1<<C)-1).toString(32),m>>=C,b-=C,Ci=1<<32-pr(u)+b|h<<b|m,Ei=S+o}else Ci=1<<S|h<<b|m,Ei=o}function p0(o){o.return!==null&&(fa(o,1),$C(o,1,0))}function m0(o){for(;o===Ld;)Ld=Bs[--zs],Bs[zs]=null,Bc=Bs[--zs],Bs[zs]=null;for(;o===ll;)ll=Br[--zr],Br[zr]=null,Ei=Br[--zr],Br[zr]=null,Ci=Br[--zr],Br[zr]=null}function HC(o,u){Br[zr++]=Ci,Br[zr++]=Ei,Br[zr++]=ll,Ci=u.id,Ei=u.overflow,ll=o}var mn=null,vt=null,Fe=!1,ol=null,$r=!1,g0=Error(r(519));function sl(o){var u=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw zc(jr(u,o)),g0}function UC(o){var u=o.stateNode,h=o.type,m=o.memoizedProps;switch(u[pn]=o,u[Xn]=m,h){case"dialog":Be("cancel",u),Be("close",u);break;case"iframe":case"object":case"embed":Be("load",u);break;case"video":case"audio":for(h=0;h<sf.length;h++)Be(sf[h],u);break;case"source":Be("error",u);break;case"img":case"image":case"link":Be("error",u),Be("load",u);break;case"details":Be("toggle",u);break;case"input":Be("invalid",u),tC(u,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":Be("invalid",u);break;case"textarea":Be("invalid",u),rC(u,m.value,m.defaultValue,m.children)}h=m.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||u.textContent===""+h||m.suppressHydrationWarning===!0||a2(u.textContent,h)?(m.popover!=null&&(Be("beforetoggle",u),Be("toggle",u)),m.onScroll!=null&&Be("scroll",u),m.onScrollEnd!=null&&Be("scrollend",u),m.onClick!=null&&(u.onclick=sa),u=!0):u=!1,u||sl(o,!0)}function FC(o){for(mn=o.return;mn;)switch(mn.tag){case 5:case 31:case 13:$r=!1;return;case 27:case 3:$r=!0;return;default:mn=mn.return}}function $s(o){if(o!==mn)return!1;if(!Fe)return FC(o),Fe=!0,!1;var u=o.tag,h;if((h=u!==3&&u!==27)&&((h=u===5)&&(h=o.type,h=!(h!=="form"&&h!=="button")||Nb(o.type,o.memoizedProps)),h=!h),h&&vt&&sl(o),FC(o),u===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));vt=p2(o)}else if(u===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));vt=p2(o)}else u===27?(u=vt,wl(o.type)?(o=zb,zb=null,vt=o):vt=u):vt=mn?Ur(o.stateNode.nextSibling):null;return!0}function mo(){vt=mn=null,Fe=!1}function v0(){var o=ol;return o!==null&&(Jn===null?Jn=o:Jn.push.apply(Jn,o),ol=null),o}function zc(o){ol===null?ol=[o]:ol.push(o)}var y0=N(null),go=null,ha=null;function ul(o,u,h){re(y0,u._currentValue),u._currentValue=h}function da(o){o._currentValue=y0.current,X(y0)}function b0(o,u,h){for(;o!==null;){var m=o.alternate;if((o.childLanes&u)!==u?(o.childLanes|=u,m!==null&&(m.childLanes|=u)):m!==null&&(m.childLanes&u)!==u&&(m.childLanes|=u),o===h)break;o=o.return}}function x0(o,u,h,m){var b=o.child;for(b!==null&&(b.return=o);b!==null;){var S=b.dependencies;if(S!==null){var C=b.child;S=S.firstContext;e:for(;S!==null;){var D=S;S=b;for(var I=0;I<u.length;I++)if(D.context===u[I]){S.lanes|=h,D=S.alternate,D!==null&&(D.lanes|=h),b0(S.return,h,o),m||(C=null);break e}S=D.next}}else if(b.tag===18){if(C=b.return,C===null)throw Error(r(341));C.lanes|=h,S=C.alternate,S!==null&&(S.lanes|=h),b0(C,h,o),C=null}else C=b.child;if(C!==null)C.return=b;else for(C=b;C!==null;){if(C===o){C=null;break}if(b=C.sibling,b!==null){b.return=C.return,C=b;break}C=C.return}b=C}}function Hs(o,u,h,m){o=null;for(var b=u,S=!1;b!==null;){if(!S){if((b.flags&524288)!==0)S=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var C=b.alternate;if(C===null)throw Error(r(387));if(C=C.memoizedProps,C!==null){var D=b.type;mr(b.pendingProps.value,C.value)||(o!==null?o.push(D):o=[D])}}else if(b===Pe.current){if(C=b.alternate,C===null)throw Error(r(387));C.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(o!==null?o.push(df):o=[df])}b=b.return}o!==null&&x0(u,o,h,m),u.flags|=262144}function jd(o){for(o=o.firstContext;o!==null;){if(!mr(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function vo(o){go=o,ha=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function gn(o){return qC(go,o)}function Bd(o,u){return go===null&&vo(o),qC(o,u)}function qC(o,u){var h=u._currentValue;if(u={context:u,memoizedValue:h,next:null},ha===null){if(o===null)throw Error(r(308));ha=u,o.dependencies={lanes:0,firstContext:u},o.flags|=524288}else ha=ha.next=u;return h}var FH=typeof AbortController<"u"?AbortController:function(){var o=[],u=this.signal={aborted:!1,addEventListener:function(h,m){o.push(m)}};this.abort=function(){u.aborted=!0,o.forEach(function(h){return h()})}},qH=e.unstable_scheduleCallback,WH=e.unstable_NormalPriority,zt={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function S0(){return{controller:new FH,data:new Map,refCount:0}}function $c(o){o.refCount--,o.refCount===0&&qH(WH,function(){o.controller.abort()})}var Hc=null,w0=0,Us=0,Fs=null;function VH(o,u){if(Hc===null){var h=Hc=[];w0=0,Us=kb(),Fs={status:"pending",value:void 0,then:function(m){h.push(m)}}}return w0++,u.then(WC,WC),u}function WC(){if(--w0===0&&Hc!==null){Fs!==null&&(Fs.status="fulfilled");var o=Hc;Hc=null,Us=0,Fs=null;for(var u=0;u<o.length;u++)(0,o[u])()}}function KH(o,u){var h=[],m={status:"pending",value:null,reason:null,then:function(b){h.push(b)}};return o.then(function(){m.status="fulfilled",m.value=u;for(var b=0;b<h.length;b++)(0,h[b])(u)},function(b){for(m.status="rejected",m.reason=b,b=0;b<h.length;b++)(0,h[b])(void 0)}),m}var VC=z.S;z.S=function(o,u){MT=hr(),typeof u=="object"&&u!==null&&typeof u.then=="function"&&VH(o,u),VC!==null&&VC(o,u)};var yo=N(null);function O0(){var o=yo.current;return o!==null?o:ut.pooledCache}function zd(o,u){u===null?re(yo,yo.current):re(yo,u.pool)}function KC(){var o=O0();return o===null?null:{parent:zt._currentValue,pool:o}}var qs=Error(r(460)),A0=Error(r(474)),$d=Error(r(542)),Hd={then:function(){}};function XC(o){return o=o.status,o==="fulfilled"||o==="rejected"}function QC(o,u,h){switch(h=o[h],h===void 0?o.push(u):h!==u&&(u.then(sa,sa),u=h),u.status){case"fulfilled":return u.value;case"rejected":throw o=u.reason,GC(o),o;default:if(typeof u.status=="string")u.then(sa,sa);else{if(o=ut,o!==null&&100<o.shellSuspendCounter)throw Error(r(482));o=u,o.status="pending",o.then(function(m){if(u.status==="pending"){var b=u;b.status="fulfilled",b.value=m}},function(m){if(u.status==="pending"){var b=u;b.status="rejected",b.reason=m}})}switch(u.status){case"fulfilled":return u.value;case"rejected":throw o=u.reason,GC(o),o}throw xo=u,qs}}function bo(o){try{var u=o._init;return u(o._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(xo=h,qs):h}}var xo=null;function YC(){if(xo===null)throw Error(r(459));var o=xo;return xo=null,o}function GC(o){if(o===qs||o===$d)throw Error(r(483))}var Ws=null,Uc=0;function Ud(o){var u=Uc;return Uc+=1,Ws===null&&(Ws=[]),QC(Ws,o,u)}function Fc(o,u){u=u.props.ref,o.ref=u!==void 0?u:null}function Fd(o,u){throw u.$$typeof===g?Error(r(525)):(o=Object.prototype.toString.call(u),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":o)))}function ZC(o){function u($,j){if(o){var U=$.deletions;U===null?($.deletions=[j],$.flags|=16):U.push(j)}}function h($,j){if(!o)return null;for(;j!==null;)u($,j),j=j.sibling;return null}function m($){for(var j=new Map;$!==null;)$.key!==null?j.set($.key,$):j.set($.index,$),$=$.sibling;return j}function b($,j){return $=ca($,j),$.index=0,$.sibling=null,$}function S($,j,U){return $.index=U,o?(U=$.alternate,U!==null?(U=U.index,U<j?($.flags|=67108866,j):U):($.flags|=67108866,j)):($.flags|=1048576,j)}function C($){return o&&$.alternate===null&&($.flags|=67108866),$}function D($,j,U,ee){return j===null||j.tag!==6?(j=h0(U,$.mode,ee),j.return=$,j):(j=b(j,U),j.return=$,j)}function I($,j,U,ee){var Ae=U.type;return Ae===x?Z($,j,U.props.children,ee,U.key):j!==null&&(j.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===L&&bo(Ae)===j.type)?(j=b(j,U.props),Fc(j,U),j.return=$,j):(j=Id(U.type,U.key,U.props,null,$.mode,ee),Fc(j,U),j.return=$,j)}function F($,j,U,ee){return j===null||j.tag!==4||j.stateNode.containerInfo!==U.containerInfo||j.stateNode.implementation!==U.implementation?(j=d0(U,$.mode,ee),j.return=$,j):(j=b(j,U.children||[]),j.return=$,j)}function Z($,j,U,ee,Ae){return j===null||j.tag!==7?(j=po(U,$.mode,ee,Ae),j.return=$,j):(j=b(j,U),j.return=$,j)}function te($,j,U){if(typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint")return j=h0(""+j,$.mode,U),j.return=$,j;if(typeof j=="object"&&j!==null){switch(j.$$typeof){case v:return U=Id(j.type,j.key,j.props,null,$.mode,U),Fc(U,j),U.return=$,U;case y:return j=d0(j,$.mode,U),j.return=$,j;case L:return j=bo(j),te($,j,U)}if(oe(j)||B(j))return j=po(j,$.mode,U,null),j.return=$,j;if(typeof j.then=="function")return te($,Ud(j),U);if(j.$$typeof===E)return te($,Bd($,j),U);Fd($,j)}return null}function W($,j,U,ee){var Ae=j!==null?j.key:null;if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return Ae!==null?null:D($,j,""+U,ee);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case v:return U.key===Ae?I($,j,U,ee):null;case y:return U.key===Ae?F($,j,U,ee):null;case L:return U=bo(U),W($,j,U,ee)}if(oe(U)||B(U))return Ae!==null?null:Z($,j,U,ee,null);if(typeof U.then=="function")return W($,j,Ud(U),ee);if(U.$$typeof===E)return W($,j,Bd($,U),ee);Fd($,U)}return null}function Q($,j,U,ee,Ae){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return $=$.get(U)||null,D(j,$,""+ee,Ae);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case v:return $=$.get(ee.key===null?U:ee.key)||null,I(j,$,ee,Ae);case y:return $=$.get(ee.key===null?U:ee.key)||null,F(j,$,ee,Ae);case L:return ee=bo(ee),Q($,j,U,ee,Ae)}if(oe(ee)||B(ee))return $=$.get(U)||null,Z(j,$,ee,Ae,null);if(typeof ee.then=="function")return Q($,j,U,Ud(ee),Ae);if(ee.$$typeof===E)return Q($,j,U,Bd(j,ee),Ae);Fd(j,ee)}return null}function ye($,j,U,ee){for(var Ae=null,Xe=null,Se=j,Ie=j=0,He=null;Se!==null&&Ie<U.length;Ie++){Se.index>Ie?(He=Se,Se=null):He=Se.sibling;var Qe=W($,Se,U[Ie],ee);if(Qe===null){Se===null&&(Se=He);break}o&&Se&&Qe.alternate===null&&u($,Se),j=S(Qe,j,Ie),Xe===null?Ae=Qe:Xe.sibling=Qe,Xe=Qe,Se=He}if(Ie===U.length)return h($,Se),Fe&&fa($,Ie),Ae;if(Se===null){for(;Ie<U.length;Ie++)Se=te($,U[Ie],ee),Se!==null&&(j=S(Se,j,Ie),Xe===null?Ae=Se:Xe.sibling=Se,Xe=Se);return Fe&&fa($,Ie),Ae}for(Se=m(Se);Ie<U.length;Ie++)He=Q(Se,$,Ie,U[Ie],ee),He!==null&&(o&&He.alternate!==null&&Se.delete(He.key===null?Ie:He.key),j=S(He,j,Ie),Xe===null?Ae=He:Xe.sibling=He,Xe=He);return o&&Se.forEach(function(El){return u($,El)}),Fe&&fa($,Ie),Ae}function Me($,j,U,ee){if(U==null)throw Error(r(151));for(var Ae=null,Xe=null,Se=j,Ie=j=0,He=null,Qe=U.next();Se!==null&&!Qe.done;Ie++,Qe=U.next()){Se.index>Ie?(He=Se,Se=null):He=Se.sibling;var El=W($,Se,Qe.value,ee);if(El===null){Se===null&&(Se=He);break}o&&Se&&El.alternate===null&&u($,Se),j=S(El,j,Ie),Xe===null?Ae=El:Xe.sibling=El,Xe=El,Se=He}if(Qe.done)return h($,Se),Fe&&fa($,Ie),Ae;if(Se===null){for(;!Qe.done;Ie++,Qe=U.next())Qe=te($,Qe.value,ee),Qe!==null&&(j=S(Qe,j,Ie),Xe===null?Ae=Qe:Xe.sibling=Qe,Xe=Qe);return Fe&&fa($,Ie),Ae}for(Se=m(Se);!Qe.done;Ie++,Qe=U.next())Qe=Q(Se,$,Ie,Qe.value,ee),Qe!==null&&(o&&Qe.alternate!==null&&Se.delete(Qe.key===null?Ie:Qe.key),j=S(Qe,j,Ie),Xe===null?Ae=Qe:Xe.sibling=Qe,Xe=Qe);return o&&Se.forEach(function(i9){return u($,i9)}),Fe&&fa($,Ie),Ae}function at($,j,U,ee){if(typeof U=="object"&&U!==null&&U.type===x&&U.key===null&&(U=U.props.children),typeof U=="object"&&U!==null){switch(U.$$typeof){case v:e:{for(var Ae=U.key;j!==null;){if(j.key===Ae){if(Ae=U.type,Ae===x){if(j.tag===7){h($,j.sibling),ee=b(j,U.props.children),ee.return=$,$=ee;break e}}else if(j.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===L&&bo(Ae)===j.type){h($,j.sibling),ee=b(j,U.props),Fc(ee,U),ee.return=$,$=ee;break e}h($,j);break}else u($,j);j=j.sibling}U.type===x?(ee=po(U.props.children,$.mode,ee,U.key),ee.return=$,$=ee):(ee=Id(U.type,U.key,U.props,null,$.mode,ee),Fc(ee,U),ee.return=$,$=ee)}return C($);case y:e:{for(Ae=U.key;j!==null;){if(j.key===Ae)if(j.tag===4&&j.stateNode.containerInfo===U.containerInfo&&j.stateNode.implementation===U.implementation){h($,j.sibling),ee=b(j,U.children||[]),ee.return=$,$=ee;break e}else{h($,j);break}else u($,j);j=j.sibling}ee=d0(U,$.mode,ee),ee.return=$,$=ee}return C($);case L:return U=bo(U),at($,j,U,ee)}if(oe(U))return ye($,j,U,ee);if(B(U)){if(Ae=B(U),typeof Ae!="function")throw Error(r(150));return U=Ae.call(U),Me($,j,U,ee)}if(typeof U.then=="function")return at($,j,Ud(U),ee);if(U.$$typeof===E)return at($,j,Bd($,U),ee);Fd($,U)}return typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint"?(U=""+U,j!==null&&j.tag===6?(h($,j.sibling),ee=b(j,U),ee.return=$,$=ee):(h($,j),ee=h0(U,$.mode,ee),ee.return=$,$=ee),C($)):h($,j)}return function($,j,U,ee){try{Uc=0;var Ae=at($,j,U,ee);return Ws=null,Ae}catch(Se){if(Se===qs||Se===$d)throw Se;var Xe=gr(29,Se,null,$.mode);return Xe.lanes=ee,Xe.return=$,Xe}}}var So=ZC(!0),JC=ZC(!1),cl=!1;function k0(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function C0(o,u){o=o.updateQueue,u.updateQueue===o&&(u.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function fl(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function hl(o,u,h){var m=o.updateQueue;if(m===null)return null;if(m=m.shared,(Ze&2)!==0){var b=m.pending;return b===null?u.next=u:(u.next=b.next,b.next=u),m.pending=u,u=Nd(o),LC(o,null,h),u}return _d(o,m,u,h),Nd(o)}function qc(o,u,h){if(u=u.updateQueue,u!==null&&(u=u.shared,(h&4194048)!==0)){var m=u.lanes;m&=o.pendingLanes,h|=m,u.lanes=h,qk(o,h)}}function E0(o,u){var h=o.updateQueue,m=o.alternate;if(m!==null&&(m=m.updateQueue,h===m)){var b=null,S=null;if(h=h.firstBaseUpdate,h!==null){do{var C={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};S===null?b=S=C:S=S.next=C,h=h.next}while(h!==null);S===null?b=S=u:S=S.next=u}else b=S=u;h={baseState:m.baseState,firstBaseUpdate:b,lastBaseUpdate:S,shared:m.shared,callbacks:m.callbacks},o.updateQueue=h;return}o=h.lastBaseUpdate,o===null?h.firstBaseUpdate=u:o.next=u,h.lastBaseUpdate=u}var T0=!1;function Wc(){if(T0){var o=Fs;if(o!==null)throw o}}function Vc(o,u,h,m){T0=!1;var b=o.updateQueue;cl=!1;var S=b.firstBaseUpdate,C=b.lastBaseUpdate,D=b.shared.pending;if(D!==null){b.shared.pending=null;var I=D,F=I.next;I.next=null,C===null?S=F:C.next=F,C=I;var Z=o.alternate;Z!==null&&(Z=Z.updateQueue,D=Z.lastBaseUpdate,D!==C&&(D===null?Z.firstBaseUpdate=F:D.next=F,Z.lastBaseUpdate=I))}if(S!==null){var te=b.baseState;C=0,Z=F=I=null,D=S;do{var W=D.lane&-536870913,Q=W!==D.lane;if(Q?($e&W)===W:(m&W)===W){W!==0&&W===Us&&(T0=!0),Z!==null&&(Z=Z.next={lane:0,tag:D.tag,payload:D.payload,callback:null,next:null});e:{var ye=o,Me=D;W=u;var at=h;switch(Me.tag){case 1:if(ye=Me.payload,typeof ye=="function"){te=ye.call(at,te,W);break e}te=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=Me.payload,W=typeof ye=="function"?ye.call(at,te,W):ye,W==null)break e;te=p({},te,W);break e;case 2:cl=!0}}W=D.callback,W!==null&&(o.flags|=64,Q&&(o.flags|=8192),Q=b.callbacks,Q===null?b.callbacks=[W]:Q.push(W))}else Q={lane:W,tag:D.tag,payload:D.payload,callback:D.callback,next:null},Z===null?(F=Z=Q,I=te):Z=Z.next=Q,C|=W;if(D=D.next,D===null){if(D=b.shared.pending,D===null)break;Q=D,D=Q.next,Q.next=null,b.lastBaseUpdate=Q,b.shared.pending=null}}while(!0);Z===null&&(I=te),b.baseState=I,b.firstBaseUpdate=F,b.lastBaseUpdate=Z,S===null&&(b.shared.lanes=0),vl|=C,o.lanes=C,o.memoizedState=te}}function eE(o,u){if(typeof o!="function")throw Error(r(191,o));o.call(u)}function tE(o,u){var h=o.callbacks;if(h!==null)for(o.callbacks=null,o=0;o<h.length;o++)eE(h[o],u)}var Vs=N(null),qd=N(0);function nE(o,u){o=wa,re(qd,o),re(Vs,u),wa=o|u.baseLanes}function M0(){re(qd,wa),re(Vs,Vs.current)}function P0(){wa=qd.current,X(Vs),X(qd)}var vr=N(null),Hr=null;function dl(o){var u=o.alternate;re(Nt,Nt.current&1),re(vr,o),Hr===null&&(u===null||Vs.current!==null||u.memoizedState!==null)&&(Hr=o)}function D0(o){re(Nt,Nt.current),re(vr,o),Hr===null&&(Hr=o)}function rE(o){o.tag===22?(re(Nt,Nt.current),re(vr,o),Hr===null&&(Hr=o)):pl()}function pl(){re(Nt,Nt.current),re(vr,vr.current)}function yr(o){X(vr),Hr===o&&(Hr=null),X(Nt)}var Nt=N(0);function Wd(o){for(var u=o;u!==null;){if(u.tag===13){var h=u.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||jb(h)||Bb(h)))return u}else if(u.tag===19&&(u.memoizedProps.revealOrder==="forwards"||u.memoizedProps.revealOrder==="backwards"||u.memoizedProps.revealOrder==="unstable_legacy-backwards"||u.memoizedProps.revealOrder==="together")){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===o)break;for(;u.sibling===null;){if(u.return===null||u.return===o)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var pa=0,Ne=null,rt=null,$t=null,Vd=!1,Ks=!1,wo=!1,Kd=0,Kc=0,Xs=null,XH=0;function Et(){throw Error(r(321))}function R0(o,u){if(u===null)return!1;for(var h=0;h<u.length&&h<o.length;h++)if(!mr(o[h],u[h]))return!1;return!0}function _0(o,u,h,m,b,S){return pa=S,Ne=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,z.H=o===null||o.memoizedState===null?$E:X0,wo=!1,S=h(m,b),wo=!1,Ks&&(S=aE(u,h,m,b)),iE(o),S}function iE(o){z.H=Yc;var u=rt!==null&&rt.next!==null;if(pa=0,$t=rt=Ne=null,Vd=!1,Kc=0,Xs=null,u)throw Error(r(300));o===null||Ht||(o=o.dependencies,o!==null&&jd(o)&&(Ht=!0))}function aE(o,u,h,m){Ne=o;var b=0;do{if(Ks&&(Xs=null),Kc=0,Ks=!1,25<=b)throw Error(r(301));if(b+=1,$t=rt=null,o.updateQueue!=null){var S=o.updateQueue;S.lastEffect=null,S.events=null,S.stores=null,S.memoCache!=null&&(S.memoCache.index=0)}z.H=HE,S=u(h,m)}while(Ks);return S}function QH(){var o=z.H,u=o.useState()[0];return u=typeof u.then=="function"?Xc(u):u,o=o.useState()[0],(rt!==null?rt.memoizedState:null)!==o&&(Ne.flags|=1024),u}function N0(){var o=Kd!==0;return Kd=0,o}function I0(o,u,h){u.updateQueue=o.updateQueue,u.flags&=-2053,o.lanes&=~h}function L0(o){if(Vd){for(o=o.memoizedState;o!==null;){var u=o.queue;u!==null&&(u.pending=null),o=o.next}Vd=!1}pa=0,$t=rt=Ne=null,Ks=!1,Kc=Kd=0,Xs=null}function zn(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $t===null?Ne.memoizedState=$t=o:$t=$t.next=o,$t}function It(){if(rt===null){var o=Ne.alternate;o=o!==null?o.memoizedState:null}else o=rt.next;var u=$t===null?Ne.memoizedState:$t.next;if(u!==null)$t=u,rt=o;else{if(o===null)throw Ne.alternate===null?Error(r(467)):Error(r(310));rt=o,o={memoizedState:rt.memoizedState,baseState:rt.baseState,baseQueue:rt.baseQueue,queue:rt.queue,next:null},$t===null?Ne.memoizedState=$t=o:$t=$t.next=o}return $t}function Xd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Xc(o){var u=Kc;return Kc+=1,Xs===null&&(Xs=[]),o=QC(Xs,o,u),u=Ne,($t===null?u.memoizedState:$t.next)===null&&(u=u.alternate,z.H=u===null||u.memoizedState===null?$E:X0),o}function Qd(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return Xc(o);if(o.$$typeof===E)return gn(o)}throw Error(r(438,String(o)))}function j0(o){var u=null,h=Ne.updateQueue;if(h!==null&&(u=h.memoCache),u==null){var m=Ne.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(u={data:m.data.map(function(b){return b.slice()}),index:0})))}if(u==null&&(u={data:[],index:0}),h===null&&(h=Xd(),Ne.updateQueue=h),h.memoCache=u,h=u.data[u.index],h===void 0)for(h=u.data[u.index]=Array(o),m=0;m<o;m++)h[m]=K;return u.index++,h}function ma(o,u){return typeof u=="function"?u(o):u}function Yd(o){var u=It();return B0(u,rt,o)}function B0(o,u,h){var m=o.queue;if(m===null)throw Error(r(311));m.lastRenderedReducer=h;var b=o.baseQueue,S=m.pending;if(S!==null){if(b!==null){var C=b.next;b.next=S.next,S.next=C}u.baseQueue=b=S,m.pending=null}if(S=o.baseState,b===null)o.memoizedState=S;else{u=b.next;var D=C=null,I=null,F=u,Z=!1;do{var te=F.lane&-536870913;if(te!==F.lane?($e&te)===te:(pa&te)===te){var W=F.revertLane;if(W===0)I!==null&&(I=I.next={lane:0,revertLane:0,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),te===Us&&(Z=!0);else if((pa&W)===W){F=F.next,W===Us&&(Z=!0);continue}else te={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},I===null?(D=I=te,C=S):I=I.next=te,Ne.lanes|=W,vl|=W;te=F.action,wo&&h(S,te),S=F.hasEagerState?F.eagerState:h(S,te)}else W={lane:te,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},I===null?(D=I=W,C=S):I=I.next=W,Ne.lanes|=te,vl|=te;F=F.next}while(F!==null&&F!==u);if(I===null?C=S:I.next=D,!mr(S,o.memoizedState)&&(Ht=!0,Z&&(h=Fs,h!==null)))throw h;o.memoizedState=S,o.baseState=C,o.baseQueue=I,m.lastRenderedState=S}return b===null&&(m.lanes=0),[o.memoizedState,m.dispatch]}function z0(o){var u=It(),h=u.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=o;var m=h.dispatch,b=h.pending,S=u.memoizedState;if(b!==null){h.pending=null;var C=b=b.next;do S=o(S,C.action),C=C.next;while(C!==b);mr(S,u.memoizedState)||(Ht=!0),u.memoizedState=S,u.baseQueue===null&&(u.baseState=S),h.lastRenderedState=S}return[S,m]}function lE(o,u,h){var m=Ne,b=It(),S=Fe;if(S){if(h===void 0)throw Error(r(407));h=h()}else h=u();var C=!mr((rt||b).memoizedState,h);if(C&&(b.memoizedState=h,Ht=!0),b=b.queue,U0(uE.bind(null,m,b,o),[o]),b.getSnapshot!==u||C||$t!==null&&$t.memoizedState.tag&1){if(m.flags|=2048,Qs(9,{destroy:void 0},sE.bind(null,m,b,h,u),null),ut===null)throw Error(r(349));S||(pa&127)!==0||oE(m,u,h)}return h}function oE(o,u,h){o.flags|=16384,o={getSnapshot:u,value:h},u=Ne.updateQueue,u===null?(u=Xd(),Ne.updateQueue=u,u.stores=[o]):(h=u.stores,h===null?u.stores=[o]:h.push(o))}function sE(o,u,h,m){u.value=h,u.getSnapshot=m,cE(u)&&fE(o)}function uE(o,u,h){return h(function(){cE(u)&&fE(o)})}function cE(o){var u=o.getSnapshot;o=o.value;try{var h=u();return!mr(o,h)}catch{return!0}}function fE(o){var u=ho(o,2);u!==null&&er(u,o,2)}function $0(o){var u=zn();if(typeof o=="function"){var h=o;if(o=h(),wo){rl(!0);try{h()}finally{rl(!1)}}}return u.memoizedState=u.baseState=o,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:o},u}function hE(o,u,h,m){return o.baseState=h,B0(o,rt,typeof m=="function"?m:ma)}function YH(o,u,h,m,b){if(Jd(o))throw Error(r(485));if(o=u.action,o!==null){var S={payload:b,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(C){S.listeners.push(C)}};z.T!==null?h(!0):S.isTransition=!1,m(S),h=u.pending,h===null?(S.next=u.pending=S,dE(u,S)):(S.next=h.next,u.pending=h.next=S)}}function dE(o,u){var h=u.action,m=u.payload,b=o.state;if(u.isTransition){var S=z.T,C={};z.T=C;try{var D=h(b,m),I=z.S;I!==null&&I(C,D),pE(o,u,D)}catch(F){H0(o,u,F)}finally{S!==null&&C.types!==null&&(S.types=C.types),z.T=S}}else try{S=h(b,m),pE(o,u,S)}catch(F){H0(o,u,F)}}function pE(o,u,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(m){mE(o,u,m)},function(m){return H0(o,u,m)}):mE(o,u,h)}function mE(o,u,h){u.status="fulfilled",u.value=h,gE(u),o.state=h,u=o.pending,u!==null&&(h=u.next,h===u?o.pending=null:(h=h.next,u.next=h,dE(o,h)))}function H0(o,u,h){var m=o.pending;if(o.pending=null,m!==null){m=m.next;do u.status="rejected",u.reason=h,gE(u),u=u.next;while(u!==m)}o.action=null}function gE(o){o=o.listeners;for(var u=0;u<o.length;u++)(0,o[u])()}function vE(o,u){return u}function yE(o,u){if(Fe){var h=ut.formState;if(h!==null){e:{var m=Ne;if(Fe){if(vt){t:{for(var b=vt,S=$r;b.nodeType!==8;){if(!S){b=null;break t}if(b=Ur(b.nextSibling),b===null){b=null;break t}}S=b.data,b=S==="F!"||S==="F"?b:null}if(b){vt=Ur(b.nextSibling),m=b.data==="F!";break e}}sl(m)}m=!1}m&&(u=h[0])}}return h=zn(),h.memoizedState=h.baseState=u,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vE,lastRenderedState:u},h.queue=m,h=jE.bind(null,Ne,m),m.dispatch=h,m=$0(!1),S=K0.bind(null,Ne,!1,m.queue),m=zn(),b={state:u,dispatch:null,action:o,pending:null},m.queue=b,h=YH.bind(null,Ne,b,S,h),b.dispatch=h,m.memoizedState=o,[u,h,!1]}function bE(o){var u=It();return xE(u,rt,o)}function xE(o,u,h){if(u=B0(o,u,vE)[0],o=Yd(ma)[0],typeof u=="object"&&u!==null&&typeof u.then=="function")try{var m=Xc(u)}catch(C){throw C===qs?$d:C}else m=u;u=It();var b=u.queue,S=b.dispatch;return h!==u.memoizedState&&(Ne.flags|=2048,Qs(9,{destroy:void 0},GH.bind(null,b,h),null)),[m,S,o]}function GH(o,u){o.action=u}function SE(o){var u=It(),h=rt;if(h!==null)return xE(u,h,o);It(),u=u.memoizedState,h=It();var m=h.queue.dispatch;return h.memoizedState=o,[u,m,!1]}function Qs(o,u,h,m){return o={tag:o,create:h,deps:m,inst:u,next:null},u=Ne.updateQueue,u===null&&(u=Xd(),Ne.updateQueue=u),h=u.lastEffect,h===null?u.lastEffect=o.next=o:(m=h.next,h.next=o,o.next=m,u.lastEffect=o),o}function wE(){return It().memoizedState}function Gd(o,u,h,m){var b=zn();Ne.flags|=o,b.memoizedState=Qs(1|u,{destroy:void 0},h,m===void 0?null:m)}function Zd(o,u,h,m){var b=It();m=m===void 0?null:m;var S=b.memoizedState.inst;rt!==null&&m!==null&&R0(m,rt.memoizedState.deps)?b.memoizedState=Qs(u,S,h,m):(Ne.flags|=o,b.memoizedState=Qs(1|u,S,h,m))}function OE(o,u){Gd(8390656,8,o,u)}function U0(o,u){Zd(2048,8,o,u)}function ZH(o){Ne.flags|=4;var u=Ne.updateQueue;if(u===null)u=Xd(),Ne.updateQueue=u,u.events=[o];else{var h=u.events;h===null?u.events=[o]:h.push(o)}}function AE(o){var u=It().memoizedState;return ZH({ref:u,nextImpl:o}),function(){if((Ze&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}function kE(o,u){return Zd(4,2,o,u)}function CE(o,u){return Zd(4,4,o,u)}function EE(o,u){if(typeof u=="function"){o=o();var h=u(o);return function(){typeof h=="function"?h():u(null)}}if(u!=null)return o=o(),u.current=o,function(){u.current=null}}function TE(o,u,h){h=h!=null?h.concat([o]):null,Zd(4,4,EE.bind(null,u,o),h)}function F0(){}function ME(o,u){var h=It();u=u===void 0?null:u;var m=h.memoizedState;return u!==null&&R0(u,m[1])?m[0]:(h.memoizedState=[o,u],o)}function PE(o,u){var h=It();u=u===void 0?null:u;var m=h.memoizedState;if(u!==null&&R0(u,m[1]))return m[0];if(m=o(),wo){rl(!0);try{o()}finally{rl(!1)}}return h.memoizedState=[m,u],m}function q0(o,u,h){return h===void 0||(pa&1073741824)!==0&&($e&261930)===0?o.memoizedState=u:(o.memoizedState=h,o=DT(),Ne.lanes|=o,vl|=o,h)}function DE(o,u,h,m){return mr(h,u)?h:Vs.current!==null?(o=q0(o,h,m),mr(o,u)||(Ht=!0),o):(pa&42)===0||(pa&1073741824)!==0&&($e&261930)===0?(Ht=!0,o.memoizedState=h):(o=DT(),Ne.lanes|=o,vl|=o,u)}function RE(o,u,h,m,b){var S=G.p;G.p=S!==0&&8>S?S:8;var C=z.T,D={};z.T=D,K0(o,!1,u,h);try{var I=b(),F=z.S;if(F!==null&&F(D,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var Z=KH(I,m);Qc(o,u,Z,Sr(o))}else Qc(o,u,m,Sr(o))}catch(te){Qc(o,u,{then:function(){},status:"rejected",reason:te},Sr())}finally{G.p=S,C!==null&&D.types!==null&&(C.types=D.types),z.T=C}}function JH(){}function W0(o,u,h,m){if(o.tag!==5)throw Error(r(476));var b=_E(o).queue;RE(o,b,u,ne,h===null?JH:function(){return NE(o),h(m)})}function _E(o){var u=o.memoizedState;if(u!==null)return u;u={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:ne},next:null};var h={};return u.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:h},next:null},o.memoizedState=u,o=o.alternate,o!==null&&(o.memoizedState=u),u}function NE(o){var u=_E(o);u.next===null&&(u=o.alternate.memoizedState),Qc(o,u.next.queue,{},Sr())}function V0(){return gn(df)}function IE(){return It().memoizedState}function LE(){return It().memoizedState}function eU(o){for(var u=o.return;u!==null;){switch(u.tag){case 24:case 3:var h=Sr();o=fl(h);var m=hl(u,o,h);m!==null&&(er(m,u,h),qc(m,u,h)),u={cache:S0()},o.payload=u;return}u=u.return}}function tU(o,u,h){var m=Sr();h={lane:m,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Jd(o)?BE(u,h):(h=c0(o,u,h,m),h!==null&&(er(h,o,m),zE(h,u,m)))}function jE(o,u,h){var m=Sr();Qc(o,u,h,m)}function Qc(o,u,h,m){var b={lane:m,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(Jd(o))BE(u,b);else{var S=o.alternate;if(o.lanes===0&&(S===null||S.lanes===0)&&(S=u.lastRenderedReducer,S!==null))try{var C=u.lastRenderedState,D=S(C,h);if(b.hasEagerState=!0,b.eagerState=D,mr(D,C))return _d(o,u,b,0),ut===null&&Rd(),!1}catch{}if(h=c0(o,u,b,m),h!==null)return er(h,o,m),zE(h,u,m),!0}return!1}function K0(o,u,h,m){if(m={lane:2,revertLane:kb(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},Jd(o)){if(u)throw Error(r(479))}else u=c0(o,h,m,2),u!==null&&er(u,o,2)}function Jd(o){var u=o.alternate;return o===Ne||u!==null&&u===Ne}function BE(o,u){Ks=Vd=!0;var h=o.pending;h===null?u.next=u:(u.next=h.next,h.next=u),o.pending=u}function zE(o,u,h){if((h&4194048)!==0){var m=u.lanes;m&=o.pendingLanes,h|=m,u.lanes=h,qk(o,h)}}var Yc={readContext:gn,use:Qd,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useLayoutEffect:Et,useInsertionEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useSyncExternalStore:Et,useId:Et,useHostTransitionStatus:Et,useFormState:Et,useActionState:Et,useOptimistic:Et,useMemoCache:Et,useCacheRefresh:Et};Yc.useEffectEvent=Et;var $E={readContext:gn,use:Qd,useCallback:function(o,u){return zn().memoizedState=[o,u===void 0?null:u],o},useContext:gn,useEffect:OE,useImperativeHandle:function(o,u,h){h=h!=null?h.concat([o]):null,Gd(4194308,4,EE.bind(null,u,o),h)},useLayoutEffect:function(o,u){return Gd(4194308,4,o,u)},useInsertionEffect:function(o,u){Gd(4,2,o,u)},useMemo:function(o,u){var h=zn();u=u===void 0?null:u;var m=o();if(wo){rl(!0);try{o()}finally{rl(!1)}}return h.memoizedState=[m,u],m},useReducer:function(o,u,h){var m=zn();if(h!==void 0){var b=h(u);if(wo){rl(!0);try{h(u)}finally{rl(!1)}}}else b=u;return m.memoizedState=m.baseState=b,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:b},m.queue=o,o=o.dispatch=tU.bind(null,Ne,o),[m.memoizedState,o]},useRef:function(o){var u=zn();return o={current:o},u.memoizedState=o},useState:function(o){o=$0(o);var u=o.queue,h=jE.bind(null,Ne,u);return u.dispatch=h,[o.memoizedState,h]},useDebugValue:F0,useDeferredValue:function(o,u){var h=zn();return q0(h,o,u)},useTransition:function(){var o=$0(!1);return o=RE.bind(null,Ne,o.queue,!0,!1),zn().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,u,h){var m=Ne,b=zn();if(Fe){if(h===void 0)throw Error(r(407));h=h()}else{if(h=u(),ut===null)throw Error(r(349));($e&127)!==0||oE(m,u,h)}b.memoizedState=h;var S={value:h,getSnapshot:u};return b.queue=S,OE(uE.bind(null,m,S,o),[o]),m.flags|=2048,Qs(9,{destroy:void 0},sE.bind(null,m,S,h,u),null),h},useId:function(){var o=zn(),u=ut.identifierPrefix;if(Fe){var h=Ei,m=Ci;h=(m&~(1<<32-pr(m)-1)).toString(32)+h,u="_"+u+"R_"+h,h=Kd++,0<h&&(u+="H"+h.toString(32)),u+="_"}else h=XH++,u="_"+u+"r_"+h.toString(32)+"_";return o.memoizedState=u},useHostTransitionStatus:V0,useFormState:yE,useActionState:yE,useOptimistic:function(o){var u=zn();u.memoizedState=u.baseState=o;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return u.queue=h,u=K0.bind(null,Ne,!0,h),h.dispatch=u,[o,u]},useMemoCache:j0,useCacheRefresh:function(){return zn().memoizedState=eU.bind(null,Ne)},useEffectEvent:function(o){var u=zn(),h={impl:o};return u.memoizedState=h,function(){if((Ze&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},X0={readContext:gn,use:Qd,useCallback:ME,useContext:gn,useEffect:U0,useImperativeHandle:TE,useInsertionEffect:kE,useLayoutEffect:CE,useMemo:PE,useReducer:Yd,useRef:wE,useState:function(){return Yd(ma)},useDebugValue:F0,useDeferredValue:function(o,u){var h=It();return DE(h,rt.memoizedState,o,u)},useTransition:function(){var o=Yd(ma)[0],u=It().memoizedState;return[typeof o=="boolean"?o:Xc(o),u]},useSyncExternalStore:lE,useId:IE,useHostTransitionStatus:V0,useFormState:bE,useActionState:bE,useOptimistic:function(o,u){var h=It();return hE(h,rt,o,u)},useMemoCache:j0,useCacheRefresh:LE};X0.useEffectEvent=AE;var HE={readContext:gn,use:Qd,useCallback:ME,useContext:gn,useEffect:U0,useImperativeHandle:TE,useInsertionEffect:kE,useLayoutEffect:CE,useMemo:PE,useReducer:z0,useRef:wE,useState:function(){return z0(ma)},useDebugValue:F0,useDeferredValue:function(o,u){var h=It();return rt===null?q0(h,o,u):DE(h,rt.memoizedState,o,u)},useTransition:function(){var o=z0(ma)[0],u=It().memoizedState;return[typeof o=="boolean"?o:Xc(o),u]},useSyncExternalStore:lE,useId:IE,useHostTransitionStatus:V0,useFormState:SE,useActionState:SE,useOptimistic:function(o,u){var h=It();return rt!==null?hE(h,rt,o,u):(h.baseState=o,[o,h.queue.dispatch])},useMemoCache:j0,useCacheRefresh:LE};HE.useEffectEvent=AE;function Q0(o,u,h,m){u=o.memoizedState,h=h(m,u),h=h==null?u:p({},u,h),o.memoizedState=h,o.lanes===0&&(o.updateQueue.baseState=h)}var Y0={enqueueSetState:function(o,u,h){o=o._reactInternals;var m=Sr(),b=fl(m);b.payload=u,h!=null&&(b.callback=h),u=hl(o,b,m),u!==null&&(er(u,o,m),qc(u,o,m))},enqueueReplaceState:function(o,u,h){o=o._reactInternals;var m=Sr(),b=fl(m);b.tag=1,b.payload=u,h!=null&&(b.callback=h),u=hl(o,b,m),u!==null&&(er(u,o,m),qc(u,o,m))},enqueueForceUpdate:function(o,u){o=o._reactInternals;var h=Sr(),m=fl(h);m.tag=2,u!=null&&(m.callback=u),u=hl(o,m,h),u!==null&&(er(u,o,h),qc(u,o,h))}};function UE(o,u,h,m,b,S,C){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(m,S,C):u.prototype&&u.prototype.isPureReactComponent?!Lc(h,m)||!Lc(b,S):!0}function FE(o,u,h,m){o=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(h,m),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(h,m),u.state!==o&&Y0.enqueueReplaceState(u,u.state,null)}function Oo(o,u){var h=u;if("ref"in u){h={};for(var m in u)m!=="ref"&&(h[m]=u[m])}if(o=o.defaultProps){h===u&&(h=p({},h));for(var b in o)h[b]===void 0&&(h[b]=o[b])}return h}function qE(o){Dd(o)}function WE(o){console.error(o)}function VE(o){Dd(o)}function ep(o,u){try{var h=o.onUncaughtError;h(u.value,{componentStack:u.stack})}catch(m){setTimeout(function(){throw m})}}function KE(o,u,h){try{var m=o.onCaughtError;m(h.value,{componentStack:h.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function G0(o,u,h){return h=fl(h),h.tag=3,h.payload={element:null},h.callback=function(){ep(o,u)},h}function XE(o){return o=fl(o),o.tag=3,o}function QE(o,u,h,m){var b=h.type.getDerivedStateFromError;if(typeof b=="function"){var S=m.value;o.payload=function(){return b(S)},o.callback=function(){KE(u,h,m)}}var C=h.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(o.callback=function(){KE(u,h,m),typeof b!="function"&&(yl===null?yl=new Set([this]):yl.add(this));var D=m.stack;this.componentDidCatch(m.value,{componentStack:D!==null?D:""})})}function nU(o,u,h,m,b){if(h.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(u=h.alternate,u!==null&&Hs(u,h,b,!0),h=vr.current,h!==null){switch(h.tag){case 31:case 13:return Hr===null?hp():h.alternate===null&&Tt===0&&(Tt=3),h.flags&=-257,h.flags|=65536,h.lanes=b,m===Hd?h.flags|=16384:(u=h.updateQueue,u===null?h.updateQueue=new Set([m]):u.add(m),wb(o,m,b)),!1;case 22:return h.flags|=65536,m===Hd?h.flags|=16384:(u=h.updateQueue,u===null?(u={transitions:null,markerInstances:null,retryQueue:new Set([m])},h.updateQueue=u):(h=u.retryQueue,h===null?u.retryQueue=new Set([m]):h.add(m)),wb(o,m,b)),!1}throw Error(r(435,h.tag))}return wb(o,m,b),hp(),!1}if(Fe)return u=vr.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=b,m!==g0&&(o=Error(r(422),{cause:m}),zc(jr(o,h)))):(m!==g0&&(u=Error(r(423),{cause:m}),zc(jr(u,h))),o=o.current.alternate,o.flags|=65536,b&=-b,o.lanes|=b,m=jr(m,h),b=G0(o.stateNode,m,b),E0(o,b),Tt!==4&&(Tt=2)),!1;var S=Error(r(520),{cause:m});if(S=jr(S,h),af===null?af=[S]:af.push(S),Tt!==4&&(Tt=2),u===null)return!0;m=jr(m,h),h=u;do{switch(h.tag){case 3:return h.flags|=65536,o=b&-b,h.lanes|=o,o=G0(h.stateNode,m,o),E0(h,o),!1;case 1:if(u=h.type,S=h.stateNode,(h.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(yl===null||!yl.has(S))))return h.flags|=65536,b&=-b,h.lanes|=b,b=XE(b),QE(b,o,h,m),E0(h,b),!1}h=h.return}while(h!==null);return!1}var Z0=Error(r(461)),Ht=!1;function vn(o,u,h,m){u.child=o===null?JC(u,null,h,m):So(u,o.child,h,m)}function YE(o,u,h,m,b){h=h.render;var S=u.ref;if("ref"in m){var C={};for(var D in m)D!=="ref"&&(C[D]=m[D])}else C=m;return vo(u),m=_0(o,u,h,C,S,b),D=N0(),o!==null&&!Ht?(I0(o,u,b),ga(o,u,b)):(Fe&&D&&p0(u),u.flags|=1,vn(o,u,m,b),u.child)}function GE(o,u,h,m,b){if(o===null){var S=h.type;return typeof S=="function"&&!f0(S)&&S.defaultProps===void 0&&h.compare===null?(u.tag=15,u.type=S,ZE(o,u,S,m,b)):(o=Id(h.type,null,m,u,u.mode,b),o.ref=u.ref,o.return=u,u.child=o)}if(S=o.child,!lb(o,b)){var C=S.memoizedProps;if(h=h.compare,h=h!==null?h:Lc,h(C,m)&&o.ref===u.ref)return ga(o,u,b)}return u.flags|=1,o=ca(S,m),o.ref=u.ref,o.return=u,u.child=o}function ZE(o,u,h,m,b){if(o!==null){var S=o.memoizedProps;if(Lc(S,m)&&o.ref===u.ref)if(Ht=!1,u.pendingProps=m=S,lb(o,b))(o.flags&131072)!==0&&(Ht=!0);else return u.lanes=o.lanes,ga(o,u,b)}return J0(o,u,h,m,b)}function JE(o,u,h,m){var b=m.children,S=o!==null?o.memoizedState:null;if(o===null&&u.stateNode===null&&(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((u.flags&128)!==0){if(S=S!==null?S.baseLanes|h:h,o!==null){for(m=u.child=o.child,b=0;m!==null;)b=b|m.lanes|m.childLanes,m=m.sibling;m=b&~S}else m=0,u.child=null;return eT(o,u,S,h,m)}if((h&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},o!==null&&zd(u,S!==null?S.cachePool:null),S!==null?nE(u,S):M0(),rE(u);else return m=u.lanes=536870912,eT(o,u,S!==null?S.baseLanes|h:h,h,m)}else S!==null?(zd(u,S.cachePool),nE(u,S),pl(),u.memoizedState=null):(o!==null&&zd(u,null),M0(),pl());return vn(o,u,b,h),u.child}function Gc(o,u){return o!==null&&o.tag===22||u.stateNode!==null||(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.sibling}function eT(o,u,h,m,b){var S=O0();return S=S===null?null:{parent:zt._currentValue,pool:S},u.memoizedState={baseLanes:h,cachePool:S},o!==null&&zd(u,null),M0(),rE(u),o!==null&&Hs(o,u,m,!0),u.childLanes=b,null}function tp(o,u){return u=rp({mode:u.mode,children:u.children},o.mode),u.ref=o.ref,o.child=u,u.return=o,u}function tT(o,u,h){return So(u,o.child,null,h),o=tp(u,u.pendingProps),o.flags|=2,yr(u),u.memoizedState=null,o}function rU(o,u,h){var m=u.pendingProps,b=(u.flags&128)!==0;if(u.flags&=-129,o===null){if(Fe){if(m.mode==="hidden")return o=tp(u,m),u.lanes=536870912,Gc(null,o);if(D0(u),(o=vt)?(o=d2(o,$r),o=o!==null&&o.data==="&"?o:null,o!==null&&(u.memoizedState={dehydrated:o,treeContext:ll!==null?{id:Ci,overflow:Ei}:null,retryLane:536870912,hydrationErrors:null},h=BC(o),h.return=u,u.child=h,mn=u,vt=null)):o=null,o===null)throw sl(u);return u.lanes=536870912,null}return tp(u,m)}var S=o.memoizedState;if(S!==null){var C=S.dehydrated;if(D0(u),b)if(u.flags&256)u.flags&=-257,u=tT(o,u,h);else if(u.memoizedState!==null)u.child=o.child,u.flags|=128,u=null;else throw Error(r(558));else if(Ht||Hs(o,u,h,!1),b=(h&o.childLanes)!==0,Ht||b){if(m=ut,m!==null&&(C=Wk(m,h),C!==0&&C!==S.retryLane))throw S.retryLane=C,ho(o,C),er(m,o,C),Z0;hp(),u=tT(o,u,h)}else o=S.treeContext,vt=Ur(C.nextSibling),mn=u,Fe=!0,ol=null,$r=!1,o!==null&&HC(u,o),u=tp(u,m),u.flags|=4096;return u}return o=ca(o.child,{mode:m.mode,children:m.children}),o.ref=u.ref,u.child=o,o.return=u,o}function np(o,u){var h=u.ref;if(h===null)o!==null&&o.ref!==null&&(u.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(r(284));(o===null||o.ref!==h)&&(u.flags|=4194816)}}function J0(o,u,h,m,b){return vo(u),h=_0(o,u,h,m,void 0,b),m=N0(),o!==null&&!Ht?(I0(o,u,b),ga(o,u,b)):(Fe&&m&&p0(u),u.flags|=1,vn(o,u,h,b),u.child)}function nT(o,u,h,m,b,S){return vo(u),u.updateQueue=null,h=aE(u,m,h,b),iE(o),m=N0(),o!==null&&!Ht?(I0(o,u,S),ga(o,u,S)):(Fe&&m&&p0(u),u.flags|=1,vn(o,u,h,S),u.child)}function rT(o,u,h,m,b){if(vo(u),u.stateNode===null){var S=js,C=h.contextType;typeof C=="object"&&C!==null&&(S=gn(C)),S=new h(m,S),u.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=Y0,u.stateNode=S,S._reactInternals=u,S=u.stateNode,S.props=m,S.state=u.memoizedState,S.refs={},k0(u),C=h.contextType,S.context=typeof C=="object"&&C!==null?gn(C):js,S.state=u.memoizedState,C=h.getDerivedStateFromProps,typeof C=="function"&&(Q0(u,h,C,m),S.state=u.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(C=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),C!==S.state&&Y0.enqueueReplaceState(S,S.state,null),Vc(u,m,S,b),Wc(),S.state=u.memoizedState),typeof S.componentDidMount=="function"&&(u.flags|=4194308),m=!0}else if(o===null){S=u.stateNode;var D=u.memoizedProps,I=Oo(h,D);S.props=I;var F=S.context,Z=h.contextType;C=js,typeof Z=="object"&&Z!==null&&(C=gn(Z));var te=h.getDerivedStateFromProps;Z=typeof te=="function"||typeof S.getSnapshotBeforeUpdate=="function",D=u.pendingProps!==D,Z||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(D||F!==C)&&FE(u,S,m,C),cl=!1;var W=u.memoizedState;S.state=W,Vc(u,m,S,b),Wc(),F=u.memoizedState,D||W!==F||cl?(typeof te=="function"&&(Q0(u,h,te,m),F=u.memoizedState),(I=cl||UE(u,h,I,m,W,F,C))?(Z||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(u.flags|=4194308)):(typeof S.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=m,u.memoizedState=F),S.props=m,S.state=F,S.context=C,m=I):(typeof S.componentDidMount=="function"&&(u.flags|=4194308),m=!1)}else{S=u.stateNode,C0(o,u),C=u.memoizedProps,Z=Oo(h,C),S.props=Z,te=u.pendingProps,W=S.context,F=h.contextType,I=js,typeof F=="object"&&F!==null&&(I=gn(F)),D=h.getDerivedStateFromProps,(F=typeof D=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(C!==te||W!==I)&&FE(u,S,m,I),cl=!1,W=u.memoizedState,S.state=W,Vc(u,m,S,b),Wc();var Q=u.memoizedState;C!==te||W!==Q||cl||o!==null&&o.dependencies!==null&&jd(o.dependencies)?(typeof D=="function"&&(Q0(u,h,D,m),Q=u.memoizedState),(Z=cl||UE(u,h,Z,m,W,Q,I)||o!==null&&o.dependencies!==null&&jd(o.dependencies))?(F||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(m,Q,I),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(m,Q,I)),typeof S.componentDidUpdate=="function"&&(u.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof S.componentDidUpdate!="function"||C===o.memoizedProps&&W===o.memoizedState||(u.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||C===o.memoizedProps&&W===o.memoizedState||(u.flags|=1024),u.memoizedProps=m,u.memoizedState=Q),S.props=m,S.state=Q,S.context=I,m=Z):(typeof S.componentDidUpdate!="function"||C===o.memoizedProps&&W===o.memoizedState||(u.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||C===o.memoizedProps&&W===o.memoizedState||(u.flags|=1024),m=!1)}return S=m,np(o,u),m=(u.flags&128)!==0,S||m?(S=u.stateNode,h=m&&typeof h.getDerivedStateFromError!="function"?null:S.render(),u.flags|=1,o!==null&&m?(u.child=So(u,o.child,null,b),u.child=So(u,null,h,b)):vn(o,u,h,b),u.memoizedState=S.state,o=u.child):o=ga(o,u,b),o}function iT(o,u,h,m){return mo(),u.flags|=256,vn(o,u,h,m),u.child}var eb={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tb(o){return{baseLanes:o,cachePool:KC()}}function nb(o,u,h){return o=o!==null?o.childLanes&~h:0,u&&(o|=xr),o}function aT(o,u,h){var m=u.pendingProps,b=!1,S=(u.flags&128)!==0,C;if((C=S)||(C=o!==null&&o.memoizedState===null?!1:(Nt.current&2)!==0),C&&(b=!0,u.flags&=-129),C=(u.flags&32)!==0,u.flags&=-33,o===null){if(Fe){if(b?dl(u):pl(),(o=vt)?(o=d2(o,$r),o=o!==null&&o.data!=="&"?o:null,o!==null&&(u.memoizedState={dehydrated:o,treeContext:ll!==null?{id:Ci,overflow:Ei}:null,retryLane:536870912,hydrationErrors:null},h=BC(o),h.return=u,u.child=h,mn=u,vt=null)):o=null,o===null)throw sl(u);return Bb(o)?u.lanes=32:u.lanes=536870912,null}var D=m.children;return m=m.fallback,b?(pl(),b=u.mode,D=rp({mode:"hidden",children:D},b),m=po(m,b,h,null),D.return=u,m.return=u,D.sibling=m,u.child=D,m=u.child,m.memoizedState=tb(h),m.childLanes=nb(o,C,h),u.memoizedState=eb,Gc(null,m)):(dl(u),rb(u,D))}var I=o.memoizedState;if(I!==null&&(D=I.dehydrated,D!==null)){if(S)u.flags&256?(dl(u),u.flags&=-257,u=ib(o,u,h)):u.memoizedState!==null?(pl(),u.child=o.child,u.flags|=128,u=null):(pl(),D=m.fallback,b=u.mode,m=rp({mode:"visible",children:m.children},b),D=po(D,b,h,null),D.flags|=2,m.return=u,D.return=u,m.sibling=D,u.child=m,So(u,o.child,null,h),m=u.child,m.memoizedState=tb(h),m.childLanes=nb(o,C,h),u.memoizedState=eb,u=Gc(null,m));else if(dl(u),Bb(D)){if(C=D.nextSibling&&D.nextSibling.dataset,C)var F=C.dgst;C=F,m=Error(r(419)),m.stack="",m.digest=C,zc({value:m,source:null,stack:null}),u=ib(o,u,h)}else if(Ht||Hs(o,u,h,!1),C=(h&o.childLanes)!==0,Ht||C){if(C=ut,C!==null&&(m=Wk(C,h),m!==0&&m!==I.retryLane))throw I.retryLane=m,ho(o,m),er(C,o,m),Z0;jb(D)||hp(),u=ib(o,u,h)}else jb(D)?(u.flags|=192,u.child=o.child,u=null):(o=I.treeContext,vt=Ur(D.nextSibling),mn=u,Fe=!0,ol=null,$r=!1,o!==null&&HC(u,o),u=rb(u,m.children),u.flags|=4096);return u}return b?(pl(),D=m.fallback,b=u.mode,I=o.child,F=I.sibling,m=ca(I,{mode:"hidden",children:m.children}),m.subtreeFlags=I.subtreeFlags&65011712,F!==null?D=ca(F,D):(D=po(D,b,h,null),D.flags|=2),D.return=u,m.return=u,m.sibling=D,u.child=m,Gc(null,m),m=u.child,D=o.child.memoizedState,D===null?D=tb(h):(b=D.cachePool,b!==null?(I=zt._currentValue,b=b.parent!==I?{parent:I,pool:I}:b):b=KC(),D={baseLanes:D.baseLanes|h,cachePool:b}),m.memoizedState=D,m.childLanes=nb(o,C,h),u.memoizedState=eb,Gc(o.child,m)):(dl(u),h=o.child,o=h.sibling,h=ca(h,{mode:"visible",children:m.children}),h.return=u,h.sibling=null,o!==null&&(C=u.deletions,C===null?(u.deletions=[o],u.flags|=16):C.push(o)),u.child=h,u.memoizedState=null,h)}function rb(o,u){return u=rp({mode:"visible",children:u},o.mode),u.return=o,o.child=u}function rp(o,u){return o=gr(22,o,null,u),o.lanes=0,o}function ib(o,u,h){return So(u,o.child,null,h),o=rb(u,u.pendingProps.children),o.flags|=2,u.memoizedState=null,o}function lT(o,u,h){o.lanes|=u;var m=o.alternate;m!==null&&(m.lanes|=u),b0(o.return,u,h)}function ab(o,u,h,m,b,S){var C=o.memoizedState;C===null?o.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:m,tail:h,tailMode:b,treeForkCount:S}:(C.isBackwards=u,C.rendering=null,C.renderingStartTime=0,C.last=m,C.tail=h,C.tailMode=b,C.treeForkCount=S)}function oT(o,u,h){var m=u.pendingProps,b=m.revealOrder,S=m.tail;m=m.children;var C=Nt.current,D=(C&2)!==0;if(D?(C=C&1|2,u.flags|=128):C&=1,re(Nt,C),vn(o,u,m,h),m=Fe?Bc:0,!D&&o!==null&&(o.flags&128)!==0)e:for(o=u.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&lT(o,h,u);else if(o.tag===19)lT(o,h,u);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===u)break e;for(;o.sibling===null;){if(o.return===null||o.return===u)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}switch(b){case"forwards":for(h=u.child,b=null;h!==null;)o=h.alternate,o!==null&&Wd(o)===null&&(b=h),h=h.sibling;h=b,h===null?(b=u.child,u.child=null):(b=h.sibling,h.sibling=null),ab(u,!1,b,h,S,m);break;case"backwards":case"unstable_legacy-backwards":for(h=null,b=u.child,u.child=null;b!==null;){if(o=b.alternate,o!==null&&Wd(o)===null){u.child=b;break}o=b.sibling,b.sibling=h,h=b,b=o}ab(u,!0,h,null,S,m);break;case"together":ab(u,!1,null,null,void 0,m);break;default:u.memoizedState=null}return u.child}function ga(o,u,h){if(o!==null&&(u.dependencies=o.dependencies),vl|=u.lanes,(h&u.childLanes)===0)if(o!==null){if(Hs(o,u,h,!1),(h&u.childLanes)===0)return null}else return null;if(o!==null&&u.child!==o.child)throw Error(r(153));if(u.child!==null){for(o=u.child,h=ca(o,o.pendingProps),u.child=h,h.return=u;o.sibling!==null;)o=o.sibling,h=h.sibling=ca(o,o.pendingProps),h.return=u;h.sibling=null}return u.child}function lb(o,u){return(o.lanes&u)!==0?!0:(o=o.dependencies,!!(o!==null&&jd(o)))}function iU(o,u,h){switch(u.tag){case 3:mt(u,u.stateNode.containerInfo),ul(u,zt,o.memoizedState.cache),mo();break;case 27:case 5:Te(u);break;case 4:mt(u,u.stateNode.containerInfo);break;case 10:ul(u,u.type,u.memoizedProps.value);break;case 31:if(u.memoizedState!==null)return u.flags|=128,D0(u),null;break;case 13:var m=u.memoizedState;if(m!==null)return m.dehydrated!==null?(dl(u),u.flags|=128,null):(h&u.child.childLanes)!==0?aT(o,u,h):(dl(u),o=ga(o,u,h),o!==null?o.sibling:null);dl(u);break;case 19:var b=(o.flags&128)!==0;if(m=(h&u.childLanes)!==0,m||(Hs(o,u,h,!1),m=(h&u.childLanes)!==0),b){if(m)return oT(o,u,h);u.flags|=128}if(b=u.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),re(Nt,Nt.current),m)break;return null;case 22:return u.lanes=0,JE(o,u,h,u.pendingProps);case 24:ul(u,zt,o.memoizedState.cache)}return ga(o,u,h)}function sT(o,u,h){if(o!==null)if(o.memoizedProps!==u.pendingProps)Ht=!0;else{if(!lb(o,h)&&(u.flags&128)===0)return Ht=!1,iU(o,u,h);Ht=(o.flags&131072)!==0}else Ht=!1,Fe&&(u.flags&1048576)!==0&&$C(u,Bc,u.index);switch(u.lanes=0,u.tag){case 16:e:{var m=u.pendingProps;if(o=bo(u.elementType),u.type=o,typeof o=="function")f0(o)?(m=Oo(o,m),u.tag=1,u=rT(null,u,o,m,h)):(u.tag=0,u=J0(null,u,o,m,h));else{if(o!=null){var b=o.$$typeof;if(b===P){u.tag=11,u=YE(null,u,o,m,h);break e}else if(b===R){u.tag=14,u=GE(null,u,o,m,h);break e}}throw u=ie(o)||o,Error(r(306,u,""))}}return u;case 0:return J0(o,u,u.type,u.pendingProps,h);case 1:return m=u.type,b=Oo(m,u.pendingProps),rT(o,u,m,b,h);case 3:e:{if(mt(u,u.stateNode.containerInfo),o===null)throw Error(r(387));m=u.pendingProps;var S=u.memoizedState;b=S.element,C0(o,u),Vc(u,m,null,h);var C=u.memoizedState;if(m=C.cache,ul(u,zt,m),m!==S.cache&&x0(u,[zt],h,!0),Wc(),m=C.element,S.isDehydrated)if(S={element:m,isDehydrated:!1,cache:C.cache},u.updateQueue.baseState=S,u.memoizedState=S,u.flags&256){u=iT(o,u,m,h);break e}else if(m!==b){b=jr(Error(r(424)),u),zc(b),u=iT(o,u,m,h);break e}else for(o=u.stateNode.containerInfo,o.nodeType===9?o=o.body:o=o.nodeName==="HTML"?o.ownerDocument.body:o,vt=Ur(o.firstChild),mn=u,Fe=!0,ol=null,$r=!0,h=JC(u,null,m,h),u.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(mo(),m===b){u=ga(o,u,h);break e}vn(o,u,m,h)}u=u.child}return u;case 26:return np(o,u),o===null?(h=b2(u.type,null,u.pendingProps,null))?u.memoizedState=h:Fe||(h=u.type,o=u.pendingProps,m=bp(Oe.current).createElement(h),m[pn]=u,m[Xn]=o,yn(m,h,o),en(m),u.stateNode=m):u.memoizedState=b2(u.type,o.memoizedProps,u.pendingProps,o.memoizedState),null;case 27:return Te(u),o===null&&Fe&&(m=u.stateNode=g2(u.type,u.pendingProps,Oe.current),mn=u,$r=!0,b=vt,wl(u.type)?(zb=b,vt=Ur(m.firstChild)):vt=b),vn(o,u,u.pendingProps.children,h),np(o,u),o===null&&(u.flags|=4194304),u.child;case 5:return o===null&&Fe&&((b=m=vt)&&(m=NU(m,u.type,u.pendingProps,$r),m!==null?(u.stateNode=m,mn=u,vt=Ur(m.firstChild),$r=!1,b=!0):b=!1),b||sl(u)),Te(u),b=u.type,S=u.pendingProps,C=o!==null?o.memoizedProps:null,m=S.children,Nb(b,S)?m=null:C!==null&&Nb(b,C)&&(u.flags|=32),u.memoizedState!==null&&(b=_0(o,u,QH,null,null,h),df._currentValue=b),np(o,u),vn(o,u,m,h),u.child;case 6:return o===null&&Fe&&((o=h=vt)&&(h=IU(h,u.pendingProps,$r),h!==null?(u.stateNode=h,mn=u,vt=null,o=!0):o=!1),o||sl(u)),null;case 13:return aT(o,u,h);case 4:return mt(u,u.stateNode.containerInfo),m=u.pendingProps,o===null?u.child=So(u,null,m,h):vn(o,u,m,h),u.child;case 11:return YE(o,u,u.type,u.pendingProps,h);case 7:return vn(o,u,u.pendingProps,h),u.child;case 8:return vn(o,u,u.pendingProps.children,h),u.child;case 12:return vn(o,u,u.pendingProps.children,h),u.child;case 10:return m=u.pendingProps,ul(u,u.type,m.value),vn(o,u,m.children,h),u.child;case 9:return b=u.type._context,m=u.pendingProps.children,vo(u),b=gn(b),m=m(b),u.flags|=1,vn(o,u,m,h),u.child;case 14:return GE(o,u,u.type,u.pendingProps,h);case 15:return ZE(o,u,u.type,u.pendingProps,h);case 19:return oT(o,u,h);case 31:return rU(o,u,h);case 22:return JE(o,u,h,u.pendingProps);case 24:return vo(u),m=gn(zt),o===null?(b=O0(),b===null&&(b=ut,S=S0(),b.pooledCache=S,S.refCount++,S!==null&&(b.pooledCacheLanes|=h),b=S),u.memoizedState={parent:m,cache:b},k0(u),ul(u,zt,b)):((o.lanes&h)!==0&&(C0(o,u),Vc(u,null,null,h),Wc()),b=o.memoizedState,S=u.memoizedState,b.parent!==m?(b={parent:m,cache:m},u.memoizedState=b,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=b),ul(u,zt,m)):(m=S.cache,ul(u,zt,m),m!==b.cache&&x0(u,[zt],h,!0))),vn(o,u,u.pendingProps.children,h),u.child;case 29:throw u.pendingProps}throw Error(r(156,u.tag))}function va(o){o.flags|=4}function ob(o,u,h,m,b){if((u=(o.mode&32)!==0)&&(u=!1),u){if(o.flags|=16777216,(b&335544128)===b)if(o.stateNode.complete)o.flags|=8192;else if(IT())o.flags|=8192;else throw xo=Hd,A0}else o.flags&=-16777217}function uT(o,u){if(u.type!=="stylesheet"||(u.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!A2(u))if(IT())o.flags|=8192;else throw xo=Hd,A0}function ip(o,u){u!==null&&(o.flags|=4),o.flags&16384&&(u=o.tag!==22?Uk():536870912,o.lanes|=u,Js|=u)}function Zc(o,u){if(!Fe)switch(o.tailMode){case"hidden":u=o.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?o.tail=null:h.sibling=null;break;case"collapsed":h=o.tail;for(var m=null;h!==null;)h.alternate!==null&&(m=h),h=h.sibling;m===null?u||o.tail===null?o.tail=null:o.tail.sibling=null:m.sibling=null}}function yt(o){var u=o.alternate!==null&&o.alternate.child===o.child,h=0,m=0;if(u)for(var b=o.child;b!==null;)h|=b.lanes|b.childLanes,m|=b.subtreeFlags&65011712,m|=b.flags&65011712,b.return=o,b=b.sibling;else for(b=o.child;b!==null;)h|=b.lanes|b.childLanes,m|=b.subtreeFlags,m|=b.flags,b.return=o,b=b.sibling;return o.subtreeFlags|=m,o.childLanes=h,u}function aU(o,u,h){var m=u.pendingProps;switch(m0(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yt(u),null;case 1:return yt(u),null;case 3:return h=u.stateNode,m=null,o!==null&&(m=o.memoizedState.cache),u.memoizedState.cache!==m&&(u.flags|=2048),da(zt),se(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(o===null||o.child===null)&&($s(u)?va(u):o===null||o.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,v0())),yt(u),null;case 26:var b=u.type,S=u.memoizedState;return o===null?(va(u),S!==null?(yt(u),uT(u,S)):(yt(u),ob(u,b,null,m,h))):S?S!==o.memoizedState?(va(u),yt(u),uT(u,S)):(yt(u),u.flags&=-16777217):(o=o.memoizedProps,o!==m&&va(u),yt(u),ob(u,b,o,m,h)),null;case 27:if(Ee(u),h=Oe.current,b=u.type,o!==null&&u.stateNode!=null)o.memoizedProps!==m&&va(u);else{if(!m){if(u.stateNode===null)throw Error(r(166));return yt(u),null}o=le.current,$s(u)?UC(u):(o=g2(b,m,h),u.stateNode=o,va(u))}return yt(u),null;case 5:if(Ee(u),b=u.type,o!==null&&u.stateNode!=null)o.memoizedProps!==m&&va(u);else{if(!m){if(u.stateNode===null)throw Error(r(166));return yt(u),null}if(S=le.current,$s(u))UC(u);else{var C=bp(Oe.current);switch(S){case 1:S=C.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:S=C.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":S=C.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":S=C.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":S=C.createElement("div"),S.innerHTML="<script><\/script>",S=S.removeChild(S.firstChild);break;case"select":S=typeof m.is=="string"?C.createElement("select",{is:m.is}):C.createElement("select"),m.multiple?S.multiple=!0:m.size&&(S.size=m.size);break;default:S=typeof m.is=="string"?C.createElement(b,{is:m.is}):C.createElement(b)}}S[pn]=u,S[Xn]=m;e:for(C=u.child;C!==null;){if(C.tag===5||C.tag===6)S.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===u)break e;for(;C.sibling===null;){if(C.return===null||C.return===u)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}u.stateNode=S;e:switch(yn(S,b,m),b){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&va(u)}}return yt(u),ob(u,u.type,o===null?null:o.memoizedProps,u.pendingProps,h),null;case 6:if(o&&u.stateNode!=null)o.memoizedProps!==m&&va(u);else{if(typeof m!="string"&&u.stateNode===null)throw Error(r(166));if(o=Oe.current,$s(u)){if(o=u.stateNode,h=u.memoizedProps,m=null,b=mn,b!==null)switch(b.tag){case 27:case 5:m=b.memoizedProps}o[pn]=u,o=!!(o.nodeValue===h||m!==null&&m.suppressHydrationWarning===!0||a2(o.nodeValue,h)),o||sl(u,!0)}else o=bp(o).createTextNode(m),o[pn]=u,u.stateNode=o}return yt(u),null;case 31:if(h=u.memoizedState,o===null||o.memoizedState!==null){if(m=$s(u),h!==null){if(o===null){if(!m)throw Error(r(318));if(o=u.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(557));o[pn]=u}else mo(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;yt(u),o=!1}else h=v0(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=h),o=!0;if(!o)return u.flags&256?(yr(u),u):(yr(u),null);if((u.flags&128)!==0)throw Error(r(558))}return yt(u),null;case 13:if(m=u.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(b=$s(u),m!==null&&m.dehydrated!==null){if(o===null){if(!b)throw Error(r(318));if(b=u.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[pn]=u}else mo(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;yt(u),b=!1}else b=v0(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=b),b=!0;if(!b)return u.flags&256?(yr(u),u):(yr(u),null)}return yr(u),(u.flags&128)!==0?(u.lanes=h,u):(h=m!==null,o=o!==null&&o.memoizedState!==null,h&&(m=u.child,b=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(b=m.alternate.memoizedState.cachePool.pool),S=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(S=m.memoizedState.cachePool.pool),S!==b&&(m.flags|=2048)),h!==o&&h&&(u.child.flags|=8192),ip(u,u.updateQueue),yt(u),null);case 4:return se(),o===null&&Mb(u.stateNode.containerInfo),yt(u),null;case 10:return da(u.type),yt(u),null;case 19:if(X(Nt),m=u.memoizedState,m===null)return yt(u),null;if(b=(u.flags&128)!==0,S=m.rendering,S===null)if(b)Zc(m,!1);else{if(Tt!==0||o!==null&&(o.flags&128)!==0)for(o=u.child;o!==null;){if(S=Wd(o),S!==null){for(u.flags|=128,Zc(m,!1),o=S.updateQueue,u.updateQueue=o,ip(u,o),u.subtreeFlags=0,o=h,h=u.child;h!==null;)jC(h,o),h=h.sibling;return re(Nt,Nt.current&1|2),Fe&&fa(u,m.treeForkCount),u.child}o=o.sibling}m.tail!==null&&hr()>up&&(u.flags|=128,b=!0,Zc(m,!1),u.lanes=4194304)}else{if(!b)if(o=Wd(S),o!==null){if(u.flags|=128,b=!0,o=o.updateQueue,u.updateQueue=o,ip(u,o),Zc(m,!0),m.tail===null&&m.tailMode==="hidden"&&!S.alternate&&!Fe)return yt(u),null}else 2*hr()-m.renderingStartTime>up&&h!==536870912&&(u.flags|=128,b=!0,Zc(m,!1),u.lanes=4194304);m.isBackwards?(S.sibling=u.child,u.child=S):(o=m.last,o!==null?o.sibling=S:u.child=S,m.last=S)}return m.tail!==null?(o=m.tail,m.rendering=o,m.tail=o.sibling,m.renderingStartTime=hr(),o.sibling=null,h=Nt.current,re(Nt,b?h&1|2:h&1),Fe&&fa(u,m.treeForkCount),o):(yt(u),null);case 22:case 23:return yr(u),P0(),m=u.memoizedState!==null,o!==null?o.memoizedState!==null!==m&&(u.flags|=8192):m&&(u.flags|=8192),m?(h&536870912)!==0&&(u.flags&128)===0&&(yt(u),u.subtreeFlags&6&&(u.flags|=8192)):yt(u),h=u.updateQueue,h!==null&&ip(u,h.retryQueue),h=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),m=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(m=u.memoizedState.cachePool.pool),m!==h&&(u.flags|=2048),o!==null&&X(yo),null;case 24:return h=null,o!==null&&(h=o.memoizedState.cache),u.memoizedState.cache!==h&&(u.flags|=2048),da(zt),yt(u),null;case 25:return null;case 30:return null}throw Error(r(156,u.tag))}function lU(o,u){switch(m0(u),u.tag){case 1:return o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 3:return da(zt),se(),o=u.flags,(o&65536)!==0&&(o&128)===0?(u.flags=o&-65537|128,u):null;case 26:case 27:case 5:return Ee(u),null;case 31:if(u.memoizedState!==null){if(yr(u),u.alternate===null)throw Error(r(340));mo()}return o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 13:if(yr(u),o=u.memoizedState,o!==null&&o.dehydrated!==null){if(u.alternate===null)throw Error(r(340));mo()}return o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 19:return X(Nt),null;case 4:return se(),null;case 10:return da(u.type),null;case 22:case 23:return yr(u),P0(),o!==null&&X(yo),o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 24:return da(zt),null;case 25:return null;default:return null}}function cT(o,u){switch(m0(u),u.tag){case 3:da(zt),se();break;case 26:case 27:case 5:Ee(u);break;case 4:se();break;case 31:u.memoizedState!==null&&yr(u);break;case 13:yr(u);break;case 19:X(Nt);break;case 10:da(u.type);break;case 22:case 23:yr(u),P0(),o!==null&&X(yo);break;case 24:da(zt)}}function Jc(o,u){try{var h=u.updateQueue,m=h!==null?h.lastEffect:null;if(m!==null){var b=m.next;h=b;do{if((h.tag&o)===o){m=void 0;var S=h.create,C=h.inst;m=S(),C.destroy=m}h=h.next}while(h!==b)}}catch(D){tt(u,u.return,D)}}function ml(o,u,h){try{var m=u.updateQueue,b=m!==null?m.lastEffect:null;if(b!==null){var S=b.next;m=S;do{if((m.tag&o)===o){var C=m.inst,D=C.destroy;if(D!==void 0){C.destroy=void 0,b=u;var I=h,F=D;try{F()}catch(Z){tt(b,I,Z)}}}m=m.next}while(m!==S)}}catch(Z){tt(u,u.return,Z)}}function fT(o){var u=o.updateQueue;if(u!==null){var h=o.stateNode;try{tE(u,h)}catch(m){tt(o,o.return,m)}}}function hT(o,u,h){h.props=Oo(o.type,o.memoizedProps),h.state=o.memoizedState;try{h.componentWillUnmount()}catch(m){tt(o,u,m)}}function ef(o,u){try{var h=o.ref;if(h!==null){switch(o.tag){case 26:case 27:case 5:var m=o.stateNode;break;case 30:m=o.stateNode;break;default:m=o.stateNode}typeof h=="function"?o.refCleanup=h(m):h.current=m}}catch(b){tt(o,u,b)}}function Ti(o,u){var h=o.ref,m=o.refCleanup;if(h!==null)if(typeof m=="function")try{m()}catch(b){tt(o,u,b)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(b){tt(o,u,b)}else h.current=null}function dT(o){var u=o.type,h=o.memoizedProps,m=o.stateNode;try{e:switch(u){case"button":case"input":case"select":case"textarea":h.autoFocus&&m.focus();break e;case"img":h.src?m.src=h.src:h.srcSet&&(m.srcset=h.srcSet)}}catch(b){tt(o,o.return,b)}}function sb(o,u,h){try{var m=o.stateNode;TU(m,o.type,h,u),m[Xn]=u}catch(b){tt(o,o.return,b)}}function pT(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&wl(o.type)||o.tag===4}function ub(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||pT(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&wl(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function cb(o,u,h){var m=o.tag;if(m===5||m===6)o=o.stateNode,u?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(o,u):(u=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,u.appendChild(o),h=h._reactRootContainer,h!=null||u.onclick!==null||(u.onclick=sa));else if(m!==4&&(m===27&&wl(o.type)&&(h=o.stateNode,u=null),o=o.child,o!==null))for(cb(o,u,h),o=o.sibling;o!==null;)cb(o,u,h),o=o.sibling}function ap(o,u,h){var m=o.tag;if(m===5||m===6)o=o.stateNode,u?h.insertBefore(o,u):h.appendChild(o);else if(m!==4&&(m===27&&wl(o.type)&&(h=o.stateNode),o=o.child,o!==null))for(ap(o,u,h),o=o.sibling;o!==null;)ap(o,u,h),o=o.sibling}function mT(o){var u=o.stateNode,h=o.memoizedProps;try{for(var m=o.type,b=u.attributes;b.length;)u.removeAttributeNode(b[0]);yn(u,m,h),u[pn]=o,u[Xn]=h}catch(S){tt(o,o.return,S)}}var ya=!1,Ut=!1,fb=!1,gT=typeof WeakSet=="function"?WeakSet:Set,tn=null;function oU(o,u){if(o=o.containerInfo,Rb=Cp,o=TC(o),i0(o)){if("selectionStart"in o)var h={start:o.selectionStart,end:o.selectionEnd};else e:{h=(h=o.ownerDocument)&&h.defaultView||window;var m=h.getSelection&&h.getSelection();if(m&&m.rangeCount!==0){h=m.anchorNode;var b=m.anchorOffset,S=m.focusNode;m=m.focusOffset;try{h.nodeType,S.nodeType}catch{h=null;break e}var C=0,D=-1,I=-1,F=0,Z=0,te=o,W=null;t:for(;;){for(var Q;te!==h||b!==0&&te.nodeType!==3||(D=C+b),te!==S||m!==0&&te.nodeType!==3||(I=C+m),te.nodeType===3&&(C+=te.nodeValue.length),(Q=te.firstChild)!==null;)W=te,te=Q;for(;;){if(te===o)break t;if(W===h&&++F===b&&(D=C),W===S&&++Z===m&&(I=C),(Q=te.nextSibling)!==null)break;te=W,W=te.parentNode}te=Q}h=D===-1||I===-1?null:{start:D,end:I}}else h=null}h=h||{start:0,end:0}}else h=null;for(_b={focusedElem:o,selectionRange:h},Cp=!1,tn=u;tn!==null;)if(u=tn,o=u.child,(u.subtreeFlags&1028)!==0&&o!==null)o.return=u,tn=o;else for(;tn!==null;){switch(u=tn,S=u.alternate,o=u.flags,u.tag){case 0:if((o&4)!==0&&(o=u.updateQueue,o=o!==null?o.events:null,o!==null))for(h=0;h<o.length;h++)b=o[h],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((o&1024)!==0&&S!==null){o=void 0,h=u,b=S.memoizedProps,S=S.memoizedState,m=h.stateNode;try{var ye=Oo(h.type,b);o=m.getSnapshotBeforeUpdate(ye,S),m.__reactInternalSnapshotBeforeUpdate=o}catch(Me){tt(h,h.return,Me)}}break;case 3:if((o&1024)!==0){if(o=u.stateNode.containerInfo,h=o.nodeType,h===9)Lb(o);else if(h===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":Lb(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(r(163))}if(o=u.sibling,o!==null){o.return=u.return,tn=o;break}tn=u.return}}function vT(o,u,h){var m=h.flags;switch(h.tag){case 0:case 11:case 15:xa(o,h),m&4&&Jc(5,h);break;case 1:if(xa(o,h),m&4)if(o=h.stateNode,u===null)try{o.componentDidMount()}catch(C){tt(h,h.return,C)}else{var b=Oo(h.type,u.memoizedProps);u=u.memoizedState;try{o.componentDidUpdate(b,u,o.__reactInternalSnapshotBeforeUpdate)}catch(C){tt(h,h.return,C)}}m&64&&fT(h),m&512&&ef(h,h.return);break;case 3:if(xa(o,h),m&64&&(o=h.updateQueue,o!==null)){if(u=null,h.child!==null)switch(h.child.tag){case 27:case 5:u=h.child.stateNode;break;case 1:u=h.child.stateNode}try{tE(o,u)}catch(C){tt(h,h.return,C)}}break;case 27:u===null&&m&4&&mT(h);case 26:case 5:xa(o,h),u===null&&m&4&&dT(h),m&512&&ef(h,h.return);break;case 12:xa(o,h);break;case 31:xa(o,h),m&4&&xT(o,h);break;case 13:xa(o,h),m&4&&ST(o,h),m&64&&(o=h.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(h=gU.bind(null,h),LU(o,h))));break;case 22:if(m=h.memoizedState!==null||ya,!m){u=u!==null&&u.memoizedState!==null||Ut,b=ya;var S=Ut;ya=m,(Ut=u)&&!S?Sa(o,h,(h.subtreeFlags&8772)!==0):xa(o,h),ya=b,Ut=S}break;case 30:break;default:xa(o,h)}}function yT(o){var u=o.alternate;u!==null&&(o.alternate=null,yT(u)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(u=o.stateNode,u!==null&&Hy(u)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var wt=null,Yn=!1;function ba(o,u,h){for(h=h.child;h!==null;)bT(o,u,h),h=h.sibling}function bT(o,u,h){if(dr&&typeof dr.onCommitFiberUnmount=="function")try{dr.onCommitFiberUnmount(Ac,h)}catch{}switch(h.tag){case 26:Ut||Ti(h,u),ba(o,u,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:Ut||Ti(h,u);var m=wt,b=Yn;wl(h.type)&&(wt=h.stateNode,Yn=!1),ba(o,u,h),cf(h.stateNode),wt=m,Yn=b;break;case 5:Ut||Ti(h,u);case 6:if(m=wt,b=Yn,wt=null,ba(o,u,h),wt=m,Yn=b,wt!==null)if(Yn)try{(wt.nodeType===9?wt.body:wt.nodeName==="HTML"?wt.ownerDocument.body:wt).removeChild(h.stateNode)}catch(S){tt(h,u,S)}else try{wt.removeChild(h.stateNode)}catch(S){tt(h,u,S)}break;case 18:wt!==null&&(Yn?(o=wt,f2(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,h.stateNode),ou(o)):f2(wt,h.stateNode));break;case 4:m=wt,b=Yn,wt=h.stateNode.containerInfo,Yn=!0,ba(o,u,h),wt=m,Yn=b;break;case 0:case 11:case 14:case 15:ml(2,h,u),Ut||ml(4,h,u),ba(o,u,h);break;case 1:Ut||(Ti(h,u),m=h.stateNode,typeof m.componentWillUnmount=="function"&&hT(h,u,m)),ba(o,u,h);break;case 21:ba(o,u,h);break;case 22:Ut=(m=Ut)||h.memoizedState!==null,ba(o,u,h),Ut=m;break;default:ba(o,u,h)}}function xT(o,u){if(u.memoizedState===null&&(o=u.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{ou(o)}catch(h){tt(u,u.return,h)}}}function ST(o,u){if(u.memoizedState===null&&(o=u.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{ou(o)}catch(h){tt(u,u.return,h)}}function sU(o){switch(o.tag){case 31:case 13:case 19:var u=o.stateNode;return u===null&&(u=o.stateNode=new gT),u;case 22:return o=o.stateNode,u=o._retryCache,u===null&&(u=o._retryCache=new gT),u;default:throw Error(r(435,o.tag))}}function lp(o,u){var h=sU(o);u.forEach(function(m){if(!h.has(m)){h.add(m);var b=vU.bind(null,o,m);m.then(b,b)}})}function Gn(o,u){var h=u.deletions;if(h!==null)for(var m=0;m<h.length;m++){var b=h[m],S=o,C=u,D=C;e:for(;D!==null;){switch(D.tag){case 27:if(wl(D.type)){wt=D.stateNode,Yn=!1;break e}break;case 5:wt=D.stateNode,Yn=!1;break e;case 3:case 4:wt=D.stateNode.containerInfo,Yn=!0;break e}D=D.return}if(wt===null)throw Error(r(160));bT(S,C,b),wt=null,Yn=!1,S=b.alternate,S!==null&&(S.return=null),b.return=null}if(u.subtreeFlags&13886)for(u=u.child;u!==null;)wT(u,o),u=u.sibling}var oi=null;function wT(o,u){var h=o.alternate,m=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:Gn(u,o),Zn(o),m&4&&(ml(3,o,o.return),Jc(3,o),ml(5,o,o.return));break;case 1:Gn(u,o),Zn(o),m&512&&(Ut||h===null||Ti(h,h.return)),m&64&&ya&&(o=o.updateQueue,o!==null&&(m=o.callbacks,m!==null&&(h=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=h===null?m:h.concat(m))));break;case 26:var b=oi;if(Gn(u,o),Zn(o),m&512&&(Ut||h===null||Ti(h,h.return)),m&4){var S=h!==null?h.memoizedState:null;if(m=o.memoizedState,h===null)if(m===null)if(o.stateNode===null){e:{m=o.type,h=o.memoizedProps,b=b.ownerDocument||b;t:switch(m){case"title":S=b.getElementsByTagName("title")[0],(!S||S[Ec]||S[pn]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=b.createElement(m),b.head.insertBefore(S,b.querySelector("head > title"))),yn(S,m,h),S[pn]=o,en(S),m=S;break e;case"link":var C=w2("link","href",b).get(m+(h.href||""));if(C){for(var D=0;D<C.length;D++)if(S=C[D],S.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&S.getAttribute("rel")===(h.rel==null?null:h.rel)&&S.getAttribute("title")===(h.title==null?null:h.title)&&S.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){C.splice(D,1);break t}}S=b.createElement(m),yn(S,m,h),b.head.appendChild(S);break;case"meta":if(C=w2("meta","content",b).get(m+(h.content||""))){for(D=0;D<C.length;D++)if(S=C[D],S.getAttribute("content")===(h.content==null?null:""+h.content)&&S.getAttribute("name")===(h.name==null?null:h.name)&&S.getAttribute("property")===(h.property==null?null:h.property)&&S.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&S.getAttribute("charset")===(h.charSet==null?null:h.charSet)){C.splice(D,1);break t}}S=b.createElement(m),yn(S,m,h),b.head.appendChild(S);break;default:throw Error(r(468,m))}S[pn]=o,en(S),m=S}o.stateNode=m}else O2(b,o.type,o.stateNode);else o.stateNode=S2(b,m,o.memoizedProps);else S!==m?(S===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):S.count--,m===null?O2(b,o.type,o.stateNode):S2(b,m,o.memoizedProps)):m===null&&o.stateNode!==null&&sb(o,o.memoizedProps,h.memoizedProps)}break;case 27:Gn(u,o),Zn(o),m&512&&(Ut||h===null||Ti(h,h.return)),h!==null&&m&4&&sb(o,o.memoizedProps,h.memoizedProps);break;case 5:if(Gn(u,o),Zn(o),m&512&&(Ut||h===null||Ti(h,h.return)),o.flags&32){b=o.stateNode;try{Ps(b,"")}catch(ye){tt(o,o.return,ye)}}m&4&&o.stateNode!=null&&(b=o.memoizedProps,sb(o,b,h!==null?h.memoizedProps:b)),m&1024&&(fb=!0);break;case 6:if(Gn(u,o),Zn(o),m&4){if(o.stateNode===null)throw Error(r(162));m=o.memoizedProps,h=o.stateNode;try{h.nodeValue=m}catch(ye){tt(o,o.return,ye)}}break;case 3:if(wp=null,b=oi,oi=xp(u.containerInfo),Gn(u,o),oi=b,Zn(o),m&4&&h!==null&&h.memoizedState.isDehydrated)try{ou(u.containerInfo)}catch(ye){tt(o,o.return,ye)}fb&&(fb=!1,OT(o));break;case 4:m=oi,oi=xp(o.stateNode.containerInfo),Gn(u,o),Zn(o),oi=m;break;case 12:Gn(u,o),Zn(o);break;case 31:Gn(u,o),Zn(o),m&4&&(m=o.updateQueue,m!==null&&(o.updateQueue=null,lp(o,m)));break;case 13:Gn(u,o),Zn(o),o.child.flags&8192&&o.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(sp=hr()),m&4&&(m=o.updateQueue,m!==null&&(o.updateQueue=null,lp(o,m)));break;case 22:b=o.memoizedState!==null;var I=h!==null&&h.memoizedState!==null,F=ya,Z=Ut;if(ya=F||b,Ut=Z||I,Gn(u,o),Ut=Z,ya=F,Zn(o),m&8192)e:for(u=o.stateNode,u._visibility=b?u._visibility&-2:u._visibility|1,b&&(h===null||I||ya||Ut||Ao(o)),h=null,u=o;;){if(u.tag===5||u.tag===26){if(h===null){I=h=u;try{if(S=I.stateNode,b)C=S.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none";else{D=I.stateNode;var te=I.memoizedProps.style,W=te!=null&&te.hasOwnProperty("display")?te.display:null;D.style.display=W==null||typeof W=="boolean"?"":(""+W).trim()}}catch(ye){tt(I,I.return,ye)}}}else if(u.tag===6){if(h===null){I=u;try{I.stateNode.nodeValue=b?"":I.memoizedProps}catch(ye){tt(I,I.return,ye)}}}else if(u.tag===18){if(h===null){I=u;try{var Q=I.stateNode;b?h2(Q,!0):h2(I.stateNode,!1)}catch(ye){tt(I,I.return,ye)}}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===o)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===o)break e;for(;u.sibling===null;){if(u.return===null||u.return===o)break e;h===u&&(h=null),u=u.return}h===u&&(h=null),u.sibling.return=u.return,u=u.sibling}m&4&&(m=o.updateQueue,m!==null&&(h=m.retryQueue,h!==null&&(m.retryQueue=null,lp(o,h))));break;case 19:Gn(u,o),Zn(o),m&4&&(m=o.updateQueue,m!==null&&(o.updateQueue=null,lp(o,m)));break;case 30:break;case 21:break;default:Gn(u,o),Zn(o)}}function Zn(o){var u=o.flags;if(u&2){try{for(var h,m=o.return;m!==null;){if(pT(m)){h=m;break}m=m.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var b=h.stateNode,S=ub(o);ap(o,S,b);break;case 5:var C=h.stateNode;h.flags&32&&(Ps(C,""),h.flags&=-33);var D=ub(o);ap(o,D,C);break;case 3:case 4:var I=h.stateNode.containerInfo,F=ub(o);cb(o,F,I);break;default:throw Error(r(161))}}catch(Z){tt(o,o.return,Z)}o.flags&=-3}u&4096&&(o.flags&=-4097)}function OT(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var u=o;OT(u),u.tag===5&&u.flags&1024&&u.stateNode.reset(),o=o.sibling}}function xa(o,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)vT(o,u.alternate,u),u=u.sibling}function Ao(o){for(o=o.child;o!==null;){var u=o;switch(u.tag){case 0:case 11:case 14:case 15:ml(4,u,u.return),Ao(u);break;case 1:Ti(u,u.return);var h=u.stateNode;typeof h.componentWillUnmount=="function"&&hT(u,u.return,h),Ao(u);break;case 27:cf(u.stateNode);case 26:case 5:Ti(u,u.return),Ao(u);break;case 22:u.memoizedState===null&&Ao(u);break;case 30:Ao(u);break;default:Ao(u)}o=o.sibling}}function Sa(o,u,h){for(h=h&&(u.subtreeFlags&8772)!==0,u=u.child;u!==null;){var m=u.alternate,b=o,S=u,C=S.flags;switch(S.tag){case 0:case 11:case 15:Sa(b,S,h),Jc(4,S);break;case 1:if(Sa(b,S,h),m=S,b=m.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(F){tt(m,m.return,F)}if(m=S,b=m.updateQueue,b!==null){var D=m.stateNode;try{var I=b.shared.hiddenCallbacks;if(I!==null)for(b.shared.hiddenCallbacks=null,b=0;b<I.length;b++)eE(I[b],D)}catch(F){tt(m,m.return,F)}}h&&C&64&&fT(S),ef(S,S.return);break;case 27:mT(S);case 26:case 5:Sa(b,S,h),h&&m===null&&C&4&&dT(S),ef(S,S.return);break;case 12:Sa(b,S,h);break;case 31:Sa(b,S,h),h&&C&4&&xT(b,S);break;case 13:Sa(b,S,h),h&&C&4&&ST(b,S);break;case 22:S.memoizedState===null&&Sa(b,S,h),ef(S,S.return);break;case 30:break;default:Sa(b,S,h)}u=u.sibling}}function hb(o,u){var h=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),o=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(o=u.memoizedState.cachePool.pool),o!==h&&(o!=null&&o.refCount++,h!=null&&$c(h))}function db(o,u){o=null,u.alternate!==null&&(o=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==o&&(u.refCount++,o!=null&&$c(o))}function si(o,u,h,m){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)AT(o,u,h,m),u=u.sibling}function AT(o,u,h,m){var b=u.flags;switch(u.tag){case 0:case 11:case 15:si(o,u,h,m),b&2048&&Jc(9,u);break;case 1:si(o,u,h,m);break;case 3:si(o,u,h,m),b&2048&&(o=null,u.alternate!==null&&(o=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==o&&(u.refCount++,o!=null&&$c(o)));break;case 12:if(b&2048){si(o,u,h,m),o=u.stateNode;try{var S=u.memoizedProps,C=S.id,D=S.onPostCommit;typeof D=="function"&&D(C,u.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(I){tt(u,u.return,I)}}else si(o,u,h,m);break;case 31:si(o,u,h,m);break;case 13:si(o,u,h,m);break;case 23:break;case 22:S=u.stateNode,C=u.alternate,u.memoizedState!==null?S._visibility&2?si(o,u,h,m):tf(o,u):S._visibility&2?si(o,u,h,m):(S._visibility|=2,Ys(o,u,h,m,(u.subtreeFlags&10256)!==0||!1)),b&2048&&hb(C,u);break;case 24:si(o,u,h,m),b&2048&&db(u.alternate,u);break;default:si(o,u,h,m)}}function Ys(o,u,h,m,b){for(b=b&&((u.subtreeFlags&10256)!==0||!1),u=u.child;u!==null;){var S=o,C=u,D=h,I=m,F=C.flags;switch(C.tag){case 0:case 11:case 15:Ys(S,C,D,I,b),Jc(8,C);break;case 23:break;case 22:var Z=C.stateNode;C.memoizedState!==null?Z._visibility&2?Ys(S,C,D,I,b):tf(S,C):(Z._visibility|=2,Ys(S,C,D,I,b)),b&&F&2048&&hb(C.alternate,C);break;case 24:Ys(S,C,D,I,b),b&&F&2048&&db(C.alternate,C);break;default:Ys(S,C,D,I,b)}u=u.sibling}}function tf(o,u){if(u.subtreeFlags&10256)for(u=u.child;u!==null;){var h=o,m=u,b=m.flags;switch(m.tag){case 22:tf(h,m),b&2048&&hb(m.alternate,m);break;case 24:tf(h,m),b&2048&&db(m.alternate,m);break;default:tf(h,m)}u=u.sibling}}var nf=8192;function Gs(o,u,h){if(o.subtreeFlags&nf)for(o=o.child;o!==null;)kT(o,u,h),o=o.sibling}function kT(o,u,h){switch(o.tag){case 26:Gs(o,u,h),o.flags&nf&&o.memoizedState!==null&&XU(h,oi,o.memoizedState,o.memoizedProps);break;case 5:Gs(o,u,h);break;case 3:case 4:var m=oi;oi=xp(o.stateNode.containerInfo),Gs(o,u,h),oi=m;break;case 22:o.memoizedState===null&&(m=o.alternate,m!==null&&m.memoizedState!==null?(m=nf,nf=16777216,Gs(o,u,h),nf=m):Gs(o,u,h));break;default:Gs(o,u,h)}}function CT(o){var u=o.alternate;if(u!==null&&(o=u.child,o!==null)){u.child=null;do u=o.sibling,o.sibling=null,o=u;while(o!==null)}}function rf(o){var u=o.deletions;if((o.flags&16)!==0){if(u!==null)for(var h=0;h<u.length;h++){var m=u[h];tn=m,TT(m,o)}CT(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)ET(o),o=o.sibling}function ET(o){switch(o.tag){case 0:case 11:case 15:rf(o),o.flags&2048&&ml(9,o,o.return);break;case 3:rf(o);break;case 12:rf(o);break;case 22:var u=o.stateNode;o.memoizedState!==null&&u._visibility&2&&(o.return===null||o.return.tag!==13)?(u._visibility&=-3,op(o)):rf(o);break;default:rf(o)}}function op(o){var u=o.deletions;if((o.flags&16)!==0){if(u!==null)for(var h=0;h<u.length;h++){var m=u[h];tn=m,TT(m,o)}CT(o)}for(o=o.child;o!==null;){switch(u=o,u.tag){case 0:case 11:case 15:ml(8,u,u.return),op(u);break;case 22:h=u.stateNode,h._visibility&2&&(h._visibility&=-3,op(u));break;default:op(u)}o=o.sibling}}function TT(o,u){for(;tn!==null;){var h=tn;switch(h.tag){case 0:case 11:case 15:ml(8,h,u);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var m=h.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:$c(h.memoizedState.cache)}if(m=h.child,m!==null)m.return=h,tn=m;else e:for(h=o;tn!==null;){m=tn;var b=m.sibling,S=m.return;if(yT(m),m===h){tn=null;break e}if(b!==null){b.return=S,tn=b;break e}tn=S}}}var uU={getCacheForType:function(o){var u=gn(zt),h=u.data.get(o);return h===void 0&&(h=o(),u.data.set(o,h)),h},cacheSignal:function(){return gn(zt).controller.signal}},cU=typeof WeakMap=="function"?WeakMap:Map,Ze=0,ut=null,je=null,$e=0,et=0,br=null,gl=!1,Zs=!1,pb=!1,wa=0,Tt=0,vl=0,ko=0,mb=0,xr=0,Js=0,af=null,Jn=null,gb=!1,sp=0,MT=0,up=1/0,cp=null,yl=null,Wt=0,bl=null,eu=null,Oa=0,vb=0,yb=null,PT=null,lf=0,bb=null;function Sr(){return(Ze&2)!==0&&$e!==0?$e&-$e:z.T!==null?kb():Vk()}function DT(){if(xr===0)if(($e&536870912)===0||Fe){var o=yd;yd<<=1,(yd&3932160)===0&&(yd=262144),xr=o}else xr=536870912;return o=vr.current,o!==null&&(o.flags|=32),xr}function er(o,u,h){(o===ut&&(et===2||et===9)||o.cancelPendingCommit!==null)&&(tu(o,0),xl(o,$e,xr,!1)),Cc(o,h),((Ze&2)===0||o!==ut)&&(o===ut&&((Ze&2)===0&&(ko|=h),Tt===4&&xl(o,$e,xr,!1)),Mi(o))}function RT(o,u,h){if((Ze&6)!==0)throw Error(r(327));var m=!h&&(u&127)===0&&(u&o.expiredLanes)===0||kc(o,u),b=m?dU(o,u):Sb(o,u,!0),S=m;do{if(b===0){Zs&&!m&&xl(o,u,0,!1);break}else{if(h=o.current.alternate,S&&!fU(h)){b=Sb(o,u,!1),S=!1;continue}if(b===2){if(S=u,o.errorRecoveryDisabledLanes&S)var C=0;else C=o.pendingLanes&-536870913,C=C!==0?C:C&536870912?536870912:0;if(C!==0){u=C;e:{var D=o;b=af;var I=D.current.memoizedState.isDehydrated;if(I&&(tu(D,C).flags|=256),C=Sb(D,C,!1),C!==2){if(pb&&!I){D.errorRecoveryDisabledLanes|=S,ko|=S,b=4;break e}S=Jn,Jn=b,S!==null&&(Jn===null?Jn=S:Jn.push.apply(Jn,S))}b=C}if(S=!1,b!==2)continue}}if(b===1){tu(o,0),xl(o,u,0,!0);break}e:{switch(m=o,S=b,S){case 0:case 1:throw Error(r(345));case 4:if((u&4194048)!==u)break;case 6:xl(m,u,xr,!gl);break e;case 2:Jn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((u&62914560)===u&&(b=sp+300-hr(),10<b)){if(xl(m,u,xr,!gl),xd(m,0,!0)!==0)break e;Oa=u,m.timeoutHandle=u2(_T.bind(null,m,h,Jn,cp,gb,u,xr,ko,Js,gl,S,"Throttled",-0,0),b);break e}_T(m,h,Jn,cp,gb,u,xr,ko,Js,gl,S,null,-0,0)}}break}while(!0);Mi(o)}function _T(o,u,h,m,b,S,C,D,I,F,Z,te,W,Q){if(o.timeoutHandle=-1,te=u.subtreeFlags,te&8192||(te&16785408)===16785408){te={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:sa},kT(u,S,te);var ye=(S&62914560)===S?sp-hr():(S&4194048)===S?MT-hr():0;if(ye=QU(te,ye),ye!==null){Oa=S,o.cancelPendingCommit=ye(HT.bind(null,o,u,S,h,m,b,C,D,I,Z,te,null,W,Q)),xl(o,S,C,!F);return}}HT(o,u,S,h,m,b,C,D,I)}function fU(o){for(var u=o;;){var h=u.tag;if((h===0||h===11||h===15)&&u.flags&16384&&(h=u.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var m=0;m<h.length;m++){var b=h[m],S=b.getSnapshot;b=b.value;try{if(!mr(S(),b))return!1}catch{return!1}}if(h=u.child,u.subtreeFlags&16384&&h!==null)h.return=u,u=h;else{if(u===o)break;for(;u.sibling===null;){if(u.return===null||u.return===o)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function xl(o,u,h,m){u&=~mb,u&=~ko,o.suspendedLanes|=u,o.pingedLanes&=~u,m&&(o.warmLanes|=u),m=o.expirationTimes;for(var b=u;0<b;){var S=31-pr(b),C=1<<S;m[S]=-1,b&=~C}h!==0&&Fk(o,h,u)}function fp(){return(Ze&6)===0?(of(0),!1):!0}function xb(){if(je!==null){if(et===0)var o=je.return;else o=je,ha=go=null,L0(o),Ws=null,Uc=0,o=je;for(;o!==null;)cT(o.alternate,o),o=o.return;je=null}}function tu(o,u){var h=o.timeoutHandle;h!==-1&&(o.timeoutHandle=-1,DU(h)),h=o.cancelPendingCommit,h!==null&&(o.cancelPendingCommit=null,h()),Oa=0,xb(),ut=o,je=h=ca(o.current,null),$e=u,et=0,br=null,gl=!1,Zs=kc(o,u),pb=!1,Js=xr=mb=ko=vl=Tt=0,Jn=af=null,gb=!1,(u&8)!==0&&(u|=u&32);var m=o.entangledLanes;if(m!==0)for(o=o.entanglements,m&=u;0<m;){var b=31-pr(m),S=1<<b;u|=o[b],m&=~S}return wa=u,Rd(),h}function NT(o,u){Ne=null,z.H=Yc,u===qs||u===$d?(u=YC(),et=3):u===A0?(u=YC(),et=4):et=u===Z0?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,br=u,je===null&&(Tt=1,ep(o,jr(u,o.current)))}function IT(){var o=vr.current;return o===null?!0:($e&4194048)===$e?Hr===null:($e&62914560)===$e||($e&536870912)!==0?o===Hr:!1}function LT(){var o=z.H;return z.H=Yc,o===null?Yc:o}function jT(){var o=z.A;return z.A=uU,o}function hp(){Tt=4,gl||($e&4194048)!==$e&&vr.current!==null||(Zs=!0),(vl&134217727)===0&&(ko&134217727)===0||ut===null||xl(ut,$e,xr,!1)}function Sb(o,u,h){var m=Ze;Ze|=2;var b=LT(),S=jT();(ut!==o||$e!==u)&&(cp=null,tu(o,u)),u=!1;var C=Tt;e:do try{if(et!==0&&je!==null){var D=je,I=br;switch(et){case 8:xb(),C=6;break e;case 3:case 2:case 9:case 6:vr.current===null&&(u=!0);var F=et;if(et=0,br=null,nu(o,D,I,F),h&&Zs){C=0;break e}break;default:F=et,et=0,br=null,nu(o,D,I,F)}}hU(),C=Tt;break}catch(Z){NT(o,Z)}while(!0);return u&&o.shellSuspendCounter++,ha=go=null,Ze=m,z.H=b,z.A=S,je===null&&(ut=null,$e=0,Rd()),C}function hU(){for(;je!==null;)BT(je)}function dU(o,u){var h=Ze;Ze|=2;var m=LT(),b=jT();ut!==o||$e!==u?(cp=null,up=hr()+500,tu(o,u)):Zs=kc(o,u);e:do try{if(et!==0&&je!==null){u=je;var S=br;t:switch(et){case 1:et=0,br=null,nu(o,u,S,1);break;case 2:case 9:if(XC(S)){et=0,br=null,zT(u);break}u=function(){et!==2&&et!==9||ut!==o||(et=7),Mi(o)},S.then(u,u);break e;case 3:et=7;break e;case 4:et=5;break e;case 7:XC(S)?(et=0,br=null,zT(u)):(et=0,br=null,nu(o,u,S,7));break;case 5:var C=null;switch(je.tag){case 26:C=je.memoizedState;case 5:case 27:var D=je;if(C?A2(C):D.stateNode.complete){et=0,br=null;var I=D.sibling;if(I!==null)je=I;else{var F=D.return;F!==null?(je=F,dp(F)):je=null}break t}}et=0,br=null,nu(o,u,S,5);break;case 6:et=0,br=null,nu(o,u,S,6);break;case 8:xb(),Tt=6;break e;default:throw Error(r(462))}}pU();break}catch(Z){NT(o,Z)}while(!0);return ha=go=null,z.H=m,z.A=b,Ze=h,je!==null?0:(ut=null,$e=0,Rd(),Tt)}function pU(){for(;je!==null&&!j6();)BT(je)}function BT(o){var u=sT(o.alternate,o,wa);o.memoizedProps=o.pendingProps,u===null?dp(o):je=u}function zT(o){var u=o,h=u.alternate;switch(u.tag){case 15:case 0:u=nT(h,u,u.pendingProps,u.type,void 0,$e);break;case 11:u=nT(h,u,u.pendingProps,u.type.render,u.ref,$e);break;case 5:L0(u);default:cT(h,u),u=je=jC(u,wa),u=sT(h,u,wa)}o.memoizedProps=o.pendingProps,u===null?dp(o):je=u}function nu(o,u,h,m){ha=go=null,L0(u),Ws=null,Uc=0;var b=u.return;try{if(nU(o,b,u,h,$e)){Tt=1,ep(o,jr(h,o.current)),je=null;return}}catch(S){if(b!==null)throw je=b,S;Tt=1,ep(o,jr(h,o.current)),je=null;return}u.flags&32768?(Fe||m===1?o=!0:Zs||($e&536870912)!==0?o=!1:(gl=o=!0,(m===2||m===9||m===3||m===6)&&(m=vr.current,m!==null&&m.tag===13&&(m.flags|=16384))),$T(u,o)):dp(u)}function dp(o){var u=o;do{if((u.flags&32768)!==0){$T(u,gl);return}o=u.return;var h=aU(u.alternate,u,wa);if(h!==null){je=h;return}if(u=u.sibling,u!==null){je=u;return}je=u=o}while(u!==null);Tt===0&&(Tt=5)}function $T(o,u){do{var h=lU(o.alternate,o);if(h!==null){h.flags&=32767,je=h;return}if(h=o.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!u&&(o=o.sibling,o!==null)){je=o;return}je=o=h}while(o!==null);Tt=6,je=null}function HT(o,u,h,m,b,S,C,D,I){o.cancelPendingCommit=null;do pp();while(Wt!==0);if((Ze&6)!==0)throw Error(r(327));if(u!==null){if(u===o.current)throw Error(r(177));if(S=u.lanes|u.childLanes,S|=u0,K6(o,h,S,C,D,I),o===ut&&(je=ut=null,$e=0),eu=u,bl=o,Oa=h,vb=S,yb=b,PT=m,(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,yU(gd,function(){return VT(),null})):(o.callbackNode=null,o.callbackPriority=0),m=(u.flags&13878)!==0,(u.subtreeFlags&13878)!==0||m){m=z.T,z.T=null,b=G.p,G.p=2,C=Ze,Ze|=4;try{oU(o,u,h)}finally{Ze=C,G.p=b,z.T=m}}Wt=1,UT(),FT(),qT()}}function UT(){if(Wt===1){Wt=0;var o=bl,u=eu,h=(u.flags&13878)!==0;if((u.subtreeFlags&13878)!==0||h){h=z.T,z.T=null;var m=G.p;G.p=2;var b=Ze;Ze|=4;try{wT(u,o);var S=_b,C=TC(o.containerInfo),D=S.focusedElem,I=S.selectionRange;if(C!==D&&D&&D.ownerDocument&&EC(D.ownerDocument.documentElement,D)){if(I!==null&&i0(D)){var F=I.start,Z=I.end;if(Z===void 0&&(Z=F),"selectionStart"in D)D.selectionStart=F,D.selectionEnd=Math.min(Z,D.value.length);else{var te=D.ownerDocument||document,W=te&&te.defaultView||window;if(W.getSelection){var Q=W.getSelection(),ye=D.textContent.length,Me=Math.min(I.start,ye),at=I.end===void 0?Me:Math.min(I.end,ye);!Q.extend&&Me>at&&(C=at,at=Me,Me=C);var $=CC(D,Me),j=CC(D,at);if($&&j&&(Q.rangeCount!==1||Q.anchorNode!==$.node||Q.anchorOffset!==$.offset||Q.focusNode!==j.node||Q.focusOffset!==j.offset)){var U=te.createRange();U.setStart($.node,$.offset),Q.removeAllRanges(),Me>at?(Q.addRange(U),Q.extend(j.node,j.offset)):(U.setEnd(j.node,j.offset),Q.addRange(U))}}}}for(te=[],Q=D;Q=Q.parentNode;)Q.nodeType===1&&te.push({element:Q,left:Q.scrollLeft,top:Q.scrollTop});for(typeof D.focus=="function"&&D.focus(),D=0;D<te.length;D++){var ee=te[D];ee.element.scrollLeft=ee.left,ee.element.scrollTop=ee.top}}Cp=!!Rb,_b=Rb=null}finally{Ze=b,G.p=m,z.T=h}}o.current=u,Wt=2}}function FT(){if(Wt===2){Wt=0;var o=bl,u=eu,h=(u.flags&8772)!==0;if((u.subtreeFlags&8772)!==0||h){h=z.T,z.T=null;var m=G.p;G.p=2;var b=Ze;Ze|=4;try{vT(o,u.alternate,u)}finally{Ze=b,G.p=m,z.T=h}}Wt=3}}function qT(){if(Wt===4||Wt===3){Wt=0,B6();var o=bl,u=eu,h=Oa,m=PT;(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?Wt=5:(Wt=0,eu=bl=null,WT(o,o.pendingLanes));var b=o.pendingLanes;if(b===0&&(yl=null),zy(h),u=u.stateNode,dr&&typeof dr.onCommitFiberRoot=="function")try{dr.onCommitFiberRoot(Ac,u,void 0,(u.current.flags&128)===128)}catch{}if(m!==null){u=z.T,b=G.p,G.p=2,z.T=null;try{for(var S=o.onRecoverableError,C=0;C<m.length;C++){var D=m[C];S(D.value,{componentStack:D.stack})}}finally{z.T=u,G.p=b}}(Oa&3)!==0&&pp(),Mi(o),b=o.pendingLanes,(h&261930)!==0&&(b&42)!==0?o===bb?lf++:(lf=0,bb=o):lf=0,of(0)}}function WT(o,u){(o.pooledCacheLanes&=u)===0&&(u=o.pooledCache,u!=null&&(o.pooledCache=null,$c(u)))}function pp(){return UT(),FT(),qT(),VT()}function VT(){if(Wt!==5)return!1;var o=bl,u=vb;vb=0;var h=zy(Oa),m=z.T,b=G.p;try{G.p=32>h?32:h,z.T=null,h=yb,yb=null;var S=bl,C=Oa;if(Wt=0,eu=bl=null,Oa=0,(Ze&6)!==0)throw Error(r(331));var D=Ze;if(Ze|=4,ET(S.current),AT(S,S.current,C,h),Ze=D,of(0,!1),dr&&typeof dr.onPostCommitFiberRoot=="function")try{dr.onPostCommitFiberRoot(Ac,S)}catch{}return!0}finally{G.p=b,z.T=m,WT(o,u)}}function KT(o,u,h){u=jr(h,u),u=G0(o.stateNode,u,2),o=hl(o,u,2),o!==null&&(Cc(o,2),Mi(o))}function tt(o,u,h){if(o.tag===3)KT(o,o,h);else for(;u!==null;){if(u.tag===3){KT(u,o,h);break}else if(u.tag===1){var m=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(yl===null||!yl.has(m))){o=jr(h,o),h=XE(2),m=hl(u,h,2),m!==null&&(QE(h,m,u,o),Cc(m,2),Mi(m));break}}u=u.return}}function wb(o,u,h){var m=o.pingCache;if(m===null){m=o.pingCache=new cU;var b=new Set;m.set(u,b)}else b=m.get(u),b===void 0&&(b=new Set,m.set(u,b));b.has(h)||(pb=!0,b.add(h),o=mU.bind(null,o,u,h),u.then(o,o))}function mU(o,u,h){var m=o.pingCache;m!==null&&m.delete(u),o.pingedLanes|=o.suspendedLanes&h,o.warmLanes&=~h,ut===o&&($e&h)===h&&(Tt===4||Tt===3&&($e&62914560)===$e&&300>hr()-sp?(Ze&2)===0&&tu(o,0):mb|=h,Js===$e&&(Js=0)),Mi(o)}function XT(o,u){u===0&&(u=Uk()),o=ho(o,u),o!==null&&(Cc(o,u),Mi(o))}function gU(o){var u=o.memoizedState,h=0;u!==null&&(h=u.retryLane),XT(o,h)}function vU(o,u){var h=0;switch(o.tag){case 31:case 13:var m=o.stateNode,b=o.memoizedState;b!==null&&(h=b.retryLane);break;case 19:m=o.stateNode;break;case 22:m=o.stateNode._retryCache;break;default:throw Error(r(314))}m!==null&&m.delete(u),XT(o,h)}function yU(o,u){return Iy(o,u)}var mp=null,ru=null,Ob=!1,gp=!1,Ab=!1,Sl=0;function Mi(o){o!==ru&&o.next===null&&(ru===null?mp=ru=o:ru=ru.next=o),gp=!0,Ob||(Ob=!0,xU())}function of(o,u){if(!Ab&&gp){Ab=!0;do for(var h=!1,m=mp;m!==null;){if(o!==0){var b=m.pendingLanes;if(b===0)var S=0;else{var C=m.suspendedLanes,D=m.pingedLanes;S=(1<<31-pr(42|o)+1)-1,S&=b&~(C&~D),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(h=!0,ZT(m,S))}else S=$e,S=xd(m,m===ut?S:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(S&3)===0||kc(m,S)||(h=!0,ZT(m,S));m=m.next}while(h);Ab=!1}}function bU(){QT()}function QT(){gp=Ob=!1;var o=0;Sl!==0&&PU()&&(o=Sl);for(var u=hr(),h=null,m=mp;m!==null;){var b=m.next,S=YT(m,u);S===0?(m.next=null,h===null?mp=b:h.next=b,b===null&&(ru=h)):(h=m,(o!==0||(S&3)!==0)&&(gp=!0)),m=b}Wt!==0&&Wt!==5||of(o),Sl!==0&&(Sl=0)}function YT(o,u){for(var h=o.suspendedLanes,m=o.pingedLanes,b=o.expirationTimes,S=o.pendingLanes&-62914561;0<S;){var C=31-pr(S),D=1<<C,I=b[C];I===-1?((D&h)===0||(D&m)!==0)&&(b[C]=V6(D,u)):I<=u&&(o.expiredLanes|=D),S&=~D}if(u=ut,h=$e,h=xd(o,o===u?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),m=o.callbackNode,h===0||o===u&&(et===2||et===9)||o.cancelPendingCommit!==null)return m!==null&&m!==null&&Ly(m),o.callbackNode=null,o.callbackPriority=0;if((h&3)===0||kc(o,h)){if(u=h&-h,u===o.callbackPriority)return u;switch(m!==null&&Ly(m),zy(h)){case 2:case 8:h=$k;break;case 32:h=gd;break;case 268435456:h=Hk;break;default:h=gd}return m=GT.bind(null,o),h=Iy(h,m),o.callbackPriority=u,o.callbackNode=h,u}return m!==null&&m!==null&&Ly(m),o.callbackPriority=2,o.callbackNode=null,2}function GT(o,u){if(Wt!==0&&Wt!==5)return o.callbackNode=null,o.callbackPriority=0,null;var h=o.callbackNode;if(pp()&&o.callbackNode!==h)return null;var m=$e;return m=xd(o,o===ut?m:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),m===0?null:(RT(o,m,u),YT(o,hr()),o.callbackNode!=null&&o.callbackNode===h?GT.bind(null,o):null)}function ZT(o,u){if(pp())return null;RT(o,u,!0)}function xU(){RU(function(){(Ze&6)!==0?Iy(zk,bU):QT()})}function kb(){if(Sl===0){var o=Us;o===0&&(o=vd,vd<<=1,(vd&261888)===0&&(vd=256)),Sl=o}return Sl}function JT(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:Ad(""+o)}function e2(o,u){var h=u.ownerDocument.createElement("input");return h.name=u.name,h.value=u.value,o.id&&h.setAttribute("form",o.id),u.parentNode.insertBefore(h,u),o=new FormData(o),h.parentNode.removeChild(h),o}function SU(o,u,h,m,b){if(u==="submit"&&h&&h.stateNode===b){var S=JT((b[Xn]||null).action),C=m.submitter;C&&(u=(u=C[Xn]||null)?JT(u.formAction):C.getAttribute("formAction"),u!==null&&(S=u,C=null));var D=new Td("action","action",null,m,b);o.push({event:D,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(Sl!==0){var I=C?e2(b,C):new FormData(b);W0(h,{pending:!0,data:I,method:b.method,action:S},null,I)}}else typeof S=="function"&&(D.preventDefault(),I=C?e2(b,C):new FormData(b),W0(h,{pending:!0,data:I,method:b.method,action:S},S,I))},currentTarget:b}]})}}for(var Cb=0;Cb<s0.length;Cb++){var Eb=s0[Cb],wU=Eb.toLowerCase(),OU=Eb[0].toUpperCase()+Eb.slice(1);li(wU,"on"+OU)}li(DC,"onAnimationEnd"),li(RC,"onAnimationIteration"),li(_C,"onAnimationStart"),li("dblclick","onDoubleClick"),li("focusin","onFocus"),li("focusout","onBlur"),li(zH,"onTransitionRun"),li($H,"onTransitionStart"),li(HH,"onTransitionCancel"),li(NC,"onTransitionEnd"),Ts("onMouseEnter",["mouseout","mouseover"]),Ts("onMouseLeave",["mouseout","mouseover"]),Ts("onPointerEnter",["pointerout","pointerover"]),Ts("onPointerLeave",["pointerout","pointerover"]),so("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),so("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),so("onBeforeInput",["compositionend","keypress","textInput","paste"]),so("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),so("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),so("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var sf="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(" "),AU=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(sf));function t2(o,u){u=(u&4)!==0;for(var h=0;h<o.length;h++){var m=o[h],b=m.event;m=m.listeners;e:{var S=void 0;if(u)for(var C=m.length-1;0<=C;C--){var D=m[C],I=D.instance,F=D.currentTarget;if(D=D.listener,I!==S&&b.isPropagationStopped())break e;S=D,b.currentTarget=F;try{S(b)}catch(Z){Dd(Z)}b.currentTarget=null,S=I}else for(C=0;C<m.length;C++){if(D=m[C],I=D.instance,F=D.currentTarget,D=D.listener,I!==S&&b.isPropagationStopped())break e;S=D,b.currentTarget=F;try{S(b)}catch(Z){Dd(Z)}b.currentTarget=null,S=I}}}}function Be(o,u){var h=u[$y];h===void 0&&(h=u[$y]=new Set);var m=o+"__bubble";h.has(m)||(n2(u,o,2,!1),h.add(m))}function Tb(o,u,h){var m=0;u&&(m|=4),n2(h,o,m,u)}var vp="_reactListening"+Math.random().toString(36).slice(2);function Mb(o){if(!o[vp]){o[vp]=!0,Qk.forEach(function(h){h!=="selectionchange"&&(AU.has(h)||Tb(h,!1,o),Tb(h,!0,o))});var u=o.nodeType===9?o:o.ownerDocument;u===null||u[vp]||(u[vp]=!0,Tb("selectionchange",!1,u))}}function n2(o,u,h,m){switch(D2(u)){case 2:var b=ZU;break;case 8:b=JU;break;default:b=qb}h=b.bind(null,u,h,o),b=void 0,!Qy||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(b=!0),m?b!==void 0?o.addEventListener(u,h,{capture:!0,passive:b}):o.addEventListener(u,h,!0):b!==void 0?o.addEventListener(u,h,{passive:b}):o.addEventListener(u,h,!1)}function Pb(o,u,h,m,b){var S=m;if((u&1)===0&&(u&2)===0&&m!==null)e:for(;;){if(m===null)return;var C=m.tag;if(C===3||C===4){var D=m.stateNode.containerInfo;if(D===b)break;if(C===4)for(C=m.return;C!==null;){var I=C.tag;if((I===3||I===4)&&C.stateNode.containerInfo===b)return;C=C.return}for(;D!==null;){if(C=ks(D),C===null)return;if(I=C.tag,I===5||I===6||I===26||I===27){m=S=C;continue e}D=D.parentNode}}m=m.return}oC(function(){var F=S,Z=Ky(h),te=[];e:{var W=IC.get(o);if(W!==void 0){var Q=Td,ye=o;switch(o){case"keypress":if(Cd(h)===0)break e;case"keydown":case"keyup":Q=vH;break;case"focusin":ye="focus",Q=Jy;break;case"focusout":ye="blur",Q=Jy;break;case"beforeblur":case"afterblur":Q=Jy;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Q=cC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=aH;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=xH;break;case DC:case RC:case _C:Q=sH;break;case NC:Q=wH;break;case"scroll":case"scrollend":Q=rH;break;case"wheel":Q=AH;break;case"copy":case"cut":case"paste":Q=cH;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=hC;break;case"toggle":case"beforetoggle":Q=CH}var Me=(u&4)!==0,at=!Me&&(o==="scroll"||o==="scrollend"),$=Me?W!==null?W+"Capture":null:W;Me=[];for(var j=F,U;j!==null;){var ee=j;if(U=ee.stateNode,ee=ee.tag,ee!==5&&ee!==26&&ee!==27||U===null||$===null||(ee=Mc(j,$),ee!=null&&Me.push(uf(j,ee,U))),at)break;j=j.return}0<Me.length&&(W=new Q(W,ye,null,h,Z),te.push({event:W,listeners:Me}))}}if((u&7)===0){e:{if(W=o==="mouseover"||o==="pointerover",Q=o==="mouseout"||o==="pointerout",W&&h!==Vy&&(ye=h.relatedTarget||h.fromElement)&&(ks(ye)||ye[As]))break e;if((Q||W)&&(W=Z.window===Z?Z:(W=Z.ownerDocument)?W.defaultView||W.parentWindow:window,Q?(ye=h.relatedTarget||h.toElement,Q=F,ye=ye?ks(ye):null,ye!==null&&(at=a(ye),Me=ye.tag,ye!==at||Me!==5&&Me!==27&&Me!==6)&&(ye=null)):(Q=null,ye=F),Q!==ye)){if(Me=cC,ee="onMouseLeave",$="onMouseEnter",j="mouse",(o==="pointerout"||o==="pointerover")&&(Me=hC,ee="onPointerLeave",$="onPointerEnter",j="pointer"),at=Q==null?W:Tc(Q),U=ye==null?W:Tc(ye),W=new Me(ee,j+"leave",Q,h,Z),W.target=at,W.relatedTarget=U,ee=null,ks(Z)===F&&(Me=new Me($,j+"enter",ye,h,Z),Me.target=U,Me.relatedTarget=at,ee=Me),at=ee,Q&&ye)t:{for(Me=kU,$=Q,j=ye,U=0,ee=$;ee;ee=Me(ee))U++;ee=0;for(var Ae=j;Ae;Ae=Me(Ae))ee++;for(;0<U-ee;)$=Me($),U--;for(;0<ee-U;)j=Me(j),ee--;for(;U--;){if($===j||j!==null&&$===j.alternate){Me=$;break t}$=Me($),j=Me(j)}Me=null}else Me=null;Q!==null&&r2(te,W,Q,Me,!1),ye!==null&&at!==null&&r2(te,at,ye,Me,!0)}}e:{if(W=F?Tc(F):window,Q=W.nodeName&&W.nodeName.toLowerCase(),Q==="select"||Q==="input"&&W.type==="file")var Xe=xC;else if(yC(W))if(SC)Xe=LH;else{Xe=NH;var Se=_H}else Q=W.nodeName,!Q||Q.toLowerCase()!=="input"||W.type!=="checkbox"&&W.type!=="radio"?F&&Wy(F.elementType)&&(Xe=xC):Xe=IH;if(Xe&&(Xe=Xe(o,F))){bC(te,Xe,h,Z);break e}Se&&Se(o,W,F),o==="focusout"&&F&&W.type==="number"&&F.memoizedProps.value!=null&&qy(W,"number",W.value)}switch(Se=F?Tc(F):window,o){case"focusin":(yC(Se)||Se.contentEditable==="true")&&(Ns=Se,a0=F,jc=null);break;case"focusout":jc=a0=Ns=null;break;case"mousedown":l0=!0;break;case"contextmenu":case"mouseup":case"dragend":l0=!1,MC(te,h,Z);break;case"selectionchange":if(BH)break;case"keydown":case"keyup":MC(te,h,Z)}var Ie;if(t0)e:{switch(o){case"compositionstart":var He="onCompositionStart";break e;case"compositionend":He="onCompositionEnd";break e;case"compositionupdate":He="onCompositionUpdate";break e}He=void 0}else _s?gC(o,h)&&(He="onCompositionEnd"):o==="keydown"&&h.keyCode===229&&(He="onCompositionStart");He&&(dC&&h.locale!=="ko"&&(_s||He!=="onCompositionStart"?He==="onCompositionEnd"&&_s&&(Ie=sC()):(al=Z,Yy="value"in al?al.value:al.textContent,_s=!0)),Se=yp(F,He),0<Se.length&&(He=new fC(He,o,null,h,Z),te.push({event:He,listeners:Se}),Ie?He.data=Ie:(Ie=vC(h),Ie!==null&&(He.data=Ie)))),(Ie=TH?MH(o,h):PH(o,h))&&(He=yp(F,"onBeforeInput"),0<He.length&&(Se=new fC("onBeforeInput","beforeinput",null,h,Z),te.push({event:Se,listeners:He}),Se.data=Ie)),SU(te,o,F,h,Z)}t2(te,u)})}function uf(o,u,h){return{instance:o,listener:u,currentTarget:h}}function yp(o,u){for(var h=u+"Capture",m=[];o!==null;){var b=o,S=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||S===null||(b=Mc(o,h),b!=null&&m.unshift(uf(o,b,S)),b=Mc(o,u),b!=null&&m.push(uf(o,b,S))),o.tag===3)return m;o=o.return}return[]}function kU(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function r2(o,u,h,m,b){for(var S=u._reactName,C=[];h!==null&&h!==m;){var D=h,I=D.alternate,F=D.stateNode;if(D=D.tag,I!==null&&I===m)break;D!==5&&D!==26&&D!==27||F===null||(I=F,b?(F=Mc(h,S),F!=null&&C.unshift(uf(h,F,I))):b||(F=Mc(h,S),F!=null&&C.push(uf(h,F,I)))),h=h.return}C.length!==0&&o.push({event:u,listeners:C})}var CU=/\r\n?/g,EU=/\u0000|\uFFFD/g;function i2(o){return(typeof o=="string"?o:""+o).replace(CU,`
|
|
9
|
+
`).replace(EU,"")}function a2(o,u){return u=i2(u),i2(o)===u}function it(o,u,h,m,b,S){switch(h){case"children":typeof m=="string"?u==="body"||u==="textarea"&&m===""||Ps(o,m):(typeof m=="number"||typeof m=="bigint")&&u!=="body"&&Ps(o,""+m);break;case"className":wd(o,"class",m);break;case"tabIndex":wd(o,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":wd(o,h,m);break;case"style":aC(o,m,S);break;case"data":if(u!=="object"){wd(o,"data",m);break}case"src":case"href":if(m===""&&(u!=="a"||h!=="href")){o.removeAttribute(h);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){o.removeAttribute(h);break}m=Ad(""+m),o.setAttribute(h,m);break;case"action":case"formAction":if(typeof m=="function"){o.setAttribute(h,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof S=="function"&&(h==="formAction"?(u!=="input"&&it(o,u,"name",b.name,b,null),it(o,u,"formEncType",b.formEncType,b,null),it(o,u,"formMethod",b.formMethod,b,null),it(o,u,"formTarget",b.formTarget,b,null)):(it(o,u,"encType",b.encType,b,null),it(o,u,"method",b.method,b,null),it(o,u,"target",b.target,b,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){o.removeAttribute(h);break}m=Ad(""+m),o.setAttribute(h,m);break;case"onClick":m!=null&&(o.onclick=sa);break;case"onScroll":m!=null&&Be("scroll",o);break;case"onScrollEnd":m!=null&&Be("scrollend",o);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(h=m.__html,h!=null){if(b.children!=null)throw Error(r(60));o.innerHTML=h}}break;case"multiple":o.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":o.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){o.removeAttribute("xlink:href");break}h=Ad(""+m),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?o.setAttribute(h,""+m):o.removeAttribute(h);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?o.setAttribute(h,""):o.removeAttribute(h);break;case"capture":case"download":m===!0?o.setAttribute(h,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?o.setAttribute(h,m):o.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?o.setAttribute(h,m):o.removeAttribute(h);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?o.removeAttribute(h):o.setAttribute(h,m);break;case"popover":Be("beforetoggle",o),Be("toggle",o),Sd(o,"popover",m);break;case"xlinkActuate":oa(o,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":oa(o,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":oa(o,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":oa(o,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":oa(o,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":oa(o,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":oa(o,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":oa(o,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":oa(o,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":Sd(o,"is",m);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=tH.get(h)||h,Sd(o,h,m))}}function Db(o,u,h,m,b,S){switch(h){case"style":aC(o,m,S);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(h=m.__html,h!=null){if(b.children!=null)throw Error(r(60));o.innerHTML=h}}break;case"children":typeof m=="string"?Ps(o,m):(typeof m=="number"||typeof m=="bigint")&&Ps(o,""+m);break;case"onScroll":m!=null&&Be("scroll",o);break;case"onScrollEnd":m!=null&&Be("scrollend",o);break;case"onClick":m!=null&&(o.onclick=sa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Yk.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(b=h.endsWith("Capture"),u=h.slice(2,b?h.length-7:void 0),S=o[Xn]||null,S=S!=null?S[h]:null,typeof S=="function"&&o.removeEventListener(u,S,b),typeof m=="function")){typeof S!="function"&&S!==null&&(h in o?o[h]=null:o.hasAttribute(h)&&o.removeAttribute(h)),o.addEventListener(u,m,b);break e}h in o?o[h]=m:m===!0?o.setAttribute(h,""):Sd(o,h,m)}}}function yn(o,u,h){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Be("error",o),Be("load",o);var m=!1,b=!1,S;for(S in h)if(h.hasOwnProperty(S)){var C=h[S];if(C!=null)switch(S){case"src":m=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:it(o,u,S,C,h,null)}}b&&it(o,u,"srcSet",h.srcSet,h,null),m&&it(o,u,"src",h.src,h,null);return;case"input":Be("invalid",o);var D=S=C=b=null,I=null,F=null;for(m in h)if(h.hasOwnProperty(m)){var Z=h[m];if(Z!=null)switch(m){case"name":b=Z;break;case"type":C=Z;break;case"checked":I=Z;break;case"defaultChecked":F=Z;break;case"value":S=Z;break;case"defaultValue":D=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(r(137,u));break;default:it(o,u,m,Z,h,null)}}tC(o,S,D,I,F,C,b,!1);return;case"select":Be("invalid",o),m=C=S=null;for(b in h)if(h.hasOwnProperty(b)&&(D=h[b],D!=null))switch(b){case"value":S=D;break;case"defaultValue":C=D;break;case"multiple":m=D;default:it(o,u,b,D,h,null)}u=S,h=C,o.multiple=!!m,u!=null?Ms(o,!!m,u,!1):h!=null&&Ms(o,!!m,h,!0);return;case"textarea":Be("invalid",o),S=b=m=null;for(C in h)if(h.hasOwnProperty(C)&&(D=h[C],D!=null))switch(C){case"value":m=D;break;case"defaultValue":b=D;break;case"children":S=D;break;case"dangerouslySetInnerHTML":if(D!=null)throw Error(r(91));break;default:it(o,u,C,D,h,null)}rC(o,m,b,S);return;case"option":for(I in h)h.hasOwnProperty(I)&&(m=h[I],m!=null)&&(I==="selected"?o.selected=m&&typeof m!="function"&&typeof m!="symbol":it(o,u,I,m,h,null));return;case"dialog":Be("beforetoggle",o),Be("toggle",o),Be("cancel",o),Be("close",o);break;case"iframe":case"object":Be("load",o);break;case"video":case"audio":for(m=0;m<sf.length;m++)Be(sf[m],o);break;case"image":Be("error",o),Be("load",o);break;case"details":Be("toggle",o);break;case"embed":case"source":case"link":Be("error",o),Be("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(F in h)if(h.hasOwnProperty(F)&&(m=h[F],m!=null))switch(F){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:it(o,u,F,m,h,null)}return;default:if(Wy(u)){for(Z in h)h.hasOwnProperty(Z)&&(m=h[Z],m!==void 0&&Db(o,u,Z,m,h,void 0));return}}for(D in h)h.hasOwnProperty(D)&&(m=h[D],m!=null&&it(o,u,D,m,h,null))}function TU(o,u,h,m){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,S=null,C=null,D=null,I=null,F=null,Z=null;for(Q in h){var te=h[Q];if(h.hasOwnProperty(Q)&&te!=null)switch(Q){case"checked":break;case"value":break;case"defaultValue":I=te;default:m.hasOwnProperty(Q)||it(o,u,Q,null,m,te)}}for(var W in m){var Q=m[W];if(te=h[W],m.hasOwnProperty(W)&&(Q!=null||te!=null))switch(W){case"type":S=Q;break;case"name":b=Q;break;case"checked":F=Q;break;case"defaultChecked":Z=Q;break;case"value":C=Q;break;case"defaultValue":D=Q;break;case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(r(137,u));break;default:Q!==te&&it(o,u,W,Q,m,te)}}Fy(o,C,D,I,F,Z,S,b);return;case"select":Q=C=D=W=null;for(S in h)if(I=h[S],h.hasOwnProperty(S)&&I!=null)switch(S){case"value":break;case"multiple":Q=I;default:m.hasOwnProperty(S)||it(o,u,S,null,m,I)}for(b in m)if(S=m[b],I=h[b],m.hasOwnProperty(b)&&(S!=null||I!=null))switch(b){case"value":W=S;break;case"defaultValue":D=S;break;case"multiple":C=S;default:S!==I&&it(o,u,b,S,m,I)}u=D,h=C,m=Q,W!=null?Ms(o,!!h,W,!1):!!m!=!!h&&(u!=null?Ms(o,!!h,u,!0):Ms(o,!!h,h?[]:"",!1));return;case"textarea":Q=W=null;for(D in h)if(b=h[D],h.hasOwnProperty(D)&&b!=null&&!m.hasOwnProperty(D))switch(D){case"value":break;case"children":break;default:it(o,u,D,null,m,b)}for(C in m)if(b=m[C],S=h[C],m.hasOwnProperty(C)&&(b!=null||S!=null))switch(C){case"value":W=b;break;case"defaultValue":Q=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==S&&it(o,u,C,b,m,S)}nC(o,W,Q);return;case"option":for(var ye in h)W=h[ye],h.hasOwnProperty(ye)&&W!=null&&!m.hasOwnProperty(ye)&&(ye==="selected"?o.selected=!1:it(o,u,ye,null,m,W));for(I in m)W=m[I],Q=h[I],m.hasOwnProperty(I)&&W!==Q&&(W!=null||Q!=null)&&(I==="selected"?o.selected=W&&typeof W!="function"&&typeof W!="symbol":it(o,u,I,W,m,Q));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Me in h)W=h[Me],h.hasOwnProperty(Me)&&W!=null&&!m.hasOwnProperty(Me)&&it(o,u,Me,null,m,W);for(F in m)if(W=m[F],Q=h[F],m.hasOwnProperty(F)&&W!==Q&&(W!=null||Q!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(r(137,u));break;default:it(o,u,F,W,m,Q)}return;default:if(Wy(u)){for(var at in h)W=h[at],h.hasOwnProperty(at)&&W!==void 0&&!m.hasOwnProperty(at)&&Db(o,u,at,void 0,m,W);for(Z in m)W=m[Z],Q=h[Z],!m.hasOwnProperty(Z)||W===Q||W===void 0&&Q===void 0||Db(o,u,Z,W,m,Q);return}}for(var $ in h)W=h[$],h.hasOwnProperty($)&&W!=null&&!m.hasOwnProperty($)&&it(o,u,$,null,m,W);for(te in m)W=m[te],Q=h[te],!m.hasOwnProperty(te)||W===Q||W==null&&Q==null||it(o,u,te,W,m,Q)}function l2(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function MU(){if(typeof performance.getEntriesByType=="function"){for(var o=0,u=0,h=performance.getEntriesByType("resource"),m=0;m<h.length;m++){var b=h[m],S=b.transferSize,C=b.initiatorType,D=b.duration;if(S&&D&&l2(C)){for(C=0,D=b.responseEnd,m+=1;m<h.length;m++){var I=h[m],F=I.startTime;if(F>D)break;var Z=I.transferSize,te=I.initiatorType;Z&&l2(te)&&(I=I.responseEnd,C+=Z*(I<D?1:(D-F)/(I-F)))}if(--m,u+=8*(S+C)/(b.duration/1e3),o++,10<o)break}}if(0<o)return u/o/1e6}return navigator.connection&&(o=navigator.connection.downlink,typeof o=="number")?o:5}var Rb=null,_b=null;function bp(o){return o.nodeType===9?o:o.ownerDocument}function o2(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function s2(o,u){if(o===0)switch(u){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&u==="foreignObject"?0:o}function Nb(o,u){return o==="textarea"||o==="noscript"||typeof u.children=="string"||typeof u.children=="number"||typeof u.children=="bigint"||typeof u.dangerouslySetInnerHTML=="object"&&u.dangerouslySetInnerHTML!==null&&u.dangerouslySetInnerHTML.__html!=null}var Ib=null;function PU(){var o=window.event;return o&&o.type==="popstate"?o===Ib?!1:(Ib=o,!0):(Ib=null,!1)}var u2=typeof setTimeout=="function"?setTimeout:void 0,DU=typeof clearTimeout=="function"?clearTimeout:void 0,c2=typeof Promise=="function"?Promise:void 0,RU=typeof queueMicrotask=="function"?queueMicrotask:typeof c2<"u"?function(o){return c2.resolve(null).then(o).catch(_U)}:u2;function _U(o){setTimeout(function(){throw o})}function wl(o){return o==="head"}function f2(o,u){var h=u,m=0;do{var b=h.nextSibling;if(o.removeChild(h),b&&b.nodeType===8)if(h=b.data,h==="/$"||h==="/&"){if(m===0){o.removeChild(b),ou(u);return}m--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")m++;else if(h==="html")cf(o.ownerDocument.documentElement);else if(h==="head"){h=o.ownerDocument.head,cf(h);for(var S=h.firstChild;S;){var C=S.nextSibling,D=S.nodeName;S[Ec]||D==="SCRIPT"||D==="STYLE"||D==="LINK"&&S.rel.toLowerCase()==="stylesheet"||h.removeChild(S),S=C}}else h==="body"&&cf(o.ownerDocument.body);h=b}while(h);ou(u)}function h2(o,u){var h=o;o=0;do{var m=h.nextSibling;if(h.nodeType===1?u?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(u?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),m&&m.nodeType===8)if(h=m.data,h==="/$"){if(o===0)break;o--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||o++;h=m}while(h)}function Lb(o){var u=o.firstChild;for(u&&u.nodeType===10&&(u=u.nextSibling);u;){var h=u;switch(u=u.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":Lb(h),Hy(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}o.removeChild(h)}}function NU(o,u,h,m){for(;o.nodeType===1;){var b=h;if(o.nodeName.toLowerCase()!==u.toLowerCase()){if(!m&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(m){if(!o[Ec])switch(u){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(S=o.getAttribute("rel"),S==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(S!==b.rel||o.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||o.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||o.getAttribute("title")!==(b.title==null?null:b.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(S=o.getAttribute("src"),(S!==(b.src==null?null:b.src)||o.getAttribute("type")!==(b.type==null?null:b.type)||o.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&S&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(u==="input"&&o.type==="hidden"){var S=b.name==null?null:""+b.name;if(b.type==="hidden"&&o.getAttribute("name")===S)return o}else return o;if(o=Ur(o.nextSibling),o===null)break}return null}function IU(o,u,h){if(u==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!h||(o=Ur(o.nextSibling),o===null))return null;return o}function d2(o,u){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!u||(o=Ur(o.nextSibling),o===null))return null;return o}function jb(o){return o.data==="$?"||o.data==="$~"}function Bb(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function LU(o,u){var h=o.ownerDocument;if(o.data==="$~")o._reactRetry=u;else if(o.data!=="$?"||h.readyState!=="loading")u();else{var m=function(){u(),h.removeEventListener("DOMContentLoaded",m)};h.addEventListener("DOMContentLoaded",m),o._reactRetry=m}}function Ur(o){for(;o!=null;o=o.nextSibling){var u=o.nodeType;if(u===1||u===3)break;if(u===8){if(u=o.data,u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"||u==="F!"||u==="F")break;if(u==="/$"||u==="/&")return null}}return o}var zb=null;function p2(o){o=o.nextSibling;for(var u=0;o;){if(o.nodeType===8){var h=o.data;if(h==="/$"||h==="/&"){if(u===0)return Ur(o.nextSibling);u--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||u++}o=o.nextSibling}return null}function m2(o){o=o.previousSibling;for(var u=0;o;){if(o.nodeType===8){var h=o.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(u===0)return o;u--}else h!=="/$"&&h!=="/&"||u++}o=o.previousSibling}return null}function g2(o,u,h){switch(u=bp(h),o){case"html":if(o=u.documentElement,!o)throw Error(r(452));return o;case"head":if(o=u.head,!o)throw Error(r(453));return o;case"body":if(o=u.body,!o)throw Error(r(454));return o;default:throw Error(r(451))}}function cf(o){for(var u=o.attributes;u.length;)o.removeAttributeNode(u[0]);Hy(o)}var Fr=new Map,v2=new Set;function xp(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var Aa=G.d;G.d={f:jU,r:BU,D:zU,C:$U,L:HU,m:UU,X:qU,S:FU,M:WU};function jU(){var o=Aa.f(),u=fp();return o||u}function BU(o){var u=Cs(o);u!==null&&u.tag===5&&u.type==="form"?NE(u):Aa.r(o)}var iu=typeof document>"u"?null:document;function y2(o,u,h){var m=iu;if(m&&typeof u=="string"&&u){var b=Ir(u);b='link[rel="'+o+'"][href="'+b+'"]',typeof h=="string"&&(b+='[crossorigin="'+h+'"]'),v2.has(b)||(v2.add(b),o={rel:o,crossOrigin:h,href:u},m.querySelector(b)===null&&(u=m.createElement("link"),yn(u,"link",o),en(u),m.head.appendChild(u)))}}function zU(o){Aa.D(o),y2("dns-prefetch",o,null)}function $U(o,u){Aa.C(o,u),y2("preconnect",o,u)}function HU(o,u,h){Aa.L(o,u,h);var m=iu;if(m&&o&&u){var b='link[rel="preload"][as="'+Ir(u)+'"]';u==="image"&&h&&h.imageSrcSet?(b+='[imagesrcset="'+Ir(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(b+='[imagesizes="'+Ir(h.imageSizes)+'"]')):b+='[href="'+Ir(o)+'"]';var S=b;switch(u){case"style":S=au(o);break;case"script":S=lu(o)}Fr.has(S)||(o=p({rel:"preload",href:u==="image"&&h&&h.imageSrcSet?void 0:o,as:u},h),Fr.set(S,o),m.querySelector(b)!==null||u==="style"&&m.querySelector(ff(S))||u==="script"&&m.querySelector(hf(S))||(u=m.createElement("link"),yn(u,"link",o),en(u),m.head.appendChild(u)))}}function UU(o,u){Aa.m(o,u);var h=iu;if(h&&o){var m=u&&typeof u.as=="string"?u.as:"script",b='link[rel="modulepreload"][as="'+Ir(m)+'"][href="'+Ir(o)+'"]',S=b;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=lu(o)}if(!Fr.has(S)&&(o=p({rel:"modulepreload",href:o},u),Fr.set(S,o),h.querySelector(b)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(hf(S)))return}m=h.createElement("link"),yn(m,"link",o),en(m),h.head.appendChild(m)}}}function FU(o,u,h){Aa.S(o,u,h);var m=iu;if(m&&o){var b=Es(m).hoistableStyles,S=au(o);u=u||"default";var C=b.get(S);if(!C){var D={loading:0,preload:null};if(C=m.querySelector(ff(S)))D.loading=5;else{o=p({rel:"stylesheet",href:o,"data-precedence":u},h),(h=Fr.get(S))&&$b(o,h);var I=C=m.createElement("link");en(I),yn(I,"link",o),I._p=new Promise(function(F,Z){I.onload=F,I.onerror=Z}),I.addEventListener("load",function(){D.loading|=1}),I.addEventListener("error",function(){D.loading|=2}),D.loading|=4,Sp(C,u,m)}C={type:"stylesheet",instance:C,count:1,state:D},b.set(S,C)}}}function qU(o,u){Aa.X(o,u);var h=iu;if(h&&o){var m=Es(h).hoistableScripts,b=lu(o),S=m.get(b);S||(S=h.querySelector(hf(b)),S||(o=p({src:o,async:!0},u),(u=Fr.get(b))&&Hb(o,u),S=h.createElement("script"),en(S),yn(S,"link",o),h.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},m.set(b,S))}}function WU(o,u){Aa.M(o,u);var h=iu;if(h&&o){var m=Es(h).hoistableScripts,b=lu(o),S=m.get(b);S||(S=h.querySelector(hf(b)),S||(o=p({src:o,async:!0,type:"module"},u),(u=Fr.get(b))&&Hb(o,u),S=h.createElement("script"),en(S),yn(S,"link",o),h.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},m.set(b,S))}}function b2(o,u,h,m){var b=(b=Oe.current)?xp(b):null;if(!b)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(u=au(h.href),h=Es(b).hoistableStyles,m=h.get(u),m||(m={type:"style",instance:null,count:0,state:null},h.set(u,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){o=au(h.href);var S=Es(b).hoistableStyles,C=S.get(o);if(C||(b=b.ownerDocument||b,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(o,C),(S=b.querySelector(ff(o)))&&!S._p&&(C.instance=S,C.state.loading=5),Fr.has(o)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},Fr.set(o,h),S||VU(b,o,h,C.state))),u&&m===null)throw Error(r(528,""));return C}if(u&&m!==null)throw Error(r(529,""));return null;case"script":return u=h.async,h=h.src,typeof h=="string"&&u&&typeof u!="function"&&typeof u!="symbol"?(u=lu(h),h=Es(b).hoistableScripts,m=h.get(u),m||(m={type:"script",instance:null,count:0,state:null},h.set(u,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function au(o){return'href="'+Ir(o)+'"'}function ff(o){return'link[rel="stylesheet"]['+o+"]"}function x2(o){return p({},o,{"data-precedence":o.precedence,precedence:null})}function VU(o,u,h,m){o.querySelector('link[rel="preload"][as="style"]['+u+"]")?m.loading=1:(u=o.createElement("link"),m.preload=u,u.addEventListener("load",function(){return m.loading|=1}),u.addEventListener("error",function(){return m.loading|=2}),yn(u,"link",h),en(u),o.head.appendChild(u))}function lu(o){return'[src="'+Ir(o)+'"]'}function hf(o){return"script[async]"+o}function S2(o,u,h){if(u.count++,u.instance===null)switch(u.type){case"style":var m=o.querySelector('style[data-href~="'+Ir(h.href)+'"]');if(m)return u.instance=m,en(m),m;var b=p({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return m=(o.ownerDocument||o).createElement("style"),en(m),yn(m,"style",b),Sp(m,h.precedence,o),u.instance=m;case"stylesheet":b=au(h.href);var S=o.querySelector(ff(b));if(S)return u.state.loading|=4,u.instance=S,en(S),S;m=x2(h),(b=Fr.get(b))&&$b(m,b),S=(o.ownerDocument||o).createElement("link"),en(S);var C=S;return C._p=new Promise(function(D,I){C.onload=D,C.onerror=I}),yn(S,"link",m),u.state.loading|=4,Sp(S,h.precedence,o),u.instance=S;case"script":return S=lu(h.src),(b=o.querySelector(hf(S)))?(u.instance=b,en(b),b):(m=h,(b=Fr.get(S))&&(m=p({},h),Hb(m,b)),o=o.ownerDocument||o,b=o.createElement("script"),en(b),yn(b,"link",m),o.head.appendChild(b),u.instance=b);case"void":return null;default:throw Error(r(443,u.type))}else u.type==="stylesheet"&&(u.state.loading&4)===0&&(m=u.instance,u.state.loading|=4,Sp(m,h.precedence,o));return u.instance}function Sp(o,u,h){for(var m=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=m.length?m[m.length-1]:null,S=b,C=0;C<m.length;C++){var D=m[C];if(D.dataset.precedence===u)S=D;else if(S!==b)break}S?S.parentNode.insertBefore(o,S.nextSibling):(u=h.nodeType===9?h.head:h,u.insertBefore(o,u.firstChild))}function $b(o,u){o.crossOrigin==null&&(o.crossOrigin=u.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=u.referrerPolicy),o.title==null&&(o.title=u.title)}function Hb(o,u){o.crossOrigin==null&&(o.crossOrigin=u.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=u.referrerPolicy),o.integrity==null&&(o.integrity=u.integrity)}var wp=null;function w2(o,u,h){if(wp===null){var m=new Map,b=wp=new Map;b.set(h,m)}else b=wp,m=b.get(h),m||(m=new Map,b.set(h,m));if(m.has(o))return m;for(m.set(o,null),h=h.getElementsByTagName(o),b=0;b<h.length;b++){var S=h[b];if(!(S[Ec]||S[pn]||o==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var C=S.getAttribute(u)||"";C=o+C;var D=m.get(C);D?D.push(S):m.set(C,[S])}}return m}function O2(o,u,h){o=o.ownerDocument||o,o.head.insertBefore(h,u==="title"?o.querySelector("head > title"):null)}function KU(o,u,h){if(h===1||u.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof u.precedence!="string"||typeof u.href!="string"||u.href==="")break;return!0;case"link":if(typeof u.rel!="string"||typeof u.href!="string"||u.href===""||u.onLoad||u.onError)break;return u.rel==="stylesheet"?(o=u.disabled,typeof u.precedence=="string"&&o==null):!0;case"script":if(u.async&&typeof u.async!="function"&&typeof u.async!="symbol"&&!u.onLoad&&!u.onError&&u.src&&typeof u.src=="string")return!0}return!1}function A2(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function XU(o,u,h,m){if(h.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var b=au(m.href),S=u.querySelector(ff(b));if(S){u=S._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(o.count++,o=Op.bind(o),u.then(o,o)),h.state.loading|=4,h.instance=S,en(S);return}S=u.ownerDocument||u,m=x2(m),(b=Fr.get(b))&&$b(m,b),S=S.createElement("link"),en(S);var C=S;C._p=new Promise(function(D,I){C.onload=D,C.onerror=I}),yn(S,"link",m),h.instance=S}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(h,u),(u=h.state.preload)&&(h.state.loading&3)===0&&(o.count++,h=Op.bind(o),u.addEventListener("load",h),u.addEventListener("error",h))}}var Ub=0;function QU(o,u){return o.stylesheets&&o.count===0&&kp(o,o.stylesheets),0<o.count||0<o.imgCount?function(h){var m=setTimeout(function(){if(o.stylesheets&&kp(o,o.stylesheets),o.unsuspend){var S=o.unsuspend;o.unsuspend=null,S()}},6e4+u);0<o.imgBytes&&Ub===0&&(Ub=62500*MU());var b=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&kp(o,o.stylesheets),o.unsuspend)){var S=o.unsuspend;o.unsuspend=null,S()}},(o.imgBytes>Ub?50:800)+u);return o.unsuspend=h,function(){o.unsuspend=null,clearTimeout(m),clearTimeout(b)}}:null}function Op(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)kp(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var Ap=null;function kp(o,u){o.stylesheets=null,o.unsuspend!==null&&(o.count++,Ap=new Map,u.forEach(YU,o),Ap=null,Op.call(o))}function YU(o,u){if(!(u.state.loading&4)){var h=Ap.get(o);if(h)var m=h.get(null);else{h=new Map,Ap.set(o,h);for(var b=o.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<b.length;S++){var C=b[S];(C.nodeName==="LINK"||C.getAttribute("media")!=="not all")&&(h.set(C.dataset.precedence,C),m=C)}m&&h.set(null,m)}b=u.instance,C=b.getAttribute("data-precedence"),S=h.get(C)||m,S===m&&h.set(null,b),h.set(C,b),this.count++,m=Op.bind(this),b.addEventListener("load",m),b.addEventListener("error",m),S?S.parentNode.insertBefore(b,S.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(b,o.firstChild)),u.state.loading|=4}}var df={$$typeof:E,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function GU(o,u,h,m,b,S,C,D,I){this.tag=1,this.containerInfo=o,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=jy(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=jy(0),this.hiddenUpdates=jy(null),this.identifierPrefix=m,this.onUncaughtError=b,this.onCaughtError=S,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.incompleteTransitions=new Map}function k2(o,u,h,m,b,S,C,D,I,F,Z,te){return o=new GU(o,u,h,C,I,F,Z,te,D),u=1,S===!0&&(u|=24),S=gr(3,null,null,u),o.current=S,S.stateNode=o,u=S0(),u.refCount++,o.pooledCache=u,u.refCount++,S.memoizedState={element:m,isDehydrated:h,cache:u},k0(S),o}function C2(o){return o?(o=js,o):js}function E2(o,u,h,m,b,S){b=C2(b),m.context===null?m.context=b:m.pendingContext=b,m=fl(u),m.payload={element:h},S=S===void 0?null:S,S!==null&&(m.callback=S),h=hl(o,m,u),h!==null&&(er(h,o,u),qc(h,o,u))}function T2(o,u){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var h=o.retryLane;o.retryLane=h!==0&&h<u?h:u}}function Fb(o,u){T2(o,u),(o=o.alternate)&&T2(o,u)}function M2(o){if(o.tag===13||o.tag===31){var u=ho(o,67108864);u!==null&&er(u,o,67108864),Fb(o,67108864)}}function P2(o){if(o.tag===13||o.tag===31){var u=Sr();u=By(u);var h=ho(o,u);h!==null&&er(h,o,u),Fb(o,u)}}var Cp=!0;function ZU(o,u,h,m){var b=z.T;z.T=null;var S=G.p;try{G.p=2,qb(o,u,h,m)}finally{G.p=S,z.T=b}}function JU(o,u,h,m){var b=z.T;z.T=null;var S=G.p;try{G.p=8,qb(o,u,h,m)}finally{G.p=S,z.T=b}}function qb(o,u,h,m){if(Cp){var b=Wb(m);if(b===null)Pb(o,u,m,Ep,h),R2(o,m);else if(t9(b,o,u,h,m))m.stopPropagation();else if(R2(o,m),u&4&&-1<e9.indexOf(o)){for(;b!==null;){var S=Cs(b);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var C=oo(S.pendingLanes);if(C!==0){var D=S;for(D.pendingLanes|=2,D.entangledLanes|=2;C;){var I=1<<31-pr(C);D.entanglements[1]|=I,C&=~I}Mi(S),(Ze&6)===0&&(up=hr()+500,of(0))}}break;case 31:case 13:D=ho(S,2),D!==null&&er(D,S,2),fp(),Fb(S,2)}if(S=Wb(m),S===null&&Pb(o,u,m,Ep,h),S===b)break;b=S}b!==null&&m.stopPropagation()}else Pb(o,u,m,null,h)}}function Wb(o){return o=Ky(o),Vb(o)}var Ep=null;function Vb(o){if(Ep=null,o=ks(o),o!==null){var u=a(o);if(u===null)o=null;else{var h=u.tag;if(h===13){if(o=l(u),o!==null)return o;o=null}else if(h===31){if(o=s(u),o!==null)return o;o=null}else if(h===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;o=null}else u!==o&&(o=null)}}return Ep=o,null}function D2(o){switch(o){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(z6()){case zk:return 2;case $k:return 8;case gd:case $6:return 32;case Hk:return 268435456;default:return 32}default:return 32}}var Kb=!1,Ol=null,Al=null,kl=null,pf=new Map,mf=new Map,Cl=[],e9="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".split(" ");function R2(o,u){switch(o){case"focusin":case"focusout":Ol=null;break;case"dragenter":case"dragleave":Al=null;break;case"mouseover":case"mouseout":kl=null;break;case"pointerover":case"pointerout":pf.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":mf.delete(u.pointerId)}}function gf(o,u,h,m,b,S){return o===null||o.nativeEvent!==S?(o={blockedOn:u,domEventName:h,eventSystemFlags:m,nativeEvent:S,targetContainers:[b]},u!==null&&(u=Cs(u),u!==null&&M2(u)),o):(o.eventSystemFlags|=m,u=o.targetContainers,b!==null&&u.indexOf(b)===-1&&u.push(b),o)}function t9(o,u,h,m,b){switch(u){case"focusin":return Ol=gf(Ol,o,u,h,m,b),!0;case"dragenter":return Al=gf(Al,o,u,h,m,b),!0;case"mouseover":return kl=gf(kl,o,u,h,m,b),!0;case"pointerover":var S=b.pointerId;return pf.set(S,gf(pf.get(S)||null,o,u,h,m,b)),!0;case"gotpointercapture":return S=b.pointerId,mf.set(S,gf(mf.get(S)||null,o,u,h,m,b)),!0}return!1}function _2(o){var u=ks(o.target);if(u!==null){var h=a(u);if(h!==null){if(u=h.tag,u===13){if(u=l(h),u!==null){o.blockedOn=u,Kk(o.priority,function(){P2(h)});return}}else if(u===31){if(u=s(h),u!==null){o.blockedOn=u,Kk(o.priority,function(){P2(h)});return}}else if(u===3&&h.stateNode.current.memoizedState.isDehydrated){o.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Tp(o){if(o.blockedOn!==null)return!1;for(var u=o.targetContainers;0<u.length;){var h=Wb(o.nativeEvent);if(h===null){h=o.nativeEvent;var m=new h.constructor(h.type,h);Vy=m,h.target.dispatchEvent(m),Vy=null}else return u=Cs(h),u!==null&&M2(u),o.blockedOn=h,!1;u.shift()}return!0}function N2(o,u,h){Tp(o)&&h.delete(u)}function n9(){Kb=!1,Ol!==null&&Tp(Ol)&&(Ol=null),Al!==null&&Tp(Al)&&(Al=null),kl!==null&&Tp(kl)&&(kl=null),pf.forEach(N2),mf.forEach(N2)}function Mp(o,u){o.blockedOn===u&&(o.blockedOn=null,Kb||(Kb=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,n9)))}var Pp=null;function I2(o){Pp!==o&&(Pp=o,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Pp===o&&(Pp=null);for(var u=0;u<o.length;u+=3){var h=o[u],m=o[u+1],b=o[u+2];if(typeof m!="function"){if(Vb(m||h)===null)continue;break}var S=Cs(h);S!==null&&(o.splice(u,3),u-=3,W0(S,{pending:!0,data:b,method:h.method,action:m},m,b))}}))}function ou(o){function u(I){return Mp(I,o)}Ol!==null&&Mp(Ol,o),Al!==null&&Mp(Al,o),kl!==null&&Mp(kl,o),pf.forEach(u),mf.forEach(u);for(var h=0;h<Cl.length;h++){var m=Cl[h];m.blockedOn===o&&(m.blockedOn=null)}for(;0<Cl.length&&(h=Cl[0],h.blockedOn===null);)_2(h),h.blockedOn===null&&Cl.shift();if(h=(o.ownerDocument||o).$$reactFormReplay,h!=null)for(m=0;m<h.length;m+=3){var b=h[m],S=h[m+1],C=b[Xn]||null;if(typeof S=="function")C||I2(h);else if(C){var D=null;if(S&&S.hasAttribute("formAction")){if(b=S,C=S[Xn]||null)D=C.formAction;else if(Vb(b)!==null)continue}else D=C.action;typeof D=="function"?h[m+1]=D:(h.splice(m,3),m-=3),I2(h)}}}function L2(){function o(S){S.canIntercept&&S.info==="react-transition"&&S.intercept({handler:function(){return new Promise(function(C){return b=C})},focusReset:"manual",scroll:"manual"})}function u(){b!==null&&(b(),b=null),m||setTimeout(h,20)}function h(){if(!m&&!navigation.transition){var S=navigation.currentEntry;S&&S.url!=null&&navigation.navigate(S.url,{state:S.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,b=null;return navigation.addEventListener("navigate",o),navigation.addEventListener("navigatesuccess",u),navigation.addEventListener("navigateerror",u),setTimeout(h,100),function(){m=!0,navigation.removeEventListener("navigate",o),navigation.removeEventListener("navigatesuccess",u),navigation.removeEventListener("navigateerror",u),b!==null&&(b(),b=null)}}}function Xb(o){this._internalRoot=o}Dp.prototype.render=Xb.prototype.render=function(o){var u=this._internalRoot;if(u===null)throw Error(r(409));var h=u.current,m=Sr();E2(h,m,o,u,null,null)},Dp.prototype.unmount=Xb.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var u=o.containerInfo;E2(o.current,2,null,o,null,null),fp(),u[As]=null}};function Dp(o){this._internalRoot=o}Dp.prototype.unstable_scheduleHydration=function(o){if(o){var u=Vk();o={blockedOn:null,target:o,priority:u};for(var h=0;h<Cl.length&&u!==0&&u<Cl[h].priority;h++);Cl.splice(h,0,o),h===0&&_2(o)}};var j2=t.version;if(j2!=="19.2.7")throw Error(r(527,j2,"19.2.7"));G.findDOMNode=function(o){var u=o._reactInternals;if(u===void 0)throw typeof o.render=="function"?Error(r(188)):(o=Object.keys(o).join(","),Error(r(268,o)));return o=f(u),o=o!==null?d(o):null,o=o===null?null:o.stateNode,o};var r9={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Rp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Rp.isDisabled&&Rp.supportsFiber)try{Ac=Rp.inject(r9),dr=Rp}catch{}}return yf.createRoot=function(o,u){if(!i(o))throw Error(r(299));var h=!1,m="",b=qE,S=WE,C=VE;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(m=u.identifierPrefix),u.onUncaughtError!==void 0&&(b=u.onUncaughtError),u.onCaughtError!==void 0&&(S=u.onCaughtError),u.onRecoverableError!==void 0&&(C=u.onRecoverableError)),u=k2(o,1,!1,null,null,h,m,null,b,S,C,L2),o[As]=u.current,Mb(o),new Xb(u)},yf.hydrateRoot=function(o,u,h){if(!i(o))throw Error(r(299));var m=!1,b="",S=qE,C=WE,D=VE,I=null;return h!=null&&(h.unstable_strictMode===!0&&(m=!0),h.identifierPrefix!==void 0&&(b=h.identifierPrefix),h.onUncaughtError!==void 0&&(S=h.onUncaughtError),h.onCaughtError!==void 0&&(C=h.onCaughtError),h.onRecoverableError!==void 0&&(D=h.onRecoverableError),h.formState!==void 0&&(I=h.formState)),u=k2(o,1,!0,u,h??null,m,b,I,S,C,D,L2),u.context=C2(null),h=u.current,m=Sr(),m=By(m),b=fl(m),b.callback=null,hl(h,b,m),h=m,u.current.lanes=h,Cc(u,h),Mi(u),o[As]=u.current,Mb(o),new Dp(u)},yf.version="19.2.7",yf}var K2;function p9(){if(K2)return Gb.exports;K2=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Gb.exports=d9(),Gb.exports}var m9=p9();const g9=wv(m9);var lc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},v9=class extends lc{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Uw=new v9,y9={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},b9=class{#e=y9;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},zo=new b9;function x9(e){setTimeout(e,0)}var S9=typeof window>"u"||"Deno"in globalThis;function $n(){}function w9(e,t){return typeof e=="function"?e(t):e}function T1(e){return typeof e=="number"&&e>=0&&e!==1/0}function QI(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Hl(e,t){return typeof e=="function"?e(t):e}function Cr(e,t){return typeof e=="function"?e(t):e}function X2(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:l,stale:s}=e;if(l){if(r){if(t.queryHash!==Fw(l,t.options))return!1}else if(!nh(t.queryKey,l))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Q2(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(ts(t.options.mutationKey)!==ts(a))return!1}else if(!nh(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Fw(e,t){return(t?.queryKeyHashFn||ts)(e)}function ts(e){return JSON.stringify(e,(t,n)=>M1(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function nh(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>nh(e[n],t[n])):!1}var O9=Object.prototype.hasOwnProperty;function YI(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Y2(e)&&Y2(t);if(!r&&!(M1(e)&&M1(t)))return t;const a=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),s=l.length,c=r?new Array(s):{};let f=0;for(let d=0;d<s;d++){const p=r?d:l[d],g=e[p],v=t[p];if(g===v){c[p]=g,(r?d<a:O9.call(e,p))&&f++;continue}if(g===null||v===null||typeof g!="object"||typeof v!="object"){c[p]=v;continue}const y=YI(g,v,n+1);c[p]=y,y===g&&f++}return a===s&&f===a?e:c}function Km(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Y2(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function M1(e){if(!G2(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!G2(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function G2(e){return Object.prototype.toString.call(e)==="[object Object]"}function A9(e){return new Promise(t=>{zo.setTimeout(t,e)})}function P1(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?YI(e,t):t}function k9(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function C9(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var qw=Symbol();function GI(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===qw?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ww(e,t){return typeof e=="function"?e(...t):!!e}function E9(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var rh=(()=>{let e=()=>S9;return{isServer(){return e()},setIsServer(t){e=t}}})();function D1(){let e,t;const n=new Promise((i,a)=>{e=i,t=a});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var T9=x9;function M9(){let e=[],t=0,n=s=>{s()},r=s=>{s()},i=T9;const a=s=>{t?e.push(s):i(()=>{n(s)})},l=()=>{const s=e;e=[],s.length&&i(()=>{r(()=>{s.forEach(c=>{n(c)})})})};return{batch:s=>{let c;t++;try{c=s()}finally{t--,t||l()}return c},batchCalls:s=>(...c)=>{a(()=>{s(...c)})},schedule:a,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{r=s},setScheduler:s=>{i=s}}}var Yt=M9(),P9=class extends lc{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},Xm=new P9;function D9(e){return Math.min(1e3*2**e,3e4)}function ZI(e){return(e??"online")==="online"?Xm.isOnline():!0}var R1=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function JI(e){let t=!1,n=0,r;const i=D1(),a=()=>i.status!=="pending",l=x=>{if(!a()){const w=new R1(x);g(w),e.onCancel?.(w)}},s=()=>{t=!0},c=()=>{t=!1},f=()=>Uw.isFocused()&&(e.networkMode==="always"||Xm.isOnline())&&e.canRun(),d=()=>ZI(e.networkMode)&&e.canRun(),p=x=>{a()||(r?.(),i.resolve(x))},g=x=>{a()||(r?.(),i.reject(x))},v=()=>new Promise(x=>{r=w=>{(a()||f())&&x(w)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),y=()=>{if(a())return;let x;const w=n===0?e.initialPromise:void 0;try{x=w??e.fn()}catch(A){x=Promise.reject(A)}Promise.resolve(x).then(p).catch(A=>{if(a())return;const k=e.retry??(rh.isServer()?0:3),E=e.retryDelay??D9,P=typeof E=="function"?E(n,A):E,T=k===!0||typeof k=="number"&&n<k||typeof k=="function"&&k(n,A);if(t||!T){g(A);return}n++,e.onFail?.(n,A),A9(P).then(()=>f()?void 0:v()).then(()=>{t?g(A):y()})})};return{promise:i,status:()=>i.status,cancel:l,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:d,start:()=>(d()?y():v().then(y),i)}}var eL=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),T1(this.gcTime)&&(this.#e=zo.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(rh.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(zo.clearTimeout(this.#e),this.#e=void 0)}};function R9(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],l=t.state.data?.pageParams||[];let s={pages:[],pageParams:[]},c=0;const f=async()=>{let d=!1;const p=y=>{E9(y,()=>t.signal,()=>d=!0)},g=GI(t.options,t.fetchOptions),v=async(y,x,w)=>{if(d)return Promise.reject(t.signal.reason);if(x==null&&y.pages.length)return Promise.resolve(y);const k=(()=>{const M={client:t.client,queryKey:t.queryKey,pageParam:x,direction:w?"backward":"forward",meta:t.options.meta};return p(M),M})(),E=await g(k),{maxPages:P}=t.options,T=w?C9:k9;return{pages:T(y.pages,E,P),pageParams:T(y.pageParams,x,P)}};if(i&&a.length){const y=i==="backward",x=y?_9:Z2,w={pages:a,pageParams:l},A=x(r,w);s=await v(w,A,y)}else{const y=e??a.length;do{const x=c===0?l[0]??r.initialPageParam:Z2(r,s);if(c>0&&x==null)break;s=await v(s,x),c++}while(c<y)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=f}}}function Z2(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function _9(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var N9=class extends eL{#e;#t;#n;#r;#a;#i;#o;#l;constructor(e){super(),this.#l=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#a=e.client,this.#r=this.#a.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=eM(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=eM(this.options);t.data!==void 0&&(this.setState(J2(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const n=P1(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#s({type:"setState",state:e})}cancel(e){const t=this.#i?.promise;return this.#i?.cancel(e),t?t.then($n).catch($n):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Cr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===qw||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Hl(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!QI(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#l||this.#c()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#i?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){const c=this.observers.find(f=>f.options.queryFn);c&&this.setOptions(c.options)}const n=new AbortController,r=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#l=!0,n.signal)})},i=()=>{const c=GI(this.options,t),d=(()=>{const p={client:this.#a,queryKey:this.queryKey,meta:this.meta};return r(p),p})();return this.#l=!1,this.options.persister?this.options.persister(c,d,this):c(d)},l=(()=>{const c={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:i};return r(c),c})();(this.#e==="infinite"?R9(this.options.pages):this.options.behavior)?.onFetch(l,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==l.fetchOptions?.meta)&&this.#s({type:"fetch",meta:l.fetchOptions?.meta}),this.#i=JI({initialPromise:t?.initialPromise,fn:l.fetchFn,onCancel:c=>{c instanceof R1&&c.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(c,f)=>{this.#s({type:"failed",failureCount:c,error:f})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0});try{const c=await this.#i.start();if(c===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(c),this.#r.config.onSuccess?.(c,this),this.#r.config.onSettled?.(c,this.state.error,this),c}catch(c){if(c instanceof R1){if(c.silent)return this.#i.promise;if(c.revert){if(this.state.data===void 0)throw c;return this.state.data}}throw this.#s({type:"error",error:c}),this.#r.config.onError?.(c,this),this.#r.config.onSettled?.(this.state.data,c,this),c}finally{this.scheduleGc()}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...tL(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...J2(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?r:void 0,r;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Yt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function tL(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ZI(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function J2(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function eM(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var I9=class extends lc{constructor(e,t){super(),this.options=t,this.#e=e,this.#l=null,this.#o=D1(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#a;#i;#o;#l;#c;#s;#p;#f;#h;#u;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),tM(this.#t,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return _1(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return _1(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Cr(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),t._defaulted&&!Km(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&nM(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),r&&(this.#t!==n||Cr(this.options.enabled,this.#t)!==Cr(t.enabled,this.#t)||Hl(this.options.staleTime,this.#t)!==Hl(t.staleTime,this.#t))&&this.#g();const i=this.#v();r&&(this.#t!==n||Cr(this.options.enabled,this.#t)!==Cr(t.enabled,this.#t)||i!==this.#u)&&this.#y(i)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return j9(this,n)&&(this.#r=n,this.#i=this.options,this.#a=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#d(e){this.#w();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch($n)),t}#g(){this.#x();const e=Hl(this.options.staleTime,this.#t);if(rh.isServer()||this.#r.isStale||!T1(e))return;const n=QI(this.#r.dataUpdatedAt,e)+1;this.#f=zo.setTimeout(()=>{this.#r.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#S(),this.#u=e,!(rh.isServer()||Cr(this.options.enabled,this.#t)===!1||!T1(this.#u)||this.#u===0)&&(this.#h=zo.setInterval(()=>{(this.options.refetchIntervalInBackground||Uw.isFocused())&&this.#d()},this.#u))}#b(){this.#g(),this.#y(this.#v())}#x(){this.#f!==void 0&&(zo.clearTimeout(this.#f),this.#f=void 0)}#S(){this.#h!==void 0&&(zo.clearInterval(this.#h),this.#h=void 0)}createResult(e,t){const n=this.#t,r=this.options,i=this.#r,a=this.#a,l=this.#i,c=e!==n?e.state:this.#n,{state:f}=e;let d={...f},p=!1,g;if(t._optimisticResults){const L=this.hasListeners(),H=!L&&tM(e,t),K=L&&nM(e,n,t,r);(H||K)&&(d={...d,...tL(f.data,e.options)}),t._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:v,errorUpdatedAt:y,status:x}=d;g=d.data;let w=!1;if(t.placeholderData!==void 0&&g===void 0&&x==="pending"){let L;i?.isPlaceholderData&&t.placeholderData===l?.placeholderData?(L=i.data,w=!0):L=typeof t.placeholderData=="function"?t.placeholderData(this.#p?.state.data,this.#p):t.placeholderData,L!==void 0&&(x="success",g=P1(i?.data,L,t),p=!0)}if(t.select&&g!==void 0&&!w)if(i&&g===a?.data&&t.select===this.#c)g=this.#s;else try{this.#c=t.select,g=t.select(g),g=P1(i?.data,g,t),this.#s=g,this.#l=null}catch(L){this.#l=L}this.#l&&(v=this.#l,g=this.#s,y=Date.now(),x="error");const A=d.fetchStatus==="fetching",k=x==="pending",E=x==="error",P=k&&A,T=g!==void 0,R={status:x,fetchStatus:d.fetchStatus,isPending:k,isSuccess:x==="success",isError:E,isInitialLoading:P,isLoading:P,data:g,dataUpdatedAt:d.dataUpdatedAt,error:v,errorUpdatedAt:y,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:A,isRefetching:A&&!k,isLoadingError:E&&!T,isPaused:d.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:E&&T,isStale:Vw(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Cr(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const L=R.data!==void 0,H=R.status==="error"&&!L,K=ae=>{H?ae.reject(R.error):L&&ae.resolve(R.data)},V=()=>{const ae=this.#o=R.promise=D1();K(ae)},B=this.#o;switch(B.status){case"pending":e.queryHash===n.queryHash&&K(B);break;case"fulfilled":(H||R.data!==B.value)&&V();break;case"rejected":(!H||R.error!==B.reason)&&V();break}}return R}updateResult(){const e=this.#r,t=this.createResult(this.#t,this.options);if(this.#a=this.#t.state,this.#i=this.options,this.#a.data!==void 0&&(this.#p=this.#t),Km(t,e))return;this.#r=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#m.size)return!0;const a=new Set(i??this.#m);return this.options.throwOnError&&a.add("error"),Object.keys(this.#r).some(l=>{const s=l;return this.#r[s]!==e[s]&&a.has(s)})};this.#O({listeners:n()})}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#O(e){Yt.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function L9(e,t){return Cr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Cr(t.retryOnMount,e)===!1)}function tM(e,t){return L9(e,t)||e.state.data!==void 0&&_1(e,t,t.refetchOnMount)}function _1(e,t,n){if(Cr(t.enabled,e)!==!1&&Hl(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Vw(e,t)}return!1}function nM(e,t,n,r){return(e!==t||Cr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Vw(e,n)}function Vw(e,t){return Cr(t.enabled,e)!==!1&&e.isStaleByTime(Hl(t.staleTime,e))}function j9(e,t){return!Km(e.getCurrentResult(),t)}var B9=class extends eL{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||nL(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#a({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=JI({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(a,l)=>{this.#a({type:"failed",failureCount:a,error:l})},onPause:()=>{this.#a({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",i=!this.#r.canStart();try{if(r)t();else{this.#a({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const l=await this.options.onMutate?.(e,n);l!==this.state.context&&this.#a({type:"pending",context:l,variables:e,isPaused:i})}const a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#a({type:"success",data:a}),a}catch(a){try{await this.#n.config.onError?.(a,e,this.state.context,this,n)}catch(l){Promise.reject(l)}try{await this.options.onError?.(a,e,this.state.context,n)}catch(l){Promise.reject(l)}try{await this.#n.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,n)}catch(l){Promise.reject(l)}try{await this.options.onSettled?.(void 0,a,e,this.state.context,n)}catch(l){Promise.reject(l)}throw this.#a({type:"error",error:a}),a}finally{this.#n.runNext(this)}}#a(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Yt.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function nL(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var z9=class extends lc{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new B9({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=_p(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=_p(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=_p(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=_p(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Yt.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Q2(t,n))}findAll(e={}){return this.getAll().filter(t=>Q2(e,t))}notify(e){Yt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Yt.batch(()=>Promise.all(e.map(t=>t.continue().catch($n))))}};function _p(e){return e.options.scope?.id}var $9=class extends lc{#e;#t=void 0;#n;#r;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#a()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),Km(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&ts(n.mutationKey)!==ts(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#a(),this.#i(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#a(),this.#i()}mutate(t,n){return this.#r=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#a(){const t=this.#n?.state??nL();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#i(t){Yt.batch(()=>{if(this.#r&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#r.onSuccess?.(t.data,n,r,i)}catch(a){Promise.reject(a)}try{this.#r.onSettled?.(t.data,null,n,r,i)}catch(a){Promise.reject(a)}}else if(t?.type==="error"){try{this.#r.onError?.(t.error,n,r,i)}catch(a){Promise.reject(a)}try{this.#r.onSettled?.(void 0,t.error,n,r,i)}catch(a){Promise.reject(a)}}}this.listeners.forEach(n=>{n(this.#t)})})}},H9=class extends lc{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,i=t.queryHash??Fw(r,t);let a=this.get(i);return a||(a=new N9({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Yt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>X2(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>X2(e,n)):t}notify(e){Yt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Yt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Yt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},U9=class{#e;#t;#n;#r;#a;#i;#o;#l;constructor(e={}){this.#e=e.queryCache||new H9,this.#t=e.mutationCache||new z9,this.#n=e.defaultOptions||{},this.#r=new Map,this.#a=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=Uw.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#l=Xm.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#o?.(),this.#o=void 0,this.#l?.(),this.#l=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Hl(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=this.#e.get(r.queryHash)?.state.data,l=w9(t,a);if(l!==void 0)return this.#e.build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return Yt.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Yt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Yt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Yt.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then($n).catch($n)}invalidateQueries(e,t={}){return Yt.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Yt.batch(()=>this.#e.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,n);return n.throwOnError||(a=a.catch($n)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then($n)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Hl(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then($n).catch($n)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then($n).catch($n)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Xm.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(ts(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{nh(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#a.set(ts(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#a.values()],n={};return t.forEach(r=>{nh(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Fw(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===qw&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},rL=O.createContext(void 0),ro=e=>{const t=O.useContext(rL);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},F9=({client:e,children:t})=>(O.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),_.jsx(rL.Provider,{value:e,children:t})),iL=O.createContext(!1),q9=()=>O.useContext(iL);iL.Provider;function W9(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var V9=O.createContext(W9()),K9=()=>O.useContext(V9),X9=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?Ww(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Q9=e=>{O.useEffect(()=>{e.clearReset()},[e])},Y9=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Ww(n,[e.error,r])),G9=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Z9=(e,t)=>e.isLoading&&e.isFetching&&!t,J9=(e,t)=>e?.suspense&&t.isPending,rM=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function eF(e,t,n){const r=q9(),i=K9(),a=ro(),l=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(l);const s=a.getQueryCache().get(l.queryHash),c=e.subscribed!==!1;l._optimisticResults=r?"isRestoring":c?"optimistic":void 0,G9(l),X9(l,i,s),Q9(i);const f=!a.getQueryCache().get(l.queryHash),[d]=O.useState(()=>new t(a,l)),p=d.getOptimisticResult(l),g=!r&&c;if(O.useSyncExternalStore(O.useCallback(v=>{const y=g?d.subscribe(Yt.batchCalls(v)):$n;return d.updateResult(),y},[d,g]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),O.useEffect(()=>{d.setOptions(l)},[l,d]),J9(l,p))throw rM(l,d,i);if(Y9({result:p,errorResetBoundary:i,throwOnError:l.throwOnError,query:s,suspense:l.suspense}))throw p.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(l,p),l.experimental_prefetchInRender&&!rh.isServer()&&Z9(p,r)&&(f?rM(l,d,i):s?.promise)?.catch($n).finally(()=>{d.updateResult()}),l.notifyOnChangeProps?p:d.trackResult(p)}function Ll(e,t){return eF(e,I9)}function $u(e,t){const n=ro(),[r]=O.useState(()=>new $9(n,e));O.useEffect(()=>{r.setOptions(e)},[r,e]);const i=O.useSyncExternalStore(O.useCallback(l=>r.subscribe(Yt.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=O.useCallback((l,s)=>{r.mutate(l,s).catch($n)},[r]);if(i.error&&Ww(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Kw=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,aL=/^[\\/]{2}/;function tF(e,t){return t+e.replace(/\\/g,"/")}var iM="popstate";function aM(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function nF(e={}){function t(r,i){let a=i.state?.masked,{pathname:l,search:s,hash:c}=a||r.location;return N1("",{pathname:l,search:s,hash:c},i.state&&i.state.usr||null,i.state&&i.state.key||"default",a?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,i){return typeof i=="string"?i:ih(i)}return iF(t,n,null,e)}function Ct(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Yi(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function rF(){return Math.random().toString(36).substring(2,10)}function lM(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function N1(e,t,n=null,r,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?oc(t):t,state:n,key:t&&t.key||r||rF(),mask:i}}function ih({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function oc(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function iF(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,l=i.history,s="POP",c=null,f=d();f==null&&(f=0,l.replaceState({...l.state,idx:f},""));function d(){return(l.state||{idx:null}).idx}function p(){s="POP";let w=d(),A=w==null?null:w-f;f=w,c&&c({action:s,location:x.location,delta:A})}function g(w,A){s="PUSH";let k=aM(w)?w:N1(x.location,w,A);f=d()+1;let E=lM(k,f),P=x.createHref(k.mask||k);try{l.pushState(E,"",P)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;i.location.assign(P)}a&&c&&c({action:s,location:x.location,delta:1})}function v(w,A){s="REPLACE";let k=aM(w)?w:N1(x.location,w,A);f=d();let E=lM(k,f),P=x.createHref(k.mask||k);l.replaceState(E,"",P),a&&c&&c({action:s,location:x.location,delta:0})}function y(w){return aF(i,w)}let x={get action(){return s},get location(){return e(i,l)},listen(w){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(iM,p),c=w,()=>{i.removeEventListener(iM,p),c=null}},createHref(w){return t(i,w)},createURL:y,encodeLocation(w){let A=y(w);return{pathname:A.pathname,search:A.search,hash:A.hash}},push:g,replace:v,go(w){return l.go(w)}};return x}function aF(e,t,n=!1){let r="http://localhost";e&&(r=e.location.origin!=="null"?e.location.origin:e.location.href),Ct(r,"No window.location.(origin|href) available to create URL");let i=typeof t=="string"?t:ih(t);return i=i.replace(/ $/,"%20"),!n&&aL.test(i)&&(i=r+i),new URL(i,r)}function lL(e,t,n="/"){return lF(e,t,n,!1)}function lF(e,t,n,r,i){let a=typeof t=="string"?oc(t):t,l=Ba(a.pathname||"/",n);if(l==null)return null;let s=oF(e),c=null,f=yF(l);for(let d=0;c==null&&d<s.length;++d)c=vF(s[d],f,r);return c}function oF(e){let t=oL(e);return sF(t),t}function oL(e,t=[],n=[],r="",i=!1){let a=(l,s,c=i,f)=>{let d={relativePath:f===void 0?l.path||"":f,caseSensitive:l.caseSensitive===!0,childrenIndex:s,route:l};if(d.relativePath.startsWith("/")){if(!d.relativePath.startsWith(r)&&c)return;Ct(d.relativePath.startsWith(r),`Absolute route path "${d.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),d.relativePath=d.relativePath.slice(r.length)}let p=mi([r,d.relativePath]),g=n.concat(d);l.children&&l.children.length>0&&(Ct(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),oL(l.children,t,g,p,c)),!(l.path==null&&!l.index)&&t.push({path:p,score:mF(p,l.index),routesMeta:g.map((v,y)=>{let[x,w]=cL(v.relativePath,v.caseSensitive,y===g.length-1);return{...v,matcher:x,compiledParams:w}})})};return e.forEach((l,s)=>{if(l.path===""||!l.path?.includes("?"))a(l,s);else for(let c of sL(l.path))a(l,s,!0,c)}),t}function sL(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return i?[a,""]:[a];let l=sL(r.join("/")),s=[];return s.push(...l.map(c=>c===""?a:[a,c].join("/"))),i&&s.push(...l),s.map(c=>e.startsWith("/")&&c===""?"/":c)}function sF(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:gF(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var uF=/^:[\w-]+$/,cF=3,fF=2,hF=1,dF=10,pF=-2,oM=e=>e==="*";function mF(e,t){let n=e.split("/"),r=n.length;return n.some(oM)&&(r+=pF),t&&(r+=fF),n.filter(i=>!oM(i)).reduce((i,a)=>i+(uF.test(a)?cF:a===""?hF:dF),r)}function gF(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function vF(e,t,n=!1){let{routesMeta:r}=e,i={},a="/",l=[];for(let s=0;s<r.length;++s){let c=r[s],f=s===r.length-1,d=a==="/"?t:t.slice(a.length)||"/",p={path:c.relativePath,caseSensitive:c.caseSensitive,end:f},g=c.matcher&&c.compiledParams?uL(p,d,c.matcher,c.compiledParams):Qm(p,d),v=c.route;if(!g&&f&&n&&!r[r.length-1].route.index&&(g=Qm({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!g)return null;Object.assign(i,g.params),l.push({params:i,pathname:mi([a,g.pathname]),pathnameBase:SF(mi([a,g.pathnameBase])),route:v}),g.pathnameBase!=="/"&&(a=mi([a,g.pathnameBase]))}return l}function Qm(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=cL(e.path,e.caseSensitive,e.end);return uL(e,t,n,r)}function uL(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],l=a.replace(/(.)\/+$/,"$1"),s=i.slice(1);return{params:r.reduce((f,{paramName:d,isOptional:p},g)=>{if(d==="*"){let y=s[g]||"";l=a.slice(0,a.length-y.length).replace(/(.)\/+$/,"$1")}const v=s[g];return p&&!v?f[d]=void 0:f[d]=(v||"").replace(/%2F/g,"/"),f},{}),pathname:a,pathnameBase:l,pattern:e}}function cL(e,t=!1,n=!0){Yi(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,s,c,f,d)=>{if(r.push({paramName:s,isOptional:c!=null}),c){let p=d.charAt(f+l.length);return p&&p!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function yF(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Yi(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ba(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function bF(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?oc(e):e,a;return n?(n=hL(n),n.startsWith("/")?a=sM(n.substring(1),"/"):a=sM(n,t)):a=t,{pathname:a,search:wF(r),hash:OF(i)}}function sM(e,t){let n=Ym(t).split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function tx(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function xF(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function fL(e){let t=xF(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Xw(e,t,n,r=!1){let i;typeof e=="string"?i=oc(e):(i={...e},Ct(!i.pathname||!i.pathname.includes("?"),tx("?","pathname","search",i)),Ct(!i.pathname||!i.pathname.includes("#"),tx("#","pathname","hash",i)),Ct(!i.search||!i.search.includes("#"),tx("#","search","hash",i)));let a=e===""||i.pathname==="",l=a?"/":i.pathname,s;if(l==null)s=n;else{let p=t.length-1;if(!r&&l.startsWith("..")){let g=l.split("/");for(;g[0]==="..";)g.shift(),p-=1;i.pathname=g.join("/")}s=p>=0?t[p]:"/"}let c=bF(i,s),f=l&&l!=="/"&&l.endsWith("/"),d=(a||l===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(f||d)&&(c.pathname+="/"),c}var hL=e=>e.replace(/[\\/]{2,}/g,"/"),mi=e=>hL(e.join("/")),Ym=e=>e.replace(/\/+$/,""),SF=e=>Ym(e).replace(/^\/*/,"/"),wF=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,OF=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,AF=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function kF(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function CF(e){let t=e.map(n=>n.route.path).filter(Boolean);return mi(t)||"/"}var dL=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function pL(e,t){let n=e;if(typeof n!="string"||!Kw.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(dL)try{let a=new URL(window.location.href),l=aL.test(n)?new URL(tF(n,a.protocol)):new URL(n),s=Ba(l.pathname,t);l.origin===a.origin&&s!=null?n=s+l.search+l.hash:i=!0}catch{Yi(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var mL=["POST","PUT","PATCH","DELETE"];new Set(mL);var EF=["GET",...mL];new Set(EF);var TF=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function MF(e){try{return TF.includes(new URL(e).protocol)}catch{return!1}}var sc=O.createContext(null);sc.displayName="DataRouter";var Ov=O.createContext(null);Ov.displayName="DataRouterState";var gL=O.createContext(!1);function PF(){return O.useContext(gL)}var vL=O.createContext({isTransitioning:!1});vL.displayName="ViewTransition";var DF=O.createContext(new Map);DF.displayName="Fetchers";var RF=O.createContext(null);RF.displayName="Await";var ti=O.createContext(null);ti.displayName="Navigation";var $h=O.createContext(null);$h.displayName="Location";var ta=O.createContext({outlet:null,matches:[],isDataRoute:!1});ta.displayName="Route";var Qw=O.createContext(null);Qw.displayName="RouteError";var yL="REACT_ROUTER_ERROR",_F="REDIRECT",NF="ROUTE_ERROR_RESPONSE";function IF(e){if(e.startsWith(`${yL}:${_F}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function LF(e){if(e.startsWith(`${yL}:${NF}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new AF(t.status,t.statusText,t.data)}catch{}}function jF(e,{relative:t}={}){Ct(Hh(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=O.useContext(ti),{hash:i,pathname:a,search:l}=Uh(e,{relative:t}),s=a;return n!=="/"&&(s=a==="/"?n:mi([n,a])),r.createHref({pathname:s,search:l,hash:i})}function Hh(){return O.useContext($h)!=null}function Qa(){return Ct(Hh(),"useLocation() may be used only in the context of a <Router> component."),O.useContext($h).location}var bL="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function xL(e){O.useContext(ti).static||O.useLayoutEffect(e)}function Yw(){let{isDataRoute:e}=O.useContext(ta);return e?YF():BF()}function BF(){Ct(Hh(),"useNavigate() may be used only in the context of a <Router> component.");let e=O.useContext(sc),{basename:t,navigator:n}=O.useContext(ti),{matches:r}=O.useContext(ta),{pathname:i}=Qa(),a=JSON.stringify(fL(r)),l=O.useRef(!1);return xL(()=>{l.current=!0}),O.useCallback((c,f={})=>{if(Yi(l.current,bL),!l.current)return;if(typeof c=="number"){n.go(c);return}let d=Xw(c,JSON.parse(a),i,f.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:mi([t,d.pathname])),(f.replace?n.replace:n.push)(d,f.state,f)},[t,n,a,i,e])}O.createContext(null);function SL(){let{matches:e}=O.useContext(ta);return e[e.length-1]?.params??{}}function Uh(e,{relative:t}={}){let{matches:n}=O.useContext(ta),{pathname:r}=Qa(),i=JSON.stringify(fL(n));return O.useMemo(()=>Xw(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function zF(e,t){return wL(e,t)}function wL(e,t,n){Ct(Hh(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=O.useContext(ti),{matches:i}=O.useContext(ta),a=i[i.length-1],l=a?a.params:{},s=a?a.pathname:"/",c=a?a.pathnameBase:"/",f=a&&a.route;{let w=f&&f.path||"";AL(s,!f||w.endsWith("*")||w.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${w}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
10
|
+
|
|
11
|
+
Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}/*`}">.`)}let d=Qa(),p;if(t){let w=typeof t=="string"?oc(t):t;Ct(c==="/"||w.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${w.pathname}" was given in the \`location\` prop.`),p=w}else p=d;let g=p.pathname||"/",v=g;if(c!=="/"){let w=c.replace(/^\//,"").split("/");v="/"+g.replace(/^\//,"").split("/").slice(w.length).join("/")}let y=n&&n.state.matches.length?n.state.matches.map(w=>Object.assign(w,{route:n.manifest[w.route.id]||w.route})):lL(e,{pathname:v});Yi(f||y!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),Yi(y==null||y[y.length-1].route.element!==void 0||y[y.length-1].route.Component!==void 0||y[y.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let x=qF(y&&y.map(w=>Object.assign({},w,{params:Object.assign({},l,w.params),pathname:mi([c,r.encodeLocation?r.encodeLocation(w.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?c:mi([c,r.encodeLocation?r.encodeLocation(w.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathnameBase])})),i,n);return t&&x?O.createElement($h.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...p},navigationType:"POP"}},x):x}function $F(){let e=QF(),t=kF(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},a={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=O.createElement(O.Fragment,null,O.createElement("p",null,"💿 Hey developer 👋"),O.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",O.createElement("code",{style:a},"ErrorBoundary")," or"," ",O.createElement("code",{style:a},"errorElement")," prop on your route.")),O.createElement(O.Fragment,null,O.createElement("h2",null,"Unexpected Application Error!"),O.createElement("h3",{style:{fontStyle:"italic"}},t),n?O.createElement("pre",{style:i},n):null,l)}var HF=O.createElement($F,null),OL=class extends O.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=LF(e.digest);n&&(e=n)}let t=e!==void 0?O.createElement(ta.Provider,{value:this.props.routeContext},O.createElement(Qw.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?O.createElement(UF,{error:e},t):t}};OL.contextType=gL;var nx=new WeakMap;function UF({children:e,error:t}){let{basename:n}=O.useContext(ti);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=IF(t.digest);if(r){let i=nx.get(t);if(i)throw i;let a=pL(r.location,n),l=a.absoluteURL||a.to;if(MF(l))throw new Error("Invalid redirect location");if(dL&&!nx.get(t))if(a.isExternal||r.reloadDocument)window.location.href=l;else{const s=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:r.replace}));throw nx.set(t,s),s}return O.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l}`})}}return e}function FF({routeContext:e,match:t,children:n}){let r=O.useContext(sc);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),O.createElement(ta.Provider,{value:e},n)}function qF(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let d=i.findIndex(p=>p.route.id&&a?.[p.route.id]!==void 0);Ct(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),i=i.slice(0,Math.min(i.length,d+1))}let l=!1,s=-1;if(n&&r){l=r.renderFallback;for(let d=0;d<i.length;d++){let p=i[d];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(s=d),p.route.id){let{loaderData:g,errors:v}=r,y=p.route.loader&&!g.hasOwnProperty(p.route.id)&&(!v||v[p.route.id]===void 0);if(p.route.lazy||y){n.isStatic&&(l=!0),s>=0?i=i.slice(0,s+1):i=[i[0]];break}}}}let c=n?.onError,f=r&&c?(d,p)=>{c(d,{location:r.location,params:r.matches?.[0]?.params??{},pattern:CF(r.matches),errorInfo:p})}:void 0;return i.reduceRight((d,p,g)=>{let v,y=!1,x=null,w=null;r&&(v=a&&p.route.id?a[p.route.id]:void 0,x=p.route.errorElement||HF,l&&(s<0&&g===0?(AL("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,w=null):s===g&&(y=!0,w=p.route.hydrateFallbackElement||null)));let A=t.concat(i.slice(0,g+1)),k=()=>{let E;return v?E=x:y?E=w:p.route.Component?E=O.createElement(p.route.Component,null):p.route.element?E=p.route.element:E=d,O.createElement(FF,{match:p,routeContext:{outlet:d,matches:A,isDataRoute:r!=null},children:E})};return r&&(p.route.ErrorBoundary||p.route.errorElement||g===0)?O.createElement(OL,{location:r.location,revalidation:r.revalidation,component:x,error:v,children:k(),routeContext:{outlet:null,matches:A,isDataRoute:!0},onError:f}):k()},null)}function Gw(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function WF(e){let t=O.useContext(sc);return Ct(t,Gw(e)),t}function VF(e){let t=O.useContext(Ov);return Ct(t,Gw(e)),t}function KF(e){let t=O.useContext(ta);return Ct(t,Gw(e)),t}function Zw(e){let t=KF(e),n=t.matches[t.matches.length-1];return Ct(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function XF(){return Zw("useRouteId")}function QF(){let e=O.useContext(Qw),t=VF("useRouteError"),n=Zw("useRouteError");return e!==void 0?e:t.errors?.[n]}function YF(){let{router:e}=WF("useNavigate"),t=Zw("useNavigate"),n=O.useRef(!1);return xL(()=>{n.current=!0}),O.useCallback(async(i,a={})=>{Yi(n.current,bL),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...a}))},[e,t])}var uM={};function AL(e,t,n){!t&&!uM[e]&&(uM[e]=!0,Yi(!1,n))}O.memo(GF);function GF({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return wL(e,void 0,{manifest:t,state:r,isStatic:i,onError:a})}function Em(e){Ct(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function ZF({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:a=!1,useTransitions:l}){Ct(!Hh(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let s=e.replace(/^\/*/,"/"),c=O.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:l,future:{}}),[s,i,a,l]);typeof n=="string"&&(n=oc(n));let{pathname:f="/",search:d="",hash:p="",state:g=null,key:v="default",mask:y}=n,x=O.useMemo(()=>{let w=Ba(f,s);return w==null?null:{location:{pathname:w,search:d,hash:p,state:g,key:v,mask:y},navigationType:r}},[s,f,d,p,g,v,r,y]);return Yi(x!=null,`<Router basename="${s}"> is not able to match the URL "${f}${d}${p}" because it does not start with the basename, so the <Router> won't render anything.`),x==null?null:O.createElement(ti.Provider,{value:c},O.createElement($h.Provider,{children:t,value:x}))}function JF({children:e,location:t}){return zF(I1(e),t)}function I1(e,t=[]){let n=[];return O.Children.forEach(e,(r,i)=>{if(!O.isValidElement(r))return;let a=[...t,i];if(r.type===O.Fragment){n.push.apply(n,I1(r.props.children,a));return}Ct(r.type===Em,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Ct(!r.props.index||!r.props.children,"An index route cannot have child routes.");let l={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=I1(r.props.children,a)),n.push(l)}),n}var Tm="get",Mm="application/x-www-form-urlencoded";function Av(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function eq(e){return Av(e)&&e.tagName.toLowerCase()==="button"}function tq(e){return Av(e)&&e.tagName.toLowerCase()==="form"}function nq(e){return Av(e)&&e.tagName.toLowerCase()==="input"}function rq(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function iq(e,t){return e.button===0&&(!t||t==="_self")&&!rq(e)}var Np=null;function aq(){if(Np===null)try{new FormData(document.createElement("form"),0),Np=!1}catch{Np=!0}return Np}var lq=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function rx(e){return e!=null&&!lq.has(e)?(Yi(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Mm}"`),null):e}function oq(e,t){let n,r,i,a,l;if(tq(e)){let s=e.getAttribute("action");r=s?Ba(s,t):null,n=e.getAttribute("method")||Tm,i=rx(e.getAttribute("enctype"))||Mm,a=new FormData(e)}else if(eq(e)||nq(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||s.getAttribute("action");if(r=c?Ba(c,t):null,n=e.getAttribute("formmethod")||s.getAttribute("method")||Tm,i=rx(e.getAttribute("formenctype"))||rx(s.getAttribute("enctype"))||Mm,a=new FormData(s,e),!aq()){let{name:f,type:d,value:p}=e;if(d==="image"){let g=f?`${f}.`:"";a.append(`${g}x`,"0"),a.append(`${g}y`,"0")}else f&&a.append(f,p)}}else{if(Av(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Tm,r=null,i=Mm,l=e}return a&&i==="text/plain"&&(l=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Jw(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function kL(e,t,n,r){let i=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname==="/"?i.pathname=`_root.${r}`:t&&Ba(i.pathname,t)==="/"?i.pathname=`${Ym(t)}/_root.${r}`:i.pathname=`${Ym(i.pathname)}.${r}`,i}async function sq(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function uq(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function cq(e,t,n){let r=await Promise.all(e.map(async i=>{let a=t.routes[i.route.id];if(a){let l=await sq(a,n);return l.links?l.links():[]}return[]}));return pq(r.flat(1).filter(uq).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function cM(e,t,n,r,i,a){let l=(c,f)=>n[f]?c.route.id!==n[f].route.id:!0,s=(c,f)=>n[f].pathname!==c.pathname||n[f].route.path?.endsWith("*")&&n[f].params["*"]!==c.params["*"];return a==="assets"?t.filter((c,f)=>l(c,f)||s(c,f)):a==="data"?t.filter((c,f)=>{let d=r.routes[c.route.id];if(!d||!d.hasLoader)return!1;if(l(c,f)||s(c,f))return!0;if(c.route.shouldRevalidate){let p=c.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function fq(e,t,{includeHydrateFallback:n}={}){return hq(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let a=[i.module];return i.clientActionModule&&(a=a.concat(i.clientActionModule)),i.clientLoaderModule&&(a=a.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(a=a.concat(i.hydrateFallbackModule)),i.imports&&(a=a.concat(i.imports)),a}).flat(1))}function hq(e){return[...new Set(e)]}function dq(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function pq(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let a=JSON.stringify(dq(i));return n.has(a)||(n.add(a),r.push({key:a,link:i})),r},[])}function eO(){let e=O.useContext(sc);return Jw(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function mq(){let e=O.useContext(Ov);return Jw(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var tO=O.createContext(void 0);tO.displayName="FrameworkContext";function kv(){let e=O.useContext(tO);return Jw(e,"You must render this element inside a <HydratedRouter> element"),e}function gq(e,t){let n=O.useContext(tO),[r,i]=O.useState(!1),[a,l]=O.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:f,onMouseLeave:d,onTouchStart:p}=t,g=O.useRef(null);O.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let x=A=>{A.forEach(k=>{l(k.isIntersecting)})},w=new IntersectionObserver(x,{threshold:.5});return g.current&&w.observe(g.current),()=>{w.disconnect()}}},[e]),O.useEffect(()=>{if(r){let x=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(x)}}},[r]);let v=()=>{i(!0)},y=()=>{i(!1),l(!1)};return n?e!=="intent"?[a,g,{}]:[a,g,{onFocus:bf(s,v),onBlur:bf(c,y),onMouseEnter:bf(f,v),onMouseLeave:bf(d,y),onTouchStart:bf(p,v)}]:[!1,g,{}]}function bf(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function vq({page:e,...t}){let n=PF(),{nonce:r}=kv(),{router:i}=eO(),a=O.useMemo(()=>lL(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?O.createElement(bq,{page:e,matches:a,...t}):O.createElement(xq,{page:e,matches:a,...t})):null}function yq(e){let{manifest:t,routeModules:n}=kv(),[r,i]=O.useState([]);return O.useEffect(()=>{let a=!1;return cq(e,t,n).then(l=>{a||i(l)}),()=>{a=!0}},[e,t,n]),r}function bq({page:e,matches:t,...n}){let r=Qa(),{future:i}=kv(),{basename:a}=eO(),l=O.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let s=kL(e,a,i.v8_trailingSlashAwareDataRequests,"rsc"),c=!1,f=[];for(let d of t)typeof d.route.shouldRevalidate=="function"?c=!0:f.push(d.route.id);return c&&f.length>0&&s.searchParams.set("_routes",f.join(",")),[s.pathname+s.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return O.createElement(O.Fragment,null,l.map(s=>O.createElement("link",{key:s,rel:"prefetch",as:"fetch",href:s,...n})))}function xq({page:e,matches:t,...n}){let r=Qa(),{future:i,manifest:a,routeModules:l}=kv(),{basename:s}=eO(),{loaderData:c,matches:f}=mq(),d=O.useMemo(()=>cM(e,t,f,a,r,"data"),[e,t,f,a,r]),p=O.useMemo(()=>cM(e,t,f,a,r,"assets"),[e,t,f,a,r]),g=O.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let x=new Set,w=!1;if(t.forEach(k=>{let E=a.routes[k.route.id];!E||!E.hasLoader||(!d.some(P=>P.route.id===k.route.id)&&k.route.id in c&&l[k.route.id]?.shouldRevalidate||E.hasClientLoader?w=!0:x.add(k.route.id))}),x.size===0)return[];let A=kL(e,s,i.v8_trailingSlashAwareDataRequests,"data");return w&&x.size>0&&A.searchParams.set("_routes",t.filter(k=>x.has(k.route.id)).map(k=>k.route.id).join(",")),[A.pathname+A.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,d,t,e,l]),v=O.useMemo(()=>fq(p,a),[p,a]),y=yq(p);return O.createElement(O.Fragment,null,g.map(x=>O.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...n})),v.map(x=>O.createElement("link",{key:x,rel:"modulepreload",href:x,...n})),y.map(({key:x,link:w})=>O.createElement("link",{key:x,nonce:n.nonce,...w,crossOrigin:w.crossOrigin??n.crossOrigin})))}function Sq(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var wq=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{wq&&(window.__reactRouterVersion="7.18.1")}catch{}function Oq({basename:e,children:t,useTransitions:n,window:r}){let i=O.useRef();i.current==null&&(i.current=nF({window:r,v5Compat:!0}));let a=i.current,[l,s]=O.useState({action:a.action,location:a.location}),c=O.useCallback(f=>{n===!1?s(f):O.startTransition(()=>s(f))},[n]);return O.useLayoutEffect(()=>a.listen(c),[a,c]),O.createElement(ZF,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:a,useTransitions:n})}var za=O.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:a,replace:l,mask:s,state:c,target:f,to:d,preventScrollReset:p,viewTransition:g,defaultShouldRevalidate:v,...y},x){let{basename:w,navigator:A,useTransitions:k}=O.useContext(ti),E=typeof d=="string"&&Kw.test(d),P=pL(d,w);d=P.to;let T=jF(d,{relative:i}),M=Qa(),R=null;if(s){let oe=Xw(s,[],M.mask?M.mask.pathname:"/",!0);w!=="/"&&(oe.pathname=oe.pathname==="/"?w:mi([w,oe.pathname])),R=A.createHref(oe)}let[L,H,K]=gq(r,y),V=Eq(d,{replace:l,mask:s,state:c,target:f,preventScrollReset:p,relative:i,viewTransition:g,defaultShouldRevalidate:v,useTransitions:k});function B(oe){t&&t(oe),oe.defaultPrevented||V(oe)}let ae=!(P.isExternal||a),ie=O.createElement("a",{...y,...K,href:(ae?R:void 0)||P.absoluteURL||T,onClick:ae?B:t,ref:Sq(x,H),target:f,"data-discover":!E&&n==="render"?"true":void 0});return L&&!E?O.createElement(O.Fragment,null,ie,O.createElement(vq,{page:T})):ie});za.displayName="Link";var Aq=O.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:a,to:l,viewTransition:s,children:c,...f},d){let p=Uh(l,{relative:f.relative}),g=Qa(),v=O.useContext(Ov),{navigator:y,basename:x}=O.useContext(ti),w=v!=null&&Rq(p)&&s===!0,A=y.encodeLocation?y.encodeLocation(p).pathname:p.pathname,k=g.pathname,E=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(k=k.toLowerCase(),E=E?E.toLowerCase():null,A=A.toLowerCase()),E&&x&&(E=Ba(E,x)||E);const P=A!=="/"&&A.endsWith("/")?A.length-1:A.length;let T=k===A||!i&&k.startsWith(A)&&k.charAt(P)==="/",M=E!=null&&(E===A||!i&&E.startsWith(A)&&E.charAt(A.length)==="/"),R={isActive:T,isPending:M,isTransitioning:w},L=T?t:void 0,H;typeof r=="function"?H=r(R):H=[r,T?"active":null,M?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let K=typeof a=="function"?a(R):a;return O.createElement(za,{...f,"aria-current":L,className:H,ref:d,style:K,to:l,viewTransition:s},typeof c=="function"?c(R):c)});Aq.displayName="NavLink";var kq=O.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:l=Tm,action:s,onSubmit:c,relative:f,preventScrollReset:d,viewTransition:p,defaultShouldRevalidate:g,...v},y)=>{let{useTransitions:x}=O.useContext(ti),w=Pq(),A=Dq(s,{relative:f}),k=l.toLowerCase()==="get"?"get":"post",E=typeof s=="string"&&Kw.test(s),P=T=>{if(c&&c(T),T.defaultPrevented)return;T.preventDefault();let M=T.nativeEvent.submitter,R=M?.getAttribute("formmethod")||l,L=()=>w(M||T.currentTarget,{fetcherKey:t,method:R,navigate:n,replace:i,state:a,relative:f,preventScrollReset:d,viewTransition:p,defaultShouldRevalidate:g});x&&n!==!1?O.startTransition(()=>L()):L()};return O.createElement("form",{ref:y,method:k,action:A,onSubmit:r?c:P,...v,"data-discover":!E&&e==="render"?"true":void 0})});kq.displayName="Form";function Cq(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function CL(e){let t=O.useContext(sc);return Ct(t,Cq(e)),t}function Eq(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:l,viewTransition:s,defaultShouldRevalidate:c,useTransitions:f}={}){let d=Yw(),p=Qa(),g=Uh(e,{relative:l});return O.useCallback(v=>{if(iq(v,t)){v.preventDefault();let y=n!==void 0?n:ih(p)===ih(g),x=()=>d(e,{replace:y,mask:r,state:i,preventScrollReset:a,relative:l,viewTransition:s,defaultShouldRevalidate:c});f?O.startTransition(()=>x()):x()}},[p,d,g,n,r,i,t,e,a,l,s,c,f])}var Tq=0,Mq=()=>`__${String(++Tq)}__`;function Pq(){let{router:e}=CL("useSubmit"),{basename:t}=O.useContext(ti),n=XF(),r=e.fetch,i=e.navigate;return O.useCallback(async(a,l={})=>{let{action:s,method:c,encType:f,formData:d,body:p}=oq(a,t);if(l.navigate===!1){let g=l.fetcherKey||Mq();await r(g,n,l.action||s,{defaultShouldRevalidate:l.defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:d,body:p,formMethod:l.method||c,formEncType:l.encType||f,flushSync:l.flushSync})}else await i(l.action||s,{defaultShouldRevalidate:l.defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:d,body:p,formMethod:l.method||c,formEncType:l.encType||f,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,i,t,n])}function Dq(e,{relative:t}={}){let{basename:n}=O.useContext(ti),r=O.useContext(ta);Ct(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),a={...Uh(e||".",{relative:t})},l=Qa();if(e==null){a.search=l.search;let s=new URLSearchParams(a.search),c=s.getAll("index");if(c.some(d=>d==="")){s.delete("index"),c.filter(p=>p).forEach(p=>s.append("index",p));let d=s.toString();a.search=d?`?${d}`:""}}return(!e||e===".")&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(a.pathname=a.pathname==="/"?n:mi([n,a.pathname])),ih(a)}function Rq(e,{relative:t}={}){let n=O.useContext(vL);Ct(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=CL("useViewTransitionState"),i=Uh(e,{relative:t});if(!n.isTransitioning)return!1;let a=Ba(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=Ba(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Qm(i.pathname,l)!=null||Qm(i.pathname,a)!=null}var nO=XI();class ah extends Error{constructor(t,n){super(n),this.status=t}status}async function wr(e,t){const n=await fetch(e,{headers:{"Content-Type":"application/json"},...t});if(!n.ok){let r=n.statusText;try{const i=await n.json();i?.error&&(r=i.error)}catch{}throw new ah(n.status,r)}if(n.status!==204)return n.json()}const an={health:()=>wr("/api/health"),configs:()=>wr("/api/configs"),config:e=>wr(`/api/configs/${e}`),createConfig:(e,t)=>wr("/api/configs",{method:"POST",body:JSON.stringify({filename:e,content:t})}),updateConfig:(e,t,n)=>wr(`/api/configs/${e}`,{method:"PUT",body:JSON.stringify({content:t,baseHash:n})}),deleteConfig:e=>wr(`/api/configs/${e}`,{method:"DELETE"}),validateConfig:e=>wr("/api/configs/validate",{method:"POST",body:JSON.stringify({content:e})}),triggerRun:e=>wr(`/api/configs/${e}/run`,{method:"POST"}),configStats:(e,t)=>wr(`/api/configs/${e}/stats?days=${t}`),runs:(e={})=>{const t=new URLSearchParams;return e.configId!==void 0&&t.set("configId",String(e.configId)),e.status!==void 0&&t.set("status",e.status),e.limit!==void 0&&t.set("limit",String(e.limit)),e.before!==void 0&&t.set("before",String(e.before)),wr(`/api/runs?${t}`)},run:e=>wr(`/api/runs/${e}`),runLogs:(e,t=0,n=1e3)=>wr(`/api/runs/${e}/logs?afterSeq=${t}&limit=${n}`),cancelRun:e=>wr(`/api/runs/${e}/cancel`,{method:"POST"})};var ix={exports:{}},fM;function _q(){return fM||(fM=1,(function(e,t){(function(r,i){e.exports=i()})(globalThis,()=>(()=>{var n={949(l,s,c){Object.defineProperty(s,"__esModule",{value:!0}),s.CronParser=void 0;var f=c(515),d=(function(){function p(g,v,y){v===void 0&&(v=!0),y===void 0&&(y=!1),this.expression=g,this.dayOfWeekStartIndexZero=v,this.monthStartIndexZero=y}return p.prototype.parse=function(){var g,v,y=(g=this.expression)!==null&&g!==void 0?g:"";if(y==="@reboot")return v=["@reboot","","","","","",""],v;if(y.startsWith("@")){var x=this.parseSpecial(this.expression);v=this.extractParts(x)}else v=this.extractParts(this.expression);return this.normalize(v),this.validate(v),v},p.prototype.parseSpecial=function(g){var v={"@yearly":"0 0 1 1 *","@annually":"0 0 1 1 *","@monthly":"0 0 1 * *","@weekly":"0 0 * * 0","@daily":"0 0 * * *","@midnight":"0 0 * * *","@hourly":"0 * * * *","@reboot":"@reboot"},y=v[g];if(!y)throw new Error("Unknown special expression.");return y},p.prototype.extractParts=function(g){if(!this.expression)throw new Error("cron expression is empty");for(var v=g.trim().split(/[ ]+/),y=0;y<v.length;y++)if(v[y].includes(",")){var x=v[y].split(",").map(function(A){return A.trim()}).filter(function(A){return A!==""}).map(function(A){return isNaN(Number(A))?A:Number(A)}).filter(function(A){return A!==null&&A!==""});x.length===0&&x.push("*"),x.sort(function(A,k){return A!==null&&k!==null?A-k:0}),v[y]=x.map(function(A){return A!==null?A.toString():""}).join(",")}if(v.length<5)throw new Error("Expression has only ".concat(v.length," part").concat(v.length==1?"":"s",". At least 5 parts are required."));if(v.length==5)v.unshift(""),v.push("");else if(v.length==6){var w=/\d{4}$/.test(v[5])||v[4]=="?"||v[2]=="?";w?v.unshift(""):v.push("")}else if(v.length>7)throw new Error("Expression has ".concat(v.length," parts; too many!"));return v},p.prototype.normalize=function(g){var v=this;if(g[3]=g[3].replace("?","*"),g[5]=g[5].replace("?","*"),g[2]=g[2].replace("?","*"),g[0].indexOf("0/")==0&&(g[0]=g[0].replace("0/","*/")),g[1].indexOf("0/")==0&&(g[1]=g[1].replace("0/","*/")),g[2].indexOf("0/")==0&&(g[2]=g[2].replace("0/","*/")),g[3].indexOf("1/")==0&&(g[3]=g[3].replace("1/","*/")),g[4].indexOf("1/")==0&&(g[4]=g[4].replace("1/","*/")),g[6].indexOf("1/")==0&&(g[6]=g[6].replace("1/","*/")),g[5]=g[5].replace(/(^\d)|([^#/\s]\d)/g,function(T){var M=T.replace(/\D/,""),R=M;return v.dayOfWeekStartIndexZero?M=="7"&&(R="0"):R=(parseInt(M)-1).toString(),T.replace(M,R)}),g[5]=="L"&&(g[5]="6"),g[3]=="?"&&(g[3]="*"),g[3].indexOf("W")>-1&&(g[3].indexOf(",")>-1||g[3].indexOf("-")>-1))throw new Error("The 'W' character can be specified only when the day-of-month is a single day, not a range or list of days.");var y={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var x in y)g[5]=g[5].replace(new RegExp(x,"gi"),y[x].toString());g[4]=g[4].replace(/(^\d{1,2})|([^#/\s]\d{1,2})/g,function(T){var M=T.replace(/\D/,""),R=M;return v.monthStartIndexZero&&(R=(parseInt(M)+1).toString()),T.replace(M,R)});var w={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12};for(var A in w)g[4]=g[4].replace(new RegExp(A,"gi"),w[A].toString());g[0]=="0"&&(g[0]=""),!/\*|\-|\,|\//.test(g[2])&&(/\*|\//.test(g[1])||/\*|\//.test(g[0]))&&(g[2]+="-".concat(g[2]));for(var k=0;k<g.length;k++)if(g[k].indexOf(",")!=-1&&(g[k]=g[k].split(",").filter(function(T){return T!==""}).join(",")||"*"),g[k]=="*/1"&&(g[k]="*"),g[k].indexOf("/")>-1&&!/^\*|\-|\,/.test(g[k])){var E=null;switch(k){case 4:E="12";break;case 5:E="6";break;case 6:E="9999";break;default:E=null;break}if(E!==null){var P=g[k].split("/");g[k]="".concat(P[0],"-").concat(E,"/").concat(P[1])}}},p.prototype.validate=function(g){var v="0-9,\\-*/";this.validateOnlyExpectedCharactersFound(g[0],v),this.validateOnlyExpectedCharactersFound(g[1],v),this.validateOnlyExpectedCharactersFound(g[2],v),this.validateOnlyExpectedCharactersFound(g[3],"0-9,\\-*/LW"),this.validateOnlyExpectedCharactersFound(g[4],v),this.validateOnlyExpectedCharactersFound(g[5],"0-9,\\-*/L#"),this.validateOnlyExpectedCharactersFound(g[6],v),this.validateAnyRanges(g)},p.prototype.validateAnyRanges=function(g){f.default.secondRange(g[0]),f.default.minuteRange(g[1]),f.default.hourRange(g[2]),f.default.dayOfMonthRange(g[3]),f.default.monthRange(g[4],this.monthStartIndexZero),f.default.dayOfWeekRange(g[5],this.dayOfWeekStartIndexZero)},p.prototype.validateOnlyExpectedCharactersFound=function(g,v){var y=g.match(new RegExp("[^".concat(v,"]+"),"gi"));if(y&&y.length)throw new Error("Expression contains invalid values: '".concat(y.toString(),"'"))},p})();s.CronParser=d},333(l,s,c){Object.defineProperty(s,"__esModule",{value:!0}),s.ExpressionDescriptor=void 0;var f=c(823),d=c(949),p=(function(){function g(v,y){if(this.expression=v,this.options=y,this.expressionParts=new Array(5),!this.options.locale&&g.defaultLocale&&(this.options.locale=g.defaultLocale),!g.locales[this.options.locale]){var x=Object.keys(g.locales)[0];console.warn("Locale '".concat(this.options.locale,"' could not be found; falling back to '").concat(x,"'.")),this.options.locale=x}this.i18n=g.locales[this.options.locale],y.use24HourTimeFormat===void 0&&(y.use24HourTimeFormat=this.i18n.use24HourTimeFormatByDefault())}return g.toString=function(v,y){var x=y===void 0?{}:y,w=x.throwExceptionOnParseError,A=w===void 0?!0:w,k=x.verbose,E=k===void 0?!1:k,P=x.dayOfWeekStartIndexZero,T=P===void 0?!0:P,M=x.monthStartIndexZero,R=M===void 0?!1:M,L=x.use24HourTimeFormat,H=x.trimHoursLeadingZero,K=H===void 0?!1:H,V=x.locale,B=V===void 0?null:V,ae=x.logicalAndDayFields,ie=ae===void 0?!1:ae,oe={throwExceptionOnParseError:A,verbose:E,dayOfWeekStartIndexZero:T,monthStartIndexZero:R,use24HourTimeFormat:L,trimHoursLeadingZero:K,locale:B,logicalAndDayFields:ie};oe.tzOffset&&console.warn("'tzOffset' option has been deprecated and is no longer supported.");var z=new g(v,oe);return z.getFullDescription()},g.initialize=function(v,y){y===void 0&&(y="en"),g.specialCharacters=["/","-",",","*"],g.defaultLocale=y,v.load(g.locales)},g.prototype.getFullDescription=function(){var v,y,x="";try{var w=new d.CronParser(this.expression,this.options.dayOfWeekStartIndexZero,this.options.monthStartIndexZero);if(this.expressionParts=w.parse(),this.expressionParts[0]==="@reboot")return((y=(v=this.i18n).atReboot)===null||y===void 0?void 0:y.call(v))||"Run once, at startup";var A=this.getTimeOfDayDescription(),k=this.getDayOfMonthDescription(),E=this.getMonthDescription(),P=this.getDayOfWeekDescription(),T=this.getYearDescription();x+=A+k+P+E+T,x=this.transformVerbosity(x,!!this.options.verbose),x=x.charAt(0).toLocaleUpperCase()+x.substr(1)}catch(M){if(!this.options.throwExceptionOnParseError)x=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();else throw"".concat(M)}return x},g.prototype.getTimeOfDayDescription=function(){var v=this.expressionParts[0],y=this.expressionParts[1],x=this.expressionParts[2],w="";if(!f.StringUtilities.containsAny(y,g.specialCharacters)&&!f.StringUtilities.containsAny(x,g.specialCharacters)&&!f.StringUtilities.containsAny(v,g.specialCharacters))w+=this.i18n.atSpace()+this.formatTime(x,y,v);else if(!v&&y.indexOf("-")>-1&&!(y.indexOf(",")>-1)&&!(y.indexOf("/")>-1)&&!f.StringUtilities.containsAny(x,g.specialCharacters)){var A=y.split("-");w+=f.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(x,A[0],""),this.formatTime(x,A[1],""))}else if(!v&&x.indexOf(",")>-1&&x.indexOf("-")==-1&&x.indexOf("/")==-1&&!f.StringUtilities.containsAny(y,g.specialCharacters)){var k=x.split(",");w+=this.i18n.at();for(var E=0;E<k.length;E++)w&&(w+=" "),w+=this.formatTime(k[E],y,""),E<k.length-2&&(w+=","),E==k.length-2&&(w+=this.i18n.spaceAnd())}else{var P=this.getSecondsDescription(),T=this.getMinutesDescription(),M=this.getHoursDescription();if(w+=P,w&&T&&(w+=", "),w+=T,T===M)return w;w&&M&&(w+=", "),w+=M}return w},g.prototype.getSecondsDescription=function(){var v=this,y=this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),function(x){return x},function(x){return f.StringUtilities.format(v.i18n.everyX0Seconds(x),x)},function(x){return v.i18n.secondsX0ThroughX1PastTheMinute()},function(x){return x=="0"?"":parseInt(x)<20?v.i18n.atX0SecondsPastTheMinute(x):v.i18n.atX0SecondsPastTheMinuteGt20()||v.i18n.atX0SecondsPastTheMinute(x)});return y},g.prototype.getMinutesDescription=function(){var v=this,y=this.expressionParts[0],x=this.expressionParts[2],w=this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),function(A){return A},function(A){return f.StringUtilities.format(v.i18n.everyX0Minutes(A),A)},function(A){return v.i18n.minutesX0ThroughX1PastTheHour()},function(A){var k,E;try{return A=="0"&&x.indexOf("/")==-1&&y==""?v.i18n.everyHour():A=="0"?((E=(k=v.i18n).onTheHour)===null||E===void 0?void 0:E.call(k))||v.i18n.atX0MinutesPastTheHour(A):parseInt(A)<20?v.i18n.atX0MinutesPastTheHour(A):v.i18n.atX0MinutesPastTheHourGt20()||v.i18n.atX0MinutesPastTheHour(A)}catch{return v.i18n.atX0MinutesPastTheHour(A)}});return w},g.prototype.getHoursDescription=function(){var v=this,y=this.expressionParts[2],x=0,w=[];y.split("/")[0].split(",").forEach(function(E){var P=E.split("-");P.length===2&&w.push({value:P[1],index:x+1}),x+=P.length});var A=0,k=this.getSegmentDescription(y,this.i18n.everyHour(),function(E){var P=w.find(function(M){return M.value===E&&M.index===A}),T=P&&v.expressionParts[1]!=="0";return A++,T?v.formatTime(E,"59",""):v.formatTime(E,"0","")},function(E){return f.StringUtilities.format(v.i18n.everyX0Hours(E),E)},function(E){return v.i18n.betweenX0AndX1()},function(E){return v.i18n.atX0()});return k},g.prototype.getDayOfWeekDescription=function(){var v=this,y=this.i18n.daysOfTheWeek(),x=null;return this.expressionParts[5]=="*"?x="":x=this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),function(w,A){var k=w;w.indexOf("#")>-1?k=w.substring(0,w.indexOf("#")):w.indexOf("L")>-1&&(k=k.replace("L",""));var E=parseInt(k),P=v.i18n.daysOfTheWeekInCase?v.i18n.daysOfTheWeekInCase(A)[E]:y[E];if(w.indexOf("#")>-1){var T=null,M=w.substring(w.indexOf("#")+1),R=w.substring(0,w.indexOf("#"));switch(M){case"1":T=v.i18n.first(R);break;case"2":T=v.i18n.second(R);break;case"3":T=v.i18n.third(R);break;case"4":T=v.i18n.fourth(R);break;case"5":T=v.i18n.fifth(R);break}P=T+" "+P}return P},function(w){return parseInt(w)==1?"":f.StringUtilities.format(v.i18n.commaEveryX0DaysOfTheWeek(w),w)},function(w){var A=w.substring(0,w.indexOf("-")),k=v.expressionParts[3]!="*";return k?v.i18n.commaAndX0ThroughX1(A):v.i18n.commaX0ThroughX1(A)},function(w){var A=null;if(w.indexOf("#")>-1){var k=w.substring(w.indexOf("#")+1),E=w.substring(0,w.indexOf("#"));A=v.i18n.commaOnThe(k,E).trim()+v.i18n.spaceX0OfTheMonth()}else if(w.indexOf("L")>-1)A=v.i18n.commaOnTheLastX0OfTheMonth(w.replace("L",""));else{var P=v.expressionParts[3]!="*";P?v.options.logicalAndDayFields?A=v.i18n.commaOnlyOnX0(w):A=v.i18n.commaAndOnX0():A=v.i18n.commaOnlyOnX0(w)}return A}),x},g.prototype.getMonthDescription=function(){var v=this,y=this.i18n.monthsOfTheYear(),x=this.getSegmentDescription(this.expressionParts[4],"",function(w,A){return A&&v.i18n.monthsOfTheYearInCase?v.i18n.monthsOfTheYearInCase(A)[parseInt(w)-1]:y[parseInt(w)-1]},function(w){return parseInt(w)==1?"":f.StringUtilities.format(v.i18n.commaEveryX0Months(w),w)},function(w){return v.i18n.commaMonthX0ThroughMonthX1()||v.i18n.commaX0ThroughX1()},function(w){return v.i18n.commaOnlyInMonthX0?v.i18n.commaOnlyInMonthX0():v.i18n.commaOnlyInX0()});return x},g.prototype.getDayOfMonthDescription=function(){var v=this,y=null,x=this.expressionParts[3];switch(x){case"L":y=this.i18n.commaOnTheLastDayOfTheMonth();break;case"WL":case"LW":y=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var w=x.match(/(\d{1,2}W)|(W\d{1,2})/);if(w){var A=parseInt(w[0].replace("W","")),k=A==1?this.i18n.firstWeekday():f.StringUtilities.format(this.i18n.weekdayNearestDayX0(),A.toString());y=f.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),k);break}else{var E=x.match(/L-(\d{1,2})/);if(E){var P=E[1];y=f.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(P),P);break}else{if(x=="*"&&this.expressionParts[5]!="*")return"";y=this.getSegmentDescription(x,this.i18n.commaEveryDay(),function(T){return T=="L"?v.i18n.lastDay():v.i18n.dayX0?f.StringUtilities.format(v.i18n.dayX0(),T):T},function(T){return T=="1"?v.i18n.commaEveryDay():v.i18n.commaEveryX0Days(T)},function(T){return v.i18n.commaBetweenDayX0AndX1OfTheMonth(T)},function(T){return v.i18n.commaOnDayX0OfTheMonth(T)})}break}}return y},g.prototype.getYearDescription=function(){var v=this,y=this.getSegmentDescription(this.expressionParts[6],"",function(x){return/^\d+$/.test(x)?new Date(parseInt(x),1).getFullYear().toString():x},function(x){return f.StringUtilities.format(v.i18n.commaEveryX0Years(x),x)},function(x){return v.i18n.commaYearX0ThroughYearX1()||v.i18n.commaX0ThroughX1()},function(x){return v.i18n.commaOnlyInYearX0?v.i18n.commaOnlyInYearX0():v.i18n.commaOnlyInX0()});return y},g.prototype.getSegmentDescription=function(v,y,x,w,A,k){var E=null,P=v.indexOf("/")>-1,T=v.indexOf("-")>-1,M=v.indexOf(",")>-1;if(!v)E="";else if(v==="*")E=y;else if(!P&&!T&&!M)E=f.StringUtilities.format(k(v),x(v));else if(M){for(var R=v.split(","),L="",H=this.i18n.spaceAnd(),K=0;K<R.length;K++)if(K>0&&R.length>2&&(L+=",",K<R.length-1&&(L+=" ")),K>0&&R.length>1&&(K==R.length-1||R.length==2)&&(L+=H==","&&R.length>2?" ":"".concat(H," ")),R[K].indexOf("/")>-1||R[K].indexOf("-")>-1){var V=R[K].indexOf("-")>-1&&R[K].indexOf("/")==-1,B=this.getSegmentDescription(R[K],y,x,w,V?this.i18n.commaX0ThroughX1:A,k);V&&(B=B.replace(", ","")),L+=B}else if(!P)L+=x(R[K]);else{var ae=this.getSegmentDescription(R[K],y,x,w,A,k);ae&&ae.startsWith(", ")&&(ae=ae.substring(2)),L+=ae}P?E=L:E=f.StringUtilities.format(k(v),L)}else if(P){var R=v.split("/");if(E=f.StringUtilities.format(w(R[1]),R[1]),R[0].indexOf("-")>-1){var ie=this.generateRangeSegmentDescription(R[0],A,x);ie.indexOf(", ")!=0&&(E+=", "),E+=ie}else if(R[0].indexOf("*")==-1){var oe=f.StringUtilities.format(k(R[0]),x(R[0]));oe=oe.replace(", ",""),E+=f.StringUtilities.format(this.i18n.commaStartingX0(),oe)}}else T&&(E=this.generateRangeSegmentDescription(v,A,x));return E},g.prototype.generateRangeSegmentDescription=function(v,y,x){var w="",A=v.split("-"),k=x(A[0],1),E=x(A[1],2),P=y(v);return w+=f.StringUtilities.format(P,k,E),w},g.prototype.formatTime=function(v,y,x){var w=0,A=0,k=parseInt(v)+w,E=parseInt(y)+A;E>=60?(E-=60,k+=1):E<0&&(E+=60,k-=1),k>=24?k=k-24:k<0&&(k=24+k);var P="",T=!1;this.options.use24HourTimeFormat||(T=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),P=T?"".concat(this.getPeriod(k)," "):" ".concat(this.getPeriod(k)),k>12&&(k-=12),k===0&&(k=12));var M="";x&&(M=":".concat(("00"+x).substring(x.length)));var R=k.toString(),L=("00"+R).substring(R.length),H=E.toString(),K=("00"+H).substring(H.length),V=this.options.trimHoursLeadingZero?R:L;return"".concat(T?P:"").concat(V,":").concat(K).concat(M).concat(T?"":P)},g.prototype.transformVerbosity=function(v,y){if(!y&&(v=v.replace(new RegExp(", ".concat(this.i18n.everyMinute()),"g"),""),v=v.replace(new RegExp(", ".concat(this.i18n.everyHour()),"g"),""),v=v.replace(new RegExp(this.i18n.commaEveryDay(),"g"),""),v=v.replace(/\, ?$/,""),this.i18n.conciseVerbosityReplacements))for(var x=0,w=Object.entries(this.i18n.conciseVerbosityReplacements());x<w.length;x++){var A=w[x],k=A[0],E=A[1];v=v.replace(new RegExp(k,"g"),E)}return v},g.prototype.getPeriod=function(v){return v>=12?this.i18n.pm&&this.i18n.pm()||"PM":this.i18n.am&&this.i18n.am()||"AM"},g.locales={},g})();s.ExpressionDescriptor=p},747(l,s,c){Object.defineProperty(s,"__esModule",{value:!0}),s.enLocaleLoader=void 0;var f=c(486),d=(function(){function p(){}return p.prototype.load=function(g){g.en=new f.en},p})();s.enLocaleLoader=d},486(l,s){Object.defineProperty(s,"__esModule",{value:!0}),s.en=void 0;var c=(function(){function f(){}return f.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},f.prototype.atX0MinutesPastTheHourGt20=function(){return null},f.prototype.commaMonthX0ThroughMonthX1=function(){return null},f.prototype.commaYearX0ThroughYearX1=function(){return null},f.prototype.use24HourTimeFormatByDefault=function(){return!1},f.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occurred when generating the expression description. Check the cron expression syntax."},f.prototype.everyMinute=function(){return"every minute"},f.prototype.everyHour=function(){return"every hour"},f.prototype.atSpace=function(){return"At "},f.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},f.prototype.at=function(){return"At"},f.prototype.spaceAnd=function(){return" and"},f.prototype.everySecond=function(){return"every second"},f.prototype.everyX0Seconds=function(){return"every %s seconds"},f.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},f.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},f.prototype.everyX0Minutes=function(){return"every %s minutes"},f.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},f.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},f.prototype.everyX0Hours=function(){return"every %s hours"},f.prototype.betweenX0AndX1=function(){return"between %s and %s"},f.prototype.atX0=function(){return"at %s"},f.prototype.commaEveryDay=function(){return", every day"},f.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},f.prototype.commaX0ThroughX1=function(){return", %s through %s"},f.prototype.commaAndX0ThroughX1=function(){return", %s through %s"},f.prototype.first=function(){return"first"},f.prototype.second=function(){return"second"},f.prototype.third=function(){return"third"},f.prototype.fourth=function(){return"fourth"},f.prototype.fifth=function(){return"fifth"},f.prototype.commaOnThe=function(){return", on the "},f.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},f.prototype.lastDay=function(){return"the last day"},f.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},f.prototype.commaOnlyOnX0=function(){return", only on %s"},f.prototype.commaAndOnX0=function(){return", and on %s"},f.prototype.commaEveryX0Months=function(){return", every %s months"},f.prototype.commaOnlyInX0=function(){return", only in %s"},f.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},f.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},f.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},f.prototype.firstWeekday=function(){return"first weekday"},f.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},f.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},f.prototype.commaEveryX0Days=function(){return", every %s days in a month"},f.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},f.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},f.prototype.commaEveryHour=function(){return", every hour"},f.prototype.commaEveryX0Years=function(){return", every %s years"},f.prototype.commaStartingX0=function(){return", starting %s"},f.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},f.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},f.prototype.atReboot=function(){return"Run once, at startup"},f.prototype.onTheHour=function(){return"on the hour"},f})();s.en=c},515(l,s){Object.defineProperty(s,"__esModule",{value:!0});function c(d,p){if(!d)throw new Error(p)}var f=(function(){function d(){}return d.secondRange=function(p){for(var g=p.split(","),v=0;v<g.length;v++)if(!isNaN(parseInt(g[v],10))){var y=parseInt(g[v],10);c(y>=0&&y<=59,"seconds part must be >= 0 and <= 59")}},d.minuteRange=function(p){for(var g=p.split(","),v=0;v<g.length;v++)if(!isNaN(parseInt(g[v],10))){var y=parseInt(g[v],10);c(y>=0&&y<=59,"minutes part must be >= 0 and <= 59")}},d.hourRange=function(p){for(var g=p.split(","),v=0;v<g.length;v++)if(!isNaN(parseInt(g[v],10))){var y=parseInt(g[v],10);c(y>=0&&y<=23,"hours part must be >= 0 and <= 23")}},d.dayOfMonthRange=function(p){for(var g=p.split(","),v=0;v<g.length;v++)if(!isNaN(parseInt(g[v],10))){var y=parseInt(g[v],10);c(y>=1&&y<=31,"DOM part must be >= 1 and <= 31")}},d.monthRange=function(p,g){for(var v=p.split(","),y=0;y<v.length;y++)if(!isNaN(parseInt(v[y],10))){var x=parseInt(v[y],10);c(x>=1&&x<=12,g?"month part must be >= 0 and <= 11":"month part must be >= 1 and <= 12")}},d.dayOfWeekRange=function(p,g){for(var v=p.split(","),y=0;y<v.length;y++)if(!isNaN(parseInt(v[y],10))){var x=parseInt(v[y],10);c(x>=0&&x<=6,g?"DOW part must be >= 0 and <= 6":"DOW part must be >= 1 and <= 7")}},d})();s.default=f},823(l,s){Object.defineProperty(s,"__esModule",{value:!0}),s.StringUtilities=void 0;var c=(function(){function f(){}return f.format=function(d){for(var p=[],g=1;g<arguments.length;g++)p[g-1]=arguments[g];return d.replace(/%s/g,function(v){return p.shift()})},f.containsAny=function(d,p){return p.some(function(g){return d.indexOf(g)>-1})},f})();s.StringUtilities=c}},r={};function i(l){var s=r[l];if(s!==void 0)return s.exports;var c=r[l]={exports:{}};return n[l](c,c.exports,i),c.exports}var a={};return(()=>{var l=a;Object.defineProperty(l,"__esModule",{value:!0}),l.toString=void 0;var s=i(333),c=i(747);s.ExpressionDescriptor.initialize(new c.enLocaleLoader),l.default=s.ExpressionDescriptor;var f=s.ExpressionDescriptor.toString;l.toString=f})(),a})())})(ix)),ix.exports}var Nq=_q();const Iq=wv(Nq);function lh(e){if(e==null||!isFinite(e))return"—";if(e<1)return"<1s";if(e<60)return`${Math.round(e)}s`;const t=Math.floor(e/60);return t<60?`${t}m ${Math.round(e%60)}s`:`${Math.floor(t/60)}h ${t%60}m`}function rO(e,t){if(!e)return"—";const n=t?new Date(t).getTime():Date.now();return lh((n-new Date(e).getTime())/1e3)}function Hu(e){return e?new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}function L1(e){if(!e)return"—";const t=new Date(e).getTime()-Date.now(),n=Math.abs(t),r=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});return n<6e4?r.format(Math.round(t/1e3),"second"):n<36e5?r.format(Math.round(t/6e4),"minute"):n<864e5?r.format(Math.round(t/36e5),"hour"):r.format(Math.round(t/864e5),"day")}function iO(e){if(!e)return"Manual only";try{return Iq.toString(e,{verbose:!1})}catch{return e}}const hM={succeeded:{label:"Succeeded",symbol:"✓",className:"text-good-text border-good/40"},failed:{label:"Failed",symbol:"✕",className:"text-critical border-critical/40"},running:{label:"Running",symbol:"●",className:"text-accent border-accent/40 animate-pulse"},queued:{label:"Queued",symbol:"…",className:"text-ink-secondary border-edge"},skipped:{label:"Skipped",symbol:"≫",className:"text-warning border-warning/40"},canceled:{label:"Canceled",symbol:"⊘",className:"text-ink-muted border-edge"}};function aO({status:e}){const t=hM[e]??hM.queued;return _.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full border bg-surface px-2.5 py-0.5 text-xs font-medium ${t.className}`,children:[_.jsx("span",{"aria-hidden":!0,children:t.symbol}),t.label]})}var Ke=Symbol("NOT_RESOLVED"),lO=Symbol("MERGE_KEY");function Dn(e,t){return{tagName:e,nodeKind:"scalar",implicit:t.implicit??!1,matchByTagPrefix:t.matchByTagPrefix??!1,implicitFirstChars:t.implicitFirstChars??null,resolve:t.resolve,identify:t.identify??null,represent:t.represent??(n=>String(n)),representTagName:t.representTagName??null}}function oO(e,t){const n=t.finalize===void 0;return{tagName:e,nodeKind:"sequence",implicit:!1,matchByTagPrefix:t.matchByTagPrefix??!1,create:t.create,addItem:t.addItem,finalize:t.finalize??(r=>r),carrierIsResult:n,identify:t.identify??null,represent:t.represent??(r=>r),representTagName:t.representTagName??null}}function Cv(e,t){const n=t.finalize===void 0;return{tagName:e,nodeKind:"mapping",implicit:!1,matchByTagPrefix:t.matchByTagPrefix??!1,create:t.create,addPair:t.addPair,has:t.has,keys:t.keys,get:t.get,finalize:t.finalize??(r=>r),carrierIsResult:n,identify:t.identify??null,represent:t.represent??(r=>r),representTagName:t.representTagName??null}}var Lq=Dn("tag:yaml.org,2002:str",{resolve:e=>e,identify:e=>typeof e=="string"}),jq=["","~","null","Null","NULL"],Bq=Dn("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:e=>jq.indexOf(e)!==-1?null:Ke,identify:e=>e===null,represent:()=>"null"}),zq=Dn("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["n"],resolve:(e,t)=>e==="null"||t&&e===""?null:Ke,identify:e=>e===null,represent:()=>"null"}),$q=["","~","null","Null","NULL"],Hq=Dn("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:e=>$q.indexOf(e)!==-1?null:Ke,identify:e=>e===null,represent:()=>"null"}),Uq=["true","True","TRUE"],Fq=["false","False","FALSE"],qq=Dn("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","T","f","F"],resolve:e=>Uq.indexOf(e)!==-1?!0:Fq.indexOf(e)!==-1?!1:Ke,identify:e=>Object.prototype.toString.call(e)==="[object Boolean]",represent:e=>e?"true":"false"}),Wq=["true"],Vq=["false"],Kq=Dn("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","f"],resolve:e=>Wq.indexOf(e)!==-1?!0:Vq.indexOf(e)!==-1?!1:Ke,identify:e=>Object.prototype.toString.call(e)==="[object Boolean]",represent:e=>e?"true":"false"}),Xq=["true","True","TRUE","y","Y","yes","Yes","YES","on","On","ON"],Qq=["false","False","FALSE","n","N","no","No","NO","off","Off","OFF"],Yq=Dn("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["y","Y","n","N","t","T","f","F","o","O"],resolve:e=>Xq.indexOf(e)!==-1?!0:Qq.indexOf(e)!==-1?!1:Ke,identify:e=>Object.prototype.toString.call(e)==="[object Boolean]",represent:e=>e?"true":"false"}),Gq=new RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$"),Zq=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");function Jq(e){let t=e,n=1;return(t[0]==="-"||t[0]==="+")&&(t[0]==="-"&&(n=-1),t=t.slice(1)),t.startsWith("0b")?n*parseInt(t.slice(2),2):t.startsWith("0o")?n*parseInt(t.slice(2),8):t.startsWith("0x")?n*parseInt(t.slice(2),16):n*parseInt(t,10)}function eW(e,t){if(t){if(!Zq.test(e))return Ke}else if(!Gq.test(e))return Ke;const n=Jq(e);return Number.isFinite(n)?n:Ke}var EL=Dn("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:eW,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:e=>e.toString(10)}),tW=new RegExp("^-?(?:0|[1-9][0-9]*)$"),nW=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");function rW(e){let t=e,n=1;return(t[0]==="-"||t[0]==="+")&&(t[0]==="-"&&(n=-1),t=t.slice(1)),t.startsWith("0b")?n*parseInt(t.slice(2),2):t.startsWith("0o")?n*parseInt(t.slice(2),8):t.startsWith("0x")?n*parseInt(t.slice(2),16):n*parseInt(t,10)}function iW(e,t){if(t){if(!nW.test(e))return Ke}else if(!tW.test(e))return Ke;const n=rW(e);return Number.isFinite(n)?n:Ke}var aW=Dn("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:iW,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:e=>e.toString(10)}),lW=new RegExp("^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$");function oW(e){let t=e.replace(/_/g,""),n=1;if((t[0]==="-"||t[0]==="+")&&(t[0]==="-"&&(n=-1),t=t.slice(1)),t.startsWith("0b"))return n*parseInt(t.slice(2),2);if(t.startsWith("0x"))return n*parseInt(t.slice(2),16);if(t.includes(":")){let r=0;for(const i of t.split(":"))r=r*60+Number(i);return n*r}return t!=="0"&&t[0]==="0"?n*parseInt(t,8):n*parseInt(t,10)}function sW(e){if(!lW.test(e))return Ke;const t=oW(e);return Number.isFinite(t)?t:Ke}var j1=Dn("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:sW,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:e=>e.toString(10)}),uW=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),cW=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function fW(e){if(!uW.test(e))return Ke;let t=e.toLowerCase();const n=t[0]==="-"?-1:1;if("+-".includes(t[0])&&(t=t.slice(1)),t===".inf")return n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(t===".nan")return NaN;const r=n*parseFloat(t);return Number.isFinite(r)||cW.test(e)?r:Ke}function hW(e){if(isNaN(e))return".nan";if(e===Number.POSITIVE_INFINITY)return".inf";if(e===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(e,-0))return"-0.0";const t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace("e",".e"):t}var TL=Dn("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:fW,identify:e=>typeof e=="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:hW}),dW=new RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$"),pW=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function mW(e,t){if(t){if(!pW.test(e))return Ke;let r=e.toLowerCase();const i=r[0]==="-"?-1:1;if("+-".includes(r[0])&&(r=r.slice(1)),r===".inf")return i===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(r===".nan")return NaN;const a=i*parseFloat(r);return Number.isFinite(a)?a:Ke}if(!dW.test(e))return Ke;const n=Number(e);return Number.isFinite(n)?n:Ke}function gW(e){if(isNaN(e))return".nan";if(e===Number.POSITIVE_INFINITY)return".inf";if(e===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(e,-0))return"-0.0";const t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace("e",".e"):t}var vW=Dn("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:mW,identify:e=>typeof e=="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:gW}),yW=new RegExp("^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),bW=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function xW(e){if(!yW.test(e))return Ke;let t=e.toLowerCase().replace(/_/g,"");const n=t[0]==="-"?-1:1;if("+-".includes(t[0])&&(t=t.slice(1)),t===".inf")return n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(t===".nan")return NaN;let r=0;if(t.includes(":")){for(const i of t.split(":"))r=r*60+Number(i);r*=n}else r=n*parseFloat(t);return Number.isFinite(r)||bW.test(e)?r:Ke}function SW(e){if(isNaN(e))return".nan";if(e===Number.POSITIVE_INFINITY)return".inf";if(e===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(e,-0))return"-0.0";const t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace("e",".e"):t}var B1=Dn("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:xW,identify:e=>typeof e=="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:SW}),wW=Dn("tag:yaml.org,2002:merge",{implicit:!0,implicitFirstChars:["<"],resolve:(e,t)=>e==="<<"||t&&e===""?lO:Ke}),OW=/^[A-Za-z0-9+/]*={0,2}$/;function AW(e){const t=e.replace(/\s/g,"");if(t.length%4!==0||!OW.test(t))return Ke;const n=atob(t),r=new Uint8Array(n.length);for(let i=0;i<n.length;i++)r[i]=n.charCodeAt(i);return r}function kW(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}var CW=Dn("tag:yaml.org,2002:binary",{resolve:AW,identify:e=>Object.prototype.toString.call(e)==="[object Uint8Array]",represent:kW}),EW=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),TW=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function MW(e){let t=EW.exec(e);if(t===null&&(t=TW.exec(e)),t===null)return Ke;const n=+t[1],r=+t[2]-1,i=+t[3];if(!t[4]){const d=new Date(Date.UTC(n,r,i));return d.getUTCFullYear()!==n||d.getUTCMonth()!==r||d.getUTCDate()!==i?Ke:d}const a=+t[4],l=+t[5],s=+t[6];let c=0;if(a>23||l>59||s>59)return Ke;if(t[7]){let d=t[7].slice(0,3);for(;d.length<3;)d+="0";c=+d}const f=new Date(Date.UTC(n,r,i,a,l,s,c));if(f.getUTCFullYear()!==n||f.getUTCMonth()!==r||f.getUTCDate()!==i)return Ke;if(t[9]){const d=+t[10],p=+(t[11]||0);if(d>23||p>59)return Ke;const g=(d*60+p)*6e4;f.setTime(f.getTime()-(t[9]==="-"?-g:g))}return f}var PW=Dn("tag:yaml.org,2002:timestamp",{implicit:!0,implicitFirstChars:[..."0123456789"],resolve:MW,identify:e=>e instanceof Date,represent:e=>e.toISOString()}),DW=oO("tag:yaml.org,2002:seq",{create:()=>[],addItem:(e,t)=>{e.push(t)},identify:Array.isArray});function Ev(e){if(e===null||typeof e!="object"||Array.isArray(e))return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function z1(e,t){const n={};for(const r of t)e[r]!==void 0&&(n[r]=e[r]);return n}var RW=oO("tag:yaml.org,2002:omap",{create:()=>({list:[],seen:new Set}),addItem:(e,t)=>{let n;if(t instanceof Map){if(t.size!==1)return"cannot resolve an ordered map item";n=t.keys().next().value}else if(Ev(t)){const r=Object.keys(t);if(r.length!==1)return"cannot resolve an ordered map item";n=r[0]}else return"cannot resolve an ordered map item";return e.seen.has(n)?"duplicate key in ordered map":(e.seen.add(n),e.list.push(t),"")},finalize:e=>e.list}),_W=oO("tag:yaml.org,2002:pairs",{create:()=>[],addItem:(e,t)=>{if(t instanceof Map)return t.size!==1?"cannot resolve a pairs item":(e.push(t.entries().next().value),"");if(Object.prototype.toString.call(t)!=="[object Object]")return"cannot resolve a pairs item";const n=t,r=Object.keys(n);return r.length!==1?"cannot resolve a pairs item":(e.push([r[0],n[r[0]]]),"")}}),NW=Cv("tag:yaml.org,2002:map",{create:()=>({}),identify:Ev,represent:e=>{const t=new Map;for(const n of Object.keys(e))t.set(n,e[n]);return t},addPair:(e,t,n)=>{if(t!==null&&typeof t=="object")return"object-based map does not support complex keys";const r=String(t);return r==="__proto__"?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,""},has:(e,t)=>t!==null&&typeof t=="object"?!1:Object.prototype.hasOwnProperty.call(e,String(t)),keys:e=>Object.keys(e),get:(e,t)=>e[String(t)]}),IW=Cv("tag:yaml.org,2002:set",{create:()=>new Set,identify:e=>e instanceof Set,represent:e=>{const t=new Map;for(const n of e)t.set(n,null);return t},addPair:(e,t,n)=>n!==null?"cannot resolve a set item":(e.add(t),""),has:(e,t)=>e.has(t),keys:e=>e.keys(),get:()=>null});function LW(){return{scalar:{},sequence:{},mapping:{}}}function jW(){return{scalar:[],sequence:[],mapping:[]}}function BW(e){const t=[];for(const n of e){let r=t.length;for(let i=0;i<t.length;i++){const a=t[i];if(a.nodeKind===n.nodeKind&&a.tagName===n.tagName&&a.matchByTagPrefix===n.matchByTagPrefix){r=i;break}}t[r]=n}return t}var Tv=class ML{tags;implicitScalarTags;implicitScalarByFirstChar;implicitScalarAnyFirstChar;defaultScalarTag;defaultSequenceTag;defaultMappingTag;exact;prefix;constructor(t){const n=BW(t),r=[],i=LW(),a=jW();for(const d of n){if(d.nodeKind==="scalar"&&d.implicit){if(d.matchByTagPrefix)throw new Error("Implicit scalar tags cannot match by tag prefix");r.push(d)}switch(d.nodeKind){case"scalar":d.matchByTagPrefix?a.scalar.push(d):i.scalar[d.tagName]=d;break;case"sequence":d.matchByTagPrefix?a.sequence.push(d):i.sequence[d.tagName]=d;break;case"mapping":d.matchByTagPrefix?a.mapping.push(d):i.mapping[d.tagName]=d;break}}const l=r.filter(d=>d.implicitFirstChars===null),s=new Set;for(const d of r)if(d.implicitFirstChars!==null)for(const p of d.implicitFirstChars)s.add(p);const c=new Map;for(const d of s)c.set(d,r.filter(p=>p.implicitFirstChars===null||p.implicitFirstChars.indexOf(d)!==-1));const f=i.scalar["tag:yaml.org,2002:str"];if(!f)throw new Error("schema does not define the default scalar tag (tag:yaml.org,2002:str)");this.tags=n,this.implicitScalarTags=r,this.implicitScalarByFirstChar=c,this.implicitScalarAnyFirstChar=l,this.defaultScalarTag=f,this.defaultSequenceTag=i.sequence["tag:yaml.org,2002:seq"],this.defaultMappingTag=i.mapping["tag:yaml.org,2002:map"],this.exact=i,this.prefix=a}withTags(...t){let n=[];for(const r of t)n=n.concat(r);return new ML([...this.tags,...n])}},sO=new Tv([Lq,DW,NW]);new Tv([...sO.tags,zq,Kq,aW,vW]);var zW=new Tv([...sO.tags,Bq,qq,EL,TL]),$W=new Tv([...sO.tags,Hq,Yq,j1,B1,PW,wW,CW,RW,_W,IW]);Cv("tag:yaml.org,2002:map",{create:()=>new Map,addPair:(e,t,n)=>(e.set(t,n),""),has:(e,t)=>e.has(t),keys:e=>e.keys(),get:(e,t)=>e.get(t),identify:e=>e instanceof Map||Ev(e),represent:e=>{if(e instanceof Map)return e;const t=new Map,n=e;for(const r of Object.keys(n))t.set(r,n[r]);return t}});function dM(e){if(Array.isArray(e)){const t=Array.prototype.slice.call(e);for(let n=0;n<t.length;n++){if(Array.isArray(t[n]))return null;typeof t[n]=="object"&&Object.prototype.toString.call(t[n])==="[object Object]"&&(t[n]="[object Object]")}return String(t)}return typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"?"[object Object]":String(e)}Cv("tag:yaml.org,2002:map",{create:()=>({}),identify:Ev,represent:e=>{const t=new Map;for(const n of Object.keys(e))t.set(n,e[n]);return t},addPair:(e,t,n)=>{const r=dM(t);return r===null?"nested arrays are not supported inside keys":(r==="__proto__"?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,"")},has:(e,t)=>{const n=dM(t);return n!==null&&Object.prototype.hasOwnProperty.call(e,n)},keys:e=>Object.keys(e),get:(e,t)=>e[String(t)]});var HW={maxLength:79,indent:1,linesBefore:3,linesAfter:2};function ax(e,t,n,r,i){let a="",l="";const s=Math.floor(i/2)-1;return r-t>s&&(a=" ... ",t=r-s+a.length),n-r>s&&(l=" ...",n=r+s-l.length),{str:a+e.slice(t,n).replace(/\t/g,"→")+l,pos:r-t+a.length}}function lx(e,t){return" ".repeat(Math.max(t-e.length,0))+e}function UW(e,t){if(!e.buffer)return null;const n={...HW,...t},r=/\r?\n|\r|\0/g,i=[0],a=[];let l,s=-1;for(;l=r.exec(e.buffer);)a.push(l.index),i.push(l.index+l[0].length),e.position<=l.index&&s<0&&(s=i.length-2);s<0&&(s=i.length-1);let c="";const f=Math.min(e.line+n.linesAfter,a.length).toString().length,d=n.maxLength-(n.indent+f+3);for(let g=1;g<=n.linesBefore&&!(s-g<0);g++){const v=ax(e.buffer,i[s-g],a[s-g],e.position-(i[s]-i[s-g]),d);c=`${" ".repeat(n.indent)}${lx((e.line-g+1).toString(),f)} | ${v.str}
|
|
12
|
+
${c}`}const p=ax(e.buffer,i[s],a[s],e.position,d);c+=`${" ".repeat(n.indent)}${lx((e.line+1).toString(),f)} | ${p.str}
|
|
13
|
+
`,c+=`${"-".repeat(n.indent+f+3+p.pos)}^
|
|
14
|
+
`;for(let g=1;g<=n.linesAfter&&!(s+g>=a.length);g++){const v=ax(e.buffer,i[s+g],a[s+g],e.position-(i[s]-i[s+g]),d);c+=`${" ".repeat(n.indent)}${lx((e.line+g+1).toString(),f)} | ${v.str}
|
|
15
|
+
`}return c.replace(/\n$/,"")}function pM(e,t){let n="";return e.mark?(e.mark.name&&(n+=`in "${e.mark.name}" `),n+=`(${e.mark.line+1}:${e.mark.column+1})`,!t&&e.mark.snippet&&(n+=`
|
|
16
|
+
|
|
17
|
+
${e.mark.snippet}`),`${e.reason} ${n}`):e.reason}var oh=class extends Error{reason;mark;constructor(e,t){super(),this.name="YAMLException",this.reason=e,this.mark=t,this.message=pM(this,!1),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toString(e){return`${this.name}: ${pM(this,e)}`}};function Mv(e,t,n,r=""){let i=0,a=0;for(let s=0;s<t;s++){const c=e.charCodeAt(s);c===10?(i++,a=s+1):c===13&&(i++,e.charCodeAt(s+1)===10&&s++,a=s+1)}const l={name:r,buffer:e,position:t,line:i,column:t-a};throw l.snippet=UW(l),new oh(n,l)}var FW=-1;function mM(e){switch(e){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
|
|
18
|
+
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"
";case 95:return" ";case 76:return"\u2028";case 80:return"\u2029";default:return""}}var PL=new Array(256),DL=new Array(256);for(let e=0;e<256;e++)PL[e]=mM(e)?1:0,DL[e]=mM(e);function qW(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function WW(e){return e>=48&&e<=57?e-48:(e|32)-97+10}function VW(e){return e===120?2:e===117?4:8}function Gm(e,t,n){let r=0;for(;t<n;){const i=e.charCodeAt(t);if(i===10)r++,t++;else if(i===13)r++,t++,e.charCodeAt(t)===10&&t++;else if(i===32||i===9)t++;else break}return{position:t,breaks:r}}function uO(e){return e===1?" ":`
|
|
19
|
+
`.repeat(e-1)}function KW(e,t,n){let r="",i=t,a=t,l=t;for(;i<n;){const s=e.charCodeAt(i);if(s===10||s===13){r+=e.slice(a,l);const c=Gm(e,i,n);r+=uO(c.breaks),i=a=l=c.position}else i++,s!==32&&s!==9&&(l=i)}return r+e.slice(a,l)}function XW(e,t,n){let r="",i=t,a=t,l=t;for(;i<n;){const s=e.charCodeAt(i);if(s===39)r+=e.slice(a,i)+"'",i+=2,a=l=i;else if(s===10||s===13){r+=e.slice(a,l);const c=Gm(e,i,n);r+=uO(c.breaks),i=a=l=c.position}else i++,s!==32&&s!==9&&(l=i)}return r+e.slice(a,n)}function QW(e,t,n){let r="",i=t,a=t,l=t;for(;i<n;){const s=e.charCodeAt(i);if(s===92){r+=e.slice(a,i),i++;const c=e.charCodeAt(i);if(c===10||c===13)i=Gm(e,i,n).position;else if(c<256&&PL[c])r+=DL[c],i++;else{let f=VW(c),d=0;for(;f>0;f--){i++;const p=WW(e.charCodeAt(i));d=(d<<4)+p}r+=qW(d),i++}a=l=i}else if(s===10||s===13){r+=e.slice(a,l);const c=Gm(e,i,n);r+=uO(c.breaks),i=a=l=c.position}else i++,s!==32&&s!==9&&(l=i)}return r+e.slice(a,n)}function gM(e,t,n,r,i,a){const l=r<0?0:r,s=e.slice(t,n).replace(/\r\n?/g,`
|
|
20
|
+
`),c=s===""?[]:(s.endsWith(`
|
|
21
|
+
`)?s.slice(0,-1):s).split(`
|
|
22
|
+
`);let f="",d=!1,p=0,g=!1;for(const v of c){let y=0;for(;y<l&&v.charCodeAt(y)===32;)y++;if(r<0||y>=v.length){p++;continue}const x=v.slice(l),w=x.charCodeAt(0);a?w===32||w===9?(g=!0,f+=`
|
|
23
|
+
`.repeat(d?1+p:p)):g?(g=!1,f+=`
|
|
24
|
+
`.repeat(p+1)):p===0?d&&(f+=" "):f+=`
|
|
25
|
+
`.repeat(p):f+=`
|
|
26
|
+
`.repeat(d?1+p:p),f+=x,d=!0,p=0}return i===3?f+=`
|
|
27
|
+
`.repeat(d?1+p:p):i!==2&&d&&(f+=`
|
|
28
|
+
`),f}function YW(e,t){if(t.valueStart===FW)return"";const{valueStart:n,valueEnd:r}=t;if(t.fast)return e.slice(n,r);switch(t.style){case 2:return XW(e,n,r);case 3:return QW(e,n,r);case 4:return gM(e,n,r,t.indent,t.chomping,!1);case 5:return gM(e,n,r,t.indent,t.chomping,!0);default:return KW(e,n,r)}}var GW={"!":"!","!!":"tag:yaml.org,2002:"};function ox(e){return encodeURI(e).replace(/!/g,"%21")}function RL(e,t){if(e.startsWith("!<")&&e.endsWith(">"))return decodeURIComponent(e.slice(2,-1));const n=e.indexOf("!",1),r=n===-1?"!":e.slice(0,n+1),i=t?.[r]??GW[r]??r;return decodeURIComponent(i)+decodeURIComponent(e.slice(r.length))}function _L(e){let t=e;return t.charCodeAt(0)===33?(t=t.slice(1),`!${ox(t)}`):t.slice(0,18)==="tag:yaml.org,2002:"?`!!${ox(t.slice(18))}`:`!<${ox(t)}>`}var Eu=-1,cO={filename:"",schema:zW,json:!1,maxTotalMergeKeys:1e4,maxAliases:-1};function ZW(e){return"tagStart"in e&&e.tagStart!==Eu?e.tagStart:"anchorStart"in e&&e.anchorStart!==Eu?e.anchorStart:"valueStart"in e&&e.valueStart!==Eu?e.valueStart:"start"in e?e.start:0}function cr(e,t){Mv(e.source,e.position,t,e.filename)}function NL(e,t,n,r){try{return n.finalize(r)}catch(i){if(i instanceof oh)throw i;Mv(e.source,t,i instanceof Error?i.message:String(i),e.filename)}}function Pm(e,t,n){const r=e[n];if(r)return r;for(const i of t)if(n.startsWith(i.tagName))return i}function JW(e,t,n,r,i){const a=Pm(t,n,r);if(a)return a;cr(e,`unknown ${i} tag !<${r}>`)}function eV(e,t){const n=YW(e.source,t),r=t.tagStart===Eu?"":e.source.slice(t.tagStart,t.tagEnd),i=e.schema.defaultScalarTag;if(r!==""){if(r==="!")return{value:n,tag:i};const a=RL(r,e.tagHandlers),l=Pm(e.schema.exact.scalar,e.schema.prefix.scalar,a);if(l){const c=l.resolve(n,!0,a);return c===Ke&&cr(e,`cannot resolve a node with !<${a}> explicit tag`),{value:c,tag:l}}const s=Pm(e.schema.exact.mapping,e.schema.prefix.mapping,a)??Pm(e.schema.exact.sequence,e.schema.prefix.sequence,a);if(s){n!==""&&cr(e,`cannot resolve a node with !<${a}> explicit tag`);const c=s.create(a);return{value:s.carrierIsResult?c:NL(e,e.position,s,c),tag:s}}cr(e,`unknown scalar tag !<${a}>`)}if(t.style===1){const a=e.schema.implicitScalarByFirstChar.get(n.charAt(0))??e.schema.implicitScalarAnyFirstChar;for(const l of a){const s=l.resolve(n,!1,l.tagName);if(s!==Ke)return{value:s,tag:l}}}return{value:i.resolve(n,!1,i.tagName),tag:i}}function vM(e,t,n,r,i,a){const l=t.tagStart===Eu?"":e.source.slice(t.tagStart,t.tagEnd),s=l===""||l==="!"?i:RL(l,e.tagHandlers);return{tagName:s,tag:JW(e,n,r,s,a)}}function IL(e){return e.nodeKind==="mapping"}function yM(e,t,n,r){for(const i of r.keys(n)){if(e.maxTotalMergeKeys!==-1&&++e.totalMergeKeys>e.maxTotalMergeKeys&&cr(e,`merge keys exceeded maxTotalMergeKeys (${e.maxTotalMergeKeys})`),t.tag.has(t.value,i))continue;const a=t.tag.addPair(t.value,i,r.get(n,i));a&&cr(e,a),(t.overridable??=new Set).add(i)}}function tV(e,t,n,r){if(e.position=t.keyPosition,IL(r))yM(e,t,n,r);else if(r.nodeKind==="sequence"&&Array.isArray(n))for(const i of n)yM(e,t,i,t.tag);else cr(e,"cannot merge mappings; the provided source object is unacceptable")}function nV(e,t,n,r,i){if(e.position=t.keyPosition,n===lO){tV(e,t,r,i);return}!e.json&&t.tag.has(t.value,n)&&!t.overridable?.has(n)&&cr(e,"duplicated mapping key");const a=t.tag.addPair(t.value,n,r);a&&cr(e,a),t.overridable?.delete(n)}function sx(e,t,n){const r=e.frames[e.frames.length-1];if(r.kind==="document")r.value=t,r.hasValue=!0;else if(r.kind==="sequence"){r.merge&&(IL(n)||cr(e,"cannot merge mappings; the provided source object is unacceptable"));const i=r.tag.addItem(r.value,t,r.index++);i&&cr(e,i)}else if(r.hasKey){const i=r.key;r.key=void 0,r.hasKey=!1,nV(e,r,i,t,n)}else r.key=t,r.keyPosition=e.position,r.hasKey=!0}function ux(e,t,n,r,i){if(t.anchorStart!==Eu){const a={value:n,tag:r,isValueFinal:i};return e.anchors.set(e.source.slice(t.anchorStart,t.anchorEnd),a),a}return null}function rV(e,t){const n={...cO,...t,events:e,documents:[],eventIndex:0,position:0,frames:[],anchors:new Map,tagHandlers:Object.create(null),totalMergeKeys:0,aliasCount:0};for(;n.eventIndex<n.events.length;){const r=n.events[n.eventIndex++];switch(n.position=ZW(r),r.type){case 1:n.anchors=new Map,n.aliasCount=0,n.tagHandlers=Object.create(null);for(const i of r.directives)i.kind==="tag"&&(n.tagHandlers[i.handle]=i.prefix);n.frames.push({kind:"document",position:n.position,value:void 0,hasValue:!1});break;case 4:{const{value:i,tag:a}=eV(n,r);ux(n,r,i,a,!0),sx(n,i,a);break}case 2:{const i=vM(n,r,n.schema.exact.sequence,n.schema.prefix.sequence,"tag:yaml.org,2002:seq","sequence"),a=i.tag.create(i.tagName),l=ux(n,r,a,i.tag,i.tag.carrierIsResult),s=n.frames[n.frames.length-1],c=s!==void 0&&s.kind==="mapping"&&s.hasKey&&s.key===lO;n.frames.push({kind:"sequence",position:n.position,value:a,tag:i.tag,anchor:l,index:0,merge:c});break}case 3:{const i=vM(n,r,n.schema.exact.mapping,n.schema.prefix.mapping,"tag:yaml.org,2002:map","mapping"),a=i.tag.create(i.tagName),l=ux(n,r,a,i.tag,i.tag.carrierIsResult);n.frames.push({kind:"mapping",position:n.position,value:a,tag:i.tag,anchor:l,key:void 0,keyPosition:n.position,hasKey:!1,overridable:null});break}case 5:{n.maxAliases!==-1&&++n.aliasCount>n.maxAliases&&cr(n,`aliases exceeded maxAliases (${n.maxAliases})`);const i=n.source.slice(r.anchorStart,r.anchorEnd),a=n.anchors.get(i);a||cr(n,`unidentified alias "${i}"`),a.isValueFinal||cr(n,`recursive alias "${i}" is not supported for tag ${a.tag.tagName} because it uses finalize()`),sx(n,a.value,a.tag);break}case 6:{const i=n.frames.pop();if(i.kind==="document")n.documents.push(i.value);else{const a=i.tag.carrierIsResult?i.value:NL(n,i.position,i.tag,i.value);i.anchor&&(i.anchor.value=a,i.anchor.isValueFinal=!0),sx(n,a,i.tag)}break}}}return n.documents}var Ue=-1,LL=Object.prototype.hasOwnProperty,jl=1,$1=2,jL=3,Zm=4,iV=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,aV=/[,\[\]{}]/,BL=/^(?:!|!!|![0-9A-Za-z-]+!)$/,H1=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`,zL=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`,lV=new RegExp(`^(?:${H1})*$`),oV=new RegExp(`^(?:${zL})+$`),sV=new RegExp(`^(?:!(?:${H1})*|${zL}(?:${H1})*)$`),fO={filename:"",maxDepth:100};function uV(e,t,n){e.events.push({type:1,explicitStart:t,explicitEnd:n,directives:e.directives})}function $L(e,t,n,r,i,a,l){e.events.push({type:2,start:t,anchorStart:n,anchorEnd:r,tagStart:i,tagEnd:a,style:l})}function Uf(e,t,n,r,i,a,l){e.events.push({type:3,start:t,anchorStart:n,anchorEnd:r,tagStart:i,tagEnd:a,style:l})}function uc(e,t,n,r,i,a,l,s,c=1,f=-1,d=!1){e.events.push({type:4,valueStart:t,valueEnd:n,anchorStart:r,anchorEnd:i,tagStart:a,tagEnd:l,style:s,chomping:c,indent:f,fast:d})}function cV(e,t,n){e.events.push({type:5,anchorStart:t,anchorEnd:n})}function Tu(e){e.events.push({type:6})}function tr(e){uc(e,Ue,Ue,Ue,Ue,Ue,Ue,1)}function bM(){return{anchorStart:Ue,anchorEnd:Ue,tagStart:Ue,tagEnd:Ue}}function Ff(e){return{position:e.position,line:e.line,lineStart:e.lineStart,lineIndent:e.lineIndent,firstTabInLine:e.firstTabInLine,eventsLength:e.events.length}}function Ul(e,t){e.position=t.position,e.line=t.line,e.lineStart=t.lineStart,e.lineIndent=t.lineIndent,e.firstTabInLine=t.firstTabInLine,e.events.length=t.eventsLength}function ke(e,t){Mv(e.input.slice(0,e.length),e.position,t,e.filename)}function rn(e){return e===10||e===13}function ns(e){return e===9||e===32}function gi(e){return ns(e)||rn(e)}function Ma(e){return e===0||gi(e)}function rs(e){return e===44||e===91||e===93||e===123||e===125}function fV(e){return e>=48&&e<=57?e-48:-1}function hV(e){if(e>=48&&e<=57)return e-48;const t=e|32;return t>=97&&t<=102?t-97+10:-1}function dV(e){return e===120?2:e===117?4:e===85?8:0}function pV(e){return e===48||e===97||e===98||e===116||e===9||e===110||e===118||e===102||e===114||e===101||e===32||e===34||e===47||e===92||e===78||e===95||e===76||e===80}function Jm(e){e.input.charCodeAt(e.position)===10?e.position++:(e.position++,e.input.charCodeAt(e.position)===10&&e.position++),e.line++,e.lineStart=e.position,e.lineIndent=0,e.firstTabInLine=-1}function Un(e,t){let n=0,r=e.input.charCodeAt(e.position),i=e.position===e.lineStart||gi(e.input.charCodeAt(e.position-1));for(;r!==0;){for(;ns(r);)i=!0,r===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),r=e.input.charCodeAt(++e.position);if(t&&i&&r===35)do r=e.input.charCodeAt(++e.position);while(!rn(r)&&r!==0);if(!rn(r))break;for(Jm(e),n++,i=!0,r=e.input.charCodeAt(e.position);r===32;)e.lineIndent++,r=e.input.charCodeAt(++e.position)}return n}function Fl(e,t=e.position){const n=e.input.charCodeAt(t);if((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)){const r=e.input.charCodeAt(t+3);return r===0||gi(r)}return!1}function xM(e){let t=e.input.charCodeAt(e.position);for(;t!==0&&!rn(t);)t=e.input.charCodeAt(++e.position)}function HL(e,t,n){iV.test(e.input.slice(t,n))&&ke(e,"the stream contains non-printable characters")}function mV(e,t,n){if(e.input.charCodeAt(e.position)!==33)return!1;t.tagStart!==Ue&&ke(e,"duplication of a tag property");const r=e.position;let i=!1,a=!1,l="!",s=e.input.charCodeAt(++e.position);s===60?(i=!0,s=e.input.charCodeAt(++e.position)):s===33&&(a=!0,l="!!",s=e.input.charCodeAt(++e.position));let c=e.position,f;if(i){for(;s!==0&&s!==62;)s=e.input.charCodeAt(++e.position);s!==62&&ke(e,"unexpected end of the stream within a verbatim tag"),f=e.input.slice(c,e.position),e.position++}else{for(;s!==0&&!gi(s)&&!(n&&rs(s));)s===33&&(a?ke(e,"tag suffix cannot contain exclamation marks"):(l=e.input.slice(c-1,e.position+1),BL.test(l)||ke(e,"named tag handle cannot contain such characters"),a=!0,c=e.position+1)),s=e.input.charCodeAt(++e.position);f=e.input.slice(c,e.position),aV.test(f)&&ke(e,"tag suffix cannot contain flow indicator characters")}return f&&!(i?lV.test(f):oV.test(f))&&ke(e,`tag name cannot contain such characters: ${f}`),!i&&l!=="!"&&l!=="!!"&&!LL.call(e.tagHandlers,l)&&ke(e,`undeclared tag handle "${l}"`),t.tagStart=r,t.tagEnd=e.position,!0}function gV(e,t){if(e.input.charCodeAt(e.position)!==38)return!1;t.anchorStart!==Ue&&ke(e,"duplication of an anchor property"),e.position++;const n=e.position;for(;e.input.charCodeAt(e.position)!==0&&!gi(e.input.charCodeAt(e.position))&&!rs(e.input.charCodeAt(e.position));)e.position++;return e.position===n&&ke(e,"name of an anchor node must contain at least one character"),t.anchorStart=n,t.anchorEnd=e.position,!0}function vV(e,t){if(e.input.charCodeAt(e.position)!==42)return!1;(t.anchorStart!==Ue||t.tagStart!==Ue)&&ke(e,"alias node should not have any properties"),e.position++;const n=e.position;for(;e.input.charCodeAt(e.position)!==0&&!gi(e.input.charCodeAt(e.position))&&!rs(e.input.charCodeAt(e.position));)e.position++;return e.position===n&&ke(e,"name of an alias node must contain at least one character"),cV(e,n,e.position),!0}function U1(e,t){Un(e,!1),e.lineIndent<t&&ke(e,"deficient indentation")}function yV(e,t,n){if(e.input.charCodeAt(e.position)!==39)return!1;e.position++;const r=e.position;let i=!0;for(;e.input.charCodeAt(e.position)!==0;){const a=e.input.charCodeAt(e.position);if(a===39){if(e.input.charCodeAt(e.position+1)===39){i=!1,e.position+=2;continue}const l=e.position;return e.position++,uc(e,r,l,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,2,1,-1,i),!0}rn(a)?(i=!1,U1(e,t)):e.position===e.lineStart&&Fl(e)?ke(e,"unexpected end of the document within a single quoted scalar"):a!==9&&a<32?ke(e,"expected valid JSON character"):e.position++}ke(e,"unexpected end of the stream within a single quoted scalar")}function bV(e,t,n){if(e.input.charCodeAt(e.position)!==34)return!1;e.position++;const r=e.position;let i=!0;for(;e.input.charCodeAt(e.position)!==0;){const a=e.input.charCodeAt(e.position);if(a===34){const l=e.position;return e.position++,uc(e,r,l,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,3,1,-1,i),!0}if(a===92){i=!1;const l=e.input.charCodeAt(++e.position);if(rn(l))U1(e,t);else if(pV(l))e.position++;else{let s=dV(l);for(s===0&&ke(e,"unknown escape sequence");s-- >0;)e.position++,hV(e.input.charCodeAt(e.position))<0&&ke(e,"expected hexadecimal character");e.position++}}else rn(a)?(i=!1,U1(e,t)):e.position===e.lineStart&&Fl(e)?ke(e,"unexpected end of the document within a double quoted scalar"):a!==9&&a<32?ke(e,"expected valid JSON character"):e.position++}ke(e,"unexpected end of the stream within a double quoted scalar")}function xV(e,t,n){const r=e.input.charCodeAt(e.position);let i=1,a=-1,l=!1;if(r!==124&&r!==62)return!1;const s=r===124?4:5;for(e.position++;e.input.charCodeAt(e.position)!==0;){const v=e.input.charCodeAt(e.position),y=fV(v);if(v===43||v===45)i!==1&&ke(e,"repeat of a chomping mode identifier"),i=v===43?3:2,e.position++;else if(y>=0)y===0&&ke(e,"bad explicit indentation width of a block scalar; it cannot be less than one"),l&&ke(e,"repeat of an indentation width identifier"),a=t+y-1,l=!0,e.position++;else break}let c=!1;for(;ns(e.input.charCodeAt(e.position));)c=!0,e.position++;c&&e.input.charCodeAt(e.position)===35&&xM(e),rn(e.input.charCodeAt(e.position))?Jm(e):e.input.charCodeAt(e.position)!==0&&ke(e,"a line break is expected");let f=l?a:-1,d=0;const p=e.position;let g=e.position;for(;e.input.charCodeAt(e.position)!==0;){const v=e.position;let y=0;for(;e.input.charCodeAt(v+y)===32;)y++;const x=e.input.charCodeAt(v+y);if(x===0){f>=0?y>f&&(g=v+y):y>0&&(g=v+y);break}if(v===e.lineStart&&Fl(e,v))break;if(!l&&f===-1&&rn(x)&&(d=Math.max(d,y)),!l&&f===-1&&!rn(x)&&(x===9&&y<t&&(e.position=v+y,ke(e,"tab characters must not be used in indentation")),y<d&&(e.position=v+y,ke(e,"bad indentation of a mapping entry"))),f===-1&&x!==0&&!rn(x)&&y<t){e.lineIndent=y,e.position=v+y;break}!l&&x!==0&&!rn(x)&&f===-1&&(f=y);const w=f===-1?t+1:f;if(x!==0&&!rn(x)&&y<w){e.lineIndent=y,e.position=v+y;break}xM(e),g=e.position,rn(e.input.charCodeAt(e.position))&&(Jm(e),g=e.position)}return HL(e,p,g),uc(e,p,g,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,s,i,f),!0}function SV(e,t){const n=e.input.charCodeAt(e.position),r=t===jl;if(n===0||gi(n)||n===35||n===38||n===42||n===33||n===124||n===62||n===39||n===34||n===37||n===64||n===96||r&&rs(n))return!1;if(n===63||n===45){const i=e.input.charCodeAt(e.position+1);if(Ma(i)||r&&rs(i))return!1}return!0}function wV(e,t,n,r){if(!SV(e,n))return!1;const i=e.position;let a=e.position,l=e.input.charCodeAt(e.position);const s=n===jl;let c=!1;for(;l!==0&&!(e.position===e.lineStart&&Fl(e));){if(l===58){const f=e.input.charCodeAt(e.position+1);if(Ma(f)||s&&rs(f))break}else if(l===35){if(gi(e.input.charCodeAt(e.position-1)))break}else{if(s&&rs(l))break;if(rn(l)){const f=e.position,d=e.line,p=e.lineStart,g=e.lineIndent;if(Un(e,!1),e.lineIndent>=t){c=!0,l=e.input.charCodeAt(e.position);continue}e.position=f,e.line=d,e.lineStart=p,e.lineIndent=g;break}}ns(l)||(a=e.position+1),l=e.input.charCodeAt(++e.position)}return a===i?!1:(HL(e,i,a),uc(e,i,a,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,1,1,-1,!c),!0)}function Co(e,t){const n=e.line;Un(e,!0),(e.line>n&&e.lineIndent<t||e.firstTabInLine!==-1&&e.lineIndent<t)&&ke(e,"deficient indentation")}function OV(e,t,n){const r=e.input.charCodeAt(e.position),i=r===123,a=e.position;let l=!0;if(r!==91&&r!==123)return!1;const s=i?125:93;for(i?Uf(e,a,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,2):$L(e,a,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,2),e.position++;e.input.charCodeAt(e.position)!==0;){Co(e,t);let c=e.input.charCodeAt(e.position);if(c===s)return e.position++,Tu(e),!0;l?c===44&&ke(e,"expected the node content, but found ','"):ke(e,"missed comma between flow collection entries");let f=!1,d=!1;c===63&&gi(e.input.charCodeAt(e.position+1))&&(f=d=!0,e.position+=1,Co(e,t));const p=e.line,g=Ff(e),v=Pa(e,t,jl,!1,!0);Co(e,t),c=e.input.charCodeAt(e.position),(i||d||e.line===p)&&c===58?(f=!0,e.position++,Co(e,t),i?v||tr(e):(Ul(e,g),Uf(e,g.position,Ue,Ue,Ue,Ue,2),Pa(e,t,jl,!1,!0)||tr(e),Co(e,t),e.position++,Co(e,t)),Pa(e,t,jl,!1,!0)||tr(e),Co(e,t),i||Tu(e)):i&&f?(v||tr(e),tr(e)):i?tr(e):f&&(Ul(e,g),Uf(e,g.position,Ue,Ue,Ue,Ue,2),Pa(e,t,jl,!1,!0),tr(e),Tu(e)),c=e.input.charCodeAt(e.position),c===44?(l=!0,e.position++):l=!1}ke(e,"unexpected end of the stream within a flow collection")}function SM(e,t,n){if(e.firstTabInLine!==-1||e.input.charCodeAt(e.position)!==45||!Ma(e.input.charCodeAt(e.position+1)))return!1;for($L(e,e.position,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,1);e.input.charCodeAt(e.position)===45&&Ma(e.input.charCodeAt(e.position+1));){e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,ke(e,"tab characters must not be used in indentation"));const r=e.line;e.position++;const i=Un(e,!0)>0;if(e.firstTabInLine!==-1&&e.input.charCodeAt(e.position)===45&&Ma(e.input.charCodeAt(e.position+1))&&ke(e,"bad indentation of a sequence entry"),i&&e.lineIndent<=t?tr(e):Pa(e,t,jL,!1,!0),Un(e,!0),e.lineIndent<t||e.position>=e.length)break;e.lineIndent>t&&ke(e,"bad indentation of a sequence entry"),e.line===r&&e.input.charCodeAt(e.position)===45&&Ma(e.input.charCodeAt(e.position+1))&&ke(e,"bad indentation of a sequence entry")}return Tu(e),!0}function cx(e,t,n,r){let i=!1,a=!1,l=!1,s=!1;if(e.firstTabInLine!==-1)return!1;let c=e.input.charCodeAt(e.position);for(;c!==0;){!i&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,ke(e,"tab characters must not be used in indentation"));const f=e.input.charCodeAt(e.position+1),d=e.line;if((c===63||c===58)&&Ma(f))l||(Uf(e,e.position,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,1),l=!0),c===63?(i&&tr(e),a=!0,i=!0):(i||(tr(e),a=!0),i=!1),e.position+=1,s=!0;else{i&&(tr(e),i=!1);const p=Ff(e);if(!Pa(e,n,$1,!1,!0))break;if(e.line===d){for(c=e.input.charCodeAt(e.position);ns(c);)c=e.input.charCodeAt(++e.position);if(c===58){if(c=e.input.charCodeAt(++e.position),Ma(c)||ke(e,"a whitespace character is expected after the key-value separator within a block mapping"),!l){for(Ul(e,p),Uf(e,p.position,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,1),l=!0,Pa(e,n,$1,!1,!0),c=e.input.charCodeAt(e.position);ns(c);)c=e.input.charCodeAt(++e.position);e.position++}a=!0,i=!1,s=!1}else if(a)ke(e,"expected ':' after a mapping key");else return r.anchorStart!==Ue||r.tagStart!==Ue?(Ul(e,p),!1):!0}else if(a)ke(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return r.anchorStart!==Ue||r.tagStart!==Ue?(Ul(e,p),!1):!0}if(Pa(e,t,Zm,!0,s)&&(s=!1),i||s&&(tr(e),s=!1),Un(e,!0),c=e.input.charCodeAt(e.position),(e.line===d||e.lineIndent>t)&&c!==0)ke(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return a?(i&&tr(e),l&&Tu(e),!0):!1}function Pa(e,t,n,r,i,a=!0){e.depth>=e.maxDepth&&ke(e,`nesting exceeded maxDepth (${e.maxDepth})`),e.depth++;let l=1,s=!1,c=!1,f=null;const d=bM();let p=n===Zm||n===jL,g=p;const v=p;if(r&&Un(e,!0)&&(s=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:l=-1),e.position===e.lineStart&&Fl(e))return e.depth--,!1;if(l===1)for(;;){const y=e.input.charCodeAt(e.position),x=Ff(e);if(s&&l!==1&&(y===33||y===38))break;if(s&&v&&(d.tagStart!==Ue||d.anchorStart!==Ue)&&(y===33||y===38)){const w=Ff(e),A=t+1;if(cx(e,e.position-e.lineStart,A,d)&&e.events[w.eventsLength]?.type===3)return e.depth--,!0;Ul(e,w)}if(s&&(y===33&&d.tagStart!==Ue||y===38&&d.anchorStart!==Ue)||!mV(e,d,n===jl)&&!gV(e,d))break;f===null&&(f=x),Un(e,!0)?(s=!0,g=v,e.lineIndent>t?l=1:e.lineIndent===t?l=0:l=-1):g=!1}if(g&&(g=s||i),l===1||n===Zm){const y=n===jl||n===$1?t:t+1,x=e.position-e.lineStart;if(l===1)if(g&&(SM(e,x,d)||cx(e,x,y,d))||OV(e,y,d))c=!0;else{const w=e.input.charCodeAt(e.position);if(f!==null&&a&&v&&!g&&w!==124&&w!==62){const A=Ff(e),k=f.position-f.lineStart;Ul(e,f),cx(e,k,y,bM())&&e.events[A.eventsLength]?.type===3?c=!0:Ul(e,A)}!c&&(p&&xV(e,y,d)||yV(e,y,d)||bV(e,y,d)||vV(e,d)||wV(e,y,n,d))&&(c=!0)}else l===0&&(c=g&&SM(e,x,d))}return p=p&&!c,!c&&(d.anchorStart!==Ue||d.tagStart!==Ue||p)&&(uc(e,Ue,Ue,d.anchorStart,d.anchorEnd,d.tagStart,d.tagEnd,1),c=!0),e.depth--,c||d.anchorStart!==Ue||d.tagStart!==Ue}function AV(e){if(e.lineIndent>0||e.input.charCodeAt(e.position)!==37)return!1;e.position++;const t=e.position;for(;e.input.charCodeAt(e.position)!==0&&!gi(e.input.charCodeAt(e.position));)e.position++;const n=e.input.slice(t,e.position),r=[];for(n.length===0&&ke(e,"directive name must not be less than one character in length");e.input.charCodeAt(e.position)!==0&&!rn(e.input.charCodeAt(e.position));){for(;ns(e.input.charCodeAt(e.position));)e.position++;if(e.input.charCodeAt(e.position)===35||rn(e.input.charCodeAt(e.position))||e.input.charCodeAt(e.position)===0)break;const i=e.position;for(;e.input.charCodeAt(e.position)!==0&&!gi(e.input.charCodeAt(e.position));)e.position++;r.push(e.input.slice(i,e.position))}if(rn(e.input.charCodeAt(e.position))&&Jm(e),n==="YAML"){e.directives.some(a=>a.kind==="yaml")&&ke(e,"duplication of %YAML directive"),r.length!==1&&ke(e,"YAML directive accepts exactly one argument");const i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]);i===null&&ke(e,"ill-formed argument of the YAML directive"),parseInt(i[1],10)!==1&&ke(e,"unacceptable YAML version of the document"),e.directives.push({kind:"yaml",version:r[0]})}else if(n==="TAG"){r.length!==2&&ke(e,"TAG directive accepts exactly two arguments");const[i,a]=r;BL.test(i)||ke(e,"ill-formed tag handle (first argument) of the TAG directive"),LL.call(e.tagHandlers,i)&&ke(e,`there is a previously declared suffix for "${i}" tag handle`),sV.test(a)||ke(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagHandlers[i]=a,e.directives.push({kind:"tag",handle:i,prefix:a})}return!0}function kV(e){e.directives=[],e.tagHandlers=Object.create(null);let t=!1;for(Un(e,!0);AV(e);)t=!0,Un(e,!0);let n=!1,r=!1,i=!0;if(e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45&&Ma(e.input.charCodeAt(e.position+3))){n=!0;const s=e.line;e.position+=3,Un(e,!0),i=e.line>s}else t&&ke(e,"directives end mark is expected");const a=e.events.length;if(!n&&e.position===e.lineStart&&e.input.charCodeAt(e.position)===46&&Fl(e)){e.position+=3,Un(e,!0);return}if(uV(e,n,!1),Pa(e,e.lineIndent-1,Zm,!1,i,i)||tr(e),Un(e,!0),e.position===e.lineStart&&Fl(e)&&(r=e.input.charCodeAt(e.position)===46,r)){const s=e.line;e.position+=3,Un(e,!0),e.line===s&&e.position<e.length&&ke(e,"end of the stream or a document separator is expected")}const l=e.events[a];l?.type===1&&(l.explicitEnd=r),Tu(e),!r&&e.position<e.length&&!(e.position===e.lineStart&&Fl(e))&&ke(e,"end of the stream or a document separator is expected")}function CV(e,t){const n=e.length,r={...fO,...t,input:`${e}\0`,length:n,position:0,line:0,lineStart:0,lineIndent:0,firstTabInLine:-1,depth:0,directives:[],tagHandlers:Object.create(null),events:[]},i=e.indexOf("\0");for(i!==-1&&Mv(e,i,"null byte is not allowed in input",r.filename),r.input.charCodeAt(r.position)===65279&&r.position++;r.position<r.length&&(Un(r,!0),!(r.position>=r.length));){const a=r.position;kV(r),r.position===a&&ke(r,"can not read a document")}return r.events}var EV={...fO,...cO};function TV(e,t={}){const n={...EV,...t},r=String(e),i=Object.keys(fO),a=Object.keys(cO);return rV(CV(r,z1(n,i)),{...z1(n,a),source:r})}function MV(e,t){const n=TV(e,t);if(n.length===0)throw new oh("expected a document, but the input is empty");if(n.length===1)return n[0];throw new oh("expected a single document in the stream, but found more")}var Ip=class{tagged=!1;flow=!1;singleQuoted=!1;doubleQuoted=!1;literal=!1;folded=!1},Ro=Symbol("INVALID");function PV(e){const t=new Set([e.defaultScalarTag,e.defaultSequenceTag,e.defaultMappingTag].filter(a=>a!==void 0)),n=e.implicitScalarTags,r=e.tags.filter(a=>!(a.nodeKind==="scalar"&&a.implicit)&&!t.has(a)),i=e.tags.filter(a=>t.has(a));return[...n.map(a=>({tag:a,implicitTag:!0})),...r.map(a=>({tag:a,implicitTag:!1})),...i.map(a=>({tag:a,implicitTag:!0}))]}function DV(e,t){for(let n=0,r=e.representTypes.length;n<r;n+=1){const{tag:i,implicitTag:a}=e.representTypes[n];if(i.identify&&i.identify(t)){let l;return i.matchByTagPrefix&&i.representTagName?l=i.representTagName(t):l=i.tagName,{tag:i,tagName:l,implicitTag:a}}}return null}function If(e,t){if(!e.noRefs&&t!==null&&typeof t=="object"){const d=e.refs.get(t);if(d)return d.anchor===void 0&&(d.anchor=`ref_${e.refCounter++}`),{kind:"alias",tag:"",style:new Ip,anchor:d.anchor}}const n=DV(e,t);if(!n){if(t===void 0||e.skipInvalid)return Ro;throw new oh(`unacceptable kind of an object to dump ${Object.prototype.toString.call(t)}`)}const{tag:r,tagName:i,implicitTag:a}=n,l=a?i:_L(i);if(r.nodeKind==="scalar"){const d=new Ip;return d.tagged=!a,{kind:"scalar",tag:l,style:d,value:r.represent(t)}}if(r.nodeKind==="sequence"){const d=r.represent(t),p=new Ip;p.tagged=!a;const g={kind:"sequence",tag:l,style:p,items:[]};e.noRefs||e.refs.set(t,g);for(let v=0,y=d.length;v<y;v+=1){let x=If(e,d[v]);x===Ro&&d[v]===void 0&&(x=If(e,null)),x!==Ro&&g.items.push(x)}return g}const s=r.represent(t),c=new Ip;c.tagged=!a;const f={kind:"mapping",tag:l,style:c,items:[]};e.noRefs||e.refs.set(t,f);for(const[d,p]of s){const g=If(e,d);if(g===Ro)continue;const v=If(e,p);v!==Ro&&f.items.push({key:g,value:v})}return f}function RV(e,t,n={}){const r=If({representTypes:PV(t),noRefs:n.noRefs??!1,skipInvalid:n.skipInvalid??!1,refs:new Map,refCounter:0},e);return[{contents:r===Ro?null:r,directives:[]}]}var _V=Symbol("visit:break"),UL=Symbol("visit:skip");function Dm(e,t,n){const r=t(e,n);if(r===_V)return!0;if(r===UL)return!1;const i=n.depth+1;switch(e.kind){case"sequence":for(const a of e.items)if(Dm(a,t,{depth:i,parent:e,isKey:!1}))return!0;break;case"mapping":for(const{key:a,value:l}of e.items)if(Dm(a,t,{depth:i,parent:e,isKey:!0})||Dm(l,t,{depth:i,parent:e,isKey:!1}))return!0;break}return!1}function NV(e,t){for(const n of e)if(n.contents&&Dm(n.contents,t,{depth:0,parent:null,isKey:!1}))return}var hO=65279,IV=9,is=10,FL=13,LV=32,jV=33,qL=34,F1=35,BV=37,zV=38,WL=39,$V=42,VL=44,dO=45,sh=58,HV=61,UV=62,KL=63,FV=64,XL=91,QL=93,qV=96,YL=123,WV=124,GL=125,Rn={};Rn[0]="\\0";Rn[7]="\\a";Rn[8]="\\b";Rn[9]="\\t";Rn[10]="\\n";Rn[11]="\\v";Rn[12]="\\f";Rn[13]="\\r";Rn[27]="\\e";Rn[34]='\\"';Rn[92]="\\\\";Rn[133]="\\N";Rn[160]="\\_";Rn[8232]="\\L";Rn[8233]="\\P";var pO={indent:2,seqNoIndent:!1,seqInlineFirst:!0,sortKeys:!1,lineWidth:80,flowBracketPadding:!1,flowSkipCommaSpace:!1,flowSkipColonSpace:!1,quoteFlowKeys:!1,quoteStyle:"single",forceQuotes:!1,tagBeforeAnchor:!1};function VV(e){return e.style.tagged?e.tag:_L(e.tag)}function KV(e){const t={...pO,...e};return{...t,defaultScalarTagName:t.schema.defaultScalarTag.tagName,implicitResolvers:t.schema.implicitScalarTags}}function XV(e){const t=e.toString(16).toUpperCase(),n=e<=255?"x":"u",r=e<=255?2:4;return`\\${n}${"0".repeat(r-t.length)}${t}`}function wM(e,t){const n=" ".repeat(t);let r=0,i="";const a=e.length;for(;r<a;){let l;const s=e.indexOf(`
|
|
29
|
+
`,r);s===-1?(l=e.slice(r),r=a):(l=e.slice(r,s+1),r=s+1),l.length&&l!==`
|
|
30
|
+
`&&(i+=n),i+=l}return i}function q1(e,t){return`
|
|
31
|
+
${" ".repeat(e.indent*t)}`}function QV(e,t){const n=e.indent*Math.max(1,t);return{indent:n,blockIndent:t===0?e.indent+1:e.indent,lineWidth:e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-n)}}function OM(e,t){for(let n=0,r=e.implicitResolvers.length;n<r;n+=1){const i=e.implicitResolvers[n];if(i.resolve(t,!1,i.tagName)!==Ke)return i.tagName}return e.defaultScalarTagName}function Uu(e){return e===LV||e===IV}function YV(e){const t=e.charCodeAt(0);if(t!==dO&&t!==46||e.charCodeAt(1)!==t||e.charCodeAt(2)!==t)return!1;if(e.length===3)return!0;const n=e.charCodeAt(3);return Uu(n)||n===FL||n===is}function uh(e){return e>=32&&e<=126||e>=161&&e<=55295&&e!==8232&&e!==8233||e>=57344&&e<=65533&&e!==hO||e>=65536&&e<=1114111}function AM(e){return uh(e)&&e!==hO&&e!==FL&&e!==is}function W1(e,t,n){const r=AM(e),i=r&&!Uu(e);return(n?r:r&&e!==VL&&e!==XL&&e!==QL&&e!==YL&&e!==GL)&&e!==F1&&!(t===sh&&!i)||AM(t)&&!Uu(t)&&e===F1||t===sh&&i}function GV(e){return uh(e)&&e!==hO&&!Uu(e)&&e!==dO&&e!==KL&&e!==sh&&e!==VL&&e!==XL&&e!==QL&&e!==YL&&e!==GL&&e!==F1&&e!==zV&&e!==$V&&e!==jV&&e!==WV&&e!==HV&&e!==UV&&e!==WL&&e!==qL&&e!==BV&&e!==FV&&e!==qV}function ZV(e,t){const n=Mu(e,0);if(GV(n))return!0;if(e.length>1&&(n===dO||n===KL||n===sh)){const r=Mu(e,1);return!Uu(r)&&W1(r,n,t)}return!1}function JV(e){return!Uu(e)&&e!==sh}function Mu(e,t){const n=e.charCodeAt(t);let r;return n>=55296&&n<=56319&&t+1<e.length&&(r=e.charCodeAt(t+1),r>=56320&&r<=57343)?(n-55296)*1024+r-56320+65536:n}function ZL(e){return/^\n* /.test(e)}var ch=1,qf=2,mO=3,gO=4,Bl=5;function e7(e,t,n,r,i,a){const{blockIndent:l,lineWidth:s}=n;let c,f=0,d=-1,p=!1,g=!1;const v=s!==-1;let y=-1,x=!YV(t)&&ZV(t,a)&&JV(Mu(t,t.length-1));if(r||i)for(c=0;c<t.length;f>=65536?c+=2:c++){if(f=Mu(t,c),!uh(f))return Bl;x=x&&W1(f,d,a),d=f}else{for(c=0;c<t.length;f>=65536?c+=2:c++){if(f=Mu(t,c),f===is)p=!0,v&&(g=g||c-y-1>s&&t[y+1]!==" ",y=c);else if(!uh(f))return Bl;x=x&&W1(f,d,a),d=f}g=g||v&&c-y-1>s&&t[y+1]!==" "}return!p&&!g?x&&!i?ch:e.quoteStyle==="double"?Bl:qf:l>9&&ZL(t)?Bl:g?gO:mO}function t7(e,t,n){const{indent:r,blockIndent:i,lineWidth:a}=n;switch(t){case ch:return CM(e,r);case qf:return`'${CM(e,r).replace(/'/g,"''")}'`;case mO:return"|"+kM(e,i)+EM(wM(e,r));case gO:return">"+kM(e,i)+EM(wM(r7(e,a),r));case Bl:return`"${i7(e)}"`}}function n7(e,t,n,r,i){const a=r||!i;if(t.style.singleQuoted)return qf;if(t.style.doubleQuoted)return Bl;if(!a){if(t.style.literal)return mO;if(t.style.folded)return gO}const l=t.value;if(l.length===0)return t.style.tagged||OM(e,l)===t.tag?ch:e.quoteStyle==="double"?Bl:qf;const s=e7(e,l,n,a,e.forceQuotes&&!r,i);return s===ch&&!t.style.tagged&&OM(e,l)!==t.tag?e.quoteStyle==="double"?Bl:qf:s}function kM(e,t){const n=ZL(e)?String(t):"",r=e[e.length-1]===`
|
|
32
|
+
`;return`${n}${r&&(e[e.length-2]===`
|
|
33
|
+
`||e===`
|
|
34
|
+
`)?"+":r?"":"-"}
|
|
35
|
+
`}function CM(e,t){let n=e.indexOf(`
|
|
36
|
+
`);if(n===-1)return e;const r=" ".repeat(t);let i=e.slice(0,n);const a=/(\n+)([^\n]*)/g;a.lastIndex=n;let l;for(;l=a.exec(e);){const s=l[1].length,c=l[2];i+=`
|
|
37
|
+
`.repeat(s+1)+r+c}return i}function EM(e){return e[e.length-1]===`
|
|
38
|
+
`?e.slice(0,-1):e}function r7(e,t){const n=/(\n+)([^\n]*)/g;let r=e.indexOf(`
|
|
39
|
+
`);r===-1&&(r=e.length),n.lastIndex=r;let i=TM(e.slice(0,r),t),a=e[0]===`
|
|
40
|
+
`||e[0]===" ",l,s;for(;s=n.exec(e);){const c=s[1],f=s[2];l=f[0]===" ",i+=c+(!a&&!l&&f!==""?`
|
|
41
|
+
`:"")+TM(f,t),a=l}return i}function TM(e,t){if(e===""||e[0]===" ")return e;const n=/ [^ ]/g;let r,i=0,a,l=0,s=0,c="";for(;r=n.exec(e);)s=r.index,s-i>t&&(a=l>i?l:s,c+=`
|
|
42
|
+
${e.slice(i,a)}`,i=a+1),l=s;return c+=`
|
|
43
|
+
`,e.length-i>t&&l>i?c+=`${e.slice(i,l)}
|
|
44
|
+
${e.slice(l+1)}`:c+=e.slice(i),c.slice(1)}function i7(e){let t="",n=0;for(let r=0;r<e.length;n>=65536?r+=2:r++){n=Mu(e,r);const i=Rn[n];if(i){t+=i;continue}if(uh(n)){t+=e[r],n>=65536&&(t+=e[r+1]);continue}t+=XV(n)}return t}function a7(e,t,n){let r="";for(let a=0,l=n.items.length;a<l;a+=1){const s=Na(e,t,n.items[a],{});r!==""&&(r+=`,${e.flowSkipCommaSpace?"":" "}`),r+=s}const i=e.flowBracketPadding&&r!==""?" ":"";return`[${i}${r}${i}]`}function MM(e,t,n,r){let i="";for(let a=0,l=n.items.length;a<l;a+=1){const s=Na(e,t+1,n.items[a],{block:!0,compact:e.seqInlineFirst,isblockseq:!0});(!r||i!=="")&&(i+=q1(e,t)),s===""||is===s.charCodeAt(0)?i+="-":i+="- ",i+=s}return i}function l7(e,t,n){let r="";const i=JL(e,n.items);for(const{key:l,value:s}of i){let c="";r!==""&&(c+=`,${e.flowSkipCommaSpace?"":" "}`);const f=Na(e,t,l,{iskey:!0}),d=f.length>1024;d?c+="? ":e.quoteFlowKeys&&(c+='"');const p=Na(e,t,s,{}),g=e.flowSkipColonSpace||p===""?"":" ";c+=`${f}${e.quoteFlowKeys&&!d?'"':""}:${g}${p}`,r+=c}const a=e.flowBracketPadding&&r!==""?" ":"";return`{${a}${r}${a}}`}function Lp(e){return e.kind==="scalar"?e.value:e}function JL(e,t){if(!e.sortKeys)return t;const n=t.slice();if(e.sortKeys===!0)n.sort((r,i)=>{const a=Lp(r.key),l=Lp(i.key);return a<l?-1:a>l?1:0});else{const r=e.sortKeys;n.sort((i,a)=>r(Lp(i.key),Lp(a.key)))}return n}function o7(e,t,n,r){let i="";const a=JL(e,n.items);for(let l=0,s=a.length;l<s;l+=1){let c="";(!r||i!=="")&&(c+=q1(e,t));const{key:f,value:d}=a[l],p=(f.kind==="mapping"||f.kind==="sequence")&&!f.style.flow&&f.items.length!==0||f.kind==="scalar"&&(f.style.literal||f.style.folded),g=p?Na(e,t+1,f,{block:!0,compact:!0,isblockseq:!V1(e,f,t+1)}):Na(e,t+1,f,{block:!0,compact:!0,iskey:!0}),v=f.kind==="scalar"&&f.value.indexOf(`
|
|
45
|
+
`)!==-1,y=p||v||g.length>1024;y&&(g&&is===g.charCodeAt(0)?c+="?":c+="? "),c+=g,y&&(c+=q1(e,t));const x=Na(e,t+1,d,{block:!0,compact:y,isblockseq:y&&!V1(e,d,t+1)}),w=f.kind==="scalar"&&f.value===""&&g!==""&&g.charCodeAt(g.length-1)!==WL&&g.charCodeAt(g.length-1)!==qL,A=!y&&(f.kind==="alias"||w)?" ":"";x===""||is===x.charCodeAt(0)?c+=`${A}:`:c+=`${A}: `,c+=x,i+=c}return i}function V1(e,t,n){return t.style.tagged||t.anchor!==void 0||e.indent<2&&n>0}function Na(e,t,n,r){if(n.kind==="alias")return`*${n.anchor}`;const{block:i=!1,iskey:a=!1,isblockseq:l=!1}=r;let s=r.compact??!1;const c=n.anchor!==void 0;V1(e,n,t)&&(s=!1);let f,d=n.style.tagged;const p=i&&(n.kind==="mapping"||n.kind==="sequence")&&!n.style.flow&&n.items.length!==0;if(n.kind==="mapping")p?f=o7(e,t,n,s):f=l7(e,t,n);else if(n.kind==="sequence")p?e.seqNoIndent&&!l&&t>0?f=MM(e,t-1,n,s):f=MM(e,t,n,s):f=a7(e,t,n);else{const g=QV(e,t),v=n7(e,n,g,a,i);f=t7(n.value,v,g),d=n.style.tagged||v!==ch&&n.tag!==e.defaultScalarTagName}if(p&&s&&t>0&&e.indent>2&&(f=`${" ".repeat(e.indent-2)}${f}`),d||c){const g=[],v=d?VV(n):null,y=c?`&${n.anchor}`:null;e.tagBeforeAnchor?(v!==null&&g.push(v),y!==null&&g.push(y)):(y!==null&&g.push(y),v!==null&&g.push(v));const x=f===""||f.charCodeAt(0)===is?"":" ";f=`${g.join(" ")}${x}${f}`}return f}function s7(e){return(e.kind==="sequence"||e.kind==="mapping")&&!e.style.flow&&e.items.length!==0&&!e.style.tagged&&e.anchor===void 0}function u7(e){let t=e;for(;(t.kind==="sequence"||t.kind==="mapping")&&!t.style.flow&&t.items.length!==0;)t=t.kind==="sequence"?t.items[t.items.length-1]:t.items[t.items.length-1].value;if(t.kind!=="scalar"||!(t.style.literal||t.style.folded))return!1;const{value:n}=t;return n.endsWith(`
|
|
46
|
+
|
|
47
|
+
`)||n===`
|
|
48
|
+
`}function c7(e){let t="";for(const n of e.directives){if(n.kind==="yaml"){t+=`%YAML ${n.version}
|
|
49
|
+
`;continue}const{handle:r,prefix:i}=n;t+=`%TAG ${r} ${i}
|
|
50
|
+
`}return t}function f7(e,t){const n=KV(t);let r="",i=!1;for(let a=0;a<e.length;a+=1){const l=e[a],s=c7(l),c=s!=="",f=l.explicitStart||c||a>0&&!i;if(r+=s,l.contents===null)f&&(r+=`---
|
|
51
|
+
`);else if(f){const d=Na(n,0,l.contents,{block:!0,compact:!0}),p=d===""?"":c||s7(l.contents)?`
|
|
52
|
+
`:" ";r+=`---${p}${d}
|
|
53
|
+
`}else r+=Na(n,0,l.contents,{block:!0,compact:!0})+`
|
|
54
|
+
`;i=l.explicitEnd||l.contents!==null&&u7(l.contents),i&&(r+=`...
|
|
55
|
+
`)}return r}var h7=$W.withTags({...j1,resolve:(e,t,n)=>{const r=j1.resolve(e,t,n);return r===Ke?EL.resolve(e,t,n):r}},{...B1,resolve:(e,t,n)=>{const r=B1.resolve(e,t,n);return r===Ke?TL.resolve(e,t,n):r}}),d7={...pO,schema:h7,skipInvalid:!1,noRefs:!1,flowLevel:-1,transform:()=>{}};function p7(e,t={}){const n={...d7,...t},r=RV(e,n.schema,{noRefs:n.noRefs,skipInvalid:n.skipInvalid});return n.flowLevel>=0&&NV(r,(i,a)=>{if(!(a.depth<n.flowLevel))return i.style.flow=!0,UL}),n.transform(r),f7(r,{...z1(n,Object.keys(pO)),schema:n.schema})}const PM=[{key:"product_name",label:"Product name",type:"string",required:!0,placeholder:"istio",help:"Stored in chunk metadata; used to identify the source"},{key:"version",label:"Version",type:"string",required:!0,placeholder:"latest",help:"Required for all types except code (defaults to branch)"},{key:"max_size",label:"Max page size (bytes)",type:"number",placeholder:"1048576",help:"Pages/files larger than this are skipped"}],jp={website:{label:"Website",fields:[{key:"url",label:"Base URL",type:"string",required:!0,placeholder:"https://docs.example.com/"},{key:"sitemap_url",label:"Sitemap URL",type:"string",placeholder:"https://docs.example.com/sitemap.xml",help:"Discovers pages not linked in navigation; lastmod dates enable cheap change detection"},{key:"markdown_store",label:"Store markdown in Postgres",type:"boolean",help:"Requires the top-level markdown store to be configured"}]},github:{label:"GitHub issues",fields:[{key:"repo",label:"Repository",type:"string",required:!0,placeholder:"owner/repo"},{key:"start_date",label:"Start date",type:"string",placeholder:"2025-01-01",help:"Only issues updated after this date (first run)"}]},local_directory:{label:"Local directory",fields:[{key:"path",label:"Directory path",type:"string",required:!0,placeholder:"/data/docs"},{key:"include_extensions",label:"Include extensions",type:"string_list",placeholder:".md, .txt, .pdf"},{key:"exclude_extensions",label:"Exclude extensions",type:"string_list",placeholder:".log, .tmp"},{key:"recursive",label:"Recurse into subdirectories",type:"boolean"},{key:"encoding",label:"File encoding",type:"string",placeholder:"utf8"},{key:"url_rewrite_prefix",label:"URL rewrite prefix",type:"string",placeholder:"https://mydomain.com",help:"Rewrites file:// URLs in chunk metadata"}]},zendesk:{label:"Zendesk",fields:[{key:"zendesk_subdomain",label:"Subdomain",type:"string",required:!0,placeholder:"mycompany",help:"mycompany.zendesk.com"},{key:"email",label:"User email",type:"string",required:!0,placeholder:"agent@company.com"},{key:"api_token",label:"API token",type:"string",required:!0,secret:!0,placeholder:"${ZENDESK_API_TOKEN}"},{key:"fetch_tickets",label:"Fetch tickets",type:"boolean"},{key:"fetch_articles",label:"Fetch help center articles",type:"boolean"},{key:"start_date",label:"Start date",type:"string",placeholder:"2025-01-01"},{key:"ticket_status",label:"Ticket statuses",type:"string_list",placeholder:"new, open, pending, hold, solved"},{key:"ticket_priority",label:"Ticket priorities",type:"string_list",placeholder:"urgent, high"},{key:"excluded_organizations",label:"Excluded organizations",type:"string_list"},{key:"include_internal_comments",label:"Include internal comments",type:"boolean"}]},code:{label:"Code",fields:[{key:"source",label:"Code source",type:"select",required:!0,options:["github","local_directory"]},{key:"repo",label:"Repository",type:"string",placeholder:"owner/repo",help:"When source is github"},{key:"branch",label:"Branch",type:"string",placeholder:"main",help:"When source is github"},{key:"path",label:"Directory path",type:"string",placeholder:"/data/src",help:"When source is local_directory"},{key:"include_extensions",label:"Include extensions",type:"string_list",placeholder:".ts, .go, .py"},{key:"exclude_extensions",label:"Exclude extensions",type:"string_list"},{key:"recursive",label:"Recurse into subdirectories",type:"boolean"},{key:"chunk_size",label:"Chunk size (tokens)",type:"number",placeholder:"1500"},{key:"url_rewrite_prefix",label:"URL rewrite prefix",type:"string"}]},s3:{label:"S3 bucket",fields:[{key:"bucket",label:"Bucket",type:"string",required:!0,placeholder:"my-docs-bucket"},{key:"prefix",label:"Key prefix",type:"string",placeholder:"docs/"},{key:"region",label:"Region",type:"string",placeholder:"us-east-1"},{key:"endpoint",label:"Custom endpoint",type:"string",placeholder:"https://minio.local:9000",help:"For S3-compatible services (MinIO, LocalStack)"},{key:"include_extensions",label:"Include extensions",type:"string_list",placeholder:".md, .txt, .pdf"},{key:"exclude_extensions",label:"Exclude extensions",type:"string_list"},{key:"encoding",label:"Text encoding",type:"string",placeholder:"utf8"},{key:"url_rewrite_prefix",label:"URL rewrite prefix",type:"string",help:"Rewrites s3:// URLs in chunk metadata"}]}},fx={sqlite:{label:"SQLite (sqlite-vec)",fields:[{key:"db_path",label:"Database file",type:"string",placeholder:"./my-product.db"}]},qdrant:{label:"Qdrant",fields:[{key:"qdrant_url",label:"Qdrant URL",type:"string",placeholder:"http://localhost"},{key:"qdrant_port",label:"Port",type:"number",placeholder:"6333"},{key:"collection_name",label:"Collection",type:"string",placeholder:"my-product"}]}},DM={openai:{label:"OpenAI (or compatible)",fields:[{key:"api_key",label:"API key",type:"string",secret:!0,placeholder:"${OPENAI_API_KEY}",help:"Falls back to the OPENAI_API_KEY env var"},{key:"model",label:"Model",type:"string",placeholder:"text-embedding-3-large"},{key:"base_url",label:"Base URL",type:"string",placeholder:"http://localhost:11434/v1",help:"For Ollama or other OpenAI-compatible endpoints"}]},azure:{label:"Azure OpenAI",fields:[{key:"api_key",label:"API key",type:"string",secret:!0,placeholder:"${AZURE_OPENAI_KEY}"},{key:"endpoint",label:"Endpoint",type:"string",placeholder:"https://myresource.openai.azure.com"},{key:"deployment_name",label:"Deployment name",type:"string",placeholder:"text-embedding-3-large"},{key:"api_version",label:"API version",type:"string",placeholder:"2024-10-21"}]}},m7=[{key:"connection_string",label:"Connection string",type:"string",secret:!0,placeholder:"postgres://user:${PG_PASSWORD}@host:5432/db",help:"Either this, or the discrete fields below"},{key:"host",label:"Host",type:"string"},{key:"port",label:"Port",type:"number",placeholder:"5432"},{key:"database",label:"Database",type:"string"},{key:"user",label:"User",type:"string"},{key:"password",label:"Password",type:"string",secret:!0,placeholder:"${PG_PASSWORD}"},{key:"table_name",label:"Table name",type:"string",placeholder:"markdown_pages"}];function Bp(e){const t={type:e,product_name:"",version:"latest",max_size:1048576};return e==="code"&&delete t.version,t.database_config={type:"sqlite",params:{db_path:""}},t}function g7(e,t){return t.reduce((n,r)=>n?.[r],e)}function ej(e,t,n){if(t.length===0)return n;const[r,...i]=t,a=Array.isArray(e)?[...e??[]]:{...e??{}};return i.length===0?n===void 0||n===""||Array.isArray(n)&&n.length===0?delete a[r]:a[r]=n:a[r]=ej(a[r],i,n),a}const $o="w-full rounded-md border border-edge bg-page px-3 py-1.5 text-sm outline-none focus:border-accent placeholder:text-ink-muted/60";function mu({field:e,value:t,onChange:n}){const[r,i]=O.useState(null);return e.type==="boolean"?_.jsxs("label",{className:"flex items-center gap-2 py-1.5 text-sm text-ink-secondary",children:[_.jsx("input",{type:"checkbox",checked:!!t,onChange:a=>n(a.target.checked||void 0),className:"h-4 w-4 accent-(--accent)"}),e.label,e.help&&_.jsxs("span",{className:"text-xs text-ink-muted",children:["— ",e.help]})]}):_.jsxs("label",{className:"block",children:[_.jsxs("span",{className:"mb-1 flex items-baseline gap-2 text-xs font-medium text-ink-secondary",children:[e.label,e.required&&_.jsx("span",{className:"text-critical",children:"*"}),e.secret&&_.jsxs("span",{className:"text-ink-muted",children:["use a ",_.jsx("code",{children:"${ENV_VAR}"})," placeholder"]})]}),e.type==="select"?_.jsxs("select",{value:t??"",onChange:a=>n(a.target.value||void 0),className:$o,children:[_.jsx("option",{value:"",children:"—"}),e.options.map(a=>_.jsx("option",{value:a,children:a},a))]}):e.type==="string_list"?_.jsx("input",{value:r??(Array.isArray(t)?t.join(", "):""),placeholder:e.placeholder,onChange:a=>i(a.target.value),onBlur:()=>{r!==null&&(n(r.split(",").map(a=>a.trim()).filter(Boolean)),i(null))},className:$o}):_.jsx("input",{type:"text",inputMode:e.type==="number"?"numeric":void 0,value:t??"",placeholder:e.placeholder,onChange:a=>{const l=a.target.value;e.type==="number"?n(l===""?void 0:Number(l)):n(l)},className:$o}),e.help&&_.jsx("span",{className:"mt-1 block text-xs text-ink-muted",children:e.help})]})}function hx({fields:e,doc:t,basePath:n,onSet:r}){return _.jsx("div",{className:"grid gap-x-4 gap-y-3 sm:grid-cols-2",children:e.map(i=>_.jsx("div",{className:i.type==="boolean"?"sm:col-span-2":"",children:_.jsx(mu,{field:i,value:g7(t,[...n,i.key]),onChange:a=>r([...n,i.key],a)})},i.key))})}function zp({title:e,subtitle:t,action:n,children:r}){return _.jsxs("section",{className:"rounded-lg border border-edge bg-surface p-4",children:[_.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[_.jsx("h3",{className:"text-sm font-semibold",children:e}),t&&_.jsx("span",{className:"text-xs text-ink-muted",children:t}),_.jsx("div",{className:"ml-auto",children:n})]}),r]})}function tj(e){const t=ro(),n=O.useMemo(()=>{if(e.mode==="edit"&&e.config)try{const A=MV(e.config.content);return A&&typeof A=="object"?{doc:A,parseError:null}:{doc:null,parseError:"config is not a YAML mapping"}}catch(A){return{doc:null,parseError:A instanceof Error?A.message:String(A)}}return{doc:{name:"",schedule:"",sources:[Bp("website")]},parseError:null}},[e.mode,e.config]),[r,i]=O.useState(n.doc),[a,l]=O.useState(""),[s,c]=O.useState(null),f=$u({mutationFn:async()=>{const A=p7(r,{lineWidth:120,noRefs:!0}),k=await an.validateConfig(A);if(!k.valid)throw new ah(400,k.error??"invalid config");if(e.mode==="create"){const E=a.trim()||`${(r.name||"config").toString().replace(/[^A-Za-z0-9._-]+/g,"-")}.yaml`;return an.createConfig(E,A)}return an.updateConfig(e.config.id,A,e.config.content_hash)},onSuccess:A=>{c(null),t.invalidateQueries({queryKey:["configs"]}),e.onSaved?.(A)},onError:A=>c(A.message)});if(n.parseError||!r)return _.jsxs("p",{className:"rounded-md border border-warning/50 bg-surface px-3 py-2 text-sm text-ink-secondary",children:["⚠ This config can't be edited as a form (",n.parseError,") — use the YAML view."]});const d=(A,k)=>i(E=>ej(E,A,k)),p=Array.isArray(r.sources)?r.sources:[],g=[];p.forEach((A,k)=>{const E=jp[A?.type];for(const P of[...PM,...E?.fields??[]]){if(!P.required||A?.type==="code"&&P.key==="version")continue;const T=A?.[P.key];(T===void 0||T==="")&&g.push(`source ${k+1}: ${P.label}`)}});const v=r.embedding!==void 0,y=r.markdown_store!==void 0,x=f.error instanceof ah&&f.error.status===409,w=r.schedule??"";return _.jsxs("div",{className:"space-y-4",children:[x&&_.jsx("div",{className:"rounded-md border border-warning/50 bg-surface px-3 py-2 text-sm text-ink-secondary",children:"⚠ The file changed on disk since you loaded it. Reload the page and reapply your edits."}),s&&!x&&_.jsx("div",{className:"rounded-md border border-critical/50 bg-surface px-3 py-2 text-sm text-critical",children:s}),_.jsx(zp,{title:"General",children:_.jsxs("div",{className:"grid gap-x-4 gap-y-3 sm:grid-cols-2",children:[e.mode==="create"&&_.jsxs("label",{className:"block",children:[_.jsx("span",{className:"mb-1 block text-xs font-medium text-ink-secondary",children:"Filename"}),_.jsx("input",{value:a,onChange:A=>l(A.target.value),placeholder:`${(r.name||"my-config").toString().replace(/[^A-Za-z0-9._-]+/g,"-")}.yaml`,className:`${$o} font-mono`})]}),_.jsx(mu,{field:{key:"name",label:"Display name",type:"string",placeholder:"product-docs"},value:r.name,onChange:A=>d(["name"],A)}),_.jsxs("div",{children:[_.jsx(mu,{field:{key:"schedule",label:"Schedule (cron)",type:"string",placeholder:"0 2 * * *",help:"Leave empty for manual runs only"},value:w,onChange:A=>d(["schedule"],A)}),w&&_.jsx("p",{className:"mt-1 text-xs text-accent",children:iO(w)})]})]})}),p.map((A,k)=>{const E=jp[A?.type]??jp.website,P=A?.database_config?.type??"sqlite",T=fx[P]??fx.sqlite;return _.jsx(zp,{title:`Source ${k+1}`,subtitle:A?.product_name||void 0,action:_.jsx("button",{onClick:()=>d(["sources"],p.filter((M,R)=>R!==k)),className:"text-xs text-ink-muted transition hover:text-critical",children:"Remove"}),children:_.jsxs("div",{className:"space-y-4",children:[_.jsxs("div",{className:"grid gap-x-4 gap-y-3 sm:grid-cols-2",children:[_.jsxs("label",{className:"block",children:[_.jsx("span",{className:"mb-1 block text-xs font-medium text-ink-secondary",children:"Type"}),_.jsx("select",{value:A?.type??"website",onChange:M=>{const R={...Bp(M.target.value),product_name:A?.product_name??"",...A?.version!==void 0&&M.target.value!=="code"&&{version:A.version},...A?.max_size!==void 0&&{max_size:A.max_size},database_config:A?.database_config??Bp(M.target.value).database_config};d(["sources",k],R)},className:$o,children:Object.entries(jp).map(([M,R])=>_.jsx("option",{value:M,children:R.label},M))})]}),PM.map(M=>_.jsx(mu,{field:A?.type==="code"&&M.key==="version"?{...M,required:!1,help:"Defaults to the branch name"}:M,value:A?.[M.key],onChange:R=>d(["sources",k,M.key],R)},M.key))]}),_.jsxs("div",{children:[_.jsxs("p",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-ink-muted",children:[E.label," options"]}),_.jsx(hx,{fields:E.fields,doc:r,basePath:["sources",k],onSet:d})]}),_.jsxs("div",{children:[_.jsx("p",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-ink-muted",children:"Vector database"}),_.jsxs("div",{className:"grid gap-x-4 gap-y-3 sm:grid-cols-2",children:[_.jsxs("label",{className:"block",children:[_.jsx("span",{className:"mb-1 block text-xs font-medium text-ink-secondary",children:"Type"}),_.jsx("select",{value:P,onChange:M=>d(["sources",k,"database_config"],{type:M.target.value,params:{}}),className:$o,children:Object.entries(fx).map(([M,R])=>_.jsx("option",{value:M,children:R.label},M))})]}),T.fields.map(M=>_.jsx(mu,{field:M,value:A?.database_config?.params?.[M.key],onChange:R=>d(["sources",k,"database_config","params",M.key],R)},M.key))]})]})]})},k)}),_.jsx("button",{onClick:()=>d(["sources"],[...p,Bp("website")]),className:"w-full rounded-lg border border-dashed border-edge py-2.5 text-sm font-medium text-ink-muted transition hover:border-accent hover:text-accent",children:"+ Add source"}),_.jsx(zp,{title:"Embedding",subtitle:"optional — defaults to OpenAI text-embedding-3-large",action:_.jsxs("label",{className:"flex items-center gap-2 text-xs text-ink-secondary",children:[_.jsx("input",{type:"checkbox",checked:v,onChange:A=>d(["embedding"],A.target.checked?{provider:"openai"}:void 0),className:"h-4 w-4 accent-(--accent)"}),"customize"]}),children:v?_.jsxs("div",{className:"space-y-3",children:[_.jsxs("div",{className:"grid gap-x-4 gap-y-3 sm:grid-cols-2",children:[_.jsxs("label",{className:"block",children:[_.jsx("span",{className:"mb-1 block text-xs font-medium text-ink-secondary",children:"Provider"}),_.jsx("select",{value:r.embedding?.provider??"openai",onChange:A=>d(["embedding"],{provider:A.target.value}),className:$o,children:Object.entries(DM).map(([A,k])=>_.jsx("option",{value:A,children:k.label},A))})]}),_.jsx(mu,{field:{key:"dimension",label:"Dimension",type:"number",placeholder:"3072"},value:r.embedding?.dimension,onChange:A=>d(["embedding","dimension"],A)})]}),_.jsx(hx,{fields:DM[r.embedding?.provider??"openai"].fields,doc:r,basePath:["embedding",r.embedding?.provider??"openai"],onSet:d})]}):_.jsx("p",{className:"text-xs text-ink-muted",children:"Using defaults (OPENAI_API_KEY env var, text-embedding-3-large, 3072 dimensions)."})}),_.jsx(zp,{title:"Markdown store",subtitle:"optional — store crawled markdown in Postgres",action:_.jsxs("label",{className:"flex items-center gap-2 text-xs text-ink-secondary",children:[_.jsx("input",{type:"checkbox",checked:y,onChange:A=>d(["markdown_store"],A.target.checked?{}:void 0),className:"h-4 w-4 accent-(--accent)"}),"enable"]}),children:y?_.jsx(hx,{fields:m7,doc:r,basePath:["markdown_store"],onSet:d}):_.jsx("p",{className:"text-xs text-ink-muted",children:"Disabled."})}),_.jsxs("div",{className:"flex items-center gap-3",children:[_.jsx("button",{onClick:()=>f.mutate(),disabled:f.isPending||p.length===0||g.length>0,className:"rounded-md bg-accent px-4 py-2 text-sm font-medium text-white transition hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-40",children:f.isPending?"Saving…":e.mode==="create"?"Create config":"Save changes"}),e.onCancel&&_.jsx("button",{onClick:e.onCancel,className:"text-sm text-ink-muted hover:text-ink-secondary",children:"Cancel"}),g.length>0&&_.jsxs("span",{className:"text-xs text-warning",children:["missing: ",g.slice(0,3).join(", "),g.length>3?"…":""]}),p.length===0&&_.jsx("span",{className:"text-xs text-warning",children:"add at least one source"}),e.mode==="edit"&&_.jsx("span",{className:"ml-auto text-xs text-ink-muted",children:"Saving rewrites the YAML file (comments are not preserved)."})]})]})}const v7={website:"🌐",github:"🐙",zendesk:"🎫",local_directory:"📁",code:"⌨️",s3:"🪣"};function nj({sources:e,max:t}){const[n,r]=O.useState(!1);if(e.length===0)return _.jsx("span",{className:"text-xs text-ink-muted",children:"no sources"});const i=n||t===void 0?e.length:t,a=e.slice(0,i),l=e.length-a.length;return _.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[a.map((s,c)=>_.jsxs("span",{title:`${s.type}${s.version?` · ${s.version}`:""}`,className:"inline-flex items-center gap-1 rounded-full border border-edge bg-page px-2 py-0.5 text-xs text-ink-secondary",children:[_.jsx("span",{"aria-hidden":!0,className:"text-[10px]",children:v7[s.type]??"•"}),s.product_name,_.jsx("span",{className:"text-ink-muted",children:s.type})]},`${s.product_name}-${s.type}-${c}`)),l>0&&_.jsxs("button",{onClick:s=>{s.preventDefault(),r(!0)},className:"rounded-full border border-edge px-2 py-0.5 text-xs text-ink-muted transition hover:border-accent hover:text-accent",children:["+",l," more"]})]})}function y7({config:e}){const t=ro(),n=$u({mutationFn:()=>an.triggerRun(e.id),onSettled:()=>t.invalidateQueries({queryKey:["configs"]})}),r=e.busy||!!e.parse_error||n.isPending;return _.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("button",{onClick:i=>{i.preventDefault(),n.mutate()},disabled:r,className:"rounded-md border border-edge bg-surface px-3 py-1 text-xs font-medium text-ink-secondary transition hover:border-accent hover:text-accent disabled:cursor-not-allowed disabled:opacity-40",children:e.busy?"Running…":"Run now"}),n.error&&_.jsx("span",{className:"text-xs text-critical",children:n.error.message})]})}function b7(){const e=Yw(),{data:t,isLoading:n,error:r}=Ll({queryKey:["configs"],queryFn:an.configs}),{data:i}=Ll({queryKey:["health"],queryFn:an.health}),[a,l]=O.useState(!1),s=t?.filter(c=>c.last_run?.status==="running"||c.last_run?.status==="queued")??[];return n?_.jsx("p",{className:"text-ink-muted",children:"Loading…"}):r?_.jsxs("p",{className:"text-critical",children:["Failed to load configs: ",String(r.message)]}):_.jsxs("div",{className:"space-y-6",children:[s.length>0&&_.jsx("div",{className:"rounded-lg border border-accent/30 bg-surface px-4 py-3",children:_.jsxs("p",{className:"text-sm text-ink-secondary",children:[_.jsxs("span",{className:"font-medium text-accent",children:["● ",s.length," config",s.length>1?"s":""," syncing now"]})," — ",s.map((c,f)=>_.jsxs("span",{children:[f>0&&", ",_.jsx(za,{to:`/runs/${c.last_run.id}`,className:"text-accent hover:underline",children:c.name})]},c.id))]})}),_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Configurations"}),i?.mode==="rw"&&_.jsx("button",{onClick:()=>l(!0),className:"rounded-md bg-accent px-3.5 py-1.5 text-sm font-medium text-white transition hover:opacity-90",children:"New config"})]}),a&&_.jsxs("div",{className:"rounded-lg border border-edge bg-page p-4",children:[_.jsx("h2",{className:"mb-4 text-sm font-semibold",children:"Create a new config"}),_.jsx(tj,{mode:"create",onSaved:c=>{l(!1),e(`/configs/${c.id}`)},onCancel:()=>l(!1)})]}),t&&t.length===0&&_.jsxs("p",{className:"rounded-lg border border-edge bg-surface px-4 py-8 text-center text-sm text-ink-muted",children:["No configs loaded. Pass config files to ",_.jsx("code",{className:"text-ink-secondary",children:"doc2vec controller"}),i?.mode==="rw"&&" or create one with the button above","."]}),_.jsx("div",{className:"grid gap-4",children:t?.map(c=>_.jsx(za,{to:`/configs/${c.id}`,className:"block rounded-lg border border-edge bg-surface p-4 transition hover:border-accent/50",children:_.jsxs("div",{className:"flex flex-wrap items-start gap-x-6 gap-y-3",children:[_.jsxs("div",{className:"min-w-48 flex-1",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("h2",{className:"font-semibold",children:c.name}),c.parse_error&&_.jsx("span",{className:"rounded-full border border-critical/40 px-2 py-0.5 text-xs text-critical",title:c.parse_error,children:"invalid"})]}),_.jsx("div",{className:"mt-1.5",children:_.jsx(nj,{sources:c.source_summary,max:4})})]}),_.jsxs("div",{className:"text-sm",children:[_.jsx("p",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"Schedule"}),_.jsx("p",{className:"mt-0.5 text-ink-secondary",title:c.schedule??void 0,children:iO(c.schedule)})]}),_.jsxs("div",{className:"text-sm",children:[_.jsx("p",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"Last run"}),_.jsx("div",{className:"mt-0.5 flex items-center gap-2",children:c.last_run?_.jsxs(_.Fragment,{children:[_.jsx(aO,{status:c.last_run.status}),_.jsxs("span",{className:"text-xs text-ink-muted",title:Hu(c.last_run.queued_at),children:[L1(c.last_run.finished_at??c.last_run.queued_at),c.last_run.finished_at&&c.last_run.started_at&&` · ${rO(c.last_run.started_at,c.last_run.finished_at)}`]})]}):_.jsx("span",{className:"text-xs text-ink-muted",children:"never"})})]}),_.jsxs("div",{className:"text-sm",children:[_.jsx("p",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"Next run"}),_.jsx("p",{className:"mt-0.5 text-ink-secondary",title:c.next_run?Hu(c.next_run):void 0,children:c.next_run?L1(c.next_run):"—"})]}),_.jsx("div",{className:"ml-auto self-center",children:_.jsx(y7,{config:c})})]})},c.id))})]})}function K1(){return K1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},K1.apply(null,arguments)}function x7(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}let X1=[],rj=[];(()=>{let e="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(t=>t?parseInt(t,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?rj:X1).push(n=n+e[t])})();function S7(e){if(e<768)return!1;for(let t=0,n=X1.length;;){let r=t+n>>1;if(e<X1[r])n=r;else if(e>=rj[r])t=r+1;else return!0;if(t==n)return!1}}function RM(e){return e>=127462&&e<=127487}const _M=8205;function w7(e,t,n=!0,r=!0){return(n?ij:O7)(e,t,r)}function ij(e,t,n){if(t==e.length)return t;t&&aj(e.charCodeAt(t))&&lj(e.charCodeAt(t-1))&&t--;let r=dx(e,t);for(t+=NM(r);t<e.length;){let i=dx(e,t);if(r==_M||i==_M||n&&S7(i))t+=NM(i),r=i;else if(RM(i)){let a=0,l=t-2;for(;l>=0&&RM(dx(e,l));)a++,l-=2;if(a%2==0)break;t+=2}else break}return t}function O7(e,t,n){for(;t>1;){let r=ij(e,t-2,n);if(r<t)return r;t--}return 0}function dx(e,t){let n=e.charCodeAt(t);if(!lj(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return aj(r)?(n-55296<<10)+(r-56320)+65536:n}function aj(e){return e>=56320&&e<57344}function lj(e){return e>=55296&&e<56320}function NM(e){return e<65536?1:2}let Je=class oj{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,n,r){[t,n]=Fu(this,t,n);let i=[];return this.decompose(0,t,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),zi.from(i,this.length-(n-t)+r.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,n=this.length){[t,n]=Fu(this,t,n);let r=[];return this.decompose(t,n,r,0),zi.from(r,n-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let n=this.scanIdentical(t,1),r=this.length-this.scanIdentical(t,-1),i=new Wf(this),a=new Wf(t);for(let l=n,s=n;;){if(i.next(l),a.next(l),l=0,i.lineBreak!=a.lineBreak||i.done!=a.done||i.value!=a.value)return!1;if(s+=i.value.length,i.done||s>=r)return!0}}iter(t=1){return new Wf(this,t)}iterRange(t,n=this.length){return new sj(this,t,n)}iterLines(t,n){let r;if(t==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(t).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new uj(r)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length==1&&!t[0]?oj.empty:t.length<=32?new Lt(t):zi.from(Lt.split(t,[]))}};class Lt extends Je{constructor(t,n=A7(t)){super(),this.text=t,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(t,n,r,i){for(let a=0;;a++){let l=this.text[a],s=i+l.length;if((n?r:s)>=t)return new k7(i,s,r,l);i=s+1,r++}}decompose(t,n,r,i){let a=t<=0&&n>=this.length?this:new Lt(IM(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let l=r.pop(),s=Rm(a.text,l.text.slice(),0,a.length);if(s.length<=32)r.push(new Lt(s,l.length+a.length));else{let c=s.length>>1;r.push(new Lt(s.slice(0,c)),new Lt(s.slice(c)))}}else r.push(a)}replace(t,n,r){if(!(r instanceof Lt))return super.replace(t,n,r);[t,n]=Fu(this,t,n);let i=Rm(this.text,Rm(r.text,IM(this.text,0,t)),n),a=this.length+r.length-(n-t);return i.length<=32?new Lt(i,a):zi.from(Lt.split(i,[]),a)}sliceString(t,n=this.length,r=`
|
|
56
|
+
`){[t,n]=Fu(this,t,n);let i="";for(let a=0,l=0;a<=n&&l<this.text.length;l++){let s=this.text[l],c=a+s.length;a>t&&l&&(i+=r),t<c&&n>a&&(i+=s.slice(Math.max(0,t-a),n-a)),a=c+1}return i}flatten(t){for(let n of this.text)t.push(n)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let a of t)r.push(a),i+=a.length+1,r.length==32&&(n.push(new Lt(r,i)),r=[],i=-1);return i>-1&&n.push(new Lt(r,i)),n}}class zi extends Je{constructor(t,n){super(),this.children=t,this.length=n,this.lines=0;for(let r of t)this.lines+=r.lines}lineInner(t,n,r,i){for(let a=0;;a++){let l=this.children[a],s=i+l.length,c=r+l.lines-1;if((n?c:s)>=t)return l.lineInner(t,n,r,i);i=s+1,r=c+1}}decompose(t,n,r,i){for(let a=0,l=0;l<=n&&a<this.children.length;a++){let s=this.children[a],c=l+s.length;if(t<=c&&n>=l){let f=i&((l<=t?1:0)|(c>=n?2:0));l>=t&&c<=n&&!f?r.push(s):s.decompose(t-l,n-l,r,f)}l=c+1}}replace(t,n,r){if([t,n]=Fu(this,t,n),r.lines<this.lines)for(let i=0,a=0;i<this.children.length;i++){let l=this.children[i],s=a+l.length;if(t>=a&&n<=s){let c=l.replace(t-a,n-a,r),f=this.lines-l.lines+c.lines;if(c.lines<f>>4&&c.lines>f>>6){let d=this.children.slice();return d[i]=c,new zi(d,this.length-(n-t)+r.length)}return super.replace(a,s,c)}a=s+1}return super.replace(t,n,r)}sliceString(t,n=this.length,r=`
|
|
57
|
+
`){[t,n]=Fu(this,t,n);let i="";for(let a=0,l=0;a<this.children.length&&l<=n;a++){let s=this.children[a],c=l+s.length;l>t&&a&&(i+=r),t<c&&n>l&&(i+=s.sliceString(t-l,n-l,r)),l=c+1}return i}flatten(t){for(let n of this.children)n.flatten(t)}scanIdentical(t,n){if(!(t instanceof zi))return 0;let r=0,[i,a,l,s]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,a+=n){if(i==l||a==s)return r;let c=this.children[i],f=t.children[a];if(c!=f)return r+c.scanIdentical(f,n);r+=c.length+1}}static from(t,n=t.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let v of t)r+=v.lines;if(r<32){let v=[];for(let y of t)y.flatten(v);return new Lt(v,n)}let i=Math.max(32,r>>5),a=i<<1,l=i>>1,s=[],c=0,f=-1,d=[];function p(v){let y;if(v.lines>a&&v instanceof zi)for(let x of v.children)p(x);else v.lines>l&&(c>l||!c)?(g(),s.push(v)):v instanceof Lt&&c&&(y=d[d.length-1])instanceof Lt&&v.lines+y.lines<=32?(c+=v.lines,f+=v.length+1,d[d.length-1]=new Lt(y.text.concat(v.text),y.length+1+v.length)):(c+v.lines>i&&g(),c+=v.lines,f+=v.length+1,d.push(v))}function g(){c!=0&&(s.push(d.length==1?d[0]:zi.from(d,f)),f=-1,c=d.length=0)}for(let v of t)p(v);return g(),s.length==1?s[0]:new zi(s,n)}}Je.empty=new Lt([""],0);function A7(e){let t=-1;for(let n of e)t+=n.length+1;return t}function Rm(e,t,n=0,r=1e9){for(let i=0,a=0,l=!0;a<e.length&&i<=r;a++){let s=e[a],c=i+s.length;c>=n&&(c>r&&(s=s.slice(0,r-i)),i<n&&(s=s.slice(n-i)),l?(t[t.length-1]+=s,l=!1):t.push(s)),i=c+1}return t}function IM(e,t,n){return Rm(e,[""],t,n)}class Wf{constructor(t,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[n>0?1:(t instanceof Lt?t.text.length:t.children.length)<<1]}nextInner(t,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],a=this.offsets[r],l=a>>1,s=i instanceof Lt?i.text.length:i.children.length;if(l==(n>0?s:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((a&1)==(n>0?0:1)){if(this.offsets[r]+=n,t==0)return this.lineBreak=!0,this.value=`
|
|
58
|
+
`,this;t--}else if(i instanceof Lt){let c=i.text[l+(n<0?-1:0)];if(this.offsets[r]+=n,c.length>Math.max(0,t))return this.value=t==0?c:n>0?c.slice(t):c.slice(0,c.length-t),this;t-=c.length}else{let c=i.children[l+(n<0?-1:0)];t>c.length?(t-=c.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(c),this.offsets.push(n>0?1:(c instanceof Lt?c.text.length:c.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class sj{constructor(t,n,r){this.value="",this.done=!1,this.cursor=new Wf(t,n>r?-1:1),this.pos=n>r?t.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(t,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;t>r&&(t=r),r-=t;let{value:i}=this.cursor.next(t);return this.pos+=(i.length+t)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class uj{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:n,lineBreak:r,value:i}=this.inner.next(t);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Je.prototype[Symbol.iterator]=function(){return this.iter()},Wf.prototype[Symbol.iterator]=sj.prototype[Symbol.iterator]=uj.prototype[Symbol.iterator]=function(){return this});let k7=class{constructor(t,n,r,i){this.from=t,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}};function Fu(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function on(e,t,n=!0,r=!0){return w7(e,t,n,r)}function C7(e){return e>=56320&&e<57344}function E7(e){return e>=55296&&e<56320}function nr(e,t){let n=e.charCodeAt(t);if(!E7(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return C7(r)?(n-55296<<10)+(r-56320)+65536:n}function vO(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function $i(e){return e<65536?1:2}const Q1=/\r\n?|\n/;var Fn=(function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e})(Fn||(Fn={}));class Ki{constructor(t){this.sections=t}get length(){let t=0;for(let n=0;n<this.sections.length;n+=2)t+=this.sections[n];return t}get newLength(){let t=0;for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n+1];t+=r<0?this.sections[n]:r}return t}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(t){for(let n=0,r=0,i=0;n<this.sections.length;){let a=this.sections[n++],l=this.sections[n++];l<0?(t(r,i,a),i+=a):i+=l,r+=a}}iterChangedRanges(t,n=!1){Y1(this,t,n)}get invertedDesc(){let t=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];i<0?t.push(r,i):t.push(i,r)}return new Ki(t)}composeDesc(t){return this.empty?t:t.empty?this:cj(this,t)}mapDesc(t,n=!1){return t.empty?this:G1(this,t,n)}mapPos(t,n=-1,r=Fn.Simple){let i=0,a=0;for(let l=0;l<this.sections.length;){let s=this.sections[l++],c=this.sections[l++],f=i+s;if(c<0){if(f>t)return a+(t-i);a+=s}else{if(r!=Fn.Simple&&f>=t&&(r==Fn.TrackDel&&i<t&&f>t||r==Fn.TrackBefore&&i<t||r==Fn.TrackAfter&&f>t))return null;if(f>t||f==t&&n<0&&!s)return t==i||n<0?a:a+c;a+=c}i=f}if(t>i)throw new RangeError(`Position ${t} is out of range for changeset of length ${i}`);return a}touchesRange(t,n=t){for(let r=0,i=0;r<this.sections.length&&i<=n;){let a=this.sections[r++],l=this.sections[r++],s=i+a;if(l>=0&&i<=n&&s>=t)return i<t&&s>n?"cover":!0;i=s}return!1}toString(){let t="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];t+=(t?" ":"")+r+(i>=0?":"+i:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Ki(t)}static create(t){return new Ki(t)}}class Qt extends Ki{constructor(t,n){super(t),this.inserted=n}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return Y1(this,(n,r,i,a,l)=>t=t.replace(i,i+(r-n),l),!1),t}mapDesc(t,n=!1){return G1(this,t,n,!0)}invert(t){let n=this.sections.slice(),r=[];for(let i=0,a=0;i<n.length;i+=2){let l=n[i],s=n[i+1];if(s>=0){n[i]=s,n[i+1]=l;let c=i>>1;for(;r.length<c;)r.push(Je.empty);r.push(l?t.slice(a,a+l):Je.empty)}a+=l}return new Qt(n,r)}compose(t){return this.empty?t:t.empty?this:cj(this,t,!0)}map(t,n=!1){return t.empty?this:G1(this,t,n,!0)}iterChanges(t,n=!1){Y1(this,t,n)}get desc(){return Ki.create(this.sections)}filter(t){let n=[],r=[],i=[],a=new fh(this);e:for(let l=0,s=0;;){let c=l==t.length?1e9:t[l++];for(;s<c||s==c&&a.len==0;){if(a.done)break e;let d=Math.min(a.len,c-s);Tn(i,d,-1);let p=a.ins==-1?-1:a.off==0?a.ins:0;Tn(n,d,p),p>0&&zl(r,n,a.text),a.forward(d),s+=d}let f=t[l++];for(;s<f;){if(a.done)break e;let d=Math.min(a.len,f-s);Tn(n,d,-1),Tn(i,d,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(d),s+=d}}return{changes:new Qt(n,r),filtered:Ki.create(i)}}toJSON(){let t=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],i=this.sections[n+1];i<0?t.push(r):i==0?t.push([r]):t.push([r].concat(this.inserted[n>>1].toJSON()))}return t}static of(t,n,r){let i=[],a=[],l=0,s=null;function c(d=!1){if(!d&&!i.length)return;l<n&&Tn(i,n-l,-1);let p=new Qt(i,a);s=s?s.compose(p.map(s)):p,i=[],a=[],l=0}function f(d){if(Array.isArray(d))for(let p of d)f(p);else if(d instanceof Qt){if(d.length!=n)throw new RangeError(`Mismatched change set length (got ${d.length}, expected ${n})`);c(),s=s?s.compose(d.map(s)):d}else{let{from:p,to:g=p,insert:v}=d;if(p>g||p<0||g>n)throw new RangeError(`Invalid change range ${p} to ${g} (in doc of length ${n})`);let y=v?typeof v=="string"?Je.of(v.split(r||Q1)):v:Je.empty,x=y.length;if(p==g&&x==0)return;p<l&&c(),p>l&&Tn(i,p-l,-1),Tn(i,g-p,x),zl(a,i,y),l=g}}return f(t),c(!s),s}static empty(t){return new Qt(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;i<t.length;i++){let a=t[i];if(typeof a=="number")n.push(a,-1);else{if(!Array.isArray(a)||typeof a[0]!="number"||a.some((l,s)=>s&&typeof l!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(a.length==1)n.push(a[0],0);else{for(;r.length<i;)r.push(Je.empty);r[i]=Je.of(a.slice(1)),n.push(a[0],r[i].length)}}}return new Qt(n,r)}static createSet(t,n){return new Qt(t,n)}}function Tn(e,t,n,r=!1){if(t==0&&n<=0)return;let i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:i>=0&&t==0&&e[i]==0?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function zl(e,t,n){if(n.length==0)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(Je.empty);e.push(n)}}function Y1(e,t,n){let r=e.inserted;for(let i=0,a=0,l=0;l<e.sections.length;){let s=e.sections[l++],c=e.sections[l++];if(c<0)i+=s,a+=s;else{let f=i,d=a,p=Je.empty;for(;f+=s,d+=c,c&&r&&(p=p.append(r[l-2>>1])),!(n||l==e.sections.length||e.sections[l+1]<0);)s=e.sections[l++],c=e.sections[l++];t(i,f,a,d,p),i=f,a=d}}}function G1(e,t,n,r=!1){let i=[],a=r?[]:null,l=new fh(e),s=new fh(t);for(let c=-1;;){if(l.done&&s.len||s.done&&l.len)throw new Error("Mismatched change set lengths");if(l.ins==-1&&s.ins==-1){let f=Math.min(l.len,s.len);Tn(i,f,-1),l.forward(f),s.forward(f)}else if(s.ins>=0&&(l.ins<0||c==l.i||l.off==0&&(s.len<l.len||s.len==l.len&&!n))){let f=s.len;for(Tn(i,s.ins,-1);f;){let d=Math.min(l.len,f);l.ins>=0&&c<l.i&&l.len<=d&&(Tn(i,0,l.ins),a&&zl(a,i,l.text),c=l.i),l.forward(d),f-=d}s.next()}else if(l.ins>=0){let f=0,d=l.len;for(;d;)if(s.ins==-1){let p=Math.min(d,s.len);f+=p,d-=p,s.forward(p)}else if(s.ins==0&&s.len<d)d-=s.len,s.next();else break;Tn(i,f,c<l.i?l.ins:0),a&&c<l.i&&zl(a,i,l.text),c=l.i,l.forward(l.len-d)}else{if(l.done&&s.done)return a?Qt.createSet(i,a):Ki.create(i);throw new Error("Mismatched change set lengths")}}}function cj(e,t,n=!1){let r=[],i=n?[]:null,a=new fh(e),l=new fh(t);for(let s=!1;;){if(a.done&&l.done)return i?Qt.createSet(r,i):Ki.create(r);if(a.ins==0)Tn(r,a.len,0,s),a.next();else if(l.len==0&&!l.done)Tn(r,0,l.ins,s),i&&zl(i,r,l.text),l.next();else{if(a.done||l.done)throw new Error("Mismatched change set lengths");{let c=Math.min(a.len2,l.len),f=r.length;if(a.ins==-1){let d=l.ins==-1?-1:l.off?0:l.ins;Tn(r,c,d,s),i&&d&&zl(i,r,l.text)}else l.ins==-1?(Tn(r,a.off?0:a.len,c,s),i&&zl(i,r,a.textBit(c))):(Tn(r,a.off?0:a.len,l.off?0:l.ins,s),i&&!l.off&&zl(i,r,l.text));s=(a.ins>c||l.ins>=0&&l.len>c)&&(s||r.length>f),a.forward2(c),l.forward(c)}}}}class fh{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i<t.length?(this.len=t[this.i++],this.ins=t[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length?Je.empty:t[n]}textBit(t){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!t?Je.empty:n[r].slice(this.off,t==null?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class _l{constructor(t,n,r,i){this.from=t,this.to=n,this.flags=r,this.goalColumn=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let t=this.flags&7;return t==7?null:t}map(t,n=-1){let r,i;return this.empty?r=i=t.mapPos(this.from,n):(r=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new _l(r,i,this.flags,this.goalColumn)}extend(t,n=t,r=0){if(t<=this.anchor&&n>=this.anchor)return J.range(t,n,void 0,void 0,r);let i=Math.abs(t-this.anchor)>Math.abs(n-this.anchor)?t:n;return J.range(this.anchor,i,void 0,void 0,r)}eq(t,n=!1){return this.anchor==t.anchor&&this.head==t.head&&this.goalColumn==t.goalColumn&&(!n||!this.empty||this.assoc==t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return J.range(t.anchor,t.head)}static create(t,n,r,i){return new _l(t,n,r,i)}}class J{constructor(t,n){this.ranges=t,this.mainIndex=n}map(t,n=-1){return t.empty?this:J.create(this.ranges.map(r=>r.map(t,n)),this.mainIndex)}eq(t,n=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(t.ranges[r],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new J([this.main],0)}addRange(t,n=!0){return J.create([t].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(t,n=this.mainIndex){let r=this.ranges.slice();return r[n]=t,J.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(t=>t.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!="number"||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new J(t.ranges.map(n=>_l.fromJSON(n)),t.main)}static single(t,n=t){return new J([J.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;i<t.length;i++){let a=t[i];if(a.empty?a.from<=r:a.from<r)return J.normalized(t.slice(),n);r=a.to}return new J(t,n)}static cursor(t,n=0,r,i){return _l.create(t,t,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r)),i)}static range(t,n,r,i,a){let l=i==null?7:Math.min(6,i);return!a&&t!=n&&(a=n<t?1:-1),a&&(l|=a<0?8:16),n<t?_l.create(n,t,l|32,r):_l.create(t,n,l,r)}static undirectionalRange(t,n){return _l.create(t,n,64,void 0)}static normalized(t,n=0){let r=t[n];t.sort((i,a)=>i.from-a.from),n=t.indexOf(r);for(let i=1;i<t.length;i++){let a=t[i],l=t[i-1];if(a.empty?a.from<=l.to:a.from<l.to){let s=l.from,c=Math.max(a.to,l.to);i<=n&&n--,t.splice(--i,2,a.anchor>a.head?J.range(c,s):J.range(s,c))}}return new J(t,n)}}function fj(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let yO=0;class me{constructor(t,n,r,i,a){this.combine=t,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=yO++,this.default=t([]),this.extensions=typeof a=="function"?a(this):a}get reader(){return this}static define(t={}){return new me(t.combine||(n=>n),t.compareInput||((n,r)=>n===r),t.compare||(t.combine?(n,r)=>n===r:bO),!!t.static,t.enables)}of(t){return new _m([],this,0,t)}compute(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new _m(t,this,1,n)}computeN(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new _m(t,this,2,n)}from(t,n){return n||(n=r=>r),this.compute([t],r=>n(r.field(t)))}}function bO(e,t){return e==t||e.length==t.length&&e.every((n,r)=>n===t[r])}class _m{constructor(t,n,r,i){this.dependencies=t,this.facet=n,this.type=r,this.value=i,this.id=yO++}dynamicSlot(t){var n;let r=this.value,i=this.facet.compareInput,a=this.id,l=t[a]>>1,s=this.type==2,c=!1,f=!1,d=[];for(let p of this.dependencies)p=="doc"?c=!0:p=="selection"?f=!0:(((n=t[p.id])!==null&&n!==void 0?n:1)&1)==0&&d.push(t[p.id]);return{create(p){return p.values[l]=r(p),1},update(p,g){if(c&&g.docChanged||f&&(g.docChanged||g.selection)||Z1(p,d)){let v=r(p);if(s?!LM(v,p.values[l],i):!i(v,p.values[l]))return p.values[l]=v,1}return 0},reconfigure:(p,g)=>{let v,y=g.config.address[a];if(y!=null){let x=tg(g,y);if(this.dependencies.every(w=>w instanceof me?g.facet(w)===p.facet(w):w instanceof _n?g.field(w,!1)==p.field(w,!1):!0)||(s?LM(v=r(p),x,i):i(v=r(p),x)))return p.values[l]=x,0}else v=r(p);return p.values[l]=v,1}}}get extension(){return this}}function LM(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function Z1(e,t){let n=!1;for(let r of t)Vf(e,r)&1&&(n=!0);return n}function T7(e,t,n){let r=n.map(c=>e[c.id]),i=n.map(c=>c.type),a=r.filter(c=>!(c&1)),l=e[t.id]>>1;function s(c){let f=[];for(let d=0;d<r.length;d++){let p=tg(c,r[d]);if(i[d]==2)for(let g of p)f.push(g);else f.push(p)}return t.combine(f)}return{create(c){for(let f of r)Vf(c,f);return c.values[l]=s(c),1},update(c,f){if(!Z1(c,a))return 0;let d=s(c);return t.compare(d,c.values[l])?0:(c.values[l]=d,1)},reconfigure(c,f){let d=Z1(c,r),p=f.config.facets[t.id],g=f.facet(t);if(p&&!d&&bO(n,p))return c.values[l]=g,0;let v=s(c);return t.compare(v,g)?(c.values[l]=g,0):(c.values[l]=v,1)}}}const $p=me.define({static:!0});class _n{constructor(t,n,r,i,a){this.id=t,this.createF=n,this.updateF=r,this.compareF=i,this.spec=a,this.provides=void 0}static define(t){let n=new _n(yO++,t.create,t.update,t.compare||((r,i)=>r===i),t);return t.provide&&(n.provides=t.provide(n)),n}create(t){let n=t.facet($p).find(r=>r.field==this);return(n?.create||this.createF)(t)}slot(t){let n=t[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let a=r.values[n],l=this.updateF(a,i);return this.compareF(a,l)?0:(r.values[n]=l,1)},reconfigure:(r,i)=>{let a=r.facet($p),l=i.facet($p),s;return(s=a.find(c=>c.field==this))&&s!=l.find(c=>c.field==this)?(r.values[n]=s.create(r),1):i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}}init(t){return[this,$p.of({field:this,create:t})]}get extension(){return this}}const Lo={lowest:4,low:3,default:2,high:1,highest:0};function xf(e){return t=>new hj(t,e)}const gs={highest:xf(Lo.highest),high:xf(Lo.high),default:xf(Lo.default),low:xf(Lo.low),lowest:xf(Lo.lowest)};class hj{constructor(t,n){this.inner=t,this.prec=n}get extension(){return this}}class Pv{of(t){return new J1(this,t)}reconfigure(t){return Pv.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class J1{constructor(t,n){this.compartment=t,this.inner=n}get extension(){return this}}class eg{constructor(t,n,r,i,a,l){for(this.base=t,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=a,this.facets=l,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(t){let n=this.address[t.id];return n==null?t.default:this.staticValues[n>>1]}static resolve(t,n,r){let i=[],a=Object.create(null),l=new Map;for(let g of M7(t,n,l))g instanceof _n?i.push(g):(a[g.facet.id]||(a[g.facet.id]=[])).push(g);let s=Object.create(null),c=[],f=[];for(let g of i)s[g.id]=f.length<<1,f.push(v=>g.slot(v));let d=r?.config.facets;for(let g in a){let v=a[g],y=v[0].facet,x=d&&d[g]||[];if(v.every(w=>w.type==0))if(s[y.id]=c.length<<1|1,bO(x,v))c.push(r.facet(y));else{let w=y.combine(v.map(A=>A.value));c.push(r&&y.compare(w,r.facet(y))?r.facet(y):w)}else{for(let w of v)w.type==0?(s[w.id]=c.length<<1|1,c.push(w.value)):(s[w.id]=f.length<<1,f.push(A=>w.dynamicSlot(A)));s[y.id]=f.length<<1,f.push(w=>T7(w,y,v))}}let p=f.map(g=>g(s));return new eg(t,l,p,s,c,a)}}function M7(e,t,n){let r=[[],[],[],[],[]],i=new Map;function a(l,s){let c=i.get(l);if(c!=null){if(c<=s)return;let f=r[c].indexOf(l);f>-1&&r[c].splice(f,1),l instanceof J1&&n.delete(l.compartment)}if(i.set(l,s),Array.isArray(l))for(let f of l)a(f,s);else if(l instanceof J1){if(n.has(l.compartment))throw new RangeError("Duplicate use of compartment in extensions");let f=t.get(l.compartment)||l.inner;n.set(l.compartment,f),a(f,s)}else if(l instanceof hj)a(l.inner,l.prec);else if(l instanceof _n)r[s].push(l),l.provides&&a(l.provides,s);else if(l instanceof _m)r[s].push(l),l.facet.extensions&&a(l.facet.extensions,Lo.default);else{let f=l.extension;if(!f)throw new Error(`Unrecognized extension value in extension set (${l}).`);if(f==l)throw new Error(`Unrecognized extension value in extension set (${l}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(f,s)}}return a(e,Lo.default),r.reduce((l,s)=>l.concat(s))}function Vf(e,t){if(t&1)return 2;let n=t>>1,r=e.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function tg(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}const dj=me.define(),eS=me.define({combine:e=>e.some(t=>t),static:!0}),pj=me.define({combine:e=>e.length?e[0]:void 0,static:!0}),mj=me.define(),gj=me.define(),vj=me.define(),yj=me.define({combine:e=>e.length?e[0]:!1});class na{constructor(t,n){this.type=t,this.value=n}static define(){return new P7}}class P7{of(t){return new na(this,t)}}class D7{constructor(t){this.map=t}of(t){return new Re(this,t)}}class Re{constructor(t,n){this.type=t,this.value=n}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new Re(this.type,n)}is(t){return this.type==t}static define(t={}){return new D7(t.map||(n=>n))}static mapEffects(t,n){if(!t.length)return t;let r=[];for(let i of t){let a=i.map(n);a&&r.push(a)}return r}}Re.reconfigure=Re.define();Re.appendConfig=Re.define();class Gt{constructor(t,n,r,i,a,l){this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=a,this.scrollIntoView=l,this._doc=null,this._state=null,r&&fj(r,n.newLength),a.some(s=>s.type==Gt.time)||(this.annotations=a.concat(Gt.time.of(Date.now())))}static create(t,n,r,i,a,l){return new Gt(t,n,r,i,a,l)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let n of this.annotations)if(n.type==t)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let n=this.annotation(Gt.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]=="."))}}Gt.time=na.define();Gt.userEvent=na.define();Gt.addToHistory=na.define();Gt.remote=na.define();function R7(e,t){let n=[];for(let r=0,i=0;;){let a,l;if(r<e.length&&(i==t.length||t[i]>=e[r]))a=e[r++],l=e[r++];else if(i<t.length)a=t[i++],l=t[i++];else return n;!n.length||n[n.length-1]<a?n.push(a,l):n[n.length-1]<l&&(n[n.length-1]=l)}}function bj(e,t,n){var r;let i,a,l;return n?(i=t.changes,a=Qt.empty(t.changes.length),l=e.changes.compose(t.changes)):(i=t.changes.map(e.changes),a=e.changes.mapDesc(t.changes,!0),l=e.changes.compose(i)),{changes:l,selection:t.selection?t.selection.map(a):(r=e.selection)===null||r===void 0?void 0:r.map(i),effects:Re.mapEffects(e.effects,i).concat(Re.mapEffects(t.effects,a)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function tS(e,t,n){let r=t.selection,i=Pu(t.annotations);return t.userEvent&&(i=i.concat(Gt.userEvent.of(t.userEvent))),{changes:t.changes instanceof Qt?t.changes:Qt.of(t.changes||[],n,e.facet(pj)),selection:r&&(r instanceof J?r:J.single(r.anchor,r.head)),effects:Pu(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}function xj(e,t,n){let r=tS(e,t.length?t[0]:{},e.doc.length);t.length&&t[0].filter===!1&&(n=!1);for(let a=1;a<t.length;a++){t[a].filter===!1&&(n=!1);let l=!!t[a].sequential;r=bj(r,tS(e,t[a],l?r.changes.newLength:e.doc.length),l)}let i=Gt.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return N7(n?_7(i):i)}function _7(e){let t=e.startState,n=!0;for(let i of t.facet(mj)){let a=i(e);if(a===!1){n=!1;break}Array.isArray(a)&&(n=n===!0?a:R7(n,a))}if(n!==!0){let i,a;if(n===!1)a=e.changes.invertedDesc,i=Qt.empty(t.doc.length);else{let l=e.changes.filter(n);i=l.changes,a=l.filtered.mapDesc(l.changes).invertedDesc}e=Gt.create(t,i,e.selection&&e.selection.map(a),Re.mapEffects(e.effects,a),e.annotations,e.scrollIntoView)}let r=t.facet(gj);for(let i=r.length-1;i>=0;i--){let a=r[i](e);a instanceof Gt?e=a:Array.isArray(a)&&a.length==1&&a[0]instanceof Gt?e=a[0]:e=xj(t,Pu(a),!1)}return e}function N7(e){let t=e.startState,n=t.facet(vj),r=e;for(let i=n.length-1;i>=0;i--){let a=n[i](e);a&&Object.keys(a).length&&(r=bj(r,tS(t,a,e.changes.newLength),!0))}return r==e?e:Gt.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}const I7=[];function Pu(e){return e==null?I7:Array.isArray(e)?e:[e]}var Ot=(function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e})(Ot||(Ot={}));const L7=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let nS;try{nS=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function j7(e){if(nS)return nS.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||L7.test(n)))return!0}return!1}function B7(e){return t=>{if(!/\S/.test(t))return Ot.Space;if(j7(t))return Ot.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return Ot.Word;return Ot.Other}}class qe{constructor(t,n,r,i,a,l){this.config=t,this.doc=n,this.selection=r,this.values=i,this.status=t.statusTemplate.slice(),this.computeSlot=a,l&&(l._state=this);for(let s=0;s<this.config.dynamicSlots.length;s++)Vf(this,s<<1);this.computeSlot=null}field(t,n=!0){let r=this.config.address[t.id];if(r==null){if(n)throw new RangeError("Field is not present in this state");return}return Vf(this,r),tg(this,r)}update(...t){return xj(this,t,!0)}applyTransaction(t){let n=this.config,{base:r,compartments:i}=n;for(let s of t.effects)s.is(Pv.reconfigure)?(n&&(i=new Map,n.compartments.forEach((c,f)=>i.set(f,c)),n=null),i.set(s.value.compartment,s.value.extension)):s.is(Re.reconfigure)?(n=null,r=s.value):s.is(Re.appendConfig)&&(n=null,r=Pu(r).concat(s.value));let a;n?a=t.startState.values.slice():(n=eg.resolve(r,i,this),a=new qe(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(c,f)=>f.reconfigure(c,this),null).values);let l=t.startState.facet(eS)?t.newSelection:t.newSelection.asSingle();new qe(n,t.newDoc,l,a,(s,c)=>c.update(s,t),t)}replaceSelection(t){return typeof t=="string"&&(t=this.toText(t)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:t},range:J.cursor(n.from+t.length)}))}changeByRange(t){let n=this.selection,r=t(n.ranges[0]),i=this.changes(r.changes),a=[r.range],l=Pu(r.effects);for(let s=1;s<n.ranges.length;s++){let c=t(n.ranges[s]),f=this.changes(c.changes),d=f.map(i);for(let g=0;g<s;g++)a[g]=a[g].map(d);let p=i.mapDesc(f,!0);a.push(c.range.map(p)),i=i.compose(d),l=Re.mapEffects(l,d).concat(Re.mapEffects(Pu(c.effects),p))}return{changes:i,selection:J.create(a,n.mainIndex),effects:l}}changes(t=[]){return t instanceof Qt?t:Qt.of(t,this.doc.length,this.facet(qe.lineSeparator))}toText(t){return Je.of(t.split(this.facet(qe.lineSeparator)||Q1))}sliceDoc(t=0,n=this.doc.length){return this.doc.sliceString(t,n,this.lineBreak)}facet(t){let n=this.config.address[t.id];return n==null?t.default:(Vf(this,n),tg(this,n))}toJSON(t){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(t)for(let r in t){let i=t[r];i instanceof _n&&this.config.address[i.id]!=null&&(n[r]=i.spec.toJSON(this.field(t[r]),this))}return n}static fromJSON(t,n={},r){if(!t||typeof t.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(r){for(let a in r)if(Object.prototype.hasOwnProperty.call(t,a)){let l=r[a],s=t[a];i.push(l.init(c=>l.spec.fromJSON(s,c)))}}return qe.create({doc:t.doc,selection:J.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(t={}){let n=eg.resolve(t.extensions||[],new Map),r=t.doc instanceof Je?t.doc:Je.of((t.doc||"").split(n.staticFacet(qe.lineSeparator)||Q1)),i=t.selection?t.selection instanceof J?t.selection:J.single(t.selection.anchor,t.selection.head):J.single(0);return fj(i,r.length),n.staticFacet(eS)||(i=i.asSingle()),new qe(n,r,i,n.dynamicSlots.map(()=>null),(a,l)=>l.create(a),null)}get tabSize(){return this.facet(qe.tabSize)}get lineBreak(){return this.facet(qe.lineSeparator)||`
|
|
59
|
+
`}get readOnly(){return this.facet(yj)}phrase(t,...n){for(let r of this.facet(qe.phrases))if(Object.prototype.hasOwnProperty.call(r,t)){t=r[t];break}return n.length&&(t=t.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let a=+(i||1);return!a||a>n.length?r:n[a-1]})),t}languageDataAt(t,n,r=-1){let i=[];for(let a of this.facet(dj))for(let l of a(this,n,r))Object.prototype.hasOwnProperty.call(l,t)&&i.push(l[t]);return i}charCategorizer(t){let n=this.languageDataAt("wordChars",t);return B7(n.length?n[0]:"")}wordAt(t){let{text:n,from:r,length:i}=this.doc.lineAt(t),a=this.charCategorizer(t),l=t-r,s=t-r;for(;l>0;){let c=on(n,l,!1);if(a(n.slice(c,l))!=Ot.Word)break;l=c}for(;s<i;){let c=on(n,s);if(a(n.slice(s,c))!=Ot.Word)break;s=c}return l==s?null:J.range(l+r,s+r)}}qe.allowMultipleSelections=eS;qe.tabSize=me.define({combine:e=>e.length?e[0]:4});qe.lineSeparator=pj;qe.readOnly=yj;qe.phrases=me.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(i=>e[i]==t[i])}});qe.languageData=dj;qe.changeFilter=mj;qe.transactionFilter=gj;qe.transactionExtender=vj;Pv.reconfigure=Re.define();function ra(e,t,n={}){let r={};for(let i of e)for(let a of Object.keys(i)){let l=i[a],s=r[a];if(s===void 0)r[a]=l;else if(!(s===l||l===void 0))if(Object.hasOwnProperty.call(n,a))r[a]=n[a](s,l);else throw new Error("Config merge conflict for field "+a)}for(let i in t)r[i]===void 0&&(r[i]=t[i]);return r}class Kl{eq(t){return this==t}range(t,n=t){return rS.create(t,n,this)}}Kl.prototype.startSide=Kl.prototype.endSide=0;Kl.prototype.point=!1;Kl.prototype.mapMode=Fn.TrackDel;function xO(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}let rS=class Sj{constructor(t,n,r){this.from=t,this.to=n,this.value=r}static create(t,n,r){return new Sj(t,n,r)}};function iS(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class SO{constructor(t,n,r,i){this.from=t,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(t,n,r,i=0){let a=r?this.to:this.from;for(let l=i,s=a.length;;){if(l==s)return l;let c=l+s>>1,f=a[c]-t||(r?this.value[c].endSide:this.value[c].startSide)-n;if(c==l)return f>=0?l:s;f>=0?s=c:l=c+1}}between(t,n,r,i){for(let a=this.findIndex(n,-1e9,!0),l=this.findIndex(r,1e9,!1,a);a<l;a++)if(i(this.from[a]+t,this.to[a]+t,this.value[a])===!1)return!1}map(t,n){let r=[],i=[],a=[],l=-1,s=-1;for(let c=0;c<this.value.length;c++){let f=this.value[c],d=this.from[c]+t,p=this.to[c]+t,g,v;if(d==p){let y=n.mapPos(d,f.startSide,f.mapMode);if(y==null||(g=v=y,f.startSide!=f.endSide&&(v=n.mapPos(d,f.endSide),v<g)))continue}else if(g=n.mapPos(d,f.startSide),v=n.mapPos(p,f.endSide),g>v||g==v&&f.startSide>0&&f.endSide<=0)continue;(v-g||f.endSide-f.startSide)<0||(l<0&&(l=g),f.point&&(s=Math.max(s,v-g)),r.push(f),i.push(g-l),a.push(v-l))}return{mapped:r.length?new SO(i,a,r,s):null,pos:l}}}class ze{constructor(t,n,r,i){this.chunkPos=t,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(t,n,r,i){return new ze(t,n,r,i)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let n of this.chunk)t+=n.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:a=this.length}=t,l=t.filter;if(n.length==0&&!l)return this;if(r&&(n=n.slice().sort(iS)),this.isEmpty)return n.length?ze.of(n):this;let s=new wj(this,null,-1).goto(0),c=0,f=[],d=new $a;for(;s.value||c<n.length;)if(c<n.length&&(s.from-n[c].from||s.startSide-n[c].value.startSide)>=0){let p=n[c++];d.addInner(p.from,p.to,p.value)||f.push(p)}else s.rangeIndex==1&&s.chunkIndex<this.chunk.length&&(c==n.length||this.chunkEnd(s.chunkIndex)<n[c].from)&&(!l||i>this.chunkEnd(s.chunkIndex)||a<this.chunkPos[s.chunkIndex])&&d.addChunk(this.chunkPos[s.chunkIndex],this.chunk[s.chunkIndex])?s.nextChunk():((!l||i>s.to||a<s.from||l(s.from,s.to,s.value))&&(d.addInner(s.from,s.to,s.value)||f.push(rS.create(s.from,s.to,s.value))),s.next());return d.finishInner(this.nextLayer.isEmpty&&!f.length?ze.empty:this.nextLayer.update({add:f,filter:l,filterFrom:i,filterTo:a}))}map(t){if(t.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let l=0;l<this.chunk.length;l++){let s=this.chunkPos[l],c=this.chunk[l],f=t.touchesRange(s,s+c.length);if(f===!1)i=Math.max(i,c.maxPoint),n.push(c),r.push(t.mapPos(s));else if(f===!0){let{mapped:d,pos:p}=c.map(s,t);d&&(i=Math.max(i,d.maxPoint),n.push(d),r.push(p))}}let a=this.nextLayer.map(t);return n.length==0?a:new ze(r,n,a||ze.empty,i)}between(t,n,r){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let a=this.chunkPos[i],l=this.chunk[i];if(n>=a&&t<=a+l.length&&l.between(a,t-a,n-a,r)===!1)return}this.nextLayer.between(t,n,r)}}iter(t=0){return hh.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,n=0){return hh.from(t).goto(n)}static compare(t,n,r,i,a=-1){let l=t.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=a),s=n.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=a),c=jM(l,s,r),f=new Sf(l,c,a),d=new Sf(s,c,a);r.iterGaps((p,g,v)=>BM(f,p,d,g,v,i)),r.empty&&r.length==0&&BM(f,0,d,0,0,i)}static eq(t,n,r=0,i){i==null&&(i=999999999);let a=t.filter(d=>!d.isEmpty&&n.indexOf(d)<0),l=n.filter(d=>!d.isEmpty&&t.indexOf(d)<0);if(a.length!=l.length)return!1;if(!a.length)return!0;let s=jM(a,l),c=new Sf(a,s,0).goto(r),f=new Sf(l,s,0).goto(r);for(;;){if(c.to!=f.to||!aS(c.active,f.active)||c.point&&(!f.point||!xO(c.point,f.point)))return!1;if(c.to>i)return!0;c.next(),f.next()}}static spans(t,n,r,i,a=-1){let l=new Sf(t,null,a).goto(n),s=n,c=l.openStart;for(;;){let f=Math.min(l.to,r);if(l.point){let d=l.activeForPoint(l.to),p=l.pointFrom<n?d.length+1:l.point.startSide<0?d.length:Math.min(d.length,c);i.point(s,f,l.point,d,p,l.pointRank),c=Math.min(l.openEnd(f),d.length)}else f>s&&(i.span(s,f,l.active,c),c=l.openEnd(f));if(l.to>r)return c+(l.point&&l.to>r?1:0);s=l.to,l.next()}}static of(t,n=!1){let r=new $a;for(let i of t instanceof rS?[t]:n?z7(t):t)r.add(i.from,i.to,i.value);return r.finish()}static join(t){if(!t.length)return ze.empty;let n=t[t.length-1];for(let r=t.length-2;r>=0;r--)for(let i=t[r];i!=ze.empty;i=i.nextLayer)n=new ze(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}ze.empty=new ze([],[],null,-1);function z7(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(iS(t,r)>0)return e.slice().sort(iS);t=r}return e}ze.empty.nextLayer=ze.empty;class $a{finishChunk(t){this.chunks.push(new SO(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,n,r){this.addInner(t,n,r)||(this.nextLayer||(this.nextLayer=new $a)).add(t,n,r)}addInner(t,n,r){let i=t-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(t-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=t,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-t)),!0)}addChunk(t,n){if((t-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(t);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+t,this.lastTo=n.to[r]+t,!0}finish(){return this.finishInner(ze.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let n=ze.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,n}}function jM(e,t,n){let r=new Map;for(let a of e)for(let l=0;l<a.chunk.length;l++)a.chunk[l].maxPoint<=0&&r.set(a.chunk[l],a.chunkPos[l]);let i=new Set;for(let a of t)for(let l=0;l<a.chunk.length;l++){let s=r.get(a.chunk[l]);s!=null&&(n?n.mapPos(s):s)==a.chunkPos[l]&&!n?.touchesRange(s,s+a.chunk[l].length)&&i.add(a.chunk[l])}return i}class wj{constructor(t,n,r,i=0){this.layer=t,this.skip=n,this.minPoint=r,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(t,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(t,n,!1),this}gotoInner(t,n,r){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<t||i.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(t-this.layer.chunkPos[this.chunkIndex],n,!0);(!r||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(t,n){(this.to-t||this.endSide-n)<0&&this.gotoInner(t,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let t=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],r=t+n.from[this.rangeIndex];if(this.from=r,this.to=t+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=t}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(t){return this.from-t.from||this.startSide-t.startSide||this.rank-t.rank||this.to-t.to||this.endSide-t.endSide}}class hh{constructor(t){this.heap=t}static from(t,n=null,r=-1){let i=[];for(let a=0;a<t.length;a++)for(let l=t[a];!l.isEmpty;l=l.nextLayer)l.maxPoint>=r&&i.push(new wj(l,n,r,a));return i.length==1?i[0]:new hh(i)}get startSide(){return this.value?this.value.startSide:0}goto(t,n=-1e9){for(let r of this.heap)r.goto(t,n);for(let r=this.heap.length>>1;r>=0;r--)px(this.heap,r);return this.next(),this}forward(t,n){for(let r of this.heap)r.forward(t,n);for(let r=this.heap.length>>1;r>=0;r--)px(this.heap,r);(this.to-t||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),px(this.heap,0)}}}function px(e,t){for(let n=e[t];;){let r=(t<<1)+1;if(r>=e.length)break;let i=e[r];if(r+1<e.length&&i.compare(e[r+1])>=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}class Sf{constructor(t,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=hh.from(t,n,r)}goto(t,n=-1e9){return this.cursor.goto(t,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=n,this.openStart=-1,this.next(),this}forward(t,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(t,n)}removeActive(t){Hp(this.active,t),Hp(this.activeTo,t),Hp(this.activeRank,t),this.minActive=zM(this.active,this.activeTo)}addActive(t){let n=0,{value:r,to:i,rank:a}=this.cursor;for(;n<this.activeRank.length&&(a-this.activeRank[n]||i-this.activeTo[n])>0;)n++;Up(this.active,n,r),Up(this.activeTo,n,i),Up(this.activeRank,n,a),t&&Up(t,n,this.cursor.from),this.minActive=zM(this.active,this.activeTo)}next(){let t=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>t){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&Hp(r,i)}else if(this.cursor.value)if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let a=this.cursor.value;if(!a.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=a,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=a.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let i=r.length-1;i>=0&&r[i]<t;i--)this.openStart++}}activeForPoint(t){if(!this.active.length)return this.active;let n=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>t||this.activeTo[r]==t&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(t){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>t;r--)n++;return n}}function BM(e,t,n,r,i,a){e.goto(t),n.goto(r);let l=r+i,s=r,c=r-t,f=!!a.boundChange;for(let d=!1;;){let p=e.to+c-n.to,g=p||e.endSide-n.endSide,v=g<0?e.to+c:n.to,y=Math.min(v,l);if(e.point||n.point?(e.point&&n.point&&xO(e.point,n.point)&&aS(e.activeForPoint(e.to),n.activeForPoint(n.to))||a.comparePoint(s,y,e.point,n.point),d=!1):(d&&a.boundChange(s),y>s&&!aS(e.active,n.active)&&a.compareRange(s,y,e.active,n.active),f&&y<l&&(p||e.openEnd(v)!=n.openEnd(v))&&(d=!0)),v>l)break;s=v,g<=0&&e.next(),g>=0&&n.next()}}function aS(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!xO(e[n],t[n]))return!1;return!0}function Hp(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function Up(e,t,n){for(let r=e.length-1;r>=t;r--)e[r+1]=e[r];e[t]=n}function zM(e,t){let n=-1,r=1e9;for(let i=0;i<t.length;i++)(t[i]-r||e[i].endSide-e[n].endSide)<0&&(n=i,r=t[i]);return n}function cc(e,t,n=e.length){let r=0;for(let i=0;i<n&&i<e.length;)e.charCodeAt(i)==9?(r+=t-r%t,i++):(r++,i=on(e,i));return r}function lS(e,t,n,r){for(let i=0,a=0;;){if(a>=t)return i;if(i==e.length)break;a+=e.charCodeAt(i)==9?n-a%n:1,i=on(e,i)}return r===!0?-1:e.length}const oS="ͼ",$M=typeof Symbol>"u"?"__"+oS:Symbol.for(oS),sS=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),HM=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Xl{constructor(t,n){this.rules=[];let{finish:r}=n||{};function i(l){return/^@/.test(l)?[l]:l.split(/,\s*/)}function a(l,s,c,f){let d=[],p=/^@(\w+)\b/.exec(l[0]),g=p&&p[1]=="keyframes";if(p&&s==null)return c.push(l[0]+";");for(let v in s){let y=s[v];if(/&/.test(v))a(v.split(/,\s*/).map(x=>l.map(w=>x.replace(/&/,w))).reduce((x,w)=>x.concat(w)),y,c);else if(y&&typeof y=="object"){if(!p)throw new RangeError("The value of a property ("+v+") should be a primitive value.");a(i(v),y,d,g)}else y!=null&&d.push(v.replace(/_.*/,"").replace(/[A-Z]/g,x=>"-"+x.toLowerCase())+": "+y+";")}(d.length||g)&&c.push((r&&!p&&!f?l.map(r):l).join(", ")+" {"+d.join(" ")+"}")}for(let l in t)a(i(l),t[l],this.rules)}getRules(){return this.rules.join(`
|
|
60
|
+
`)}static newName(){let t=HM[$M]||1;return HM[$M]=t+1,oS+t.toString(36)}static mount(t,n,r){let i=t[sS],a=r&&r.nonce;i?a&&i.setNonce(a):i=new $7(t,a),i.mount(Array.isArray(n)?n:[n],t)}}let UM=new Map;class $7{constructor(t,n){let r=t.ownerDocument||t,i=r.defaultView;if(!t.head&&t.adoptedStyleSheets&&i.CSSStyleSheet){let a=UM.get(r);if(a)return t[sS]=a;this.sheet=new i.CSSStyleSheet,UM.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],t[sS]=this}mount(t,n){let r=this.sheet,i=0,a=0;for(let l=0;l<t.length;l++){let s=t[l],c=this.modules.indexOf(s);if(c<a&&c>-1&&(this.modules.splice(c,1),a--,c=-1),c==-1){if(this.modules.splice(a++,0,s),r)for(let f=0;f<s.rules.length;f++)r.insertRule(s.rules[f],i++)}else{for(;a<c;)i+=this.modules[a++].rules.length;i+=s.rules.length,a++}}if(r)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let l="";for(let c=0;c<this.modules.length;c++)l+=this.modules[c].getRules()+`
|
|
61
|
+
`;this.styleTag.textContent=l;let s=n.head||n;this.styleTag.parentNode!=s&&s.insertBefore(this.styleTag,s.firstChild)}}setNonce(t){this.styleTag&&this.styleTag.getAttribute("nonce")!=t&&this.styleTag.setAttribute("nonce",t)}}var Ql={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:"'"},dh={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},H7=typeof navigator<"u"&&/Mac/.test(navigator.platform),U7=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var On=0;On<10;On++)Ql[48+On]=Ql[96+On]=String(On);for(var On=1;On<=24;On++)Ql[On+111]="F"+On;for(var On=65;On<=90;On++)Ql[On]=String.fromCharCode(On+32),dh[On]=String.fromCharCode(On);for(var mx in Ql)dh.hasOwnProperty(mx)||(dh[mx]=Ql[mx]);function F7(e){var t=H7&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||U7&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?dh:Ql)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function ot(){var e=arguments[0];typeof e=="string"&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i=="string"?e.setAttribute(r,i):i!=null&&(e[r]=i)}t++}for(;t<arguments.length;t++)Oj(e,arguments[t]);return e}function Oj(e,t){if(typeof t=="string")e.appendChild(document.createTextNode(t));else if(t!=null)if(t.nodeType!=null)e.appendChild(t);else if(Array.isArray(t))for(var n=0;n<t.length;n++)Oj(e,t[n]);else throw new RangeError("Unsupported child node: "+t)}let Hn=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},uS=typeof document<"u"?document:{documentElement:{style:{}}};const cS=/Edge\/(\d+)/.exec(Hn.userAgent),Aj=/MSIE \d/.test(Hn.userAgent),fS=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Hn.userAgent),Dv=!!(Aj||fS||cS),FM=!Dv&&/gecko\/(\d+)/i.test(Hn.userAgent),gx=!Dv&&/Chrome\/(\d+)/.exec(Hn.userAgent),qM="webkitFontSmoothing"in uS.documentElement.style,hS=!Dv&&/Apple Computer/.test(Hn.vendor),WM=hS&&(/Mobile\/\w+/.test(Hn.userAgent)||Hn.maxTouchPoints>2);var pe={mac:WM||/Mac/.test(Hn.platform),windows:/Win/.test(Hn.platform),linux:/Linux|X11/.test(Hn.platform),ie:Dv,ie_version:Aj?uS.documentMode||6:fS?+fS[1]:cS?+cS[1]:0,gecko:FM,gecko_version:FM?+(/Firefox\/(\d+)/.exec(Hn.userAgent)||[0,0])[1]:0,chrome:!!gx,chrome_version:gx?+gx[1]:0,ios:WM,android:/Android\b/.test(Hn.userAgent),webkit:qM,webkit_version:qM?+(/\bAppleWebKit\/(\d+)/.exec(Hn.userAgent)||[0,0])[1]:0,safari:hS,safari_version:hS?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Hn.userAgent)||[0,0])[1]:0,tabSize:uS.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function wO(e,t){for(let n in e)n=="class"&&t.class?t.class+=" "+e.class:n=="style"&&t.style?t.style+=";"+e.style:t[n]=e[n];return t}const ng=Object.create(null);function OO(e,t,n){if(e==t)return!0;e||(e=ng),t||(t=ng);let r=Object.keys(e),i=Object.keys(t);if(r.length-0!=i.length-0)return!1;for(let a of r)if(a!=n&&(i.indexOf(a)==-1||e[a]!==t[a]))return!1;return!0}function q7(e,t){for(let n=e.attributes.length-1;n>=0;n--){let r=e.attributes[n].name;t[r]==null&&e.removeAttribute(r)}for(let n in t){let r=t[n];n=="style"?e.style.cssText=r:e.getAttribute(n)!=r&&e.setAttribute(n,r)}}function VM(e,t,n){let r=!1;if(t)for(let i in t)n&&i in n||(r=!0,i=="style"?e.style.cssText="":e.removeAttribute(i));if(n)for(let i in n)t&&t[i]==n[i]||(r=!0,i=="style"?e.style.cssText=n[i]:e.setAttribute(i,n[i]));return r}function W7(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let r=e.attributes[n];t[r.name]=r.value}return t}class ia{eq(t){return!1}updateDOM(t,n,r){return!1}compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(t){return!0}coordsAt(t,n,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(t){}}var kn=(function(e){return e[e.Text=0]="Text",e[e.WidgetBefore=1]="WidgetBefore",e[e.WidgetAfter=2]="WidgetAfter",e[e.WidgetRange=3]="WidgetRange",e})(kn||(kn={}));class Ce extends Kl{constructor(t,n,r,i){super(),this.startSide=t,this.endSide=n,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(t){return new Fh(t)}static widget(t){let n=Math.max(-1e4,Math.min(1e4,t.side||0)),r=!!t.block;return n+=r&&!t.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new as(t,n,n,r,t.widget||null,!1)}static replace(t){let n=!!t.block,r,i;if(t.isBlockGap)r=-5e8,i=4e8;else{let{start:a,end:l}=kj(t,n);r=(a?n?-3e8:-1:5e8)-1,i=(l?n?2e8:1:-6e8)+1}return new as(t,r,i,n,t.widget||null,!0)}static line(t){return new qh(t)}static set(t,n=!1){return ze.of(t,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Ce.none=ze.empty;class Fh extends Ce{constructor(t){let{start:n,end:r}=kj(t);super(n?-1:5e8,r?1:-6e8,null,t),this.tagName=t.tagName||"span",this.attrs=t.class&&t.attributes?wO(t.attributes,{class:t.class}):t.class?{class:t.class}:t.attributes||ng}eq(t){return this==t||t instanceof Fh&&this.tagName==t.tagName&&OO(this.attrs,t.attrs)}range(t,n=t){if(t>=n)throw new RangeError("Mark decorations may not be empty");return super.range(t,n)}}Fh.prototype.point=!1;class qh extends Ce{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof qh&&this.spec.class==t.spec.class&&OO(this.spec.attributes,t.spec.attributes)}range(t,n=t){if(n!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,n)}}qh.prototype.mapMode=Fn.TrackBefore;qh.prototype.point=!0;class as extends Ce{constructor(t,n,r,i,a,l){super(n,r,a,t),this.block=i,this.isReplace=l,this.mapMode=i?n<=0?Fn.TrackBefore:Fn.TrackAfter:Fn.TrackDel}get type(){return this.startSide!=this.endSide?kn.WidgetRange:this.startSide<=0?kn.WidgetBefore:kn.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof as&&V7(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,n=t){if(this.isReplace&&(t>n||t==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,n)}}as.prototype.point=!0;function kj(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return n==null&&(n=e.inclusive),r==null&&(r=e.inclusive),{start:n??t,end:r??t}}function V7(e,t){return e==t||!!(e&&t&&e.compare(t))}function Du(e,t,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}class ph extends Kl{constructor(t,n,r){super(),this.tagName=t,this.attributes=n,this.rank=r}eq(t){return t==this||t instanceof ph&&this.tagName==t.tagName&&OO(this.attributes,t.attributes)}static create(t){return new ph(t.tagName,t.attributes||ng,t.rank==null?50:Math.max(0,Math.min(t.rank,100)))}static set(t,n=!1){return ze.of(t,n)}}ph.prototype.startSide=ph.prototype.endSide=-1;function mh(e){let t;return e.nodeType==11?t=e.getSelection?e:e.ownerDocument:t=e,t.getSelection()}function dS(e,t){return t?e==t||e.contains(t.nodeType!=1?t.parentNode:t):!1}function Kf(e,t){if(!t.anchorNode)return!1;try{return dS(e,t.anchorNode)}catch{return!1}}function Xf(e){return e.nodeType==3?vh(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function Qf(e,t,n,r){return n?KM(e,t,n,r,-1)||KM(e,t,n,r,1):!1}function Yl(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function rg(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function KM(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Ha(e))){if(e.nodeName=="DIV")return!1;let a=e.parentNode;if(!a||a.nodeType!=1)return!1;t=Yl(e)+(i<0?0:1),e=a}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.nodeType==1&&e.contentEditable=="false")return!1;t=i<0?Ha(e):0}else return!1}}function Ha(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function gh(e,t){let{left:n,right:r}=e;if(n==r)return e;let i=t?n:r;return{left:i,right:i,top:e.top,bottom:e.bottom}}function K7(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function Cj(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(t.height-e.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function X7(e,t,n,r,i,a,l,s){let c=e.ownerDocument,f=c.defaultView||window;for(let d=e,p=!1;d&&!p;)if(d.nodeType==1){let g,v=d==c.body,y=1,x=1;if(v)g=K7(f);else{if(/^(fixed|sticky)$/.test(getComputedStyle(d).position)&&(p=!0),d.scrollHeight<=d.clientHeight&&d.scrollWidth<=d.clientWidth){d=d.assignedSlot||d.parentNode;continue}let k=d.getBoundingClientRect();({scaleX:y,scaleY:x}=Cj(d,k)),g={left:k.left,right:k.left+d.clientWidth*y,top:k.top,bottom:k.top+d.clientHeight*x}}let w=0,A=0;if(i=="nearest")t.top<g.top+l?(A=t.top-(g.top+l),n>0&&t.bottom>g.bottom+A&&(A=t.bottom-g.bottom+l)):t.bottom>g.bottom-l&&(A=t.bottom-g.bottom+l,n<0&&t.top-A<g.top&&(A=t.top-(g.top+l)));else{let k=t.bottom-t.top,E=g.bottom-g.top;A=(i=="center"&&k<=E?t.top+k/2-E/2:i=="start"||i=="center"&&n<0?t.top-l:t.bottom-E+l)-g.top}if(r=="nearest"?t.left<g.left+a?(w=t.left-(g.left+a),n>0&&t.right>g.right+w&&(w=t.right-g.right+a)):t.right>g.right-a&&(w=t.right-g.right+a,n<0&&t.left<g.left+w&&(w=t.left-(g.left+a))):w=(r=="center"?t.left+(t.right-t.left)/2-(g.right-g.left)/2:r=="start"==s?t.left-a:t.right-(g.right-g.left)+a)-g.left,w||A)if(v)f.scrollBy(w,A);else{let k=0,E=0;if(A){let P=d.scrollTop;d.scrollTop+=A/x,E=(d.scrollTop-P)*x}if(w){let P=d.scrollLeft;d.scrollLeft+=w/y,k=(d.scrollLeft-P)*y}t={left:t.left-k,top:t.top-E,right:t.right-k,bottom:t.bottom-E},k&&Math.abs(k-w)<1&&(r="nearest"),E&&Math.abs(E-A)<1&&(i="nearest")}if(v)break;(t.top<g.top||t.bottom>g.bottom||t.left<g.left||t.right>g.right)&&(t={left:Math.max(t.left,g.left),right:Math.min(t.right,g.right),top:Math.max(t.top,g.top),bottom:Math.min(t.bottom,g.bottom)}),d=d.assignedSlot||d.parentNode}else if(d.nodeType==11)d=d.host;else break}function Ej(e,t=!0){let n=e.ownerDocument,r=null,i=null;for(let a=e.parentNode;a&&!(a==n.body||(!t||r)&&i);)if(a.nodeType==1)!i&&a.scrollHeight>a.clientHeight&&(i=a),t&&!r&&a.scrollWidth>a.clientWidth&&(r=a),a=a.assignedSlot||a.parentNode;else if(a.nodeType==11)a=a.host;else break;return{x:r,y:i}}class Q7{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:n,focusNode:r}=t;this.set(n,Math.min(t.anchorOffset,n?Ha(n):0),r,Math.min(t.focusOffset,r?Ha(r):0))}set(t,n,r,i){this.anchorNode=t,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let _o=null;pe.safari&&pe.safari_version>=26&&(_o=!1);function Tj(e){if(e.setActive)return e.setActive();if(_o)return e.focus(_o);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(_o==null?{get preventScroll(){return _o={preventScroll:!0},!0}}:void 0),!_o){_o=!1;for(let n=0;n<t.length;){let r=t[n++],i=t[n++],a=t[n++];r.scrollTop!=i&&(r.scrollTop=i),r.scrollLeft!=a&&(r.scrollLeft=a)}}}let XM;function vh(e,t,n=t){let r=XM||(XM=document.createRange());return r.setEnd(e,n),r.setStart(e,t),r}function Ru(e,t,n,r){let i={key:t,code:t,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let a=new KeyboardEvent("keydown",i);a.synthetic=!0,e.dispatchEvent(a);let l=new KeyboardEvent("keyup",i);return l.synthetic=!0,e.dispatchEvent(l),a.defaultPrevented||l.defaultPrevented}function Y7(e){for(;e;){if(e&&(e.nodeType==9||e.nodeType==11&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}function G7(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,Ha(n));;)if(r){if(n.nodeType!=1)return!1;let i=n.childNodes[r-1];i.contentEditable=="false"?r--:(n=i,r=Ha(n))}else{if(n==e)return!0;r=Yl(n),n=n.parentNode}}function Mj(e){return e instanceof Window?e.pageYOffset>Math.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function Pj(e,t){for(let n=e,r=t;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=Ha(n)}else if(n.parentNode&&!rg(n))r=Yl(n),n=n.parentNode;else return null}}function Dj(e,t){for(let n=e,r=t;;){if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!rg(n))r=Yl(n)+1,n=n.parentNode;else return null}}class di{constructor(t,n,r=!0){this.node=t,this.offset=n,this.precise=r}static before(t,n){return new di(t.parentNode,Yl(t),n)}static after(t,n){return new di(t.parentNode,Yl(t)+1,n)}}var ft=(function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e})(ft||(ft={}));const ls=ft.LTR,AO=ft.RTL;function Rj(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<+e[n]);return t}const Z7=Rj("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),J7=Rj("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),pS=Object.create(null),Pi=[];for(let e of["()","[]","{}"]){let t=e.charCodeAt(0),n=e.charCodeAt(1);pS[t]=n,pS[n]=-t}function _j(e){return e<=247?Z7[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?J7[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}const eK=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Ui{get dir(){return this.level%2?AO:ls}constructor(t,n,r){this.from=t,this.to=n,this.level=r}side(t,n){return this.dir==n==t?this.to:this.from}forward(t,n){return t==(this.dir==n)}static find(t,n,r,i){let a=-1;for(let l=0;l<t.length;l++){let s=t[l];if(s.from<=n&&s.to>=n){if(s.level==r)return l;(a<0||(i!=0?i<0?s.from<n:s.to>n:t[a].level>s.level))&&(a=l)}}if(a<0)throw new RangeError("Index out of range");return a}}function Nj(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!Nj(r.inner,i.inner))return!1}return!0}const ct=[];function tK(e,t,n,r,i){for(let a=0;a<=r.length;a++){let l=a?r[a-1].to:t,s=a<r.length?r[a].from:n,c=a?256:i;for(let f=l,d=c,p=c;f<s;f++){let g=_j(e.charCodeAt(f));g==512?g=d:g==8&&p==4&&(g=16),ct[f]=g==4?2:g,g&7&&(p=g),d=g}for(let f=l,d=c,p=c;f<s;f++){let g=ct[f];if(g==128)f<s-1&&d==ct[f+1]&&d&24?g=ct[f]=d:ct[f]=256;else if(g==64){let v=f+1;for(;v<s&&ct[v]==64;)v++;let y=f&&d==8||v<n&&ct[v]==8?p==1?1:8:256;for(let x=f;x<v;x++)ct[x]=y;f=v-1}else g==8&&p==1&&(ct[f]=1);d=g,g&7&&(p=g)}}}function nK(e,t,n,r,i){let a=i==1?2:1;for(let l=0,s=0,c=0;l<=r.length;l++){let f=l?r[l-1].to:t,d=l<r.length?r[l].from:n;for(let p=f,g,v,y;p<d;p++)if(v=pS[g=e.charCodeAt(p)])if(v<0){for(let x=s-3;x>=0;x-=3)if(Pi[x+1]==-v){let w=Pi[x+2],A=w&2?i:w&4?w&1?a:i:0;A&&(ct[p]=ct[Pi[x]]=A),s=x;break}}else{if(Pi.length==189)break;Pi[s++]=p,Pi[s++]=g,Pi[s++]=c}else if((y=ct[p])==2||y==1){let x=y==i;c=x?0:1;for(let w=s-3;w>=0;w-=3){let A=Pi[w+2];if(A&2)break;if(x)Pi[w+2]|=2;else{if(A&4)break;Pi[w+2]|=4}}}}}function rK(e,t,n,r){for(let i=0,a=r;i<=n.length;i++){let l=i?n[i-1].to:e,s=i<n.length?n[i].from:t;for(let c=l;c<s;){let f=ct[c];if(f==256){let d=c+1;for(;;)if(d==s){if(i==n.length)break;d=n[i++].to,s=i<n.length?n[i].from:t}else if(ct[d]==256)d++;else break;let p=a==1,g=(d<t?ct[d]:r)==1,v=p==g?p?1:2:r;for(let y=d,x=i,w=x?n[x-1].to:e;y>c;)y==w&&(y=n[--x].from,w=x?n[x-1].to:e),ct[--y]=v;c=d}else a=f,c++}}}function mS(e,t,n,r,i,a,l){let s=r%2?2:1;if(r%2==i%2)for(let c=t,f=0;c<n;){let d=!0,p=!1;if(f==a.length||c<a[f].from){let x=ct[c];x!=s&&(d=!1,p=x==16)}let g=!d&&s==1?[]:null,v=d?r:r+1,y=c;e:for(;;)if(f<a.length&&y==a[f].from){if(p)break e;let x=a[f];if(!d)for(let w=x.to,A=f+1;;){if(w==n)break e;if(A<a.length&&a[A].from==w)w=a[A++].to;else{if(ct[w]==s)break e;break}}if(f++,g)g.push(x);else{x.from>c&&l.push(new Ui(c,x.from,v));let w=x.direction==ls!=!(v%2);gS(e,w?r+1:r,i,x.inner,x.from,x.to,l),c=x.to}y=x.to}else{if(y==n||(d?ct[y]!=s:ct[y]==s))break;y++}g?mS(e,c,y,r+1,i,g,l):c<y&&l.push(new Ui(c,y,v)),c=y}else for(let c=n,f=a.length;c>t;){let d=!0,p=!1;if(!f||c>a[f-1].to){let x=ct[c-1];x!=s&&(d=!1,p=x==16)}let g=!d&&s==1?[]:null,v=d?r:r+1,y=c;e:for(;;)if(f&&y==a[f-1].to){if(p)break e;let x=a[--f];if(!d)for(let w=x.from,A=f;;){if(w==t)break e;if(A&&a[A-1].to==w)w=a[--A].from;else{if(ct[w-1]==s)break e;break}}if(g)g.push(x);else{x.to<c&&l.push(new Ui(x.to,c,v));let w=x.direction==ls!=!(v%2);gS(e,w?r+1:r,i,x.inner,x.from,x.to,l),c=x.from}y=x.from}else{if(y==t||(d?ct[y-1]!=s:ct[y-1]==s))break;y--}g?mS(e,y,c,r+1,i,g,l):y<c&&l.push(new Ui(y,c,v)),c=y}}function gS(e,t,n,r,i,a,l){let s=t%2?2:1;tK(e,i,a,r,s),nK(e,i,a,r,s),rK(i,a,r,s),mS(e,i,a,t,n,r,l)}function iK(e,t,n){if(!e)return[new Ui(0,0,t==AO?1:0)];if(t==ls&&!n.length&&!eK.test(e))return Ij(e.length);if(n.length)for(;e.length>ct.length;)ct[ct.length]=256;let r=[],i=t==ls?0:1;return gS(e,i,i,n,0,e.length,r),r}function Ij(e){return[new Ui(0,e,0)]}let Lj="";function aK(e,t,n,r,i){var a;let l=r.head-e.from,s=Ui.find(t,l,(a=r.bidiLevel)!==null&&a!==void 0?a:-1,r.assoc),c=t[s],f=c.side(i,n);if(l==f){let g=s+=i?1:-1;if(g<0||g>=t.length)return null;c=t[s=g],l=c.side(!i,n),f=c.side(i,n)}let d=on(e.text,l,c.forward(i,n));(d<c.from||d>c.to)&&(d=f),Lj=e.text.slice(Math.min(l,d),Math.max(l,d));let p=s==(i?t.length-1:0)?null:t[s+(i?1:-1)];return p&&d==f&&p.level+(i?0:1)<c.level?J.cursor(p.side(!i,n)+e.from,p.forward(i,n)?1:-1,p.level):J.cursor(d+e.from,c.forward(i,n)?-1:1,c.level)}function lK(e,t,n){for(let r=t;r<n;r++){let i=_j(e.charCodeAt(r));if(i==1)return ls;if(i==2||i==4)return AO}return ls}const jj=me.define(),Bj=me.define(),zj=me.define(),$j=me.define(),vS=me.define(),Hj=me.define(),Uj=me.define(),kO=me.define(),CO=me.define(),Fj=me.define({combine:e=>e.some(t=>t)}),qj=me.define({combine:e=>e.some(t=>t)}),Wj=me.define();class _u{constructor(t,n,r,i,a,l=!1){this.range=t,this.y=n,this.x=r,this.yMargin=i,this.xMargin=a,this.isSnapshot=l}map(t){return t.empty?this:new _u(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new _u(J.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Fp=Re.define({map:(e,t)=>e.map(t)}),Vj=Re.define();function ar(e,t,n){let r=e.facet($j);r.length?r[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+":",t):console.error(t))}const Ea=me.define({combine:e=>e.length?e[0]:!0});let oK=0;const Su=me.define({combine(e){return e.filter((t,n)=>{for(let r=0;r<n;r++)if(e[r].plugin==t.plugin)return!1;return!0})}});class Rt{constructor(t,n,r,i,a){this.id=t,this.create=n,this.domEventHandlers=r,this.domEventObservers=i,this.baseExtensions=a(this),this.extension=this.baseExtensions.concat(Su.of({plugin:this,arg:void 0}))}of(t){return this.baseExtensions.concat(Su.of({plugin:this,arg:t}))}static define(t,n){const{eventHandlers:r,eventObservers:i,provide:a,decorations:l}=n||{};return new Rt(oK++,t,r,i,s=>{let c=[];return l&&c.push(Rv.of(f=>{let d=f.plugin(s);return d?l(d):Ce.none})),a&&c.push(a(s)),c})}static fromClass(t,n){return Rt.define((r,i)=>new t(r,i),n)}}class vx{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(t){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(ar(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(t,this.spec.arg)}catch(n){ar(t.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){ar(t.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Kj=me.define(),EO=me.define(),Rv=me.define(),Xj=me.define(),TO=me.define(),Wh=me.define(),Qj=me.define();function QM(e,t){let n=e.state.facet(Qj);if(!n.length)return n;let r=n.map(a=>a instanceof Function?a(e):a),i=[];return ze.spans(r,t.from,t.to,{point(){},span(a,l,s,c){let f=a-t.from,d=l-t.from,p=i;for(let g=s.length-1;g>=0;g--,c--){let v=s[g].spec.bidiIsolate,y;if(v==null&&(v=lK(t.text,f,d)),c>0&&p.length&&(y=p[p.length-1]).to==f&&y.direction==v)y.to=d,p=y.inner;else{let x={from:f,to:d,direction:v,inner:[]};p.push(x),p=x.inner}}}}),i}const Yj=me.define();function MO(e){let t=0,n=0,r=0,i=0;for(let a of e.state.facet(Yj)){let l=a(e);l&&(l.left!=null&&(t=Math.max(t,l.left)),l.right!=null&&(n=Math.max(n,l.right)),l.top!=null&&(r=Math.max(r,l.top)),l.bottom!=null&&(i=Math.max(i,l.bottom)))}return{left:t,right:n,top:r,bottom:i}}const Lf=me.define();class Xr{constructor(t,n,r,i){this.fromA=t,this.toA=n,this.fromB=r,this.toB=i}join(t){return new Xr(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let n=t.length,r=this;for(;n>0;n--){let i=t[n-1];if(!(i.fromA>r.toA)){if(i.toA<r.fromA)break;r=r.join(i),t.splice(n-1,1)}}return t.splice(n,0,r),t}static extendWithRanges(t,n){if(n.length==0)return t;let r=[];for(let i=0,a=0,l=0;;){let s=i<t.length?t[i].fromB:1e9,c=a<n.length?n[a]:1e9,f=Math.min(s,c);if(f==1e9)break;let d=f+l,p=f,g=d;for(;;)if(a<n.length&&n[a]<=p){let v=n[a+1];a+=2,p=Math.max(p,v);for(let y=i;y<t.length&&t[y].fromB<=p;y++)l=t[y].toA-t[y].toB;g=Math.max(g,v+l)}else if(i<t.length&&t[i].fromB<=p){let v=t[i++];p=Math.max(p,v.toB),g=Math.max(g,v.toA),l=v.toA-v.toB}else break;r.push(new Xr(d,g,f,p))}return r}}class ig{constructor(t,n,r){this.view=t,this.state=n,this.transactions=r,this.flags=0,this.startState=t.state,this.changes=Qt.empty(this.startState.doc.length);for(let a of r)this.changes=this.changes.compose(a.changes);let i=[];this.changes.iterChangedRanges((a,l,s,c)=>i.push(new Xr(a,l,s,c))),this.changedRanges=i}static create(t,n,r){return new ig(t,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const sK=[];class Dt{constructor(t,n,r=0){this.dom=t,this.length=n,this.flags=r,this.parent=null,t.cmTile=this}get breakAfter(){return this.flags&1}get children(){return sK}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(t){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&q7(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(t){this.dom=t,t.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(t,n=this.posAtStart){let r=n;for(let i of this.children){if(i==t)return r;r+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(t){return this.posBefore(t)+t.length}covers(t){return!0}coordsIn(t,n,r){return null}domPosFor(t,n){let r=Yl(this.dom),i=this.length?t>0:n>0;return new di(this.parent.dom,r+(i?1:0),t==0||t==this.length)}markDirty(t){this.flags&=-3,t&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let t=this;t;t=t.parent)if(t instanceof Nv)return t;return null}static get(t){return t.cmTile}}class _v extends Dt{constructor(t){super(t,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(t){this.children.push(t),t.parent=this}sync(t){if(this.flags&2)return;super.sync(t);let n=this.dom,r=null,i,a=t?.node==n?t:null,l=0;for(let s of this.children){if(s.sync(t),l+=s.length+s.breakAfter,i=r?r.nextSibling:n.firstChild,a&&i!=s.dom&&(a.written=!0),s.dom.parentNode==n)for(;i&&i!=s.dom;)i=YM(i);else n.insertBefore(s.dom,i);r=s.dom}for(i=r?r.nextSibling:n.firstChild,a&&i&&(a.written=!0);i;)i=YM(i);this.length=l}}function YM(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class Nv extends _v{constructor(t,n){super(n),this.view=t}owns(t){for(;t;t=t.parent)if(t==this)return!0;return!1}isBlock(){return!0}nearest(t){for(;;){if(!t)return null;let n=Dt.get(t);if(n&&this.owns(n))return n;t=t.parentNode}}blockTiles(t){for(let n=[],r=this,i=0,a=0;;)if(i==r.children.length){if(!n.length)return;r=r.parent,r.breakAfter&&a++,i=n.pop()}else{let l=r.children[i++];if(l instanceof Ia)n.push(i),r=l,i=0;else{let s=a+l.length,c=t(l,a);if(c!==void 0)return c;a=s+l.breakAfter}}}resolveBlock(t,n){let r,i=-1,a,l=-1;if(this.blockTiles((s,c)=>{let f=c+s.length;if(t>=c&&t<=f){if(s.isWidget()&&n>=-1&&n<=1){if(s.flags&32)return!0;s.flags&16&&(r=void 0)}(c<t||t==f&&(n<-1?s.length:s.covers(1)))&&(!r||!s.isWidget()&&r.isWidget())&&(r=s,i=t-c),(f>t||t==c&&(n>1?s.length:s.covers(-1)))&&(!a||!s.isWidget()&&a.isWidget())&&(a=s,l=t-c)}}),!r&&!a)throw new Error("No tile at position "+t);return r&&n<0||!a?{tile:r,offset:i}:{tile:a,offset:l}}}class Ia extends _v{constructor(t,n){super(t),this.wrapper=n}isBlock(){return!0}covers(t){return this.children.length?t<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(t,n){let r=new Ia(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}}class qu extends _v{constructor(t,n){super(t),this.attrs=n}isLine(){return!0}static start(t,n,r){let i=new qu(n||document.createElement("div"),t);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(t,n,r){let i=null,a=-1,l=null,s=-1;function c(d,p){for(let g=0,v=0;g<d.children.length&&v<=p;g++){let y=d.children[g],x=v+y.length;x>=p&&(y.isComposite()?c(y,p-v):(!l||l.isHidden&&(n>0&&!(l.flags&32)||r&&cK(l,y)))&&(x>p||y.flags&32)?(l=y,s=p-v):(v<p||y.flags&16&&!y.isHidden)&&(i=y,a=p-v)),v=x}}c(this,t);let f=(n<0?i:l)||i||l;return f?{tile:f,offset:f==i?a:s}:null}coordsIn(t,n,r){let i=this.resolveInline(t,n,!0);return i?i.tile.coordsIn(Math.max(0,i.offset),n,r):uK(this)}domIn(t,n){let r=this.resolveInline(t,n);if(r){let{tile:i,offset:a}=r;if(this.dom.contains(i.dom))return i.isText()?new di(i.dom,Math.min(i.dom.nodeValue.length,a)):i.domPosFor(a,i.flags&16?1:i.flags&32?-1:n);let l=r.tile.parent,s=!1;for(let c of l.children){if(s)return new di(c.dom,0);c==r.tile&&(s=!0)}}return new di(this.dom,0)}}function uK(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=Xf(t);return n[n.length-1]||null}function cK(e,t){let n=e.coordsIn(0,1),r=t.coordsIn(0,1);return n&&r&&r.top<n.bottom}class ir extends _v{constructor(t,n){super(t),this.mark=n}get domAttrs(){return this.mark.attrs}static of(t,n){let r=new ir(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}}class Ho extends Dt{constructor(t,n){super(t,n.length),this.text=n}sync(t){this.flags&2||(super.sync(t),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(t,n,r){let i=this.dom.nodeValue.length;t>i&&(t=i);let a=t,l=t,s=0;t==0&&n<0||t==i&&n>=0?pe.chrome||pe.gecko||(t?(a--,s=1):l<i&&(l++,s=-1)):n<0?a--:l<i&&l++;let c=vh(this.dom,a,l).getClientRects();if(!c.length)return null;let f=c[(s?s<0:n>=0)?0:c.length-1];return pe.safari&&!s&&f.width==0&&(f=Array.prototype.find.call(c,d=>d.width)||f),r==null?f:gh(f,(s?s>0:n<0)==r)}static of(t,n){let r=new Ho(n||document.createTextNode(t),t);return n||(r.flags|=2),r}}class os extends Dt{constructor(t,n,r,i){super(t,n,i),this.widget=r}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(t){return this.flags&48?!1:(this.flags&(t<0?64:128))>0}coordsIn(t,n){return this.coordsInWidget(t,n,!1)}coordsInWidget(t,n,r){let i=this.widget.coordsAt(this.dom,t,n);if(i)return i;if(r)return gh(this.dom.getBoundingClientRect(),this.length?t==0:n<=0);{let a=this.dom.getClientRects(),l=null;if(!a.length)return null;let s=this.flags&16?!0:this.flags&32?!1:t>0;for(let c=s?a.length-1:0;l=a[c],!(t>0?c==0:c==a.length-1||l.top<l.bottom);c+=s?-1:1);return gh(l,!s)}}get overrideDOMText(){if(!this.length)return Je.empty;let{root:t}=this;if(!t)return Je.empty;let n=this.posAtStart;return t.view.state.doc.slice(n,n+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(t,n,r,i,a){return a||(a=t.toDOM(n),t.editable||(a.contentEditable="false")),new os(a,r,t,i)}}class ag extends Dt{constructor(t){let n=document.createElement("img");n.className="cm-widgetBuffer",n.setAttribute("aria-hidden","true"),super(n,0,t)}get isHidden(){return!0}get overrideDOMText(){return Je.empty}coordsIn(t,n,r){let i=this.dom.getBoundingClientRect();return r==null?i:gh(i,n>0==r)}}class fK{constructor(t){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=t}advance(t,n,r){let{tile:i,index:a,beforeBreak:l,parents:s}=this;for(;t||n>0;)if(i.isComposite())if(l){if(!t)break;r&&r.break(),t--,l=!1}else if(a==i.children.length){if(!t&&!s.length)break;r&&r.leave(i),l=!!i.breakAfter,{tile:i,index:a}=s.pop(),a++}else{let c=i.children[a],f=c.breakAfter;(n>0?c.length<=t:c.length<t)&&(!r||r.skip(c,0,c.length)!==!1||!c.isComposite)?(l=!!f,a++,t-=c.length):(s.push({tile:i,index:a}),i=c,a=0,r&&c.isComposite()&&r.enter(c))}else if(a==i.length)l=!!i.breakAfter,{tile:i,index:a}=s.pop(),a++;else if(t){let c=Math.min(t,i.length-a);r&&r.skip(i,a,a+c),t-=c,a+=c}else break;return this.tile=i,this.index=a,this.beforeBreak=l,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class hK{constructor(t,n,r,i){this.from=t,this.to=n,this.wrapper=r,this.rank=i}}class dK{constructor(t,n,r){this.cache=t,this.root=n,this.blockWrappers=r,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(t,n,r,i){var a;this.flushBuffer();let l=this.ensureMarks(n,r),s=l.lastChild;if(s&&s.isText()&&!(s.flags&8)&&s.length+t.length<512){this.cache.reused.set(s,2);let c=l.children[l.children.length-1]=new Ho(s.dom,s.text+t);c.parent=l}else l.append(i||Ho.of(t,(a=this.cache.find(Ho))===null||a===void 0?void 0:a.dom));this.pos+=t.length,this.afterWidget=null}addComposition(t,n){let r=this.curLine;r.dom!=n.line.dom&&(r.setDOM(this.cache.reused.has(n.line)?yx(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let i=r;for(let s=n.marks.length-1;s>=0;s--){let c=n.marks[s],f=i.lastChild;if(f instanceof ir&&f.mark.eq(c.mark))f.dom!=c.dom&&f.setDOM(yx(c.dom)),i=f;else{if(this.cache.reused.get(c)){let p=Dt.get(c.dom);p&&p.setDOM(yx(c.dom))}let d=ir.of(c.mark,c.dom);i.append(d),i=d}this.cache.reused.set(c,2)}let a=Dt.get(t.text);a&&this.cache.reused.set(a,2);let l=new Ho(t.text,t.text.nodeValue);l.flags|=8,this.pos=t.range.toB,i.append(l)}addInlineWidget(t,n,r){let i=this.afterWidget&&t.flags&48&&(this.afterWidget.flags&48)==(t.flags&48);i||this.flushBuffer();let a=this.ensureMarks(n,r);!i&&!(t.flags&16)&&a.append(this.getBuffer(1)),a.append(t),this.pos+=t.length,this.afterWidget=t}addMark(t,n,r){this.flushBuffer(),this.ensureMarks(n,r).append(t),this.pos+=t.length,this.afterWidget=null}addBlockWidget(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}continueWidget(t){let n=this.afterWidget||this.lastBlock;n.length+=t,this.pos+=t}addLineStart(t,n){var r;t||(t=Gj);let i=qu.start(t,n||((r=this.cache.find(qu))===null||r===void 0?void 0:r.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=i)}addLine(t){this.getBlockPos().append(t),this.pos+=t.length,this.lastBlock=t,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(t){this.blockPosCovered()||this.addLineStart(t)}ensureLine(t){this.curLine||this.addLineStart(t)}ensureMarks(t,n){var r;let i=this.curLine;for(let a=t.length-1;a>=0;a--){let l=t[a],s;if(n>0&&(s=i.lastChild)&&s instanceof ir&&s.mark.eq(l))i=s,n--;else{let c=ir.of(l,(r=this.cache.find(ir,f=>f.mark.eq(l)))===null||r===void 0?void 0:r.dom);i.append(c),i=c,n=0}}return i}endLine(){if(this.curLine){this.flushBuffer();let t=this.curLine.lastChild;(!t||!GM(this.curLine,!1)||t.dom.nodeName!="BR"&&t.isWidget()&&!(pe.ios&&GM(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(bx,0,32)||new os(bx.toDOM(),0,bx,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let t=this.wrappers.length-1;t>=0;t--)this.wrappers[t].to<this.pos&&this.wrappers.splice(t,1);for(let t=this.blockWrappers;t.value&&t.from<=this.pos;t.next())if(t.to>=this.pos){let n=t.rank*102+t.value.rank,r=new hK(t.from,t.to,t.value,n),i=this.wrappers.length;for(;i>0&&(this.wrappers[i-1].rank-r.rank||this.wrappers[i-1].to-r.to)<0;)i--;this.wrappers.splice(i,0,r)}this.wrapperPos=this.pos}getBlockPos(){var t;this.updateBlockWrappers();let n=this.root;for(let r of this.wrappers){let i=n.lastChild;if(r.from<this.pos&&i instanceof Ia&&i.wrapper.eq(r.wrapper))n=i;else{let a=Ia.of(r.wrapper,(t=this.cache.find(Ia,l=>l.wrapper.eq(r.wrapper)))===null||t===void 0?void 0:t.dom);n.append(a),n=a}}return n}blockPosCovered(){let t=this.lastBlock;return t!=null&&!t.breakAfter&&(!t.isWidget()||(t.flags&160)>0)}getBuffer(t){let n=2|(t<0?16:32),r=this.cache.find(ag,void 0,1);return r&&(r.flags=n),r||new ag(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class pK{constructor(t){this.skipCount=0,this.text="",this.textOff=0,this.cursor=t.iter()}skip(t){this.textOff+t<=this.text.length?this.textOff+=t:(this.skipCount+=t-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(t){if(this.textOff==this.text.length){let{value:i,lineBreak:a,done:l}=this.cursor.next(this.skipCount);if(this.skipCount=0,l)throw new Error("Ran out of text content when drawing inline views");this.text=i;let s=this.textOff=Math.min(t,i.length);return a?null:i.slice(0,s)}let n=Math.min(this.text.length,this.textOff+t),r=this.text.slice(this.textOff,n);return this.textOff=n,r}}const lg=[os,qu,Ho,ir,ag,Ia,Nv];for(let e=0;e<lg.length;e++)lg[e].bucket=e;class mK{constructor(t){this.view=t,this.buckets=lg.map(()=>[]),this.index=lg.map(()=>0),this.reused=new Map}add(t){let n=t.constructor.bucket,r=this.buckets[n];r.length<6?r.push(t):r[this.index[n]=(this.index[n]+1)%6]=t}find(t,n,r=2){let i=t.bucket,a=this.buckets[i],l=this.index[i];for(let s=0;s<a.length;s++){let c=(s+l)%a.length,f=a[c];if((!n||n(f))&&!this.reused.has(f))return a.splice(c,1),c<l&&this.index[i]--,this.reused.set(f,r),f}return null}findWidget(t,n,r){let i=this.buckets[0];if(i.length)for(let a=0,l=0;;a++){if(a==i.length){if(l)return null;l=1,a=0}let s=i[a];if(!this.reused.has(s)&&(l==0?s.widget.compare(t):s.widget.constructor==t.constructor&&t.updateDOM(s.dom,this.view,s.widget)))return i.splice(a,1),a<this.index[0]&&this.index[0]--,s.widget==t&&s.length==n&&(s.flags&497)==r?(this.reused.set(s,1),s):(this.reused.set(s,2),new os(s.dom,n,t,s.flags&-498|r))}}reuse(t){return this.reused.set(t,1),t}maybeReuse(t,n=2){if(!this.reused.has(t))return this.reused.set(t,n),t.dom}clear(){for(let t=0;t<this.buckets.length;t++)this.buckets[t].length=this.index[t]=0}}class gK{constructor(t,n,r,i,a){this.view=t,this.decorations=i,this.disallowBlockEffectsFor=a,this.openWidget=!1,this.openMarks=0,this.cache=new mK(t),this.text=new pK(t.state.doc),this.builder=new dK(this.cache,new Nv(t,t.contentDOM),ze.iter(r)),this.cache.reused.set(n,2),this.old=new fK(n),this.reuseWalker={skip:(l,s,c)=>{if(this.cache.add(l),l.isComposite())return!1},enter:l=>this.cache.add(l),leave:()=>{},break:()=>{}}}run(t,n){let r=n&&this.getCompositionContext(n.text);for(let i=0,a=0,l=0;;){let s=l<t.length?t[l++]:null,c=s?s.fromA:this.old.root.length;if(c>i){let f=c-i;this.preserve(f,!l,!s),i=c,a+=f}if(!s)break;n&&s.fromA<=n.range.fromA&&s.toA>=n.range.toA?(this.forward(s.fromA,n.range.fromA,n.range.fromA<n.range.toA?1:-1),this.emit(a,n.range.fromB),this.builder.flushBuffer(),this.cache.clear(),this.builder.addComposition(n,r),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,s.toA),this.emit(n.range.toB,s.toB)):(this.forward(s.fromA,s.toA),this.emit(a,s.toB)),a=s.toB,i=s.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(t,n,r){let i=bK(this.old),a=this.openMarks;this.old.advance(t,r?1:-1,{skip:(l,s,c)=>{if(l.isWidget())if(this.openWidget)this.builder.continueWidget(c-s);else{let f=c>0||s<l.length?os.of(l.widget,this.view,c-s,l.flags&496,this.cache.maybeReuse(l)):this.cache.reuse(l);f.flags&256?(f.flags&=-2,this.builder.addBlockWidget(f)):(this.builder.ensureLine(null),this.builder.addInlineWidget(f,i,a),a=i.length)}else if(l.isText())this.builder.ensureLine(null),!s&&c==l.length&&!this.cache.reused.has(l)?this.builder.addText(l.text,i,a,this.cache.reuse(l)):(this.cache.add(l),this.builder.addText(l.text.slice(s,c),i,a)),a=i.length;else if(l.isLine())l.flags&=-2,this.cache.reused.set(l,1),this.builder.addLine(l);else if(l instanceof ag)this.cache.add(l);else if(l instanceof ir)this.builder.ensureLine(null),this.builder.addMark(l,i,a),this.cache.reused.set(l,1),a=i.length;else return!1;this.openWidget=!1},enter:l=>{l.isLine()?this.builder.addLineStart(l.attrs,this.cache.maybeReuse(l)):(this.cache.add(l),l instanceof ir&&i.unshift(l.mark)),this.openWidget=!1},leave:l=>{l.isLine()?i.length&&(i.length=a=0):l instanceof ir&&(i.shift(),a=Math.min(a,i.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(t)}emit(t,n){let r=null,i=this.builder,a=-1,l=ze.spans(this.decorations,t,n,{point:(s,c,f,d,p,g)=>{if(f instanceof as){if(this.disallowBlockEffectsFor[g]){if(f.block)throw new RangeError("Block decorations may not be specified via plugins");if(c>this.view.state.doc.lineAt(s).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(a=d.length,p>d.length)i.continueWidget(c-s);else{let v=f.widget||(f.block?Wu.block:Wu.inline),y=vK(f),x=this.cache.findWidget(v,c-s,y)||os.of(v,this.view,c-s,y);f.block?(f.startSide>0&&i.addLineStartIfNotCovered(r),i.addBlockWidget(x)):(i.ensureLine(r),i.addInlineWidget(x,d,p))}r=null}else r=yK(r,f);c>s&&this.text.skip(c-s)},span:(s,c,f,d)=>{for(let p=s;p<c;){let g=this.text.next(Math.min(512,c-p));g==null?(i.addLineStartIfNotCovered(r),i.addBreak(),p++):(i.ensureLine(r),i.addText(g,f,p==s?d:f.length),p+=g.length),r=null}a=f.length}});a>-1&&(this.openWidget=l>a),this.openWidget||i.addLineStartIfNotCovered(r),this.openMarks=l}forward(t,n,r=1){n-t<=10?this.old.advance(n-t,r,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-t-10,-1),this.old.advance(5,r,this.reuseWalker))}getCompositionContext(t){let n=[],r=null;for(let i=t.parentNode;;i=i.parentNode){let a=Dt.get(i);if(i==this.view.contentDOM)break;a instanceof ir?n.push(a):a?.isLine()?r=a:a instanceof Ia||(i.nodeName=="DIV"&&!r&&i!=this.view.contentDOM?r=new qu(i,Gj):r||n.push(ir.of(new Fh({tagName:i.nodeName.toLowerCase(),attributes:W7(i)}),i)))}return{line:r,marks:n}}}function GM(e,t){let n=r=>{for(let i of r.children)if((t?i.isText():i.length)||n(i))return!0;return!1};return n(e)}function vK(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}const Gj={class:"cm-line"};function yK(e,t){let n=t.spec.attributes,r=t.spec.class;return!n&&!r||(e||(e={class:"cm-line"}),n&&wO(n,e),r&&(e.class+=" "+r)),e}function bK(e){let t=[];for(let n=e.parents.length;n>1;n--){let r=n==e.parents.length?e.tile:e.parents[n].tile;r instanceof ir&&t.push(r.mark)}return t}function yx(e){let t=Dt.get(e);return t&&t.setDOM(e.cloneNode()),e}class Wu extends ia{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Wu.inline=new Wu("span");Wu.block=new Wu("div");const bx=new class extends ia{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class ZM{constructor(t){this.view=t,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Ce.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new Nv(t,t.contentDOM),this.updateInner([new Xr(0,0,0,t.state.doc.length)],null)}update(t){var n;let r=t.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:d,toA:p})=>p<this.minWidthFrom||d>this.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!TK(t.changes,this.hasComposition)&&!t.selectionSet&&(i=t.state.selection.main.head));let a=i>-1?SK(this.view,t.changes,i):null;if(this.domChanged=null,this.hasComposition){let{from:d,to:p}=this.hasComposition;r=new Xr(d,p,t.changes.mapPos(d,-1),t.changes.mapPos(p,1)).addToSet(r.slice())}this.hasComposition=a?{from:a.range.fromB,to:a.range.toB}:null,(pe.ie||pe.chrome)&&!a&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let l=this.decorations,s=this.blockWrappers;this.updateDeco();let c=AK(l,this.decorations,t.changes);c.length&&(r=Xr.extendWithRanges(r,c));let f=CK(s,this.blockWrappers,t.changes);return f.length&&(r=Xr.extendWithRanges(r,f)),a&&!r.some(d=>d.fromA<=a.range.fromA&&d.toA>=a.range.toA)&&(r=a.range.addToSet(r.slice())),this.tile.flags&2&&r.length==0?!1:(this.updateInner(r,a),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,n){this.view.viewState.mustMeasureContent=!0;let{observer:r}=this.view;r.ignore(()=>{if(n||t.length){let l=this.tile,s=new gK(this.view,l,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&Dt.get(n.text)&&s.cache.reused.set(Dt.get(n.text),2),this.tile=s.run(t,n),yS(l,s.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let a=pe.chrome||pe.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(a),a&&(a.written||r.selectionRange.focusNode!=a.node||!this.tile.dom.contains(a.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let i=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let a of this.tile.children)a.isWidget()&&a.widget instanceof xx&&i.push(a.dom);r.updateGaps(i)}updateEditContextFormatting(t){this.editContextFormatting=this.editContextFormatting.map(t.changes);for(let n of t.transactions)for(let r of n.effects)r.is(Vj)&&(this.editContextFormatting=r.value)}updateSelection(t=!1,n=!1){(t||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:r}=this.tile,i=this.view.root.activeElement,a=i==r,l=!a&&!(this.view.state.facet(Ea)||r.tabIndex>-1)&&Kf(r,this.view.observer.selectionRange)&&!(i&&r.contains(i));if(!(a||n||l))return;let s=this.forceSelection;this.forceSelection=!1;let c=this.view.state.selection.main,f,d;if(c.empty?d=f=this.inlineDOMNearPos(c.anchor,c.assoc||1):(d=this.inlineDOMNearPos(c.head,c.head==c.from?1:-1),f=this.inlineDOMNearPos(c.anchor,c.anchor==c.from?1:-1)),pe.gecko&&c.empty&&!this.hasComposition&&xK(f)){let g=document.createTextNode("");this.view.observer.ignore(()=>f.node.insertBefore(g,f.node.childNodes[f.offset]||null)),f=d=new di(g,0),s=!0}let p=this.view.observer.selectionRange;(s||!p.focusNode||(!Qf(f.node,f.offset,p.anchorNode,p.anchorOffset)||!Qf(d.node,d.offset,p.focusNode,p.focusOffset))&&!this.suppressWidgetCursorChange(p,c))&&(this.view.observer.ignore(()=>{pe.android&&pe.chrome&&r.contains(p.focusNode)&&EK(p.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let g=mh(this.view.root);if(g)if(c.empty){if(pe.gecko){let v=wK(f.node,f.offset);if(v&&v!=3){let y=(v==1?Pj:Dj)(f.node,f.offset);y&&(f=new di(y.node,y.offset))}}g.collapse(f.node,f.offset),c.bidiLevel!=null&&g.caretBidiLevel!==void 0&&(g.caretBidiLevel=c.bidiLevel)}else if(g.extend){g.collapse(f.node,f.offset);try{g.extend(d.node,d.offset)}catch{}}else{let v=document.createRange();c.anchor>c.head&&([f,d]=[d,f]),v.setEnd(d.node,d.offset),v.setStart(f.node,f.offset),g.removeAllRanges(),g.addRange(v)}l&&this.view.root.activeElement==r&&(r.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(f,d)),this.impreciseAnchor=f.precise?null:new di(p.anchorNode,p.anchorOffset),this.impreciseHead=d.precise?null:new di(p.focusNode,p.focusOffset)}suppressWidgetCursorChange(t,n){return this.hasComposition&&n.empty&&Qf(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,n=t.state.selection.main,r=mh(t.root),{anchorNode:i,anchorOffset:a}=t.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let l=this.lineAt(n.head,n.assoc);if(!l)return;let s=l.posAtStart;if(n.head==s||n.head==s+l.length)return;let c=this.coordsAt(n.head,-1),f=this.coordsAt(n.head,1);if(!c||!f||c.bottom>f.top)return;let d=this.domAtPos(n.head+n.assoc,n.assoc);r.collapse(d.node,d.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let p=t.observer.selectionRange;t.docView.posFromDOM(p.anchorNode,p.anchorOffset)!=n.from&&r.collapse(i,a)}posFromDOM(t,n){let r=this.tile.nearest(t);if(!r)return this.tile.dom.compareDocumentPosition(t)&2?0:this.view.state.doc.length;let i=r.posAtStart;if(r.isComposite()){let a;if(t==r.dom)a=r.dom.childNodes[n];else{let l=Ha(t)==0?0:n==0?-1:1;for(;;){let s=t.parentNode;if(s==r.dom)break;l==0&&s.firstChild!=s.lastChild&&(t==s.firstChild?l=-1:l=1),t=s}l<0?a=t:a=t.nextSibling}if(a==r.dom.firstChild)return i;for(;a&&!Dt.get(a);)a=a.nextSibling;if(!a)return i+r.length;for(let l=0,s=i;;l++){let c=r.children[l];if(c.dom==a)return s;s+=c.length+c.breakAfter}}else return r.isText()?t==r.dom?i+n:i+(n?r.length:0):i}domAtPos(t,n){let{tile:r,offset:i}=this.tile.resolveBlock(t,n);return r.isWidget()?r.domPosFor(i,n):r.domIn(i,n)}inlineDOMNearPos(t,n){let r,i=-1,a=!1,l,s=-1,c=!1;return this.tile.blockTiles((f,d)=>{if(f.isWidget()){if(f.flags&32&&d>=t)return!0;f.flags&16&&(a=!0)}else{let p=d+f.length;if(d<=t&&(r=f,i=t-d,a=p<t),p>=t&&!l&&(l=f,s=t-d,c=d>t),d>t&&l)return!0}}),!r&&!l?this.domAtPos(t,n):(a&&l?r=null:c&&r&&(l=null),r&&n<0||!l?r.domIn(i,n):l.domIn(s,n))}coordsAt(t,n,r){let{tile:i,offset:a}=this.tile.resolveBlock(t,n);return i.isWidget()?i.widget instanceof xx?null:i.coordsInWidget(a,n,!0):i.coordsIn(a,n,r)}lineAt(t,n){let{tile:r}=this.tile.resolveBlock(t,n);return r.isLine()?r:null}coordsForChar(t){let{tile:n,offset:r}=this.tile.resolveBlock(t,1);if(!n.isLine())return null;function i(a,l){if(a.isComposite())for(let s of a.children){if(s.length>=l){let c=i(s,l);if(c)return c}if(l-=s.length,l<0)break}else if(a.isText()&&l<a.length){let s=on(a.text,l);if(s==l)return null;let c=vh(a.dom,l,s).getClientRects();for(let f=0;f<c.length;f++){let d=c[f];if(f==c.length-1||d.top<d.bottom&&d.left<d.right)return d}}return null}return i(n,r)}measureVisibleLineHeights(t){let n=[],{from:r,to:i}=t,a=this.view.contentDOM.clientWidth,l=a>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,s=-1,c=this.view.textDirection==ft.LTR,f=0,d=(p,g,v)=>{for(let y=0;y<p.children.length&&!(g>i);y++){let x=p.children[y],w=g+x.length,A=x.dom.getBoundingClientRect(),{height:k}=A;if(v&&!y&&(f+=A.top-v.top),x instanceof Ia)w>r&&d(x,g,A);else if(g>=r&&(f>0&&n.push(-f),n.push(k+f),f=0,l)){let E=x.dom.lastChild,P=E?Xf(E):[];if(P.length){let T=P[P.length-1],M=c?T.right-A.left:A.right-T.left;M>s&&(s=M,this.minWidth=a,this.minWidthFrom=g,this.minWidthTo=w)}}v&&y==p.children.length-1&&(f+=v.bottom-A.bottom),g=w+x.breakAfter}};return d(this.tile,0,null),n}textDirectionAt(t){let{tile:n}=this.tile.resolveBlock(t,1);return getComputedStyle(n.dom).direction=="rtl"?ft.RTL:ft.LTR}measureTextSize(){let t=this.tile.blockTiles(l=>{if(l.isLine()&&l.children.length&&l.length<=20){let s=0,c;for(let f of l.children){if(!f.isText()||/[^ -~]/.test(f.text))return;let d=Xf(f.dom);if(d.length!=1)return;s+=d[0].width,c=d[0].height}if(s)return{lineHeight:l.dom.getBoundingClientRect().height,charWidth:s/l.length,textHeight:c}}});if(t)return t;let n=document.createElement("div"),r,i,a;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let l=Xf(n.firstChild)[0];r=n.getBoundingClientRect().height,i=l&&l.width?l.width/27:7,a=l&&l.height?l.height:r,n.remove()}),{lineHeight:r,charWidth:i,textHeight:a}}computeBlockGapDeco(){let t=[],n=this.view.viewState;for(let r=0,i=0;;i++){let a=i==n.viewports.length?null:n.viewports[i],l=a?a.from-1:this.view.state.doc.length;if(l>r){let s=(n.lineBlockAt(l).bottom-n.lineBlockAt(r).top)/this.view.scaleY;t.push(Ce.replace({widget:new xx(s),block:!0,inclusive:!0,isBlockGap:!0}).range(r,l))}if(!a)break;r=a.to+1}return Ce.set(t)}updateDeco(){let t=1,n=this.view.state.facet(Rv).map(a=>(this.dynamicDecorationMap[t++]=typeof a=="function")?a(this.view):a),r=!1,i=this.view.state.facet(TO).map((a,l)=>{let s=typeof a=="function";return s&&(r=!0),s?a(this.view):a});for(i.length&&(this.dynamicDecorationMap[t++]=r,n.push(ze.join(i))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];t<this.decorations.length;)this.dynamicDecorationMap[t++]=!1;this.blockWrappers=this.view.state.facet(Xj).map(a=>typeof a=="function"?a(this.view):a)}scrollIntoView(t){if(t.isSnapshot){let f=this.view.viewState.lineBlockAt(t.range.head);this.view.scrollDOM.scrollTop=f.top-t.yMargin,this.view.scrollDOM.scrollLeft=t.xMargin;return}for(let f of this.view.state.facet(Wj))try{if(f(this.view,t.range,t))return!0}catch(d){ar(this.view.state,d,"scroll handler")}let{range:n}=t,r=this.coordsAt(n.head,n.assoc||(n.head>n.anchor?-1:1)),i;if(!r)return;!n.empty&&(i=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,i.left),top:Math.min(r.top,i.top),right:Math.max(r.right,i.right),bottom:Math.max(r.bottom,i.bottom)});let a=MO(this.view),l={left:r.left-a.left,top:r.top-a.top,right:r.right+a.right,bottom:r.bottom+a.bottom},{offsetWidth:s,offsetHeight:c}=this.view.scrollDOM;if(X7(this.view.scrollDOM,l,n.head<n.anchor?-1:1,t.x,t.y,Math.max(Math.min(t.xMargin,s),-s),Math.max(Math.min(t.yMargin,c),-c),this.view.textDirection==ft.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(r.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||r.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let f=this.view.docView.lineAt(n.head,1);f&&f.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(t){let n=r=>r.isWidget()||r.children.some(n);return n(this.tile.resolveBlock(t,1).tile)}destroy(){yS(this.tile)}}function yS(e,t){let n=t?.get(e);if(n!=1){n==null&&e.destroy();for(let r of e.children)yS(r,t)}}function xK(e){return e.node.nodeType==1&&e.node.firstChild&&(e.offset==0||e.node.childNodes[e.offset-1].contentEditable=="false")&&(e.offset==e.node.childNodes.length||e.node.childNodes[e.offset].contentEditable=="false")}function Zj(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=Pj(n.focusNode,n.focusOffset),i=Dj(n.focusNode,n.focusOffset),a=r||i;if(i&&r&&i.node!=r.node){let s=Dt.get(i.node);if(!s||s.isText()&&s.text!=i.node.nodeValue)a=i;else if(e.docView.lastCompositionAfterCursor){let c=Dt.get(r.node);!c||c.isText()&&c.text!=r.node.nodeValue||(a=i)}}if(e.docView.lastCompositionAfterCursor=a!=r,!a)return null;let l=t-a.offset;return{from:l,to:l+a.node.nodeValue.length,node:a.node}}function SK(e,t,n){let r=Zj(e,n);if(!r)return null;let{node:i,from:a,to:l}=r,s=i.nodeValue;if(/[\n\r]/.test(s)||e.state.doc.sliceString(r.from,r.to)!=s)return null;let c=t.invertedDesc;return{range:new Xr(c.mapPos(a),c.mapPos(l),a,l),text:i}}function wK(e,t){return e.nodeType!=1?0:(t&&e.childNodes[t-1].contentEditable=="false"?1:0)|(t<e.childNodes.length&&e.childNodes[t].contentEditable=="false"?2:0)}let OK=class{constructor(){this.changes=[]}compareRange(t,n){Du(t,n,this.changes)}comparePoint(t,n){Du(t,n,this.changes)}boundChange(t){Du(t,t,this.changes)}};function AK(e,t,n){let r=new OK;return ze.compare(e,t,n,r),r.changes}class kK{constructor(){this.changes=[]}compareRange(t,n){Du(t,n,this.changes)}comparePoint(){}boundChange(t){Du(t,t,this.changes)}}function CK(e,t,n){let r=new kK;return ze.compare(e,t,n,r),r.changes}function EK(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function TK(e,t){let n=!1;return t&&e.iterChangedRanges((r,i)=>{r<t.to&&i>t.from&&(n=!0)}),n}class xx extends ia{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function MK(e,t,n=1){let r=e.charCategorizer(t),i=e.doc.lineAt(t),a=t-i.from;if(i.length==0)return J.cursor(t);a==0?n=1:a==i.length&&(n=-1);let l=a,s=a;n<0?l=on(i.text,a,!1):s=on(i.text,a);let c=r(i.text.slice(l,s));for(;l>0;){let f=on(i.text,l,!1);if(r(i.text.slice(f,l))!=c)break;l=f}for(;s<i.length;){let f=on(i.text,s);if(r(i.text.slice(s,f))!=c)break;s=f}return J.undirectionalRange(l+i.from,s+i.from)}function PK(e,t,n,r,i){let a=Math.round((r-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&n.height>e.defaultLineHeight*1.5){let s=e.viewState.heightOracle.textHeight,c=Math.floor((i-n.top-(e.defaultLineHeight-s)*.5)/s);a+=c*e.viewState.heightOracle.lineLength}let l=e.state.sliceDoc(n.from,n.to);return n.from+lS(l,a,e.state.tabSize)}function bS(e,t,n){let r=e.lineBlockAt(t);if(Array.isArray(r.type)){let i;for(let a of r.type){if(a.from>t)break;if(!(a.to<t)){if(a.from<t&&a.to>t)return a;(!i||a.type==kn.Text&&(i.type!=a.type||(n<0?a.from<t:a.to>t)))&&(i=a)}}return i||r}return r}function DK(e,t,n,r){let i=bS(e,t.head,t.assoc||-1),a=!r||i.type!=kn.Text||!(e.lineWrapping||i.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>i.from?t.head-1:t.head);if(a){let l=e.dom.getBoundingClientRect(),s=e.textDirectionAt(i.from),c=e.posAtCoords({x:n==(s==ft.LTR)?l.right-1:l.left+1,y:(a.top+a.bottom)/2});if(c!=null)return J.cursor(c,n?-1:1)}return J.cursor(n?i.to:i.from,n?-1:1)}function JM(e,t,n,r){let i=e.state.doc.lineAt(t.head),a=e.bidiSpans(i),l=e.textDirectionAt(i.from);for(let s=t,c=null;;){let f=aK(i,a,l,s,n),d=Lj;if(!f){if(i.number==(n?e.state.doc.lines:1))return s;d=`
|
|
62
|
+
`,i=e.state.doc.line(i.number+(n?1:-1)),a=e.bidiSpans(i),f=e.visualLineSide(i,!n)}if(c){if(!c(d))return s}else{if(!r)return f;c=r(d)}s=f}}function RK(e,t,n){let r=e.state.charCategorizer(t),i=r(n);return a=>{let l=r(a);return i==Ot.Space&&(i=l),i==l}}function _K(e,t,n,r){let i=t.head,a=n?1:-1;if(i==(n?e.state.doc.length:0))return J.cursor(i,t.assoc);let l=t.goalColumn,s,c=e.contentDOM.getBoundingClientRect(),f=e.coordsAtPos(i,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),d=e.documentTop;if(f)l==null&&(l=f.left-c.left),s=a<0?f.top:f.bottom;else{let y=e.viewState.lineBlockAt(i);l==null&&(l=Math.min(c.right-c.left,e.defaultCharacterWidth*(i-y.from))),s=(a<0?y.top:y.bottom)+d}let p=c.left+l,g=e.viewState.heightOracle.textHeight>>1,v=r??g;for(let y=0;;y+=g){let x=s+(v+y)*a,w=xS(e,{x:p,y:x},!1,a);if(n?x>c.bottom:x<c.top)return J.cursor(w.pos,w.assoc);let A=e.coordsAtPos(w.pos,w.assoc),k=A?(A.top+A.bottom)/2:0;if(!A||(n?k>s:k<s))return J.cursor(w.pos,w.assoc,void 0,l)}}function Yf(e,t,n){for(;;){let r=0;for(let i of e)i.between(t-1,t+1,(a,l,s)=>{if(t>a&&t<l){let c=r||n||(t-a<l-t?-1:1);t=c<0?a:l,r=c}});if(!r)return t}}function Jj(e,t){let n=null;for(let r=0;r<t.ranges.length;r++){let i=t.ranges[r],a=null;if(i.empty){let l=Yf(e,i.from,0);l!=i.from&&(a=J.cursor(l,-1))}else{let l=Yf(e,i.from,-1),s=Yf(e,i.to,1);(l!=i.from||s!=i.to)&&(i.undirectional?a=J.undirectionalRange(i.from,i.to):a=J.range(i.from==i.anchor?l:s,i.from==i.head?l:s))}a&&(n||(n=t.ranges.slice()),n[r]=a)}return n?J.create(n,t.mainIndex):t}function Sx(e,t,n){let r=Yf(e.state.facet(Wh).map(i=>i(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:J.cursor(r,r<n.from?1:-1)}class Hi{constructor(t,n){this.pos=t,this.assoc=n}}function xS(e,t,n,r){let i=e.contentDOM.getBoundingClientRect(),a=i.top+e.viewState.paddingTop,{x:l,y:s}=t,c=s-a,f;for(;;){if(c<0)return new Hi(0,1);if(c>e.viewState.docHeight)return new Hi(e.state.doc.length,-1);if(f=e.elementAtHeight(c),r==null)break;if(f.type==kn.Text){if(r<0?f.to<e.viewport.from:f.from>e.viewport.to)break;let g=e.docView.coordsAt(r<0?f.from:f.to,r>0?-1:1);if(g&&(r<0?g.top<=c+a:g.bottom>=c+a))break}let p=e.viewState.heightOracle.textHeight/2;c=r>0?f.bottom+p:f.top-p}if(e.viewport.from>=f.to||e.viewport.to<=f.from){if(n)return null;if(f.type==kn.Text){let p=PK(e,i,f,l,s);return new Hi(p,p==f.from?1:-1)}}if(f.type!=kn.Text)return c<(f.top+f.bottom)/2?new Hi(f.from,1):new Hi(f.to,-1);let d=e.docView.lineAt(f.from,2);return(!d||d.length!=f.length)&&(d=e.docView.lineAt(f.from,-2)),new NK(e,l,s,e.textDirectionAt(f.from)).scanTile(d,f.from)}class NK{constructor(t,n,r,i){this.view=t,this.x=n,this.y=r,this.baseDir=i,this.line=null,this.spans=null}bidiSpansAt(t){return(!this.line||this.line.from>t||this.line.to<t)&&(this.line=this.view.state.doc.lineAt(t),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(t,n){let{line:r,spans:i}=this.bidiSpansAt(t);return i[Ui.find(i,t-r.from,-1,n)].level==this.baseDir}dirAt(t,n){let{line:r,spans:i}=this.bidiSpansAt(t);return i[Ui.find(i,t-r.from,-1,n)].dir}bidiIn(t,n){let{spans:r,line:i}=this.bidiSpansAt(t);return r.length>1||r.length&&(r[0].level!=this.baseDir||r[0].to+i.from<n)}scan(t,n,r=!1){let i=0,a=t.length-1,l=new Set,s=this.bidiIn(t[0],t[a]),c,f,d=-1,p=1e9,g;e:for(;i<a;){let y=a-i,x=i+a>>1;t:if(l.has(x)){let A=i+Math.floor(Math.random()*y);for(let k=0;k<y;k++){if(!l.has(A)){x=A;break t}A++,A==a&&(A=i)}break e}l.add(x);let w=n(x);if(w)for(let A=0;A<w.length;A++){let k=w[A],E=0;if(!(k.width==0&&w.length>1)){if(k.bottom<this.y)(!c||c.bottom<k.bottom)&&(c=k),E=1;else if(k.top>this.y)(!f||f.top>k.top)&&(f=k),E=-1;else{let P=k.left>this.x?this.x-k.left:k.right<this.x?this.x-k.right:0,T=Math.abs(P);T<p&&(d=x,p=T,g=k),P&&(E=P<0==(this.baseDir==ft.LTR)?-1:1)}E==-1&&(!s||this.baseDirAt(t[x],1))?a=x:E==1&&(!s||this.baseDirAt(t[x+1],-1))&&(i=x+1)}}}if(!g){if(!f&&!c)return{i:t[0],after:!1};let y=c&&(!f||this.y-c.bottom<f.top-this.y)?c:f;return this.y=(y.top+y.bottom)/2,this.scan(t,n,!0)}if(p&&!r){let{top:y,bottom:x}=g;if(c&&c.bottom>(y+y+x)/3)return this.y=c.bottom-1,this.scan(t,n,!0);if(f&&f.top<(y+x+x)/3)return this.y=f.top+1,this.scan(t,n,!0)}let v=(s?this.dirAt(t[d],1):this.baseDir)==ft.LTR;return{i:d,after:this.x>(g.left+g.right)/2==v}}scanText(t,n){let r=[];for(let a=0;a<t.length;a=on(t.text,a))r.push(n+a);r.push(n+t.length);let i=this.scan(r,a=>{let l=r[a]-n,s=r[a+1]-n;return vh(t.dom,l,s).getClientRects()});return i.after?new Hi(r[i.i+1],-1):new Hi(r[i.i],1)}scanTile(t,n){if(!t.length)return new Hi(n,1);if(t.children.length==1){let s=t.children[0];if(s.isText())return this.scanText(s,n);if(s.isComposite())return this.scanTile(s,n)}let r=[n];for(let s=0,c=n;s<t.children.length;s++)r.push(c+=t.children[s].length);let i=this.scan(r,s=>{let c=t.children[s];return c.flags&48?null:(c.dom.nodeType==1?c.dom:vh(c.dom,0,c.length)).getClientRects()}),a=t.children[i.i],l=r[i.i];return a.isText()?this.scanText(a,l):a.isComposite()?this.scanTile(a,l):i.after?new Hi(r[i.i+1],-1):new Hi(l,1)}}const gu="";class IK{constructor(t,n){this.points=t,this.view=n,this.text="",this.lineSeparator=n.state.facet(qe.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=gu}readRange(t,n){if(!t)return this;let r=t.parentNode;for(let i=t;;){this.findPointBefore(r,i);let a=this.text.length;this.readNode(i);let l=Dt.get(i),s=i.nextSibling;if(s==n){l?.breakAfter&&!s&&r!=this.view.contentDOM&&this.lineBreak();break}let c=Dt.get(s);(l&&c?l.breakAfter:(l?l.breakAfter:rg(i))||rg(s)&&(i.nodeName!="BR"||l?.isWidget())&&this.text.length>a)&&!jK(s,n)&&this.lineBreak(),i=s}return this.findPointBefore(r,n),this}readTextNode(t){let n=t.nodeValue;for(let r of this.points)r.node==t&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let a=-1,l=1,s;if(this.lineSeparator?(a=n.indexOf(this.lineSeparator,r),l=this.lineSeparator.length):(s=i.exec(n))&&(a=s.index,l=s[0].length),this.append(n.slice(r,a<0?n.length:a)),a<0)break;if(this.lineBreak(),l>1)for(let c of this.points)c.node==t&&c.pos>this.text.length&&(c.pos-=l-1);r=a+l}}readNode(t){let n=Dt.get(t),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(t,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else t.nodeType==3?this.readTextNode(t):t.nodeName=="BR"?t.nextSibling&&this.lineBreak():t.nodeType==1&&this.readRange(t.firstChild,null)}findPointBefore(t,n){for(let r of this.points)r.node==t&&t.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(t,n){for(let r of this.points)(t.nodeType==3?r.node==t:t.contains(r.node))&&(r.pos=this.text.length+(LK(t,r.node,r.offset)?n:0))}}function LK(e,t,n){for(;;){if(!t||n<Ha(t))return!1;if(t==e)return!0;n=Yl(t)+1,t=t.parentNode}}function jK(e,t){let n;for(;!(e==t||!e);e=e.nextSibling){let r=Dt.get(e);if(!r?.isWidget())return!1;r&&(n||(n=[])).push(r)}if(n)for(let r of n){let i=r.overrideDOMText;if(i?.length)return!1}return!0}class eP{constructor(t,n){this.node=t,this.offset=n,this.pos=-1}}class BK{constructor(t,n,r,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:a,impreciseAnchor:l}=t.docView,s=t.state.selection;if(t.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=e3(t.docView.tile,n,r,0))){let c=a||l?[]:$K(t),f=new IK(c,t);f.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=f.text,this.newSel=HK(c,this.bounds.from)}else{let c=t.observer.selectionRange,f=a&&a.node==c.focusNode&&a.offset==c.focusOffset||!dS(t.contentDOM,c.focusNode)?s.main.head:t.docView.posFromDOM(c.focusNode,c.focusOffset),d=l&&l.node==c.anchorNode&&l.offset==c.anchorOffset||!dS(t.contentDOM,c.anchorNode)?s.main.anchor:t.docView.posFromDOM(c.anchorNode,c.anchorOffset),p=t.viewport;if((pe.ios||pe.chrome)&&f!=d&&Math.min(f,d)<=s.main.from&&Math.max(f,d)>=s.main.to&&(p.from>0||p.to<t.state.doc.length)){let g=Math.min(f,d),v=Math.max(f,d),y=p.from-g,x=p.to-v;(y==0||y==1||g==0)&&(x==0||x==-1||v==t.state.doc.length)&&(f=0,d=t.state.doc.length)}if(t.inputState.composing>-1&&s.ranges.length>1)this.newSel=s.replaceRange(J.range(d,f));else if(t.lineWrapping&&d==f&&!(s.main.empty&&s.main.head==f)&&t.inputState.lastTouchTime>Date.now()-100){let g=t.coordsAtPos(f,-1),v=0;g&&(v=t.inputState.lastTouchY<=g.bottom?-1:1),this.newSel=J.create([J.cursor(f,v)])}else this.newSel=J.single(d,f)}}}function e3(e,t,n,r){if(e.isComposite()){let i=-1,a=-1,l=-1,s=-1;for(let c=0,f=r,d=r;c<e.children.length;c++){let p=e.children[c],g=f+p.length;if(f<t&&g>n)return e3(p,t,n,f);if(g>=t&&i==-1&&(i=c,a=f),f>n&&p.dom.parentNode==e.dom){l=c,s=d;break}d=g,f=g+p.breakAfter}return{from:a,to:s<0?r+e.length:s,startDOM:(i?e.children[i-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:l<e.children.length&&l>=0?e.children[l].dom:null}}else return e.isText()?{from:r,to:r+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function t3(e,t){let n,{newSel:r}=t,{state:i}=e,a=i.selection.main,l=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:s,to:c}=t.bounds,f=a.from,d=null;(l===8||pe.android&&t.text.length<c-s)&&(f=a.to,d="end");let p=i.doc.sliceString(s,c,gu),g,v;!a.empty&&a.from>=s&&a.to<=c&&(t.typeOver||p!=t.text)&&p.slice(0,a.from-s)==t.text.slice(0,a.from-s)&&p.slice(a.to-s)==t.text.slice(g=t.text.length-(p.length-(a.to-s)))?n={from:a.from,to:a.to,insert:Je.of(t.text.slice(a.from-s,g).split(gu))}:(v=n3(p,t.text,f-s,d))&&(pe.chrome&&l==13&&v.toB==v.from+2&&t.text.slice(v.from,v.toB)==gu+gu&&v.toB--,n={from:s+v.from,to:s+v.toA,insert:Je.of(t.text.slice(v.from,v.toB).split(gu))})}else r&&(!e.hasFocus&&i.facet(Ea)||og(r,a))&&(r=null);if(!n&&!r)return!1;if((pe.mac||pe.android)&&n&&n.from==n.to&&n.from==a.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=J.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:Je.of([n.insert.toString().replace("."," ")])}):i.doc.lineAt(a.from).to<a.to&&e.docView.lineHasWidget(a.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:a.from,to:a.to,insert:i.toText(e.inputState.insertingText)}:pe.chrome&&n&&n.from==n.to&&n.from==a.head&&n.insert.toString()==`
|
|
63
|
+
`&&e.lineWrapping&&(r&&(r=J.single(r.main.anchor-1,r.main.head-1)),n={from:a.from,to:a.to,insert:Je.of([" "])}),n)return PO(e,n,r,l);if(r&&!og(r,a)){let s=!1,c="select";return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin=="select"&&(s=!0),c=e.inputState.lastSelectionOrigin,c=="select.pointer"&&(r=Jj(i.facet(Wh).map(f=>f(e)),r))),e.dispatch({selection:r,scrollIntoView:s,userEvent:c}),!0}else return!1}function PO(e,t,n,r=-1){if(pe.ios&&e.inputState.flushIOSKey(t))return!0;let i=e.state.selection.main;if(pe.android&&(t.to==i.to&&(t.from==i.from||t.from==i.from-1&&e.state.sliceDoc(t.from,i.from)==" ")&&t.insert.length==1&&t.insert.lines==2&&Ru(e.contentDOM,"Enter",13)||(t.from==i.from-1&&t.to==i.to&&t.insert.length==0||r==8&&t.insert.length<t.to-t.from&&t.to>i.head)&&Ru(e.contentDOM,"Backspace",8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&Ru(e.contentDOM,"Delete",46)))return!0;let a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let l,s=()=>l||(l=zK(e,t,n));return e.state.facet(Hj).some(c=>c(e,t.from,t.to,a,s))||e.dispatch(s()),!0}function zK(e,t,n){let r,i=e.state,a=i.selection.main,l=-1;if(t.from==t.to&&t.from<a.from||t.from>a.to){let c=t.from<a.from?-1:1,f=c<0?a.from:a.to,d=Yf(i.facet(Wh).map(p=>p(e)),f,c);t.from==d&&(l=d)}if(l>-1)r={changes:t,selection:J.cursor(t.from+t.insert.length,-1)};else if(t.from>=a.from&&t.to<=a.to&&t.to-t.from>=(a.to-a.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let c=a.from<t.from?i.sliceDoc(a.from,t.from):"",f=a.to>t.to?i.sliceDoc(t.to,a.to):"";r=i.replaceSelection(e.state.toText(c+t.insert.sliceString(0,void 0,e.state.lineBreak)+f))}else{let c=i.changes(t),f=n&&n.main.to<=c.newLength?n.main:void 0;if(i.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=a.to+10&&t.to>=a.to-10){let d=e.state.sliceDoc(t.from,t.to),p,g=n&&Zj(e,n.main.head);if(g){let y=t.insert.length-(t.to-t.from);p={from:g.from,to:g.to-y}}else p=e.state.doc.lineAt(a.head);let v=a.to-t.to;r=i.changeByRange(y=>{if(y.from==a.from&&y.to==a.to)return{changes:c,range:f||y.map(c)};let x=y.to-v,w=x-d.length;if(e.state.sliceDoc(w,x)!=d||x>=p.from&&w<=p.to)return{range:y};let A=i.changes({from:w,to:x,insert:t.insert}),k=y.to-a.to;return{changes:A,range:f?J.range(Math.max(0,f.anchor+k),Math.max(0,f.head+k)):y.map(A)}})}else r={changes:c,selection:f&&i.selection.replaceRange(f)}}let s="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,s+=".compose",e.inputState.compositionFirstChange&&(s+=".start",e.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function n3(e,t,n,r){let i=Math.min(e.length,t.length),a=0;for(;a<i&&e.charCodeAt(a)==t.charCodeAt(a);)a++;if(a==i&&e.length==t.length)return null;let l=e.length,s=t.length;for(;l>0&&s>0&&e.charCodeAt(l-1)==t.charCodeAt(s-1);)l--,s--;if(r=="end"){let c=Math.max(0,a-Math.min(l,s));n-=l+c-a}if(l<a&&e.length<t.length){let c=n<=a&&n>=l?a-n:0;a-=c,s=a+(s-l),l=a}else if(s<a){let c=n<=a&&n>=s?a-n:0;a-=c,l=a+(l-s),s=a}return{from:a,toA:l,toB:s}}function $K(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}=e.observer.selectionRange;return n&&(t.push(new eP(n,r)),(i!=n||a!=r)&&t.push(new eP(i,a))),t}function HK(e,t){if(e.length==0)return null;let n=e[0].pos,r=e.length==2?e[1].pos:n;return n>-1&&r>-1?J.single(n+t,r+t):null}function og(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class UK{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,pe.safari&&t.contentDOM.addEventListener("input",()=>null),pe.gecko&&iX(t.contentDOM.ownerDocument)}handleEvent(t){!GK(this.view,t)||this.ignoreDuringComposition(t)||t.type=="keydown"&&this.keydown(t)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(t.type,t)):this.runHandlers(t.type,t))}runHandlers(t,n){let r=this.handlers[t];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(t){let n=qK(t),r=this.handlers,i=this.view.contentDOM;for(let a in n)if(a!="scroll"){let l=!n[a].handlers.length,s=r[a];s&&l!=!s.handlers.length&&(i.removeEventListener(a,this.handleEvent),s=null),s||i.addEventListener(a,this.handleEvent,{passive:l})}for(let a in r)a!="scroll"&&!n[a]&&i.removeEventListener(a,this.handleEvent);this.handlers=n}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&t.keyCode!=27&&i3.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),pe.android&&pe.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;if(pe.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&(r3.some(n=>n.keyCode==t.keyCode)&&!t.ctrlKey||WK.indexOf(t.key)>-1&&t.ctrlKey)){let n={ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey,shiftKey:t.shiftKey};return n.shiftKey&&pe.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&FK(this.view.win)&&(n.shiftKey=!1),this.pendingIOSKey={key:t.key,keyCode:t.keyCode,mods:n},setTimeout(()=>this.flushIOSKey(),250),!0}return t.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(t){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&t&&t.from<t.to&&/^\S+$/.test(t.insert.toString())?!1:(this.pendingIOSKey=void 0,Ru(this.view.contentDOM,n.key,n.keyCode,n.mods))}ignoreDuringComposition(t){return!/^key/.test(t.type)||t.synthetic?!1:this.composing>0?!0:pe.safari&&!pe.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function FK(e){return e.visualViewport?e.visualViewport.height*e.visualViewport.scale/e.document.documentElement.clientHeight<.85:!1}function tP(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(i){ar(n.state,i)}}}function qK(e){let t=Object.create(null);function n(r){return t[r]||(t[r]={observers:[],handlers:[]})}for(let r of e){let i=r.spec,a=i&&i.plugin.domEventHandlers,l=i&&i.plugin.domEventObservers;if(a)for(let s in a){let c=a[s];c&&n(s).handlers.push(tP(r.value,c))}if(l)for(let s in l){let c=l[s];c&&n(s).observers.push(tP(r.value,c))}}for(let r in vi)n(r).handlers.push(vi[r]);for(let r in Vn)n(r).observers.push(Vn[r]);return t}const r3=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],WK="dthko",i3=[16,17,18,20,91,92,224,225],qp=6;function Wp(e){return Math.max(0,e)*.7+8}function VK(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}class KK{constructor(t,n,r,i){this.view=t,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=Ej(t.contentDOM),this.atoms=t.state.facet(Wh).map(l=>l(t));let a=t.contentDOM.ownerDocument;a.addEventListener("mousemove",this.move=this.move.bind(this)),a.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=t.state.facet(qe.allowMultipleSelections)&&XK(t,n),this.dragging=YK(t,n)&&o3(n)==1?null:!1}start(t){this.dragging===!1&&this.select(t)}move(t){if(t.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&VK(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let n=0,r=0,i=0,a=0,l=this.view.win.innerWidth,s=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:l}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:a,bottom:s}=this.scrollParents.y.getBoundingClientRect());let c=MO(this.view);t.clientX-c.left<=i+qp?n=-Wp(i-t.clientX):t.clientX+c.right>=l-qp&&(n=Wp(t.clientX-l)),t.clientY-c.top<=a+qp?r=-Wp(a-t.clientY):t.clientY+c.bottom>=s-qp&&(r=Wp(t.clientY-s)),this.setScrollSpeed(n,r)}up(t){this.dragging==null&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,n){this.scrollSpeed={x:t,y:n},t||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:n}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(t||n)&&this.view.win.scrollBy(t,n),this.dragging===!1&&this.select(this.lastEvent)}select(t){let{view:n}=this,r=Jj(this.atoms,this.style.get(t,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(t){t.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(t)&&setTimeout(()=>this.select(this.lastEvent),20)}}function XK(e,t){let n=e.state.facet(jj);return n.length?n[0](t):pe.mac?t.metaKey:t.ctrlKey}function QK(e,t){let n=e.state.facet(Bj);return n.length?n[0](t):pe.mac?!t.altKey:!t.ctrlKey}function YK(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=mh(e.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let a=0;a<i.length;a++){let l=i[a];if(l.left<=t.clientX&&l.right>=t.clientX&&l.top<=t.clientY&&l.bottom>=t.clientY)return!0}return!1}function GK(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target,r;n!=e.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=Dt.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(t))return!1;return!0}const vi=Object.create(null),Vn=Object.create(null),a3=pe.ie&&pe.ie_version<15||pe.ios&&pe.webkit_version<604;function ZK(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{e.focus(),n.remove(),l3(e,n.value)},50)}function Iv(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function l3(e,t){t=Iv(e.state,kO,t);let{state:n}=e,r,i=1,a=n.toText(t),l=a.lines==n.selection.ranges.length;if(SS!=null&&n.selection.ranges.every(c=>c.empty)&&SS==a.toString()){let c=-1;r=n.changeByRange(f=>{let d=n.doc.lineAt(f.from);if(d.from==c)return{range:f};c=d.from;let p=n.toText((l?a.line(i++).text:t)+n.lineBreak);return{changes:{from:d.from,insert:p},range:J.cursor(f.from+p.length)}})}else l?r=n.changeByRange(c=>{let f=a.line(i++);return{changes:{from:c.from,to:c.to,insert:f.text},range:J.cursor(c.from+f.length)}}):r=n.replaceSelection(a);e.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}Vn.scroll=e=>{let t=e.inputState;t.lastScrollTop=e.scrollDOM.scrollTop,t.lastScrollLeft=e.scrollDOM.scrollLeft,pe.ios&&!t.touchActive&&(t.lastIOSMomentumScroll=Date.now())};Vn.wheel=Vn.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()};vi.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1);Vn.touchstart=(e,t)=>{let n=e.inputState,r=t.targetTouches[0];n.touchActive=!0,n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin("select.pointer")};Vn.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")};Vn.touchend=(e,t)=>{e.inputState.touchActive=!1};vi.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of e.state.facet(zj))if(n=r(e,t),n)break;if(!n&&t.button==0&&(n=eX(e,t)),n){let r=!e.hasFocus;e.inputState.startMouseSelection(new KK(e,t,n,r)),r&&e.observer.ignore(()=>{Tj(e.contentDOM);let a=e.root.activeElement;a&&!a.contains(e.contentDOM)&&a.blur()});let i=e.inputState.mouseSelection;if(i)return i.start(t),i.dragging===!1}else e.inputState.setSelectionOrigin("select.pointer");return!1};function nP(e,t,n,r){if(r==1)return J.cursor(t,n);if(r==2)return MK(e.state,t,n);{let i=e.docView.lineAt(t,n),a=e.state.doc.lineAt(i?i.posAtEnd:t),l=i?i.posAtStart:a.from,s=i?i.posAtEnd:a.to;return s<e.state.doc.length&&s==a.to&&s++,J.undirectionalRange(l,s)}}const JK=pe.ie&&pe.ie_version<=11;let rP=null,iP=0,aP=0;function o3(e){if(!JK)return e.detail;let t=rP,n=aP;return rP=e,aP=Date.now(),iP=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(iP+1)%3:1}function eX(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),r=o3(t),i=e.state.selection;return{update(a){a.docChanged&&(n.pos=a.changes.mapPos(n.pos),i=i.map(a.changes))},get(a,l,s){let c=e.posAndSideAtCoords({x:a.clientX,y:a.clientY},!1),f,d=nP(e,c.pos,c.assoc,r);if(n.pos!=c.pos&&!l){let p=nP(e,n.pos,n.assoc,r),g=Math.min(p.from,d.from),v=Math.max(p.to,d.to);d=g<d.from?J.range(g,v,d.assoc):J.range(v,g,d.assoc)}return l?i.replaceRange(i.main.extend(d.from,d.to,d.assoc)):s&&r==1&&i.ranges.length>1&&(f=tX(i,c.pos))?f:s?i.addRange(d):J.create([d])}}}function tX(e,t){for(let n=0;n<e.ranges.length;n++){let{from:r,to:i}=e.ranges[n];if(r<=t&&i>=t)return J.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}vi.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let i=e.docView.tile.nearest(t.target);if(i&&i.isWidget()){let a=i.posAtStart,l=a+i.length;(a>=n.to||l<=n.from)&&(n=J.undirectionalRange(a,l))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",Iv(e.state,CO,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1};vi.dragend=e=>(e.inputState.draggedContent=null,!1);function lP(e,t,n,r){if(n=Iv(e.state,kO,n),!n)return;let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:a}=e.inputState,l=r&&a&&QK(e,t)?{from:a.from,to:a.to}:null,s={from:i,insert:n},c=e.state.changes(l?[l,s]:s);e.focus(),e.dispatch({changes:c,selection:{anchor:c.mapPos(i,-1),head:c.mapPos(i,1)},userEvent:l?"move.drop":"input.drop"}),e.inputState.draggedContent=null}vi.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,a=()=>{++i==n.length&&lP(e,t,r.filter(l=>l!=null).join(e.state.lineBreak),!1)};for(let l=0;l<n.length;l++){let s=new FileReader;s.onerror=a,s.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(s.result)||(r[l]=s.result),a()},s.readAsText(n[l])}return!0}else{let r=t.dataTransfer.getData("Text");if(r)return lP(e,t,r,!0),!0}return!1};vi.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=a3?null:t.clipboardData;return n?(l3(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(ZK(e),!1)};function nX(e,t){let n=e.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=t,r.focus(),r.selectionEnd=t.length,r.selectionStart=0,setTimeout(()=>{r.remove(),e.focus()},50)}function rX(e){let t=[],n=[],r=!1;for(let i of e.selection.ranges)i.empty||(t.push(e.sliceDoc(i.from,i.to)),n.push(i));if(!t.length){let i=-1;for(let{from:a}of e.selection.ranges){let l=e.doc.lineAt(a);l.number>i&&(t.push(l.text),n.push({from:l.from,to:Math.min(e.doc.length,l.to+1)})),i=l.number}r=!0}return{text:Iv(e,CO,t.join(e.lineBreak)),ranges:n,linewise:r}}let SS=null;vi.copy=vi.cut=(e,t)=>{if(!Kf(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=rX(e.state);if(!n&&!i)return!1;SS=i?n:null,t.type=="cut"&&!e.state.readOnly&&e.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let a=a3?null:t.clipboardData;return a?(a.clearData(),a.setData("text/plain",n),!0):(nX(e,n),!1)};const s3=na.define();function u3(e,t){let n=[];for(let r of e.facet(Uj)){let i=r(e,t);i&&n.push(i)}return n.length?e.update({effects:n,annotations:s3.of(!0)}):null}function c3(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=u3(e.state,t);n?e.dispatch(n):e.update([])}},10)}Vn.focus=e=>{e.inputState.lastFocusTime=Date.now(),!e.scrollDOM.scrollTop&&(e.inputState.lastScrollTop||e.inputState.lastScrollLeft)&&(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),c3(e)};Vn.blur=e=>{e.observer.clearSelectionRange(),c3(e)};Vn.compositionstart=Vn.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange==null&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))};Vn.compositionend=e=>{e.observer.editContext||(e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,pe.chrome&&pe.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(()=>e.observer.flush()):setTimeout(()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])},50))};Vn.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()};vi.beforeinput=(e,t)=>{var n,r;if((t.inputType=="insertText"||t.inputType=="insertCompositionText")&&(e.inputState.insertingText=t.data,e.inputState.insertingTextAt=Date.now()),t.inputType=="insertReplacementText"&&e.observer.editContext){let a=(n=t.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),l=t.getTargetRanges();if(a&&l.length){let s=l[0],c=e.posAtDOM(s.startContainer,s.startOffset),f=e.posAtDOM(s.endContainer,s.endOffset);return PO(e,{from:c,to:f,insert:e.state.toText(a)},null),!0}}let i;if(pe.chrome&&pe.android&&(i=r3.find(a=>a.inputType==t.inputType))&&(e.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let a=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var l;(((l=window.visualViewport)===null||l===void 0?void 0:l.height)||0)>a+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}return pe.ios&&t.inputType=="deleteContentForward"&&e.observer.flushSoon(),pe.safari&&t.inputType=="insertText"&&e.inputState.composing>=0&&setTimeout(()=>Vn.compositionend(e,t),20),!1};const oP=new Set;function iX(e){oP.has(e)||(oP.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}const sP=["pre-wrap","normal","pre-line","break-spaces"];let Vu=!1;function uP(){Vu=!1}class aX{constructor(t){this.lineWrapping=t,this.doc=Je.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-t-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return sP.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let n=!1;for(let r=0;r<t.length;r++){let i=t[r];i<0?r++:this.heightSamples[Math.floor(i*10)]||(n=!0,this.heightSamples[Math.floor(i*10)]=!0)}return n}refresh(t,n,r,i,a,l){let s=sP.indexOf(t)>-1,c=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=s;if(this.lineWrapping=s,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=a,c){this.heightSamples={};for(let f=0;f<l.length;f++){let d=l[f];d<0?f++:this.heightSamples[Math.floor(d*10)]=!0}}return c}}class lX{constructor(t,n){this.from=t,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class ci{constructor(t,n,r,i,a){this.from=t,this.length=n,this.top=r,this.height=i,this._content=a}get type(){return typeof this._content=="number"?kn.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof as?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(t){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new ci(this.from,this.length+t.length,this.top,this.height+t.height,n)}}var pt=(function(e){return e[e.ByPos=0]="ByPos",e[e.ByHeight=1]="ByHeight",e[e.ByPosNoHeight=2]="ByPosNoHeight",e})(pt||(pt={}));const Nm=.001;class Wn{constructor(t,n,r=2){this.length=t,this.height=n,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(t){this.flags=(t?2:0)|this.flags&-3}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>Nm&&(Vu=!0),this.height=t)}replace(t,n,r){return Wn.of(r)}decomposeLeft(t,n){n.push(this)}decomposeRight(t,n){n.push(this)}applyChanges(t,n,r,i){let a=this,l=r.doc;for(let s=i.length-1;s>=0;s--){let{fromA:c,toA:f,fromB:d,toB:p}=i[s],g=a.lineAt(c,pt.ByPosNoHeight,r.setDoc(n),0,0),v=g.to>=f?g:a.lineAt(f,pt.ByPosNoHeight,r,0,0);for(p+=v.to-f,f=v.to;s>0&&g.from<=i[s-1].toA;)c=i[s-1].fromA,d=i[s-1].fromB,s--,c<g.from&&(g=a.lineAt(c,pt.ByPosNoHeight,r,0,0));d+=g.from-c,c=g.from;let y=DO.build(r.setDoc(l),t,d,p);a=sg(a,a.replace(c,f,y))}return a.updateHeight(r,0)}static empty(){return new kr(0,0,0)}static of(t){if(t.length==1)return t[0];let n=0,r=t.length,i=0,a=0;for(;;)if(n==r)if(i>a*2){let s=t[n-1];s.break?t.splice(--n,1,s.left,null,s.right):t.splice(--n,1,s.left,s.right),r+=1+s.break,i-=s.size}else if(a>i*2){let s=t[r];s.break?t.splice(r,1,s.left,null,s.right):t.splice(r,1,s.left,s.right),r+=2+s.break,a-=s.size}else break;else if(i<a){let s=t[n++];s&&(i+=s.size)}else{let s=t[--r];s&&(a+=s.size)}let l=0;return t[n-1]==null?(l=1,n--):t[n]==null&&(l=1,r++),new sX(Wn.of(t.slice(0,n)),l,Wn.of(t.slice(r)))}}function sg(e,t){return e==t?e:(e.constructor!=t.constructor&&(Vu=!0),t)}Wn.prototype.size=1;const oX=Ce.replace({});class f3 extends Wn{constructor(t,n,r){super(t,n),this.deco=r,this.spaceAbove=0}mainBlock(t,n){return new ci(n,this.length,t+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(t,n,r,i){return this.spaceAbove&&t<r+this.spaceAbove?new ci(i,0,r,this.spaceAbove,oX):this.mainBlock(r,i)}lineAt(t,n,r,i,a){let l=this.mainBlock(i,a);return this.spaceAbove?this.blockAt(0,r,i,a).join(l):l}forEachLine(t,n,r,i,a,l){t<=a+this.length&&n>=a&&l(this.lineAt(0,pt.ByPos,r,i,a))}setMeasuredHeight(t){let n=t.heights[t.index++];n<0?(this.spaceAbove=-n,n=t.heights[t.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(t,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setMeasuredHeight(i),this.outdated=!1,this}toString(){return`block(${this.length})`}}class kr extends f3{constructor(t,n,r){super(t,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=r}mainBlock(t,n){return new ci(n,this.length,t+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(t,n,r){let i=r[0];return r.length==1&&(i instanceof kr||i instanceof xn&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof xn?i=new kr(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):Wn.of(r)}updateHeight(t,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setMeasuredHeight(i):(r||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class xn extends Wn{constructor(t){super(t,0)}heightMetrics(t,n){let r=t.doc.lineAt(n).number,i=t.doc.lineAt(n+this.length).number,a=i-r+1,l,s=0;if(t.lineWrapping){let c=Math.min(this.height,t.lineHeight*a);l=c/a,this.length>a+1&&(s=(this.height-c)/(this.length-a-1))}else l=this.height/a;return{firstLine:r,lastLine:i,perLine:l,perChar:s}}blockAt(t,n,r,i){let{firstLine:a,lastLine:l,perLine:s,perChar:c}=this.heightMetrics(n,i);if(n.lineWrapping){let f=i+(t<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(t-r)/this.height))*this.length)),d=n.doc.lineAt(f),p=s+d.length*c,g=Math.max(r,t-p/2);return new ci(d.from,d.length,g,p,0)}else{let f=Math.max(0,Math.min(l-a,Math.floor((t-r)/s))),{from:d,length:p}=n.doc.line(a+f);return new ci(d,p,r+s*f,s,0)}}lineAt(t,n,r,i,a){if(n==pt.ByHeight)return this.blockAt(t,r,i,a);if(n==pt.ByPosNoHeight){let{from:v,to:y}=r.doc.lineAt(t);return new ci(v,y-v,0,0,0)}let{firstLine:l,perLine:s,perChar:c}=this.heightMetrics(r,a),f=r.doc.lineAt(t),d=s+f.length*c,p=f.number-l,g=i+s*p+c*(f.from-a-p);return new ci(f.from,f.length,Math.max(i,Math.min(g,i+this.height-d)),d,0)}forEachLine(t,n,r,i,a,l){t=Math.max(t,a),n=Math.min(n,a+this.length);let{firstLine:s,perLine:c,perChar:f}=this.heightMetrics(r,a);for(let d=t,p=i;d<=n;){let g=r.doc.lineAt(d);if(d==t){let y=g.number-s;p+=c*y+f*(t-a-y)}let v=c+f*g.length;l(new ci(g.from,g.length,p,v,0)),p+=v,d=g.to+1}}replace(t,n,r){let i=this.length-n;if(i>0){let a=r[r.length-1];a instanceof xn?r[r.length-1]=new xn(a.length+i):r.push(null,new xn(i-1))}if(t>0){let a=r[0];a instanceof xn?r[0]=new xn(t+a.length):r.unshift(new xn(t-1),null)}return Wn.of(r)}decomposeLeft(t,n){n.push(new xn(t-1),null)}decomposeRight(t,n){n.push(null,new xn(this.length-t-1))}updateHeight(t,n=0,r=!1,i){let a=n+this.length;if(i&&i.from<=n+this.length&&i.more){let l=[],s=Math.max(n,i.from),c=-1;for(i.from>n&&l.push(new xn(i.from-n-1).updateHeight(t,n));s<=a&&i.more;){let d=t.doc.lineAt(s).length;l.length&&l.push(null);let p=i.heights[i.index++],g=0;p<0&&(g=-p,p=i.heights[i.index++]),c==-1?c=p:Math.abs(p-c)>=Nm&&(c=-2);let v=new kr(d,p,g);v.outdated=!1,l.push(v),s+=d+1}s<=a&&l.push(null,new xn(a-s).updateHeight(t,s));let f=Wn.of(l);return(c<0||Math.abs(f.height-this.height)>=Nm||Math.abs(c-this.heightMetrics(t,n).perLine)>=Nm)&&(Vu=!0),sg(this,f)}else(r||this.outdated)&&(this.setHeight(t.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class sX extends Wn{constructor(t,n,r){super(t.length+n+r.length,t.height+r.height,n|(t.outdated||r.outdated?2:0)),this.left=t,this.right=r,this.size=t.size+r.size}get break(){return this.flags&1}blockAt(t,n,r,i){let a=r+this.left.height;return t<a?this.left.blockAt(t,n,r,i):this.right.blockAt(t,n,a,i+this.left.length+this.break)}lineAt(t,n,r,i,a){let l=i+this.left.height,s=a+this.left.length+this.break,c=n==pt.ByHeight?t<l:t<s,f=c?this.left.lineAt(t,n,r,i,a):this.right.lineAt(t,n,r,l,s);if(this.break||(c?f.to<s:f.from>s))return f;let d=n==pt.ByPosNoHeight?pt.ByPosNoHeight:pt.ByPos;return c?f.join(this.right.lineAt(s,d,r,l,s)):this.left.lineAt(s,d,r,i,a).join(f)}forEachLine(t,n,r,i,a,l){let s=i+this.left.height,c=a+this.left.length+this.break;if(this.break)t<c&&this.left.forEachLine(t,n,r,i,a,l),n>=c&&this.right.forEachLine(t,n,r,s,c,l);else{let f=this.lineAt(c,pt.ByPos,r,i,a);t<f.from&&this.left.forEachLine(t,f.from-1,r,i,a,l),f.to>=t&&f.from<=n&&l(f),n>f.to&&this.right.forEachLine(f.to+1,n,r,s,c,l)}}replace(t,n,r){let i=this.left.length+this.break;if(n<i)return this.balanced(this.left.replace(t,n,r),this.right);if(t>this.left.length)return this.balanced(this.left,this.right.replace(t-i,n-i,r));let a=[];t>0&&this.decomposeLeft(t,a);let l=a.length;for(let s of r)a.push(s);if(t>0&&cP(a,l-1),n<this.length){let s=a.length;this.decomposeRight(n,a),cP(a,s)}return Wn.of(a)}decomposeLeft(t,n){let r=this.left.length;if(t<=r)return this.left.decomposeLeft(t,n);n.push(this.left),this.break&&(r++,t>=r&&n.push(null)),t>r&&this.right.decomposeLeft(t-r,n)}decomposeRight(t,n){let r=this.left.length,i=r+this.break;if(t>=i)return this.right.decomposeRight(t-i,n);t<r&&this.left.decomposeRight(t,n),this.break&&t<i&&n.push(null),n.push(this.right)}balanced(t,n){return t.size>2*n.size||n.size>2*t.size?Wn.of(this.break?[t,null,n]:[t,n]):(this.left=sg(this.left,t),this.right=sg(this.right,n),this.setHeight(t.height+n.height),this.outdated=t.outdated||n.outdated,this.size=t.size+n.size,this.length=t.length+this.break+n.length,this)}updateHeight(t,n=0,r=!1,i){let{left:a,right:l}=this,s=n+a.length+this.break,c=null;return i&&i.from<=n+a.length&&i.more?c=a=a.updateHeight(t,n,r,i):a.updateHeight(t,n,r),i&&i.from<=s+l.length&&i.more?c=l=l.updateHeight(t,s,r,i):l.updateHeight(t,s,r),c?this.balanced(a,l):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function cP(e,t){let n,r;e[t]==null&&(n=e[t-1])instanceof xn&&(r=e[t+1])instanceof xn&&e.splice(t-1,3,new xn(n.length+1+r.length))}const uX=5;class DO{constructor(t,n){this.pos=t,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof kr?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new kr(r-this.pos,-1,0)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(t,n,r){if(t<n||r.heightRelevant){let i=r.widget?r.widget.estimatedHeight:0,a=r.widget?r.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let l=n-t;r.block?this.addBlock(new f3(l,i,r)):(l||a||i>=uX)&&this.addLineDeco(i,a,l)}else n>t&&this.span(t,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:t,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=n,this.writtenTo<t&&((this.writtenTo<t-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,t-1)),this.nodes.push(null)),this.pos>t&&this.nodes.push(new kr(this.pos-t,-1,0)),this.writtenTo=this.pos}blankContent(t,n){let r=new xn(n-t);return this.oracle.doc.lineAt(t).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof kr)return t;let n=new kr(0,-1,0);return this.nodes.push(n),n}addBlock(t){this.enterLine();let n=t.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,n&&n.endSide>0&&(this.covering=t)}addLineDeco(t,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,t),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(t){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof kr)&&!this.isCovered?this.nodes.push(new kr(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=t;for(let i of this.nodes)i instanceof kr&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(t,n,r,i){let a=new DO(r,t);return ze.spans(n,r,i,a,0),a.finish(r)}}function cX(e,t,n){let r=new fX;return ze.compare(e,t,n,r,0),r.changes}class fX{constructor(){this.changes=[]}compareRange(){}comparePoint(t,n,r,i){(t<n||r&&r.heightRelevant||i&&i.heightRelevant)&&Du(t,n,this.changes,5)}}function hX(e,t){let n=e.getBoundingClientRect(),r=e.ownerDocument,i=r.defaultView||window,a=Math.max(0,n.left),l=Math.min(i.innerWidth,n.right),s=Math.max(0,n.top),c=Math.min(i.innerHeight,n.bottom);for(let f=e.parentNode;f&&f!=r.body;)if(f.nodeType==1){let d=f,p=window.getComputedStyle(d);if((d.scrollHeight>d.clientHeight||d.scrollWidth>d.clientWidth)&&p.overflow!="visible"){let g=d.getBoundingClientRect();a=Math.max(a,g.left),l=Math.min(l,g.right),s=Math.max(s,g.top),c=Math.min(f==e.parentNode?i.innerHeight:c,g.bottom)}f=p.position=="absolute"||p.position=="fixed"?d.offsetParent:d.parentNode}else if(f.nodeType==11)f=f.host;else break;return{left:a-n.left,right:Math.max(a,l)-n.left,top:s-(n.top+t),bottom:Math.max(s,c)-(n.top+t)}}function dX(e){let t=e.getBoundingClientRect(),n=e.ownerDocument.defaultView||window;return t.left<n.innerWidth&&t.right>0&&t.top<n.innerHeight&&t.bottom>0}function pX(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class wx{constructor(t,n,r,i){this.from=t,this.to=n,this.size=r,this.displaySize=i}static same(t,n){if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++){let i=t[r],a=n[r];if(i.from!=a.from||i.to!=a.to||i.size!=a.size)return!1}return!0}draw(t,n){return Ce.replace({widget:new mX(this.displaySize*(n?t.scaleY:t.scaleX),n)}).range(this.from,this.to)}}class mX extends ia{constructor(t,n){super(),this.size=t,this.vertical=n}eq(t){return t.size==this.size&&t.vertical==this.vertical}toDOM(){let t=document.createElement("div");return this.vertical?t.style.height=this.size+"px":(t.style.width=this.size+"px",t.style.height="2px",t.style.display="inline-block"),t}get estimatedHeight(){return this.vertical?this.size:-1}}class fP{constructor(t,n){this.view=t,this.state=n,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=hP,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=ft.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let r=n.facet(EO).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new aX(r),this.stateDeco=dP(n),this.heightMap=Wn.empty().applyChanges(this.stateDeco,Je.empty,this.heightOracle.setDoc(n.doc),[new Xr(0,0,0,n.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Ce.set(this.lineGaps.map(i=>i.draw(this,!1))),this.scrollParent=t.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!t.some(({from:a,to:l})=>i>=a&&i<=l)){let{from:a,to:l}=this.lineBlockAt(i);t.push(new Vp(a,l))}}return this.viewports=t.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?hP:new RO(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,t=>{this.viewportLines.push(jf(t,this.scaler))})}update(t,n=null){this.state=t.state;let r=this.stateDeco;this.stateDeco=dP(this.state);let i=t.changedRanges,a=Xr.extendWithRanges(i,cX(r,this.stateDeco,t?t.changes:Qt.empty(this.state.doc.length))),l=this.heightMap.height,s=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);uP(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),a),(this.heightMap.height!=l||Vu)&&(t.flags|=2),s?(this.scrollAnchorPos=t.changes.mapPos(s.from,-1),this.scrollAnchorHeight=s.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=l);let c=a.length?this.mapViewport(this.viewport,t.changes):this.viewport;(n&&(n.range.head<c.from||n.range.head>c.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,n));let f=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,t.flags|=this.updateForViewport(),(f||!t.changes.empty||t.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(t.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(t.selectionSet||t.focusChanged)&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(qj)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:t}=this,n=t.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,a=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?ft.RTL:ft.LTR;let l=this.heightOracle.mustRefreshForWrapping(a)||this.mustMeasureContent==="refresh",s=n.getBoundingClientRect(),c=l||this.mustMeasureContent||this.contentDOMHeight!=s.height;this.contentDOMHeight=s.height,this.mustMeasureContent=!1;let f=0,d=0;if(s.width&&s.height){let{scaleX:T,scaleY:M}=Cj(n,s);(T>.005&&Math.abs(this.scaleX-T)>.005||M>.005&&Math.abs(this.scaleY-M)>.005)&&(this.scaleX=T,this.scaleY=M,f|=16,l=c=!0)}let p=(parseInt(r.paddingTop)||0)*this.scaleY,g=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=p||this.paddingBottom!=g)&&(this.paddingTop=p,this.paddingBottom=g,f|=18),this.editorWidth!=t.scrollDOM.clientWidth&&(i.lineWrapping&&(c=!0),this.editorWidth=t.scrollDOM.clientWidth,f|=16);let v=Ej(this.view.contentDOM,!1).y;v!=this.scrollParent&&(this.scrollParent=v,this.scrollAnchorHeight=-1,this.scrollOffset=0);let y=this.getScrollOffset();this.scrollOffset!=y&&(this.scrollAnchorHeight=-1,this.scrollOffset=y),this.scrolledToBottom=Mj(this.scrollParent||t.win);let x=(this.printing?pX:hX)(n,this.paddingTop),w=x.top-this.pixelViewport.top,A=x.bottom-this.pixelViewport.bottom;this.pixelViewport=x;let k=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(k!=this.inView&&(this.inView=k,k&&(c=!0)),!this.inView&&!this.scrollTarget&&!dX(t.dom))return 0;let E=s.width;if((this.contentDOMWidth!=E||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=s.width,this.editorHeight=t.scrollDOM.clientHeight,f|=16),c){let T=t.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(T)&&(l=!0),l||i.lineWrapping&&Math.abs(E-this.contentDOMWidth)>i.charWidth){let{lineHeight:M,charWidth:R,textHeight:L}=t.docView.measureTextSize();l=M>0&&i.refresh(a,M,R,L,Math.max(5,E/R),T),l&&(t.docView.minWidth=0,f|=16)}w>0&&A>0?d=Math.max(w,A):w<0&&A<0&&(d=Math.min(w,A)),uP();for(let M of this.viewports){let R=M.from==this.viewport.from?T:t.docView.measureVisibleLineHeights(M);this.heightMap=(l?Wn.empty().applyChanges(this.stateDeco,Je.empty,this.heightOracle,[new Xr(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(i,0,l,new lX(M.from,R))}Vu&&(f|=2)}let P=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return P&&(f&2&&(f|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),f|=this.updateForViewport()),(f&2||P)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(l?[]:this.lineGaps,t)),f|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),f}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,n){let r=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),i=this.heightMap,a=this.heightOracle,{visibleTop:l,visibleBottom:s}=this,c=new Vp(i.lineAt(l-r*1e3,pt.ByHeight,a,0,0).from,i.lineAt(s+(1-r)*1e3,pt.ByHeight,a,0,0).to);if(n){let{head:f}=n.range;if(f<c.from||f>c.to){let d=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),p=i.lineAt(f,pt.ByPos,a,0,0),g;n.y=="center"?g=(p.top+p.bottom)/2-d/2:n.y=="start"||n.y=="nearest"&&f<c.from?g=p.top:g=p.bottom-d,c=new Vp(i.lineAt(g-1e3/2,pt.ByHeight,a,0,0).from,i.lineAt(g+d+1e3/2,pt.ByHeight,a,0,0).to)}}return c}mapViewport(t,n){let r=n.mapPos(t.from,-1),i=n.mapPos(t.to,1);return new Vp(this.heightMap.lineAt(r,pt.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,pt.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:t,to:n},r=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(t,pt.ByPos,this.heightOracle,0,0),{bottom:a}=this.heightMap.lineAt(n,pt.ByPos,this.heightOracle,0,0),{visibleTop:l,visibleBottom:s}=this;return(t==0||i<=l-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||a>=s+Math.max(10,Math.min(r,250)))&&i>l-2*1e3&&a<s+2*1e3}mapLineGaps(t,n){if(!t.length||n.empty)return t;let r=[];for(let i of t)n.touchesRange(i.from,i.to)||r.push(new wx(n.mapPos(i.from),n.mapPos(i.to),i.size,i.displaySize));return r}ensureLineGaps(t,n){let r=this.heightOracle.lineWrapping,i=r?1e4:2e3,a=i>>1,l=i<<1;if(this.defaultTextDirection!=ft.LTR&&!r)return[];let s=[],c=(d,p,g,v)=>{if(p-d<a)return;let y=this.state.selection.main,x=[y.from];y.empty||x.push(y.to);for(let A of x)if(A>d&&A<p){c(d,A-10,g,v),c(A+10,p,g,v);return}let w=vX(t,A=>A.from>=g.from&&A.to<=g.to&&Math.abs(A.from-d)<a&&Math.abs(A.to-p)<a&&!x.some(k=>A.from<k&&A.to>k));if(!w){if(p<g.to&&n&&r&&n.visibleRanges.some(E=>E.from<=p&&E.to>=p)){let E=n.moveToLineBoundary(J.cursor(p),!1,!0).head;E>d&&(p=E)}let A=this.gapSize(g,d,p,v),k=r||A<2e6?A:2e6;w=new wx(d,p,A,k)}s.push(w)},f=d=>{if(d.length<l||d.type!=kn.Text)return;let p=gX(d.from,d.to,this.stateDeco);if(p.total<l)return;let g=this.scrollTarget?this.scrollTarget.range.head:null,v,y;if(r){let x=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,w,A;if(g!=null){let k=Xp(p,g),E=((this.visibleBottom-this.visibleTop)/2+x)/d.height;w=k-E,A=k+E}else w=(this.visibleTop-d.top-x)/d.height,A=(this.visibleBottom-d.top+x)/d.height;v=Kp(p,w),y=Kp(p,A)}else{let x=p.total*this.heightOracle.charWidth,w=i*this.heightOracle.charWidth,A=0;if(x>2e6)for(let M of t)M.from>=d.from&&M.from<d.to&&M.size!=M.displaySize&&M.from*this.heightOracle.charWidth+A<this.pixelViewport.left&&(A=M.size-M.displaySize);let k=this.pixelViewport.left+A,E=this.pixelViewport.right+A,P,T;if(g!=null){let M=Xp(p,g),R=((E-k)/2+w)/x;P=M-R,T=M+R}else P=(k-w)/x,T=(E+w)/x;v=Kp(p,P),y=Kp(p,T)}v>d.from&&c(d.from,v,d,p),y<d.to&&c(y,d.to,d,p)};for(let d of this.viewportLines)Array.isArray(d.type)?d.type.forEach(f):f(d);return s}gapSize(t,n,r,i){let a=Xp(i,r)-Xp(i,n);return this.heightOracle.lineWrapping?t.height*a:i.total*this.heightOracle.charWidth*a}updateLineGaps(t){wx.same(t,this.lineGaps)||(this.lineGaps=t,this.lineGapDeco=Ce.set(t.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(t){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let r=[];ze.spans(n,this.viewport.from,this.viewport.to,{span(a,l){r.push({from:a,to:l})},point(){}},20);let i=0;if(r.length!=this.visibleRanges.length)i=12;else for(let a=0;a<r.length&&!(i&8);a++){let l=this.visibleRanges[a],s=r[a];(l.from!=s.from||l.to!=s.to)&&(i|=4,t&&t.mapPos(l.from,-1)==s.from&&t.mapPos(l.to,1)==s.to||(i|=8))}return this.visibleRanges=r,i}lineBlockAt(t){return t>=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(n=>n.from<=t&&n.to>=t)||jf(this.heightMap.lineAt(t,pt.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=t&&n.bottom>=t)||jf(this.heightMap.lineAt(this.scaler.fromDOM(t),pt.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(t){let n=this.lineBlockAtHeight(t+8);return n.from>=this.viewport.from||this.viewportLines[0].top-t>200?n:this.viewportLines[0]}elementAtHeight(t){return jf(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Vp{constructor(t,n){this.from=t,this.to=n}}function gX(e,t,n){let r=[],i=e,a=0;return ze.spans(n,e,t,{span(){},point(l,s){l>i&&(r.push({from:i,to:l}),a+=l-i),i=s}},20),i<t&&(r.push({from:i,to:t}),a+=t-i),{total:a,ranges:r}}function Kp({total:e,ranges:t},n){if(n<=0)return t[0].from;if(n>=1)return t[t.length-1].to;let r=Math.floor(e*n);for(let i=0;;i++){let{from:a,to:l}=t[i],s=l-a;if(r<=s)return a+r;r-=s}}function Xp(e,t){let n=0;for(let{from:r,to:i}of e.ranges){if(t<=i){n+=t-r;break}n+=i-r}return n/e.total}function vX(e,t){for(let n of e)if(t(n))return n}const hP={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function dP(e){let t=e.facet(Rv).filter(r=>typeof r!="function"),n=e.facet(TO).filter(r=>typeof r!="function");return n.length&&t.push(ze.join(n)),t}class RO{constructor(t,n,r){let i=0,a=0,l=0;this.viewports=r.map(({from:s,to:c})=>{let f=n.lineAt(s,pt.ByPos,t,0,0).top,d=n.lineAt(c,pt.ByPos,t,0,0).bottom;return i+=d-f,{from:s,to:c,top:f,bottom:d,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let s of this.viewports)s.domTop=l+(s.top-a)*this.scale,l=s.domBottom=s.domTop+(s.bottom-s.top),a=s.bottom}toDOM(t){for(let n=0,r=0,i=0;;n++){let a=n<this.viewports.length?this.viewports[n]:null;if(!a||t<a.top)return i+(t-r)*this.scale;if(t<=a.bottom)return a.domTop+(t-a.top);r=a.bottom,i=a.domBottom}}fromDOM(t){for(let n=0,r=0,i=0;;n++){let a=n<this.viewports.length?this.viewports[n]:null;if(!a||t<a.domTop)return r+(t-i)/this.scale;if(t<=a.domBottom)return a.top+(t-a.domTop);r=a.bottom,i=a.domBottom}}eq(t){return t instanceof RO?this.scale==t.scale&&this.viewports.length==t.viewports.length&&this.viewports.every((n,r)=>n.from==t.viewports[r].from&&n.to==t.viewports[r].to):!1}}function jf(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new ci(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(i=>jf(i,t)):e._content)}const Qp=me.define({combine:e=>e.join(" ")}),wS=me.define({combine:e=>e.indexOf(!0)>-1}),OS=Xl.newName(),h3=Xl.newName(),d3=Xl.newName(),p3={"&light":"."+h3,"&dark":"."+d3};function AS(e,t,n){return new Xl(t,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return e;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):e+" "+r}})}const yX=AS("."+OS,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},p3),bX={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Ox=pe.ie&&pe.ie_version<=11;class xX{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new Q7,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(pe.ie&&pe.ie_version<=11||pe.ios&&t.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&pe.android&&t.constructor.EDIT_CONTEXT!==!1&&!(pe.chrome&&pe.chrome_version<126)&&(this.editContext=new wX(t),t.state.facet(Ea)&&(t.contentDOM.editContext=this.editContext.editContext)),Ox&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(t.scrollDOM)),this.addWindowListeners(this.win=t.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(t){(t.type=="change"||!t.type)&&!t.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((n,r)=>n!=t[r]))){this.gapIntersection.disconnect();for(let n of t)this.gapIntersection.observe(n);this.gaps=t}}onSelectionChange(t){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(Ea)?r.root.activeElement!=this.dom:!Kf(this.dom,i))return;let a=i.anchorNode&&r.docView.tile.nearest(i.anchorNode);if(a&&a.isWidget()&&a.widget.ignoreEvent(t)){n||(this.selectionChanged=!1);return}(pe.ie&&pe.ie_version<=11||pe.android&&pe.chrome)&&!r.state.selection.main.empty&&i.focusNode&&Qf(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,n=mh(t.root);if(!n)return!1;let r=pe.safari&&t.root.nodeType==11&&t.root.activeElement==this.dom&&SX(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=Kf(this.dom,r);return i&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime<Date.now()-300&&G7(this.dom,r)?(this.view.inputState.lastFocusTime=0,t.docView.updateSelection(),!1):(this.selectionRange.setRange(r),i&&(this.selectionChanged=!0),!0)}setSelectionRange(t,n){this.selectionRange.set(t.node,t.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let t=0,n=null;for(let r=this.dom;r;)if(r.nodeType==1)!n&&t<this.scrollTargets.length&&this.scrollTargets[t]==r?t++:n||(n=this.scrollTargets.slice(0,t)),n&&n.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(t<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,t)),n){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=n)r.addEventListener("scroll",this.onScroll)}}ignore(t){if(!this.active)return t();try{return this.stop(),t()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,bX),Ox&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Ox&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(t,n){var r;if(!this.delayedAndroidKey){let i=()=>{let a=this.delayedAndroidKey;a&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=a.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&a.force&&Ru(this.dom,a.key,a.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||t=="Enter")&&(this.delayedAndroidKey={key:t,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let a of t){let l=this.readMutation(a);l&&(l.typeOver&&(i=!0),n==-1?{from:n,to:r}=l:(n=Math.min(l.from,n),r=Math.max(l.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:t,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&Kf(this.dom,this.selectionRange);if(t<0&&!i)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let a=new BK(this.view,t,n,r);return this.view.docView.domChanged={newSel:a.newSel?a.newSel.main:null},a}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=t3(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!og(this.view.state.selection,n.newSel.main))&&this.view.update([]),i}readMutation(t){let n=this.view.docView.tile.nearest(t.target);if(!n||n.isWidget())return null;if(n.markDirty(t.type=="attributes"),t.type=="childList"){let r=pP(n,t.previousSibling||t.target.previousSibling,-1),i=pP(n,t.nextSibling||t.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return t.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(Ea)!=t.state.facet(Ea)&&(t.view.contentDOM.editContext=t.state.facet(Ea)?this.editContext.editContext:null))}destroy(){var t,n,r;this.stop(),(t=this.intersection)===null||t===void 0||t.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function pP(e,t,n){for(;t;){let r=Dt.get(t);if(r&&r.parent==e)return r;let i=t.parentNode;t=i!=e.dom?i:n>0?t.nextSibling:t.previousSibling}return null}function mP(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,l=e.docView.domAtPos(e.state.selection.main.anchor,1);return Qf(l.node,l.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function SX(e,t){if(t.getComposedRanges){let i=t.getComposedRanges(e.root)[0];if(i)return mP(e,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return e.contentDOM.addEventListener("beforeinput",r,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",r,!0),n?mP(e,n):null}class wX{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);let n=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=r=>{let i=t.state.selection.main,{anchor:a,head:l}=i,s=this.toEditorPos(r.updateRangeStart),c=this.toEditorPos(r.updateRangeEnd);t.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:s,drifted:!1});let f=c-s>r.text.length;s==this.from&&a<this.from?s=a:c==this.to&&a>this.to&&(c=a);let d=n3(t.state.sliceDoc(s,c),r.text,(f?i.from:i.to)-s,f?"end":null);if(!d){let g=J.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));og(g,i)||t.dispatch({selection:g,userEvent:"select"});return}let p={from:d.from+s,to:d.toA+s,insert:Je.of(r.text.slice(d.from,d.toB).split(`
|
|
64
|
+
`))};if((pe.mac||pe.android)&&p.from==l-1&&/^\. ?$/.test(r.text)&&t.contentDOM.getAttribute("autocorrect")=="off"&&(p={from:s,to:c,insert:Je.of([r.text.replace("."," ")])}),this.pendingContextChange=p,!t.state.readOnly){let g=this.to-this.from+(p.to-p.from+p.insert.length);PO(t,p,J.single(this.toEditorPos(r.selectionStart,g),this.toEditorPos(r.selectionEnd,g)))}this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state)),p.from<p.to&&!p.insert.length&&t.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(n.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let i=[],a=null;for(let l=this.toEditorPos(r.rangeStart),s=this.toEditorPos(r.rangeEnd);l<s;l++){let c=t.coordsForChar(l);a=c&&new DOMRect(c.left,c.top,c.right-c.left,c.bottom-c.top)||a||new DOMRect,i.push(a)}n.updateCharacterBounds(r.rangeStart,i)},this.handlers.textformatupdate=r=>{let i=[];for(let a of r.getTextFormats()){let l=a.underlineStyle,s=a.underlineThickness;if(!/none/i.test(l)&&!/none/i.test(s)){let c=this.toEditorPos(a.rangeStart),f=this.toEditorPos(a.rangeEnd);if(c<f){let d=`text-decoration: underline ${/^[a-z]/.test(l)?l+" ":l=="Dashed"?"dashed ":l=="Squiggle"?"wavy ":""}${/thin/i.test(s)?1:2}px`;i.push(Ce.mark({attributes:{style:d}}).range(c,f))}}}t.dispatch({effects:Vj.of(Ce.set(i))})},this.handlers.compositionstart=()=>{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(t.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{let i=mh(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let n=0,r=!1,i=this.pendingContextChange;return t.changes.iterChanges((a,l,s,c,f)=>{if(r)return;let d=f.length-(l-a);if(i&&l>=i.to)if(i.from==a&&i.to==l&&i.insert.eq(f)){i=this.pendingContextChange=null,n+=d,this.to+=d;return}else i=null,this.revertPending(t.state);if(a+=n,l+=n,l<=this.from)this.from+=d,this.to+=d;else if(a<this.to){if(a<this.from||l>this.to||this.to-this.from+f.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(a),this.toContextPos(l),f.toString()),this.to+=d}n+=d}),i&&!r&&this.revertPending(t.state),!r}update(t){let n=this.pendingContextChange,r=t.startState.selection.main;this.composing&&(this.composing.drifted||!t.changes.touchesRange(r.from,r.to)&&t.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):!this.applyEdits(t)||!this.rangeIsValid(t.state)?(this.pendingContextChange=null,this.reset(t.state)):(t.docChanged||t.selectionSet||n)&&this.setSelection(t.state),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:n}=t.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(t.doc.length,n+1e4)}reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t)}revertPending(t){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),t.doc.sliceString(n.from,n.to))}setSelection(t){let{main:n}=t.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),i=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(t){let{head:n}=t.selection.main;return!(this.from>0&&n-this.from<500||this.to<t.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(t,n=this.to-this.from){t=Math.min(t,n);let r=this.composing;return r&&r.drifted?r.editorBase+(t-r.contextBase):t+this.from}toContextPos(t){let n=this.composing;return n&&n.drifted?n.contextBase+(t-n.editorBase):t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class de{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:r}=t;this.dispatchTransactions=t.dispatchTransactions||r&&(i=>i.forEach(a=>r(a,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=t.root||Y7(t.parent)||document,this.viewState=new fP(this,t.state||qe.create(t)),t.scrollTo&&t.scrollTo.is(Fp)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Su).map(i=>new vx(i));for(let i of this.plugins)i.update(this);this.observer=new xX(this),this.inputState=new UK(this),this.inputState.ensureHandlers(this.plugins),this.docView=new ZM(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...t){let n=t.length==1&&t[0]instanceof Gt?t:t.length==1&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(n,this)}update(t){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,a=this.state;for(let g of t){if(g.startState!=a)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");a=g.state}if(this.destroyed){this.viewState.state=a;return}let l=this.hasFocus,s=0,c=null;t.some(g=>g.annotation(s3))?(this.inputState.notifiedFocused=l,s=1):l!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=l,c=u3(a,l),c||(s=1));let f=this.observer.delayedAndroidKey,d=null;if(f?(this.observer.clearDelayedAndroidKey(),d=this.observer.readChange(),(d&&!this.state.doc.eq(a.doc)||!this.state.selection.eq(a.selection))&&(d=null)):this.observer.clear(),a.facet(qe.phrases)!=this.state.facet(qe.phrases))return this.setState(a);i=ig.create(this,a,t),i.flags|=s;let p=this.viewState.scrollTarget;try{this.updateState=2;for(let g of t){if(p&&(p=p.map(g.changes)),g.scrollIntoView){let{main:v}=g.state.selection,{x:y,y:x}=this.state.facet(de.cursorScrollMargin);p=new _u(v.empty?v:J.cursor(v.head,v.head>v.anchor?-1:1),"nearest","nearest",x,y)}for(let v of g.effects)v.is(Fp)&&(p=v.value.clip(this.state))}this.viewState.update(i,p),this.bidiCache=ug.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(Lf)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(n,t.some(g=>g.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(Qp)!=i.state.facet(Qp)&&(this.viewState.mustMeasureContent=!0),(n||r||p||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let g of this.state.facet(vS))try{g(i)}catch(v){ar(this.state,v,"update listener")}(c||d)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),d&&!t3(this,d)&&f.force&&Ru(this.contentDOM,f.key,f.keyCode)})}setState(t){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=t;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new fP(this,t),this.plugins=t.facet(Su).map(r=>new vx(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new ZM(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(t){let n=t.startState.facet(Su),r=t.state.facet(Su);if(n!=r){let i=[];for(let a of r){let l=n.indexOf(a);if(l<0)i.push(new vx(a));else{let s=this.plugins[l];s.mustUpdate=t,i.push(s)}}for(let a of this.plugins)a.mustUpdate!=t&&a.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=t;for(let i=0;i<this.plugins.length;i++)this.plugins[i].update(this);n!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let t of this.plugins){let n=t.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(r){ar(this.state,r,"doc view update listener")}}}measure(t=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,t&&this.observer.forceFlush();let n=null,r=this.viewState.scrollParent,i=this.viewState.getScrollOffset(),{scrollAnchorPos:a,scrollAnchorHeight:l}=this.viewState;Math.abs(i-this.viewState.scrollOffset)>1&&(l=-1),this.viewState.scrollAnchorHeight=-1;try{for(let s=0;;s++){if(l<0)if(Mj(r||this.win))a=-1,l=this.viewState.heightMap.height;else{let v=this.viewState.scrollAnchorAt(i);a=v.from,l=v.top}this.updateState=1;let c=this.viewState.measure();if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(s>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let f=[];c&4||([this.measureRequests,f]=[f,this.measureRequests]);let d=f.map(v=>{try{return v.read(this)}catch(y){return ar(this.state,y),gP}}),p=ig.create(this,this.state,[]),g=!1;p.flags|=c,n?n.flags|=c:n=p,this.updateState=2,p.empty||(this.updatePlugins(p),this.inputState.update(p),this.updateAttrs(),g=this.docView.update(p),g&&this.docViewUpdate());for(let v=0;v<f.length;v++)if(d[v]!=gP)try{let y=f[v];y.write&&y.write(d[v],this)}catch(y){ar(this.state,y)}if(g&&this.docView.updateSelection(!0),!p.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,l=-1;continue}else{let y=((a<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(a).top)-l)/this.scaleY;if((y>1||y<-1)&&!(pe.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(r==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){i=i+y,r?r.scrollTop+=y:this.win.scrollBy(0,y),l=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let s of this.state.facet(vS))s(n)}get themeClasses(){return OS+" "+(this.state.facet(wS)?d3:h3)+" "+this.state.facet(Qp)}updateAttrs(){let t=vP(this,Kj,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Ea)?"true":"false",class:"cm-content",style:`${pe.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),vP(this,EO,n);let r=this.observer.ignore(()=>{let i=VM(this.contentDOM,this.contentAttrs,n),a=VM(this.dom,this.editorAttrs,t);return i||a});return this.editorAttrs=t,this.contentAttrs=n,r}showAnnouncements(t){let n=!0;for(let r of t)for(let i of r.effects)if(i.is(de.announce)){n&&(this.announceDOM.textContent=""),n=!1;let a=this.announceDOM.appendChild(document.createElement("div"));a.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(Lf);let t=this.state.facet(de.cspNonce);Xl.mount(this.root,this.styleModules.concat(yX).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(this.measureRequests.indexOf(t)>-1)return;if(t.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===t.key){this.measureRequests[n]=t;return}}this.measureRequests.push(t)}}plugin(t){let n=this.pluginMap.get(t);return(n===void 0||n&&n.plugin!=t)&&this.pluginMap.set(t,n=this.plugins.find(r=>r.plugin==t)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,n,r){return Sx(this,t,JM(this,t,n,r))}moveByGroup(t,n){return Sx(this,t,JM(this,t,n,r=>RK(this,t.head,r)))}visualLineSide(t,n){let r=this.bidiSpans(t),i=this.textDirectionAt(t.from),a=r[n?r.length-1:0];return J.cursor(a.side(n,i)+t.from,a.forward(!n,i)?1:-1)}moveToLineBoundary(t,n,r=!0){return DK(this,t,n,r)}moveVertically(t,n,r){return Sx(this,t,_K(this,t,n,r))}domAtPos(t,n=1){return this.docView.domAtPos(t,n)}posAtDOM(t,n=0){return this.docView.posFromDOM(t,n)}posAtCoords(t,n=!0){this.readMeasured();let r=xS(this,t,n);return r&&r.pos}posAndSideAtCoords(t,n=!0){return this.readMeasured(),xS(this,t,n)}coordsAtPos(t,n=1){this.readMeasured();let r=this.state.doc.lineAt(t),i=this.bidiSpans(r),a=i[Ui.find(i,t-r.from,-1,n)];return this.docView.coordsAt(t,n,a.dir==ft.RTL)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(Fj)||t<this.viewport.from||t>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>OX)return Ij(t.length);let n=this.textDirectionAt(t.from),r;for(let a of this.bidiCache)if(a.from==t.from&&a.dir==n&&(a.fresh||Nj(a.isolates,r=QM(this,t))))return a.order;r||(r=QM(this,t));let i=iK(t.text,n,r);return this.bidiCache.push(new ug(t.from,t.to,n,r,!0,i)),i}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||pe.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Tj(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((t.nodeType==9?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,n={}){var r,i,a,l;return Fp.of(new _u(typeof t=="number"?J.cursor(t):t,(r=n.y)!==null&&r!==void 0?r:"nearest",(i=n.x)!==null&&i!==void 0?i:"nearest",(a=n.yMargin)!==null&&a!==void 0?a:5,(l=n.xMargin)!==null&&l!==void 0?l:5))}scrollSnapshot(){let{scrollTop:t,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(t);return Fp.of(new _u(J.cursor(r.from),"start","start",r.top-t,n,!0))}setTabFocusMode(t){t==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof t=="boolean"?this.inputState.tabFocusMode=t?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return Rt.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return Rt.define(()=>({}),{eventObservers:t})}static theme(t,n){let r=Xl.newName(),i=[Qp.of(r),Lf.of(AS(`.${r}`,t))];return n&&n.dark&&i.push(wS.of(!0)),i}static baseTheme(t){return gs.lowest(Lf.of(AS("."+OS,t,p3)))}static findFromDOM(t){var n;let r=t.querySelector(".cm-content"),i=r&&Dt.get(r)||Dt.get(t);return((n=i?.root)===null||n===void 0?void 0:n.view)||null}}de.styleModule=Lf;de.inputHandler=Hj;de.clipboardInputFilter=kO;de.clipboardOutputFilter=CO;de.scrollHandler=Wj;de.focusChangeEffect=Uj;de.perLineTextDirection=Fj;de.exceptionSink=$j;de.updateListener=vS;de.editable=Ea;de.mouseSelectionStyle=zj;de.dragMovesSelection=Bj;de.clickAddsSelectionRange=jj;de.decorations=Rv;de.blockWrappers=Xj;de.outerDecorations=TO;de.atomicRanges=Wh;de.bidiIsolatedRanges=Qj;de.cursorScrollMargin=me.define({combine:e=>{let t=5,n=5;for(let r of e)typeof r=="number"?t=n=r:{x:t,y:n}=r;return{x:t,y:n}}});de.scrollMargins=Yj;de.darkTheme=wS;de.cspNonce=me.define({combine:e=>e.length?e[0]:""});de.contentAttributes=EO;de.editorAttributes=Kj;de.lineWrapping=de.contentAttributes.of({class:"cm-lineWrapping"});de.announce=Re.define();const OX=4096,gP={};class ug{constructor(t,n,r,i,a,l){this.from=t,this.to=n,this.dir=r,this.isolates=i,this.fresh=a,this.order=l}static update(t,n){if(n.empty&&!t.some(a=>a.fresh))return t;let r=[],i=t.length?t[t.length-1].dir:ft.LTR;for(let a=Math.max(0,t.length-10);a<t.length;a++){let l=t[a];l.dir==i&&!n.touchesRange(l.from,l.to)&&r.push(new ug(n.mapPos(l.from,1),n.mapPos(l.to,-1),l.dir,l.isolates,!1,l.order))}return r}}function vP(e,t,n){for(let r=e.state.facet(t),i=r.length-1;i>=0;i--){let a=r[i],l=typeof a=="function"?a(e):a;l&&wO(l,n)}return n}const AX=pe.mac?"mac":pe.windows?"win":pe.linux?"linux":"key";function kX(e,t){const n=e.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,a,l,s;for(let c=0;c<n.length-1;++c){const f=n[c];if(/^(cmd|meta|m)$/i.test(f))s=!0;else if(/^a(lt)?$/i.test(f))i=!0;else if(/^(c|ctrl|control)$/i.test(f))a=!0;else if(/^s(hift)?$/i.test(f))l=!0;else if(/^mod$/i.test(f))t=="mac"?s=!0:a=!0;else throw new Error("Unrecognized modifier name: "+f)}return i&&(r="Alt-"+r),a&&(r="Ctrl-"+r),s&&(r="Meta-"+r),l&&(r="Shift-"+r),r}function Yp(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n!==!1&&t.shiftKey&&(e="Shift-"+e),e}const CX=gs.default(de.domEventHandlers({keydown(e,t){return g3(m3(t.state),e,t,"editor")}})),Lv=me.define({enables:CX}),yP=new WeakMap;function m3(e){let t=e.facet(Lv),n=yP.get(t);return n||yP.set(t,n=MX(t.reduce((r,i)=>r.concat(i),[]))),n}function EX(e,t,n){return g3(m3(e.state),t,e,n)}let Nl=null;const TX=4e3;function MX(e,t=AX){let n=Object.create(null),r=Object.create(null),i=(l,s)=>{let c=r[l];if(c==null)r[l]=s;else if(c!=s)throw new Error("Key binding "+l+" is used both as a regular binding and as a multi-stroke prefix")},a=(l,s,c,f,d)=>{var p,g;let v=n[l]||(n[l]=Object.create(null)),y=s.split(/ (?!$)/).map(A=>kX(A,t));for(let A=1;A<y.length;A++){let k=y.slice(0,A).join(" ");i(k,!0),v[k]||(v[k]={preventDefault:!0,stopPropagation:!1,run:[E=>{let P=Nl={view:E,prefix:k,scope:l};return setTimeout(()=>{Nl==P&&(Nl=null)},TX),!0}]})}let x=y.join(" ");i(x,!1);let w=v[x]||(v[x]={preventDefault:!1,stopPropagation:!1,run:((g=(p=v._any)===null||p===void 0?void 0:p.run)===null||g===void 0?void 0:g.slice())||[]});c&&w.run.push(c),f&&(w.preventDefault=!0),d&&(w.stopPropagation=!0)};for(let l of e){let s=l.scope?l.scope.split(" "):["editor"];if(l.any)for(let f of s){let d=n[f]||(n[f]=Object.create(null));d._any||(d._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:p}=l;for(let g in d)d[g].run.push(v=>p(v,kS))}let c=l[t]||l.key;if(c)for(let f of s)a(f,c,l.run,l.preventDefault,l.stopPropagation),l.shift&&a(f,"Shift-"+c,l.shift,l.preventDefault,l.stopPropagation)}return n}let kS=null;function g3(e,t,n,r){kS=t;let i=F7(t),a=nr(i,0),l=$i(a)==i.length&&i!=" ",s="",c=!1,f=!1,d=!1;Nl&&Nl.view==n&&Nl.scope==r&&(s=Nl.prefix+" ",i3.indexOf(t.keyCode)<0&&(f=!0,Nl=null));let p=new Set,g=w=>{if(w){for(let A of w.run)if(!p.has(A)&&(p.add(A),A(n)))return w.stopPropagation&&(d=!0),!0;w.preventDefault&&(w.stopPropagation&&(d=!0),f=!0)}return!1},v=e[r],y,x;return v&&(g(v[s+Yp(i,t,!l)])?c=!0:l&&(t.altKey||t.metaKey||t.ctrlKey)&&!(pe.windows&&t.ctrlKey&&t.altKey)&&!(pe.mac&&t.altKey&&!(t.ctrlKey||t.metaKey))&&(y=Ql[t.keyCode])&&y!=i?(g(v[s+Yp(y,t,!0)])||t.shiftKey&&(x=dh[t.keyCode])!=i&&x!=y&&g(v[s+Yp(x,t,!1)]))&&(c=!0):l&&t.shiftKey&&g(v[s+Yp(i,t,!0)])&&(c=!0),!c&&g(v._any)&&(c=!0)),f&&(c=!0),c&&d&&t.stopPropagation(),kS=null,c}class Qo{constructor(t,n,r,i,a){this.className=t,this.left=n,this.top=r,this.width=i,this.height=a}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,n){return n.className!=this.className?!1:(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",this.width!=null&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,n,r){if(r.empty){let i=t.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let a=v3(t);return[new Qo(n,i.left-a.left,i.top-a.top,null,i.bottom-i.top)]}else return PX(t,n,r)}}function v3(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==ft.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function bP(e,t,n,r){let i=e.coordsAtPos(t,n*2);if(!i)return r;let a=e.dom.getBoundingClientRect(),l=(i.top+i.bottom)/2,s=e.posAtCoords({x:a.left+1,y:l}),c=e.posAtCoords({x:a.right-1,y:l});return s==null||c==null?r:{from:Math.max(r.from,Math.min(s,c)),to:Math.min(r.to,Math.max(s,c))}}function PX(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let r=Math.max(n.from,e.viewport.from),i=Math.min(n.to,e.viewport.to),a=e.textDirection==ft.LTR,l=e.contentDOM,s=l.getBoundingClientRect(),c=v3(e),f=l.querySelector(".cm-line"),d=f&&window.getComputedStyle(f),p=s.left+(d?parseInt(d.paddingLeft)+Math.min(0,parseInt(d.textIndent)):0),g=s.right-(d?parseInt(d.paddingRight):0),v=bS(e,r,1),y=bS(e,i,-1),x=v.type==kn.Text?v:null,w=y.type==kn.Text?y:null;if(x&&(e.lineWrapping||v.widgetLineBreaks)&&(x=bP(e,r,1,x)),w&&(e.lineWrapping||y.widgetLineBreaks)&&(w=bP(e,i,-1,w)),x&&w&&x.from==w.from&&x.to==w.to)return k(E(n.from,n.to,x));{let T=x?E(n.from,null,x):P(v,!1),M=w?E(null,n.to,w):P(y,!0),R=[];return(x||v).to<(w||y).from-(x&&w?1:0)||v.widgetLineBreaks>1&&T.bottom+e.defaultLineHeight/2<M.top?R.push(A(p,T.bottom,g,M.top)):T.bottom<M.top&&e.elementAtHeight((T.bottom+M.top)/2).type==kn.Text&&(T.bottom=M.top=(T.bottom+M.top)/2),k(T).concat(R).concat(k(M))}function A(T,M,R,L){return new Qo(t,T-c.left,M-c.top,Math.max(0,R-T),L-M)}function k({top:T,bottom:M,horizontal:R}){let L=[];for(let H=0;H<R.length;H+=2)L.push(A(R[H],T,R[H+1],M));return L}function E(T,M,R){let L=1e9,H=-1e9,K=[];function V(ie,oe,z,G,ne){let ce=e.coordsAtPos(ie,ie==R.to?-2:2),fe=e.coordsAtPos(z,z==R.from?2:-2);!ce||!fe||(L=Math.min(ce.top,fe.top,L),H=Math.max(ce.bottom,fe.bottom,H),ne==ft.LTR?K.push(a&&oe?p:ce.left,a&&G?g:fe.right):K.push(!a&&G?p:fe.left,!a&&oe?g:ce.right))}let B=T??R.from,ae=M??R.to;for(let ie of e.visibleRanges)if(ie.to>B&&ie.from<ae)for(let oe=Math.max(ie.from,B),z=Math.min(ie.to,ae);;){let G=e.state.doc.lineAt(oe);for(let ne of e.bidiSpans(G)){let ce=ne.from+G.from,fe=ne.to+G.from;if(ce>=z)break;fe>oe&&V(Math.max(ce,oe),T==null&&ce<=B,Math.min(fe,z),M==null&&fe>=ae,ne.dir)}if(oe=G.to+1,oe>=z)break}return K.length==0&&V(B,T==null,ae,M==null,e.textDirection),{top:L,bottom:H,horizontal:K}}function P(T,M){let R=s.top+(M?T.top:T.bottom);return{top:R,bottom:R,horizontal:[]}}}function DX(e,t){return e.constructor==t.constructor&&e.eq(t)}class RX{constructor(t,n){this.view=t,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,t)}update(t){t.startState.facet(Im)!=t.state.facet(Im)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}docViewUpdate(t){this.layer.updateOnDocViewUpdate!==!1&&t.requestMeasure(this.measureReq)}setOrder(t){let n=0,r=t.facet(Im);for(;n<r.length&&r[n]!=this.layer;)n++;this.dom.style.zIndex=String((this.layer.above?150:-1)-n)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:t,scaleY:n}=this.view;(t!=this.scaleX||n!=this.scaleY)&&(this.scaleX=t,this.scaleY=n,this.dom.style.transform=`scale(${1/t}, ${1/n})`)}draw(t){if(t.length!=this.drawn.length||t.some((n,r)=>!DX(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let i of t)i.update&&n&&i.constructor&&this.drawn[r].constructor&&i.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(i.draw(),n);for(;n;){let i=n.nextSibling;n.remove(),n=i}this.drawn=t,pe.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Im=me.define();function y3(e){return[Rt.define(t=>new RX(t,e)),Im.of(e)]}const Ku=me.define({combine(e){return ra(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(t,n)=>Math.min(t,n),drawRangeCursor:(t,n)=>t||n})}});function _X(e={}){return[Ku.of(e),NX,IX,LX,qj.of(!0)]}function b3(e){return e.startState.facet(Ku)!=e.state.facet(Ku)}const NX=y3({above:!0,markers(e){let{state:t}=e,n=t.facet(Ku),r=[];for(let i of t.selection.ranges){let a=i==t.selection.main;if(i.empty||n.drawRangeCursor&&!(a&&pe.ios&&n.iosSelectionHandles)){let l=a?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",s=i.empty?i:J.cursor(i.head,i.assoc);for(let c of Qo.forRange(e,l,s))r.push(c)}}return r},update(e,t){e.transactions.some(r=>r.selection)&&(t.style.animationName=t.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=b3(e);return n&&xP(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){xP(t.state,e)},class:"cm-cursorLayer"});function xP(e,t){t.style.animationDuration=e.facet(Ku).cursorBlinkRate+"ms"}const IX=y3({above:!1,markers(e){let t=[],{main:n,ranges:r}=e.state.selection;for(let i of r)if(!i.empty)for(let a of Qo.forRange(e,"cm-selectionBackground",i))t.push(a);if(pe.ios&&!n.empty&&e.state.facet(Ku).iosSelectionHandles){for(let i of Qo.forRange(e,"cm-selectionHandle cm-selectionHandle-start",J.cursor(n.from,1)))t.push(i);for(let i of Qo.forRange(e,"cm-selectionHandle cm-selectionHandle-end",J.cursor(n.to,1)))t.push(i)}return t},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||b3(e)},class:"cm-selectionLayer"}),LX=gs.highest(de.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),x3=Re.define({map(e,t){return e==null?null:t.mapPos(e)}}),Bf=_n.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((n,r)=>r.is(x3)?r.value:n,e)}}),jX=Rt.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(Bf);n==null?this.cursor!=null&&((t=this.cursor)===null||t===void 0||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(Bf)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(Bf),n=t!=null&&e.coordsAtPos(t);if(!n)return null;let r=e.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-r.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(Bf)!=e&&this.view.dispatch({effects:x3.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){(e.target==this.view.contentDOM||!this.view.contentDOM.contains(e.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function BX(){return[Bf,jX]}function SP(e,t,n,r,i){t.lastIndex=0;for(let a=e.iterRange(n,r),l=n,s;!a.next().done;l+=a.value.length)if(!a.lineBreak)for(;s=t.exec(a.value);)i(l+s.index,s)}function zX(e,t){let n=e.visibleRanges;if(n.length==1&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let r=[];for(let{from:i,to:a}of n)i=Math.max(e.state.doc.lineAt(i).from,i-t),a=Math.min(e.state.doc.lineAt(a).to,a+t),r.length&&r[r.length-1].to>=i?r[r.length-1].to=a:r.push({from:i,to:a});return r}class $X{constructor(t){const{regexp:n,decoration:r,decorate:i,boundary:a,maxLength:l=1e3}=t;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,i)this.addMatch=(s,c,f,d)=>i(d,f,f+s[0].length,s,c);else if(typeof r=="function")this.addMatch=(s,c,f,d)=>{let p=r(s,c,f);p&&d(f,f+s[0].length,p)};else if(r)this.addMatch=(s,c,f,d)=>d(f,f+s[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=a,this.maxLength=l}createDeco(t){let n=new $a,r=n.add.bind(n);for(let{from:i,to:a}of zX(t,this.maxLength))SP(t.state.doc,this.regexp,i,a,(l,s)=>this.addMatch(s,t,l,r));return n.finish()}updateDeco(t,n){let r=1e9,i=-1;return t.docChanged&&t.changes.iterChanges((a,l,s,c)=>{c>=t.view.viewport.from&&s<=t.view.viewport.to&&(r=Math.min(s,r),i=Math.max(c,i))}),t.viewportMoved||i-r>1e3?this.createDeco(t.view):i>-1?this.updateRange(t.view,n.map(t.changes),r,i):n}updateRange(t,n,r,i){for(let a of t.visibleRanges){let l=Math.max(a.from,r),s=Math.min(a.to,i);if(s>=l){let c=t.state.doc.lineAt(l),f=c.to<s?t.state.doc.lineAt(s):c,d=Math.max(a.from,c.from),p=Math.min(a.to,f.to);if(this.boundary){for(;l>c.from;l--)if(this.boundary.test(c.text[l-1-c.from])){d=l;break}for(;s<f.to;s++)if(this.boundary.test(f.text[s-f.from])){p=s;break}}let g=[],v,y=(x,w,A)=>g.push(A.range(x,w));if(c==f)for(this.regexp.lastIndex=d-c.from;(v=this.regexp.exec(c.text))&&v.index<p-c.from;)this.addMatch(v,t,v.index+c.from,y);else SP(t.state.doc,this.regexp,d,p,(x,w)=>this.addMatch(w,t,x,y));n=n.update({filterFrom:d,filterTo:p,filter:(x,w)=>x<d||w>p,add:g})}}return n}}const CS=/x/.unicode!=null?"gu":"g",HX=new RegExp(`[\0-\b
|
|
65
|
+
--\u2028\u2029\uFEFF-]`,CS),UX={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Ax=null;function FX(){var e;if(Ax==null&&typeof document<"u"&&document.body){let t=document.body.style;Ax=((e=t.tabSize)!==null&&e!==void 0?e:t.MozTabSize)!=null}return Ax||!1}const Lm=me.define({combine(e){let t=ra(e,{render:null,specialChars:HX,addSpecialChars:null});return(t.replaceTabs=!FX())&&(t.specialChars=new RegExp(" |"+t.specialChars.source,CS)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,CS)),t}});function qX(e={}){return[Lm.of(e),WX()]}let wP=null;function WX(){return wP||(wP=Rt.fromClass(class{constructor(e){this.view=e,this.decorations=Ce.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(Lm)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new $X({regexp:e.specialChars,decoration:(t,n,r)=>{let{doc:i}=n.state,a=nr(t[0],0);if(a==9){let l=i.lineAt(r),s=n.state.tabSize,c=cc(l.text,s,r-l.from);return Ce.replace({widget:new QX((s-c%s)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[a]||(this.decorationCache[a]=Ce.replace({widget:new XX(e,a)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(Lm);e.startState.facet(Lm)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))}const VX="•";function KX(e){return e>=32?VX:e==10?"":String.fromCharCode(9216+e)}class XX extends ia{constructor(t,n){super(),this.options=t,this.code=n}eq(t){return t.code==this.code}toDOM(t){let n=KX(this.code),r=t.state.phrase("Control character")+" "+(UX[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;let a=document.createElement("span");return a.textContent=n,a.title=r,a.setAttribute("aria-label",r),a.className="cm-specialChar",a}ignoreEvent(){return!1}}class QX extends ia{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent=" ",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}function YX(){return ZX}const GX=Ce.line({class:"cm-activeLine"}),ZX=Rt.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let r of e.state.selection.ranges){let i=e.lineBlockAt(r.head);i.from>t&&(n.push(GX.range(i.from)),t=i.from)}return Ce.set(n)}},{decorations:e=>e.decorations});class JX extends ia{constructor(t){super(),this.content=t}toDOM(t){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(t):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(t){let n=t.firstChild?Xf(t.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(t.parentNode),i=gh(n[0],r.direction!="rtl"),a=parseInt(r.lineHeight);return i.bottom-i.top>a*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+a}:i}ignoreEvent(){return!1}}function eQ(e){let t=Rt.fromClass(class{constructor(n){this.view=n,this.placeholder=e?Ce.set([Ce.widget({widget:new JX(e),side:1}).range(0)]):Ce.none}get decorations(){return this.view.state.doc.length?Ce.none:this.placeholder}},{decorations:n=>n.decorations});return typeof e=="string"?[t,de.contentAttributes.of({"aria-placeholder":e})]:t}const ES=2e3;function tQ(e,t,n){let r=Math.min(t.line,n.line),i=Math.max(t.line,n.line),a=[];if(t.off>ES||n.off>ES||t.col<0||n.col<0){let l=Math.min(t.off,n.off),s=Math.max(t.off,n.off);for(let c=r;c<=i;c++){let f=e.doc.line(c);f.length<=s&&a.push(J.range(f.from+l,f.to+s))}}else{let l=Math.min(t.col,n.col),s=Math.max(t.col,n.col);for(let c=r;c<=i;c++){let f=e.doc.line(c),d=lS(f.text,l,e.tabSize,!0);if(d<0)a.push(J.cursor(f.to));else{let p=lS(f.text,s,e.tabSize);a.push(J.range(f.from+d,f.from+p))}}}return a}function nQ(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function OP(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),r=e.state.doc.lineAt(n),i=n-r.from,a=i>ES?-1:i==r.length?nQ(e,t.clientX):cc(r.text,e.state.tabSize,n-r.from);return{line:r.number,col:a,off:i}}function rQ(e,t){let n=OP(e,t),r=e.state.selection;return n?{update(i){if(i.docChanged){let a=i.changes.mapPos(i.startState.doc.line(n.line).from),l=i.state.doc.lineAt(a);n={line:l.number,col:n.col,off:Math.min(n.off,l.length)},r=r.map(i.changes)}},get(i,a,l){let s=OP(e,i);if(!s)return r;let c=tQ(e.state,n,s);return c.length?l?J.create(c.concat(r.ranges)):J.create(c):r}}:null}function iQ(e){let t=(n=>n.altKey&&n.button==0);return de.mouseSelectionStyle.of((n,r)=>t(r)?rQ(n,r):null)}const aQ={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},lQ={style:"cursor: crosshair"};function oQ(e={}){let[t,n]=aQ[e.key||"Alt"],r=Rt.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==t||n(i))},keyup(i){(i.keyCode==t||!n(i))&&this.set(!1)},mousemove(i){this.set(n(i))}}});return[r,de.contentAttributes.of(i=>{var a;return!((a=i.plugin(r))===null||a===void 0)&&a.isDown?lQ:null})]}const Gp="-10000px";class S3{constructor(t,n,r,i){this.facet=n,this.createTooltipView=r,this.removeTooltipView=i,this.input=t.state.facet(n),this.tooltips=this.input.filter(l=>l);let a=null;this.tooltipViews=this.tooltips.map(l=>a=r(l,a))}update(t,n){var r;let i=t.state.facet(this.facet),a=i.filter(c=>c);if(i===this.input){for(let c of this.tooltipViews)c.update&&c.update(t);return!1}let l=[],s=n?[]:null;for(let c=0;c<a.length;c++){let f=a[c],d=-1;if(f){for(let p=0;p<this.tooltips.length;p++){let g=this.tooltips[p];g&&g.create==f.create&&(d=p)}if(d<0)l[c]=this.createTooltipView(f,c?l[c-1]:null),s&&(s[c]=!!f.above);else{let p=l[c]=this.tooltipViews[d];s&&(s[c]=n[d]),p.update&&p.update(t)}}}for(let c of this.tooltipViews)l.indexOf(c)<0&&(this.removeTooltipView(c),(r=c.destroy)===null||r===void 0||r.call(c));return n&&(s.forEach((c,f)=>n[f]=c),n.length=s.length),this.input=i,this.tooltips=a,this.tooltipViews=l,!0}}function sQ(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}const kx=me.define({combine:e=>{var t,n,r;return{position:pe.ios?"absolute":((t=e.find(i=>i.position))===null||t===void 0?void 0:t.position)||"fixed",parent:((n=e.find(i=>i.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=e.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||sQ}}}),AP=new WeakMap,_O=Rt.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(kx);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new S3(e,NO,(n,r)=>this.createTooltip(n,r),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),e.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,r=e.state.facet(kx);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e,t){let n=e.create(this.view),r=t?t.dom:null;if(n.dom.classList.add("cm-tooltip"),e.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",n.dom.appendChild(i)}return n.dom.style.position=this.position,n.dom.style.top=Gp,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var e,t,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(e=r.destroy)===null||e===void 0||e.call(r);this.parent&&this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=1,t=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:a}=this.manager.tooltipViews[0];if(pe.safari){let l=a.getBoundingClientRect();n=Math.abs(l.top+1e4)>1||Math.abs(l.left)>1}else n=!!a.offsetParent&&a.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let a=this.parent.getBoundingClientRect();a.width&&a.height&&(e=a.width/this.parent.offsetWidth,t=a.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=MO(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((a,l)=>{let s=this.manager.tooltipViews[l];return s.getCoords?s.getCoords(a.pos):this.view.coordsAtPos(a.pos)}),size:this.manager.tooltipViews.map(({dom:a})=>a.getBoundingClientRect()),space:this.view.state.facet(kx).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:n}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let s of this.manager.tooltipViews)s.dom.style.position="absolute"}let{visible:n,space:r,scaleX:i,scaleY:a}=e,l=[];for(let s=0;s<this.manager.tooltips.length;s++){let c=this.manager.tooltips[s],f=this.manager.tooltipViews[s],{dom:d}=f,p=e.pos[s],g=e.size[s];if(!p||c.clip!==!1&&(p.bottom<=Math.max(n.top,r.top)||p.top>=Math.min(n.bottom,r.bottom)||p.right<Math.max(n.left,r.left)-.1||p.left>Math.min(n.right,r.right)+.1)){d.style.top=Gp;continue}let v=c.arrow?f.dom.querySelector(".cm-tooltip-arrow"):null,y=v?7:0,x=g.right-g.left,w=(t=AP.get(f))!==null&&t!==void 0?t:g.bottom-g.top,A=f.offset||cQ,k=this.view.textDirection==ft.LTR,E=g.width>r.right-r.left?k?r.left:r.right-g.width:k?Math.max(r.left,Math.min(p.left-(v?14:0)+A.x,r.right-x)):Math.min(Math.max(r.left,p.left-x+(v?14:0)-A.x),r.right-x),P=this.above[s];!c.strictSide&&(P?p.top-w-y-A.y<r.top:p.bottom+w+y+A.y>r.bottom)&&P==r.bottom-p.bottom>p.top-r.top&&(P=this.above[s]=!P);let T=(P?p.top-r.top:r.bottom-p.bottom)-y;if(T<w&&f.resize!==!1){if(T<this.view.defaultLineHeight){d.style.top=Gp;continue}AP.set(f,w),d.style.height=(w=T)/a+"px"}else d.style.height&&(d.style.height="");let M=P?p.top-w-y-A.y:p.bottom+y+A.y,R=E+x;if(f.overlap!==!0)for(let L of l)L.left<R&&L.right>E&&L.top<M+w&&L.bottom>M&&(M=P?L.top-w-2-y:L.bottom+y+2);if(this.position=="absolute"?(d.style.top=(M-e.parent.top)/a+"px",kP(d,(E-e.parent.left)/i)):(d.style.top=M/a+"px",kP(d,E/i)),v){let L=p.left+(k?A.x:-A.x)-(E+14-7);v.style.left=L/i+"px"}f.overlap!==!0&&l.push({left:E,top:M,right:R,bottom:M+w}),d.classList.toggle("cm-tooltip-above",P),d.classList.toggle("cm-tooltip-below",!P),f.positioned&&f.positioned(e.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=Gp}},{eventObservers:{scroll(){this.maybeMeasure()}}});function kP(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}const uQ=de.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),cQ={x:0,y:0},NO=me.define({enables:[_O,uQ]}),cg=me.define({combine:e=>e.reduce((t,n)=>t.concat(n),[])});class jv{static create(t){return new jv(t)}constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new S3(t,cg,(n,r)=>this.createHostedView(n,r),n=>n.dom.remove())}createHostedView(t,n){let r=t.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(t){for(let n of this.manager.tooltipViews)n.mount&&n.mount(t);this.mounted=!0}positioned(t){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(t)}update(t){this.manager.update(t)}destroy(){var t;for(let n of this.manager.tooltipViews)(t=n.destroy)===null||t===void 0||t.call(n)}passProp(t){let n;for(let r of this.manager.tooltipViews){let i=r[t];if(i!==void 0){if(n===void 0)n=i;else if(n!==i)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const fQ=NO.compute([cg],e=>{let t=e.facet(cg);return t.length===0?null:{pos:Math.min(...t.map(n=>n.pos)),end:Math.max(...t.map(n=>{var r;return(r=n.end)!==null&&r!==void 0?r:n.pos})),create:jv.create,above:t[0].above,arrow:t.some(n=>n.arrow)}}),w3=me.define();class hQ{constructor(t,n,r,i,a,l){this.view=t,this.source=n,this.field=r,this.locked=i,this.setHover=a,this.hoverTime=l,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(t){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let t=Date.now()-this.lastMove.time;t<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-t):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:t,lastMove:n}=this,r=t.docView.tile.nearest(n.target);if(!r)return;let i,a=1;if(r.isWidget())i=r.posAtStart;else{if(i=t.posAtCoords(n),i==null)return;let l=t.coordsAtPos(i);if(!l||n.y<l.top||n.y>l.bottom||n.x<l.left-t.defaultCharacterWidth||n.x>l.right+t.defaultCharacterWidth)return;let s=t.bidiSpans(t.state.doc.lineAt(i)).find(f=>f.from<=i&&f.to>=i),c=s&&s.dir==ft.RTL?-1:1;a=n.x<l.left?-c:c}this.activateHover(t,i,a)}activateHover(t,n,r,i){let a=this.source(t,n,r),l=s=>{if(s&&!(Array.isArray(s)&&!s.length)){let c=Array.isArray(s)?s:[s];i&&this.locked.set(c,i),t.dispatch({effects:this.setHover.of(c)})}};if(a&&"then"in a){let s=this.pending={pos:n};a.then(c=>{this.pending==s&&(this.pending=null,l(c))},c=>ar(t.state,c,"hover tooltip"))}else l(a)}get tooltip(){let t=this.view.plugin(_O),n=t?t.manager.tooltips.findIndex(r=>r.create==jv.create):-1;return n>-1?t.manager.tooltipViews[n]:null}mousemove(t){var n,r;this.lastMove={x:t.clientX,y:t.clientY,target:t.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:a}=this;if(i.length&&!this.locked.has(i)&&a&&!dQ(a.dom,t)||this.pending){let{pos:l}=i[0]||this.pending,s=(r=(n=i[0])===null||n===void 0?void 0:n.end)!==null&&r!==void 0?r:l;(l==s?this.view.posAtCoords(this.lastMove)!=l:!pQ(this.view,l,s,t.clientX,t.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(t){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length&&!this.locked.has(n)){let{tooltip:r}=this;r&&r.dom.contains(t.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(t){let n=r=>{t.removeEventListener("mouseleave",n);let{active:i}=this;i.length&&!this.locked.has(i)&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};t.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const Zp=4;function dQ(e,t){let{left:n,right:r,top:i,bottom:a}=e.getBoundingClientRect(),l;if(l=e.querySelector(".cm-tooltip-arrow")){let s=l.getBoundingClientRect();i=Math.min(s.top,i),a=Math.max(s.bottom,a)}return t.clientX>=n-Zp&&t.clientX<=r+Zp&&t.clientY>=i-Zp&&t.clientY<=a+Zp}function pQ(e,t,n,r,i,a){let l=e.scrollDOM.getBoundingClientRect(),s=e.documentTop+e.documentPadding.top+e.contentHeight;if(l.left>r||l.right<r||l.top>i||Math.min(l.bottom,s)<i)return!1;let c=e.posAtCoords({x:r,y:i},!1);return c>=t&&c<=n}function mQ(e,t={}){let n=Re.define(),r=new WeakMap,i=_n.define({create(){return[]},update(l,s){let c=r.get(l);if(l.length&&(t.hideOnChange&&(s.docChanged||s.selection)?l=[]:c&&c(s)?l=[]:t.hideOn&&(l=l.filter(f=>!t.hideOn(s,f)))),s.docChanged&&l.length){let f=[];for(let d of l){let p=s.changes.mapPos(d.pos,-1,Fn.TrackDel);if(p!=null){let g=Object.assign(Object.create(null),d);g.pos=p,g.end!=null&&(g.end=s.changes.mapPos(g.end)),f.push(g)}}l=f}for(let f of s.effects)f.is(n)&&(l=f.value,c=void 0),(f.is(vQ)&&!f.value||f.value==i)&&(l=[]);return l.length&&c&&r.set(l,c),l},provide:l=>cg.from(l)});const a=Rt.define(l=>new hQ(l,e,i,r,n,t.hoverTime||300));return{active:i,extension:[i,a,w3.of(a),fQ]}}function gQ(e,t,n,r={}){var i;let a=e.state.facet(w3).map(l=>e.plugin(l)).filter(l=>!!l);if(r.tooltip&&r.tooltip.active){let l=a.find(s=>s.field==r.tooltip.active);l&&(a=[l])}for(let l of a)l.activateHover(e,t,n,(i=r.until)!==null&&i!==void 0?i:(()=>!1))}function O3(e,t){let n=e.plugin(_O);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}const vQ=Re.define(),CP=me.define({combine(e){let t,n;for(let r of e)t=t||r.topContainer,n=n||r.bottomContainer;return{topContainer:t,bottomContainer:n}}});function IO(e,t){let n=e.plugin(A3),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}const A3=Rt.fromClass(class{constructor(e){this.input=e.state.facet(yh),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(e));let t=e.state.facet(CP);this.top=new Jp(e,!0,t.topContainer),this.bottom=new Jp(e,!1,t.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(e){let t=e.state.facet(CP);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new Jp(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new Jp(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(yh);if(n!=this.input){let r=n.filter(c=>c),i=[],a=[],l=[],s=[];for(let c of r){let f=this.specs.indexOf(c),d;f<0?(d=c(e.view),s.push(d)):(d=this.panels[f],d.update&&d.update(e)),i.push(d),(d.top?a:l).push(d)}this.specs=r,this.panels=i,this.top.sync(a),this.bottom.sync(l);for(let c of s)c.dom.classList.add("cm-panel"),c.mount&&c.mount()}else for(let r of this.panels)r.update&&r.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>de.scrollMargins.of(t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class Jp{constructor(t,n,r){this.view=t,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let n of this.panels)n.destroy&&t.indexOf(n)<0&&n.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let t=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;t!=n.dom;)t=EP(t);t=t.nextSibling}else this.dom.insertBefore(n.dom,t);for(;t;)t=EP(t)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function EP(e){let t=e.nextSibling;return e.remove(),t}const yh=me.define({enables:A3});function yQ(e,t){let n,r=new Promise(l=>n=l),i=l=>bQ(l,t,n);e.state.field(Cx,!1)?e.dispatch({effects:k3.of(i)}):e.dispatch({effects:Re.appendConfig.of(Cx.init(()=>[i]))});let a=C3.of(i);return{close:a,result:r.then(l=>((e.win.queueMicrotask||(c=>e.win.setTimeout(c,10)))(()=>{e.state.field(Cx).indexOf(i)>-1&&e.dispatch({effects:a})}),l))}}const Cx=_n.define({create(){return[]},update(e,t){for(let n of t.effects)n.is(k3)?e=[n.value].concat(e):n.is(C3)&&(e=e.filter(r=>r!=n.value));return e},provide:e=>yh.computeN([e],t=>t.field(e))}),k3=Re.define(),C3=Re.define();function bQ(e,t,n){let r=t.content?t.content(e,()=>l(null)):null;if(!r){if(r=ot("form"),t.input){let s=ot("input",t.input);/^(text|password|number|email|tel|url)$/.test(s.type)&&s.classList.add("cm-textfield"),s.name||(s.name="input"),r.appendChild(ot("label",(t.label||"")+": ",s))}else r.appendChild(document.createTextNode(t.label||""));r.appendChild(document.createTextNode(" ")),r.appendChild(ot("button",{class:"cm-button",type:"submit"},t.submitLabel||"OK"))}let i=r.nodeName=="FORM"?[r]:r.querySelectorAll("form");for(let s=0;s<i.length;s++){let c=i[s];c.addEventListener("keydown",f=>{f.keyCode==27?(f.preventDefault(),l(null)):f.keyCode==13&&(f.preventDefault(),l(c))}),c.addEventListener("submit",f=>{f.preventDefault(),l(c)})}let a=ot("div",r,ot("button",{onclick:()=>l(null),"aria-label":e.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));t.class&&(a.className=t.class),a.classList.add("cm-dialog");function l(s){a.contains(a.ownerDocument.activeElement)&&e.focus(),n(s)}return{dom:a,top:t.top,mount:()=>{if(t.focus){let s;typeof t.focus=="string"?s=r.querySelector(t.focus):s=r.querySelector("input")||r.querySelector("button"),s&&"select"in s?s.select():s&&"focus"in s&&s.focus()}}}}class Ua extends Kl{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}Ua.prototype.elementClass="";Ua.prototype.toDOM=void 0;Ua.prototype.mapMode=Fn.TrackBefore;Ua.prototype.startSide=Ua.prototype.endSide=-1;Ua.prototype.point=!0;const jm=me.define(),xQ=me.define(),SQ={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>ze.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},Gf=me.define();function wQ(e){return[E3(),Gf.of({...SQ,...e})]}const TP=me.define({combine:e=>e.some(t=>t)});function E3(e){return[OQ]}const OQ=Rt.fromClass(class{constructor(e){this.view=e,this.domAfter=null,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=e.state.facet(Gf).map(t=>new PP(e,t)),this.fixed=!e.state.facet(TP);for(let t of this.gutters)t.config.side=="after"?this.getDOMAfter().appendChild(t.dom):this.dom.appendChild(t.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,r=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}if(e.geometryChanged){let t=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=t,this.domAfter&&(this.domAfter.style.minHeight=t)}this.view.state.facet(TP)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=ze.iter(this.view.state.facet(jm),this.view.viewport.from),r=[],i=this.gutters.map(a=>new AQ(a,this.view.viewport,-this.view.documentPadding.top));for(let a of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(a.type)){let l=!0;for(let s of a.type)if(s.type==kn.Text&&l){TS(n,r,s.from);for(let c of i)c.line(this.view,s,r);l=!1}else if(s.widget)for(let c of i)c.widget(this.view,s)}else if(a.type==kn.Text){TS(n,r,a.from);for(let l of i)l.line(this.view,a,r)}else if(a.widget)for(let l of i)l.widget(this.view,a);for(let a of i)a.finish();e&&(this.view.scrollDOM.insertBefore(this.dom,t),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(e){let t=e.startState.facet(Gf),n=e.state.facet(Gf),r=e.docChanged||e.heightChanged||e.viewportChanged||!ze.eq(e.startState.facet(jm),e.state.facet(jm),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let i of this.gutters)i.update(e)&&(r=!0);else{r=!0;let i=[];for(let a of n){let l=t.indexOf(a);l<0?i.push(new PP(this.view,a)):(this.gutters[l].update(e),i.push(this.gutters[l]))}for(let a of this.gutters)a.dom.remove(),i.indexOf(a)<0&&a.destroy();for(let a of i)a.config.side=="after"?this.getDOMAfter().appendChild(a.dom):this.dom.appendChild(a.dom);this.gutters=i}return r}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:e=>de.scrollMargins.of(t=>{let n=t.plugin(e);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*t.scaleX,i=n.domAfter?n.domAfter.offsetWidth*t.scaleX:0;return t.textDirection==ft.LTR?{left:r,right:i}:{right:r,left:i}})});function MP(e){return Array.isArray(e)?e:[e]}function TS(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class AQ{constructor(t,n,r){this.gutter=t,this.height=r,this.i=0,this.cursor=ze.iter(t.markers,n.from)}addElement(t,n,r){let{gutter:i}=this,a=(n.top-this.height)/t.scaleY,l=n.height/t.scaleY;if(this.i==i.elements.length){let s=new T3(t,l,a,r);i.elements.push(s),i.dom.appendChild(s.dom)}else i.elements[this.i].update(t,l,a,r);this.height=n.bottom,this.i++}line(t,n,r){let i=[];TS(this.cursor,i,n.from),r.length&&(i=i.concat(r));let a=this.gutter.config.lineMarker(t,n,i);a&&i.unshift(a);let l=this.gutter;i.length==0&&!l.config.renderEmptyElements||this.addElement(t,n,i)}widget(t,n){let r=this.gutter.config.widgetMarker(t,n.widget,n),i=r?[r]:null;for(let a of t.state.facet(xQ)){let l=a(t,n.widget,n);l&&(i||(i=[])).push(l)}i&&this.addElement(t,n,i)}finish(){let t=this.gutter;for(;t.elements.length>this.i;){let n=t.elements.pop();t.dom.removeChild(n.dom),n.destroy()}}}class PP{constructor(t,n){this.view=t,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,i=>{let a=i.target,l;if(a!=this.dom&&this.dom.contains(a)){for(;a.parentNode!=this.dom;)a=a.parentNode;let c=a.getBoundingClientRect();l=(c.top+c.bottom)/2}else l=i.clientY;let s=t.lineBlockAtHeight(l-t.documentTop);n.domEventHandlers[r](t,s,i)&&i.preventDefault()});this.markers=MP(n.markers(t)),n.initialSpacer&&(this.spacer=new T3(t,0,0,[n.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(t){let n=this.markers;if(this.markers=MP(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],t);i!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[i])}let r=t.view.viewport;return!ze.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(t):!1)}destroy(){for(let t of this.elements)t.destroy()}}class T3{constructor(t,n,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,n,r,i)}update(t,n,r,i){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),kQ(this.markers,i)||this.setMarkers(t,i)}setMarkers(t,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let a=0,l=0;;){let s=l,c=a<n.length?n[a++]:null,f=!1;if(c){let d=c.elementClass;d&&(r+=" "+d);for(let p=l;p<this.markers.length;p++)if(this.markers[p].compare(c)){s=p,f=!0;break}}else s=this.markers.length;for(;l<s;){let d=this.markers[l++];if(d.toDOM){d.destroy(i);let p=i.nextSibling;i.remove(),i=p}}if(!c)break;c.toDOM&&(f?i=i.nextSibling:this.dom.insertBefore(c.toDOM(t),i)),f&&l++}this.dom.className=r,this.markers=n}destroy(){this.setMarkers(null,[])}}function kQ(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].compare(t[n]))return!1;return!0}const CQ=me.define(),EQ=me.define(),wu=me.define({combine(e){return ra(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(t,n){let r=Object.assign({},t);for(let i in n){let a=r[i],l=n[i];r[i]=a?(s,c,f)=>a(s,c,f)||l(s,c,f):l}return r}})}});class Ex extends Ua{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function Tx(e,t){return e.state.facet(wu).formatNumber(t,e.state)}const TQ=Gf.compute([wu],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(t){return t.state.facet(CQ)},lineMarker(t,n,r){return r.some(i=>i.toDOM)?null:new Ex(Tx(t,t.state.doc.lineAt(n.from).number))},widgetMarker:(t,n,r)=>{for(let i of t.state.facet(EQ)){let a=i(t,n,r);if(a)return a}return null},lineMarkerChange:t=>t.startState.facet(wu)!=t.state.facet(wu),initialSpacer(t){return new Ex(Tx(t,DP(t.state.doc.lines)))},updateSpacer(t,n){let r=Tx(n.view,DP(n.view.state.doc.lines));return r==t.number?t:new Ex(r)},domEventHandlers:e.facet(wu).domEventHandlers,side:"before"}));function MQ(e={}){return[wu.of(e),E3(),TQ]}function DP(e){let t=9;for(;t<e;)t=t*10+9;return t}const PQ=new class extends Ua{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},DQ=jm.compute(["selection"],e=>{let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.head).from;i>n&&(n=i,t.push(PQ.range(i)))}return ze.of(t)});function RQ(){return DQ}const M3=1024;let _Q=0;class Mx{constructor(t,n){this.from=t,this.to=n}}class Le{constructor(t={}){this.id=_Q++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=t.combine||null}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof t!="function"&&(t=fr.match(t)),n=>{let r=t(n);return r===void 0?null:[this,r]}}}Le.closedBy=new Le({deserialize:e=>e.split(" ")});Le.openedBy=new Le({deserialize:e=>e.split(" ")});Le.group=new Le({deserialize:e=>e.split(" ")});Le.isolate=new Le({deserialize:e=>{if(e&&e!="rtl"&&e!="ltr"&&e!="auto")throw new RangeError("Invalid value for isolate: "+e);return e||"auto"}});Le.contextHash=new Le({perNode:!0});Le.lookAhead=new Le({perNode:!0});Le.mounted=new Le({perNode:!0});class Zf{constructor(t,n,r,i=!1){this.tree=t,this.overlay=n,this.parser=r,this.bracketed=i}static get(t){return t&&t.props&&t.props[Le.mounted.id]}}const NQ=Object.create(null);class fr{constructor(t,n,r,i=0){this.name=t,this.props=n,this.id=r,this.flags=i}static define(t){let n=t.props&&t.props.length?Object.create(null):NQ,r=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new fr(t.name||"",n,t.id,r);if(t.props){for(let a of t.props)if(Array.isArray(a)||(a=a(i)),a){if(a[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[a[0].id]=a[1]}}return i}prop(t){return this.props[t.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(t){if(typeof t=="string"){if(this.name==t)return!0;let n=this.prop(Le.group);return n?n.indexOf(t)>-1:!1}return this.id==t}static match(t){let n=Object.create(null);for(let r in t)for(let i of r.split(" "))n[i]=t[r];return r=>{for(let i=r.prop(Le.group),a=-1;a<(i?i.length:0);a++){let l=n[a<0?r.name:i[a]];if(l)return l}}}}fr.none=new fr("",Object.create(null),0,8);class LO{constructor(t){this.types=t;for(let n=0;n<t.length;n++)if(t[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...t){let n=[];for(let r of this.types){let i=null;for(let a of t){let l=a(r);if(l){i||(i=Object.assign({},r.props));let s=l[1],c=l[0];c.combine&&c.id in i&&(s=c.combine(i[c.id],s)),i[c.id]=s}}n.push(i?new fr(r.name,i,r.id,r.flags):r)}return new LO(n)}}const em=new WeakMap,RP=new WeakMap;var Pt;(function(e){e[e.ExcludeBuffers=1]="ExcludeBuffers",e[e.IncludeAnonymous=2]="IncludeAnonymous",e[e.IgnoreMounts=4]="IgnoreMounts",e[e.IgnoreOverlays=8]="IgnoreOverlays",e[e.EnterBracketed=16]="EnterBracketed"})(Pt||(Pt={}));class jt{constructor(t,n,r,i,a){if(this.type=t,this.children=n,this.positions=r,this.length=i,this.props=null,a&&a.length){this.props=Object.create(null);for(let[l,s]of a)this.props[typeof l=="number"?l:l.id]=s}}toString(){let t=Zf.get(this);if(t&&!t.overlay)return t.tree.toString();let n="";for(let r of this.children){let i=r.toString();i&&(n&&(n+=","),n+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(t=0){return new PS(this.topNode,t)}cursorAt(t,n=0,r=0){let i=em.get(this)||this.topNode,a=new PS(i);return a.moveTo(t,n),em.set(this,a._tree),a}get topNode(){return new Jr(this,0,0,null)}resolve(t,n=0){let r=bh(em.get(this)||this.topNode,t,n,!1);return em.set(this,r),r}resolveInner(t,n=0){let r=bh(RP.get(this)||this.topNode,t,n,!0);return RP.set(this,r),r}resolveStack(t,n=0){return jQ(this,t,n)}iterate(t){let{enter:n,leave:r,from:i=0,to:a=this.length}=t,l=t.mode||0,s=(l&Pt.IncludeAnonymous)>0;for(let c=this.cursor(l|Pt.IncludeAnonymous);;){let f=!1;if(c.from<=a&&c.to>=i&&(!s&&c.type.isAnonymous||n(c)!==!1)){if(c.firstChild())continue;f=!0}for(;f&&r&&(s||!c.type.isAnonymous)&&r(c),!c.nextSibling();){if(!c.parent())return;f=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let n in this.props)t.push([+n,this.props[n]]);return t}balance(t={}){return this.children.length<=8?this:zO(fr.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new jt(this.type,n,r,i,this.propValues),t.makeTree||((n,r,i)=>new jt(fr.none,n,r,i)))}static build(t){return BQ(t)}}jt.empty=new jt(fr.none,[],[],0);class jO{constructor(t,n){this.buffer=t,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new jO(this.buffer,this.index)}}class Gl{constructor(t,n,r){this.buffer=t,this.length=n,this.set=r}get type(){return fr.none}toString(){let t=[];for(let n=0;n<this.buffer.length;)t.push(this.childString(n)),n=this.buffer[n+3];return t.join(",")}childString(t){let n=this.buffer[t],r=this.buffer[t+3],i=this.set.types[n],a=i.name;if(/\W/.test(a)&&!i.isError&&(a=JSON.stringify(a)),t+=4,r==t)return a;let l=[];for(;t<r;)l.push(this.childString(t)),t=this.buffer[t+3];return a+"("+l.join(",")+")"}findChild(t,n,r,i,a){let{buffer:l}=this,s=-1;for(let c=t;c!=n&&!(P3(a,i,l[c+1],l[c+2])&&(s=c,r>0));c=l[c+3]);return s}slice(t,n,r){let i=this.buffer,a=new Uint16Array(n-t),l=0;for(let s=t,c=0;s<n;){a[c++]=i[s++],a[c++]=i[s++]-r;let f=a[c++]=i[s++]-r;a[c++]=i[s++]-t,l=Math.max(l,f)}return new Gl(a,l,this.set)}}function P3(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function bh(e,t,n,r){for(var i;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let l=!r&&e instanceof Jr&&e.index<0?null:e.parent;if(!l)return e;e=l}let a=r?0:Pt.IgnoreOverlays;if(r)for(let l=e,s=l.parent;s;l=s,s=l.parent)l instanceof Jr&&l.index<0&&((i=s.enter(t,n,a))===null||i===void 0?void 0:i.from)!=l.from&&(e=s);for(;;){let l=e.enter(t,n,a);if(!l)return e;e=l}}class D3{cursor(t=0){return new PS(this,t)}getChild(t,n=null,r=null){let i=_P(this,t,n,r);return i.length?i[0]:null}getChildren(t,n=null,r=null){return _P(this,t,n,r)}resolve(t,n=0){return bh(this,t,n,!1)}resolveInner(t,n=0){return bh(this,t,n,!0)}matchContext(t){return MS(this.parent,t)}enterUnfinishedNodesBefore(t){let n=this.childBefore(t),r=this;for(;n;){let i=n.lastChild;if(!i||i.to!=n.to)break;i.type.isError&&i.from==i.to?(r=n,n=i.prevSibling):n=i}return r}get node(){return this}get next(){return this.parent}}class Jr extends D3{constructor(t,n,r,i){super(),this._tree=t,this.from=n,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,n,r,i,a=0){for(let l=this;;){for(let{children:s,positions:c}=l._tree,f=n>0?s.length:-1;t!=f;t+=n){let d=s[t],p=c[t]+l.from,g;if(!(!(a&Pt.EnterBracketed&&d instanceof jt&&(g=Zf.get(d))&&!g.overlay&&g.bracketed&&r>=p&&r<=p+d.length)&&!P3(i,r,p,p+d.length))){if(d instanceof Gl){if(a&Pt.ExcludeBuffers)continue;let v=d.findChild(0,d.buffer.length,n,r-p,i);if(v>-1)return new $l(new IQ(l,d,t,p),null,v)}else if(a&Pt.IncludeAnonymous||!d.type.isAnonymous||BO(d)){let v;if(!(a&Pt.IgnoreMounts)&&(v=Zf.get(d))&&!v.overlay)return new Jr(v.tree,p,t,l);let y=new Jr(d,p,t,l);return a&Pt.IncludeAnonymous||!y.type.isAnonymous?y:y.nextChild(n<0?d.children.length-1:0,n,r,i,a)}}}if(a&Pt.IncludeAnonymous||!l.type.isAnonymous||(l.index>=0?t=l.index+n:t=n<0?-1:l._parent._tree.children.length,l=l._parent,!l))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}prop(t){return this._tree.prop(t)}enter(t,n,r=0){let i;if(!(r&Pt.IgnoreOverlays)&&(i=Zf.get(this._tree))&&i.overlay){let a=t-this.from,l=r&Pt.EnterBracketed&&i.bracketed;for(let{from:s,to:c}of i.overlay)if((n>0||l?s<=a:s<a)&&(n<0||l?c>=a:c>a))return new Jr(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,r)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function _P(e,t,n,r){let i=e.cursor(),a=[];if(!i.firstChild())return a;if(n!=null){for(let l=!1;!l;)if(l=i.type.is(n),!i.nextSibling())return a}for(;;){if(r!=null&&i.type.is(r))return a;if(i.type.is(t)&&a.push(i.node),!i.nextSibling())return r==null?a:[]}}function MS(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}class IQ{constructor(t,n,r,i){this.parent=t,this.buffer=n,this.index=r,this.start=i}}class $l extends D3{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,n,r){super(),this.context=t,this._parent=n,this.index=r,this.type=t.buffer.set.types[t.buffer.buffer[r]]}child(t,n,r){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return a<0?null:new $l(this.context,this,a)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}prop(t){return this.type.prop(t)}enter(t,n,r=0){if(r&Pt.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return a<0?null:new $l(this.context,this,a)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new $l(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new $l(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],n=[],{buffer:r}=this.context,i=this.index+4,a=r.buffer[this.index+3];if(a>i){let l=r.buffer[this.index+1];t.push(r.slice(i,a,l)),n.push(0)}return new jt(this.type,t,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function R3(e){if(!e.length)return null;let t=0,n=e[0];for(let a=1;a<e.length;a++){let l=e[a];(l.from>n.from||l.to<n.to)&&(n=l,t=a)}let r=n instanceof Jr&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new LQ(i,n)}class LQ{constructor(t,n){this.heads=t,this.node=n}get next(){return R3(this.heads)}}function jQ(e,t,n){let r=e.resolveInner(t,n),i=null;for(let a=r instanceof Jr?r:r.context.parent;a;a=a.parent)if(a.index<0){let l=a.parent;(i||(i=[r])).push(l.resolve(t,n)),a=l}else{let l=Zf.get(a.tree);if(l&&l.overlay&&l.overlay[0].from<=t&&l.overlay[l.overlay.length-1].to>=t){let s=new Jr(l.tree,l.overlay[0].from+a.from,-1,a);(i||(i=[r])).push(bh(s,t,n,!1))}}return i?R3(i):r}class PS{get name(){return this.type.name}constructor(t,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~Pt.EnterBracketed,t instanceof Jr)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let r=t._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return t?(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0):!1}yieldBuf(t,n){this.index=t;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[t]],this.from=r+i.buffer[t+1],this.to=r+i.buffer[t+2],!0}yield(t){return t?t instanceof Jr?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,n,r,this.mode));let{buffer:i}=this.buffer,a=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.buffer.start,r);return a<0?!1:(this.stack.push(this.index),this.yieldBuf(a))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,n,r=this.mode){return this.buffer?r&Pt.ExcludeBuffers?!1:this.enterChild(1,t,n):this.yield(this._tree.enter(t,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Pt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&Pt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(t<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let n,r,{buffer:i}=this;if(i){if(t>0){if(this.index<i.buffer.buffer.length)return!1}else for(let a=0;a<this.index;a++)if(i.buffer.buffer[a+3]<this.index)return!1;({index:n,parent:r}=i)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let a=n+t,l=t<0?-1:r._tree.children.length;a!=l;a+=t){let s=r._tree.children[a];if(this.mode&Pt.IncludeAnonymous||s instanceof Gl||!s.type.isAnonymous||BO(s))return!1}return!0}move(t,n){if(n&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,n=0){for(;(this.from==this.to||(n<1?this.from>=t:this.from>t)||(n>-1?this.to<=t:this.to<t))&&this.parent(););for(;this.enterChild(1,t,n););return this}get node(){if(!this.buffer)return this._tree;let t=this.bufferNode,n=null,r=0;if(t&&t.context==this.buffer)e:for(let i=this.index,a=this.stack.length;a>=0;){for(let l=t;l;l=l._parent)if(l.index==i){if(i==this.index)return l;n=l,r=a+1;break e}i=this.stack[--a]}for(let i=r;i<this.stack.length;i++)n=new $l(this.buffer,n,this.stack[i]);return this.bufferNode=new $l(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(t,n){for(let r=0;;){let i=!1;if(this.type.isAnonymous||t(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&n&&n(this),i=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,i=!0}}}matchContext(t){if(!this.buffer)return MS(this.node.parent,t);let{buffer:n}=this.buffer,{types:r}=n.set;for(let i=t.length-1,a=this.stack.length-1;i>=0;a--){if(a<0)return MS(this._tree,t,i);let l=r[n.buffer[this.stack[a]]];if(!l.isAnonymous){if(t[i]&&t[i]!=l.name)return!1;i--}}return!0}}function BO(e){return e.children.some(t=>t instanceof Gl||!t.type.isAnonymous||BO(t))}function BQ(e){var t;let{buffer:n,nodeSet:r,maxBufferLength:i=M3,reused:a=[],minRepeatType:l=r.types.length}=e,s=Array.isArray(n)?new jO(n,n.length):n,c=r.types,f=0,d=0;function p(T,M,R,L,H,K){let{id:V,start:B,end:ae,size:ie}=s,oe=d,z=f;if(ie<0)if(s.next(),ie==-1){let N=a[V];R.push(N),L.push(B-T);return}else if(ie==-3){f=V;return}else if(ie==-4){d=V;return}else throw new RangeError(`Unrecognized record size: ${ie}`);let G=c[V],ne,ce,fe=B-T;if(ae-B<=i&&(ce=w(s.pos-M,H))){let N=new Uint16Array(ce.size-ce.skip),X=s.pos-ce.size,re=N.length;for(;s.pos>X;)re=A(ce.start,N,re);ne=new Gl(N,ae-ce.start,r),fe=ce.start-T}else{let N=s.pos-ie;s.next();let X=[],re=[],le=V>=l?V:-1,ge=0,Oe=ae;for(;s.pos>N;)le>=0&&s.id==le&&s.size>=0?(s.end<=Oe-i&&(y(X,re,B,ge,s.end,Oe,le,oe,z),ge=X.length,Oe=s.end),s.next()):K>2500?g(B,N,X,re):p(B,N,X,re,le,K+1);if(le>=0&&ge>0&&ge<X.length&&y(X,re,B,ge,B,Oe,le,oe,z),X.reverse(),re.reverse(),le>-1&&ge>0){let Pe=v(G,z);ne=zO(G,X,re,0,X.length,0,ae-B,Pe,Pe)}else ne=x(G,X,re,ae-B,oe-ae,z)}R.push(ne),L.push(fe)}function g(T,M,R,L){let H=[],K=0,V=-1;for(;s.pos>M;){let{id:B,start:ae,end:ie,size:oe}=s;if(oe>4)s.next();else{if(V>-1&&ae<V)break;V<0&&(V=ie-i),H.push(B,ae,ie),K++,s.next()}}if(K){let B=new Uint16Array(K*4),ae=H[H.length-2];for(let ie=H.length-3,oe=0;ie>=0;ie-=3)B[oe++]=H[ie],B[oe++]=H[ie+1]-ae,B[oe++]=H[ie+2]-ae,B[oe++]=oe;R.push(new Gl(B,H[2]-ae,r)),L.push(ae-T)}}function v(T,M){return(R,L,H)=>{let K=0,V=R.length-1,B,ae;if(V>=0&&(B=R[V])instanceof jt){if(!V&&B.type==T&&B.length==H)return B;(ae=B.prop(Le.lookAhead))&&(K=L[V]+B.length+ae)}return x(T,R,L,H,K,M)}}function y(T,M,R,L,H,K,V,B,ae){let ie=[],oe=[];for(;T.length>L;)ie.push(T.pop()),oe.push(M.pop()+R-H);T.push(x(r.types[V],ie,oe,K-H,B-K,ae)),M.push(H-R)}function x(T,M,R,L,H,K,V){if(K){let B=[Le.contextHash,K];V=V?[B].concat(V):[B]}if(H>25){let B=[Le.lookAhead,H];V=V?[B].concat(V):[B]}return new jt(T,M,R,L,V)}function w(T,M){let R=s.fork(),L=0,H=0,K=0,V=R.end-i,B={size:0,start:0,skip:0};e:for(let ae=R.pos-T;R.pos>ae;){let ie=R.size;if(R.id==M&&ie>=0){B.size=L,B.start=H,B.skip=K,K+=4,L+=4,R.next();continue}let oe=R.pos-ie;if(ie<0||oe<ae||R.start<V)break;let z=R.id>=l?4:0,G=R.start;for(R.next();R.pos>oe;){if(R.size<0)if(R.size==-3||R.size==-4)z+=4;else break e;else R.id>=l&&(z+=4);R.next()}H=G,L+=ie,K+=z}return(M<0||L==T)&&(B.size=L,B.start=H,B.skip=K),B.size>4?B:void 0}function A(T,M,R){let{id:L,start:H,end:K,size:V}=s;if(s.next(),V>=0&&L<l){let B=R;if(V>4){let ae=s.pos-(V-4);for(;s.pos>ae;)R=A(T,M,R)}M[--R]=B,M[--R]=K-T,M[--R]=H-T,M[--R]=L}else V==-3?f=L:V==-4&&(d=L);return R}let k=[],E=[];for(;s.pos>0;)p(e.start||0,e.bufferStart||0,k,E,-1,0);let P=(t=e.length)!==null&&t!==void 0?t:k.length?E[0]+k[0].length:0;return new jt(c[e.topID],k.reverse(),E.reverse(),P)}const NP=new WeakMap;function Bm(e,t){if(!e.isAnonymous||t instanceof Gl||t.type!=e)return 1;let n=NP.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof jt)){n=1;break}n+=Bm(e,r)}NP.set(t,n)}return n}function zO(e,t,n,r,i,a,l,s,c){let f=0;for(let y=r;y<i;y++)f+=Bm(e,t[y]);let d=Math.ceil(f*1.5/8),p=[],g=[];function v(y,x,w,A,k){for(let E=w;E<A;){let P=E,T=x[E],M=Bm(e,y[E]);for(E++;E<A;E++){let R=Bm(e,y[E]);if(M+R>=d)break;M+=R}if(E==P+1){if(M>d){let R=y[P];v(R.children,R.positions,0,R.children.length,x[P]+k);continue}p.push(y[P])}else{let R=x[E-1]+y[E-1].length-T;p.push(zO(e,y,x,P,E,T,R,null,c))}g.push(T+k-a)}}return v(t,n,r,i,0),(s||c)(p,g,l)}class Yo{constructor(t,n,r,i,a=!1,l=!1){this.from=t,this.to=n,this.tree=r,this.offset=i,this.open=(a?1:0)|(l?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new Yo(0,t.length,t,0,!1,r)];for(let a of n)a.to>t.length&&i.push(a);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],a=1,l=t.length?t[0]:null;for(let s=0,c=0,f=0;;s++){let d=s<n.length?n[s]:null,p=d?d.fromA:1e9;if(p-c>=r)for(;l&&l.from<p;){let g=l;if(c>=g.from||p<=g.to||f){let v=Math.max(g.from,c)-f,y=Math.min(g.to,p)-f;g=v>=y?null:new Yo(v,y,g.tree,g.offset+f,s>0,!!d)}if(g&&i.push(g),l.to>p)break;l=a<t.length?t[a++]:null}if(!d)break;c=d.toA,f=d.toA-d.toB}return i}}class _3{startParse(t,n,r){return typeof t=="string"&&(t=new zQ(t)),r=r?r.length?r.map(i=>new Mx(i.from,i.to)):[new Mx(0,0)]:[new Mx(0,t.length)],this.createParse(t,n||[],r)}parse(t,n,r){let i=this.startParse(t,n,r);for(;;){let a=i.advance();if(a)return a}}}class zQ{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,n){return this.string.slice(t,n)}}new Le({perNode:!0});let $Q=0,ka=class DS{constructor(t,n,r,i){this.name=t,this.set=n,this.base=r,this.modified=i,this.id=$Q++}toString(){let{name:t}=this;for(let n of this.modified)n.name&&(t=`${n.name}(${t})`);return t}static define(t,n){let r=typeof t=="string"?t:"?";if(t instanceof DS&&(n=t),n?.base)throw new Error("Can not derive from a modified tag");let i=new DS(r,[],null,[]);if(i.set.push(i),n)for(let a of n.set)i.set.push(a);return i}static defineModifier(t){let n=new fg(t);return r=>r.modified.indexOf(n)>-1?r:fg.get(r.base||r,r.modified.concat(n).sort((i,a)=>i.id-a.id))}},HQ=0;class fg{constructor(t){this.name=t,this.instances=[],this.id=HQ++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(s=>s.base==t&&UQ(n,s.modified));if(r)return r;let i=[],a=new ka(t.name,i,t,n);for(let s of n)s.instances.push(a);let l=FQ(n);for(let s of t.set)if(!s.modified.length)for(let c of l)i.push(fg.get(s,c));return a}}function UQ(e,t){return e.length==t.length&&e.every((n,r)=>n==t[r])}function FQ(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((n,r)=>r.length-n.length)}function N3(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let a=[],l=2,s=i;for(let p=0;;){if(s=="..."&&p>0&&p+3==i.length){l=1;break}let g=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(s);if(!g)throw new RangeError("Invalid path: "+i);if(a.push(g[0]=="*"?"":g[0][0]=='"'?JSON.parse(g[0]):g[0]),p+=g[0].length,p==i.length)break;let v=i[p++];if(p==i.length&&v=="!"){l=0;break}if(v!="/")throw new RangeError("Invalid path: "+i);s=i.slice(p)}let c=a.length-1,f=a[c];if(!f)throw new RangeError("Invalid path: "+i);let d=new xh(r,l,c>0?a.slice(0,c):null);t[f]=d.sort(t[f])}}return I3.add(t)}const I3=new Le({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth>=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let a=new xh(i.tags,i.mode,i.context);n?n.next=a:r=a,n=a}return r}});class xh{constructor(t,n,r,i){this.tags=t,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth<this.depth?(this.next=t,this):(t.next=this.sort(t.next),t)}get depth(){return this.context?this.context.length:0}}xh.empty=new xh([],2,null);function L3(e,t){let n=Object.create(null);for(let a of e)if(!Array.isArray(a.tag))n[a.tag.id]=a.class;else for(let l of a.tag)n[l.id]=a.class;let{scope:r,all:i=null}=t||{};return{style:a=>{let l=i;for(let s of a)for(let c of s.set){let f=n[c.id];if(f){l=l?l+" "+f:f;break}}return l},scope:r}}function qQ(e,t){let n=null;for(let r of e){let i=r.style(t);i&&(n=n?n+" "+i:i)}return n}function WQ(e,t,n,r=0,i=e.length){let a=new VQ(r,Array.isArray(t)?t:[t],n);a.highlightRange(e.cursor(),r,i,"",a.highlighters),a.flush(i)}class VQ{constructor(t,n,r){this.at=t,this.highlighters=n,this.span=r,this.class=""}startSpan(t,n){n!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=n)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,n,r,i,a){let{type:l,from:s,to:c}=t;if(s>=r||c<=n)return;l.isTop&&(a=this.highlighters.filter(v=>!v.scope||v.scope(l)));let f=i,d=KQ(t)||xh.empty,p=qQ(a,d.tags);if(p&&(f&&(f+=" "),f+=p,d.mode==1&&(i+=(i?" ":"")+p)),this.startSpan(Math.max(n,s),f),d.opaque)return;let g=t.tree&&t.tree.prop(Le.mounted);if(g&&g.overlay){let v=t.node.enter(g.overlay[0].from+s,1),y=this.highlighters.filter(w=>!w.scope||w.scope(g.tree.type)),x=t.firstChild();for(let w=0,A=s;;w++){let k=w<g.overlay.length?g.overlay[w]:null,E=k?k.from+s:c,P=Math.max(n,A),T=Math.min(r,E);if(P<T&&x)for(;t.from<T&&(this.highlightRange(t,P,T,i,a),this.startSpan(Math.min(T,t.to),f),!(t.to>=E||!t.nextSibling())););if(!k||E>r)break;A=k.to+s,A>n&&(this.highlightRange(v.cursor(),Math.max(n,k.from+s),Math.min(r,A),"",y),this.startSpan(Math.min(r,A),f))}x&&t.parent()}else if(t.firstChild()){g&&(i="");do if(!(t.to<=n)){if(t.from>=r)break;this.highlightRange(t,n,r,i,a),this.startSpan(Math.min(r,t.to),f)}while(t.nextSibling());t.parent()}}}function KQ(e){let t=e.type.prop(I3);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}const he=ka.define,tm=he(),Ml=he(),IP=he(Ml),LP=he(Ml),Pl=he(),nm=he(Pl),Px=he(Pl),Li=he(),Eo=he(Li),Di=he(),Ri=he(),RS=he(),wf=he(RS),rm=he(),Y={comment:tm,lineComment:he(tm),blockComment:he(tm),docComment:he(tm),name:Ml,variableName:he(Ml),typeName:IP,tagName:he(IP),propertyName:LP,attributeName:he(LP),className:he(Ml),labelName:he(Ml),namespace:he(Ml),macroName:he(Ml),literal:Pl,string:nm,docString:he(nm),character:he(nm),attributeValue:he(nm),number:Px,integer:he(Px),float:he(Px),bool:he(Pl),regexp:he(Pl),escape:he(Pl),color:he(Pl),url:he(Pl),keyword:Di,self:he(Di),null:he(Di),atom:he(Di),unit:he(Di),modifier:he(Di),operatorKeyword:he(Di),controlKeyword:he(Di),definitionKeyword:he(Di),moduleKeyword:he(Di),operator:Ri,derefOperator:he(Ri),arithmeticOperator:he(Ri),logicOperator:he(Ri),bitwiseOperator:he(Ri),compareOperator:he(Ri),updateOperator:he(Ri),definitionOperator:he(Ri),typeOperator:he(Ri),controlOperator:he(Ri),punctuation:RS,separator:he(RS),bracket:wf,angleBracket:he(wf),squareBracket:he(wf),paren:he(wf),brace:he(wf),content:Li,heading:Eo,heading1:he(Eo),heading2:he(Eo),heading3:he(Eo),heading4:he(Eo),heading5:he(Eo),heading6:he(Eo),contentSeparator:he(Li),list:he(Li),quote:he(Li),emphasis:he(Li),strong:he(Li),link:he(Li),monospace:he(Li),strikethrough:he(Li),inserted:he(),deleted:he(),changed:he(),invalid:he(),meta:rm,documentMeta:he(rm),annotation:he(rm),processingInstruction:he(rm),definition:ka.defineModifier("definition"),constant:ka.defineModifier("constant"),function:ka.defineModifier("function"),standard:ka.defineModifier("standard"),local:ka.defineModifier("local"),special:ka.defineModifier("special")};for(let e in Y){let t=Y[e];t instanceof ka&&(t.name=e)}L3([{tag:Y.link,class:"tok-link"},{tag:Y.heading,class:"tok-heading"},{tag:Y.emphasis,class:"tok-emphasis"},{tag:Y.strong,class:"tok-strong"},{tag:Y.keyword,class:"tok-keyword"},{tag:Y.atom,class:"tok-atom"},{tag:Y.bool,class:"tok-bool"},{tag:Y.url,class:"tok-url"},{tag:Y.labelName,class:"tok-labelName"},{tag:Y.inserted,class:"tok-inserted"},{tag:Y.deleted,class:"tok-deleted"},{tag:Y.literal,class:"tok-literal"},{tag:Y.string,class:"tok-string"},{tag:Y.number,class:"tok-number"},{tag:[Y.regexp,Y.escape,Y.special(Y.string)],class:"tok-string2"},{tag:Y.variableName,class:"tok-variableName"},{tag:Y.local(Y.variableName),class:"tok-variableName tok-local"},{tag:Y.definition(Y.variableName),class:"tok-variableName tok-definition"},{tag:Y.special(Y.variableName),class:"tok-variableName2"},{tag:Y.definition(Y.propertyName),class:"tok-propertyName tok-definition"},{tag:Y.typeName,class:"tok-typeName"},{tag:Y.namespace,class:"tok-namespace"},{tag:Y.className,class:"tok-className"},{tag:Y.macroName,class:"tok-macroName"},{tag:Y.propertyName,class:"tok-propertyName"},{tag:Y.operator,class:"tok-operator"},{tag:Y.comment,class:"tok-comment"},{tag:Y.meta,class:"tok-meta"},{tag:Y.invalid,class:"tok-invalid"},{tag:Y.punctuation,class:"tok-punctuation"}]);var Dx;const Ou=new Le;function XQ(e){return me.define({combine:e?t=>t.concat(e):void 0})}const QQ=new Le;class pi{constructor(t,n,r=[],i=""){this.data=t,this.name=i,qe.prototype.hasOwnProperty("tree")||Object.defineProperty(qe.prototype,"tree",{get(){return Pn(this)}}),this.parser=n,this.extension=[Zl.of(this),qe.languageData.of((a,l,s)=>{let c=jP(a,l,s),f=c.type.prop(Ou);if(!f)return[];let d=a.facet(f),p=c.type.prop(QQ);if(p){let g=c.resolve(l-c.from,s);for(let v of p)if(v.test(g,a)){let y=a.facet(v.facet);return v.type=="replace"?y:y.concat(d)}}return d})].concat(r)}isActiveAt(t,n,r=-1){return jP(t,n,r).type.prop(Ou)==this.data}findRegions(t){let n=t.facet(Zl);if(n?.data==this.data)return[{from:0,to:t.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(a,l)=>{if(a.prop(Ou)==this.data){r.push({from:l,to:l+a.length});return}let s=a.prop(Le.mounted);if(s){if(s.tree.prop(Ou)==this.data){if(s.overlay)for(let c of s.overlay)r.push({from:c.from+l,to:c.to+l});else r.push({from:l,to:l+a.length});return}else if(s.overlay){let c=r.length;if(i(s.tree,s.overlay[0].from+l),r.length>c)return}}for(let c=0;c<a.children.length;c++){let f=a.children[c];f instanceof jt&&i(f,a.positions[c]+l)}};return i(Pn(t),0),r}get allowsNesting(){return!0}}pi.setState=Re.define();function jP(e,t,n){let r=e.facet(Zl),i=Pn(e).topNode;if(!r||r.allowsNesting)for(let a=i;a;a=a.enter(t,n,Pt.ExcludeBuffers|Pt.EnterBracketed))a.type.isTop&&(i=a);return i}class hg extends pi{constructor(t,n,r){super(t,n,[],r),this.parser=n}static define(t){let n=XQ(t.languageData);return new hg(n,t.parser.configure({props:[Ou.add(r=>r.isTop?n:void 0)]}),t.name)}configure(t,n){return new hg(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Pn(e){let t=e.field(pi.state,!1);return t?t.tree:jt.empty}class YQ{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,n){let r=this.cursorPos-this.string.length;return t<r||n>=this.cursorPos?this.doc.sliceString(t,n):this.string.slice(t-r,n-r)}}let Of=null;class dg{constructor(t,n,r=[],i,a,l,s,c){this.parser=t,this.state=n,this.fragments=r,this.tree=i,this.treeLen=a,this.viewport=l,this.skipped=s,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}static create(t,n,r){return new dg(t,n,[],jt.empty,0,r,[],null)}startParse(){return this.parser.startParse(new YQ(this.state.doc),this.fragments)}work(t,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=jt.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof t=="number"){let i=Date.now()+t;t=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(Yo.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(t())return!1}})}takeTree(){let t,n;this.parse&&(t=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=t,this.tree=n,this.fragments=this.withoutTempSkipped(Yo.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let n=Of;Of=this;try{return t()}finally{Of=n}}withoutTempSkipped(t){for(let n;n=this.tempSkipped.pop();)t=BP(t,n.from,n.to);return t}changes(t,n){let{fragments:r,tree:i,treeLen:a,viewport:l,skipped:s}=this;if(this.takeTree(),!t.empty){let c=[];if(t.iterChangedRanges((f,d,p,g)=>c.push({fromA:f,toA:d,fromB:p,toB:g})),r=Yo.applyChanges(r,c),i=jt.empty,a=0,l={from:t.mapPos(l.from,-1),to:t.mapPos(l.to,1)},this.skipped.length){s=[];for(let f of this.skipped){let d=t.mapPos(f.from,1),p=t.mapPos(f.to,-1);d<p&&s.push({from:d,to:p})}}}return new dg(this.parser,n,r,i,a,l,s,this.scheduleOn)}updateViewport(t){if(this.viewport.from==t.from&&this.viewport.to==t.to)return!1;this.viewport=t;let n=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:a}=this.skipped[r];i<t.to&&a>t.from&&(this.fragments=BP(this.fragments,i,a),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,n){this.skipped.push({from:t,to:n})}static getSkippingParser(t){return new class extends _3{createParse(n,r,i){let a=i[0].from,l=i[i.length-1].to;return{parsedPos:a,advance(){let c=Of;if(c){for(let f of i)c.tempSkipped.push(f);t&&(c.scheduleOn=c.scheduleOn?Promise.all([c.scheduleOn,t]):t)}return this.parsedPos=l,new jt(fr.none,[],[],l-a)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let n=this.fragments;return this.treeLen>=t&&n.length&&n[0].from==0&&n[0].to>=t}static get(){return Of}}function BP(e,t,n){return Yo.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class Xu{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new Xu(n)}static init(t){let n=Math.min(3e3,t.doc.length),r=dg.create(t.facet(Zl).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new Xu(r)}}pi.state=_n.define({create:Xu.init,update(e,t){for(let n of t.effects)if(n.is(pi.setState))return n.value;return t.startState.facet(Zl)!=t.state.facet(Zl)?Xu.init(t.state):e.apply(t)}});let j3=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(j3=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const Rx=typeof navigator<"u"&&(!((Dx=navigator.scheduling)===null||Dx===void 0)&&Dx.isInputPending)?()=>navigator.scheduling.isInputPending():null,GQ=Rt.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let n=this.view.state.field(pi.state).context;(n.updateViewport(t.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:t}=this.view,n=t.field(pi.state);(n.tree!=n.context.tree||!n.context.isDone(t.doc.length))&&(this.working=j3(this.work))}work(t){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:i}}=this.view,a=r.field(pi.state);if(a.tree==a.context.tree&&a.context.isDone(i+1e5))return;let l=Date.now()+Math.min(this.chunkBudget,100,t&&!Rx?Math.max(25,t.timeRemaining()-5):1e9),s=a.context.treeLen<i&&r.doc.length>i+1e3,c=a.context.work(()=>Rx&&Rx()||Date.now()>l,i+(s?0:1e5));this.chunkBudget-=Date.now()-n,(c||this.chunkBudget<=0)&&(a.context.takeTree(),this.view.dispatch({effects:pi.setState.of(new Xu(a.context))})),this.chunkBudget>0&&!(c&&!s)&&this.scheduleWork(),this.checkAsyncSchedule(a.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(n=>ar(this.view.state,n)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Zl=me.define({combine(e){return e.length?e[0]:null},enables:e=>[pi.state,GQ,de.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class ZQ{constructor(t,n=[]){this.language=t,this.support=n,this.extension=[t,n]}}const JQ=me.define(),Bv=me.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(n=>n!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function pg(e){let t=e.facet(Bv);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function Sh(e,t){let n="",r=e.tabSize,i=e.facet(Bv)[0];if(i==" "){for(;t>=r;)n+=" ",t-=r;i=" "}for(let a=0;a<t;a++)n+=i;return n}function $O(e,t){e instanceof qe&&(e=new zv(e));for(let r of e.state.facet(JQ)){let i=r(e,t);if(i!==void 0)return i}let n=Pn(e.state);return n.length>=t?eY(e,n,t):null}class zv{constructor(t,n={}){this.state=t,this.options=n,this.unit=pg(t)}lineAt(t,n=1){let r=this.state.doc.lineAt(t),{simulateBreak:i,simulateDoubleBreak:a}=this.options;return i!=null&&i>=r.from&&i<=r.to?a&&i==t?{text:"",from:t}:(n<0?i<t:i<=t)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(t,n=1){if(this.options.simulateDoubleBreak&&t==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(t,n);return r.slice(t-i,Math.min(r.length,t+100-i))}column(t,n=1){let{text:r,from:i}=this.lineAt(t,n),a=this.countColumn(r,t-i),l=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return l>-1&&(a+=l-this.countColumn(r,r.search(/\S|$/))),a}countColumn(t,n=t.length){return cc(t,this.state.tabSize,n)}lineIndent(t,n=1){let{text:r,from:i}=this.lineAt(t,n),a=this.options.overrideIndentation;if(a){let l=a(i);if(l>-1)return l}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const B3=new Le;function eY(e,t,n){let r=t.resolveStack(n),i=t.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let a=[];for(let l=i;l&&!(l.from<r.node.from||l.to>r.node.to||l.from==r.node.from&&l.type==r.node.type);l=l.parent)a.push(l);for(let l=a.length-1;l>=0;l--)r={node:a[l],next:r}}return z3(r,e,n)}function z3(e,t,n){for(let r=e;r;r=r.next){let i=nY(r.node);if(i)return i(HO.create(t,n,r))}return 0}function tY(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function nY(e){let t=e.type.prop(B3);if(t)return t;let n=e.firstChild,r;if(n&&(r=n.type.prop(Le.closedBy))){let i=e.lastChild,a=i&&r.indexOf(i.name)>-1;return l=>$3(l,!0,1,void 0,a&&!tY(l)?i.from:void 0)}return e.parent==null?rY:null}function rY(){return 0}class HO extends zv{constructor(t,n,r){super(t.state,t.options),this.base=t,this.pos=n,this.context=r}get node(){return this.context.node}static create(t,n,r){return new HO(t,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let n=this.state.doc.lineAt(t.from);for(;;){let r=t.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(iY(r,t))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return z3(this.context.next,this.base,this.pos)}}function iY(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function aY(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,a=e.state.doc.lineAt(n.from),l=i==null||i<=a.from?a.to:Math.min(a.to,i);for(let s=n.to;;){let c=t.childAfter(s);if(!c||c==r)return null;if(!c.type.isSkipped){if(c.from>=l)return null;let f=/^ */.exec(a.text.slice(n.to-a.from))[0].length;return{from:n.from,to:n.to+f}}s=c.to}}function zP({closing:e,align:t=!0,units:n=1}){return r=>$3(r,t,n,e)}function $3(e,t,n,r,i){let a=e.textAfter,l=a.match(/^\s*/)[0].length,s=r&&a.slice(l,l+r.length)==r||i==e.pos+l,c=t?aY(e):null;return c?s?e.column(c.from):e.column(c.to):e.baseIndent+(s?0:e.unit*n)}const lY=200;function oY(){return qe.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:r}=e.newSelection.main,i=n.lineAt(r);if(r>i.from+lY)return e;let a=n.sliceString(i.from,r);if(!t.some(f=>f.test(a)))return e;let{state:l}=e,s=-1,c=[];for(let{head:f}of l.selection.ranges){let d=l.doc.lineAt(f);if(d.from==s)continue;s=d.from;let p=$O(l,d.from);if(p==null)continue;let g=/^\s*/.exec(d.text)[0],v=Sh(l,p);g!=v&&c.push({from:d.from,to:d.from+g.length,insert:v})}return c.length?[e,{changes:c,sequential:!0}]:e})}const sY=me.define(),H3=new Le;function uY(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}function cY(e,t,n){let r=Pn(e);if(r.length<n)return null;let i=r.resolveStack(n,1),a=null;for(let l=i;l;l=l.next){let s=l.node;if(s.to<=n||s.from>n)continue;if(a&&s.from<t)break;let c=s.type.prop(H3);if(c&&(s.to<r.length-50||r.length==e.doc.length||!fY(s))){let f=c(s,e);f&&f.from<=n&&f.from>=t&&f.to>n&&(a=f)}}return a}function fY(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function mg(e,t,n){for(let r of e.facet(sY)){let i=r(e,t,n);if(i)return i}return cY(e,t,n)}function U3(e,t){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}const $v=Re.define({map:U3}),Vh=Re.define({map:U3});function F3(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(r=>r.from<=n&&r.to>=n)||t.push(e.lineBlockAt(n));return t}const ss=_n.define({create(){return Ce.none},update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((r,i)=>e=$P(e,r,i)),e=e.map(t.changes);let n=[];for(let r of t.effects)r.is($v)&&!hY(e,r.value.from,r.value.to)?n.push(r.value):r.is(Vh)&&(e=e.update({filter:(i,a)=>r.value.from!=i||r.value.to!=a,filterFrom:r.value.from,filterTo:r.value.to}));if(n.length){let{preparePlaceholder:r}=t.state.facet(V3),i=n.map(a=>(r?Ce.replace({widget:new bY(r(t.state,a))}):HP).range(a.from,a.to));e=e.update({add:i})}return t.selection&&(e=$P(e,t.selection.main.head)),e},provide:e=>de.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(r,i)=>{n.push(r,i)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n<e.length;){let r=e[n++],i=e[n++];if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid JSON for fold state");t.push(HP.range(r,i))}return Ce.set(t,!0)}});function $P(e,t,n=t){let r=!1;return e.between(t,n,(i,a)=>{i<n&&a>t&&(r=!0)}),r?e.update({filterFrom:t,filterTo:n,filter:(i,a)=>i>=n||a<=t}):e}function gg(e,t,n){var r;let i=null;return(r=e.field(ss,!1))===null||r===void 0||r.between(t,n,(a,l)=>{(!i||i.from>a)&&(i={from:a,to:l})}),i}function hY(e,t,n){let r=!1;return e.between(t,t,(i,a)=>{i==t&&a==n&&(r=!0)}),r}function q3(e,t){return e.field(ss,!1)?t:t.concat(Re.appendConfig.of(K3()))}const dY=e=>{for(let t of F3(e)){let n=mg(e.state,t.from,t.to);if(n)return e.dispatch({effects:q3(e.state,[$v.of(n),W3(e,n)])}),!0}return!1},pY=e=>{if(!e.state.field(ss,!1))return!1;let t=[];for(let n of F3(e)){let r=gg(e.state,n.from,n.to);r&&t.push(Vh.of(r),W3(e,r,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function W3(e,t,n=!0){let r=e.state.doc.lineAt(t.from).number,i=e.state.doc.lineAt(t.to).number;return de.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${e.state.phrase("to")} ${i}.`)}const mY=e=>{let{state:t}=e,n=[];for(let r=0;r<t.doc.length;){let i=e.lineBlockAt(r),a=mg(t,i.from,i.to);a&&n.push($v.of(a)),r=(a?e.lineBlockAt(a.to):i).to+1}return n.length&&e.dispatch({effects:q3(e.state,n)}),!!n.length},gY=e=>{let t=e.state.field(ss,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(r,i)=>{n.push(Vh.of({from:r,to:i}))}),e.dispatch({effects:n}),!0},vY=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:dY},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:pY},{key:"Ctrl-Alt-[",run:mY},{key:"Ctrl-Alt-]",run:gY}],yY={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},V3=me.define({combine(e){return ra(e,yY)}});function K3(e){return[ss,wY]}function X3(e,t){let{state:n}=e,r=n.facet(V3),i=l=>{let s=e.lineBlockAt(e.posAtDOM(l.target)),c=gg(e.state,s.from,s.to);c&&e.dispatch({effects:Vh.of(c)}),l.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(e,i,t);let a=document.createElement("span");return a.textContent=r.placeholderText,a.setAttribute("aria-label",n.phrase("folded code")),a.title=n.phrase("unfold"),a.className="cm-foldPlaceholder",a.onclick=i,a}const HP=Ce.replace({widget:new class extends ia{toDOM(e){return X3(e,null)}}});class bY extends ia{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return X3(t,this.value)}}const xY={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class _x extends Ua{constructor(t,n){super(),this.config=t,this.open=n}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=t.state.phrase(this.open?"Fold line":"Unfold line"),n}}function SY(e={}){let t={...xY,...e},n=new _x(t,!0),r=new _x(t,!1),i=Rt.fromClass(class{constructor(l){this.from=l.viewport.from,this.markers=this.buildMarkers(l)}update(l){(l.docChanged||l.viewportChanged||l.startState.facet(Zl)!=l.state.facet(Zl)||l.startState.field(ss,!1)!=l.state.field(ss,!1)||Pn(l.startState)!=Pn(l.state)||t.foldingChanged(l))&&(this.markers=this.buildMarkers(l.view))}buildMarkers(l){let s=new $a;for(let c of l.viewportLineBlocks){let f=gg(l.state,c.from,c.to)?r:mg(l.state,c.from,c.to)?n:null;f&&s.add(c.from,c.from,f)}return s.finish()}}),{domEventHandlers:a}=t;return[i,wQ({class:"cm-foldGutter",markers(l){var s;return((s=l.plugin(i))===null||s===void 0?void 0:s.markers)||ze.empty},initialSpacer(){return new _x(t,!1)},domEventHandlers:{...a,click:(l,s,c)=>{if(a.click&&a.click(l,s,c))return!0;let f=gg(l.state,s.from,s.to);if(f)return l.dispatch({effects:Vh.of(f)}),!0;let d=mg(l.state,s.from,s.to);return d?(l.dispatch({effects:$v.of(d)}),!0):!1}}}),K3()]}const wY=de.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Kh{constructor(t,n){this.specs=t;let r;function i(s){let c=Xl.newName();return(r||(r=Object.create(null)))["."+c]=s,c}const a=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,l=n.scope;this.scope=l instanceof pi?s=>s.prop(Ou)==l.data:l?s=>s==l:void 0,this.style=L3(t.map(s=>({tag:s.tag,class:s.class||i(Object.assign({},s,{tag:null}))})),{all:a}).style,this.module=r?new Xl(r):null,this.themeType=n.themeType}static define(t,n){return new Kh(t,n||{})}}const _S=me.define(),Q3=me.define({combine(e){return e.length?[e[0]]:null}});function Nx(e){let t=e.facet(_S);return t.length?t:e.facet(Q3)}function Y3(e,t){let n=[AY],r;return e instanceof Kh&&(e.module&&n.push(de.styleModule.of(e.module)),r=e.themeType),t?.fallback?n.push(Q3.of(e)):r?n.push(_S.computeN([de.darkTheme],i=>i.facet(de.darkTheme)==(r=="dark")?[e]:[])):n.push(_S.of(e)),n}class OY{constructor(t){this.markCache=Object.create(null),this.tree=Pn(t.state),this.decorations=this.buildDeco(t,Nx(t.state)),this.decoratedTo=t.viewport.to}update(t){let n=Pn(t.state),r=Nx(t.state),i=r!=Nx(t.startState),{viewport:a}=t.view,l=t.changes.mapPos(this.decoratedTo,1);n.length<a.to&&!i&&n.type==this.tree.type&&l>=a.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=l):(n!=this.tree||t.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(t.view,r),this.decoratedTo=a.to)}buildDeco(t,n){if(!n||!this.tree.length)return Ce.none;let r=new $a;for(let{from:i,to:a}of t.visibleRanges)WQ(this.tree,n,(l,s,c)=>{r.add(l,s,this.markCache[c]||(this.markCache[c]=Ce.mark({class:c})))},i,a);return r.finish()}}const AY=gs.high(Rt.fromClass(OY,{decorations:e=>e.decorations})),kY=Kh.define([{tag:Y.meta,color:"#404740"},{tag:Y.link,textDecoration:"underline"},{tag:Y.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Y.emphasis,fontStyle:"italic"},{tag:Y.strong,fontWeight:"bold"},{tag:Y.strikethrough,textDecoration:"line-through"},{tag:Y.keyword,color:"#708"},{tag:[Y.atom,Y.bool,Y.url,Y.contentSeparator,Y.labelName],color:"#219"},{tag:[Y.literal,Y.inserted],color:"#164"},{tag:[Y.string,Y.deleted],color:"#a11"},{tag:[Y.regexp,Y.escape,Y.special(Y.string)],color:"#e40"},{tag:Y.definition(Y.variableName),color:"#00f"},{tag:Y.local(Y.variableName),color:"#30a"},{tag:[Y.typeName,Y.namespace],color:"#085"},{tag:Y.className,color:"#167"},{tag:[Y.special(Y.variableName),Y.macroName],color:"#256"},{tag:Y.definition(Y.propertyName),color:"#00c"},{tag:Y.comment,color:"#940"},{tag:Y.invalid,color:"#f00"}]),CY=de.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),G3=1e4,Z3="()[]{}",J3=me.define({combine(e){return ra(e,{afterCursor:!0,brackets:Z3,maxScanDistance:G3,renderMatch:MY})}}),EY=Ce.mark({class:"cm-matchingBracket"}),TY=Ce.mark({class:"cm-nonmatchingBracket"});function MY(e){let t=[],n=e.matched?EY:TY;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}function UP(e){let t=[],n=e.facet(J3);for(let r of e.selection.ranges){if(!r.empty)continue;let i=Fi(e,r.head,-1,n)||r.head>0&&Fi(e,r.head-1,1,n)||n.afterCursor&&(Fi(e,r.head,1,n)||r.head<e.doc.length&&Fi(e,r.head+1,-1,n));i&&(t=t.concat(n.renderMatch(i,e)))}return Ce.set(t,!0)}const PY=Rt.fromClass(class{constructor(e){this.paused=!1,this.decorations=UP(e.state)}update(e){(e.docChanged||e.selectionSet||this.paused)&&(e.view.composing?(this.decorations=this.decorations.map(e.changes),this.paused=!0):(this.decorations=UP(e.state),this.paused=!1))}},{decorations:e=>e.decorations}),DY=[PY,CY];function RY(e={}){return[J3.of(e),DY]}const _Y=new Le;function NS(e,t,n){let r=e.prop(t<0?Le.openedBy:Le.closedBy);if(r)return r;if(e.name.length==1){let i=n.indexOf(e.name);if(i>-1&&i%2==(t<0?1:0))return[n[i+t]]}return null}function IS(e){let t=e.type.prop(_Y);return t?t(e.node):e}function Fi(e,t,n,r={}){let i=r.maxScanDistance||G3,a=r.brackets||Z3,l=Pn(e),s=l.resolveInner(t,n);for(let c=s;c;c=c.parent){let f=NS(c.type,n,a);if(f&&c.from<c.to){let d=IS(c);if(d&&(n>0?t>=d.from&&t<d.to:t>d.from&&t<=d.to))return NY(e,t,n,c,d,f,a)}}return IY(e,t,n,l,s.type,i,a)}function NY(e,t,n,r,i,a,l){let s=r.parent,c={from:i.from,to:i.to},f=0,d=s?.cursor();if(d&&(n<0?d.childBefore(r.from):d.childAfter(r.to)))do if(n<0?d.to<=r.from:d.from>=r.to){if(f==0&&a.indexOf(d.type.name)>-1&&d.from<d.to){let p=IS(d);return{start:c,end:p?{from:p.from,to:p.to}:void 0,matched:!0}}else if(NS(d.type,n,l))f++;else if(NS(d.type,-n,l)){if(f==0){let p=IS(d);return{start:c,end:p&&p.from<p.to?{from:p.from,to:p.to}:void 0,matched:!1}}f--}}while(n<0?d.prevSibling():d.nextSibling());return{start:c,matched:!1}}function IY(e,t,n,r,i,a,l){if(n<0?!t:t==e.doc.length)return null;let s=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),c=l.indexOf(s);if(c<0||c%2==0!=n>0)return null;let f={from:n<0?t-1:t,to:n>0?t+1:t},d=e.doc.iterRange(t,n>0?e.doc.length:0),p=0;for(let g=0;!d.next().done&&g<=a;){let v=d.value;n<0&&(g+=v.length);let y=t+g*n;for(let x=n>0?0:v.length-1,w=n>0?v.length:-1;x!=w;x+=n){let A=l.indexOf(v[x]);if(!(A<0||r.resolveInner(y+x,1).type!=i))if(A%2==0==n>0)p++;else{if(p==1)return{start:f,end:{from:y+x,to:y+x+1},matched:A>>1==c>>1};p--}}n>0&&(g+=v.length)}return d.done?{start:f,matched:!1}:null}const LY=Object.create(null),FP=[fr.none],qP=[],WP=Object.create(null),jY=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])jY[e]=BY(LY,t);function Ix(e,t){qP.indexOf(e)>-1||(qP.push(e),console.warn(t))}function BY(e,t){let n=[];for(let s of t.split(" ")){let c=[];for(let f of s.split(".")){let d=e[f]||Y[f];d?typeof d=="function"?c.length?c=c.map(d):Ix(f,`Modifier ${f} used at start of tag`):c.length?Ix(f,`Tag ${f} used as modifier`):c=Array.isArray(d)?d:[d]:Ix(f,`Unknown highlighting tag ${f}`)}for(let f of c)n.push(f)}if(!n.length)return 0;let r=t.replace(/ /g,"_"),i=r+" "+n.map(s=>s.id),a=WP[i];if(a)return a.id;let l=WP[i]=fr.define({id:FP.length,name:r,props:[N3({[r]:n})]});return FP.push(l),l.id}ft.RTL,ft.LTR;const zY=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=FO(e.state,n.from);return r.line?$Y(e):r.block?UY(e):!1};function UO(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}const $Y=UO(WY,0),HY=UO(eB,0),UY=UO((e,t)=>eB(e,t,qY(t)),0);function FO(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const Af=50;function FY(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-Af,r),l=e.sliceDoc(i,i+Af),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(l)[0].length,f=a.length-s;if(a.slice(f-t.length,f)==t&&l.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let d,p;i-r<=2*Af?d=p=e.sliceDoc(r,i):(d=e.sliceDoc(r,r+Af),p=e.sliceDoc(i-Af,i));let g=/^\s*/.exec(d)[0].length,v=/\s*$/.exec(p)[0].length,y=p.length-v-n.length;return d.slice(g,g+t.length)==t&&p.slice(y,y+n.length)==n?{open:{pos:r+g+t.length,margin:/\s/.test(d.charAt(g+t.length))?1:0},close:{pos:i-v-n.length,margin:/\s/.test(p.charAt(y-1))?1:0}}:null}function qY(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function eB(e,t,n=t.selection.ranges){let r=n.map(a=>FO(t,a.from).block);if(!r.every(a=>a))return null;let i=n.map((a,l)=>FY(t,r[l],a.from,a.to));if(e!=2&&!i.every(a=>a))return{changes:t.changes(n.map((a,l)=>i[l]?[]:[{from:a.from,insert:r[l].open+" "},{from:a.to,insert:" "+r[l].close}]))};if(e!=1&&i.some(a=>a)){let a=[];for(let l=0,s;l<i.length;l++)if(s=i[l]){let c=r[l],{open:f,close:d}=s;a.push({from:f.pos-c.open.length,to:f.pos+f.margin},{from:d.pos-d.margin,to:d.pos+c.close.length})}return{changes:a}}return null}function WY(e,t,n=t.selection.ranges){let r=[],i=-1;e:for(let{from:a,to:l}of n){let s=r.length,c=1e9,f;for(let d=a;d<=l;){let p=t.doc.lineAt(d);if(f==null&&(f=FO(t,p.from).line,!f))continue e;if(p.from>i&&(a==l||l>p.from)){i=p.from;let g=/^\s*/.exec(p.text)[0].length,v=g==p.length,y=p.text.slice(g,g+f.length)==f?g:-1;g<p.text.length&&g<c&&(c=g),r.push({line:p,comment:y,token:f,indent:g,empty:v,single:!1})}d=p.to+1}if(c<1e9)for(let d=s;d<r.length;d++)r[d].indent<r[d].line.text.length&&(r[d].indent=c);r.length==s+1&&(r[s].single=!0)}if(e!=2&&r.some(a=>a.comment<0&&(!a.empty||a.single))){let a=[];for(let{line:s,token:c,indent:f,empty:d,single:p}of r)(p||!d)&&a.push({from:s.from+f,insert:c+" "});let l=t.changes(a);return{changes:l,selection:t.selection.map(l,1)}}else if(e!=1&&r.some(a=>a.comment>=0)){let a=[];for(let{line:l,comment:s,token:c}of r)if(s>=0){let f=l.from+s,d=f+c.length;l.text[d-l.from]==" "&&d++,a.push({from:f,to:d})}return{changes:a}}return null}const LS=na.define(),VY=na.define(),KY=me.define(),tB=me.define({combine(e){return ra(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(r,i)=>t(r,i)||n(r,i)})}}),nB=_n.define({create(){return qi.empty},update(e,t){let n=t.state.facet(tB),r=t.annotation(LS);if(r){let c=lr.fromTransaction(t,r.selection),f=r.side,d=f==0?e.undone:e.done;return c?d=vg(d,d.length,n.minDepth,c):d=aB(d,t.startState.selection),new qi(f==0?r.rest:d,f==0?d:r.rest)}let i=t.annotation(VY);if((i=="full"||i=="before")&&(e=e.isolate()),t.annotation(Gt.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=lr.fromTransaction(t),l=t.annotation(Gt.time),s=t.annotation(Gt.userEvent);return a?e=e.addChanges(a,l,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,l,s,n.newGroupDelay)),(i=="full"||i=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new qi(e.done.map(lr.fromJSON),e.undone.map(lr.fromJSON))}});function XY(e={}){return[nB,tB.of(e),de.domEventHandlers({beforeinput(t,n){let r=t.inputType=="historyUndo"?rB:t.inputType=="historyRedo"?jS:null;return r?(t.preventDefault(),r(n)):!1}})]}function Hv(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(nB,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}const rB=Hv(0,!1),jS=Hv(1,!1),QY=Hv(0,!0),YY=Hv(1,!0);class lr{constructor(t,n,r,i,a){this.changes=t,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=a}setSelAfter(t){return new lr(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,r;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(t){return new lr(t.changes&&Qt.fromJSON(t.changes),[],t.mapped&&Ki.fromJSON(t.mapped),t.startSelection&&J.fromJSON(t.startSelection),t.selectionsAfter.map(J.fromJSON))}static fromTransaction(t,n){let r=Qr;for(let i of t.startState.facet(KY)){let a=i(t);a.length&&(r=r.concat(a))}return!r.length&&t.changes.empty?null:new lr(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,Qr)}static selection(t){return new lr(void 0,Qr,void 0,void 0,t)}}function vg(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function GY(e,t){let n=[],r=!1;return e.iterChangedRanges((i,a)=>n.push(i,a)),t.iterChangedRanges((i,a,l,s)=>{for(let c=0;c<n.length;){let f=n[c++],d=n[c++];s>=f&&l<=d&&(r=!0)}}),r}function ZY(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,r)=>n.empty!=t.ranges[r].empty).length===0}function iB(e,t){return e.length?t.length?e.concat(t):e:t}const Qr=[],JY=200;function aB(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-JY));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),vg(e,e.length-1,1e9,n.setSelAfter(r)))}else return[lr.selection([t])]}function eG(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function Lx(e,t){if(!e.length)return e;let n=e.length,r=Qr;for(;n;){let i=tG(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let a=e.slice(0,n);return a[n-1]=i,a}else t=i.mapped,n--,r=i.selectionsAfter}return r.length?[lr.selection(r)]:Qr}function tG(e,t,n){let r=iB(e.selectionsAfter.length?e.selectionsAfter.map(s=>s.map(t)):Qr,n);if(!e.changes)return lr.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),l=e.mapped?e.mapped.composeDesc(a):a;return new lr(i,Re.mapEffects(e.effects,t),l,e.startSelection.map(a),r)}const nG=/^(input\.type|delete)($|\.)/;class qi{constructor(t,n,r=0,i=void 0){this.done=t,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new qi(this.done,this.undone):this}addChanges(t,n,r,i,a){let l=this.done,s=l[l.length-1];return s&&s.changes&&!s.changes.empty&&t.changes&&(!r||nG.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,GY(s.changes,t.changes))||r=="input.type.compose")?l=vg(l,l.length-1,i.minDepth,new lr(t.changes.compose(s.changes),iB(Re.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,Qr)):l=vg(l,l.length,i.minDepth,t),new qi(l,Qr,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:Qr;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&ZY(a[a.length-1],t)?this:new qi(aB(this.done,t),this.undone,n,r)}addMapping(t){return new qi(Lx(this.done,t),Lx(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,n,r){let i=t==0?this.done:this.undone;if(i.length==0)return null;let a=i[i.length-1],l=a.selectionsAfter[0]||(a.startSelection?a.startSelection.map(a.changes.invertedDesc,1):n.selection);if(r&&a.selectionsAfter.length)return n.update({selection:a.selectionsAfter[a.selectionsAfter.length-1],annotations:LS.of({side:t,rest:eG(i),selection:l}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(a.changes){let s=i.length==1?Qr:i.slice(0,i.length-1);return a.mapped&&(s=Lx(s,a.mapped)),n.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:LS.of({side:t,rest:s,selection:l}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}qi.empty=new qi(Qr,Qr);const rG=[{key:"Mod-z",run:rB,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:jS,preventDefault:!0},{linux:"Ctrl-Shift-z",run:jS,preventDefault:!0},{key:"Mod-u",run:QY,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:YY,preventDefault:!0}];function fc(e,t){return J.create(e.ranges.map(t),e.mainIndex)}function wi(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Oi({state:e,dispatch:t},n){let r=fc(e.selection,n);return r.eq(e.selection,!0)?!1:(t(wi(e,r)),!0)}function Uv(e,t){return J.cursor(t?e.to:e.from)}function lB(e,t){return Oi(e,n=>n.empty?e.moveByChar(n,t):Uv(n,t))}function Nn(e){return e.textDirectionAt(e.state.selection.main.head)==ft.LTR}const oB=e=>lB(e,!Nn(e)),sB=e=>lB(e,Nn(e));function uB(e,t){return Oi(e,n=>n.empty?e.moveByGroup(n,t):Uv(n,t))}const iG=e=>uB(e,!Nn(e)),aG=e=>uB(e,Nn(e));function lG(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function Fv(e,t,n){let r=Pn(e).resolveInner(t.head),i=n?Le.closedBy:Le.openedBy;for(let c=t.head;;){let f=n?r.childAfter(c):r.childBefore(c);if(!f)break;lG(e,f,i)?r=f:c=n?f.to:f.from}let a=r.type.prop(i),l,s;return a&&(l=n?Fi(e,r.from,1):Fi(e,r.to,-1))&&l.matched?s=n?l.end.to:l.end.from:s=n?r.to:r.from,J.cursor(s,n?-1:1)}const oG=e=>Oi(e,t=>Fv(e.state,t,!Nn(e))),sG=e=>Oi(e,t=>Fv(e.state,t,Nn(e)));function cB(e,t){return Oi(e,n=>{if(!n.empty)return Uv(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}const fB=e=>cB(e,!1),hB=e=>cB(e,!0);function dB(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let a of e.state.facet(de.scrollMargins)){let l=a(e);l?.top&&(n=Math.max(l?.top,n)),l?.bottom&&(r=Math.max(l?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function pB(e,t){let n=dB(e),{state:r}=e,i=fc(r.selection,l=>l.empty?e.moveVertically(l,t,n.height):Uv(l,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let l=e.coordsAtPos(r.selection.main.head),s=e.scrollDOM.getBoundingClientRect(),c=s.top+n.marginTop,f=s.bottom-n.marginBottom;l&&l.top>c&&l.bottom<f&&(a=de.scrollIntoView(i.main.head,{y:"start",yMargin:l.top-c}))}return e.dispatch(wi(r,i),{effects:a}),!0}const VP=e=>pB(e,!1),BS=e=>pB(e,!0);function io(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let a=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;a&&t.head!=r.from+a&&(i=J.cursor(r.from+a))}return i}const uG=e=>Oi(e,t=>io(e,t,!0)),cG=e=>Oi(e,t=>io(e,t,!1)),fG=e=>Oi(e,t=>io(e,t,!Nn(e))),hG=e=>Oi(e,t=>io(e,t,Nn(e))),dG=e=>Oi(e,t=>J.cursor(e.lineBlockAt(t.head).from,1)),pG=e=>Oi(e,t=>J.cursor(e.lineBlockAt(t.head).to,-1));function mG(e,t,n){let r=!1,i=fc(e.selection,a=>{let l=Fi(e,a.head,-1)||Fi(e,a.head,1)||a.head>0&&Fi(e,a.head-1,1)||a.head<e.doc.length&&Fi(e,a.head+1,-1);if(!l||!l.end)return a;r=!0;let s=l.start.from==a.head?l.end.to:l.end.from;return J.cursor(s)});return r?(t(wi(e,i)),!0):!1}const gG=({state:e,dispatch:t})=>mG(e,t);function ni(e,t,n){let r=fc(e.state.selection,i=>{i.undirectional&&i.head>=i.anchor!=t&&(i=J.range(i.head,i.anchor));let a=n(i);return J.range(i.anchor,a.head,a.goalColumn,a.bidiLevel||void 0,a.assoc)});return r.eq(e.state.selection)?!1:(e.dispatch(wi(e.state,r)),!0)}function mB(e,t){return ni(e,t,n=>e.moveByChar(n,t))}const gB=e=>mB(e,!Nn(e)),vB=e=>mB(e,Nn(e));function yB(e,t){return ni(e,t,n=>e.moveByGroup(n,t))}const vG=e=>yB(e,!Nn(e)),yG=e=>yB(e,Nn(e)),bG=e=>{let t=!Nn(e);return ni(e,t,n=>Fv(e.state,n,t))},xG=e=>{let t=Nn(e);return ni(e,t,n=>Fv(e.state,n,t))};function bB(e,t){return ni(e,t,n=>e.moveVertically(n,t))}const xB=e=>bB(e,!1),SB=e=>bB(e,!0);function wB(e,t){return ni(e,t,n=>e.moveVertically(n,t,dB(e).height))}const KP=e=>wB(e,!1),XP=e=>wB(e,!0),SG=e=>ni(e,!0,t=>io(e,t,!0)),wG=e=>ni(e,!1,t=>io(e,t,!1)),OG=e=>{let t=!Nn(e);return ni(e,t,n=>io(e,n,t))},AG=e=>{let t=Nn(e);return ni(e,t,n=>io(e,n,t))},kG=e=>ni(e,!1,t=>J.cursor(e.lineBlockAt(t.head).from)),CG=e=>ni(e,!0,t=>J.cursor(e.lineBlockAt(t.head).to)),QP=({state:e,dispatch:t})=>(t(wi(e,{anchor:0})),!0),YP=({state:e,dispatch:t})=>(t(wi(e,{anchor:e.doc.length})),!0),GP=({state:e,dispatch:t})=>(t(wi(e,{anchor:e.selection.main.anchor,head:0})),!0),ZP=({state:e,dispatch:t})=>(t(wi(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),EG=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),TG=({state:e,dispatch:t})=>{let n=qv(e).map(({from:r,to:i})=>J.range(r,Math.min(i+1,e.doc.length)));return t(e.update({selection:J.create(n),userEvent:"select"})),!0},MG=({state:e,dispatch:t})=>{let n=fc(e.selection,r=>{let i=Pn(e),a=i.resolveStack(r.from,1);if(r.empty){let l=i.resolveStack(r.from,-1);l.node.from>=a.node.from&&l.node.to<=a.node.to&&(a=l)}for(let l=a;l;l=l.next){let{node:s}=l;if((s.from<r.from&&s.to>=r.to||s.to>r.to&&s.from<=r.from)&&l.next)return J.range(s.to,s.from)}return r});return n.eq(e.selection)?!1:(t(wi(e,n)),!0)};function OB(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let a of n.selection.ranges){let l=n.doc.lineAt(a.head);if(t?l.to<e.state.doc.length:l.from>0)for(let s=a;;){let c=e.moveVertically(s,t);if(c.head<l.from||c.head>l.to){i.some(f=>f.head==c.head)||i.push(c);break}else{if(c.head==s.head)break;s=c}}}return i.length==r.ranges.length?!1:(e.dispatch(wi(n,J.create(i,i.length-1))),!0)}const PG=e=>OB(e,!1),DG=e=>OB(e,!0),RG=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=J.create([n.main]):n.main.empty||(r=J.create([J.cursor(n.main.head)])),r?(t(wi(e,r)),!0):!1};function Xh(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,i=r.changeByRange(a=>{let{from:l,to:s}=a;if(l==s){let c=t(a);c<l?(n="delete.backward",c=im(e,c,!1)):c>l&&(n="delete.forward",c=im(e,c,!0)),l=Math.min(l,c),s=Math.max(s,c)}else l=im(e,l,!1),s=im(e,s,!0);return l==s?{range:a}:{changes:{from:l,to:s},range:J.cursor(l,l<a.head?-1:1)}});return i.changes.empty?!1:(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?de.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function im(e,t,n){if(e instanceof de)for(let r of e.state.facet(de.atomicRanges).map(i=>i(e)))r.between(t,t,(i,a)=>{i<t&&a>t&&(t=n?a:i)});return t}const AB=(e,t,n)=>Xh(e,r=>{let i=r.from,{state:a}=e,l=a.doc.lineAt(i),s,c;if(n&&!t&&i>l.from&&i<l.from+200&&!/[^ \t]/.test(s=l.text.slice(0,i-l.from))){if(s[s.length-1]==" ")return i-1;let f=cc(s,a.tabSize),d=f%pg(a)||pg(a);for(let p=0;p<d&&s[s.length-1-p]==" ";p++)i--;c=i}else c=on(l.text,i-l.from,t,t)+l.from,c==i&&l.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(l.text.slice(c-l.from,i-l.from))&&(c=on(l.text,c-l.from,!1,!1)+l.from);return c}),zS=e=>AB(e,!1,!0),kB=e=>AB(e,!0,!1),CB=(e,t)=>Xh(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),l=i.charCategorizer(r);for(let s=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let c=on(a.text,r-a.from,t)+a.from,f=a.text.slice(Math.min(r,c)-a.from,Math.max(r,c)-a.from),d=l(f);if(s!=null&&d!=s)break;(f!=" "||r!=n.head)&&(s=d),r=c}return r}),EB=e=>CB(e,!1),_G=e=>CB(e,!0),NG=e=>Xh(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),IG=e=>Xh(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),LG=e=>Xh(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),jG=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:Je.of(["",""])},range:J.cursor(r.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},BG=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{if(!r.empty||r.from==0||r.from==e.doc.length)return{range:r};let i=r.from,a=e.doc.lineAt(i),l=i==a.from?i-1:on(a.text,i-a.from,!1)+a.from,s=i==a.to?i+1:on(a.text,i-a.from,!0)+a.from;return{changes:{from:l,to:s,insert:e.doc.slice(i,s).append(e.doc.slice(l,i))},range:J.cursor(s)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function qv(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let l=t[t.length-1];l.to=a.to,l.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function TB(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let a of qv(e)){if(n?a.to==e.doc.length:a.from==0)continue;let l=e.doc.lineAt(n?a.to+1:a.from-1),s=l.length+1;if(n){r.push({from:a.to,to:l.to},{from:a.from,insert:l.text+e.lineBreak});for(let c of a.ranges)i.push(J.range(Math.min(e.doc.length,c.anchor+s),Math.min(e.doc.length,c.head+s)))}else{r.push({from:l.from,to:a.from},{from:a.to,insert:e.lineBreak+l.text});for(let c of a.ranges)i.push(J.range(c.anchor-s,c.head-s))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:J.create(i,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const zG=({state:e,dispatch:t})=>TB(e,t,!1),$G=({state:e,dispatch:t})=>TB(e,t,!0);function MB(e,t,n){if(e.readOnly)return!1;let r=[];for(let a of qv(e))n?r.push({from:a.from,insert:e.doc.slice(a.from,a.to)+e.lineBreak}):r.push({from:a.to,insert:e.lineBreak+e.doc.slice(a.from,a.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const HG=({state:e,dispatch:t})=>MB(e,t,!1),UG=({state:e,dispatch:t})=>MB(e,t,!0),FG=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(qv(t).map(({from:i,to:a})=>(i>0?i--:a<t.doc.length&&a++,{from:i,to:a}))),r=fc(t.selection,i=>{let a;if(e.lineWrapping){let l=e.lineBlockAt(i.head),s=e.coordsAtPos(i.head,i.assoc||1);s&&(a=l.bottom+e.documentTop-s.bottom+e.defaultLineHeight/2)}return e.moveVertically(i,!0,a)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function qG(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=Pn(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),a;return r&&i&&r.to<=t&&i.from>=t&&(a=r.type.prop(Le.closedBy))&&a.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const JP=PB(!1),WG=PB(!0);function PB(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(i=>{let{from:a,to:l}=i,s=t.doc.lineAt(a),c=!e&&a==l&&qG(t,a);e&&(a=l=(l<=s.to?s:t.doc.lineAt(l)).to);let f=new zv(t,{simulateBreak:a,simulateDoubleBreak:!!c}),d=$O(f,a);for(d==null&&(d=cc(/^\s*/.exec(t.doc.lineAt(a).text)[0],t.tabSize));l<s.to&&/\s/.test(s.text[l-s.from]);)l++;c?{from:a,to:l}=c:a>s.from&&a<s.from+100&&!/\S/.test(s.text.slice(0,a))&&(a=s.from);let p=["",Sh(t,d)];return c&&p.push(Sh(t,f.lineIndent(s.from,-1))),{changes:{from:a,to:l,insert:Je.of(p)},range:J.cursor(a+1+p[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function qO(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let l=r.from;l<=r.to;){let s=e.doc.lineAt(l);s.number>n&&(r.empty||r.to>s.from)&&(t(s,i,r),n=s.number),l=s.to+1}let a=e.changes(i);return{changes:i,range:J.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}const VG=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new zv(e,{overrideIndentation:a=>{let l=n[a];return l??-1}}),i=qO(e,(a,l,s)=>{let c=$O(r,a.from);if(c==null)return;/\S/.test(a.text)||(c=0);let f=/^\s*/.exec(a.text)[0],d=Sh(e,c);(f!=d||s.from<a.from+f.length)&&(n[a.from]=c,l.push({from:a.from,to:a.from+f.length,insert:d}))});return i.changes.empty||t(e.update(i,{userEvent:"indent"})),!0},DB=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(qO(e,(n,r)=>{r.push({from:n.from,insert:e.facet(Bv)})}),{userEvent:"input.indent"})),!0),RB=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(qO(e,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let a=cc(i,e.tabSize),l=0,s=Sh(e,Math.max(0,a-pg(e)));for(;l<i.length&&l<s.length&&i.charCodeAt(l)==s.charCodeAt(l);)l++;r.push({from:n.from+l,to:n.from+i.length,insert:s.slice(l)})}),{userEvent:"delete.dedent"})),!0),KG=e=>(e.setTabFocusMode(),!0),XG=[{key:"Ctrl-b",run:oB,shift:gB,preventDefault:!0},{key:"Ctrl-f",run:sB,shift:vB},{key:"Ctrl-p",run:fB,shift:xB},{key:"Ctrl-n",run:hB,shift:SB},{key:"Ctrl-a",run:dG,shift:kG},{key:"Ctrl-e",run:pG,shift:CG},{key:"Ctrl-d",run:kB},{key:"Ctrl-h",run:zS},{key:"Ctrl-k",run:NG},{key:"Ctrl-Alt-h",run:EB},{key:"Ctrl-o",run:jG},{key:"Ctrl-t",run:BG},{key:"Ctrl-v",run:BS}],QG=[{key:"ArrowLeft",run:oB,shift:gB,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:iG,shift:vG,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:fG,shift:OG,preventDefault:!0},{key:"ArrowRight",run:sB,shift:vB,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:aG,shift:yG,preventDefault:!0},{mac:"Cmd-ArrowRight",run:hG,shift:AG,preventDefault:!0},{key:"ArrowUp",run:fB,shift:xB,preventDefault:!0},{mac:"Cmd-ArrowUp",run:QP,shift:GP},{mac:"Ctrl-ArrowUp",run:VP,shift:KP},{key:"ArrowDown",run:hB,shift:SB,preventDefault:!0},{mac:"Cmd-ArrowDown",run:YP,shift:ZP},{mac:"Ctrl-ArrowDown",run:BS,shift:XP},{key:"PageUp",run:VP,shift:KP},{key:"PageDown",run:BS,shift:XP},{key:"Home",run:cG,shift:wG,preventDefault:!0},{key:"Mod-Home",run:QP,shift:GP},{key:"End",run:uG,shift:SG,preventDefault:!0},{key:"Mod-End",run:YP,shift:ZP},{key:"Enter",run:JP,shift:JP},{key:"Mod-a",run:EG},{key:"Backspace",run:zS,shift:zS,preventDefault:!0},{key:"Delete",run:kB,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:EB,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:_G,preventDefault:!0},{mac:"Mod-Backspace",run:IG,preventDefault:!0},{mac:"Mod-Delete",run:LG,preventDefault:!0}].concat(XG.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),YG=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:oG,shift:bG},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:sG,shift:xG},{key:"Alt-ArrowUp",run:zG},{key:"Shift-Alt-ArrowUp",run:HG},{key:"Alt-ArrowDown",run:$G},{key:"Shift-Alt-ArrowDown",run:UG},{key:"Mod-Alt-ArrowUp",run:PG},{key:"Mod-Alt-ArrowDown",run:DG},{key:"Escape",run:RG},{key:"Mod-Enter",run:WG},{key:"Alt-l",mac:"Ctrl-l",run:TG},{key:"Mod-i",run:MG,preventDefault:!0},{key:"Mod-[",run:RB},{key:"Mod-]",run:DB},{key:"Mod-Alt-\\",run:VG},{key:"Shift-Mod-k",run:FG},{key:"Shift-Mod-\\",run:gG},{key:"Mod-/",run:zY},{key:"Alt-A",run:HY},{key:"Ctrl-m",mac:"Shift-Alt-m",run:KG}].concat(QG),GG={key:"Tab",run:DB,shift:RB},eD=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class Qu{constructor(t,n,r=0,i=t.length,a,l){this.test=l,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(r,i),this.bufferStart=r,this.normalize=a?s=>a(eD(s)):eD,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return nr(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let n=vO(t),r=this.bufferStart+this.bufferPos;this.bufferPos+=$i(t);let i=this.normalize(n);if(i.length)for(let a=0,l=r,s=!0;;a++){let c=i.charCodeAt(a),f=this.match(c,l,s,this.bufferPos+this.bufferStart,a==i.length-1);if(f)return this.value=f,this;if(a==i.length-1)break;s&&a<n.length&&n.charCodeAt(a)==c?l++:s=!1}}}match(t,n,r,i,a){let l=null;for(let s=0;s<this.matches.length;){let c=this.matches[s],f=!1;this.query.charCodeAt(c.index)==t&&(c.index==this.query.length-1?l={from:c.from,to:i,precise:a&&c.precise}:(c.index++,f=!0)),f?s++:this.matches.splice(s,1)}return this.query.charCodeAt(0)==t&&(this.query.length==1?l={from:n,to:i,precise:r&&a}:this.matches.push({from:n,index:1,precise:r})),l&&this.test&&!this.test(l.from,l.to,this.buffer,this.bufferStart)&&(l=null),l}}typeof Symbol<"u"&&(Qu.prototype[Symbol.iterator]=function(){return this});const _B={from:-1,to:-1,match:/.*/.exec(""),precise:!0},WO="gm"+(/x/.unicode==null?"":"u");class NB{constructor(t,n,r,i=0,a=t.length){if(this.text=t,this.to=a,this.curLine="",this.done=!1,this.value=_B,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new IB(t,n,r,i,a);this.re=new RegExp(n,WO+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=t.iter();let l=t.lineAt(i);this.curLineStart=l.from,this.matchPos=yg(t,i),this.getLine(this.curLineStart)}getLine(t){this.iter.next(t),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,i=r+n[0].length;if(this.matchPos=yg(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<i||r>this.value.to)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,precise:!0,match:n},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),t=0;else return this.done=!0,this}}}const jx=new WeakMap;class Nu{constructor(t,n){this.from=t,this.text=n}get to(){return this.from+this.text.length}static get(t,n,r){let i=jx.get(t);if(!i||i.from>=r||i.to<=n){let s=new Nu(n,t.sliceString(n,r));return jx.set(t,s),s}if(i.from==n&&i.to==r)return i;let{text:a,from:l}=i;return l>n&&(a=t.sliceString(n,l)+a,l=n),i.to<r&&(a+=t.sliceString(i.to,r)),jx.set(t,new Nu(l,a)),new Nu(n,a.slice(n-l,r-l))}}class IB{constructor(t,n,r,i,a){this.text=t,this.to=a,this.done=!1,this.value=_B,this.matchPos=yg(t,i),this.re=new RegExp(n,WO+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=Nu.get(t,i,this.chunkEnd(i+5e3))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==t&&(this.re.lastIndex=t+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,i=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,precise:!0,match:n},this.matchPos=yg(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Nu.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(NB.prototype[Symbol.iterator]=IB.prototype[Symbol.iterator]=function(){return this});function ZG(e){try{return new RegExp(e,WO),!0}catch{return!1}}function yg(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}const JG=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:i}=yQ(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:n},focus:!0,submitLabel:t.phrase("go")});return i.then(a=>{let l=a&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(a.elements.line.value);if(!l){e.dispatch({effects:r});return}let s=t.doc.lineAt(t.selection.main.head),[,c,f,d,p]=l,g=d?+d.slice(1):0,v=f?+f:s.number;if(f&&p){let w=v/100;c&&(w=w*(c=="-"?-1:1)+s.number/t.doc.lines),v=Math.round(t.doc.lines*w)}else f&&c&&(v=v*(c=="-"?-1:1)+s.number);let y=t.doc.line(Math.max(1,Math.min(t.doc.lines,v))),x=J.cursor(y.from+Math.max(0,Math.min(g,y.length)));e.dispatch({effects:[r,de.scrollIntoView(x.from,{y:"center"})],selection:x})}),!0},eZ={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},tZ=me.define({combine(e){return ra(e,eZ,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function nZ(e){return[oZ,lZ]}const rZ=Ce.mark({class:"cm-selectionMatch"}),iZ=Ce.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function tD(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=Ot.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=Ot.Word)}function aZ(e,t,n,r){return e(t.sliceDoc(n,n+1))==Ot.Word&&e(t.sliceDoc(r-1,r))==Ot.Word}const lZ=Rt.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(tZ),{state:n}=e,r=n.selection;if(r.ranges.length>1)return Ce.none;let i=r.main,a,l=null;if(i.empty){if(!t.highlightWordAroundCursor)return Ce.none;let c=n.wordAt(i.head);if(!c)return Ce.none;l=n.charCategorizer(i.head),a=n.sliceDoc(c.from,c.to)}else{let c=i.to-i.from;if(c<t.minSelectionLength||c>200)return Ce.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),l=n.charCategorizer(i.head),!(tD(l,n,i.from,i.to)&&aZ(l,n,i.from,i.to)))return Ce.none}else if(a=n.sliceDoc(i.from,i.to),!a)return Ce.none}let s=[];for(let c of e.visibleRanges){let f=new Qu(n.doc,a,c.from,c.to);for(;!f.next().done;){let{from:d,to:p}=f.value;if((!l||tD(l,n,d,p))&&(i.empty&&d<=i.from&&p>=i.to?s.push(iZ.range(d,p)):(d>=i.to||p<=i.from)&&s.push(rZ.range(d,p)),s.length>t.maxMatches))return Ce.none}}return Ce.set(s)}},{decorations:e=>e.decorations}),oZ=de.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),sZ=({state:e,dispatch:t})=>{let{selection:n}=e,r=J.create(n.ranges.map(i=>e.wordAt(i.head)||J.cursor(i.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function uZ(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let l=!1,s=new Qu(e.doc,t,r[r.length-1].to);;)if(s.next(),s.done){if(l)return null;s=new Qu(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),l=!0}else{if(l&&r.some(c=>c.from==s.value.from))continue;if(a){let c=e.wordAt(s.value.from);if(!c||c.from!=s.value.from||c.to!=s.value.to)continue}return s.value}}const cZ=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(a=>a.from===a.to))return sZ({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(a=>e.sliceDoc(a.from,a.to)!=r))return!1;let i=uZ(e,r);return i?(t(e.update({selection:e.selection.addRange(J.range(i.from,i.to),!1),effects:de.scrollIntoView(i.to)})),!0):!1},hc=me.define({combine(e){return ra(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new AZ(t),scrollToMatch:t=>de.scrollIntoView(t)})}});class LB{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||ZG(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord,this.test=t.test}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?`
|
|
66
|
+
`:r=="r"?"\r":r=="t"?" ":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord&&this.test==t.test}create(){return this.regexp?new gZ(this):new dZ(this)}getCursor(t,n=0,r){let i=t.doc?t:qe.create({doc:t});return r==null&&(r=i.doc.length),this.regexp?yu(this,i,n,r):vu(this,i,n,r)}}class jB{constructor(t){this.spec=t}}function fZ(e,t,n){return(r,i,a,l)=>{if(n&&!n(r,i,a,l))return!1;let s=r>=l&&i<=l+a.length?a.slice(r-l,i-l):t.doc.sliceString(r,i);return e(s,t,r,i)}}function vu(e,t,n,r){let i;return e.wholeWord&&(i=hZ(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=fZ(e.test,t,i)),new Qu(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:a=>a.toLowerCase(),i)}function hZ(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(bg(i,n-a))!=Ot.Word||t(xg(i,n-a))!=Ot.Word)&&(t(xg(i,r-a))!=Ot.Word||t(bg(i,r-a))!=Ot.Word))}class dZ extends jB{constructor(t){super(t)}nextMatch(t,n,r){let i=vu(this.spec,t,r,t.doc.length).nextOverlapping();if(i.done){let a=Math.min(t.doc.length,n+this.spec.unquoted.length);i=vu(this.spec,t,0,a).nextOverlapping()}return i.done||i.value.from==n&&i.value.to==r?null:i.value}prevMatchInRange(t,n,r){for(let i=r;;){let a=Math.max(n,i-1e4-this.spec.unquoted.length),l=vu(this.spec,t,a,i),s=null;for(;!l.nextOverlapping().done;)s=l.value;if(s)return s;if(a==n)return null;i-=1e4}}prevMatch(t,n,r){let i=this.prevMatchInRange(t,0,n);return i||(i=this.prevMatchInRange(t,Math.max(0,r-this.spec.unquoted.length),t.doc.length)),i&&(i.from!=n||i.to!=r)?i:null}getReplacement(t){return this.spec.unquote(this.spec.replace)}matchAll(t,n){let r=vu(this.spec,t,0,t.doc.length),i=[];for(;!r.next().done;){if(i.length>=n)return null;i.push(r.value)}return i}highlight(t,n,r,i){let a=vu(this.spec,t,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,t.doc.length));for(;!a.next().done;)i(a.value.from,a.value.to)}}function pZ(e,t,n){return(r,i,a)=>(!n||n(r,i,a))&&e(a[0],t,r,i)}function yu(e,t,n,r){let i;return e.wholeWord&&(i=mZ(t.charCategorizer(t.selection.main.head))),e.test&&(i=pZ(e.test,t,i)),new NB(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function bg(e,t){return e.slice(on(e,t,!1),t)}function xg(e,t){return e.slice(t,on(e,t))}function mZ(e){return(t,n,r)=>!r[0].length||(e(bg(r.input,r.index))!=Ot.Word||e(xg(r.input,r.index))!=Ot.Word)&&(e(xg(r.input,r.index+r[0].length))!=Ot.Word||e(bg(r.input,r.index+r[0].length))!=Ot.Word)}class gZ extends jB{nextMatch(t,n,r){let i=yu(this.spec,t,r,t.doc.length).next();return i.done&&(i=yu(this.spec,t,0,n).next()),i.done?null:i.value}prevMatchInRange(t,n,r){for(let i=1;;i++){let a=Math.max(n,r-i*1e4),l=yu(this.spec,t,a,r),s=null;for(;!l.next().done;)s=l.value;if(s&&(a==n||s.from>a+10))return s;if(a==n)return null}}prevMatch(t,n,r){return this.prevMatchInRange(t,0,n)||this.prevMatchInRange(t,r,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,r)=>{if(r=="&")return t.match[0];if(r=="$")return"$";for(let i=r.length;i>0;i--){let a=+r.slice(0,i);if(a>0&&a<t.match.length)return t.match[a]+r.slice(i)}return n})}matchAll(t,n){let r=yu(this.spec,t,0,t.doc.length),i=[];for(;!r.next().done;){if(i.length>=n)return null;i.push(r.value)}return i}highlight(t,n,r,i){let a=yu(this.spec,t,Math.max(0,n-250),Math.min(r+250,t.doc.length));for(;!a.next().done;)i(a.value.from,a.value.to)}}const wh=Re.define(),VO=Re.define(),ql=_n.define({create(e){return new Bx($S(e).create(),null)},update(e,t){for(let n of t.effects)n.is(wh)?e=new Bx(n.value.create(),e.panel):n.is(VO)&&(e=new Bx(e.query,n.value?KO:null));return e},provide:e=>yh.from(e,t=>t.panel)});class Bx{constructor(t,n){this.query=t,this.panel=n}}const vZ=Ce.mark({class:"cm-searchMatch"}),yZ=Ce.mark({class:"cm-searchMatch cm-searchMatch-selected"}),bZ=Rt.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(ql))}update(e){let t=e.state.field(ql);(t!=e.startState.field(ql)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return Ce.none;let{view:n}=this,r=new $a;for(let i=0,a=n.visibleRanges,l=a.length;i<l;i++){let{from:s,to:c}=a[i];for(;i<l-1&&c>a[i+1].from-500;)c=a[++i].to;e.highlight(n.state,s,c,(f,d)=>{let p=n.state.selection.ranges.some(g=>g.from==f&&g.to==d);r.add(f,d,p?yZ:vZ)})}return r.finish()}},{decorations:e=>e.decorations});function Qh(e){return t=>{let n=t.state.field(ql,!1);return n&&n.query.spec.valid?e(t,n):$B(t)}}const Sg=Qh((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=J.single(r.from,r.to),a=e.state.facet(hc);return e.dispatch({selection:i,effects:[XO(e,r),a.scrollToMatch(i.main,e)],userEvent:"select.search"}),zB(e),!0}),wg=Qh((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=J.single(i.from,i.to),l=e.state.facet(hc);return e.dispatch({selection:a,effects:[XO(e,i),l.scrollToMatch(a.main,e)],userEvent:"select.search"}),zB(e),!0}),xZ=Qh((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:J.create(n.map(r=>J.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),SZ=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],l=0;for(let s=new Qu(e.doc,e.sliceDoc(r,i));!s.next().done;){if(a.length>1e3)return!1;s.value.from==r&&(l=a.length),a.push(J.range(s.value.from,s.value.to))}return t(e.update({selection:J.create(a,l),userEvent:"select.search.matches"})),!0},nD=Qh((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let l=a,s=[],c,f,d=[];l.precise?l.from==r&&l.to==i&&(f=n.toText(t.getReplacement(l)),s.push({from:l.from,to:l.to,insert:f}),l=t.nextMatch(n,l.from,l.to),d.push(de.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."))):l=t.nextMatch(n,l.from,l.to);let p=e.state.changes(s);return l&&(c=J.single(l.from,l.to).map(p),d.push(XO(e,l)),d.push(n.facet(hc).scrollToMatch(c.main,e))),e.dispatch({changes:p,selection:c,effects:d,userEvent:"input.replace"}),!0}),wZ=Qh((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let i of t.matchAll(e.state,1e9)){let{from:a,to:l,precise:s}=i;s&&n.push({from:a,to:l,insert:t.getReplacement(i)})}if(!n.length)return!1;let r=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:de.announce.of(r),userEvent:"input.replace.all"}),!0});function KO(e){return e.state.facet(hc).createPanel(e)}function $S(e,t){var n,r,i,a,l;let s=e.selection.main,c=s.empty||s.to>s.from+100?"":e.sliceDoc(s.from,s.to);if(t&&!c)return t;let f=e.facet(hc);return new LB({search:((n=t?.literal)!==null&&n!==void 0?n:f.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(r=t?.caseSensitive)!==null&&r!==void 0?r:f.caseSensitive,literal:(i=t?.literal)!==null&&i!==void 0?i:f.literal,regexp:(a=t?.regexp)!==null&&a!==void 0?a:f.regexp,wholeWord:(l=t?.wholeWord)!==null&&l!==void 0?l:f.wholeWord})}function BB(e){let t=IO(e,KO);return t&&t.dom.querySelector("[main-field]")}function zB(e){let t=BB(e);t&&t==e.root.activeElement&&t.select()}const $B=e=>{let t=e.state.field(ql,!1);if(t&&t.panel){let n=BB(e);if(n&&n!=e.root.activeElement){let r=$S(e.state,t.query.spec);r.valid&&e.dispatch({effects:wh.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[VO.of(!0),t?wh.of($S(e.state,t.query.spec)):Re.appendConfig.of(CZ)]});return!0},HB=e=>{let t=e.state.field(ql,!1);if(!t||!t.panel)return!1;let n=IO(e,KO);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:VO.of(!1)}),!0},OZ=[{key:"Mod-f",run:$B,scope:"editor search-panel"},{key:"F3",run:Sg,shift:wg,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Sg,shift:wg,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:HB,scope:"editor search-panel"},{key:"Mod-Shift-l",run:SZ},{key:"Mod-Alt-g",run:JG},{key:"Mod-d",run:cZ,preventDefault:!0}];class AZ{constructor(t){this.view=t;let n=this.query=t.state.field(ql).query.spec;this.commit=this.commit.bind(this),this.searchField=ot("input",{value:n.search,placeholder:Or(t,"Find"),"aria-label":Or(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=ot("input",{value:n.replace,placeholder:Or(t,"Replace"),"aria-label":Or(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=ot("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=ot("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=ot("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(i,a,l){return ot("button",{class:"cm-button",name:i,onclick:a,type:"button"},l)}this.dom=ot("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>Sg(t),[Or(t,"next")]),r("prev",()=>wg(t),[Or(t,"previous")]),r("select",()=>xZ(t),[Or(t,"all")]),ot("label",null,[this.caseField,Or(t,"match case")]),ot("label",null,[this.reField,Or(t,"regexp")]),ot("label",null,[this.wordField,Or(t,"by word")]),...t.state.readOnly?[]:[ot("br"),this.replaceField,r("replace",()=>nD(t),[Or(t,"replace")]),r("replaceAll",()=>wZ(t),[Or(t,"replace all")])],ot("button",{name:"close",onclick:()=>HB(t),"aria-label":Or(t,"close"),type:"button"},["×"])])}commit(){let t=new LB({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:wh.of(t)}))}keydown(t){EX(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?wg:Sg)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),nD(this.view))}update(t){for(let n of t.transactions)for(let r of n.effects)r.is(wh)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(hc).top}}function Or(e,t){return e.state.phrase(t)}const am=30,lm=/[\s\.,:;?!]/;function XO(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-am),l=Math.min(i,n+am),s=e.state.sliceDoc(a,l);if(a!=r.from){for(let c=0;c<am;c++)if(!lm.test(s[c+1])&&lm.test(s[c])){s=s.slice(c);break}}if(l!=i){for(let c=s.length-1;c>s.length-am;c--)if(!lm.test(s[c-1])&&lm.test(s[c])){s=s.slice(0,c);break}}return de.announce.of(`${e.state.phrase("current match")}. ${s} ${e.state.phrase("on line")} ${r.number}.`)}const kZ=de.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),CZ=[ql,gs.low(bZ),kZ];class UB{constructor(t,n,r,i){this.state=t,this.pos=n,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let n=Pn(this.state).resolveInner(this.pos,-1);for(;n&&t.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(t){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),i=n.text.slice(r-n.from,this.pos-n.from),a=i.search(FB(t,!1));return a<0?null:{from:r+a,to:this.pos,text:i.slice(a)}}get aborted(){return this.abortListeners==null}addEventListener(t,n,r){t=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function rD(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function EZ(e){let t=Object.create(null),n=Object.create(null);for(let{label:i}of e){t[i[0]]=!0;for(let a=1;a<i.length;a++)n[i[a]]=!0}let r=rD(t)+rD(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function TZ(e){let t=e.map(i=>typeof i=="string"?{label:i}:i),[n,r]=t.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:EZ(t);return i=>{let a=i.matchBefore(r);return a||i.explicit?{from:a?a.from:i.pos,options:t,validFor:n}:null}}class iD{constructor(t,n,r,i){this.completion=t,this.source=n,this.match=r,this.score=i}}function Go(e){return e.selection.main.from}function FB(e,t){var n;let{source:r}=e,i=t&&r[0]!="^",a=r[r.length-1]!="$";return!i&&!a?e:new RegExp(`${i?"^":""}(?:${r})${a?"$":""}`,(n=e.flags)!==null&&n!==void 0?n:e.ignoreCase?"i":"")}const qB=na.define();function MZ(e,t,n,r){let{main:i}=e.selection,a=n-i.from,l=r-i.from;return{...e.changeByRange(s=>{if(s!=i&&n!=r&&e.sliceDoc(s.from+a,s.from+l)!=e.sliceDoc(n,r))return{range:s};let c=e.toText(t);return{changes:{from:s.from+a,to:r==i.from?s.to:s.from+l,insert:c},range:J.cursor(s.from+a+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const aD=new WeakMap;function PZ(e){if(!Array.isArray(e))return e;let t=aD.get(e);return t||aD.set(e,t=TZ(e)),t}const Og=Re.define(),Oh=Re.define();class DZ{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n<t.length;){let r=nr(t,n),i=$i(r);this.chars.push(r);let a=t.slice(n,n+i),l=a.toUpperCase();this.folded.push(nr(l==a?a.toLowerCase():l,0)),n+=i}this.astral=t.length!=this.chars.length}ret(t,n){return this.score=t,this.matched=n,this}match(t){if(this.pattern.length==0)return this.ret(-100,[]);if(t.length<this.pattern.length)return null;let{chars:n,folded:r,any:i,precise:a,byWord:l}=this;if(n.length==1){let k=nr(t,0),E=$i(k),P=E==t.length?0:-100;if(k!=n[0])if(k==r[0])P+=-200;else return null;return this.ret(P,[0,E])}let s=t.indexOf(this.pattern);if(s==0)return this.ret(t.length==this.pattern.length?0:-100,[0,this.pattern.length]);let c=n.length,f=0;if(s<0){for(let k=0,E=Math.min(t.length,200);k<E&&f<c;){let P=nr(t,k);(P==n[f]||P==r[f])&&(i[f++]=k),k+=$i(P)}if(f<c)return null}let d=0,p=0,g=!1,v=0,y=-1,x=-1,w=/[a-z]/.test(t),A=!0;for(let k=0,E=Math.min(t.length,200),P=0;k<E&&p<c;){let T=nr(t,k);s<0&&(d<c&&T==n[d]&&(a[d++]=k),v<c&&(T==n[v]||T==r[v]?(v==0&&(y=k),x=k+1,v++):v=0));let M,R=T<255?T>=48&&T<=57||T>=97&&T<=122?2:T>=65&&T<=90?1:0:(M=vO(T))!=M.toLowerCase()?1:M!=M.toUpperCase()?2:0;(!k||R==1&&w||P==0&&R!=0)&&(n[p]==T||r[p]==T&&(g=!0)?l[p++]=k:l.length&&(A=!1)),P=R,k+=$i(T)}return p==c&&l[0]==0&&A?this.result(-100+(g?-200:0),l,t):v==c&&y==0?this.ret(-200-t.length+(x==t.length?0:-100),[0,x]):s>-1?this.ret(-700-t.length,[s,s+this.pattern.length]):v==c?this.ret(-900-t.length,[y,x]):p==c?this.result(-100+(g?-200:0)+-700+(A?0:-1100),l,t):n.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,t)}result(t,n,r){let i=[],a=0;for(let l of n){let s=l+(this.astral?$i(nr(r,l)):1);a&&i[a-1]==l?i[a-1]=s:(i[a++]=l,i[a++]=s)}return this.ret(t-r.length,i)}}class RZ{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.length<this.pattern.length)return null;let n=t.slice(0,this.pattern.length),r=n==this.pattern?0:n.toLowerCase()==this.folded?-200:null;return r==null?null:(this.matched=[0,n.length],this.score=r+(t.length==this.pattern.length?0:-100),this)}}const ln=me.define({combine(e){return ra(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:_Z,filterStrict:!1,compareCompletions:(t,n)=>(t.sortText||t.label).localeCompare(n.sortText||n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,n)=>t&&n,closeOnBlur:(t,n)=>t&&n,icons:(t,n)=>t&&n,tooltipClass:(t,n)=>r=>lD(t(r),n(r)),optionClass:(t,n)=>r=>lD(t(r),n(r)),addToOptions:(t,n)=>t.concat(n),filterStrict:(t,n)=>t||n})}});function lD(e,t){return e?t?e+" "+t:e:t}function _Z(e,t,n,r,i,a){let l=e.textDirection==ft.RTL,s=l,c=!1,f="top",d,p,g=t.left-i.left,v=i.right-t.right,y=r.right-r.left,x=r.bottom-r.top;if(s&&g<Math.min(y,v)?s=!1:!s&&v<Math.min(y,g)&&(s=!0),y<=(s?g:v))d=Math.max(i.top,Math.min(n.top,i.bottom-x))-t.top,p=Math.min(400,s?g:v);else{c=!0,p=Math.min(400,(l?t.right:i.right-t.left)-30);let k=i.bottom-t.bottom;k>=x||k>t.top?d=n.bottom-t.top:(f="bottom",d=t.bottom-n.top)}let w=(t.bottom-t.top)/a.offsetHeight,A=(t.right-t.left)/a.offsetWidth;return{style:`${f}: ${d/w}px; max-width: ${p/A}px`,class:"cm-completionInfo-"+(c?l?"left-narrow":"right-narrow":s?"left":"right")}}const QO=Re.define();function NZ(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),t.push({render(n,r,i,a){let l=document.createElement("span");l.className="cm-completionLabel";let s=n.displayLabel||n.label,c=0;for(let f=0;f<a.length;){let d=a[f++],p=a[f++];d>c&&l.appendChild(document.createTextNode(s.slice(c,d)));let g=l.appendChild(document.createElement("span"));g.appendChild(document.createTextNode(s.slice(d,p))),g.className="cm-completionMatchedText",c=p}return c<s.length&&l.appendChild(document.createTextNode(s.slice(c))),l},position:50},{render(n){if(!n.detail)return null;let r=document.createElement("span");return r.className="cm-completionDetail",r.textContent=n.detail,r},position:80}),t.sort((n,r)=>n.position-r.position).map(n=>n.render)}function zx(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let i=Math.floor(t/n);return{from:i*n,to:(i+1)*n}}let r=Math.ceil((e-t)/n);return{from:e-r*n,to:e-(r-1)*n}}class IZ{constructor(t,n,r){this.view=t,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:c=>this.placeInfo(c),key:this},this.space=null,this.currentClass="";let i=t.state.field(n),{options:a,selected:l}=i.open,s=t.state.facet(ln);this.optionContent=NZ(s),this.optionClass=s.optionClass,this.tooltipClass=s.tooltipClass,this.range=zx(a.length,l,s.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",c=>{let{options:f}=t.state.field(n).open;for(let d=c.target,p;d&&d!=this.dom;d=d.parentNode)if(d.nodeName=="LI"&&(p=/-(\d+)$/.exec(d.id))&&+p[1]<f.length){this.applyCompletion(t,f[+p[1]]),c.preventDefault();return}if(c.target==this.list){let d=this.list.classList.contains("cm-completionListIncompleteTop")&&c.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains("cm-completionListIncompleteBottom")&&c.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;d!=null&&(t.dispatch({effects:QO.of(d)}),c.preventDefault())}}),this.dom.addEventListener("focusout",c=>{let f=t.state.field(this.stateField,!1);f&&f.tooltip&&t.state.facet(ln).closeOnBlur&&c.relatedTarget!=t.contentDOM&&t.dispatch({effects:Oh.of(null)})}),this.showOptions(a,i.id)}mount(){this.updateSel()}showOptions(t,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(t){var n;let r=t.state.field(this.stateField),i=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),r!=i){let{options:a,selected:l,disabled:s}=r.open;(!i.open||i.open.options!=a)&&(this.range=zx(a.length,l,t.state.facet(ln).maxRenderedOptions),this.showOptions(a,r.id)),this.updateSel(),s!=((n=i.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!s)}}updateTooltipClass(t){let n=this.tooltipClass(t);if(n!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of n.split(" "))r&&this.dom.classList.add(r);this.currentClass=n}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),n=t.open;(n.selected>-1&&n.selected<this.range.from||n.selected>=this.range.to)&&(this.range=zx(n.options.length,n.selected,this.view.state.facet(ln).maxRenderedOptions),this.showOptions(n.options,t.id));let r=this.updateSelectedOption(n.selected);if(r){this.destroyInfo();let{completion:i}=n.options[n.selected],{info:a}=i;if(!a)return;let l=typeof a=="string"?document.createTextNode(a):a(i);if(!l)return;"then"in l?l.then(s=>{s&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(s,i)}).catch(s=>ar(this.view.state,s,"completion info")):(this.addInfoPane(l,i),r.setAttribute("aria-describedby",this.info.id))}}addInfoPane(t,n){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",r.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),t.nodeType!=null)r.appendChild(t),this.infoDestroy=null;else{let{dom:i,destroy:a}=t;r.appendChild(i),this.infoDestroy=a||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let n=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==t?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),n=r):r.hasAttribute("aria-selected")&&(r.removeAttribute("aria-selected"),r.removeAttribute("aria-describedby"));return n&&jZ(this.list,n),n}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=t.getBoundingClientRect(),a=this.space;if(!a){let l=this.dom.ownerDocument.documentElement;a={left:0,top:0,right:l.clientWidth,bottom:l.clientHeight}}return i.top>Math.min(a.bottom,n.bottom)-10||i.bottom<Math.max(a.top,n.top)+10?null:this.view.state.facet(ln).positionInfo(this.view,n,i,r,a,this.dom)}placeInfo(t){this.info&&(t?(t.style&&(this.info.style.cssText=t.style),this.info.className="cm-tooltip cm-completionInfo "+(t.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(t,n,r){const i=document.createElement("ul");i.id=n,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions")),i.addEventListener("mousedown",l=>{l.target==i&&l.preventDefault()});let a=null;for(let l=r.from;l<r.to;l++){let{completion:s,match:c}=t[l],{section:f}=s;if(f){let g=typeof f=="string"?f:f.name;if(g!=a&&(l>r.from||r.from==0))if(a=g,typeof f!="string"&&f.header)i.appendChild(f.header(f));else{let v=i.appendChild(document.createElement("completion-section"));v.textContent=g}}const d=i.appendChild(document.createElement("li"));d.id=n+"-"+l,d.setAttribute("role","option");let p=this.optionClass(s);p&&(d.className=p);for(let g of this.optionContent){let v=g(s,this.view.state,this.view,c);v&&d.appendChild(v)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.to<t.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function LZ(e,t){return n=>new IZ(n,e,t)}function jZ(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.height/e.offsetHeight;r.top<n.top?e.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(e.scrollTop+=(r.bottom-n.bottom)/i)}function oD(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}function BZ(e,t){let n=[],r=null,i=null,a=d=>{n.push(d);let{section:p}=d.completion;if(p){r||(r=[]);let g=typeof p=="string"?p:p.name;r.some(v=>v.name==g)||r.push(typeof p=="string"?{name:g}:p)}},l=t.facet(ln);for(let d of e)if(d.hasResult()){let p=d.result.getMatch;if(d.result.filter===!1)for(let g of d.result.options)a(new iD(g,d.source,p?p(g):[],1e9-n.length));else{let g=t.sliceDoc(d.from,d.to),v,y=l.filterStrict?new RZ(g):new DZ(g);for(let x of d.result.options)if(v=y.match(x.label)){let w=x.displayLabel?p?p(x,v.matched):[]:v.matched,A=v.score+(x.boost||0);if(a(new iD(x,d.source,w,A)),typeof x.section=="object"&&x.section.rank==="dynamic"){let{name:k}=x.section;i||(i=Object.create(null)),i[k]=Math.max(A,i[k]||-1e9)}}}}if(r){let d=Object.create(null),p=0,g=(v,y)=>(v.rank==="dynamic"&&y.rank==="dynamic"?i[y.name]-i[v.name]:0)||(typeof v.rank=="number"?v.rank:1e9)-(typeof y.rank=="number"?y.rank:1e9)||(v.name<y.name?-1:1);for(let v of r.sort(g))p-=1e5,d[v.name]=p;for(let v of n){let{section:y}=v.completion;y&&(v.score+=d[typeof y=="string"?y:y.name])}}let s=[],c=null,f=l.compareCompletions;for(let d of n.sort((p,g)=>g.score-p.score||f(p.completion,g.completion))){let p=d.completion;!c||c.label!=p.label||c.detail!=p.detail||c.type!=null&&p.type!=null&&c.type!=p.type||c.apply!=p.apply||c.boost!=p.boost?s.push(d):oD(d.completion)>oD(c)&&(s[s.length-1]=d),c=d.completion}return s}class Au{constructor(t,n,r,i,a,l){this.options=t,this.attrs=n,this.tooltip=r,this.timestamp=i,this.selected=a,this.disabled=l}setSelected(t,n){return t==this.selected||t>=this.options.length?this:new Au(this.options,sD(n,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,n,r,i,a,l){if(i&&!l&&t.some(f=>f.isPending))return i.setDisabled();let s=BZ(t,n);if(!s.length)return i&&t.some(f=>f.isPending)?i.setDisabled():null;let c=n.facet(ln).selectOnOpen?0:-1;if(i&&i.selected!=c&&i.selected!=-1){let f=i.options[i.selected].completion;for(let d=0;d<s.length;d++)if(s[d].completion==f){c=d;break}}return new Au(s,sD(r,c),{pos:t.reduce((f,d)=>d.hasResult()?Math.min(f,d.from):f,1e8),create:qZ,above:a.aboveCursor},i?i.timestamp:Date.now(),c,!1)}map(t){return new Au(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Au(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Ag{constructor(t,n,r){this.active=t,this.id=n,this.open=r}static start(){return new Ag(UZ,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:n}=t,r=n.facet(ln),a=(r.override||n.languageDataAt("autocomplete",Go(n)).map(PZ)).map(c=>(this.active.find(d=>d.source==c)||new Yr(c,this.active.some(d=>d.state!=0)?1:0)).update(t,r));a.length==this.active.length&&a.every((c,f)=>c==this.active[f])&&(a=this.active);let l=this.open,s=t.effects.some(c=>c.is(YO));l&&t.docChanged&&(l=l.map(t.changes)),t.selection||a.some(c=>c.hasResult()&&t.changes.touchesRange(c.from,c.to))||!zZ(a,this.active)||s?l=Au.build(a,n,this.id,l,r,s):l&&l.disabled&&!a.some(c=>c.isPending)&&(l=null),!l&&a.every(c=>!c.isPending)&&a.some(c=>c.hasResult())&&(a=a.map(c=>c.hasResult()?new Yr(c.source,0):c));for(let c of t.effects)c.is(QO)&&(l=l&&l.setSelected(c.value,this.id));return a==this.active&&l==this.open?this:new Ag(a,this.id,l)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?$Z:HZ}}function zZ(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult();)n++;for(;r<t.length&&!t[r].hasResult();)r++;let i=n==e.length,a=r==t.length;if(i||a)return i==a;if(e[n++].result!=t[r++].result)return!1}}const $Z={"aria-autocomplete":"list"},HZ={};function sD(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}const UZ=[];function WB(e,t){if(e.isUserEvent("input.complete")){let r=e.annotation(qB);if(r&&t.activateOnCompletion(r))return 12}let n=e.isUserEvent("input.type");return n&&t.activateOnTyping?5:n?1:e.isUserEvent("delete.backward")?2:e.selection?8:e.docChanged?16:0}class Yr{constructor(t,n,r=!1){this.source=t,this.state=n,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(t,n){let r=WB(t,n),i=this;(r&8||r&16&&this.touches(t))&&(i=new Yr(i.source,0)),r&4&&i.state==0&&(i=new Yr(this.source,1)),i=i.updateFor(t,r);for(let a of t.effects)if(a.is(Og))i=new Yr(i.source,1,a.value);else if(a.is(Oh))i=new Yr(i.source,0);else if(a.is(YO))for(let l of a.value)l.source==i.source&&(i=l);return i}updateFor(t,n){return this.map(t.changes)}map(t){return this}touches(t){return t.changes.touchesRange(Go(t.state))}}class Iu extends Yr{constructor(t,n,r,i,a,l){super(t,3,n),this.limit=r,this.result=i,this.from=a,this.to=l}hasResult(){return!0}updateFor(t,n){var r;if(!(n&3))return this.map(t.changes);let i=this.result;i.map&&!t.changes.empty&&(i=i.map(i,t.changes));let a=t.changes.mapPos(this.from),l=t.changes.mapPos(this.to,1),s=Go(t.state);if(s>l||!i||n&2&&(Go(t.startState)==this.from||s<this.limit))return new Yr(this.source,n&4?1:0);let c=t.changes.mapPos(this.limit);return FZ(i.validFor,t.state,a,l)?new Iu(this.source,this.explicit,c,i,a,l):i.update&&(i=i.update(i,a,l,new UB(t.state,s,!1)))?new Iu(this.source,this.explicit,c,i,i.from,(r=i.to)!==null&&r!==void 0?r:Go(t.state)):new Yr(this.source,1,this.explicit)}map(t){if(t.empty)return this;let n=this.result.map?this.result.map(this.result,t):this.result;return n?new Iu(this.source,this.explicit,t.mapPos(this.limit),n,t.mapPos(this.from),t.mapPos(this.to,1)):new Yr(this.source,0)}touches(t){return t.changes.touchesRange(this.from,this.to)}}function FZ(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e=="function"?e(i,n,r,t):FB(e,!0).test(i)}const YO=Re.define({map(e,t){return e.map(n=>n.map(t))}}),rr=_n.define({create(){return Ag.start()},update(e,t){return e.update(t)},provide:e=>[NO.from(e,t=>t.tooltip),de.contentAttributes.from(e,t=>t.attrs)]});function GO(e,t){const n=t.completion.apply||t.completion.label;let r=e.state.field(rr).active.find(i=>i.source==t.source);return r instanceof Iu?(typeof n=="string"?e.dispatch({...MZ(e.state,n,r.from,r.to),annotations:qB.of(t.completion)}):n(e,t.completion,r.from,r.to),!0):!1}const qZ=LZ(rr,GO);function om(e,t="option"){return n=>{let r=n.state.field(rr,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(ln).interactionDelay)return!1;let i=1,a;t=="page"&&(a=O3(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(a.dom.offsetHeight/a.dom.querySelector("li").offsetHeight)-1));let{length:l}=r.open.options,s=r.open.selected>-1?r.open.selected+i*(e?1:-1):e?0:l-1;return s<0?s=t=="page"?0:l-1:s>=l&&(s=t=="page"?l-1:0),n.dispatch({effects:QO.of(s)}),!0}}const WZ=e=>{let t=e.state.field(rr,!1);return e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(ln).interactionDelay?!1:GO(e,t.open.options[t.open.selected])},$x=e=>e.state.field(rr,!1)?(e.dispatch({effects:Og.of(!0)}),!0):!1,VZ=e=>{let t=e.state.field(rr,!1);return!t||!t.active.some(n=>n.state!=0)?!1:(e.dispatch({effects:Oh.of(null)}),!0)};class KZ{constructor(t,n){this.active=t,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const XZ=50,QZ=1e3,YZ=Rt.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of e.state.field(rr).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(rr),n=e.state.facet(ln);if(!e.selectionSet&&!e.docChanged&&e.startState.field(rr)==t)return;let r=e.transactions.some(a=>{let l=WB(a,n);return l&8||(a.selection||a.docChanged)&&!(l&3)});for(let a=0;a<this.running.length;a++){let l=this.running[a];if(r||l.context.abortOnDocChange&&e.docChanged||l.updates.length+e.transactions.length>XZ&&Date.now()-l.time>QZ){for(let s of l.context.abortListeners)try{s()}catch(c){ar(this.view.state,c)}l.context.abortListeners=null,this.running.splice(a--,1)}else l.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(a=>a.effects.some(l=>l.is(Og)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(a=>a.isPending&&!this.running.some(l=>l.active.source==a.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let a of e.transactions)a.isUserEvent("input.type")?this.composing=2:this.composing==2&&a.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view,t=e.field(rr);for(let n of t.active)n.isPending&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n);this.running.length&&t.open&&t.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(ln).updateSyncTime))}startQuery(e){let{state:t}=this.view,n=Go(t),r=new UB(t,n,e.explicit,this.view),i=new KZ(e,r);this.running.push(i),Promise.resolve(e.source(r)).then(a=>{i.context.aborted||(i.done=a||null,this.scheduleAccept())},a=>{this.view.dispatch({effects:Oh.of(null)}),ar(this.view.state,a)})}scheduleAccept(){this.running.every(e=>e.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(ln).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(ln),r=this.view.state.field(rr);for(let i=0;i<this.running.length;i++){let a=this.running[i];if(a.done===void 0)continue;if(this.running.splice(i--,1),a.done){let s=Go(a.updates.length?a.updates[0].startState:this.view.state),c=Math.min(s,a.done.from+(a.active.explicit?0:1)),f=new Iu(a.active.source,a.active.explicit,c,a.done,a.done.from,(e=a.done.to)!==null&&e!==void 0?e:s);for(let d of a.updates)f=f.update(d,n);if(f.hasResult()){t.push(f);continue}}let l=r.active.find(s=>s.source==a.active.source);if(l&&l.isPending)if(a.done==null){let s=new Yr(a.active.source,0);for(let c of a.updates)s=s.update(c,n);s.isPending||t.push(s)}else this.startQuery(l)}(t.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:YO.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(rr,!1);if(t&&t.tooltip&&this.view.state.facet(ln).closeOnBlur){let n=t.open&&O3(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Oh.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Og.of(!1)}),20),this.composing=0}}}),GZ=typeof navigator=="object"&&/Win/.test(navigator.platform),ZZ=gs.highest(de.domEventHandlers({keydown(e,t){let n=t.state.field(rr,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(GZ&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(l=>l.source==r.source),a=r.completion.commitCharacters||i.result.commitCharacters;return a&&a.indexOf(e.key)>-1&&GO(t,r),!1}})),JZ=de.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),Ah={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Uo=Re.define({map(e,t){let n=t.mapPos(e,-1,Fn.TrackAfter);return n??void 0}}),ZO=new class extends Kl{};ZO.startSide=1;ZO.endSide=-1;const VB=_n.define({create(){return ze.empty},update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of t.effects)n.is(Uo)&&(e=e.update({add:[ZO.range(n.value,n.value+1)]}));return e}});function eJ(){return[nJ,VB]}const Hx="()[]{}<>«»»«[]{}";function KB(e){for(let t=0;t<Hx.length;t+=2)if(Hx.charCodeAt(t)==e)return Hx.charAt(t+1);return vO(e<128?e:e+1)}function XB(e,t){return e.languageDataAt("closeBrackets",t)[0]||Ah}const tJ=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),nJ=de.inputHandler.of((e,t,n,r)=>{if((tJ?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let i=e.state.selection.main;if(r.length>2||r.length==2&&$i(nr(r,0))==1||t!=i.from||n!=i.to)return!1;let a=aJ(e.state,r);return a?(e.dispatch(a),!0):!1}),rJ=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=XB(e,e.selection.main.head).brackets||Ah.brackets,i=null,a=e.changeByRange(l=>{if(l.empty){let s=lJ(e.doc,l.head);for(let c of r)if(c==s&&Wv(e.doc,l.head)==KB(nr(c,0)))return{changes:{from:l.head-c.length,to:l.head+c.length},range:J.cursor(l.head-c.length)}}return{range:i=l}});return i||t(e.update(a,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},iJ=[{key:"Backspace",run:rJ}];function aJ(e,t){let n=XB(e,e.selection.main.head),r=n.brackets||Ah.brackets;for(let i of r){let a=KB(nr(i,0));if(t==i)return a==i?uJ(e,i,r.indexOf(i+i+i)>-1,n):oJ(e,i,a,n.before||Ah.before);if(t==a&&QB(e,e.selection.main.from))return sJ(e,i,a)}return null}function QB(e,t){let n=!1;return e.field(VB).between(0,e.doc.length,r=>{r==t&&(n=!0)}),n}function Wv(e,t){let n=e.sliceString(t,t+2);return n.slice(0,$i(nr(n,0)))}function lJ(e,t){let n=e.sliceString(t-2,t);return $i(nr(n,0))==n.length?n:n.slice(1)}function oJ(e,t,n,r){let i=null,a=e.changeByRange(l=>{if(!l.empty)return{changes:[{insert:t,from:l.from},{insert:n,from:l.to}],effects:Uo.of(l.to+t.length),range:J.range(l.anchor+t.length,l.head+t.length)};let s=Wv(e.doc,l.head);return!s||/\s/.test(s)||r.indexOf(s)>-1?{changes:{insert:t+n,from:l.head},effects:Uo.of(l.head+t.length),range:J.cursor(l.head+t.length)}:{range:i=l}});return i?null:e.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function sJ(e,t,n){let r=null,i=e.changeByRange(a=>a.empty&&Wv(e.doc,a.head)==n?{changes:{from:a.head,to:a.head+n.length,insert:n},range:J.cursor(a.head+n.length)}:r={range:a});return r?null:e.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function uJ(e,t,n,r){let i=r.stringPrefixes||Ah.stringPrefixes,a=null,l=e.changeByRange(s=>{if(!s.empty)return{changes:[{insert:t,from:s.from},{insert:t,from:s.to}],effects:Uo.of(s.to+t.length),range:J.range(s.anchor+t.length,s.head+t.length)};let c=s.head,f=Wv(e.doc,c),d;if(f==t){if(uD(e,c))return{changes:{insert:t+t,from:c},effects:Uo.of(c+t.length),range:J.cursor(c+t.length)};if(QB(e,c)){let g=n&&e.sliceDoc(c,c+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:c,to:c+g.length,insert:g},range:J.cursor(c+g.length)}}}else{if(n&&e.sliceDoc(c-2*t.length,c)==t+t&&(d=cD(e,c-2*t.length,i))>-1&&uD(e,d))return{changes:{insert:t+t+t+t,from:c},effects:Uo.of(c+t.length),range:J.cursor(c+t.length)};if(e.charCategorizer(c)(f)!=Ot.Word&&cD(e,c,i)>-1&&!cJ(e,c,t,i))return{changes:{insert:t+t,from:c},effects:Uo.of(c+t.length),range:J.cursor(c+t.length)}}return{range:a=s}});return a?null:e.update(l,{scrollIntoView:!0,userEvent:"input.type"})}function uD(e,t){let n=Pn(e).resolveInner(t+1);return n.parent&&n.from==t}function cJ(e,t,n,r){let i=Pn(e).resolveInner(t,-1),a=r.reduce((l,s)=>Math.max(l,s.length),0);for(let l=0;l<5;l++){let s=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+a)),c=s.indexOf(n);if(!c||c>-1&&r.indexOf(s.slice(0,c))>-1){let d=i.firstChild;for(;d&&d.from==i.from&&d.to-d.from>n.length+c;){if(e.sliceDoc(d.to-n.length,d.to)==n)return!1;d=d.firstChild}return!0}let f=i.to==t&&i.parent;if(!f)break;i=f}return!1}function cD(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=Ot.Word)return t;for(let i of n){let a=t-i.length;if(e.sliceDoc(a,t)==i&&r(e.sliceDoc(a-1,a))!=Ot.Word)return a}return-1}function fJ(e={}){return[ZZ,rr,ln.of(e),YZ,hJ,JZ]}const YB=[{key:"Ctrl-Space",run:$x},{mac:"Alt-`",run:$x},{mac:"Alt-i",run:$x},{key:"Escape",run:VZ},{key:"ArrowDown",run:om(!0)},{key:"ArrowUp",run:om(!1)},{key:"PageDown",run:om(!0,"page")},{key:"PageUp",run:om(!1,"page")},{key:"Enter",run:WZ}],hJ=gs.highest(Lv.computeN([ln],e=>e.facet(ln).defaultKeymap?[YB]:[]));class fD{constructor(t,n,r){this.from=t,this.to=n,this.diagnostic=r}}class jo{constructor(t,n,r){this.diagnostics=t,this.panel=n,this.selected=r}static init(t,n,r){let i=r.facet(kh).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((v,y)=>v.from-y.from||v.to-y.to),l=new $a,s=[],c=0,f=r.doc.iter(),d=0,p=r.doc.length;for(let v=0;;){let y=v==a.length?null:a[v];if(!y&&!s.length)break;let x,w;if(s.length)x=c,w=s.reduce((E,P)=>Math.min(E,P.to),y&&y.from>x?y.from:1e8);else{if(x=y.from,x>p)break;w=y.to,s.push(y),v++}for(;v<a.length;){let E=a[v];if(E.from==x&&(E.to>E.from||E.to==x))s.push(E),v++,w=Math.min(E.to,w);else{w=Math.min(E.from,w);break}}w=Math.min(w,p);let A=!1;if(s.some(E=>E.from==x&&(E.to==w||w==p))&&(A=x==w,!A&&w-x<10)){let E=x-(d+f.value.length);E>0&&(f.next(E),d=x);for(let P=x;;){if(P>=w){A=!0;break}if(!f.lineBreak&&d+f.value.length>P)break;P=d+f.value.length,d+=f.value.length,f.next()}}let k=kJ(s);if(A)l.add(x,x,Ce.widget({widget:new SJ(k),diagnostics:s.slice()}));else{let E=s.reduce((P,T)=>T.markClass?P+" "+T.markClass:P,"");l.add(x,w,Ce.mark({class:"cm-lintRange cm-lintRange-"+k+E,diagnostics:s.slice(),inclusiveEnd:s.some(P=>P.to>w)}))}if(c=w,c==p)break;for(let E=0;E<s.length;E++)s[E].to<=c&&s.splice(E--,1)}let g=l.finish();return new jo(g,n,Jl(g))}}function Jl(e,t=null,n=0){let r=null;return e.between(n,1e9,(i,a,{spec:l})=>{if(!(t&&l.diagnostics.indexOf(t)<0))if(!r)r=new fD(i,a,t||l.diagnostics[0]);else{if(l.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new fD(r.from,a,r.diagnostic)}}),r}function dJ(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(kh).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(l=>l.is(GB))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function pJ(e,t){return e.field(Tr,!1)?t:t.concat(Re.appendConfig.of(CJ))}const GB=Re.define(),JO=Re.define(),ZB=Re.define(),Tr=_n.define({create(){return new jo(Ce.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let a=t.changes.mapPos(e.selected.from,1);r=Jl(n,e.selected.diagnostic,a)||Jl(n,null,a)}!n.size&&i&&t.state.facet(kh).autoPanel&&(i=null),e=new jo(n,i,r)}for(let n of t.effects)if(n.is(GB)){let r=t.state.facet(kh).autoPanel?n.value.length?Ch.open:null:e.panel;e=jo.init(n.value,r,t.state)}else n.is(JO)?e=new jo(e.diagnostics,n.value?Ch.open:null,e.selected):n.is(ZB)&&(e=new jo(e.diagnostics,e.panel,n.value));return e},provide:e=>[yh.from(e,t=>t.panel),de.decorations.from(e,t=>t.diagnostics)]}),mJ=Ce.mark({class:"cm-lintRange cm-lintRange-active"});function gJ(e,t,n){let{diagnostics:r}=e.state.field(Tr),i,a=-1,l=-1;r.between(t-(n<0?1:0),t+(n>0?1:0),(c,f,{spec:d})=>{if(t>=c&&t<=f&&(c==f||(t>c||n>0)&&(t<f||n<0)))return i=d.diagnostics,a=c,l=f,!1});let s=e.state.facet(kh).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:l,above:!0,create(){return{dom:vJ(e,i)}}}:null}function vJ(e,t){return ot("ul",{class:"cm-tooltip-lint"},t.map(n=>ez(e,n,!1)))}const yJ=e=>{let t=e.state.field(Tr,!1);(!t||!t.panel)&&e.dispatch({effects:pJ(e.state,[JO.of(!0)])});let n=IO(e,Ch.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},hD=e=>{let t=e.state.field(Tr,!1);return!t||!t.panel?!1:(e.dispatch({effects:JO.of(!1)}),!0)},bJ=e=>{let t=e.state.field(Tr,!1);if(!t)return!1;let n=e.state.selection.main,r=Jl(t.diagnostics,null,n.to+1);return!r&&(r=Jl(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),gQ(e,r.from,1,{tooltip:tz,until:i=>i.docChanged||i.newSelection.main.head<r.from||i.newSelection.main.head>r.to}),!0)},xJ=[{key:"Mod-Shift-m",run:yJ,preventDefault:!0},{key:"F8",run:bJ}],kh=me.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...ra(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:dD,tooltipFilter:dD,needsRefresh:(t,n)=>t?n?r=>t(r)||n(r):t:n,hideOn:(t,n)=>t?n?(r,i,a)=>t(r,i,a)||n(r,i,a):t:n,autoPanel:(t,n)=>t||n})}}});function dD(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function JB(e){let t=[];if(e)e:for(let{name:n}of e){for(let r=0;r<n.length;r++){let i=n[r];if(/[a-zA-Z]/.test(i)&&!t.some(a=>a.toLowerCase()==i.toLowerCase())){t.push(i);continue e}}t.push("")}return t}function ez(e,t,n){var r;let i=n?JB(t.actions):[];return ot("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},ot("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),(r=t.actions)===null||r===void 0?void 0:r.map((a,l)=>{let s=!1,c=v=>{if(v.preventDefault(),s)return;s=!0;let y=Jl(e.state.field(Tr).diagnostics,t);y&&a.apply(e,y.from,y.to)},{name:f}=a,d=i[l]?f.indexOf(i[l]):-1,p=d<0?f:[f.slice(0,d),ot("u",f.slice(d,d+1)),f.slice(d+1)],g=a.markClass?" "+a.markClass:"";return ot("button",{type:"button",class:"cm-diagnosticAction"+g,onclick:c,onmousedown:c,"aria-label":` Action: ${f}${d<0?"":` (access key "${i[l]})"`}.`},p)}),t.source&&ot("div",{class:"cm-diagnosticSource"},t.source))}class SJ extends ia{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return ot("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class pD{constructor(t,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=ez(t,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Ch{constructor(t){this.view=t,this.items=[];let n=i=>{if(!(i.ctrlKey||i.altKey||i.metaKey)){if(i.keyCode==27)hD(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:a}=this.items[this.selectedIndex],l=JB(a.actions);for(let s=0;s<l.length;s++)if(l[s].toUpperCase().charCodeAt(0)==i.keyCode){let c=Jl(this.view.state.field(Tr).diagnostics,a);c&&a.actions[s].apply(t,c.from,c.to)}}else return;i.preventDefault()}},r=i=>{for(let a=0;a<this.items.length;a++)this.items[a].dom.contains(i.target)&&this.moveSelection(a)};this.list=ot("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:r}),this.dom=ot("div",{class:"cm-panel-lint"},this.list,ot("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>hD(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(Tr).selected;if(!t)return-1;for(let n=0;n<this.items.length;n++)if(this.items[n].diagnostic==t.diagnostic)return n;return-1}update(){let{diagnostics:t,selected:n}=this.view.state.field(Tr),r=0,i=!1,a=null,l=new Set;for(t.between(0,this.view.state.doc.length,(s,c,{spec:f})=>{for(let d of f.diagnostics){if(l.has(d))continue;l.add(d);let p=-1,g;for(let v=r;v<this.items.length;v++)if(this.items[v].diagnostic==d){p=v;break}p<0?(g=new pD(this.view,d),this.items.splice(r,0,g),i=!0):(g=this.items[p],p>r&&(this.items.splice(r,p-r),i=!0)),n&&g.diagnostic==n.diagnostic?g.dom.hasAttribute("aria-selected")||(g.dom.setAttribute("aria-selected","true"),a=g):g.dom.hasAttribute("aria-selected")&&g.dom.removeAttribute("aria-selected"),r++}});r<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();this.items.length==0&&(this.items.push(new pD(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),a?(this.list.setAttribute("aria-activedescendant",a.id),this.view.requestMeasure({key:this,read:()=>({sel:a.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:s,panel:c})=>{let f=c.height/this.list.offsetHeight;s.top<c.top?this.list.scrollTop-=(c.top-s.top)/f:s.bottom>c.bottom&&(this.list.scrollTop+=(s.bottom-c.bottom)/f)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let t=this.list.firstChild;function n(){let r=t;t=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;t!=r.dom;)n();t=r.dom.nextSibling}else this.list.insertBefore(r.dom,t);for(;t;)n()}moveSelection(t){if(this.selectedIndex<0)return;let n=this.view.state.field(Tr),r=Jl(n.diagnostics,this.items[t].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:ZB.of(r)})}static open(t){return new Ch(t)}}function wJ(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function sm(e){return wJ(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const OJ=de.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:sm("#f11")},".cm-lintRange-warning":{backgroundImage:sm("orange")},".cm-lintRange-info":{backgroundImage:sm("#999")},".cm-lintRange-hint":{backgroundImage:sm("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function AJ(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function kJ(e){let t="hint",n=1;for(let r of e){let i=AJ(r.severity);i>n&&(n=i,t=r.severity)}return t}const tz=mQ(gJ,{hideOn:dJ}),CJ=[Tr,de.decorations.compute([Tr],e=>{let{selected:t,panel:n}=e.field(Tr);return!t||!n||t.from==t.to?Ce.none:Ce.set([mJ.range(t.from,t.to)])}),tz,OJ];var mD=function(t){t===void 0&&(t={});var n=t,r=n.crosshairCursor,i=r===void 0?!1:r,a=[];t.closeBracketsKeymap!==!1&&(a=a.concat(iJ)),t.defaultKeymap!==!1&&(a=a.concat(YG)),t.searchKeymap!==!1&&(a=a.concat(OZ)),t.historyKeymap!==!1&&(a=a.concat(rG)),t.foldKeymap!==!1&&(a=a.concat(vY)),t.completionKeymap!==!1&&(a=a.concat(YB)),t.lintKeymap!==!1&&(a=a.concat(xJ));var l=[];return t.lineNumbers!==!1&&l.push(MQ()),t.highlightActiveLineGutter!==!1&&l.push(RQ()),t.highlightSpecialChars!==!1&&l.push(qX()),t.history!==!1&&l.push(XY()),t.foldGutter!==!1&&l.push(SY()),t.drawSelection!==!1&&l.push(_X()),t.dropCursor!==!1&&l.push(BX()),t.allowMultipleSelections!==!1&&l.push(qe.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&l.push(oY()),t.syntaxHighlighting!==!1&&l.push(Y3(kY,{fallback:!0})),t.bracketMatching!==!1&&l.push(RY()),t.closeBrackets!==!1&&l.push(eJ()),t.autocompletion!==!1&&l.push(fJ()),t.rectangularSelection!==!1&&l.push(iQ()),i!==!1&&l.push(oQ()),t.highlightActiveLine!==!1&&l.push(YX()),t.highlightSelectionMatches!==!1&&l.push(nZ()),t.tabSize&&typeof t.tabSize=="number"&&l.push(Bv.of(" ".repeat(t.tabSize))),l.concat([Lv.of(a.flat())]).filter(Boolean)};const EJ="#e5c07b",gD="#e06c75",TJ="#56b6c2",MJ="#ffffff",zm="#abb2bf",HS="#7d8799",PJ="#61afef",DJ="#98c379",vD="#d19a66",RJ="#c678dd",_J="#21252b",yD="#2c313a",bD="#282c34",Ux="#353a42",NJ="#3E4451",xD="#528bff",IJ=de.theme({"&":{color:zm,backgroundColor:bD},".cm-content":{caretColor:xD},".cm-cursor, .cm-dropCursor":{borderLeftColor:xD},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:NJ},".cm-panels":{backgroundColor:_J,color:zm},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:bD,color:HS,border:"none"},".cm-activeLineGutter":{backgroundColor:yD},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Ux},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Ux,borderBottomColor:Ux},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:yD,color:zm}}},{dark:!0}),LJ=Kh.define([{tag:Y.keyword,color:RJ},{tag:[Y.name,Y.deleted,Y.character,Y.propertyName,Y.macroName],color:gD},{tag:[Y.function(Y.variableName),Y.labelName],color:PJ},{tag:[Y.color,Y.constant(Y.name),Y.standard(Y.name)],color:vD},{tag:[Y.definition(Y.name),Y.separator],color:zm},{tag:[Y.typeName,Y.className,Y.number,Y.changed,Y.annotation,Y.modifier,Y.self,Y.namespace],color:EJ},{tag:[Y.operator,Y.operatorKeyword,Y.url,Y.escape,Y.regexp,Y.link,Y.special(Y.string)],color:TJ},{tag:[Y.meta,Y.comment],color:HS},{tag:Y.strong,fontWeight:"bold"},{tag:Y.emphasis,fontStyle:"italic"},{tag:Y.strikethrough,textDecoration:"line-through"},{tag:Y.link,color:HS,textDecoration:"underline"},{tag:Y.heading,fontWeight:"bold",color:gD},{tag:[Y.atom,Y.bool,Y.special(Y.variableName)],color:vD},{tag:[Y.processingInstruction,Y.string,Y.inserted],color:DJ},{tag:Y.invalid,color:MJ}]),jJ=[IJ,Y3(LJ)];var BJ=de.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),zJ=function(t){t===void 0&&(t={});var n=t,r=n.indentWithTab,i=r===void 0?!0:r,a=n.editable,l=a===void 0?!0:a,s=n.readOnly,c=s===void 0?!1:s,f=n.theme,d=f===void 0?"light":f,p=n.placeholder,g=p===void 0?"":p,v=n.basicSetup,y=v===void 0?!0:v,x=[];switch(i&&x.unshift(Lv.of([GG])),y&&(typeof y=="boolean"?x.unshift(mD()):x.unshift(mD(y))),g&&x.unshift(eQ(g)),d){case"light":x.push(BJ);break;case"dark":x.push(jJ);break;case"none":break;default:x.push(d);break}return l===!1&&x.push(de.editable.of(!1)),c&&x.push(qe.readOnly.of(!0)),[...x]},$J=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(t=>!t.empty)});class HJ{constructor(t,n){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=n,this.timeoutMS=n,this.callbacks.push(t)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var t=this.callbacks.slice();this.callbacks.length=0,t.forEach(n=>{try{n()}catch(r){console.error("TimeoutLatch callback error:",r)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class SD{constructor(){this.interval=null,this.latches=new Set}add(t){this.latches.add(t),this.start()}remove(t){this.latches.delete(t),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(t=>{t.tick(),t.isDone&&this.remove(t)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var Fx=null,UJ=()=>typeof window>"u"?new SD:(Fx||(Fx=new SD),Fx),wD=na.define(),FJ=200,qJ=[];function WJ(e){var t=e.value,n=e.selection,r=e.onChange,i=e.onStatistics,a=e.onCreateEditor,l=e.onUpdate,s=e.extensions,c=s===void 0?qJ:s,f=e.autoFocus,d=e.theme,p=d===void 0?"light":d,g=e.height,v=g===void 0?null:g,y=e.minHeight,x=y===void 0?null:y,w=e.maxHeight,A=w===void 0?null:w,k=e.width,E=k===void 0?null:k,P=e.minWidth,T=P===void 0?null:P,M=e.maxWidth,R=M===void 0?null:M,L=e.placeholder,H=L===void 0?"":L,K=e.editable,V=K===void 0?!0:K,B=e.readOnly,ae=B===void 0?!1:B,ie=e.indentWithTab,oe=ie===void 0?!0:ie,z=e.basicSetup,G=z===void 0?!0:z,ne=e.root,ce=e.initialState,fe=O.useState(),N=fe[0],X=fe[1],re=O.useState(),le=re[0],ge=re[1],Oe=O.useState(),Pe=Oe[0],mt=Oe[1],se=O.useState(()=>({current:null}))[0],Te=O.useState(()=>({current:null}))[0],Ee=de.theme({"&":{height:v,minHeight:x,maxHeight:A,width:E,minWidth:T,maxWidth:R},"& .cm-scroller":{height:"100% !important"}}),ue=de.updateListener.of(xe=>{if(xe.docChanged&&typeof r=="function"&&!xe.transactions.some(la=>la.annotation(wD))){se.current?se.current.reset():(se.current=new HJ(()=>{if(Te.current){var la=Te.current;Te.current=null,la()}se.current=null},FJ),UJ().add(se.current));var gt=xe.state.doc,dn=gt.toString();r(dn,xe)}i&&i($J(xe))}),_t=zJ({theme:p,editable:V,readOnly:ae,placeholder:H,indentWithTab:oe,basicSetup:G}),_e=[ue,Ee,..._t];return l&&typeof l=="function"&&_e.push(de.updateListener.of(l)),_e=_e.concat(c),O.useLayoutEffect(()=>{if(N&&!Pe){var xe={doc:t,selection:n,extensions:_e},gt=ce?qe.fromJSON(ce.json,xe,ce.fields):qe.create(xe);if(mt(gt),!le){var dn=new de({state:gt,parent:N,root:ne});ge(dn),a&&a(dn,gt)}}return()=>{le&&(mt(void 0),ge(void 0))}},[N,Pe]),O.useEffect(()=>{e.container&&X(e.container)},[e.container]),O.useEffect(()=>()=>{le&&(le.destroy(),ge(void 0)),se.current&&(se.current.cancel(),se.current=null)},[le]),O.useEffect(()=>{f&&le&&le.focus()},[f,le]),O.useEffect(()=>{le&&le.dispatch({effects:Re.reconfigure.of(_e)})},[p,c,v,x,A,E,T,R,H,V,ae,oe,G,r,l]),O.useEffect(()=>{if(t!==void 0){var xe=le?le.state.doc.toString():"";if(le&&t!==xe){var gt=se.current&&!se.current.isDone,dn=()=>{le&&t!==le.state.doc.toString()&&le.dispatch({changes:{from:0,to:le.state.doc.toString().length,insert:t||""},annotations:[wD.of(!0)]})};gt?Te.current=dn:dn()}}},[t,le]),{state:Pe,setState:mt,view:le,setView:ge,container:N,setContainer:X}}var VJ=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],nz=O.forwardRef((e,t)=>{var n=e.className,r=e.value,i=r===void 0?"":r,a=e.selection,l=e.extensions,s=l===void 0?[]:l,c=e.onChange,f=e.onStatistics,d=e.onCreateEditor,p=e.onUpdate,g=e.autoFocus,v=e.theme,y=v===void 0?"light":v,x=e.height,w=e.minHeight,A=e.maxHeight,k=e.width,E=e.minWidth,P=e.maxWidth,T=e.basicSetup,M=e.placeholder,R=e.indentWithTab,L=e.editable,H=e.readOnly,K=e.root,V=e.initialState,B=x7(e,VJ),ae=O.useRef(null),ie=WJ({root:K,value:i,autoFocus:g,theme:y,height:x,minHeight:w,maxHeight:A,width:k,minWidth:E,maxWidth:P,basicSetup:T,placeholder:M,indentWithTab:R,editable:L,readOnly:H,selection:a,onChange:c,onStatistics:f,onCreateEditor:d,onUpdate:p,extensions:s,initialState:V}),oe=ie.state,z=ie.view,G=ie.container,ne=ie.setContainer;O.useImperativeHandle(t,()=>({editor:ae.current,state:oe,view:z}),[ae,G,oe,z]);var ce=O.useCallback(N=>{ae.current=N,ne(N)},[ne]);if(typeof i!="string")throw new Error("value must be typeof string but got "+typeof i);var fe=typeof y=="string"?"cm-theme-"+y:"cm-theme";return _.jsx("div",K1({ref:ce,className:""+fe+(n?" "+n:"")},B))});nz.displayName="CodeMirror";var OD={};class kg{constructor(t,n,r,i,a,l,s,c,f,d=0,p){this.p=t,this.stack=n,this.state=r,this.reducePos=i,this.pos=a,this.score=l,this.buffer=s,this.bufferBase=c,this.curContext=f,this.lookAhead=d,this.parent=p}toString(){return`[${this.stack.filter((t,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,n,r=0){let i=t.parser.context;return new kg(t,[],n,r,r,0,[],0,i?new AD(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var n;let r=t>>19,i=t&65535,{parser:a}=this.p,l=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),s=a.dynamicPrecedence(i);if(s&&(this.score+=s),r==0){i<a.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(a.getGoto(this.state,i,!0),this.reducePos),i<a.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,l?8:4,!0),this.reduceContext(i,this.reducePos);return}let c=this.stack.length-(r-1)*3-(t&262144?6:0),f=c?this.stack[c-2]:this.p.ranges[0].from;i<a.minRepeatTerm&&f==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let d=this.reducePos-f;d>=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(f==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=d):this.p.lastBigReductionSize<d&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=f,this.p.lastBigReductionSize=d));let p=c?this.stack[c-1]:0,g=this.bufferBase+this.buffer.length-p;if(i<a.minRepeatTerm||t&131072){let v=a.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,f,v,g+4,!0)}if(t&262144)this.state=this.stack[c];else{let v=this.stack[c-3];this.state=a.getGoto(v,i,!0)}for(;this.stack.length>c;)this.stack.pop();this.reduceContext(i,f)}storeNode(t,n,r,i=4,a=!1){if(t==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let l=this.buffer.length;if(l>0&&this.buffer[l-4]==0&&this.buffer[l-1]>-1){if(n==r)return;if(this.buffer[l-2]>=n){this.buffer[l-2]=r;return}}}if(!a||this.pos==r)this.buffer.push(t,n,r,i);else{let l=this.buffer.length;if(l>0&&(this.buffer[l-4]!=0||this.buffer[l-1]<0)){let s=!1;for(let c=l;c>0&&this.buffer[c-2]>r;c-=4)if(this.buffer[c-1]>=0){s=!0;break}if(s)for(;l>0&&this.buffer[l-2]>r;)this.buffer[l]=this.buffer[l-4],this.buffer[l+1]=this.buffer[l-3],this.buffer[l+2]=this.buffer[l-2],this.buffer[l+3]=this.buffer[l-1],l-=4,i>4&&(i-=4)}this.buffer[l]=t,this.buffer[l+1]=n,this.buffer[l+2]=r,this.buffer[l+3]=i}}shift(t,n,r,i){if(t&131072)this.pushState(t&65535,this.pos);else if((t&262144)==0){let a=t,{parser:l}=this.p;this.pos=i;let s=l.stateFlag(a,1);!s&&(i>r||n<=l.maxNode)&&(this.reducePos=i),this.pushState(a,s?r:Math.min(r,this.reducePos)),this.shiftContext(n,r),n<=l.maxNode&&this.buffer.push(n,r,i,4)}else this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4)}apply(t,n,r,i){t&65536?this.reduce(t):this.shift(t,n,r,i)}useNode(t,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=t)&&(this.p.reused.push(t),r++);let i=this.pos;this.reducePos=this.pos=i+t.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new kg(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(t,n){let r=t<=this.p.parser.maxNode;r&&this.storeNode(t,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(t){for(let n=new KJ(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,t);if(r==0)return!1;if((r&65536)==0)return!0;n.reduce(r)}}recoverByInsert(t){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let a=0,l;a<n.length;a+=2)(l=n[a+1])!=this.state&&this.p.parser.hasAction(l,t)&&i.push(n[a],l);if(this.stack.length<120)for(let a=0;i.length<8&&a<n.length;a+=2){let l=n[a+1];i.some((s,c)=>c&1&&s==l)||i.push(n[a],l)}n=i}let r=[];for(let i=0;i<n.length&&r.length<4;i+=2){let a=n[i+1];if(a==this.state)continue;let l=this.split();l.pushState(a,this.pos),l.storeNode(0,l.pos,l.pos,4,!0),l.shiftContext(n[i],this.pos),l.reducePos=this.pos,l.score-=200,r.push(l)}return r}forceReduce(){let{parser:t}=this.p,n=t.stateSlot(this.state,5);if((n&65536)==0)return!1;if(!t.validAction(this.state,n)){let r=n>>19,i=n&65535,a=this.stack.length-r*3;if(a<0||t.getGoto(this.stack[a],i,!1)<0){let l=this.findForcedReduction();if(l==null)return!1;n=l}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:t}=this.p,n=[],r=(i,a)=>{if(!n.includes(i))return n.push(i),t.allActions(i,l=>{if(!(l&393216))if(l&65536){let s=(l>>19)-a;if(s>1){let c=l&65535,f=this.stack.length-s*3;if(f>=0&&t.getGoto(this.stack[f],c,!1)>=0)return s<<19|65536|c}}else{let s=r(l,a+1);if(s!=null)return s}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:t}=this.p;return t.data[t.stateSlot(this.state,1)]==65535&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let n=0;n<this.stack.length;n+=3)if(this.stack[n]!=t.stack[n])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(t){return this.p.parser.dialect.flags[t]}shiftContext(t,n){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,t,this,this.p.stream.reset(n)))}reduceContext(t,n){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,t,this,this.p.stream.reset(n)))}emitContext(){let t=this.buffer.length-1;(t<0||this.buffer[t]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let t=this.buffer.length-1;(t<0||this.buffer[t]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(t){if(t!=this.curContext.context){let n=new AD(this.curContext.tracker,t);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}setLookAhead(t){return t<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=t,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class AD{constructor(t,n){this.tracker=t,this.context=n,this.hash=t.strict?t.hash(n):0}}class KJ{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let n=t&65535,r=t>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}}class Cg{constructor(t,n,r){this.stack=t,this.pos=n,this.index=r,this.buffer=t.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new Cg(t,n,n-t.bufferBase)}maybeNext(){let t=this.stack.parent;t!=null&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Cg(this.stack,this.pos,this.index)}}function um(e,t=Uint16Array){if(typeof e!="string")return e;let n=null;for(let r=0,i=0;r<e.length;){let a=0;for(;;){let l=e.charCodeAt(r++),s=!1;if(l==126){a=65535;break}l>=92&&l--,l>=34&&l--;let c=l-32;if(c>=46&&(c-=46,s=!0),a+=c,s)break;a*=46}n?n[i++]=a:n=new t(a)}return n}class $m{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const kD=new $m;class XJ{constructor(t,n){this.input=t,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=kD,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(t,n){let r=this.range,i=this.rangeIndex,a=this.pos+t;for(;a<r.from;){if(!i)return null;let l=this.ranges[--i];a-=r.from-l.to,r=l}for(;n<0?a>r.to:a>=r.to;){if(i==this.ranges.length-1)return null;let l=this.ranges[++i];a+=l.from-r.to,r=l}return a}clipPos(t){if(t>=this.range.from&&t<this.range.to)return t;for(let n of this.ranges)if(n.to>t)return Math.max(t,n.from);return this.end}peek(t){let n=this.chunkOff+t,r,i;if(n>=0&&n<this.chunk.length)r=this.pos+t,i=this.chunk.charCodeAt(n);else{let a=this.resolveOffset(t,1);if(a==null)return-1;if(r=a,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let l=this.rangeIndex,s=this.range;for(;s.to<=r;)s=this.ranges[++l];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>s.to&&(this.chunk2=this.chunk2.slice(0,s.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(t,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=t,this.token.end=r}acceptTokenTo(t,n){this.token.value=t,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:t,chunkPos:n}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=t,this.chunk2Pos=n,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let t=this.input.chunk(this.pos),n=this.pos+t.length;this.chunk=n>this.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,n){if(n?(this.token=n,n.start=t,n.lookAhead=t+1,n.value=n.extended=-1):this.token=kD,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;t>=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t<this.chunkPos+this.chunk.length?this.chunkOff=t-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(t,n){if(t>=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,n-this.chunkPos);if(t>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,n-this.chunk2Pos);if(t>=this.range.from&&n<=this.range.to)return this.input.read(t,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>t&&(r+=this.input.read(Math.max(i.from,t),Math.min(i.to,n)))}return r}}class Lu{constructor(t,n){this.data=t,this.id=n}token(t,n){let{parser:r}=n.p;QJ(this.data,t,n,this.id,r.data,r.tokenPrecTable)}}Lu.prototype.contextual=Lu.prototype.fallback=Lu.prototype.extend=!1;Lu.prototype.fallback=Lu.prototype.extend=!1;class Vv{constructor(t,n={}){this.token=t,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function QJ(e,t,n,r,i,a){let l=0,s=1<<r,{dialect:c}=n.p.parser;e:for(;(s&e[l])!=0;){let f=e[l+1];for(let v=l+3;v<f;v+=2)if((e[v+1]&s)>0){let y=e[v];if(c.allows(y)&&(t.token.value==-1||t.token.value==y||YJ(y,t.token.value,i,a))){t.acceptToken(y);break}}let d=t.next,p=0,g=e[l+2];if(t.next<0&&g>p&&e[f+g*3-3]==65535){l=e[f+g*3-1];continue e}for(;p<g;){let v=p+g>>1,y=f+v+(v<<1),x=e[y],w=e[y+1]||65536;if(d<x)g=v;else if(d>=w)p=v+1;else{l=e[y+2],t.advance();continue e}}break}}function CD(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function YJ(e,t,n,r){let i=CD(n,r,t);return i<0||CD(n,r,e)<i}const Ar=typeof process<"u"&&OD&&/\bparse\b/.test(OD.LOG);let qx=null;function ED(e,t,n){let r=e.cursor(Pt.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}class GJ{constructor(t,n){this.fragments=t,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?ED(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?ED(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(t<this.nextStart)return null;for(;this.fragment&&this.safeTo<=t;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let r=this.trees[n],i=this.index[n];if(i==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let a=r.children[i],l=this.start[n]+r.positions[i];if(l>t)return this.nextStart=l,null;if(a instanceof jt){if(l==t){if(l<this.safeFrom)return null;let s=l+a.length;if(s<=this.safeTo){let c=a.prop(Le.lookAhead);if(!c||s+c<this.fragment.to)return a}}this.index[n]++,l+a.length>=Math.max(this.safeFrom,t)&&(this.trees.push(a),this.start.push(l),this.index.push(0))}else this.index[n]++,this.nextStart=l+a.length}}}class ZJ{constructor(t,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(r=>new $m)}getActions(t){let n=0,r=null,{parser:i}=t.p,{tokenizers:a}=i,l=i.stateSlot(t.state,3),s=t.curContext?t.curContext.hash:0,c=0;for(let f=0;f<a.length;f++){if((1<<f&l)==0)continue;let d=a[f],p=this.tokens[f];if(!(r&&!d.fallback)&&((d.contextual||p.start!=t.pos||p.mask!=l||p.context!=s)&&(this.updateCachedToken(p,d,t),p.mask=l,p.context=s),p.lookAhead>p.end+25&&(c=Math.max(p.lookAhead,c)),p.value!=0)){let g=n;if(p.extended>-1&&(n=this.addActions(t,p.extended,p.end,n)),n=this.addActions(t,p.value,p.end,n),!d.extend&&(r=p,n>g))break}}for(;this.actions.length>n;)this.actions.pop();return c&&t.setLookAhead(c),!r&&t.pos==this.stream.end&&(r=new $m,r.value=t.p.parser.eofTerm,r.start=r.end=t.pos,n=this.addActions(t,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let n=new $m,{pos:r,p:i}=t;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(t,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,t),r),t.value>-1){let{parser:a}=r.p;for(let l=0;l<a.specialized.length;l++)if(a.specialized[l]==t.value){let s=a.specializers[l](this.stream.read(t.start,t.end),r);if(s>=0&&r.p.parser.dialect.allows(s>>1)){(s&1)==0?t.value=s>>1:t.extended=s>>1;break}}}else t.value=0,t.end=this.stream.clipPos(i+1)}putAction(t,n,r,i){for(let a=0;a<i;a+=3)if(this.actions[a]==t)return i;return this.actions[i++]=t,this.actions[i++]=n,this.actions[i++]=r,i}addActions(t,n,r,i){let{state:a}=t,{parser:l}=t.p,{data:s}=l;for(let c=0;c<2;c++)for(let f=l.stateSlot(a,c?2:1);;f+=3){if(s[f]==65535)if(s[f+1]==1)f=Ca(s,f+2);else{i==0&&s[f+1]==2&&(i=this.putAction(Ca(s,f+2),n,r,i));break}s[f]==n&&(i=this.putAction(Ca(s,f+1),n,r,i))}return i}}class JJ{constructor(t,n,r,i){this.parser=t,this.input=n,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new XJ(n,i),this.tokens=new ZJ(t,this.stream),this.topTerm=t.top[1];let{from:a}=i[0];this.stacks=[kg.start(this,t.top[0],a)],this.fragments=r.length&&this.stream.end-a>t.bufferLength*4?new GJ(r,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t=this.stacks,n=this.minStackPos,r=this.stacks=[],i,a;if(this.bigReductionCount>300&&t.length==1){let[l]=t;for(;l.forceReduce()&&l.stack.length&&l.stack[l.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let l=0;l<t.length;l++){let s=t[l];for(;;){if(this.tokens.mainToken=null,s.pos>n)r.push(s);else{if(this.advanceStack(s,r,t))continue;{i||(i=[],a=[]),i.push(s);let c=this.tokens.getMainToken(s);a.push(c.value,c.end)}}break}}if(!r.length){let l=i&&nee(i);if(l)return Ar&&console.log("Finish with "+this.stackID(l)),this.stackToTree(l);if(this.parser.strict)throw Ar&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let l=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,a,r);if(l)return Ar&&console.log("Force-finish "+this.stackID(l)),this.stackToTree(l.forceAll())}if(this.recovering){let l=this.recovering==1?1:this.recovering*3;if(r.length>l)for(r.sort((s,c)=>c.score-s.score);r.length>l;)r.pop();r.some(s=>s.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let l=0;l<r.length-1;l++){let s=r[l];for(let c=l+1;c<r.length;c++){let f=r[c];if(s.sameState(f)||s.buffer.length>500&&f.buffer.length>500)if((s.score-f.score||s.buffer.length-f.buffer.length)>0)r.splice(c--,1);else{r.splice(l--,1);continue e}}}r.length>12&&(r.sort((l,s)=>s.score-l.score),r.splice(12,r.length-12))}this.minStackPos=r[0].pos;for(let l=1;l<r.length;l++)r[l].pos<this.minStackPos&&(this.minStackPos=r[l].pos);return null}stopAt(t){if(this.stoppedAt!=null&&this.stoppedAt<t)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=t}advanceStack(t,n,r){let i=t.pos,{parser:a}=this,l=Ar?this.stackID(t)+" -> ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let f=t.curContext&&t.curContext.tracker.strict,d=f?t.curContext.hash:0;for(let p=this.fragments.nodeAt(i);p;){let g=this.parser.nodeSet.types[p.type.id]==p.type?a.getGoto(t.state,p.type.id):-1;if(g>-1&&p.length&&(!f||(p.prop(Le.contextHash)||0)==d))return t.useNode(p,g),Ar&&console.log(l+this.stackID(t)+` (via reuse of ${a.getName(p.type.id)})`),!0;if(!(p instanceof jt)||p.children.length==0||p.positions[0]>0)break;let v=p.children[0];if(v instanceof jt&&p.positions[0]==0)p=v;else break}}let s=a.stateSlot(t.state,4);if(s>0)return t.reduce(s),Ar&&console.log(l+this.stackID(t)+` (via always-reduce ${a.getName(s&65535)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let c=this.tokens.getActions(t);for(let f=0;f<c.length;){let d=c[f++],p=c[f++],g=c[f++],v=f==c.length||!r,y=v?t:t.split(),x=this.tokens.mainToken;if(y.apply(d,p,x?x.start:y.pos,g),Ar&&console.log(l+this.stackID(y)+` (via ${(d&65536)==0?"shift":`reduce of ${a.getName(d&65535)}`} for ${a.getName(p)} @ ${i}${y==t?"":", split"})`),v)return!0;y.pos>i?n.push(y):r.push(y)}return!1}advanceFully(t,n){let r=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>r)return TD(t,n),!0}}runRecovery(t,n,r){let i=null,a=!1;for(let l=0;l<t.length;l++){let s=t[l],c=n[l<<1],f=n[(l<<1)+1],d=Ar?this.stackID(s)+" -> ":"";if(s.deadEnd&&(a||(a=!0,s.restart(),Ar&&console.log(d+this.stackID(s)+" (restarted)"),this.advanceFully(s,r))))continue;let p=s.split(),g=d;for(let v=0;v<10&&p.forceReduce()&&(Ar&&console.log(g+this.stackID(p)+" (via force-reduce)"),!this.advanceFully(p,r));v++)Ar&&(g=this.stackID(p)+" -> ");for(let v of s.recoverByInsert(c))Ar&&console.log(d+this.stackID(v)+" (via recover-insert)"),this.advanceFully(v,r);this.stream.end>s.pos?(f==s.pos&&(f++,c=0),s.recoverByDelete(c,f),Ar&&console.log(d+this.stackID(s)+` (via recover-delete ${this.parser.getName(c)})`),TD(s,r)):(!i||i.score<p.score)&&(i=p)}return i}stackToTree(t){return t.close(),jt.build({buffer:Cg.create(t),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:t.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(t){let n=(qx||(qx=new WeakMap)).get(t);return n||qx.set(t,n=String.fromCodePoint(this.nextStackID++)),n+t}}function TD(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}class eee{constructor(t,n,r){this.source=t,this.flags=n,this.disabled=r}allows(t){return!this.disabled||this.disabled[t]==0}}const Wx=e=>e;class tee{constructor(t){this.start=t.start,this.shift=t.shift||Wx,this.reduce=t.reduce||Wx,this.reuse=t.reuse||Wx,this.hash=t.hash||(()=>0),this.strict=t.strict!==!1}}class Eg extends _3{constructor(t){if(super(),this.wrappers=[],t.version!=14)throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let n=t.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let s=0;s<t.repeatNodeCount;s++)n.push("");let r=Object.keys(t.topRules).map(s=>t.topRules[s][1]),i=[];for(let s=0;s<n.length;s++)i.push([]);function a(s,c,f){i[s].push([c,c.deserialize(String(f))])}if(t.nodeProps)for(let s of t.nodeProps){let c=s[0];typeof c=="string"&&(c=Le[c]);for(let f=1;f<s.length;){let d=s[f++];if(d>=0)a(d,c,s[f++]);else{let p=s[f+-d];for(let g=-d;g>0;g--)a(s[f++],c,p);f++}}}this.nodeSet=new LO(n.map((s,c)=>fr.define({name:c>=this.minRepeatTerm?void 0:s,id:c,props:i[c],top:r.indexOf(c)>-1,error:c==0,skipped:t.skippedNodes&&t.skippedNodes.indexOf(c)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=M3;let l=um(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let s=0;s<this.specializerSpecs.length;s++)this.specialized[s]=this.specializerSpecs[s].term;this.specializers=this.specializerSpecs.map(MD),this.states=um(t.states,Uint32Array),this.data=um(t.stateData),this.goto=um(t.goto),this.maxTerm=t.maxTerm,this.tokenizers=t.tokenizers.map(s=>typeof s=="number"?new Lu(l,s):s),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,n,r){let i=new JJ(this,t,n,r);for(let a of this.wrappers)i=a(i,t,n,r);return i}getGoto(t,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let a=i[n+1];;){let l=i[a++],s=l&1,c=i[a++];if(s&&r)return c;for(let f=a+(l>>1);a<f;a++)if(i[a]==t)return c;if(s)return-1}}hasAction(t,n){let r=this.data;for(let i=0;i<2;i++)for(let a=this.stateSlot(t,i?2:1),l;;a+=3){if((l=r[a])==65535)if(r[a+1]==1)l=r[a=Ca(r,a+2)];else{if(r[a+1]==2)return Ca(r,a+2);break}if(l==n||l==0)return Ca(r,a+1)}return 0}stateSlot(t,n){return this.states[t*6+n]}stateFlag(t,n){return(this.stateSlot(t,0)&n)>0}validAction(t,n){return!!this.allActions(t,r=>r==n?!0:null)}allActions(t,n){let r=this.stateSlot(t,4),i=r?n(r):void 0;for(let a=this.stateSlot(t,1);i==null;a+=3){if(this.data[a]==65535)if(this.data[a+1]==1)a=Ca(this.data,a+2);else break;i=n(Ca(this.data,a+1))}return i}nextStates(t){let n=[];for(let r=this.stateSlot(t,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=Ca(this.data,r+2);else break;if((this.data[r+2]&1)==0){let i=this.data[r+1];n.some((a,l)=>l&1&&a==i)||n.push(this.data[r],i)}}return n}configure(t){let n=Object.assign(Object.create(Eg.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let r=this.topRules[t.top];if(!r)throw new RangeError(`Invalid top rule name ${t.top}`);n.top=r}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=t.tokenizers.find(a=>a.from==r);return i?i.to:r})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let a=t.specializers.find(s=>s.from==r.external);if(!a)return r;let l=Object.assign(Object.assign({},r),{external:a.to});return n.specializers[i]=MD(l),l})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let n=this.dynamicPrecedences;return n==null?0:n[t]||0}parseDialect(t){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(t)for(let a of t.split(" ")){let l=n.indexOf(a);l>=0&&(r[l]=!0)}let i=null;for(let a=0;a<n.length;a++)if(!r[a])for(let l=this.dialects[n[a]],s;(s=this.data[l++])!=65535;)(i||(i=new Uint8Array(this.maxTerm+1)))[s]=1;return new eee(t,r,i)}static deserialize(t){return new Eg(t)}}function Ca(e,t){return e[t]|e[t+1]<<16}function nee(e){let t=null;for(let n of e){let r=n.p.stoppedAt;(n.pos==n.p.stream.end||r!=null&&n.pos>r)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}function MD(e){if(e.external){let t=e.extend?1:0;return(n,r)=>e.external(n,r)<<1|t}return e.get}const bu=63,PD=64,ree=1,iee=2,rz=3,aee=4,iz=5,lee=6,oee=7,az=65,see=66,uee=8,cee=9,fee=10,hee=11,dee=12,lz=13,pee=19,mee=20,gee=29,vee=33,yee=34,bee=47,xee=0,eA=1,US=2,Eh=3,FS=4;class Bo{constructor(t,n,r){this.parent=t,this.depth=n,this.type=r,this.hash=(t?t.hash+t.hash<<8:0)+n+(n<<4)+r}}Bo.top=new Bo(null,-1,xee);function Jf(e,t){for(let n=0,r=t-e.pos-1;;r--,n++){let i=e.peek(r);if(Fa(i)||i==-1)return n}}function qS(e){return e==32||e==9}function Fa(e){return e==10||e==13}function oz(e){return qS(e)||Fa(e)}function Fo(e){return e<0||oz(e)}const See=new tee({start:Bo.top,reduce(e,t){return e.type==Eh&&(t==mee||t==yee)?e.parent:e},shift(e,t,n,r){if(t==rz)return new Bo(e,Jf(r,r.pos),eA);if(t==az||t==iz)return new Bo(e,Jf(r,r.pos),US);if(t==bu)return e.parent;if(t==pee||t==vee)return new Bo(e,0,Eh);if(t==lz&&e.type==FS)return e.parent;if(t==bee){let i=/[1-9]/.exec(r.read(r.pos,n.pos));if(i)return new Bo(e,e.depth+ +i[0],FS)}return e},hash(e){return e.hash}});function Yu(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&Fo(e.peek(n+3))}const wee=new Vv((e,t)=>{if(e.next==-1&&t.canShift(PD))return e.acceptToken(PD);let n=e.peek(-1);if((Fa(n)||n<0)&&t.context.type!=Eh){if(Yu(e,45))if(t.canShift(bu))e.acceptToken(bu);else return e.acceptToken(ree,3);if(Yu(e,46))if(t.canShift(bu))e.acceptToken(bu);else return e.acceptToken(iee,3);let r=0;for(;e.next==32;)r++,e.advance();(r<t.context.depth||r==t.context.depth&&t.context.type==eA&&(e.next!=45||!Fo(e.peek(1))))&&e.next!=-1&&!Fa(e.next)&&e.next!=35&&e.acceptToken(bu,-r)}},{contextual:!0}),Oee=new Vv((e,t)=>{if(t.context.type==Eh){e.next==63&&(e.advance(),Fo(e.next)&&e.acceptToken(oee));return}if(e.next==45)e.advance(),Fo(e.next)&&e.acceptToken(t.context.type==eA&&t.context.depth==Jf(e,e.pos-1)?aee:rz);else if(e.next==63)e.advance(),Fo(e.next)&&e.acceptToken(t.context.type==US&&t.context.depth==Jf(e,e.pos-1)?lee:iz);else{let n=e.pos;for(;;)if(qS(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)sz(e);else if(e.next==38)WS(e);else if(e.next==42){WS(e);break}else if(e.next==39||e.next==34){if(tA(e,!0))break;return}else if(e.next==91||e.next==123){if(!kee(e))return;break}else{uz(e,!0,!1,0);break}for(;qS(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(gee))return;let r=e.peek(1);Fo(r)&&e.acceptTokenTo(t.context.type==US&&t.context.depth==Jf(e,n)?see:az,n)}}},{contextual:!0});function Aee(e){return e>32&&e<127&&e!=34&&e!=37&&e!=44&&e!=60&&e!=62&&e!=92&&e!=94&&e!=96&&e!=123&&e!=124&&e!=125}function DD(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function RD(e,t){return e.next==37?(e.advance(),DD(e.next)&&e.advance(),DD(e.next)&&e.advance(),!0):Aee(e.next)||t&&e.next==44?(e.advance(),!0):!1}function sz(e){if(e.advance(),e.next==60){for(e.advance();;)if(!RD(e,!0)){e.next==62&&e.advance();break}}else for(;RD(e,!1););}function WS(e){for(e.advance();!Fo(e.next)&&Tg(e.next)!="f";)e.advance()}function tA(e,t){let n=e.next,r=!1,i=e.pos;for(e.advance();;){let a=e.next;if(a<0)break;if(e.advance(),a==n)if(a==39)if(e.next==39)e.advance();else break;else break;else if(a==92&&n==34)e.next>=0&&e.advance();else if(Fa(a)){if(t)return!1;r=!0}else if(t&&e.pos>=i+1024)return!1}return!r}function kee(e){for(let t=[],n=e.pos+1024;;)if(e.next==91||e.next==123)t.push(e.next),e.advance();else if(e.next==39||e.next==34){if(!tA(e,!0))return!1}else if(e.next==93||e.next==125){if(t[t.length-1]!=e.next-2)return!1;if(t.pop(),e.advance(),!t.length)return!0}else{if(e.next<0||e.pos>n||Fa(e.next))return!1;e.advance()}}const Cee="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function Tg(e){return e<33?"u":e>125?"s":Cee[e-33]}function Vx(e,t){let n=Tg(e);return n!="u"&&!(t&&n=="f")}function uz(e,t,n,r){if(Tg(e.next)=="s"||(e.next==63||e.next==58||e.next==45)&&Vx(e.peek(1),n))e.advance();else return!1;let i=e.pos;for(;;){let a=e.next,l=0,s=r+1;for(;oz(a);){if(Fa(a)){if(t)return!1;s=0}else s++;a=e.peek(++l)}if(!(a>=0&&(a==58?Vx(e.peek(l+1),n):a==35?e.peek(l-1)!=32:Vx(a,n)))||!n&&s<=r||s==0&&!n&&(Yu(e,45,l)||Yu(e,46,l)))break;if(t&&Tg(a)=="f")return!1;for(let f=l;f>=0;f--)e.advance();if(t&&e.pos>i+1024)return!1}return!0}const Eee=new Vv((e,t)=>{if(e.next==33)sz(e),e.acceptToken(dee);else if(e.next==38||e.next==42){let n=e.next==38?fee:hee;WS(e),e.acceptToken(n)}else e.next==39||e.next==34?(tA(e,!1),e.acceptToken(cee)):uz(e,!1,t.context.type==Eh,t.context.depth)&&e.acceptToken(uee)}),Tee=new Vv((e,t)=>{let n=t.context.type==FS?t.context.depth:-1,r=e.pos;e:for(;;){let i=0,a=e.next;for(;a==32;)a=e.peek(++i);if(!i&&(Yu(e,45,i)||Yu(e,46,i))||!Fa(a)&&(n<0&&(n=Math.max(t.context.depth+1,i)),i<n))break;for(;;){if(e.next<0)break e;let l=Fa(e.next);if(e.advance(),l)continue e;r=e.pos}}e.acceptTokenTo(lz,r)}),Mee=N3({DirectiveName:Y.keyword,DirectiveContent:Y.attributeValue,"DirectiveEnd DocEnd":Y.meta,QuotedLiteral:Y.string,BlockLiteralHeader:Y.special(Y.string),BlockLiteralContent:Y.content,Literal:Y.content,"Key/Literal Key/QuotedLiteral":Y.definition(Y.propertyName),"Anchor Alias":Y.labelName,Tag:Y.typeName,Comment:Y.lineComment,": , -":Y.separator,"?":Y.punctuation,"[ ]":Y.squareBracket,"{ }":Y.brace}),Pee=Eg.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQdO'#DUO%nQgO'#DUO&ROaO'#D[OOQR'#Du'#DuO&{QgO'#D^O'rQgO'#D`OOQR'#Dt'#DtO(iOqO'#DbOOQP'#Dj'#DjO(zQaO'#CmO)YQgO'#CmOOQP'#Cm'#CmQ)jQaOOQ)uQgOOQ]QgOOO*PQdO'#CrO*nQdO'#CtOOQO'#Dw'#DwO+]Q`O'#CxO+hQdO'#CwO+rQ`O'#CwOOQO'#Cv'#CvO+wQdO'#CvOOQO'#Cq'#CqO,UQ`O,59[O,^QfO,59[OOQR,59[,59[OOQO'#Cx'#CxO,eQ`O'#DPO,pQdO'#DPOOQO'#Dx'#DxO,zQdO'#DxO-XQ`O,59jO-aQfO,59jOOQR,59j,59jOOQR'#DS'#DSO-hQcO,59mO-sQgO'#DVO.TQ`O'#DVO.YQcO,59pOOQR'#DX'#DXO#|QfO'#DWO.hQcO'#DWOOQR,59v,59vO.yOWO,59vO/OOaO,59vO/WOaO,59vO/cQgO'#D_OOQR,59x,59xO0VQgO'#DaOOQR,59z,59zOOQP,59|,59|O0yOaO,59|O1ROaO,59|O1aOqO,59|OOQP-E7h-E7hO1oQgO,59XOOQP,59X,59XO2PQaO'#DeO2_QgO'#DeO2oQgO'#DkOOQP'#Dk'#DkQ)jQaOOO3PQdO'#CsOOQO,59^,59^O3kQdO'#CuOOQO,59`,59`OOQO,59c,59cO4VQdO,59cO4aQdO'#CzO4kQ`O'#CzOOQO,59b,59bOOQU,5:Q,5:QOOQR1G.v1G.vO4pQ`O1G.vOOQU-E7d-E7dO4xQdO,59kOOQO,59k,59kO5SQdO'#DQO5^Q`O'#DQOOQO,5:d,5:dOOQU,5:R,5:ROOQR1G/U1G/UO5cQ`O1G/UOOQU-E7e-E7eO5kQgO'#DhO5xQcO1G/XOOQR1G/X1G/XOOQR,59q,59qO6TQgO,59qO6eQdO'#DiO6lQgO'#DiO7PQcO1G/[OOQR1G/[1G/[OOQR,59r,59rO#|QfO,59rOOQR1G/b1G/bO7_OWO1G/bO7dOaO1G/bOOQR,59y,59yOOQR,59{,59{OOQP1G/h1G/hO7lOaO1G/hO7tOaO1G/hO8POaO1G/hOOQP1G.s1G.sO8_QgO,5:POOQP,5:P,5:POOQP,5:V,5:VOOQP-E7i-E7iOOQO,59_,59_OOQO,59a,59aOOQO1G.}1G.}OOQO,59f,59fO8oQdO,59fOOQR7+$b7+$bP,XQ`O'#DfOOQO1G/V1G/VOOQO,59l,59lO8yQdO,59lOOQR7+$p7+$pP9TQ`O'#DgOOQR'#DT'#DTOOQR,5:S,5:SOOQR-E7f-E7fOOQR7+$s7+$sOOQR1G/]1G/]O9YQgO'#DYO9jQ`O'#DYOOQR,5:T,5:TO#|QfO'#DZO9oQcO'#DZOOQR-E7g-E7gOOQR7+$v7+$vOOQR1G/^1G/^OOQR7+$|7+$|O:QOWO7+$|OOQP7+%S7+%SO:VOaO7+%SO:_OaO7+%SOOQP1G/k1G/kOOQO1G/Q1G/QOOQO1G/W1G/WOOQR,59t,59tO:jQgO,59tOOQR,59u,59uO#|QfO,59uOOQR<<Hh<<HhOOQP<<Hn<<HnO:zOaO<<HnOOQR1G/`1G/`OOQR1G/a1G/aOOQPAN>YAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:See,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[Mee],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[wee,Oee,Eee,Tee,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),Dee=hg.define({name:"yaml",parser:Pee.configure({props:[B3.add({Stream:e=>{for(let t=e.node.resolve(e.pos,-1);t&&t.to>=e.pos;t=t.parent){if(t.name=="BlockLiteralContent"&&t.from<t.to)return e.baseIndentFor(t);if(t.name=="BlockLiteral")return e.baseIndentFor(t)+e.unit;if(t.name=="BlockSequence"||t.name=="BlockMapping")return e.column(t.firstChild.from,1);if(t.name=="QuotedLiteral")return null;if(t.name=="Literal"){let n=e.column(t.from,1);if(n==e.lineIndent(t.from,1))return n;if(t.to>e.pos)return null}}return null},FlowMapping:zP({closing:"}"}),FlowSequence:zP({closing:"]"})}),H3.add({"FlowMapping FlowSequence":uY,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function Ree(){return new ZQ(Dee)}function _D(e){const t=ro(),n=e.mode==="create"?e.initialContent:e.config.content,[r,i]=O.useState(n),[a,l]=O.useState("new-config.yaml"),[s,c]=O.useState(null),f=r!==n,d=O.useMemo(()=>window.matchMedia("(prefers-color-scheme: dark)").matches,[]),p=$u({mutationFn:async()=>{const y=await an.validateConfig(r);if(!y.valid)throw new ah(400,y.error??"invalid config");if(e.mode==="create")return an.createConfig(a,r);if(e.mode==="edit")return an.updateConfig(e.config.id,r,e.config.content_hash);throw new Error("unreachable")},onSuccess:y=>{c(null),t.invalidateQueries({queryKey:["configs"]}),e.mode!=="view"&&e.onSaved?.(y)},onError:y=>c(y.message)}),g=p.error instanceof ah&&p.error.status===409,v=e.mode==="view";return _.jsxs("div",{className:"space-y-3",children:[e.mode==="create"&&_.jsxs("label",{className:"block text-sm",children:[_.jsx("span",{className:"mb-1 block text-xs uppercase tracking-wide text-ink-muted",children:"Filename"}),_.jsx("input",{value:a,onChange:y=>l(y.target.value),className:"w-72 rounded-md border border-edge bg-page px-3 py-1.5 font-mono text-sm outline-none focus:border-accent",placeholder:"my-config.yaml"})]}),g&&_.jsx("div",{className:"rounded-md border border-warning/50 bg-surface px-3 py-2 text-sm text-ink-secondary",children:"⚠ The file changed on disk since you loaded it. Reload the page and reapply your edits."}),s&&!g&&_.jsx("div",{className:"rounded-md border border-critical/50 bg-surface px-3 py-2 text-sm text-critical",children:s}),_.jsx("div",{className:"overflow-hidden rounded-md border border-edge",children:_.jsx(nz,{value:r,onChange:i,extensions:[Ree()],editable:!v,theme:d?"dark":"light",minHeight:"240px",maxHeight:"560px"})}),!v&&_.jsxs("div",{className:"flex items-center gap-3",children:[_.jsx("button",{onClick:()=>p.mutate(),disabled:p.isPending||e.mode==="edit"&&!f,className:"rounded-md bg-accent px-3.5 py-1.5 text-sm font-medium text-white transition hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-40",children:p.isPending?"Saving…":e.mode==="create"?"Create config":"Save changes"}),e.mode==="create"&&_.jsx("button",{onClick:()=>e.onCancel?.(),className:"text-sm text-ink-muted hover:text-ink-secondary",children:"Cancel"}),e.mode==="edit"&&f&&_.jsx("span",{className:"text-xs text-ink-muted",children:"unsaved changes"}),_.jsxs("span",{className:"ml-auto text-xs text-ink-muted",children:["Secrets stay as ",_.jsx("code",{children:"${ENV_VAR}"})," placeholders — they are resolved only inside sync jobs."]})]})]})}function _ee({runs:e,showConfig:t=!1,configNames:n}){return e.length===0?_.jsx("p",{className:"py-8 text-center text-sm text-ink-muted",children:"No runs yet."}):_.jsx("div",{className:"overflow-x-auto",children:_.jsxs("table",{className:"w-full text-sm",children:[_.jsx("thead",{children:_.jsxs("tr",{className:"border-b border-edge text-left text-xs uppercase tracking-wide text-ink-muted",children:[_.jsx("th",{className:"py-2 pr-4 font-medium",children:"Run"}),t&&_.jsx("th",{className:"py-2 pr-4 font-medium",children:"Config"}),_.jsx("th",{className:"py-2 pr-4 font-medium",children:"Status"}),_.jsx("th",{className:"py-2 pr-4 font-medium",children:"Trigger"}),_.jsx("th",{className:"py-2 pr-4 font-medium",children:"Started"}),_.jsx("th",{className:"py-2 pr-4 font-medium",children:"Duration"}),_.jsx("th",{className:"py-2 font-medium",children:"Detail"})]})}),_.jsx("tbody",{children:e.map(r=>_.jsxs("tr",{className:"border-b border-edge/60 hover:bg-ink/[0.03]",children:[_.jsx("td",{className:"py-2.5 pr-4",children:_.jsxs(za,{to:`/runs/${r.id}`,className:"font-medium text-accent hover:underline",children:["#",r.id]})}),t&&_.jsx("td",{className:"py-2.5 pr-4",children:_.jsx(za,{to:`/configs/${r.config_id}`,className:"hover:underline",children:n?.get(r.config_id)??r.config_name??`config ${r.config_id}`})}),_.jsx("td",{className:"py-2.5 pr-4",children:_.jsx(aO,{status:r.status})}),_.jsx("td",{className:"py-2.5 pr-4 text-ink-secondary",children:r.trigger}),_.jsx("td",{className:"py-2.5 pr-4 text-ink-secondary",children:Hu(r.started_at??r.queued_at)}),_.jsx("td",{className:"py-2.5 pr-4 text-ink-secondary",children:r.status==="running"||r.status==="queued"?"…":rO(r.started_at,r.finished_at)}),_.jsx("td",{className:"max-w-md truncate py-2.5 text-ink-muted",title:r.error??void 0,children:r.error??(r.stats?.sources?`${r.stats.sources.length} source(s)`:"")})]},r.id))})]})})}function cz(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=cz(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function st(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=cz(e))&&(r&&(r+=" "),r+=t);return r}var Nee=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function nA(e){if(typeof e!="string")return!1;var t=Nee;return t.includes(e)}var Iee=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],Lee=new Set(Iee);function fz(e){return typeof e!="string"?!1:Lee.has(e)}function hz(e){return typeof e=="string"&&e.startsWith("data-")}function yi(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(fz(n)||hz(n))&&(t[n]=e[n]);return t}function Yh(e){if(e==null)return null;if(O.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return yi(t)}return typeof e=="object"&&!Array.isArray(e)?yi(e):null}function Dr(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(fz(n)||hz(n)||nA(n))&&(t[n]=e[n]);return t}function jee(e){return e==null?null:O.isValidElement(e)?Dr(e.props):typeof e=="object"&&!Array.isArray(e)?Dr(e):null}var Bee=["children","width","height","viewBox","className","style","title","desc"];function VS(){return VS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},VS.apply(null,arguments)}function zee(e,t){if(e==null)return{};var n,r,i=$ee(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function $ee(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var rA=O.forwardRef((e,t)=>{var n=e.children,r=e.width,i=e.height,a=e.viewBox,l=e.className,s=e.style,c=e.title,f=e.desc,d=zee(e,Bee),p=a||{width:r,height:i,x:0,y:0},g=st("recharts-surface",l);return O.createElement("svg",VS({},Dr(d),{className:g,width:r,height:i,style:s,viewBox:"".concat(p.x," ").concat(p.y," ").concat(p.width," ").concat(p.height),ref:t}),O.createElement("title",null,c),O.createElement("desc",null,f),n)}),Hee=["children","className"];function KS(){return KS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},KS.apply(null,arguments)}function Uee(e,t){if(e==null)return{};var n,r,i=Fee(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Fee(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Rr=O.forwardRef((e,t)=>{var n=e.children,r=e.className,i=Uee(e,Hee),a=st("recharts-layer",r);return O.createElement("g",KS({className:a},Dr(i),{ref:t}),n)}),dz=O.createContext(null),qee=()=>O.useContext(dz);function dt(e){return function(){return e}}const pz=Math.cos,Mg=Math.sin,Ai=Math.sqrt,Pg=Math.PI,Kv=2*Pg,XS=Math.PI,QS=2*XS,No=1e-6,Wee=QS-No;function mz(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Vee(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return mz;const n=10**t;return function(r){this._+=r[0];for(let i=1,a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class Kee{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?mz:Vee(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,a,l){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+l}`}arcTo(t,n,r,i,a){if(t=+t,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let l=this._x1,s=this._y1,c=r-t,f=i-n,d=l-t,p=s-n,g=d*d+p*p;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(g>No)if(!(Math.abs(p*c-f*d)>No)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let v=r-l,y=i-s,x=c*c+f*f,w=v*v+y*y,A=Math.sqrt(x),k=Math.sqrt(g),E=a*Math.tan((XS-Math.acos((x+g-w)/(2*A*k)))/2),P=E/k,T=E/A;Math.abs(P-1)>No&&this._append`L${t+P*d},${n+P*p}`,this._append`A${a},${a},0,0,${+(p*v>d*y)},${this._x1=t+T*c},${this._y1=n+T*f}`}}arc(t,n,r,i,a,l){if(t=+t,n=+n,r=+r,l=!!l,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),c=r*Math.sin(i),f=t+s,d=n+c,p=1^l,g=l?i-a:a-i;this._x1===null?this._append`M${f},${d}`:(Math.abs(this._x1-f)>No||Math.abs(this._y1-d)>No)&&this._append`L${f},${d}`,r&&(g<0&&(g=g%QS+QS),g>Wee?this._append`A${r},${r},0,1,${p},${t-s},${n-c}A${r},${r},0,1,${p},${this._x1=f},${this._y1=d}`:g>No&&this._append`A${r},${r},0,${+(g>=XS)},${p},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function iA(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new Kee(t)}function aA(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function gz(e){this._context=e}gz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Xv(e){return new gz(e)}function vz(e){return e[0]}function yz(e){return e[1]}function bz(e,t){var n=dt(!0),r=null,i=Xv,a=null,l=iA(s);e=typeof e=="function"?e:e===void 0?vz:dt(e),t=typeof t=="function"?t:t===void 0?yz:dt(t);function s(c){var f,d=(c=aA(c)).length,p,g=!1,v;for(r==null&&(a=i(v=l())),f=0;f<=d;++f)!(f<d&&n(p=c[f],f,c))===g&&((g=!g)?a.lineStart():a.lineEnd()),g&&a.point(+e(p,f,c),+t(p,f,c));if(v)return a=null,v+""||null}return s.x=function(c){return arguments.length?(e=typeof c=="function"?c:dt(+c),s):e},s.y=function(c){return arguments.length?(t=typeof c=="function"?c:dt(+c),s):t},s.defined=function(c){return arguments.length?(n=typeof c=="function"?c:dt(!!c),s):n},s.curve=function(c){return arguments.length?(i=c,r!=null&&(a=i(r)),s):i},s.context=function(c){return arguments.length?(c==null?r=a=null:a=i(r=c),s):r},s}function cm(e,t,n){var r=null,i=dt(!0),a=null,l=Xv,s=null,c=iA(f);e=typeof e=="function"?e:e===void 0?vz:dt(+e),t=typeof t=="function"?t:dt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?yz:dt(+n);function f(p){var g,v,y,x=(p=aA(p)).length,w,A=!1,k,E=new Array(x),P=new Array(x);for(a==null&&(s=l(k=c())),g=0;g<=x;++g){if(!(g<x&&i(w=p[g],g,p))===A)if(A=!A)v=g,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),y=g-1;y>=v;--y)s.point(E[y],P[y]);s.lineEnd(),s.areaEnd()}A&&(E[g]=+e(w,g,p),P[g]=+t(w,g,p),s.point(r?+r(w,g,p):E[g],n?+n(w,g,p):P[g]))}if(k)return s=null,k+""||null}function d(){return bz().defined(i).curve(l).context(a)}return f.x=function(p){return arguments.length?(e=typeof p=="function"?p:dt(+p),r=null,f):e},f.x0=function(p){return arguments.length?(e=typeof p=="function"?p:dt(+p),f):e},f.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:dt(+p),f):r},f.y=function(p){return arguments.length?(t=typeof p=="function"?p:dt(+p),n=null,f):t},f.y0=function(p){return arguments.length?(t=typeof p=="function"?p:dt(+p),f):t},f.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:dt(+p),f):n},f.lineX0=f.lineY0=function(){return d().x(e).y(t)},f.lineY1=function(){return d().x(e).y(n)},f.lineX1=function(){return d().x(r).y(t)},f.defined=function(p){return arguments.length?(i=typeof p=="function"?p:dt(!!p),f):i},f.curve=function(p){return arguments.length?(l=p,a!=null&&(s=l(a)),f):l},f.context=function(p){return arguments.length?(p==null?a=s=null:s=l(a=p),f):a},f}class xz{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function Xee(e){return new xz(e,!0)}function Qee(e){return new xz(e,!1)}const lA={draw(e,t){const n=Ai(t/Pg);e.moveTo(n,0),e.arc(0,0,n,0,Kv)}},Yee={draw(e,t){const n=Ai(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},Sz=Ai(1/3),Gee=Sz*2,Zee={draw(e,t){const n=Ai(t/Gee),r=n*Sz;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Jee={draw(e,t){const n=Ai(t),r=-n/2;e.rect(r,r,n,n)}},ete=.8908130915292852,wz=Mg(Pg/10)/Mg(7*Pg/10),tte=Mg(Kv/10)*wz,nte=-pz(Kv/10)*wz,rte={draw(e,t){const n=Ai(t*ete),r=tte*n,i=nte*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const l=Kv*a/5,s=pz(l),c=Mg(l);e.lineTo(c*n,-s*n),e.lineTo(s*r-c*i,c*r+s*i)}e.closePath()}},Kx=Ai(3),ite={draw(e,t){const n=-Ai(t/(Kx*3));e.moveTo(0,n*2),e.lineTo(-Kx*n,-n),e.lineTo(Kx*n,-n),e.closePath()}},qr=-.5,Wr=Ai(3)/2,YS=1/Ai(12),ate=(YS/2+1)*3,lte={draw(e,t){const n=Ai(t/ate),r=n/2,i=n*YS,a=r,l=n*YS+n,s=-a,c=l;e.moveTo(r,i),e.lineTo(a,l),e.lineTo(s,c),e.lineTo(qr*r-Wr*i,Wr*r+qr*i),e.lineTo(qr*a-Wr*l,Wr*a+qr*l),e.lineTo(qr*s-Wr*c,Wr*s+qr*c),e.lineTo(qr*r+Wr*i,qr*i-Wr*r),e.lineTo(qr*a+Wr*l,qr*l-Wr*a),e.lineTo(qr*s+Wr*c,qr*c-Wr*s),e.closePath()}};function ote(e,t){let n=null,r=iA(i);e=typeof e=="function"?e:dt(e||lA),t=typeof t=="function"?t:dt(t===void 0?64:+t);function i(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:dt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:dt(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function Dg(){}function Rg(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Oz(e){this._context=e}Oz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Rg(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Rg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ste(e){return new Oz(e)}function Az(e){this._context=e}Az.prototype={areaStart:Dg,areaEnd:Dg,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Rg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ute(e){return new Az(e)}function kz(e){this._context=e}kz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Rg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function cte(e){return new kz(e)}function Cz(e){this._context=e}Cz.prototype={areaStart:Dg,areaEnd:Dg,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function fte(e){return new Cz(e)}function ND(e){return e<0?-1:1}function ID(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),l=(n-e._y1)/(i||r<0&&-0),s=(a*i+l*r)/(r+i);return(ND(a)+ND(l))*Math.min(Math.abs(a),Math.abs(l),.5*Math.abs(s))||0}function LD(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Xx(e,t,n){var r=e._x0,i=e._y0,a=e._x1,l=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,l-s*n,a,l)}function _g(e){this._context=e}_g.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Xx(this,this._t0,LD(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Xx(this,LD(this,n=ID(this,e,t)),n);break;default:Xx(this,this._t0,n=ID(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Ez(e){this._context=new Tz(e)}(Ez.prototype=Object.create(_g.prototype)).point=function(e,t){_g.prototype.point.call(this,t,e)};function Tz(e){this._context=e}Tz.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function hte(e){return new _g(e)}function dte(e){return new Ez(e)}function Mz(e){this._context=e}Mz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=jD(e),i=jD(t),a=0,l=1;l<n;++a,++l)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[l],t[l]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function jD(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),l=new Array(n);for(i[0]=0,a[0]=2,l[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,l[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,l[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,l[t]-=r*l[t-1];for(i[n-1]=l[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(l[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function pte(e){return new Mz(e)}function Qv(e,t){this._context=e,this._t=t}Qv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function mte(e){return new Qv(e,.5)}function gte(e){return new Qv(e,0)}function vte(e){return new Qv(e,1)}function us(e,t){if((l=e.length)>1)for(var n=1,r,i,a=e[t[0]],l,s=a.length;n<l;++n)for(i=a,a=e[t[n]],r=0;r<s;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function GS(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function yte(e,t){return e[t]}function bte(e){const t=[];return t.key=e,t}function xte(){var e=dt([]),t=GS,n=us,r=yte;function i(a){var l=Array.from(e.apply(this,arguments),bte),s,c=l.length,f=-1,d;for(const p of a)for(s=0,++f;s<c;++s)(l[s][f]=[0,+r(p,l[s].key,f,a)]).data=p;for(s=0,d=aA(t(l));s<c;++s)l[d[s]].index=s;return n(l,d),l}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:dt(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:dt(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?GS:typeof a=="function"?a:dt(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??us,i):n},i}function Ste(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,l;i<a;++i){for(l=n=0;n<r;++n)l+=e[n][i][1]||0;if(l)for(n=0;n<r;++n)e[n][i][1]/=l}us(e,t)}}function wte(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var l=0,s=0;l<i;++l)s+=e[l][n][1]||0;r[n][1]+=r[n][0]=-s/2}us(e,t)}}function Ote(e,t){if(!(!((l=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,l;r<a;++r){for(var s=0,c=0,f=0;s<l;++s){for(var d=e[t[s]],p=d[r][1]||0,g=d[r-1][1]||0,v=(p-g)/2,y=0;y<s;++y){var x=e[t[y]],w=x[r][1]||0,A=x[r-1][1]||0;v+=w-A}c+=p,f+=v*p}i[r-1][1]+=i[r-1][0]=n,c&&(n-=f/c)}i[r-1][1]+=i[r-1][0]=n,us(e,t)}}function ZS(e){return e==="__proto__"}function Pz(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return e.includes(".")||e.includes("[")||e.includes("]")}}function oA(e){return typeof e=="string"||typeof e=="symbol"?e:Object.is(e?.valueOf?.(),-0)?"-0":String(e)}function Dz(e){if(e==null)return"";if(typeof e=="string")return e;if(Array.isArray(e))return e.map(Dz).join(",");const t=String(e);return t==="0"&&Object.is(Number(e),-0)?"-0":t}function sA(e){if(Array.isArray(e))return e.map(oA);if(typeof e=="symbol")return[e];e=Dz(e);const t=[],n=e.length;if(n===0)return t;let r=0,i="",a="",l=!1;for(e.charCodeAt(0)===46&&t.push("");r<n;){const s=e[r];if(a)s==="\\"&&r+1<n?(r++,i+=e[r]):s===a?a="":i+=s;else if(l)s==='"'||s==="'"?a=s:s==="]"?(l=!1,t.push(i),i=""):i+=s;else if(s==="[")l=!0,i&&(t.push(i),i="");else if(s==="."){i&&(t.push(i),i="");const c=e[r+1];(c===void 0||c===".")&&t.push("")}else i+=s;r++}return i&&t.push(i),t}function qa(e,t,n){if(e==null)return n;switch(typeof t){case"string":{if(ZS(t))return n;const r=e[t];return r===void 0?Pz(t)&&!Object.hasOwn(e,t)?qa(e,sA(t),n):n:r}case"number":case"symbol":{typeof t=="number"&&(t=oA(t));const r=e[t];return r===void 0?n:r}default:{if(Array.isArray(t))return Ate(e,t,n);if(Object.is(t?.valueOf(),-0)?t="-0":t=String(t),ZS(t))return n;const r=e[t];return r===void 0?n:r}}}function Ate(e,t,n){if(t.length===0)return n;let r=e;for(let i=0;i<t.length;i++){if(r==null||ZS(t[i]))return n;r=r[t[i]]}return r===void 0?n:r}var kte=4;function Da(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:kte,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function Sn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.reduce((i,a,l)=>{var s=n[l-1];return typeof s=="string"?i+s+a:s!==void 0?i+Da(s)+a:i+a},"")}var or=e=>e===0?0:e>0?1:-1,Gi=e=>typeof e=="number"&&e!=+e,cs=e=>typeof e=="string"&&e.length>1&&e.indexOf("%")===e.length-1,be=e=>(typeof e=="number"||e instanceof Number)&&!Gi(e),Zi=e=>be(e)||typeof e=="string",Cte=0,Th=e=>{var t=++Cte;return"".concat(e||"").concat(t)},bi=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!be(t)&&typeof t!="string")return r;var a;if(cs(t)){if(n==null)return r;var l=t.indexOf("%");a=n*parseFloat(t.slice(0,l))/100}else a=+t;return Gi(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},Rz=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function Ft(e,t,n){return be(e)&&be(t)?Da(e+n*(t-e)):t}function _z(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):qa(r,t))===n)}var kt=e=>e===null||typeof e>"u",Gh=e=>kt(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function sr(e){return e!=null}function vs(){}var Ete=["type","size","sizeType"];function JS(){return JS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},JS.apply(null,arguments)}function BD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BD(Object(n),!0).forEach(function(r){Tte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tte(e,t,n){return(t=Mte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mte(e){var t=Pte(e,"string");return typeof t=="symbol"?t:t+""}function Pte(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Dte(e,t){if(e==null)return{};var n,r,i=Rte(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Rte(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Nz={symbolCircle:lA,symbolCross:Yee,symbolDiamond:Zee,symbolSquare:Jee,symbolStar:rte,symbolTriangle:ite,symbolWye:lte},_te=Math.PI/180,Nte=e=>{var t="symbol".concat(Gh(e));return Nz[t]||lA},Ite=(e,t,n)=>{if(t==="area")return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var r=18*_te;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},Lte=(e,t)=>{Nz["symbol".concat(Gh(e))]=t},Iz=e=>{var t=e.type,n=t===void 0?"circle":t,r=e.size,i=r===void 0?64:r,a=e.sizeType,l=a===void 0?"area":a,s=Dte(e,Ete),c=zD(zD({},s),{},{type:n,size:i,sizeType:l}),f="circle";typeof n=="string"&&(f=n);var d=()=>{var x=Nte(f),w=ote().type(x).size(Ite(i,l,f)),A=w();if(A!==null)return A},p=c.className,g=c.cx,v=c.cy,y=Dr(c);return be(g)&&be(v)&&be(i)?O.createElement("path",JS({},y,{className:st("recharts-symbols",p),transform:"translate(".concat(g,", ").concat(v,")"),d:d()})):null};Iz.registerSymbol=Lte;var Lz=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,uA=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(O.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{nA(i)&&typeof n[i]=="function"&&(r[i]=(a=>n[i](n,a)))}),r},jte=(e,t,n)=>r=>(e(t,n,r),null),Yv=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];nA(i)&&typeof a=="function"&&(r||(r={}),r[i]=jte(a,t,n))}),r};function $D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Bte(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$D(Object(n),!0).forEach(function(r){zte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$D(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zte(e,t,n){return(t=$te(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $te(e){var t=Hte(e,"string");return typeof t=="symbol"?t:t+""}function Hte(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function In(e,t){var n=Bte({},e),r=t,i=Object.keys(t),a=i.reduce((l,s)=>(l[s]===void 0&&r[s]!==void 0&&(l[s]=r[s]),l),n);return a}function Ng(){return Ng=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ng.apply(null,arguments)}function HD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HD(Object(n),!0).forEach(function(r){Ute(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ute(e,t,n){return(t=Fte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fte(e){var t=qte(e,"string");return typeof t=="symbol"?t:t+""}function qte(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Kr=32,Wte={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function Vte(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function Kte(e){var t=e.data,n=e.iconType,r=e.inactiveColor,i=Kr/2,a=Kr/6,l=Kr/3,s=t.inactive?r:t.color,c=n??t.type;if(c==="none")return null;if(c==="plainline")return O.createElement("line",{strokeWidth:4,fill:"none",stroke:s,strokeDasharray:Vte(t.payload),x1:0,y1:i,x2:Kr,y2:i,className:"recharts-legend-icon"});if(c==="line")return O.createElement("path",{strokeWidth:4,fill:"none",stroke:s,d:"M0,".concat(i,"h").concat(l,`
|
|
67
|
+
A`).concat(a,",").concat(a,",0,1,1,").concat(2*l,",").concat(i,`
|
|
68
|
+
H`).concat(Kr,"M").concat(2*l,",").concat(i,`
|
|
69
|
+
A`).concat(a,",").concat(a,",0,1,1,").concat(l,",").concat(i),className:"recharts-legend-icon"});if(c==="rect")return O.createElement("path",{stroke:"none",fill:s,d:"M0,".concat(Kr/8,"h").concat(Kr,"v").concat(Kr*3/4,"h").concat(-Kr,"z"),className:"recharts-legend-icon"});if(O.isValidElement(t.legendIcon)){var f=jz({},t);return delete f.legendIcon,O.cloneElement(t.legendIcon,f)}return O.createElement(Iz,{fill:s,cx:i,cy:i,size:Kr,sizeType:"diameter",type:c})}function Xte(e){var t=e.payload,n=e.iconSize,r=e.layout,i=e.formatter,a=e.inactiveColor,l=e.iconType,s=e.labelStyle,c={x:0,y:0,width:Kr,height:Kr},f={display:r==="horizontal"?"inline-block":"block",marginRight:10},d={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((p,g)=>{var v=p.formatter||i,y=st({"recharts-legend-item":!0,["legend-item-".concat(g)]:!0,inactive:p.inactive});if(p.type==="none")return null;var x=typeof s=="object"?jz({},s):{};x.color=p.inactive?a:x.color||p.color;var w=v?v(p.value,p,g):p.value;return O.createElement("li",Ng({className:y,style:f,key:"legend-item-".concat(g)},Yv(e,p,g)),O.createElement(rA,{width:n,height:n,viewBox:c,style:d,"aria-label":p.value==null?"legend icon":"".concat(p.value," legend icon")},O.createElement(Kte,{data:p,iconType:l,inactiveColor:a})),O.createElement("span",{className:"recharts-legend-item-text",style:x},w))})}var Qte=e=>{var t=In(e,Wte),n=t.payload,r=t.layout,i=t.align;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r==="horizontal"?i:"left"};return O.createElement("ul",{className:"recharts-default-legend",style:a},O.createElement(Xte,Ng({},t,{payload:n})))};function Yte(e,t){const n=new Map;for(let r=0;r<e.length;r++){const i=e[r],a=t(i,r,e);n.has(a)||n.set(a,i)}return Array.from(n.values())}function Gte(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}function Bz(e){return e}function Zte(e){return function(t){return qa(t,e)}}function ew(e){return e==null||typeof e!="object"&&typeof e!="function"}function Jte(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ene(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function cA(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const tne="[object RegExp]",zz="[object String]",$z="[object Number]",Hz="[object Boolean]",Uz="[object Arguments]",nne="[object Symbol]",rne="[object Date]",ine="[object Map]",ane="[object Set]",lne="[object Array]",one="[object ArrayBuffer]",sne="[object Object]",une="[object DataView]",cne="[object Uint8Array]",fne="[object Uint8ClampedArray]",hne="[object Uint16Array]",dne="[object Uint32Array]",pne="[object Int8Array]",mne="[object Int16Array]",gne="[object Int32Array]",vne="[object Float32Array]",yne="[object Float64Array]",UD=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function bne(e){return typeof UD.Buffer<"u"&&UD.Buffer.isBuffer(e)}function xne(e,t){return qo(e,void 0,e,new Map,t)}function qo(e,t,n,r=new Map,i=void 0){const a=i?.(e,t,n,r);if(a!==void 0)return a;if(ew(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){const l=new Array(e.length);r.set(e,l);for(let s=0;s<e.length;s++)l[s]=qo(e[s],s,n,r,i);return Object.hasOwn(e,"index")&&(l.index=e.index),Object.hasOwn(e,"input")&&(l.input=e.input),l}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const l=new RegExp(e.source,e.flags);return l.lastIndex=e.lastIndex,l}if(e instanceof Map){const l=new Map;r.set(e,l);for(const[s,c]of e)l.set(s,qo(c,s,n,r,i));return l}if(e instanceof Set){const l=new Set;r.set(e,l);for(const s of e)l.add(qo(s,void 0,n,r,i));return l}if(bne(e))return e.subarray();if(Jte(e)){const l=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,l);for(let s=0;s<e.length;s++)l[s]=qo(e[s],s,n,r,i);return l}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const l=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,l),ui(l,e,n,r,i),l}if(typeof File<"u"&&e instanceof File){const l=new File([e],e.name,{type:e.type});return r.set(e,l),ui(l,e,n,r,i),l}if(typeof Blob<"u"&&e instanceof Blob){const l=new Blob([e],{type:e.type});return r.set(e,l),ui(l,e,n,r,i),l}if(e instanceof Error){const l=structuredClone(e);return r.set(e,l),l.message=e.message,l.name=e.name,l.stack=e.stack,l.cause=e.cause,l.constructor=e.constructor,ui(l,e,n,r,i),l}if(e instanceof Boolean){const l=new Boolean(e.valueOf());return r.set(e,l),ui(l,e,n,r,i),l}if(e instanceof Number){const l=new Number(e.valueOf());return r.set(e,l),ui(l,e,n,r,i),l}if(e instanceof String){const l=new String(e.valueOf());return r.set(e,l),ui(l,e,n,r,i),l}if(typeof e=="object"&&Sne(e)){const l=Object.create(Object.getPrototypeOf(e));return r.set(e,l),ui(l,e,n,r,i),l}return e}function ui(e,t,n=e,r,i){const a=[...Object.keys(t),...ene(t)];for(let l=0;l<a.length;l++){const s=a[l],c=Object.getOwnPropertyDescriptor(e,s);(c==null||c.writable)&&(e[s]=qo(t[s],s,n,r,i))}}function Sne(e){switch(cA(e)){case Uz:case lne:case one:case une:case Hz:case rne:case vne:case yne:case pne:case mne:case gne:case ine:case $z:case sne:case tne:case ane:case zz:case nne:case cne:case fne:case hne:case dne:return!0;default:return!1}}function wne(e){return qo(e,void 0,e,new Map,void 0)}function Hm(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function Fz(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function qz(e,t,n){return typeof n!="function"?qz(e,t,()=>{}):tw(e,t,function r(i,a,l,s,c,f){const d=n(i,a,l,s,c,f);return d!==void 0?!!d:tw(i,a,r,f,!1)},new Map,!0)}function tw(e,t,n,r,i=!1){if(t===e)return!0;switch(typeof t){case"object":return One(e,t,n,r);case"function":return Object.keys(t).length>0?tw(e,{...t},n,r,i):Hm(e,t);default:return Fz(e)&&i?typeof t=="string"?t==="":!0:Hm(e,t)}}function One(e,t,n,r){if(t==null)return!0;if(Array.isArray(t))return Wz(e,t,n,r);if(t instanceof Map)return Ane(e,t,n,r);if(t instanceof Set)return kne(e,t,n,r);const i=Object.keys(t);if(e==null||ew(e))return i.length===0;if(i.length===0)return!0;if(r?.has(t))return r.get(t)===e;r?.set(t,e);try{for(let a=0;a<i.length;a++){const l=i[a];if(!ew(e)&&!(l in e)||t[l]===void 0&&e[l]!==void 0||t[l]===null&&e[l]!==null||!n(e[l],t[l],l,e,t,r))return!1}return!0}finally{r?.delete(t)}}function Ane(e,t,n,r){if(t.size===0)return!0;if(!(e instanceof Map))return!1;for(const[i,a]of t.entries())if(n(e.get(i),a,i,e,t,r)===!1)return!1;return!0}function Wz(e,t,n,r){if(t.length===0)return!0;if(!Array.isArray(e))return!1;const i=new Set;for(let a=0;a<t.length;a++){const l=t[a];let s=!1;for(let c=0;c<e.length;c++){if(i.has(c))continue;const f=e[c];let d=!1;if(n(f,l,a,e,t,r)&&(d=!0),d){i.add(c),s=!0;break}}if(!s)return!1}return!0}function kne(e,t,n,r){return t.size===0?!0:e instanceof Set?Wz([...e],[...t],n,r):!1}function Vz(e,t){return qz(e,t,()=>{})}function Cne(e){return e=wne(e),t=>Vz(t,e)}function Ene(e,t){return xne(e,(n,r,i,a)=>{if(typeof e=="object"){if(cA(e)==="[object Object]"&&typeof e.constructor!="function"){const l={};return a.set(e,l),ui(l,e,i,a),l}switch(Object.prototype.toString.call(e)){case $z:case zz:case Hz:{const l=new e.constructor(e?.valueOf());return ui(l,e),l}case Uz:{const l={};return ui(l,e),l.length=e.length,l[Symbol.iterator]=e[Symbol.iterator],l}default:return}}})}function Tne(e){return Ene(e)}const Mne=/^(?:0|[1-9]\d*)$/;function Kz(e,t=Number.MAX_SAFE_INTEGER){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e<t;case"symbol":return!1;case"string":return Mne.test(e)}}function Pne(e){return e!==null&&typeof e=="object"&&cA(e)==="[object Arguments]"}function Dne(e,t){let n;if(Array.isArray(t)?n=t:typeof t=="string"&&Pz(t)&&e?.[t]==null?n=sA(t):n=[t],n.length===0)return!1;let r=e;for(let i=0;i<n.length;i++){const a=n[i];if((r==null||!Object.hasOwn(r,a))&&!((Array.isArray(r)||Pne(r))&&Kz(a)&&a<r.length))return!1;r=r[a]}return!0}function Rne(e,t){switch(typeof e){case"object":Object.is(e?.valueOf(),-0)&&(e="-0");break;case"number":e=oA(e);break}return t=Tne(t),function(n){const r=qa(n,e);return r===void 0?Dne(n,e):t===void 0?r===void 0:Vz(r,t)}}function _ne(e){if(e==null)return Bz;switch(typeof e){case"function":return e;case"object":return Array.isArray(e)&&e.length===2?Rne(e[0],e[1]):Cne(e);case"string":case"symbol":case"number":return Zte(e)}}function Nne(e){return Number.isSafeInteger(e)&&e>=0}function Xz(e){return e!=null&&typeof e!="function"&&Nne(e.length)}function Ine(e){return typeof e=="object"&&e!==null}function Lne(e){return Ine(e)&&Xz(e)}function FD(e,t=Bz){return Lne(e)?Yte(Array.from(e),Gte(_ne(t),1)):[]}function Qz(e,t,n){return t===!0?FD(e,n):typeof t=="function"?FD(e,t):e}var Qx={exports:{}},Yx={},Gx={exports:{}},Zx={};var qD;function jne(){if(qD)return Zx;qD=1;var e=ac();function t(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function s(p,g){var v=g(),y=r({inst:{value:v,getSnapshot:g}}),x=y[0].inst,w=y[1];return a(function(){x.value=v,x.getSnapshot=g,c(x)&&w({inst:x})},[p,v,g]),i(function(){return c(x)&&w({inst:x}),p(function(){c(x)&&w({inst:x})})},[p]),l(v),v}function c(p){var g=p.getSnapshot;p=p.value;try{var v=g();return!n(p,v)}catch{return!0}}function f(p,g){return g()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:s;return Zx.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,Zx}var WD;function Bne(){return WD||(WD=1,Gx.exports=jne()),Gx.exports}var VD;function zne(){if(VD)return Yx;VD=1;var e=ac(),t=Bne();function n(f,d){return f===d&&(f!==0||1/f===1/d)||f!==f&&d!==d}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,l=e.useEffect,s=e.useMemo,c=e.useDebugValue;return Yx.useSyncExternalStoreWithSelector=function(f,d,p,g,v){var y=a(null);if(y.current===null){var x={hasValue:!1,value:null};y.current=x}else x=y.current;y=s(function(){function A(M){if(!k){if(k=!0,E=M,M=g(M),v!==void 0&&x.hasValue){var R=x.value;if(v(R,M))return P=R}return P=M}if(R=P,r(E,M))return R;var L=g(M);return v!==void 0&&v(R,L)?(E=M,R):(E=M,P=L)}var k=!1,E,P,T=p===void 0?null:p;return[function(){return A(d())},T===null?void 0:function(){return A(T())}]},[d,p,g,v]);var w=i(f,y[0],y[1]);return l(function(){x.hasValue=!0,x.value=w},[w]),c(w),w},Yx}var KD;function $ne(){return KD||(KD=1,Qx.exports=zne()),Qx.exports}var Hne=$ne(),fA=O.createContext(null),Une=e=>e,St=()=>{var e=O.useContext(fA);return e?e.store.dispatch:Une},Um=()=>{},Fne=()=>Um,qne=(e,t)=>e===t;function we(e){var t=O.useContext(fA),n=O.useMemo(()=>t?r=>{if(r!=null)return e(r)}:Um,[t,e]);return Hne.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:Fne,t?t.store.getState:Um,t?t.store.getState:Um,n,qne)}function Wne(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Vne(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var XD=e=>Array.isArray(e)?e:[e];function Kne(e){const t=Array.isArray(e[0])?e[0]:e;return Vne(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Xne(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Qne=class{constructor(e){this.value=e}deref(){return this.value}},Yne=()=>typeof WeakRef>"u"?Qne:WeakRef,Yz=Yne(),Gne=0,QD=1;function fm(){return{s:Gne,v:void 0,o:null,p:null}}function Zne(e){return e instanceof Yz?e.deref():e}function Gz(e,t={}){let n=fm();const{resultEqualityCheck:r}=t;let i,a=0;function l(){let s=n;const{length:c}=arguments;for(let p=0,g=c;p<g;p++){const v=arguments[p];if(typeof v=="function"||typeof v=="object"&&v!==null){let y=s.o;y===null&&(s.o=y=new WeakMap);const x=y.get(v);x===void 0?(s=fm(),y.set(v,s)):s=x}else{let y=s.p;y===null&&(s.p=y=new Map);const x=y.get(v);x===void 0?(s=fm(),y.set(v,s)):s=x}}const f=s;let d;if(s.s===QD)d=s.v;else if(d=e.apply(null,arguments),a++,r){const p=Zne(i);p!=null&&r(p,d)&&(d=p,a!==0&&a--),i=typeof d=="object"&&d!==null||typeof d=="function"?new Yz(d):d}return f.s=QD,f.v=d,d}return l.clearCache=()=>{n=fm(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}function Jne(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let a=0,l=0,s,c={},f=i.pop();typeof f=="object"&&(c=f,f=i.pop()),Wne(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const d={...n,...c},{memoize:p,memoizeOptions:g=[],argsMemoize:v=Gz,argsMemoizeOptions:y=[]}=d,x=XD(g),w=XD(y),A=Kne(i),k=p(function(){return a++,f.apply(null,arguments)},...x),E=v(function(){l++;const T=Xne(A,arguments);return s=k.apply(null,T),s},...w);return Object.assign(E,{resultFunc:f,memoizedResultFunc:k,dependencies:A,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>s,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:p,argsMemoize:v})};return Object.assign(r,{withTypes:()=>r}),r}var q=Jne(Gz);function ere(e,t=1){const n=[],r=Math.floor(t),i=(a,l)=>{for(let s=0;s<a.length;s++){const c=a[s];Array.isArray(c)&&l<r?i(c,l+1):n.push(c)}};return i(e,0),n}function nw(e,t,n){return Fz(n)&&(typeof t=="number"&&Xz(n)&&Kz(t)&&t<n.length||typeof t=="string"&&t in n)?Hm(n[t],e):!1}function YD(e){return typeof e=="symbol"?1:e===null?2:e===void 0?3:e!==e?4:0}const tre=(e,t,n)=>{if(e!==t){const r=YD(e),i=YD(t);if(r===i&&r===0){if(e<t)return n==="desc"?1:-1;if(e>t)return n==="desc"?-1:1}return n==="desc"?i-r:r-i}return 0};function Zz(e){return typeof e=="symbol"||e instanceof Symbol}const nre=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,rre=/^\w*$/;function ire(e,t){return Array.isArray(e)?!1:typeof e=="number"||typeof e=="boolean"||e==null||Zz(e)?!0:typeof e=="string"&&(rre.test(e)||!nre.test(e))||t!=null}function are(e,t,n,r){if(e==null)return[];n=n,Array.isArray(e)||(e=Object.values(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(n)||(n=n==null?[]:[n]),n=n.map(s=>String(s));const i=(s,c)=>{let f=s;for(let d=0;d<c.length&&f!=null;++d)f=f[c[d]];return f},a=(s,c)=>c==null||s==null?c:typeof s=="object"&&"key"in s?Object.hasOwn(c,s.key)?c[s.key]:i(c,s.path):typeof s=="function"?s(c):Array.isArray(s)?i(c,s):typeof c=="object"?c[s]:c,l=t.map(s=>(Array.isArray(s)&&s.length===1&&(s=s[0]),s==null||typeof s=="function"||Array.isArray(s)||ire(s)?s:{key:s,path:sA(s)}));return e.map(s=>({original:s,criteria:l.map(c=>a(c,s))})).slice().sort((s,c)=>{for(let f=0;f<l.length;f++){const d=tre(s.criteria[f],c.criteria[f],n[f]);if(d!==0)return d}return 0}).map(s=>s.original)}function Gv(e,...t){const n=t.length;return n>1&&nw(e,t[0],t[1])?t=[]:n>2&&nw(t[0],t[1],t[2])&&(t=[t[0]]),are(e,ere(t),["asc"])}var Jz=e=>e.legend.settings,lre=e=>e.legend.size,ore=e=>e.legend.payload,sre=q([ore,Jz],(e,t)=>{var n=t.itemSorter,r=e.flat(1);return n?Gv(r,n):r});function ure(){return we(sre)}function cre(e,t){return pre(e)||dre(e,t)||hre(e,t)||fre()}function fre(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
70
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hre(e,t){if(e){if(typeof e=="string")return GD(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?GD(e,t):void 0}}function GD(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function dre(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function pre(e){if(Array.isArray(e))return e}var hm=1;function ZD(e,t){return Math.abs(e.height-t.height)>hm||Math.abs(e.left-t.left)>hm||Math.abs(e.top-t.top)>hm||Math.abs(e.width-t.width)>hm}function JD(e){var t=e.getBoundingClientRect();return{height:t.height,left:t.left,top:t.top,width:t.width}}function e5(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=O.useState({height:0,left:0,top:0,width:0}),n=cre(t,2),r=n[0],i=n[1],a=O.useRef(null),l=O.useRef(r);l.current=r;var s=O.useCallback(c=>{if(a.current!=null&&(a.current.disconnect(),a.current=null),c!=null){var f=JD(c);if(ZD(f,l.current)&&i(f),typeof ResizeObserver<"u"){var d=new ResizeObserver(()=>{var p=JD(c);ZD(p,l.current)&&i(p)});d.observe(c),a.current=d}}},[...e]);return O.useEffect(()=>()=>{var c;(c=a.current)===null||c===void 0||c.disconnect()},[]),[r,s]}function bn(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var mre=typeof Symbol=="function"&&Symbol.observable||"@@observable",eR=mre,Jx=()=>Math.random().toString(36).substring(7).split("").join("."),gre={INIT:`@@redux/INIT${Jx()}`,REPLACE:`@@redux/REPLACE${Jx()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Jx()}`},Ig=gre;function hA(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function t5(e,t,n){if(typeof e!="function")throw new Error(bn(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(bn(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(bn(1));return n(t5)(e,t)}let r=e,i=t,a=new Map,l=a,s=0,c=!1;function f(){l===a&&(l=new Map,a.forEach((w,A)=>{l.set(A,w)}))}function d(){if(c)throw new Error(bn(3));return i}function p(w){if(typeof w!="function")throw new Error(bn(4));if(c)throw new Error(bn(5));let A=!0;f();const k=s++;return l.set(k,w),function(){if(A){if(c)throw new Error(bn(6));A=!1,f(),l.delete(k),a=null}}}function g(w){if(!hA(w))throw new Error(bn(7));if(typeof w.type>"u")throw new Error(bn(8));if(typeof w.type!="string")throw new Error(bn(17));if(c)throw new Error(bn(9));try{c=!0,i=r(i,w)}finally{c=!1}return(a=l).forEach(k=>{k()}),w}function v(w){if(typeof w!="function")throw new Error(bn(10));r=w,g({type:Ig.REPLACE})}function y(){const w=p;return{subscribe(A){if(typeof A!="object"||A===null)throw new Error(bn(11));function k(){const P=A;P.next&&P.next(d())}return k(),{unsubscribe:w(k)}},[eR](){return this}}}return g({type:Ig.INIT}),{dispatch:g,subscribe:p,getState:d,replaceReducer:v,[eR]:y}}function vre(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Ig.INIT})>"u")throw new Error(bn(12));if(typeof n(void 0,{type:Ig.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(bn(13))})}function n5(e){const t=Object.keys(e),n={};for(let a=0;a<t.length;a++){const l=t[a];typeof e[l]=="function"&&(n[l]=e[l])}const r=Object.keys(n);let i;try{vre(n)}catch(a){i=a}return function(l={},s){if(i)throw i;let c=!1;const f={};for(let d=0;d<r.length;d++){const p=r[d],g=n[p],v=l[p],y=g(v,s);if(typeof y>"u")throw s&&s.type,new Error(bn(14));f[p]=y,c=c||y!==v}return c=c||r.length!==Object.keys(l).length,c?f:l}}function Lg(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function yre(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(bn(15))};const l={getState:i.getState,dispatch:(c,...f)=>a(c,...f)},s=e.map(c=>c(l));return a=Lg(...s)(i.dispatch),{...i,dispatch:a}}}function r5(e){return hA(e)&&"type"in e&&typeof e.type=="string"}var i5=Symbol.for("immer-nothing"),tR=Symbol.for("immer-draftable"),Kn=Symbol.for("immer-state");function fi(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Mr=Object,Gu=Mr.getPrototypeOf,jg="constructor",Zv="prototype",rw="configurable",Bg="enumerable",Fm="writable",Mh="value",Wa=e=>!!e&&!!e[Kn];function xi(e){return e?a5(e)||ey(e)||!!e[tR]||!!e[jg]?.[tR]||ty(e)||ny(e):!1}var bre=Mr[Zv][jg].toString(),nR=new WeakMap;function a5(e){if(!e||!dA(e))return!1;const t=Gu(e);if(t===null||t===Mr[Zv])return!0;const n=Mr.hasOwnProperty.call(t,jg)&&t[jg];if(n===Object)return!0;if(!xu(n))return!1;let r=nR.get(n);return r===void 0&&(r=Function.toString.call(n),nR.set(n,r)),r===bre}function Jv(e,t,n=!0){Zh(e)===0?(n?Reflect.ownKeys(e):Mr.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Zh(e){const t=e[Kn];return t?t.type_:ey(e)?1:ty(e)?2:ny(e)?3:0}var e1=(e,t,n=Zh(e))=>n===2?e.has(t):Mr[Zv].hasOwnProperty.call(e,t),iw=(e,t,n=Zh(e))=>n===2?e.get(t):e[t],zg=(e,t,n,r=Zh(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function xre(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var ey=Array.isArray,ty=e=>e instanceof Map,ny=e=>e instanceof Set,dA=e=>typeof e=="object",xu=e=>typeof e=="function",t1=e=>typeof e=="boolean";function Sre(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var ji=e=>e.copy_||e.base_,pA=e=>e.modified_?e.copy_:e.base_;function aw(e,t){if(ty(e))return new Map(e);if(ny(e))return new Set(e);if(ey(e))return Array[Zv].slice.call(e);const n=a5(e);if(t===!0||t==="class_only"&&!n){const r=Mr.getOwnPropertyDescriptors(e);delete r[Kn];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const l=i[a],s=r[l];s[Fm]===!1&&(s[Fm]=!0,s[rw]=!0),(s.get||s.set)&&(r[l]={[rw]:!0,[Fm]:!0,[Bg]:s[Bg],[Mh]:e[l]})}return Mr.create(Gu(e),r)}else{const r=Gu(e);if(r!==null&&n)return{...e};const i=Mr.create(r);return Mr.assign(i,e)}}function mA(e,t=!1){return ry(e)||Wa(e)||!xi(e)||(Zh(e)>1&&Mr.defineProperties(e,{set:dm,add:dm,clear:dm,delete:dm}),Mr.freeze(e),t&&Jv(e,(n,r)=>{mA(r,!0)},!1)),e}function wre(){fi(2)}var dm={[Mh]:wre};function ry(e){return e===null||!dA(e)?!0:Mr.isFrozen(e)}var $g="MapSet",lw="Patches",rR="ArrayMethods",l5={};function fs(e){const t=l5[e];return t||fi(0,e),t}var iR=e=>!!l5[e],Ph,o5=()=>Ph,Ore=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:iR($g)?fs($g):void 0,arrayMethodsPlugin_:iR(rR)?fs(rR):void 0});function aR(e,t){t&&(e.patchPlugin_=fs(lw),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ow(e){sw(e),e.drafts_.forEach(Are),e.drafts_=null}function sw(e){e===Ph&&(Ph=e.parent_)}var lR=e=>Ph=Ore(Ph,e);function Are(e){const t=e[Kn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function oR(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[Kn].modified_&&(ow(t),fi(4)),xi(e)&&(e=sR(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[Kn].base_,e,t)}else e=sR(t,n);return kre(t,e,!0),ow(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==i5?e:void 0}function sR(e,t){if(ry(t))return t;const n=t[Kn];if(!n)return Hg(t,e.handledSet_,e);if(!iy(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);c5(n,e)}return n.copy_}function kre(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&mA(t,n)}function s5(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var iy=(e,t)=>e.scope_===t,Cre=[];function u5(e,t,n,r){const i=ji(e),a=e.type_;if(r!==void 0&&iw(i,r,a)===t){zg(i,r,n,a);return}if(!e.draftLocations_){const s=e.draftLocations_=new Map;Jv(i,(c,f)=>{if(Wa(f)){const d=s.get(f)||[];d.push(c),s.set(f,d)}})}const l=e.draftLocations_.get(t)??Cre;for(const s of l)zg(i,s,n,a)}function Ere(e,t,n){e.callbacks_.push(function(i){const a=t;if(!a||!iy(a,i))return;i.mapSetPlugin_?.fixSetContents(a);const l=pA(a);u5(e,a.draft_??a,l,n),c5(a,i)})}function c5(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:r}=t;if(r){const i=r.getPath(e);i&&r.generatePatches_(e,i,t)}s5(e)}}function Tre(e,t,n){const{scope_:r}=e;if(Wa(n)){const i=n[Kn];iy(i,r)&&i.callbacks_.push(function(){qm(e);const l=pA(i);u5(e,n,l,t)})}else xi(n)&&e.callbacks_.push(function(){const a=ji(e);e.type_===3?a.has(n)&&Hg(n,r.handledSet_,r):iw(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Hg(iw(e.copy_,t,e.type_),r.handledSet_,r)})}function Hg(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Wa(e)||t.has(e)||!xi(e)||ry(e)||(t.add(e),Jv(e,(r,i)=>{if(Wa(i)){const a=i[Kn];if(iy(a,n)){const l=pA(a);zg(e,r,l,e.type_),s5(a)}}else xi(i)&&Hg(i,t,n)})),e}function Mre(e,t){const n=ey(e),r={type_:n?1:0,scope_:t?t.scope_:o5(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,a=Ug;n&&(i=[r],a=Dh);const{revoke:l,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=l,[s,r]}var Ug={get(e,t){if(t===Kn)return e;if(t==="constructor"||t==="__proto__"){const s=ji(e)[t];return new Proxy(s||{},{get:(c,f)=>f==="__proto__"||f==="prototype"?Object.freeze(Object.create(null)):Reflect.get(c,f),set:()=>!0,apply:(c,f,d)=>Reflect.apply(c,f,d)})}let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const i=ji(e);if(!e1(i,t,e.type_))return Pre(e,i,t);const a=i[t];if(e.finalized_||!xi(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Sre(t))return a;if(a===n1(e.base_,t)){qm(e);const l=e.type_===1?+t:t,s=cw(e.scope_,a,e,l);return e.copy_[l]=s}return a},has(e,t){return t==="constructor"||t==="__proto__"||t==="prototype"?!1:t in ji(e)},ownKeys(e){return Reflect.ownKeys(ji(e))},set(e,t,n){if(t==="constructor"||t==="__proto__"||t==="prototype")return!0;const r=f5(ji(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=n1(ji(e),t),a=i?.[Kn];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(xre(n,i)&&(n!==void 0||e1(e.base_,t,e.type_)))return!0;qm(e),uw(e)}return e.copy_[t]===n&&(n!==void 0||e1(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),Tre(e,t,n)),!0},deleteProperty(e,t){return qm(e),n1(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),uw(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=ji(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Fm]:!0,[rw]:e.type_!==1||t!=="length",[Bg]:r[Bg],[Mh]:n[t]}},defineProperty(){fi(11)},getPrototypeOf(e){return Gu(e.base_)},setPrototypeOf(){fi(12)}},Dh={};for(let e in Ug){let t=Ug[e];Dh[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Dh.deleteProperty=function(e,t){return Dh.set.call(this,e,t,void 0)};Dh.set=function(e,t,n){return Ug.set.call(this,e[0],t,n,e[0])};function n1(e,t){const n=e[Kn];return(n?ji(n):e)[t]}function Pre(e,t,n){const r=f5(t,n);return r?Mh in r?r[Mh]:r.get?.call(e.draft_):void 0}function f5(e,t){if(!(t in e))return;let n=Gu(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Gu(n)}}function uw(e){e.modified_||(e.modified_=!0,e.parent_&&uw(e.parent_))}function qm(e){e.copy_||(e.assigned_=new Map,e.copy_=aw(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Dre=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,n,r)=>{if(xu(t)&&!xu(n)){const a=n;n=t;const l=this;return function(c=a,...f){return l.produce(c,d=>n.call(this,d,...f))}}xu(n)||fi(6),r!==void 0&&!xu(r)&&fi(7);let i;if(xi(t)){const a=lR(this),l=cw(a,t,void 0);let s=!0;try{i=n(l),s=!1}finally{s?ow(a):sw(a)}return aR(a,r),oR(i,a)}else if(!t||!dA(t)){if(i=n(t),i===void 0&&(i=t),i===i5&&(i=void 0),this.autoFreeze_&&mA(i,!0),r){const a=[],l=[];fs(lw).generateReplacementPatches_(t,i,{patches_:a,inversePatches_:l}),r(a,l)}return i}else fi(1,t)},this.produceWithPatches=(t,n)=>{if(xu(t))return(l,...s)=>this.produceWithPatches(l,c=>t(c,...s));let r,i;return[this.produce(t,n,(l,s)=>{r=l,i=s}),r,i]},t1(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),t1(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),t1(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){xi(e)||fi(8),Wa(e)&&(e=Gr(e));const t=lR(this),n=cw(t,e,void 0);return n[Kn].isManual_=!0,sw(t),n}finishDraft(e,t){const n=e&&e[Kn];(!n||!n.isManual_)&&fi(9);const{scope_:r}=n;return aR(r,t),oR(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=fs(lw).applyPatches_;return Wa(e)?r(e,t):this.produce(e,i=>r(i,t))}};function cw(e,t,n,r){const[i,a]=ty(t)?fs($g).proxyMap_(t,n):ny(t)?fs($g).proxySet_(t,n):Mre(t,n);return(n?.scope_??o5()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?Ere(n,a,r):a.callbacks_.push(function(c){c.mapSetPlugin_?.fixSetContents(a);const{patchPlugin_:f}=c;a.modified_&&f&&f.generatePatches_(a,[],c)}),i}function Gr(e){return Wa(e)||fi(10,e),h5(e)}function h5(e){if(!xi(e)||ry(e))return e;const t=e[Kn];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=aw(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=aw(e,!0);return Jv(n,(i,a)=>{zg(n,i,h5(a))},r),t&&(t.finalized_=!1),n}var Rre=new Dre,d5=Rre.produce,Ye=e=>e;function p5(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var _re=p5(),Nre=p5,Ire=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Lg:Lg.apply(null,arguments)};function _r(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(Pr(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>r5(r)&&r.type===e,n}var m5=class zf extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,zf.prototype)}static get[Symbol.species](){return zf}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new zf(...t[0].concat(this)):new zf(...t.concat(this))}};function uR(e){return xi(e)?d5(e,()=>{}):e}function pm(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function Lre(e){return typeof e=="boolean"}var jre=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let l=new m5;return n&&(Lre(n)?l.push(_re):l.push(Nre(n.extraArgument))),l},g5="RTK_autoBatch",bt=()=>e=>({payload:e,meta:{[g5]:!0}}),cR=e=>t=>{setTimeout(t,e)},Bre=(e,t)=>n=>{let r=!1;const i=()=>{r||(r=!0,cancelAnimationFrame(a),clearTimeout(l),n())},a=e(i),l=setTimeout(i,t)},v5=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,a=!1,l=!1;const s=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?Bre(window.requestAnimationFrame,100):cR(10):e.type==="callback"?e.queueNotification:cR(e.timeout),f=()=>{l=!1,a&&(a=!1,s.forEach(d=>d()))};return Object.assign({},r,{subscribe(d){const p=()=>i&&d(),g=r.subscribe(p);return s.add(d),()=>{g(),s.delete(d)}},dispatch(d){try{return i=!d?.meta?.[g5],a=!i,a&&(l||(l=!0,c(f))),r.dispatch(d)}finally{i=!0}}})},zre=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new m5(e);return r&&i.push(v5(typeof r=="object"?r:void 0)),i};function $re(e){const t=jre(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:a=void 0,enhancers:l=void 0}=e||{};let s;if(typeof n=="function")s=n;else if(hA(n))s=n5(n);else throw new Error(Pr(1));let c;typeof r=="function"?c=r(t):c=t();let f=Lg;i&&(f=Ire({trace:!1,...typeof i=="object"&&i}));const d=yre(...c),p=zre(d);let g=typeof l=="function"?l(p):p();const v=f(...g);return t5(s,a,v)}function y5(e){const t={},n=[];let r;const i={addCase(a,l){const s=typeof a=="string"?a:a.type;if(!s)throw new Error(Pr(28));if(s in t)throw new Error(Pr(29));return t[s]=l,i},addAsyncThunk(a,l){return l.pending&&(t[a.pending.type]=l.pending),l.rejected&&(t[a.rejected.type]=l.rejected),l.fulfilled&&(t[a.fulfilled.type]=l.fulfilled),l.settled&&n.push({matcher:a.settled,reducer:l.settled}),i},addMatcher(a,l){return n.push({matcher:a,reducer:l}),i},addDefaultCase(a){return r=a,i}};return e(i),[t,n,r]}function Hre(e){return typeof e=="function"}function Ure(e,t){let[n,r,i]=y5(t),a;if(Hre(e))a=()=>uR(e());else{const s=uR(e);a=()=>s}function l(s=a(),c){let f=[n[c.type],...r.filter(({matcher:d})=>d(c)).map(({reducer:d})=>d)];return f.filter(d=>!!d).length===0&&(f=[i]),f.reduce((d,p)=>{if(p)if(Wa(d)){const v=p(d,c);return v===void 0?d:v}else{if(xi(d))return d5(d,g=>p(g,c));{const g=p(d,c);if(g===void 0){if(d===null)return d;throw Error("A case reducer on a non-draftable value must not return undefined")}return g}}return d},s)}return l.getInitialState=a,l}var Fre="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",qre=(e=21)=>{let t="",n=e;for(;n--;)t+=Fre[Math.random()*64|0];return t},Wre=Symbol.for("rtk-slice-createasyncthunk");function Vre(e,t){return`${e}/${t}`}function Kre({creators:e}={}){const t=e?.asyncThunk?.[Wre];return function(r){const{name:i,reducerPath:a=i}=r;if(!i)throw new Error(Pr(11));const l=(typeof r.reducers=="function"?r.reducers(Qre()):r.reducers)||{},s=Object.keys(l),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(E,P){const T=typeof E=="string"?E:E.type;if(!T)throw new Error(Pr(12));if(T in c.sliceCaseReducersByType)throw new Error(Pr(13));return c.sliceCaseReducersByType[T]=P,f},addMatcher(E,P){return c.sliceMatchers.push({matcher:E,reducer:P}),f},exposeAction(E,P){return c.actionCreators[E]=P,f},exposeCaseReducer(E,P){return c.sliceCaseReducersByName[E]=P,f}};s.forEach(E=>{const P=l[E],T={reducerName:E,type:Vre(i,E),createNotation:typeof r.reducers=="function"};Gre(P)?Jre(T,P,f,t):Yre(T,P,f)});function d(){const[E={},P=[],T=void 0]=typeof r.extraReducers=="function"?y5(r.extraReducers):[r.extraReducers],M={...E,...c.sliceCaseReducersByType};return Ure(r.initialState,R=>{for(let L in M)R.addCase(L,M[L]);for(let L of c.sliceMatchers)R.addMatcher(L.matcher,L.reducer);for(let L of P)R.addMatcher(L.matcher,L.reducer);T&&R.addDefaultCase(T)})}const p=E=>E,g=new Map,v=new WeakMap;let y;function x(E,P){return y||(y=d()),y(E,P)}function w(){return y||(y=d()),y.getInitialState()}function A(E,P=!1){function T(R){let L=R[E];return typeof L>"u"&&P&&(L=pm(v,T,w)),L}function M(R=p){const L=pm(g,P,()=>new WeakMap);return pm(L,R,()=>{const H={};for(const[K,V]of Object.entries(r.selectors??{}))H[K]=Xre(V,R,()=>pm(v,R,w),P);return H})}return{reducerPath:E,getSelectors:M,get selectors(){return M(T)},selectSlice:T}}const k={name:i,reducer:x,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:w,...A(a),injectInto(E,{reducerPath:P,...T}={}){const M=P??a;return E.inject({reducerPath:M,reducer:x},T),{...k,...A(M,!0)}}};return k}}function Xre(e,t,n,r){function i(a,...l){let s=t(a);return typeof s>"u"&&r&&(s=n()),e(s,...l)}return i.unwrapped=e,i}var Ln=Kre();function Qre(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function Yre({type:e,reducerName:t,createNotation:n},r,i){let a,l;if("reducer"in r){if(n&&!Zre(r))throw new Error(Pr(17));a=r.reducer,l=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,l?_r(e,l):_r(e))}function Gre(e){return e._reducerDefinitionType==="asyncThunk"}function Zre(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Jre({type:e,reducerName:t},n,r,i){if(!i)throw new Error(Pr(18));const{payloadCreator:a,fulfilled:l,pending:s,rejected:c,settled:f,options:d}=n,p=i(e,a,d);r.exposeAction(t,p),l&&r.addCase(p.fulfilled,l),s&&r.addCase(p.pending,s),c&&r.addCase(p.rejected,c),f&&r.addMatcher(p.settled,f),r.exposeCaseReducer(t,{fulfilled:l||mm,pending:s||mm,rejected:c||mm,settled:f||mm})}function mm(){}var eie="task",b5="listener",x5="completed",gA="cancelled",tie=`task-${gA}`,nie=`task-${x5}`,fw=`${b5}-${gA}`,rie=`${b5}-${x5}`,ay=class{constructor(e){this.code=e,this.message=`${eie} ${gA} (reason: ${e})`}code;name="TaskAbortError";message},vA=(e,t)=>{if(typeof e!="function")throw new TypeError(Pr(32))},Fg=()=>{},S5=(e,t=Fg)=>(e.catch(t),e),w5=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Zo=e=>{if(e.aborted)throw new ay(e.reason)};function O5(e,t){let n=Fg;return new Promise((r,i)=>{const a=()=>i(new ay(e.reason));if(e.aborted){a();return}n=w5(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Fg})}var iie=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof ay?"cancelled":"rejected",error:n}}finally{t?.()}},qg=e=>t=>S5(O5(e,t).then(n=>(Zo(e),n))),A5=e=>{const t=qg(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:ju}=Object,fR={},ly="listenerMiddleware",aie=(e,t)=>{const n=r=>w5(e,()=>r.abort(e.reason));return(r,i)=>{vA(r);const a=new AbortController;n(a);const l=iie(async()=>{Zo(e),Zo(a.signal);const s=await r({pause:qg(a.signal),delay:A5(a.signal),signal:a.signal});return Zo(a.signal),s},()=>a.abort(nie));return i?.autoJoin&&t.push(l.catch(Fg)),{result:qg(e)(l),cancel(){a.abort(tie)}}}},lie=(e,t)=>{const n=async(r,i)=>{Zo(t);let a=()=>{};const s=[new Promise((c,f)=>{let d=e({predicate:r,effect:(p,g)=>{g.unsubscribe(),c([p,g.getState(),g.getOriginalState()])}});a=()=>{d(),f()}})];i!=null&&s.push(new Promise(c=>setTimeout(c,i,null)));try{const c=await O5(t,Promise.race(s));return Zo(t),c}finally{a()}};return((r,i)=>S5(n(r,i)))},k5=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=_r(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(Pr(21));return vA(a),{predicate:i,type:t,effect:a}},C5=ju(e=>{const{type:t,predicate:n,effect:r}=k5(e);return{id:qre(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Pr(22))}}},{withTypes:()=>C5}),hR=(e,t)=>{const{type:n,effect:r,predicate:i}=k5(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},hw=e=>{e.pending.forEach(t=>{t.abort(fw)})},oie=(e,t)=>()=>{for(const n of t.keys())hw(n);e.clear()},dR=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},E5=ju(_r(`${ly}/add`),{withTypes:()=>E5}),sie=_r(`${ly}/removeAll`),T5=ju(_r(`${ly}/remove`),{withTypes:()=>T5}),uie=(...e)=>{console.error(`${ly}/error`,...e)},Jh=(e={})=>{const t=new Map,n=new Map,r=v=>{const y=n.get(v)??0;n.set(v,y+1)},i=v=>{const y=n.get(v)??1;y===1?n.delete(v):n.set(v,y-1)},{extra:a,onError:l=uie}=e;vA(l);const s=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),y=>{v.unsubscribe(),y?.cancelActive&&hw(v)}),c=(v=>{const y=hR(t,v)??C5(v);return s(y)});ju(c,{withTypes:()=>c});const f=v=>{const y=hR(t,v);return y&&(y.unsubscribe(),v.cancelActive&&hw(y)),!!y};ju(f,{withTypes:()=>f});const d=async(v,y,x,w)=>{const A=new AbortController,k=lie(c,A.signal),E=[];try{v.pending.add(A),r(v),await Promise.resolve(v.effect(y,ju({},x,{getOriginalState:w,condition:(P,T)=>k(P,T).then(Boolean),take:k,delay:A5(A.signal),pause:qg(A.signal),extra:a,signal:A.signal,fork:aie(A.signal,E),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((P,T,M)=>{P!==A&&(P.abort(fw),M.delete(P))})},cancel:()=>{A.abort(fw),v.pending.delete(A)},throwIfCancelled:()=>{Zo(A.signal)}})))}catch(P){P instanceof ay||dR(l,P,{raisedBy:"effect"})}finally{await Promise.all(E),A.abort(rie),i(v),v.pending.delete(A)}},p=oie(t,n);return{middleware:v=>y=>x=>{if(!r5(x))return y(x);if(E5.match(x))return c(x.payload);if(sie.match(x)){p();return}if(T5.match(x))return f(x.payload);let w=v.getState();const A=()=>{if(w===fR)throw new Error(Pr(23));return w};let k;try{if(k=y(x),t.size>0){const E=v.getState(),P=Array.from(t.values());for(const T of P){let M=!1;try{M=T.predicate(x,E,w)}catch(R){M=!1,dR(l,R,{raisedBy:"predicate"})}M&&d(T,x,v,A)}}}finally{w=fR}return k},startListening:c,stopListening:f,clearListeners:p}};function Pr(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var cie={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},M5=Ln({name:"chartLayout",initialState:cie,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var n,r,i,a;e.margin.top=(n=t.payload.top)!==null&&n!==void 0?n:0,e.margin.right=(r=t.payload.right)!==null&&r!==void 0?r:0,e.margin.bottom=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(a=t.payload.left)!==null&&a!==void 0?a:0},setScale(e,t){e.scale=t.payload}}}),oy=M5.actions,fie=oy.setMargin,hie=oy.setLayout,die=oy.setChartSize,pie=oy.setScale,mie=M5.reducer;function P5(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function Ve(e){return Number.isFinite(e)}function Ji(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function pR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ku(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pR(Object(n),!0).forEach(function(r){gie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gie(e,t,n){return(t=vie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vie(e){var t=yie(e,"string");return typeof t=="symbol"?t:t+""}function yie(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Bt(e,t,n){return kt(e)||kt(t)?n:Zi(t)?qa(e,t,n):typeof t=="function"?t(e):n}var bie=(e,t,n)=>{if(t&&n){var r=n.width,i=n.height,a=t.align,l=t.verticalAlign,s=t.layout;if((s==="vertical"||s==="horizontal"&&l==="middle")&&a!=="center"&&be(e[a]))return ku(ku({},e),{},{[a]:e[a]+(r||0)});if((s==="horizontal"||s==="vertical"&&a==="center")&&l!=="middle"&&be(e[l]))return ku(ku({},e),{},{[l]:e[l]+(i||0)})}return e},Ya=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",D5=(e,t,n,r)=>{if(r)return e.map(s=>s.coordinate);var i,a,l=e.map(s=>(s.coordinate===t&&(i=!0),s.coordinate===n&&(a=!0),s.coordinate));return i||l.push(t),a||l.push(n),l},R5=(e,t,n)=>{if(!e)return null;var r=e.duplicateDomain,i=e.type,a=e.range,l=e.scale,s=e.realScaleType,c=e.isCategorical,f=e.categoricalDomain,d=e.tickCount,p=e.ticks,g=e.niceTicks,v=e.axisType;if(!l)return null;var y=s==="scaleBand"&&l.bandwidth?l.bandwidth()/2:2,x=i==="category"&&l.bandwidth?l.bandwidth()/y:0;if(x=v==="angleAxis"&&a&&a.length>=2?or(a[0]-a[1])*2*x:x,p||g){var w=(p||g||[]).map((A,k)=>{var E=r?r.indexOf(A):A,P=l.map(E);return Ve(P)?{coordinate:P+x,value:A,offset:x,index:k}:null}).filter(sr);return w}return c&&f?f.map((A,k)=>{var E=l.map(A);return Ve(E)?{coordinate:E+x,value:A,index:k,offset:x}:null}).filter(sr):l.ticks&&d!=null?l.ticks(d).map((A,k)=>{var E=l.map(A);return Ve(E)?{coordinate:E+x,value:A,index:k,offset:x}:null}).filter(sr):l.domain().map((A,k)=>{var E=l.map(A);return Ve(E)?{coordinate:E+x,value:r?r[A]:A,index:k,offset:x}:null}).filter(sr)},xie=(e,t)=>{if(!t||t.length!==2||!be(t[0])||!be(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!be(e[0])||e[0]<n)&&(i[0]=n),(!be(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},Sie=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,l=0,s=0;s<n;++s){var c=e[s],f=c?.[i];if(f!=null){var d=f[1],p=f[0],g=Gi(d)?p:d;g>=0?(f[0]=a,a+=g,f[1]=a):(f[0]=l,l+=g,f[1]=l)}}}},wie=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,l=0;l<n;++l){var s=e[l],c=s?.[i];if(c!=null){var f=Gi(c[1])?c[0]:c[1];f>=0?(c[0]=a,a+=f,c[1]=a):(c[0]=0,c[1]=0)}}}},Oie={sign:Sie,expand:Ste,none:us,silhouette:wte,wiggle:Ote,positive:wie},Aie=(e,t,n)=>{var r,i=(r=Oie[n])!==null&&r!==void 0?r:us,a=xte().keys(t).value((s,c)=>Number(Bt(s,c,0))).order(GS).offset(i),l=a(e);return l.forEach((s,c)=>{s.forEach((f,d)=>{var p=Bt(e[d],t[c],0);Array.isArray(p)&&p.length===2&&be(p[0])&&be(p[1])&&(f[0]=p[0],f[1]=p[1])})}),l};function kie(e){return e==null?void 0:String(e)}function mR(e){var t=e.axis,n=e.ticks,r=e.bandSize,i=e.entry,a=e.index,l=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!kt(i[t.dataKey])){var s=_z(n,"value",i[t.dataKey]);if(s)return s.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var c=Bt(i,kt(l)?t.dataKey:l),f=t.scale.map(c);return be(f)?f:null}var gR=e=>{var t=e.axis,n=e.ticks,r=e.offset,i=e.bandSize,a=e.entry,l=e.index;if(t.type==="category")return n[l]?n[l].coordinate+r:null;var s=Bt(a,t.dataKey,t.scale.domain()[l]);if(kt(s))return null;var c=t.scale.map(s);return be(c)?c-i/2+r:null},Cie=e=>{var t=e.numericAxis,n=t.scale.domain();if(t.type==="number"){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},Eie=e=>{var t=e.flat(2).filter(be);return[Math.min(...t),Math.max(...t)]},Tie=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],Mie=(e,t,n)=>{if(!(e==null||Object.keys(e).length===0))return Tie(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var l=a.stackedData,s=l.reduce((c,f)=>{var d=P5(f,t,n),p=Eie(d);return!Ve(p[0])||!Ve(p[1])?c:[Math.min(c[0],p[0]),Math.max(c[1],p[1])]},[1/0,-1/0]);return[Math.min(s[0],r[0]),Math.max(s[1],r[1])]},[1/0,-1/0]))},vR=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,yR=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Zu=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=Gv(t,d=>d.coordinate),a=1/0,l=1,s=i.length;l<s;l++){var c=i[l],f=i[l-1];a=Math.min((c?.coordinate||0)-(f?.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0};function bR(e){var t=e.tooltipEntrySettings,n=e.dataKey,r=e.payload,i=e.value,a=e.name;return ku(ku({},t),{},{dataKey:n,payload:r,value:i,name:a})}function sy(e,t){if(e!=null)return String(e);if(typeof t=="string")return t}var Pie=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},Die=(e,t)=>t==="centric"?e.angle:e.radius,Ga=e=>e.layout.width,Za=e=>e.layout.height,Rie=e=>e.layout.scale,_5=e=>e.layout.margin,uy=q(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),cy=q(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),_ie="data-recharts-item-index",Nie="data-recharts-item-id",ed=60;function xR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function gm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xR(Object(n),!0).forEach(function(r){Iie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Iie(e,t,n){return(t=Lie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lie(e){var t=jie(e,"string");return typeof t=="symbol"?t:t+""}function jie(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Bie=e=>e.brush.height;function zie(e){var t=cy(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:ed;return n+i}return n},0)}function $ie(e){var t=cy(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:ed;return n+i}return n},0)}function Hie(e){var t=uy(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function Uie(e){var t=uy(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var un=q([Ga,Za,_5,Bie,zie,$ie,Hie,Uie,Jz,lre],(e,t,n,r,i,a,l,s,c,f)=>{var d={left:(n.left||0)+i,right:(n.right||0)+a},p={top:(n.top||0)+l,bottom:(n.bottom||0)+s},g=gm(gm({},p),d),v=g.bottom;g.bottom+=r,g=bie(g,c,f);var y=e-g.left-g.right,x=t-g.top-g.bottom;return gm(gm({brushBottom:v},g),{},{width:Math.max(y,0),height:Math.max(x,0)})}),Fie=q(un,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),yA=q(Ga,Za,(e,t)=>({x:0,y:0,width:e,height:t})),qie=O.createContext(null),jn=()=>O.useContext(qie)!=null,fy=e=>e.brush,hy=q([fy,un,_5],(e,t,n)=>({height:e.height,x:be(e.x)?e.x:t.left,y:be(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:be(e.width)?e.width:t.width}));function Wie(e,t,{signal:n,edges:r}={}){let i,a=null;const l=r!=null&&r.includes("leading"),s=r==null||r.includes("trailing"),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},f=()=>{s&&c(),v()};let d=null;const p=()=>{d!=null&&clearTimeout(d),d=setTimeout(()=>{d=null,f()},t)},g=()=>{d!==null&&(clearTimeout(d),d=null)},v=()=>{g(),i=void 0,a=null},y=()=>{c()},x=function(...w){if(n?.aborted)return;i=this,a=w;const A=d==null;p(),l&&A&&c()};return x.schedule=p,x.cancel=v,x.flush=y,n?.addEventListener("abort",v,{once:!0}),x}function Vie(e,t=0,n={}){typeof n!="object"&&(n={});const{leading:r=!1,trailing:i=!0,maxWait:a}=n,l=Array(2);r&&(l[0]="leading"),i&&(l[1]="trailing");let s,c=null;const f=Wie(function(...g){s=e.apply(this,g),c=null},t,{edges:l}),d=function(...g){return a!=null&&(c===null&&(c=Date.now()),Date.now()-c>=a)?(s=e.apply(this,g),c=Date.now(),f.cancel(),f.schedule(),s):(f.apply(this,g),s)},p=()=>(f.flush(),s);return d.cancel=f.cancel,d.flush=p,d}function Kie(e,t=0,n={}){const{leading:r=!0,trailing:i=!0}=n;return Vie(e,t,{leading:r,maxWait:t,trailing:i})}var Wg=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];if(typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=0;console.warn(n.replace(/%s/g,()=>i[l++]))}},Wi={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},N5=(e,t,n)=>{var r=n.width,i=r===void 0?Wi.width:r,a=n.height,l=a===void 0?Wi.height:a,s=n.aspect,c=n.maxHeight,f=cs(i)?e:Number(i),d=cs(l)?t:Number(l);return s&&s>0&&(f?d=f/s:d&&(f=d*s),c&&d!=null&&d>c&&(d=c)),{calculatedWidth:f,calculatedHeight:d}},Xie={width:0,height:0,overflow:"visible"},Qie={width:0,overflowX:"visible"},Yie={height:0,overflowY:"visible"},Gie={},Zie=e=>{var t=e.width,n=e.height,r=cs(t),i=cs(n);return r&&i?Xie:r?Qie:i?Yie:Gie};function Jie(e){var t=e.width,n=e.height,r=e.aspect,i=t,a=n;return i===void 0&&a===void 0?(i=Wi.width,a=Wi.height):i===void 0?i=r&&r>0?void 0:Wi.width:a===void 0&&(a=r&&r>0?void 0:Wi.height),{width:i,height:a}}var eae=["aspect","initialDimension","width","height","minWidth","minHeight","maxHeight","children","debounce","id","className","onResize","style"];function Vg(){return Vg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vg.apply(null,arguments)}function SR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SR(Object(n),!0).forEach(function(r){tae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tae(e,t,n){return(t=nae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nae(e){var t=rae(e,"string");return typeof t=="symbol"?t:t+""}function rae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function iae(e,t){return sae(e)||oae(e,t)||lae(e,t)||aae()}function aae(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
71
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lae(e,t){if(e){if(typeof e=="string")return OR(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?OR(e,t):void 0}}function OR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function oae(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function sae(e){if(Array.isArray(e))return e}function uae(e,t){if(e==null)return{};var n,r,i=cae(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function cae(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var I5=O.createContext(Wi.initialDimension);function fae(e){return Ji(e.width)&&Ji(e.height)}function L5(e){var t=e.children,n=e.width,r=e.height,i=O.useMemo(()=>({width:n,height:r}),[n,r]);return fae(i)?O.createElement(I5.Provider,{value:i},t):null}var bA=()=>O.useContext(I5),hae=O.forwardRef((e,t)=>{var n=e.aspect,r=e.initialDimension,i=r===void 0?Wi.initialDimension:r,a=e.width,l=e.height,s=e.minWidth,c=s===void 0?Wi.minWidth:s,f=e.minHeight,d=e.maxHeight,p=e.children,g=e.debounce,v=g===void 0?Wi.debounce:g,y=e.id,x=e.className,w=e.onResize,A=e.style,k=A===void 0?{}:A,E=uae(e,eae),P=O.useRef(null),T=O.useRef();T.current=w,O.useImperativeHandle(t,()=>P.current);var M=O.useState({containerWidth:i.width,containerHeight:i.height}),R=iae(M,2),L=R[0],H=R[1],K=O.useCallback((z,G)=>{H(ne=>{var ce=Math.round(z),fe=Math.round(G);return ne.containerWidth===ce&&ne.containerHeight===fe?ne:{containerWidth:ce,containerHeight:fe}})},[]);O.useEffect(()=>{if(P.current==null||typeof ResizeObserver>"u")return vs;var z=N=>{var X,re=N[0];if(re!=null){var le=re.contentRect,ge=le.width,Oe=le.height;K(ge,Oe),(X=T.current)===null||X===void 0||X.call(T,ge,Oe)}};v>0&&(z=Kie(z,v,{trailing:!0,leading:!1}));var G=new ResizeObserver(z),ne=P.current.getBoundingClientRect(),ce=ne.width,fe=ne.height;return K(ce,fe),G.observe(P.current),()=>{G.disconnect()}},[K,v]);var V=L.containerWidth,B=L.containerHeight;Wg(!n||n>0,"The aspect(%s) must be greater than zero.",n);var ae=N5(V,B,{width:a,height:l,aspect:n,maxHeight:d}),ie=ae.calculatedWidth,oe=ae.calculatedHeight;return Wg(V<0||B<0||ie!=null&&ie>0||oe!=null&&oe>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
72
|
+
please check the style of container, or the props width(%s) and height(%s),
|
|
73
|
+
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
74
|
+
height and width.`,ie,oe,a,l,c,f,n),O.createElement("div",Vg({id:y?"".concat(y):void 0,className:st("recharts-responsive-container",x),style:wR(wR({},k),{},{width:a,height:l,minWidth:c,minHeight:f,maxHeight:d}),ref:P},E),O.createElement("div",{style:Zie({width:a,height:l})},O.createElement(L5,{width:ie,height:oe},p)))}),AR=O.forwardRef((e,t)=>{var n=bA();if(Ji(n.width)&&Ji(n.height))return e.children;var r=Jie({width:e.width,height:e.height,aspect:e.aspect}),i=r.width,a=r.height,l=N5(void 0,void 0,{width:i,height:a,aspect:e.aspect,maxHeight:e.maxHeight}),s=l.calculatedWidth,c=l.calculatedHeight;return be(s)&&be(c)?O.createElement(L5,{width:s,height:c},e.children):O.createElement(hae,Vg({},e,{width:i,height:a,ref:t}))});function xA(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var dy=()=>{var e,t=jn(),n=we(Fie),r=we(hy),i=(e=we(fy))===null||e===void 0?void 0:e.padding;return!t||!r||!i?n:{width:r.width-i.left-i.right,height:r.height-i.top-i.bottom,x:i.left,y:i.top}},dae={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},j5=()=>{var e;return(e=we(un))!==null&&e!==void 0?e:dae},SA=()=>we(Ga),wA=()=>we(Za),pae=()=>we(e=>e.layout.margin),nt=e=>e.layout.layoutType,ys=()=>we(nt),B5=()=>{var e=ys();if(e==="horizontal"||e==="vertical")return e},z5=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},mae=()=>{var e=ys();return e!==void 0},td=e=>{var t=St(),n=jn(),r=e.width,i=e.height,a=bA(),l=r,s=i;return a&&(l=a.width>0?a.width:r,s=a.height>0?a.height:i),O.useEffect(()=>{!n&&Ji(l)&&Ji(s)&&t(die({width:l,height:s}))},[t,n,l,s]),null},gae={settings:{layout:"horizontal",align:"center",verticalAlign:"bottom",itemSorter:"value"},size:{width:0,height:0},payload:[]},$5=Ln({name:"legend",initialState:gae,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(Ye(t.payload))},prepare:bt()},replaceLegendPayload:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=Gr(e).payload.indexOf(Ye(r));a>-1&&(e.payload[a]=Ye(i))},prepare:bt()},removeLegendPayload:{reducer(e,t){var n=Gr(e).payload.indexOf(Ye(t.payload));n>-1&&e.payload.splice(n,1)},prepare:bt()}}}),nd=$5.actions,kR=nd.setLegendSize,vae=nd.setLegendSettings,yae=nd.addLegendPayload,bae=nd.replaceLegendPayload,xae=nd.removeLegendPayload,Sae=$5.reducer,r1={exports:{}},i1={};var CR;function wae(){if(CR)return i1;CR=1;var e=ac();function t(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,i=e.useRef,a=e.useEffect,l=e.useMemo,s=e.useDebugValue;return i1.useSyncExternalStoreWithSelector=function(c,f,d,p,g){var v=i(null);if(v.current===null){var y={hasValue:!1,value:null};v.current=y}else y=v.current;v=l(function(){function w(T){if(!A){if(A=!0,k=T,T=p(T),g!==void 0&&y.hasValue){var M=y.value;if(g(M,T))return E=M}return E=T}if(M=E,n(k,T))return M;var R=p(T);return g!==void 0&&g(M,R)?(k=T,M):(k=T,E=R)}var A=!1,k,E,P=d===void 0?null:d;return[function(){return w(f())},P===null?void 0:function(){return w(P())}]},[f,d,p,g]);var x=r(c,v[0],v[1]);return a(function(){y.hasValue=!0,y.value=x},[x]),s(x),x},i1}var ER;function Oae(){return ER||(ER=1,r1.exports=wae()),r1.exports}Oae();function Aae(e){e()}function kae(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Aae(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var TR={notify(){},get:()=>[]};function Cae(e,t){let n,r=TR,i=0,a=!1;function l(x){d();const w=r.subscribe(x);let A=!1;return()=>{A||(A=!0,w(),p())}}function s(){r.notify()}function c(){y.onStateChange&&y.onStateChange()}function f(){return a}function d(){i++,n||(n=e.subscribe(c),r=kae())}function p(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=TR)}function g(){a||(a=!0,d())}function v(){a&&(a=!1,p())}const y={addNestedSub:l,notifyNestedSubs:s,handleChangeWrapper:c,isSubscribed:f,trySubscribe:g,tryUnsubscribe:v,getListeners:()=>r};return y}var Eae=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Tae=Eae(),Mae=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Pae=Mae(),Dae=()=>Tae||Pae?O.useLayoutEffect:O.useEffect,Rae=Dae();function MR(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function _ae(e,t){if(MR(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!MR(e[n[i]],t[n[i]]))return!1;return!0}var Nae=Symbol.for("react-redux-context"),Iae=typeof globalThis<"u"?globalThis:{};function Lae(){if(!O.createContext)return{};const e=Iae[Nae]??=new Map;let t=e.get(O.createContext);return t||(t=O.createContext(null),e.set(O.createContext,t)),t}var jae=Lae();function Bae(e){const{children:t,context:n,serverState:r,store:i}=e,a=O.useMemo(()=>{const c=Cae(i);return{store:i,subscription:c,getServerState:r?()=>r:void 0}},[i,r]),l=O.useMemo(()=>i.getState(),[i]);Rae(()=>{const{subscription:c}=a;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),l!==i.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[a,l]);const s=n||jae;return O.createElement(s.Provider,{value:a},t)}var zae=Bae,$ae=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function Hae(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function dc(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if($ae.has(r)){if(e[r]==null&&t[r]==null)continue;if(!_ae(e[r],t[r]))return!1}else if(!Hae(e[r],t[r]))return!1;return!0}var Uae=["contextPayload"];function dw(){return dw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dw.apply(null,arguments)}function Fae(e,t){return Kae(e)||Vae(e,t)||Wae(e,t)||qae()}function qae(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
75
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wae(e,t){if(e){if(typeof e=="string")return PR(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?PR(e,t):void 0}}function PR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Vae(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function Kae(e){if(Array.isArray(e))return e}function DR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ju(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DR(Object(n),!0).forEach(function(r){Xae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xae(e,t,n){return(t=Qae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qae(e){var t=Yae(e,"string");return typeof t=="symbol"?t:t+""}function Yae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Gae(e,t){if(e==null)return{};var n,r,i=Zae(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Zae(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Jae(e){return e.value}function ele(e){var t=e.contextPayload,n=Gae(e,Uae),r=Qz(t,e.payloadUniqBy,Jae),i=Ju(Ju({},n),{},{payload:r});return O.isValidElement(e.content)?O.cloneElement(e.content,i):typeof e.content=="function"?O.createElement(e.content,i):O.createElement(Qte,i)}function tle(e,t,n,r,i,a){var l=t.layout,s=t.align,c=t.verticalAlign,f,d;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(s==="center"&&l==="vertical"?f={left:((r||0)-a.width)/2}:f=s==="right"?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(c==="middle"?d={top:((i||0)-a.height)/2}:d=c==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),Ju(Ju({},f),d)}function nle(e){var t=e.align,n=e.layout,r=e.verticalAlign,i=e.itemSorter,a=St();return O.useLayoutEffect(()=>{a(vae({align:t,layout:n,verticalAlign:r,itemSorter:i}))},[a,t,n,r,i]),null}function rle(e){var t=e.width,n=e.height,r=St();return O.useLayoutEffect(()=>{r(kR({width:t,height:n}))},[r,t,n]),O.useLayoutEffect(()=>()=>{r(kR({width:0,height:0}))},[r]),null}function ile(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var ale={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",labelStyle:{},layout:"horizontal",verticalAlign:"bottom"};function lle(e){var t=In(e,ale),n=ure(),r=qee(),i=pae(),a=t.width,l=t.height,s=t.wrapperStyle,c=t.portal,f=e5([n]),d=Fae(f,2),p=d[0],g=d[1],v=SA(),y=wA();if(v==null||y==null)return null;var x=v-(i?.left||0)-(i?.right||0),w=ile(t.layout,l,a,x),A=c?s:Ju(Ju({position:"absolute",width:w?.width||a||"auto",height:w?.height||l||"auto"},tle(s,t,i,v,y,p)),s),k=c??r;if(k==null||n==null)return null;var E=O.createElement("div",{className:"recharts-legend-wrapper",style:A,ref:g},O.createElement(nle,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!c&&O.createElement(rle,{width:p.width,height:p.height}),O.createElement(ele,dw({},t,w,{margin:i,chartWidth:v,chartHeight:y,contextPayload:n})));return nO.createPortal(E,k)}var H5=O.memo(lle,dc);H5.displayName="Legend";function pw(){return pw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pw.apply(null,arguments)}function RR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function kf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RR(Object(n),!0).forEach(function(r){ole(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ole(e,t,n){return(t=sle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sle(e){var t=ule(e,"string");return typeof t=="symbol"?t:t+""}function ule(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cle(e,t){return ple(e)||dle(e,t)||hle(e,t)||fle()}function fle(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
76
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hle(e,t){if(e){if(typeof e=="string")return _R(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_R(e,t):void 0}}function _R(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function dle(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function ple(e){if(Array.isArray(e))return e}function mle(e){return Array.isArray(e)&&Zi(e[0])&&Zi(e[1])?e.join(" ~ "):e}var su={separator:" : ",contentStyle:{margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},itemStyle:{display:"block",paddingTop:4,paddingBottom:4,color:"#000"},labelStyle:{},accessibilityLayer:!1};function gle(e,t){return t==null?e:Gv(e,t)}var vle=e=>{var t=e.separator,n=t===void 0?su.separator:t,r=e.contentStyle,i=e.itemStyle,a=e.labelStyle,l=a===void 0?su.labelStyle:a,s=e.payload,c=e.formatter,f=e.itemSorter,d=e.wrapperClassName,p=e.labelClassName,g=e.label,v=e.labelFormatter,y=e.accessibilityLayer,x=y===void 0?su.accessibilityLayer:y,w=()=>{if(s&&s.length){var L={padding:0,margin:0},H=gle(s,f),K=H.map((V,B)=>{if(!V||V.type==="none")return null;var ae=V.formatter||c||mle,ie=V.value,oe=V.name,z=ie,G=oe;if(ae){var ne=ae(ie,oe,V,B,s);if(Array.isArray(ne)){var ce=cle(ne,2);z=ce[0],G=ce[1]}else if(ne!=null)z=ne;else return null}var fe=kf(kf({},su.itemStyle),{},{color:V.color||su.itemStyle.color},i);return O.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(B),style:fe},Zi(G)?O.createElement("span",{className:"recharts-tooltip-item-name"},G):null,Zi(G)?O.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,O.createElement("span",{className:"recharts-tooltip-item-value"},z),O.createElement("span",{className:"recharts-tooltip-item-unit"},V.unit||""))});return O.createElement("ul",{className:"recharts-tooltip-item-list",style:L},K)}return null},A=kf(kf({},su.contentStyle),r),k=kf({margin:0},l),E=!kt(g),P=E?g:"",T=st("recharts-default-tooltip",d),M=st("recharts-tooltip-label",p);E&&v&&s!==void 0&&s!==null&&(P=v(g,s));var R=x?{role:"status","aria-live":"assertive"}:{};return O.createElement("div",pw({className:T,style:A},R),O.createElement("p",{className:M,style:k},O.isValidElement(P)?P:"".concat(P)),w())},Cf="recharts-tooltip-wrapper",yle={visibility:"hidden"};function ble(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return st(Cf,{["".concat(Cf,"-right")]:be(n)&&t&&be(t.x)&&n>=t.x,["".concat(Cf,"-left")]:be(n)&&t&&be(t.x)&&n<t.x,["".concat(Cf,"-bottom")]:be(r)&&t&&be(t.y)&&r>=t.y,["".concat(Cf,"-top")]:be(r)&&t&&be(t.y)&&r<t.y})}function NR(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,i=e.offset,a=e.position,l=e.reverseDirection,s=e.tooltipDimension,c=e.viewBox,f=e.viewBoxDimension;if(a&&be(a[r]))return a[r];var d=n[r]-s-(i>0?i:0),p=n[r]+i;if(t[r])return l[r]?d:p;var g=c[r];if(g==null)return 0;if(l[r]){var v=d,y=g;return v<y?Math.max(p,g):Math.max(d,g)}if(f==null)return 0;var x=p+s,w=g+f;return x>w?Math.max(d,g):Math.max(p,g)}function xle(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function Sle(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTop,i=e.offsetLeft,a=e.position,l=e.reverseDirection,s=e.tooltipBox,c=e.useTranslate3d,f=e.viewBox,d,p,g;return s.height>0&&s.width>0&&n?(p=NR({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:l,tooltipDimension:s.width,viewBox:f,viewBoxDimension:f.width}),g=NR({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:l,tooltipDimension:s.height,viewBox:f,viewBoxDimension:f.height}),d=xle({translateX:p,translateY:g,useTranslate3d:c})):d=yle,{cssProperties:d,cssClasses:ble({translateX:p,translateY:g,coordinate:n})}}var wle=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),rd={isSsr:wle()};function Ole(e,t){return Ele(e)||Cle(e,t)||kle(e,t)||Ale()}function Ale(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
77
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kle(e,t){if(e){if(typeof e=="string")return IR(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?IR(e,t):void 0}}function IR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Cle(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function Ele(e){if(Array.isArray(e))return e}function U5(){var e=O.useState(()=>rd.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches),t=Ole(e,2),n=t[0],r=t[1];return O.useEffect(()=>{if(window.matchMedia){var i=window.matchMedia("(prefers-reduced-motion: reduce)"),a=()=>{r(i.matches)};return i.addEventListener("change",a),()=>{i.removeEventListener("change",a)}}},[]),n}function LR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function uu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LR(Object(n),!0).forEach(function(r){Tle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tle(e,t,n){return(t=Mle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mle(e){var t=Ple(e,"string");return typeof t=="symbol"?t:t+""}function Ple(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Dle(e,t){return Ile(e)||Nle(e,t)||_le(e,t)||Rle()}function Rle(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
78
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _le(e,t){if(e){if(typeof e=="string")return jR(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jR(e,t):void 0}}function jR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Nle(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function Ile(e){if(Array.isArray(e))return e}function Lle(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active){var t=typeof e.animationEasing=="string"?e.animationEasing:"ease";return"transform ".concat(e.animationDuration,"ms ").concat(t)}}function jle(e){var t,n,r,i,a,l,s=U5(),c=O.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}})),f=Dle(c,2),d=f[0],p=f[1];O.useEffect(()=>{var A=k=>{if(k.key==="Escape"){var E,P,T,M;p({dismissed:!0,dismissedAtCoordinate:{x:(E=(P=e.coordinate)===null||P===void 0?void 0:P.x)!==null&&E!==void 0?E:0,y:(T=(M=e.coordinate)===null||M===void 0?void 0:M.y)!==null&&T!==void 0?T:0}})}};return document.addEventListener("keydown",A),()=>{document.removeEventListener("keydown",A)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(n=e.coordinate)===null||n===void 0?void 0:n.y]),d.dismissed&&(((r=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)!==d.dismissedAtCoordinate.x||((a=(l=e.coordinate)===null||l===void 0?void 0:l.y)!==null&&a!==void 0?a:0)!==d.dismissedAtCoordinate.y)&&p(uu(uu({},d),{},{dismissed:!1}));var g=Sle({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset=="number"?e.offset:e.offset.x,offsetTop:typeof e.offset=="number"?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),v=g.cssClasses,y=g.cssProperties,x=e.hasPortalFromProps?{}:uu(uu({transition:Lle({prefersReducedMotion:s,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},y),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),w=uu(uu({},x),{},{visibility:!d.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return O.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:v,style:w,ref:e.innerRef},e.children)}var Ble=O.memo(jle),F5=()=>{var e;return(e=we(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function mw(){return mw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mw.apply(null,arguments)}function BR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BR(Object(n),!0).forEach(function(r){zle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zle(e,t,n){return(t=$le(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $le(e){var t=Hle(e,"string");return typeof t=="symbol"?t:t+""}function Hle(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $R={curveBasisClosed:ute,curveBasisOpen:cte,curveBasis:ste,curveBumpX:Xee,curveBumpY:Qee,curveLinearClosed:fte,curveLinear:Xv,curveMonotoneX:hte,curveMonotoneY:dte,curveNatural:pte,curveStep:mte,curveStepAfter:vte,curveStepBefore:gte},Kg=e=>Ve(e.x)&&Ve(e.y),HR=e=>e.base!=null&&Kg(e.base)&&Kg(e),Ef=e=>e.x,Tf=e=>e.y,Ule=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(Gh(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=$R["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return $R[n]||Xv},UR={connectNulls:!1,type:"linear"},Fle=e=>{var t=e.type,n=t===void 0?UR.type:t,r=e.points,i=r===void 0?[]:r,a=e.baseLine,l=e.layout,s=e.connectNulls,c=s===void 0?UR.connectNulls:s,f=Ule(n,l),d=c?i.filter(Kg):i;if(Array.isArray(a)){var p,g=i.map((A,k)=>zR(zR({},A),{},{base:a[k]}));l==="vertical"?p=cm().y(Tf).x1(Ef).x0(A=>A.base.x):p=cm().x(Ef).y1(Tf).y0(A=>A.base.y);var v=p.defined(HR).curve(f),y=c?g.filter(HR):g;return v(y)}var x;l==="vertical"&&be(a)?x=cm().y(Tf).x1(Ef).x0(a):be(a)?x=cm().x(Ef).y1(Tf).y0(a):x=bz().x(Ef).y(Tf);var w=x.defined(Kg).curve(f);return w(d)},q5=e=>{var t=e.className,n=e.points,r=e.path,i=e.pathRef,a=ys();if((!n||!n.length)&&!r)return null;var l={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},s=n&&n.length?Fle(l):r;return O.createElement("path",mw({},yi(e),uA(e),{className:st("recharts-curve",t),d:s===null?void 0:s,ref:i}))},qle=["x","y","top","left","width","height","className"];function gw(){return gw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gw.apply(null,arguments)}function FR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Wle(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FR(Object(n),!0).forEach(function(r){Vle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Vle(e,t,n){return(t=Kle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kle(e){var t=Xle(e,"string");return typeof t=="symbol"?t:t+""}function Xle(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qle(e,t){if(e==null)return{};var n,r,i=Yle(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Yle(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Gle=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),Zle=e=>{var t=e.x,n=t===void 0?0:t,r=e.y,i=r===void 0?0:r,a=e.top,l=a===void 0?0:a,s=e.left,c=s===void 0?0:s,f=e.width,d=f===void 0?0:f,p=e.height,g=p===void 0?0:p,v=e.className,y=Qle(e,qle),x=Wle({x:n,y:i,top:l,left:c,width:d,height:g},y);return!be(n)||!be(i)||!be(d)||!be(g)||!be(l)||!be(c)?null:O.createElement("path",gw({},Dr(x),{className:st("recharts-cross",v),d:Gle(n,i,d,g,l,c)}))};function Jle(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}var Xg=1e-4,W5=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],V5=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),qR=(e,t)=>n=>{var r=W5(e,t);return V5(r,n)},eoe=(e,t)=>n=>{var r=W5(e,t),i=[...r.map((a,l)=>a*l).slice(1),0];return V5(i,n)},toe=e=>{var t,n=e.split("(");if(n.length!==2||n[0]!=="cubic-bezier")return null;var r=(t=n[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(r==null||r.length!==4)return null;var i=r.map(a=>parseFloat(a));return[i[0],i[1],i[2],i[3]]},noe=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(n.length===1)switch(n[0]){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-out":return[.42,0,.58,1];case"ease-in-out":return[0,0,.58,1];default:{var i=toe(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},roe=(e,t,n,r)=>{var i=qR(e,n),a=qR(t,r),l=eoe(e,n),s=f=>f>1?1:f<0?0:f,c=f=>{for(var d=f>1?1:f,p=d,g=0;g<8;++g){var v=i(p)-d,y=l(p);if(Math.abs(v-d)<Xg||y<Xg)return a(p);p=s(p-v/y)}return a(p)};return c.isStepper=!1,c},WR=function(){return roe(...noe(...arguments))},ioe=function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,i=t.damping,a=i===void 0?8:i,l=t.dt,s=l===void 0?16.67:l,c=1,f=[0],d=0,p=0,g=1e4,v=0;v<g;){var y=-(d-c)*r,x=p*a;if(p+=(y-x)*s/1e3,d+=p*s/1e3,f.push(d),Math.abs(d-c)<Xg&&Math.abs(p)<Xg)break;v++}f[f.length-1]=c;var w=f.length-1;return A=>{var k,E,P;if(A<=0)return 0;if(A>=1)return c;var T=A*w,M=Math.floor(T),R=T-M;return((k=f[M])!==null&&k!==void 0?k:0)+(((E=f[M+1])!==null&&E!==void 0?E:0)-((P=f[M])!==null&&P!==void 0?P:0))*R}},aoe=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return WR(e);case"spring":return ioe();default:if(e.split("(")[0]==="cubic-bezier")return WR(e)}return typeof e=="function"?e:null},loe=(e,t,n)=>{var r,i=a=>{var l=t.tick(a);if(t.getState()==="active"){if(n(t.getInterpolated()),t.getProgress()===1){t.complete(),r=void 0;return}r=e.setTimeout(i,l);return}r=e.setTimeout(i,l)};return r=e.setTimeout(i,0),()=>{var a;return(a=r)===null||a===void 0?void 0:a()}},K5=O.createContext(loe);K5.Provider;function ooe(e){var t=O.useContext(K5);return O.useMemo(()=>e??t,[e,t])}function soe(e,t,n){return(t=uoe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uoe(e){var t=coe(e,"string");return typeof t=="symbol"?t:t+""}function coe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var VR="init",KR="pending",XR="active",foe="completed";function a1(e){return Math.max(0,e)}class hoe{getAnimationStartedTime(){return this.animationStartedTime}getBeginStartedTime(){return this.beginStartedTime}constructor(t){var n;soe(this,"state",VR),this.animationId=t.animationId,this.onAnimationEnd=t.onAnimationEnd,this.animationDuration=a1(t.animationDuration),this.animationBegin=a1(t.animationBegin),this.progress=0,this.from=t.from,this.to=t.to,this.easing=t.easing,(n=t.onAnimationStart)===null||n===void 0||n.call(t)}getState(){return this.state}getEasing(){return this.easing}getAnimationDuration(){return this.animationDuration}tick(t){if(this.getState()===VR)return this.state=KR,this.beginStartedTime=t,this.animationBegin;if(this.getState()===KR){if(this.beginStartedTime==null)throw new Error;var n=t-this.beginStartedTime;return n>=this.animationBegin?(this.state=XR,this.animationStartedTime=t,this.nextAnimationUpdate(0)):a1(this.animationBegin-n)}if(this.getState()===XR){if(this.animationStartedTime==null)throw new Error;var r=t-this.animationStartedTime;return this.setProgress(r/this.animationDuration),this.nextAnimationUpdate(r)}return 0}setProgress(t){this.progress=Math.min(1,Math.max(0,t))}getProgress(){return this.progress}complete(){if(this.progress=1,this.state==="active"){var t;(t=this.onAnimationEnd)===null||t===void 0||t.call(this)}this.state=foe}getFrom(){return this.from}getTo(){return this.to}getAnimationId(){return this.animationId}getAnimationBegin(){return this.animationBegin}}class doe extends hoe{nextAnimationUpdate(){return 0}getInterpolated(){return this.easing(Ft(this.getFrom(),this.getTo(),this.getProgress()))}}class poe{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,a=l=>{l-r>=n?t(l):i=requestAnimationFrame(a)};return i=requestAnimationFrame(a),()=>{i!=null&&cancelAnimationFrame(i)}}}function moe(e,t){return boe(e)||yoe(e,t)||voe(e,t)||goe()}function goe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
79
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function voe(e,t){if(e){if(typeof e=="string")return QR(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?QR(e,t):void 0}}function QR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function yoe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function boe(e){if(Array.isArray(e))return e}var xoe={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},YR=0,l1=1;function X5(e){var t=In(e,xoe),n=t.animationId,r=t.isActive,i=t.canBegin,a=t.duration,l=t.easing,s=t.begin,c=t.onAnimationEnd,f=t.onAnimationStart,d=t.children,p=U5(),g=r==="auto"?!rd.isSsr&&!p:r,v=ooe(t.animationController),y=O.useState(g?YR:l1),x=moe(y,2),w=x[0],A=x[1];return O.useEffect(()=>{g||A(l1)},[g]),O.useEffect(()=>{var k=aoe(l);if(!g||!i||k==null)return vs;var E=new poe,P=new doe({animationId:n,easing:k,animationDuration:a,animationBegin:s,onAnimationStart:f,onAnimationEnd:c,from:YR,to:l1});return v(E,P,A)},[v,n,g,i,a,l,s,f,c]),d(Number(w))}function Q5(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=O.useRef(Th(t)),r=O.useRef(e);return r.current!==e&&(n.current=Th(t),r.current=e),n.current}var Soe=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),woe=(e,t,n)=>e.map(r=>"".concat(Soe(r)," ").concat(t,"ms ").concat(n)).join(","),Ooe=["radius"],Aoe=["radius"],GR,ZR,JR,e_,t_,n_,r_,i_,a_,l_;function o_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function s_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?o_(Object(n),!0).forEach(function(r){koe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function koe(e,t,n){return(t=Coe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Coe(e){var t=Eoe(e,"string");return typeof t=="symbol"?t:t+""}function Eoe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qg(){return Qg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qg.apply(null,arguments)}function u_(e,t){if(e==null)return{};var n,r,i=Toe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Toe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Moe(e,t){return _oe(e)||Roe(e,t)||Doe(e,t)||Poe()}function Poe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
80
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Doe(e,t){if(e){if(typeof e=="string")return c_(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c_(e,t):void 0}}function c_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Roe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function _oe(e){if(Array.isArray(e))return e}function _i(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var f_=(e,t,n,r,i)=>{var a=Da(n),l=Da(r),s=Math.min(Math.abs(a)/2,Math.abs(l)/2),c=l>=0?1:-1,f=a>=0?1:-1,d=l>=0&&a>=0||l<0&&a<0?1:0,p;if(s>0&&Array.isArray(i)){for(var g=[0,0,0,0],v=0,y=4;v<y;v++){var x,w=(x=i[v])!==null&&x!==void 0?x:0;g[v]=w>s?s:w}p=Sn(GR||(GR=_i(["M",",",""])),e,t+c*g[0]),g[0]>0&&(p+=Sn(ZR||(ZR=_i(["A ",",",",0,0,",",",",",""])),g[0],g[0],d,e+f*g[0],t)),p+=Sn(JR||(JR=_i(["L ",",",""])),e+n-f*g[1],t),g[1]>0&&(p+=Sn(e_||(e_=_i(["A ",",",",0,0,",`,
|
|
81
|
+
`,",",""])),g[1],g[1],d,e+n,t+c*g[1])),p+=Sn(t_||(t_=_i(["L ",",",""])),e+n,t+r-c*g[2]),g[2]>0&&(p+=Sn(n_||(n_=_i(["A ",",",",0,0,",`,
|
|
82
|
+
`,",",""])),g[2],g[2],d,e+n-f*g[2],t+r)),p+=Sn(r_||(r_=_i(["L ",",",""])),e+f*g[3],t+r),g[3]>0&&(p+=Sn(i_||(i_=_i(["A ",",",",0,0,",`,
|
|
83
|
+
`,",",""])),g[3],g[3],d,e,t+r-c*g[3])),p+="Z"}else if(s>0&&i===+i&&i>0){var A=Math.min(s,i);p=Sn(a_||(a_=_i(["M ",",",`
|
|
84
|
+
A `,",",",0,0,",",",",",`
|
|
85
|
+
L `,",",`
|
|
86
|
+
A `,",",",0,0,",",",",",`
|
|
87
|
+
L `,",",`
|
|
88
|
+
A `,",",",0,0,",",",",",`
|
|
89
|
+
L `,",",`
|
|
90
|
+
A `,",",",0,0,",",",","," Z"])),e,t+c*A,A,A,d,e+f*A,t,e+n-f*A,t,A,A,d,e+n,t+c*A,e+n,t+r-c*A,A,A,d,e+n-f*A,t+r,e+f*A,t+r,A,A,d,e,t+r-c*A)}else p=Sn(l_||(l_=_i(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return p},h_={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Y5=e=>{var t=In(e,h_),n=O.useRef(null),r=O.useState(-1),i=Moe(r,2),a=i[0],l=i[1];O.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var ne=n.current.getTotalLength();ne&&l(ne)}catch{}},[]);var s=t.x,c=t.y,f=t.width,d=t.height,p=t.radius,g=t.className,v=t.animationEasing,y=t.animationDuration,x=t.animationBegin,w=t.isAnimationActive,A=t.isUpdateAnimationActive,k=O.useRef(f),E=O.useRef(d),P=O.useRef(s),T=O.useRef(c),M=O.useMemo(()=>({x:s,y:c,width:f,height:d,radius:p}),[s,c,f,d,p]),R=Q5(M,"rectangle-");if(s!==+s||c!==+c||f!==+f||d!==+d||f===0||d===0)return null;var L=st("recharts-rectangle",g);if(!A){var H=Dr(t);H.radius;var K=u_(H,Ooe);return O.createElement("path",Qg({},K,{x:Da(s),y:Da(c),width:Da(f),height:Da(d),radius:typeof p=="number"?p:void 0,className:L,d:f_(s,c,f,d,p)}))}var V=k.current,B=E.current,ae=P.current,ie=T.current,oe="0px ".concat(a===-1?1:a,"px"),z="".concat(a,"px ").concat(a,"px"),G=woe(["strokeDasharray"],y,typeof v=="string"?v:h_.animationEasing);return O.createElement(X5,{animationId:R,key:R,canBegin:a>0,duration:y,easing:v,isActive:A,begin:x},ne=>{var ce=Ft(V,f,ne),fe=Ft(B,d,ne),N=Ft(ae,s,ne),X=Ft(ie,c,ne);n.current&&(k.current=ce,E.current=fe,P.current=N,T.current=X);var re;w?ne>0?re={transition:G,strokeDasharray:z}:re={strokeDasharray:oe}:re={strokeDasharray:z};var le=Dr(t);le.radius;var ge=u_(le,Aoe);return O.createElement("path",Qg({},ge,{radius:typeof p=="number"?p:void 0,className:L,d:f_(N,X,ce,fe,p),ref:n,style:s_(s_({},re),t.style)}))})};function d_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function p_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?d_(Object(n),!0).forEach(function(r){Noe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Noe(e,t,n){return(t=Ioe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ioe(e){var t=Loe(e,"string");return typeof t=="symbol"?t:t+""}function Loe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Yg=Math.PI/180,joe=e=>e*180/Math.PI,An=(e,t,n,r)=>({x:e+Math.cos(-Yg*r)*n,y:t+Math.sin(-Yg*r)*n}),Boe=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},zoe=(e,t)=>{var n=e.x,r=e.y,i=t.x,a=t.y;return Math.sqrt((n-i)**2+(r-a)**2)},$oe=(e,t)=>{var n=e.x,r=e.y,i=t.cx,a=t.cy,l=zoe({x:n,y:r},{x:i,y:a});if(l<=0)return{radius:l,angle:0};var s=(n-i)/l,c=Math.acos(s);return r>a&&(c=2*Math.PI-c),{radius:l,angle:joe(c),angleInRadian:c}},Hoe=e=>{var t=e.startAngle,n=e.endAngle,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},Uoe=(e,t)=>{var n=t.startAngle,r=t.endAngle,i=Math.floor(n/360),a=Math.floor(r/360),l=Math.min(i,a);return e+l*360},Foe=(e,t)=>{var n=e.relativeX,r=e.relativeY,i=$oe({x:n,y:r},t),a=i.radius,l=i.angle,s=t.innerRadius,c=t.outerRadius;if(a<s||a>c||a===0)return null;var f=Hoe(t),d=f.startAngle,p=f.endAngle,g=l,v;if(d<=p){for(;g>p;)g-=360;for(;g<d;)g+=360;v=g>=d&&g<=p}else{for(;g>d;)g-=360;for(;g<p;)g+=360;v=g>=p&&g<=d}return v?p_(p_({},t),{},{radius:a,angle:Uoe(g,t)}):null};function G5(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,a=e.endAngle,l=An(t,n,r,i),s=An(t,n,r,a);return{points:[l,s],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var m_,g_,v_,y_,b_,x_,S_;function vw(){return vw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vw.apply(null,arguments)}function Wo(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var qoe=(e,t)=>{var n=or(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},vm=e=>{var t=e.cx,n=e.cy,r=e.radius,i=e.angle,a=e.sign,l=e.isExternal,s=e.cornerRadius,c=e.cornerIsExternal,f=s*(l?1:-1)+r,d=Math.asin(s/f)/Yg,p=c?i:i+a*d,g=An(t,n,f,p),v=An(t,n,r,p),y=c?i-a*d:i,x=An(t,n,f*Math.cos(d*Yg),y);return{center:g,circleTangency:v,lineTangency:x,theta:d}},Z5=e=>{var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.startAngle,l=e.endAngle,s=qoe(a,l),c=a+s,f=An(t,n,i,a),d=An(t,n,i,c),p=Sn(m_||(m_=Wo(["M ",",",`
|
|
91
|
+
A `,",",`,0,
|
|
92
|
+
`,",",`,
|
|
93
|
+
`,",",`
|
|
94
|
+
`])),f.x,f.y,i,i,+(Math.abs(s)>180),+(a>c),d.x,d.y);if(r>0){var g=An(t,n,r,a),v=An(t,n,r,c);p+=Sn(g_||(g_=Wo(["L ",",",`
|
|
95
|
+
A `,",",`,0,
|
|
96
|
+
`,",",`,
|
|
97
|
+
`,","," Z"])),v.x,v.y,r,r,+(Math.abs(s)>180),+(a<=c),g.x,g.y)}else p+=Sn(v_||(v_=Wo(["L ",","," Z"])),t,n);return p},Woe=e=>{var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.cornerRadius,l=e.forceCornerRadius,s=e.cornerIsExternal,c=e.startAngle,f=e.endAngle,d=or(f-c),p=vm({cx:t,cy:n,radius:i,angle:c,sign:d,cornerRadius:a,cornerIsExternal:s}),g=p.circleTangency,v=p.lineTangency,y=p.theta,x=vm({cx:t,cy:n,radius:i,angle:f,sign:-d,cornerRadius:a,cornerIsExternal:s}),w=x.circleTangency,A=x.lineTangency,k=x.theta,E=s?Math.abs(c-f):Math.abs(c-f)-y-k;if(E<0)return l?Sn(y_||(y_=Wo(["M ",",",`
|
|
98
|
+
a`,",",",0,0,1,",`,0
|
|
99
|
+
a`,",",",0,0,1,",`,0
|
|
100
|
+
`])),v.x,v.y,a,a,a*2,a,a,-a*2):Z5({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:f});var P=Sn(b_||(b_=Wo(["M ",",",`
|
|
101
|
+
A`,",",",0,0,",",",",",`
|
|
102
|
+
A`,",",",0,",",",",",",",`
|
|
103
|
+
A`,",",",0,0,",",",",",`
|
|
104
|
+
`])),v.x,v.y,a,a,+(d<0),g.x,g.y,i,i,+(E>180),+(d<0),w.x,w.y,a,a,+(d<0),A.x,A.y);if(r>0){var T=vm({cx:t,cy:n,radius:r,angle:c,sign:d,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),M=T.circleTangency,R=T.lineTangency,L=T.theta,H=vm({cx:t,cy:n,radius:r,angle:f,sign:-d,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),K=H.circleTangency,V=H.lineTangency,B=H.theta,ae=s?Math.abs(c-f):Math.abs(c-f)-L-B;if(ae<0&&a===0)return"".concat(P,"L").concat(t,",").concat(n,"Z");P+=Sn(x_||(x_=Wo(["L",",",`
|
|
105
|
+
A`,",",",0,0,",",",",",`
|
|
106
|
+
A`,",",",0,",",",",",",",`
|
|
107
|
+
A`,",",",0,0,",",",",","Z"])),V.x,V.y,a,a,+(d<0),K.x,K.y,r,r,+(ae>180),+(d>0),M.x,M.y,a,a,+(d<0),R.x,R.y)}else P+=Sn(S_||(S_=Wo(["L",",","Z"])),t,n);return P},Voe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Koe=e=>{var t=In(e,Voe),n=t.cx,r=t.cy,i=t.innerRadius,a=t.outerRadius,l=t.cornerRadius,s=t.forceCornerRadius,c=t.cornerIsExternal,f=t.startAngle,d=t.endAngle,p=t.className;if(a<i||f===d)return null;var g=st("recharts-sector",p),v=a-i,y=bi(l,v,0,!0),x;return y>0&&Math.abs(f-d)<360?x=Woe({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(y,v/2),forceCornerRadius:s,cornerIsExternal:c,startAngle:f,endAngle:d}):x=Z5({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:f,endAngle:d}),O.createElement("path",vw({},Dr(t),{className:g,d:x}))};function Xoe(e,t,n){if(e==="horizontal")return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e==="vertical")return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(Lz(t)){if(e==="centric"){var r=t.cx,i=t.cy,a=t.innerRadius,l=t.outerRadius,s=t.angle,c=An(r,i,a,s),f=An(r,i,l,s);return[{x:c.x,y:c.y},{x:f.x,y:f.y}]}return G5(t)}}function Qoe(e){return Zz(e)?NaN:Number(e)}function o1(e){return e?(e=Qoe(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}function J5(e,t,n){n&&typeof n!="number"&&nw(e,t,n)&&(t=n=void 0),e=o1(e),t===void 0?(t=e,e=0):t=o1(t),n=n===void 0?e<t?1:-1:o1(n);const r=Math.max(Math.ceil((t-e)/(n||1)),0),i=new Array(r);for(let a=0;a<r;a++)i[a]=e,e+=n;return i}var ki=e=>e.chartData,OA=q([ki],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),id=(e,t,n,r)=>r?OA(e):ki(e),Yoe=(e,t,n)=>n?OA(e):ki(e),Goe=q([id],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t!=null?t.slice(n,r+1):[]});q([OA],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t!=null?t.slice(n,r+1):[]});var Zoe=q([ki],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t!=null?t.slice(n,r+1):[]});function AA(e,t){return nse(e)||tse(e,t)||ese(e,t)||Joe()}function Joe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
108
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ese(e,t){if(e){if(typeof e=="string")return w_(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w_(e,t):void 0}}function w_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function tse(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function nse(e){if(Array.isArray(e))return e}function Xi(e){if(Array.isArray(e)&&e.length===2){var t=AA(e,2),n=t[0],r=t[1];if(Ve(n)&&Ve(r))return!0}return!1}function O_(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function e$(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var n=AA(e,2),r=n[0],i=n[1],a,l;if(Ve(r))a=r;else if(typeof r=="function")return;if(Ve(i))l=i;else if(typeof i=="function")return;var s=[a,l];if(Xi(s))return s}}function rse(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(Xi(r))return O_(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var i=AA(e,2),a=i[0],l=i[1],s,c;if(a==="auto")t!=null&&(s=Math.min(...t));else if(be(a))s=a;else if(typeof a=="function")try{t!=null&&(s=a(t?.[0]))}catch{}else if(typeof a=="string"&&vR.test(a)){var f=vR.exec(a);if(f==null||f[1]==null||t==null)s=void 0;else{var d=+f[1];s=t[0]-d}}else s=t?.[0];if(l==="auto")t!=null&&(c=Math.max(...t));else if(be(l))c=l;else if(typeof l=="function")try{t!=null&&(c=l(t?.[1]))}catch{}else if(typeof l=="string"&&yR.test(l)){var p=yR.exec(l);if(p==null||p[1]==null||t==null)c=void 0;else{var g=+p[1];c=t[1]+g}}else c=t?.[1];var v=[s,c];if(Xi(v))return t==null?v:O_(v,t,n)}}}var pc=1e9,ise={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},CA,At=!0,ei="[DecimalError] ",Jo=ei+"Invalid argument: ",kA=ei+"Exponent out of range: ",mc=Math.floor,Io=Math.pow,ase=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Er,nn=1e7,xt=7,t$=9007199254740991,Gg=mc(t$/xt),ve={};ve.absoluteValue=ve.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};ve.comparedTo=ve.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};ve.decimalPlaces=ve.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*xt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};ve.dividedBy=ve.div=function(e){return La(this,new this.constructor(e))};ve.dividedToIntegerBy=ve.idiv=function(e){var t=this,n=t.constructor;return ht(La(t,new n(e),0,1),n.precision)};ve.equals=ve.eq=function(e){return!this.cmp(e)};ve.exponent=function(){return qt(this)};ve.greaterThan=ve.gt=function(e){return this.cmp(e)>0};ve.greaterThanOrEqualTo=ve.gte=function(e){return this.cmp(e)>=0};ve.isInteger=ve.isint=function(){return this.e>this.d.length-2};ve.isNegative=ve.isneg=function(){return this.s<0};ve.isPositive=ve.ispos=function(){return this.s>0};ve.isZero=function(){return this.s===0};ve.lessThan=ve.lt=function(e){return this.cmp(e)<0};ve.lessThanOrEqualTo=ve.lte=function(e){return this.cmp(e)<1};ve.logarithm=ve.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Er))throw Error(ei+"NaN");if(n.s<1)throw Error(ei+(n.s?"NaN":"-Infinity"));return n.eq(Er)?new r(0):(At=!1,t=La(Rh(n,a),Rh(e,a),a),At=!0,ht(t,i))};ve.minus=ve.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?i$(t,e):n$(t,(e.s=-e.s,e))};ve.modulo=ve.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(ei+"NaN");return n.s?(At=!1,t=La(n,e,0,1).times(e),At=!0,n.minus(t)):ht(new r(n),i)};ve.naturalExponential=ve.exp=function(){return r$(this)};ve.naturalLogarithm=ve.ln=function(){return Rh(this)};ve.negated=ve.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};ve.plus=ve.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?n$(t,e):i$(t,(e.s=-e.s,e))};ve.precision=ve.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Jo+e);if(t=qt(i)+1,r=i.d.length-1,n=r*xt+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};ve.squareRoot=ve.sqrt=function(){var e,t,n,r,i,a,l,s=this,c=s.constructor;if(s.s<1){if(!s.s)return new c(0);throw Error(ei+"NaN")}for(e=qt(s),At=!1,i=Math.sqrt(+s),i==0||i==1/0?(t=Vi(s.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=mc((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(i.toString()),n=c.precision,i=l=n+3;;)if(a=r,r=a.plus(La(s,a,l+2)).times(.5),Vi(a.d).slice(0,l)===(t=Vi(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),i==l&&t=="4999"){if(ht(a,n+1,0),a.times(a).eq(s)){r=a;break}}else if(t!="9999")break;l+=4}return At=!0,ht(r,n)};ve.times=ve.mul=function(e){var t,n,r,i,a,l,s,c,f,d=this,p=d.constructor,g=d.d,v=(e=new p(e)).d;if(!d.s||!e.s)return new p(0);for(e.s*=d.s,n=d.e+e.e,c=g.length,f=v.length,c<f&&(a=g,g=v,v=a,l=c,c=f,f=l),a=[],l=c+f,r=l;r--;)a.push(0);for(r=f;--r>=0;){for(t=0,i=c+r;i>r;)s=a[i]+v[r]*g[i-r-1]+t,a[i--]=s%nn|0,t=s/nn|0;a[i]=(a[i]+t)%nn|0}for(;!a[--l];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,At?ht(e,p.precision):e};ve.toDecimalPlaces=ve.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(ea(e,0,pc),t===void 0?t=r.rounding:ea(t,0,8),ht(n,e+qt(n)+1,t))};ve.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=hs(r,!0):(ea(e,0,pc),t===void 0?t=i.rounding:ea(t,0,8),r=ht(new i(r),e+1,t),n=hs(r,!0,e+1)),n};ve.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?hs(i):(ea(e,0,pc),t===void 0?t=a.rounding:ea(t,0,8),r=ht(new a(i),e+qt(i)+1,t),n=hs(r.abs(),!1,e+qt(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};ve.toInteger=ve.toint=function(){var e=this,t=e.constructor;return ht(new t(e),qt(e)+1,t.rounding)};ve.toNumber=function(){return+this};ve.toPower=ve.pow=function(e){var t,n,r,i,a,l,s=this,c=s.constructor,f=12,d=+(e=new c(e));if(!e.s)return new c(Er);if(s=new c(s),!s.s){if(e.s<1)throw Error(ei+"Infinity");return s}if(s.eq(Er))return s;if(r=c.precision,e.eq(Er))return ht(s,r);if(t=e.e,n=e.d.length-1,l=t>=n,a=s.s,l){if((n=d<0?-d:d)<=t$){for(i=new c(Er),t=Math.ceil(r/xt+4),At=!1;n%2&&(i=i.times(s),k_(i.d,t)),n=mc(n/2),n!==0;)s=s.times(s),k_(s.d,t);return At=!0,e.s<0?new c(Er).div(i):ht(i,r)}}else if(a<0)throw Error(ei+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,s.s=1,At=!1,i=e.times(Rh(s,r+f)),At=!0,i=r$(i),i.s=a,i};ve.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=qt(i),r=hs(i,n<=a.toExpNeg||n>=a.toExpPos)):(ea(e,1,pc),t===void 0?t=a.rounding:ea(t,0,8),i=ht(new a(i),e,t),n=qt(i),r=hs(i,e<=n||n<=a.toExpNeg,e)),r};ve.toSignificantDigits=ve.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(ea(e,1,pc),t===void 0?t=r.rounding:ea(t,0,8)),ht(new r(n),e,t)};ve.toString=ve.valueOf=ve.val=ve.toJSON=ve[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=qt(e),n=e.constructor;return hs(e,t<=n.toExpNeg||t>=n.toExpPos)};function n$(e,t){var n,r,i,a,l,s,c,f,d=e.constructor,p=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),At?ht(t,p):t;if(c=e.d,f=t.d,l=e.e,i=t.e,c=c.slice(),a=l-i,a){for(a<0?(r=c,a=-a,s=f.length):(r=f,i=l,s=c.length),l=Math.ceil(p/xt),s=l>s?l+1:s+1,a>s&&(a=s,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(s=c.length,a=f.length,s-a<0&&(a=s,r=f,f=c,c=r),n=0;a;)n=(c[--a]=c[a]+f[a]+n)/nn|0,c[a]%=nn;for(n&&(c.unshift(n),++i),s=c.length;c[--s]==0;)c.pop();return t.d=c,t.e=i,At?ht(t,p):t}function ea(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Jo+e)}function Vi(e){var t,n,r,i=e.length-1,a="",l=e[0];if(i>0){for(a+=l,t=1;t<i;t++)r=e[t]+"",n=xt-r.length,n&&(a+=Dl(n)),a+=r;l=e[t],r=l+"",n=xt-r.length,n&&(a+=Dl(n))}else if(l===0)return"0";for(;l%10===0;)l/=10;return a+l}var La=(function(){function e(r,i){var a,l=0,s=r.length;for(r=r.slice();s--;)a=r[s]*i+l,r[s]=a%nn|0,l=a/nn|0;return l&&r.unshift(l),r}function t(r,i,a,l){var s,c;if(a!=l)c=a>l?1:-1;else for(s=c=0;s<a;s++)if(r[s]!=i[s]){c=r[s]>i[s]?1:-1;break}return c}function n(r,i,a){for(var l=0;a--;)r[a]-=l,l=r[a]<i[a]?1:0,r[a]=l*nn+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,l){var s,c,f,d,p,g,v,y,x,w,A,k,E,P,T,M,R,L,H=r.constructor,K=r.s==i.s?1:-1,V=r.d,B=i.d;if(!r.s)return new H(r);if(!i.s)throw Error(ei+"Division by zero");for(c=r.e-i.e,R=B.length,T=V.length,v=new H(K),y=v.d=[],f=0;B[f]==(V[f]||0);)++f;if(B[f]>(V[f]||0)&&--c,a==null?k=a=H.precision:l?k=a+(qt(r)-qt(i))+1:k=a,k<0)return new H(0);if(k=k/xt+2|0,f=0,R==1)for(d=0,B=B[0],k++;(f<T||d)&&k--;f++)E=d*nn+(V[f]||0),y[f]=E/B|0,d=E%B|0;else{for(d=nn/(B[0]+1)|0,d>1&&(B=e(B,d),V=e(V,d),R=B.length,T=V.length),P=R,x=V.slice(0,R),w=x.length;w<R;)x[w++]=0;L=B.slice(),L.unshift(0),M=B[0],B[1]>=nn/2&&++M;do d=0,s=t(B,x,R,w),s<0?(A=x[0],R!=w&&(A=A*nn+(x[1]||0)),d=A/M|0,d>1?(d>=nn&&(d=nn-1),p=e(B,d),g=p.length,w=x.length,s=t(p,x,g,w),s==1&&(d--,n(p,R<g?L:B,g))):(d==0&&(s=d=1),p=B.slice()),g=p.length,g<w&&p.unshift(0),n(x,p,w),s==-1&&(w=x.length,s=t(B,x,R,w),s<1&&(d++,n(x,R<w?L:B,w))),w=x.length):s===0&&(d++,x=[0]),y[f++]=d,s&&x[0]?x[w++]=V[P]||0:(x=[V[P]],w=1);while((P++<T||x[0]!==void 0)&&k--)}return y[0]||y.shift(),v.e=c,ht(v,l?a+qt(v)+1:a)}})();function r$(e,t){var n,r,i,a,l,s,c=0,f=0,d=e.constructor,p=d.precision;if(qt(e)>16)throw Error(kA+qt(e));if(!e.s)return new d(Er);for(At=!1,s=p,l=new d(.03125);e.abs().gte(.1);)e=e.times(l),f+=5;for(r=Math.log(Io(2,f))/Math.LN10*2+5|0,s+=r,n=i=a=new d(Er),d.precision=s;;){if(i=ht(i.times(e),s),n=n.times(++c),l=a.plus(La(i,n,s)),Vi(l.d).slice(0,s)===Vi(a.d).slice(0,s)){for(;f--;)a=ht(a.times(a),s);return d.precision=p,t==null?(At=!0,ht(a,p)):a}a=l}}function qt(e){for(var t=e.e*xt,n=e.d[0];n>=10;n/=10)t++;return t}function s1(e,t,n){if(t>e.LN10.sd())throw At=!0,n&&(e.precision=n),Error(ei+"LN10 precision limit exceeded");return ht(new e(e.LN10),t)}function Dl(e){for(var t="";e--;)t+="0";return t}function Rh(e,t){var n,r,i,a,l,s,c,f,d,p=1,g=10,v=e,y=v.d,x=v.constructor,w=x.precision;if(v.s<1)throw Error(ei+(v.s?"NaN":"-Infinity"));if(v.eq(Er))return new x(0);if(t==null?(At=!1,f=w):f=t,v.eq(10))return t==null&&(At=!0),s1(x,f);if(f+=g,x.precision=f,n=Vi(y),r=n.charAt(0),a=qt(v),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)v=v.times(e),n=Vi(v.d),r=n.charAt(0),p++;a=qt(v),r>1?(v=new x("0."+n),a++):v=new x(r+"."+n.slice(1))}else return c=s1(x,f+2,w).times(a+""),v=Rh(new x(r+"."+n.slice(1)),f-g).plus(c),x.precision=w,t==null?(At=!0,ht(v,w)):v;for(s=l=v=La(v.minus(Er),v.plus(Er),f),d=ht(v.times(v),f),i=3;;){if(l=ht(l.times(d),f),c=s.plus(La(l,new x(i),f)),Vi(c.d).slice(0,f)===Vi(s.d).slice(0,f))return s=s.times(2),a!==0&&(s=s.plus(s1(x,f+2,w).times(a+""))),s=La(s,new x(p),f),x.precision=w,t==null?(At=!0,ht(s,w)):s;s=c,i+=2}}function A_(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=mc(n/xt),e.d=[],r=(n+1)%xt,n<0&&(r+=xt),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=xt;r<i;)e.d.push(+t.slice(r,r+=xt));t=t.slice(r),r=xt-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),At&&(e.e>Gg||e.e<-Gg))throw Error(kA+n)}else e.s=0,e.e=0,e.d=[0];return e}function ht(e,t,n){var r,i,a,l,s,c,f,d,p=e.d;for(l=1,a=p[0];a>=10;a/=10)l++;if(r=t-l,r<0)r+=xt,i=t,f=p[d=0];else{if(d=Math.ceil((r+1)/xt),a=p.length,d>=a)return e;for(f=a=p[d],l=1;a>=10;a/=10)l++;r%=xt,i=r-xt+l}if(n!==void 0&&(a=Io(10,l-i-1),s=f/a%10|0,c=t<0||p[d+1]!==void 0||f%a,c=n<4?(s||c)&&(n==0||n==(e.s<0?3:2)):s>5||s==5&&(n==4||c||n==6&&(r>0?i>0?f/Io(10,l-i):0:p[d-1])%10&1||n==(e.s<0?8:7))),t<1||!p[0])return c?(a=qt(e),p.length=1,t=t-a-1,p[0]=Io(10,(xt-t%xt)%xt),e.e=mc(-t/xt)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(r==0?(p.length=d,a=1,d--):(p.length=d+1,a=Io(10,xt-r),p[d]=i>0?(f/Io(10,l-i)%Io(10,i)|0)*a:0),c)for(;;)if(d==0){(p[0]+=a)==nn&&(p[0]=1,++e.e);break}else{if(p[d]+=a,p[d]!=nn)break;p[d--]=0,a=1}for(r=p.length;p[--r]===0;)p.pop();if(At&&(e.e>Gg||e.e<-Gg))throw Error(kA+qt(e));return e}function i$(e,t){var n,r,i,a,l,s,c,f,d,p,g=e.constructor,v=g.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new g(e),At?ht(t,v):t;if(c=e.d,p=t.d,r=t.e,f=e.e,c=c.slice(),l=f-r,l){for(d=l<0,d?(n=c,l=-l,s=p.length):(n=p,r=f,s=c.length),i=Math.max(Math.ceil(v/xt),s)+2,l>i&&(l=i,n.length=1),n.reverse(),i=l;i--;)n.push(0);n.reverse()}else{for(i=c.length,s=p.length,d=i<s,d&&(s=i),i=0;i<s;i++)if(c[i]!=p[i]){d=c[i]<p[i];break}l=0}for(d&&(n=c,c=p,p=n,t.s=-t.s),s=c.length,i=p.length-s;i>0;--i)c[s++]=0;for(i=p.length;i>l;){if(c[--i]<p[i]){for(a=i;a&&c[--a]===0;)c[a]=nn-1;--c[a],c[i]+=nn}c[i]-=p[i]}for(;c[--s]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,At?ht(t,v):t):new g(0)}function hs(e,t,n){var r,i=qt(e),a=Vi(e.d),l=a.length;return t?(n&&(r=n-l)>0?a=a.charAt(0)+"."+a.slice(1)+Dl(r):l>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Dl(-i-1)+a,n&&(r=n-l)>0&&(a+=Dl(r))):i>=l?(a+=Dl(i+1-l),n&&(r=n-i-1)>0&&(a=a+"."+Dl(r))):((r=i+1)<l&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-l)>0&&(i+1===l&&(a+="."),a+=Dl(r))),e.s<0?"-"+a:a}function k_(e,t){if(e.length>t)return e.length=t,!0}function a$(e){var t,n,r;function i(a){var l=this;if(!(l instanceof i))return new i(a);if(l.constructor=i,a instanceof i){l.s=a.s,l.e=a.e,l.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Jo+a);if(a>0)l.s=1;else if(a<0)a=-a,l.s=-1;else{l.s=0,l.e=0,l.d=[0];return}if(a===~~a&&a<1e7){l.e=0,l.d=[a];return}return A_(l,a.toString())}else if(typeof a!="string")throw Error(Jo+a);if(a.charCodeAt(0)===45?(a=a.slice(1),l.s=-1):l.s=1,ase.test(a))A_(l,a);else throw Error(Jo+a)}if(i.prototype=ve,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=a$,i.config=i.set=lse,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function lse(e){if(!e||typeof e!="object")throw Error(ei+"Object expected");var t,n,r,i=["precision",1,pc,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if(mc(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Jo+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Jo+n+": "+r);return this}var CA=a$(ise);Er=new CA(1);const We=CA;function l$(e){var t;return e===0?t=1:t=Math.floor(new We(e).abs().log(10).toNumber())+1,t}function o$(e,t,n){for(var r=new We(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}function _h(e,t){return cse(e)||use(e,t)||sse(e,t)||ose()}function ose(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
109
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sse(e,t){if(e){if(typeof e=="string")return C_(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C_(e,t):void 0}}function C_(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function use(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function cse(e){if(Array.isArray(e))return e}var s$=e=>{var t=_h(e,2),n=t[0],r=t[1],i=n,a=r;return n>r&&(i=r,a=n),[i,a]},EA=(e,t,n)=>{if(e.lte(0))return new We(0);var r=l$(e.toNumber()),i=new We(10).pow(r),a=e.div(i),l=r!==1?.05:.1,s=new We(Math.ceil(a.div(l).toNumber())).add(n).mul(l),c=s.mul(i);return t?new We(c.toNumber()):new We(Math.ceil(c.toNumber()))},u$=(e,t,n)=>{var r;if(e.lte(0))return new We(0);var i=[1,2,2.5,5],a=e.toNumber(),l=Math.floor(new We(a).abs().log(10).toNumber()),s=new We(10).pow(l),c=e.div(s).toNumber(),f=i.findIndex(v=>v>=c-1e-10);if(f===-1&&(s=s.mul(10),f=0),f+=n,f>=i.length){var d=Math.floor(f/i.length);f%=i.length,s=s.mul(new We(10).pow(d))}var p=(r=i[f])!==null&&r!==void 0?r:1,g=new We(p).mul(s);return t?g:new We(Math.ceil(g.toNumber()))},fse=(e,t,n)=>{var r=new We(1),i=new We(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new We(10).pow(l$(e)-1),i=new We(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new We(Math.floor(e)))}else e===0?i=new We(Math.floor((t-1)/2)):n||(i=new We(Math.floor(e)));for(var l=Math.floor((t-1)/2),s=[],c=0;c<t;c++)s.push(i.add(new We(c-l).mul(r)).toNumber());return s},c$=function(t,n,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:EA;if(!Number.isFinite((n-t)/(r-1)))return{step:new We(0),tickMin:new We(0),tickMax:new We(0)};var s=l(new We(n).sub(t).div(r-1),i,a),c;t<=0&&n>=0?c=new We(0):(c=new We(t).add(n).div(2),c=c.sub(new We(c).mod(s)));var f=Math.ceil(c.sub(t).div(s).toNumber()),d=Math.ceil(new We(n).sub(c).div(s).toNumber()),p=f+d+1;return p>r?c$(t,n,r,i,a+1,l):(p<r&&(d=n>0?d+(r-p):d,f=n>0?f:f+(r-p)),{step:s,tickMin:c.sub(new We(f).mul(s)),tickMax:c.add(new We(d).mul(s))})},E_=function(t){var n=_h(t,2),r=n[0],i=n[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",c=Math.max(a,2),f=s$([r,i]),d=_h(f,2),p=d[0],g=d[1];if(p===-1/0||g===1/0){var v=g===1/0?[p,...Array(a-1).fill(1/0)]:[...Array(a-1).fill(-1/0),g];return r>i?v.reverse():v}if(p===g)return fse(p,a,l);var y=s==="snap125"?u$:EA,x=c$(p,g,c,l,0,y),w=x.step,A=x.tickMin,k=x.tickMax,E=o$(A,k.add(new We(.1).mul(w)),w);return r>i?E.reverse():E},T_=function(t,n){var r=_h(t,2),i=r[0],a=r[1],l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",c=s$([i,a]),f=_h(c,2),d=f[0],p=f[1];if(d===-1/0||p===1/0)return[i,a];if(d===p)return[d];var g=s==="snap125"?u$:EA,v=Math.max(n,2),y=g(new We(p).sub(d).div(v-1),l,0),x=[...o$(new We(d),new We(p),y),p];if(l===!1){x=x.map(A=>Math.round(A));var w=x.length-1;w>0&&x[w]===x[w-1]&&(x=x.slice(0,w))}return i>a?x.reverse():x},f$=e=>e.rootProps.maxBarSize,hse=e=>e.rootProps.barGap,h$=e=>e.rootProps.barCategoryGap,dse=e=>e.rootProps.barSize,py=e=>e.rootProps.stackOffset,d$=e=>e.rootProps.reverseStackOrder,TA=e=>e.options.chartName,MA=e=>e.rootProps.syncId,p$=e=>e.rootProps.syncMethod,PA=e=>e.options.eventEmitter,sn={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},To={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},Ni={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},my=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function gy(e,t,n){if(n!=="auto")return n;if(e!=null)return Ya(e,t)?"category":"number"}function M_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Zg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?M_(Object(n),!0).forEach(function(r){pse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pse(e,t,n){return(t=mse(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mse(e){var t=gse(e,"string");return typeof t=="symbol"?t:t+""}function gse(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var P_={allowDataOverflow:To.allowDataOverflow,allowDecimals:To.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:To.angleAxisId,includeHidden:!1,name:void 0,reversed:To.reversed,scale:To.scale,tick:To.tick,tickCount:void 0,ticks:void 0,type:To.type,unit:void 0,niceTicks:"auto"},D_={allowDataOverflow:Ni.allowDataOverflow,allowDecimals:Ni.allowDecimals,allowDuplicatedCategory:Ni.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:Ni.radiusAxisId,includeHidden:Ni.includeHidden,name:void 0,reversed:Ni.reversed,scale:Ni.scale,tick:Ni.tick,tickCount:Ni.tickCount,ticks:void 0,type:Ni.type,unit:void 0,niceTicks:"auto"},vse=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},DA=q([vse,z5],(e,t)=>{var n;if(e!=null)return e;var r=(n=gy(t,"angleAxis",P_.type))!==null&&n!==void 0?n:"category";return Zg(Zg({},P_),{},{type:r})}),yse=(e,t)=>e.polarAxis.radiusAxis[t],RA=q([yse,z5],(e,t)=>{var n;if(e!=null)return e;var r=(n=gy(t,"radiusAxis",D_.type))!==null&&n!==void 0?n:"category";return Zg(Zg({},D_),{},{type:r})}),vy=e=>e.polarOptions,_A=q([Ga,Za,un],Boe),m$=q([vy,_A],(e,t)=>{if(e!=null)return bi(e.innerRadius,t,0)}),g$=q([vy,_A],(e,t)=>{if(e!=null)return bi(e.outerRadius,t,t*.8)}),bse=e=>{if(e==null)return[0,0];var t=e.startAngle,n=e.endAngle;return[t,n]},v$=q([vy],bse);q([DA,v$],my);var y$=q([_A,m$,g$],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});q([RA,y$],my);var b$=q([nt,vy,m$,g$,Ga,Za],(e,t,n,r,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var l=t.cx,s=t.cy,c=t.startAngle,f=t.endAngle;return{cx:bi(l,i,i/2),cy:bi(s,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:f,clockWise:!1}}}),cn=(e,t)=>t,yy=(e,t,n)=>n;function NA(e){return e?.id}function x$(e,t,n){var r=t.chartData,i=r===void 0?[]:r,a=n.allowDuplicatedCategory,l=n.dataKey,s=new Map;return e.forEach(c=>{var f,d=(f=c.data)!==null&&f!==void 0?f:i;if(!(d==null||d.length===0)){var p=NA(c);d.forEach((g,v)=>{var y=l==null||a?v:String(Bt(g,l,null)),x=Bt(g,c.dataKey,0),w;s.has(y)?w=s.get(y):w={},Object.assign(w,{[p]:x}),s.set(y,w)})}}),Array.from(s.values())}function by(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var ad=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function xy(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function xse(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return!1}var fn=e=>{var t=nt(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},gc=e=>e.tooltip.settings.axisId;function IA(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:(function(a){function l(){return a.apply(this,arguments)}return l.toString=function(){return a.toString()},l})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(a){var l=i[0],s=i[1];return l<=s?a>=l&&a<=s:a>=s&&a<=l},bandwidth:n?()=>n.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,l)=>{var s=e(a);if(s!=null){if(e.bandwidth&&l!==null&&l!==void 0&&l.position){var c=e.bandwidth();switch(l.position){case"middle":s+=c/2;break;case"end":s+=c;break}}return s}}}}}var Sse=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Xi(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];Ve(a)&&((n===void 0||a<n)&&(n=a),(r===void 0||a>r)&&(r=a))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t}default:return t}};function Wl(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function wse(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function LA(e){let t,n,r;e.length!==2?(t=Wl,n=(s,c)=>Wl(e(s),c),r=(s,c)=>e(s)-c):(t=e===Wl||e===wse?e:Ose,n=e,r=e);function i(s,c,f=0,d=s.length){if(f<d){if(t(c,c)!==0)return d;do{const p=f+d>>>1;n(s[p],c)<0?f=p+1:d=p}while(f<d)}return f}function a(s,c,f=0,d=s.length){if(f<d){if(t(c,c)!==0)return d;do{const p=f+d>>>1;n(s[p],c)<=0?f=p+1:d=p}while(f<d)}return f}function l(s,c,f=0,d=s.length){const p=i(s,c,f,d-1);return p>f&&r(s[p-1],c)>-r(s[p],c)?p-1:p}return{left:i,center:l,right:a}}function Ose(){return 0}function S$(e){return e===null?NaN:+e}function*Ase(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const kse=LA(Wl),ld=kse.right;LA(S$).center;class R_ extends Map{constructor(t,n=Tse){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(__(this,t))}has(t){return super.has(__(this,t))}set(t,n){return super.set(Cse(this,t),n)}delete(t){return super.delete(Ese(this,t))}}function __({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Cse({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Ese({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Tse(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Mse(e=Wl){if(e===Wl)return w$;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function w$(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Pse=Math.sqrt(50),Dse=Math.sqrt(10),Rse=Math.sqrt(2);function Jg(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),l=a>=Pse?10:a>=Dse?5:a>=Rse?2:1;let s,c,f;return i<0?(f=Math.pow(10,-i)/l,s=Math.round(e*f),c=Math.round(t*f),s/f<e&&++s,c/f>t&&--c,f=-f):(f=Math.pow(10,i)*l,s=Math.round(e/f),c=Math.round(t/f),s*f<e&&++s,c*f>t&&--c),c<s&&.5<=n&&n<2?Jg(e,t,n*2):[s,c,f]}function yw(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,l]=r?Jg(t,e,n):Jg(e,t,n);if(!(a>=i))return[];const s=a-i+1,c=new Array(s);if(r)if(l<0)for(let f=0;f<s;++f)c[f]=(a-f)/-l;else for(let f=0;f<s;++f)c[f]=(a-f)*l;else if(l<0)for(let f=0;f<s;++f)c[f]=(i+f)/-l;else for(let f=0;f<s;++f)c[f]=(i+f)*l;return c}function bw(e,t,n){return t=+t,e=+e,n=+n,Jg(e,t,n)[2]}function xw(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?bw(t,e,n):bw(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function N_(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function I_(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function O$(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?w$:Mse(i);r>n;){if(r-n>600){const c=r-n+1,f=t-n+1,d=Math.log(c),p=.5*Math.exp(2*d/3),g=.5*Math.sqrt(d*p*(c-p)/c)*(f-c/2<0?-1:1),v=Math.max(n,Math.floor(t-f*p/c+g)),y=Math.min(r,Math.floor(t+(c-f)*p/c+g));O$(e,t,v,y,i)}const a=e[t];let l=n,s=r;for(Mf(e,n,t),i(e[r],a)>0&&Mf(e,n,r);l<s;){for(Mf(e,l,s),++l,--s;i(e[l],a)<0;)++l;for(;i(e[s],a)>0;)--s}i(e[n],a)===0?Mf(e,n,s):(++s,Mf(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function Mf(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function _se(e,t,n){if(e=Float64Array.from(Ase(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return I_(e);if(t>=1)return N_(e);var r,i=(r-1)*t,a=Math.floor(i),l=N_(O$(e,a).subarray(0,a+1)),s=I_(e.subarray(a+1));return l+(s-l)*(i-a)}}function Nse(e,t,n=S$){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),l=+n(e[a],a,e),s=+n(e[a+1],a+1,e);return l+(s-l)*(i-a)}}function Ise(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=new Array(i);++r<i;)a[r]=e+r*n;return a}function ri(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ja(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const Sw=Symbol("implicit");function jA(){var e=new R_,t=[],n=[],r=Sw;function i(a){let l=e.get(a);if(l===void 0){if(r!==Sw)return r;e.set(a,l=t.push(a)-1)}return n[l%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new R_;for(const l of a)e.has(l)||e.set(l,t.push(l)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return jA(t,n).unknown(r)},ri.apply(i,arguments),i}function BA(){var e=jA().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,l,s=!1,c=0,f=0,d=.5;delete e.unknown;function p(){var g=t().length,v=i<r,y=v?i:r,x=v?r:i;a=(x-y)/Math.max(1,g-c+f*2),s&&(a=Math.floor(a)),y+=(x-y-a*(g-c))*d,l=a*(1-c),s&&(y=Math.round(y),l=Math.round(l));var w=Ise(g).map(function(A){return y+a*A});return n(v?w.reverse():w)}return e.domain=function(g){return arguments.length?(t(g),p()):t()},e.range=function(g){return arguments.length?([r,i]=g,r=+r,i=+i,p()):[r,i]},e.rangeRound=function(g){return[r,i]=g,r=+r,i=+i,s=!0,p()},e.bandwidth=function(){return l},e.step=function(){return a},e.round=function(g){return arguments.length?(s=!!g,p()):s},e.padding=function(g){return arguments.length?(c=Math.min(1,f=+g),p()):c},e.paddingInner=function(g){return arguments.length?(c=Math.min(1,g),p()):c},e.paddingOuter=function(g){return arguments.length?(f=+g,p()):f},e.align=function(g){return arguments.length?(d=Math.max(0,Math.min(1,g)),p()):d},e.copy=function(){return BA(t(),[r,i]).round(s).paddingInner(c).paddingOuter(f).align(d)},ri.apply(p(),arguments)}function A$(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return A$(t())},e}function Lse(){return A$(BA.apply(null,arguments).paddingInner(1))}function zA(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function k$(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function od(){}var Nh=.7,ev=1/Nh,Bu="\\s*([+-]?\\d+)\\s*",Ih="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Qi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",jse=/^#([0-9a-f]{3,8})$/,Bse=new RegExp(`^rgb\\(${Bu},${Bu},${Bu}\\)$`),zse=new RegExp(`^rgb\\(${Qi},${Qi},${Qi}\\)$`),$se=new RegExp(`^rgba\\(${Bu},${Bu},${Bu},${Ih}\\)$`),Hse=new RegExp(`^rgba\\(${Qi},${Qi},${Qi},${Ih}\\)$`),Use=new RegExp(`^hsl\\(${Ih},${Qi},${Qi}\\)$`),Fse=new RegExp(`^hsla\\(${Ih},${Qi},${Qi},${Ih}\\)$`),L_={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};zA(od,Lh,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:j_,formatHex:j_,formatHex8:qse,formatHsl:Wse,formatRgb:B_,toString:B_});function j_(){return this.rgb().formatHex()}function qse(){return this.rgb().formatHex8()}function Wse(){return C$(this).formatHsl()}function B_(){return this.rgb().formatRgb()}function Lh(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=jse.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?z_(t):n===3?new ur(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ym(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ym(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Bse.exec(e))?new ur(t[1],t[2],t[3],1):(t=zse.exec(e))?new ur(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=$se.exec(e))?ym(t[1],t[2],t[3],t[4]):(t=Hse.exec(e))?ym(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Use.exec(e))?U_(t[1],t[2]/100,t[3]/100,1):(t=Fse.exec(e))?U_(t[1],t[2]/100,t[3]/100,t[4]):L_.hasOwnProperty(e)?z_(L_[e]):e==="transparent"?new ur(NaN,NaN,NaN,0):null}function z_(e){return new ur(e>>16&255,e>>8&255,e&255,1)}function ym(e,t,n,r){return r<=0&&(e=t=n=NaN),new ur(e,t,n,r)}function Vse(e){return e instanceof od||(e=Lh(e)),e?(e=e.rgb(),new ur(e.r,e.g,e.b,e.opacity)):new ur}function ww(e,t,n,r){return arguments.length===1?Vse(e):new ur(e,t,n,r??1)}function ur(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}zA(ur,ww,k$(od,{brighter(e){return e=e==null?ev:Math.pow(ev,e),new ur(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Nh:Math.pow(Nh,e),new ur(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ur(es(this.r),es(this.g),es(this.b),tv(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:$_,formatHex:$_,formatHex8:Kse,formatRgb:H_,toString:H_}));function $_(){return`#${Vo(this.r)}${Vo(this.g)}${Vo(this.b)}`}function Kse(){return`#${Vo(this.r)}${Vo(this.g)}${Vo(this.b)}${Vo((isNaN(this.opacity)?1:this.opacity)*255)}`}function H_(){const e=tv(this.opacity);return`${e===1?"rgb(":"rgba("}${es(this.r)}, ${es(this.g)}, ${es(this.b)}${e===1?")":`, ${e})`}`}function tv(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function es(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Vo(e){return e=es(e),(e<16?"0":"")+e.toString(16)}function U_(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new hi(e,t,n,r)}function C$(e){if(e instanceof hi)return new hi(e.h,e.s,e.l,e.opacity);if(e instanceof od||(e=Lh(e)),!e)return new hi;if(e instanceof hi)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),l=NaN,s=a-i,c=(a+i)/2;return s?(t===a?l=(n-r)/s+(n<r)*6:n===a?l=(r-t)/s+2:l=(t-n)/s+4,s/=c<.5?a+i:2-a-i,l*=60):s=c>0&&c<1?0:l,new hi(l,s,c,e.opacity)}function Xse(e,t,n,r){return arguments.length===1?C$(e):new hi(e,t,n,r??1)}function hi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}zA(hi,Xse,k$(od,{brighter(e){return e=e==null?ev:Math.pow(ev,e),new hi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Nh:Math.pow(Nh,e),new hi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new ur(u1(e>=240?e-240:e+120,i,r),u1(e,i,r),u1(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new hi(F_(this.h),bm(this.s),bm(this.l),tv(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=tv(this.opacity);return`${e===1?"hsl(":"hsla("}${F_(this.h)}, ${bm(this.s)*100}%, ${bm(this.l)*100}%${e===1?")":`, ${e})`}`}}));function F_(e){return e=(e||0)%360,e<0?e+360:e}function bm(e){return Math.max(0,Math.min(1,e||0))}function u1(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const $A=e=>()=>e;function Qse(e,t){return function(n){return e+n*t}}function Yse(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Gse(e){return(e=+e)==1?E$:function(t,n){return n-t?Yse(t,n,e):$A(isNaN(t)?n:t)}}function E$(e,t){var n=t-e;return n?Qse(e,n):$A(isNaN(e)?t:e)}const q_=(function e(t){var n=Gse(t);function r(i,a){var l=n((i=ww(i)).r,(a=ww(a)).r),s=n(i.g,a.g),c=n(i.b,a.b),f=E$(i.opacity,a.opacity);return function(d){return i.r=l(d),i.g=s(d),i.b=c(d),i.opacity=f(d),i+""}}return r.gamma=e,r})(1);function Zse(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function Jse(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function eue(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),l;for(l=0;l<r;++l)i[l]=vc(e[l],t[l]);for(;l<n;++l)a[l]=t[l];return function(s){for(l=0;l<r;++l)a[l]=i[l](s);return a}}function tue(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function nv(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function nue(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=vc(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var Ow=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,c1=new RegExp(Ow.source,"g");function rue(e){return function(){return e}}function iue(e){return function(t){return e(t)+""}}function aue(e,t){var n=Ow.lastIndex=c1.lastIndex=0,r,i,a,l=-1,s=[],c=[];for(e=e+"",t=t+"";(r=Ow.exec(e))&&(i=c1.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[l]?s[l]+=a:s[++l]=a),(r=r[0])===(i=i[0])?s[l]?s[l]+=i:s[++l]=i:(s[++l]=null,c.push({i:l,x:nv(r,i)})),n=c1.lastIndex;return n<t.length&&(a=t.slice(n),s[l]?s[l]+=a:s[++l]=a),s.length<2?c[0]?iue(c[0].x):rue(t):(t=c.length,function(f){for(var d=0,p;d<t;++d)s[(p=c[d]).i]=p.x(f);return s.join("")})}function vc(e,t){var n=typeof t,r;return t==null||n==="boolean"?$A(t):(n==="number"?nv:n==="string"?(r=Lh(t))?(t=r,q_):aue:t instanceof Lh?q_:t instanceof Date?tue:Jse(t)?Zse:Array.isArray(t)?eue:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?nue:nv)(e,t)}function HA(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function lue(e,t){t===void 0&&(t=e,e=vc);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(l){var s=Math.max(0,Math.min(r-1,Math.floor(l*=r)));return a[s](l-s)}}function oue(e){return function(){return e}}function rv(e){return+e}var W_=[0,1];function qn(e){return e}function Aw(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:oue(isNaN(t)?NaN:.5)}function sue(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function uue(e,t,n){var r=e[0],i=e[1],a=t[0],l=t[1];return i<r?(r=Aw(i,r),a=n(l,a)):(r=Aw(r,i),a=n(a,l)),function(s){return a(r(s))}}function cue(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),l=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++l<r;)i[l]=Aw(e[l],e[l+1]),a[l]=n(t[l],t[l+1]);return function(s){var c=ld(e,s,1,r)-1;return a[c](i[c](s))}}function sd(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Sy(){var e=W_,t=W_,n=vc,r,i,a,l=qn,s,c,f;function d(){var g=Math.min(e.length,t.length);return l!==qn&&(l=sue(e[0],e[g-1])),s=g>2?cue:uue,c=f=null,p}function p(g){return g==null||isNaN(g=+g)?a:(c||(c=s(e.map(r),t,n)))(r(l(g)))}return p.invert=function(g){return l(i((f||(f=s(t,e.map(r),nv)))(g)))},p.domain=function(g){return arguments.length?(e=Array.from(g,rv),d()):e.slice()},p.range=function(g){return arguments.length?(t=Array.from(g),d()):t.slice()},p.rangeRound=function(g){return t=Array.from(g),n=HA,d()},p.clamp=function(g){return arguments.length?(l=g?!0:qn,d()):l!==qn},p.interpolate=function(g){return arguments.length?(n=g,d()):n},p.unknown=function(g){return arguments.length?(a=g,p):a},function(g,v){return r=g,i=v,d()}}function UA(){return Sy()(qn,qn)}function fue(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function iv(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function ec(e){return e=iv(Math.abs(e)),e?e[1]:NaN}function hue(e,t){return function(n,r){for(var i=n.length,a=[],l=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[l=(l+1)%e.length];return a.reverse().join(t)}}function due(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var pue=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function jh(e){if(!(t=pue.exec(e)))throw new Error("invalid format: "+e);var t;return new FA({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}jh.prototype=FA.prototype;function FA(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}FA.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function mue(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var av;function gue(e,t){var n=iv(e,t);if(!n)return av=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(av=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,l=r.length;return a===l?r:a>l?r+new Array(a-l+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+iv(e,Math.max(0,t+a-1))[0]}function V_(e,t){var n=iv(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const K_={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:fue,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>V_(e*100,t),r:V_,s:gue,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function X_(e){return e}var Q_=Array.prototype.map,Y_=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function vue(e){var t=e.grouping===void 0||e.thousands===void 0?X_:hue(Q_.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?X_:due(Q_.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function f(p,g){p=jh(p);var v=p.fill,y=p.align,x=p.sign,w=p.symbol,A=p.zero,k=p.width,E=p.comma,P=p.precision,T=p.trim,M=p.type;M==="n"?(E=!0,M="g"):K_[M]||(P===void 0&&(P=12),T=!0,M="g"),(A||v==="0"&&y==="=")&&(A=!0,v="0",y="=");var R=(g&&g.prefix!==void 0?g.prefix:"")+(w==="$"?n:w==="#"&&/[boxX]/.test(M)?"0"+M.toLowerCase():""),L=(w==="$"?r:/[%p]/.test(M)?l:"")+(g&&g.suffix!==void 0?g.suffix:""),H=K_[M],K=/[defgprs%]/.test(M);P=P===void 0?6:/[gprs]/.test(M)?Math.max(1,Math.min(21,P)):Math.max(0,Math.min(20,P));function V(B){var ae=R,ie=L,oe,z,G;if(M==="c")ie=H(B)+ie,B="";else{B=+B;var ne=B<0||1/B<0;if(B=isNaN(B)?c:H(Math.abs(B),P),T&&(B=mue(B)),ne&&+B==0&&x!=="+"&&(ne=!1),ae=(ne?x==="("?x:s:x==="-"||x==="("?"":x)+ae,ie=(M==="s"&&!isNaN(B)&&av!==void 0?Y_[8+av/3]:"")+ie+(ne&&x==="("?")":""),K){for(oe=-1,z=B.length;++oe<z;)if(G=B.charCodeAt(oe),48>G||G>57){ie=(G===46?i+B.slice(oe+1):B.slice(oe))+ie,B=B.slice(0,oe);break}}}E&&!A&&(B=t(B,1/0));var ce=ae.length+B.length+ie.length,fe=ce<k?new Array(k-ce+1).join(v):"";switch(E&&A&&(B=t(fe+B,fe.length?k-ie.length:1/0),fe=""),y){case"<":B=ae+B+ie+fe;break;case"=":B=ae+fe+B+ie;break;case"^":B=fe.slice(0,ce=fe.length>>1)+ae+B+ie+fe.slice(ce);break;default:B=fe+ae+B+ie;break}return a(B)}return V.toString=function(){return p+""},V}function d(p,g){var v=Math.max(-8,Math.min(8,Math.floor(ec(g)/3)))*3,y=Math.pow(10,-v),x=f((p=jh(p),p.type="f",p),{suffix:Y_[8+v/3]});return function(w){return x(y*w)}}return{format:f,formatPrefix:d}}var xm,qA,T$;yue({thousands:",",grouping:[3],currency:["$",""]});function yue(e){return xm=vue(e),qA=xm.format,T$=xm.formatPrefix,xm}function bue(e){return Math.max(0,-ec(Math.abs(e)))}function xue(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ec(t)/3)))*3-ec(Math.abs(e)))}function Sue(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ec(t)-ec(e))+1}function M$(e,t,n,r){var i=xw(e,t,n),a;switch(r=jh(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=xue(i,l))&&(r.precision=a),T$(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=Sue(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=bue(i))&&(r.precision=a-(r.type==="%")*2);break}}return qA(r)}function ao(e){var t=e.domain;return e.ticks=function(n){var r=t();return yw(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return M$(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,l=r[i],s=r[a],c,f,d=10;for(s<l&&(f=l,l=s,s=f,f=i,i=a,a=f);d-- >0;){if(f=bw(l,s,n),f===c)return r[i]=l,r[a]=s,t(r);if(f>0)l=Math.floor(l/f)*f,s=Math.ceil(s/f)*f;else if(f<0)l=Math.ceil(l*f)/f,s=Math.floor(s*f)/f;else break;c=f}return e},e}function P$(){var e=UA();return e.copy=function(){return sd(e,P$())},ri.apply(e,arguments),ao(e)}function D$(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,rv),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return D$(e).unknown(t)},e=arguments.length?Array.from(e,rv):[0,1],ao(n)}function R$(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],l;return a<i&&(l=n,n=r,r=l,l=i,i=a,a=l),e[n]=t.floor(i),e[r]=t.ceil(a),e}function G_(e){return Math.log(e)}function Z_(e){return Math.exp(e)}function wue(e){return-Math.log(-e)}function Oue(e){return-Math.exp(-e)}function Aue(e){return isFinite(e)?+("1e"+e):e<0?0:e}function kue(e){return e===10?Aue:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Cue(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function J_(e){return(t,n)=>-e(-t,n)}function WA(e){const t=e(G_,Z_),n=t.domain;let r=10,i,a;function l(){return i=Cue(r),a=kue(r),n()[0]<0?(i=J_(i),a=J_(a),e(wue,Oue)):e(G_,Z_),t}return t.base=function(s){return arguments.length?(r=+s,l()):r},t.domain=function(s){return arguments.length?(n(s),l()):n()},t.ticks=s=>{const c=n();let f=c[0],d=c[c.length-1];const p=d<f;p&&([f,d]=[d,f]);let g=i(f),v=i(d),y,x;const w=s==null?10:+s;let A=[];if(!(r%1)&&v-g<w){if(g=Math.floor(g),v=Math.ceil(v),f>0){for(;g<=v;++g)for(y=1;y<r;++y)if(x=g<0?y/a(-g):y*a(g),!(x<f)){if(x>d)break;A.push(x)}}else for(;g<=v;++g)for(y=r-1;y>=1;--y)if(x=g>0?y/a(-g):y*a(g),!(x<f)){if(x>d)break;A.push(x)}A.length*2<w&&(A=yw(f,d,w))}else A=yw(g,v,Math.min(v-g,w)).map(a);return p?A.reverse():A},t.tickFormat=(s,c)=>{if(s==null&&(s=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=jh(c)).precision==null&&(c.trim=!0),c=qA(c)),s===1/0)return c;const f=Math.max(1,r*s/t.ticks().length);return d=>{let p=d/a(Math.round(i(d)));return p*r<r-.5&&(p*=r),p<=f?c(d):""}},t.nice=()=>n(R$(n(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),t}function _$(){const e=WA(Sy()).domain([1,10]);return e.copy=()=>sd(e,_$()).base(e.base()),ri.apply(e,arguments),e}function eN(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function tN(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function VA(e){var t=1,n=e(eN(t),tN(t));return n.constant=function(r){return arguments.length?e(eN(t=+r),tN(t)):t},ao(n)}function N$(){var e=VA(Sy());return e.copy=function(){return sd(e,N$()).constant(e.constant())},ri.apply(e,arguments)}function nN(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Eue(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Tue(e){return e<0?-e*e:e*e}function KA(e){var t=e(qn,qn),n=1;function r(){return n===1?e(qn,qn):n===.5?e(Eue,Tue):e(nN(n),nN(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},ao(t)}function XA(){var e=KA(Sy());return e.copy=function(){return sd(e,XA()).exponent(e.exponent())},ri.apply(e,arguments),e}function Mue(){return XA.apply(null,arguments).exponent(.5)}function rN(e){return Math.sign(e)*e*e}function Pue(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function I$(){var e=UA(),t=[0,1],n=!1,r;function i(a){var l=Pue(e(a));return isNaN(l)?r:n?Math.round(l):l}return i.invert=function(a){return e.invert(rN(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,rv)).map(rN)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(n=!!a,i):n},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return I$(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},ri.apply(i,arguments),ao(i)}function L$(){var e=[],t=[],n=[],r;function i(){var l=0,s=Math.max(1,t.length);for(n=new Array(s-1);++l<s;)n[l-1]=Nse(e,l/s);return a}function a(l){return l==null||isNaN(l=+l)?r:t[ld(n,l)]}return a.invertExtent=function(l){var s=t.indexOf(l);return s<0?[NaN,NaN]:[s>0?n[s-1]:e[0],s<n.length?n[s]:e[e.length-1]]},a.domain=function(l){if(!arguments.length)return e.slice();e=[];for(let s of l)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(Wl),i()},a.range=function(l){return arguments.length?(t=Array.from(l),i()):t.slice()},a.unknown=function(l){return arguments.length?(r=l,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return L$().domain(e).range(t).unknown(r)},ri.apply(a,arguments)}function j$(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function l(c){return c!=null&&c<=c?i[ld(r,c,0,n)]:a}function s(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*t-(c-n)*e)/(n+1);return l}return l.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,s()):[e,t]},l.range=function(c){return arguments.length?(n=(i=Array.from(c)).length-1,s()):i.slice()},l.invertExtent=function(c){var f=i.indexOf(c);return f<0?[NaN,NaN]:f<1?[e,r[0]]:f>=n?[r[n-1],t]:[r[f-1],r[f]]},l.unknown=function(c){return arguments.length&&(a=c),l},l.thresholds=function(){return r.slice()},l.copy=function(){return j$().domain([e,t]).range(i).unknown(a)},ri.apply(ao(l),arguments)}function B$(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[ld(e,a,0,r)]:n}return i.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var l=t.indexOf(a);return[e[l-1],e[l]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return B$().domain(e).range(t).unknown(n)},ri.apply(i,arguments)}const f1=new Date,h1=new Date;function Zt(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const l=i(a),s=i.ceil(a);return a-l<s-a?l:s},i.offset=(a,l)=>(t(a=new Date(+a),l==null?1:Math.floor(l)),a),i.range=(a,l,s)=>{const c=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a<l)||!(s>0))return c;let f;do c.push(f=new Date(+a)),t(a,s),e(a);while(f<a&&a<l);return c},i.filter=a=>Zt(l=>{if(l>=l)for(;e(l),!a(l);)l.setTime(l-1)},(l,s)=>{if(l>=l)if(s<0)for(;++s<=0;)for(;t(l,-1),!a(l););else for(;--s>=0;)for(;t(l,1),!a(l););}),n&&(i.count=(a,l)=>(f1.setTime(+a),h1.setTime(+l),e(f1),e(h1),Math.floor(n(f1,h1))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?l=>r(l)%a===0:l=>i.count(0,l)%a===0):i)),i}const lv=Zt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);lv.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Zt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):lv);lv.range;const Ra=1e3,Zr=Ra*60,_a=Zr*60,Va=_a*24,QA=Va*7,iN=Va*30,d1=Va*365,Ko=Zt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ra)},(e,t)=>(t-e)/Ra,e=>e.getUTCSeconds());Ko.range;const YA=Zt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ra)},(e,t)=>{e.setTime(+e+t*Zr)},(e,t)=>(t-e)/Zr,e=>e.getMinutes());YA.range;const GA=Zt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Zr)},(e,t)=>(t-e)/Zr,e=>e.getUTCMinutes());GA.range;const ZA=Zt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ra-e.getMinutes()*Zr)},(e,t)=>{e.setTime(+e+t*_a)},(e,t)=>(t-e)/_a,e=>e.getHours());ZA.range;const JA=Zt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*_a)},(e,t)=>(t-e)/_a,e=>e.getUTCHours());JA.range;const ud=Zt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Zr)/Va,e=>e.getDate()-1);ud.range;const wy=Zt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Va,e=>e.getUTCDate()-1);wy.range;const z$=Zt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Va,e=>Math.floor(e/Va));z$.range;function bs(e){return Zt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Zr)/QA)}const Oy=bs(0),ov=bs(1),Due=bs(2),Rue=bs(3),tc=bs(4),_ue=bs(5),Nue=bs(6);Oy.range;ov.range;Due.range;Rue.range;tc.range;_ue.range;Nue.range;function xs(e){return Zt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/QA)}const Ay=xs(0),sv=xs(1),Iue=xs(2),Lue=xs(3),nc=xs(4),jue=xs(5),Bue=xs(6);Ay.range;sv.range;Iue.range;Lue.range;nc.range;jue.range;Bue.range;const ek=Zt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());ek.range;const tk=Zt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());tk.range;const Ka=Zt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Ka.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Zt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Ka.range;const Xa=Zt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Xa.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Zt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Xa.range;function $$(e,t,n,r,i,a){const l=[[Ko,1,Ra],[Ko,5,5*Ra],[Ko,15,15*Ra],[Ko,30,30*Ra],[a,1,Zr],[a,5,5*Zr],[a,15,15*Zr],[a,30,30*Zr],[i,1,_a],[i,3,3*_a],[i,6,6*_a],[i,12,12*_a],[r,1,Va],[r,2,2*Va],[n,1,QA],[t,1,iN],[t,3,3*iN],[e,1,d1]];function s(f,d,p){const g=d<f;g&&([f,d]=[d,f]);const v=p&&typeof p.range=="function"?p:c(f,d,p),y=v?v.range(f,+d+1):[];return g?y.reverse():y}function c(f,d,p){const g=Math.abs(d-f)/p,v=LA(([,,w])=>w).right(l,g);if(v===l.length)return e.every(xw(f/d1,d/d1,p));if(v===0)return lv.every(Math.max(xw(f,d,p),1));const[y,x]=l[g/l[v-1][2]<l[v][2]/g?v-1:v];return y.every(x)}return[s,c]}const[zue,$ue]=$$(Xa,tk,Ay,z$,JA,GA),[Hue,Uue]=$$(Ka,ek,Oy,ud,ZA,YA);function p1(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function m1(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Pf(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Fue(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,l=e.shortDays,s=e.months,c=e.shortMonths,f=Df(i),d=Rf(i),p=Df(a),g=Rf(a),v=Df(l),y=Rf(l),x=Df(s),w=Rf(s),A=Df(c),k=Rf(c),E={a:G,A:ne,b:ce,B:fe,c:null,d:cN,e:cN,f:hce,g:wce,G:Ace,H:uce,I:cce,j:fce,L:H$,m:dce,M:pce,p:N,q:X,Q:dN,s:pN,S:mce,u:gce,U:vce,V:yce,w:bce,W:xce,x:null,X:null,y:Sce,Y:Oce,Z:kce,"%":hN},P={a:re,A:le,b:ge,B:Oe,c:null,d:fN,e:fN,f:Mce,g:zce,G:Hce,H:Cce,I:Ece,j:Tce,L:F$,m:Pce,M:Dce,p:Pe,q:mt,Q:dN,s:pN,S:Rce,u:_ce,U:Nce,V:Ice,w:Lce,W:jce,x:null,X:null,y:Bce,Y:$ce,Z:Uce,"%":hN},T={a:K,A:V,b:B,B:ae,c:ie,d:sN,e:sN,f:ace,g:oN,G:lN,H:uN,I:uN,j:tce,L:ice,m:ece,M:nce,p:H,q:Jue,Q:oce,s:sce,S:rce,u:Xue,U:Que,V:Yue,w:Kue,W:Gue,x:oe,X:z,y:oN,Y:lN,Z:Zue,"%":lce};E.x=M(n,E),E.X=M(r,E),E.c=M(t,E),P.x=M(n,P),P.X=M(r,P),P.c=M(t,P);function M(se,Te){return function(Ee){var ue=[],_t=-1,_e=0,xe=se.length,gt,dn,la;for(Ee instanceof Date||(Ee=new Date(+Ee));++_t<xe;)se.charCodeAt(_t)===37&&(ue.push(se.slice(_e,_t)),(dn=aN[gt=se.charAt(++_t)])!=null?gt=se.charAt(++_t):dn=gt==="e"?" ":"0",(la=Te[gt])&&(gt=la(Ee,dn)),ue.push(gt),_e=_t+1);return ue.push(se.slice(_e,_t)),ue.join("")}}function R(se,Te){return function(Ee){var ue=Pf(1900,void 0,1),_t=L(ue,se,Ee+="",0),_e,xe;if(_t!=Ee.length)return null;if("Q"in ue)return new Date(ue.Q);if("s"in ue)return new Date(ue.s*1e3+("L"in ue?ue.L:0));if(Te&&!("Z"in ue)&&(ue.Z=0),"p"in ue&&(ue.H=ue.H%12+ue.p*12),ue.m===void 0&&(ue.m="q"in ue?ue.q:0),"V"in ue){if(ue.V<1||ue.V>53)return null;"w"in ue||(ue.w=1),"Z"in ue?(_e=m1(Pf(ue.y,0,1)),xe=_e.getUTCDay(),_e=xe>4||xe===0?sv.ceil(_e):sv(_e),_e=wy.offset(_e,(ue.V-1)*7),ue.y=_e.getUTCFullYear(),ue.m=_e.getUTCMonth(),ue.d=_e.getUTCDate()+(ue.w+6)%7):(_e=p1(Pf(ue.y,0,1)),xe=_e.getDay(),_e=xe>4||xe===0?ov.ceil(_e):ov(_e),_e=ud.offset(_e,(ue.V-1)*7),ue.y=_e.getFullYear(),ue.m=_e.getMonth(),ue.d=_e.getDate()+(ue.w+6)%7)}else("W"in ue||"U"in ue)&&("w"in ue||(ue.w="u"in ue?ue.u%7:"W"in ue?1:0),xe="Z"in ue?m1(Pf(ue.y,0,1)).getUTCDay():p1(Pf(ue.y,0,1)).getDay(),ue.m=0,ue.d="W"in ue?(ue.w+6)%7+ue.W*7-(xe+5)%7:ue.w+ue.U*7-(xe+6)%7);return"Z"in ue?(ue.H+=ue.Z/100|0,ue.M+=ue.Z%100,m1(ue)):p1(ue)}}function L(se,Te,Ee,ue){for(var _t=0,_e=Te.length,xe=Ee.length,gt,dn;_t<_e;){if(ue>=xe)return-1;if(gt=Te.charCodeAt(_t++),gt===37){if(gt=Te.charAt(_t++),dn=T[gt in aN?Te.charAt(_t++):gt],!dn||(ue=dn(se,Ee,ue))<0)return-1}else if(gt!=Ee.charCodeAt(ue++))return-1}return ue}function H(se,Te,Ee){var ue=f.exec(Te.slice(Ee));return ue?(se.p=d.get(ue[0].toLowerCase()),Ee+ue[0].length):-1}function K(se,Te,Ee){var ue=v.exec(Te.slice(Ee));return ue?(se.w=y.get(ue[0].toLowerCase()),Ee+ue[0].length):-1}function V(se,Te,Ee){var ue=p.exec(Te.slice(Ee));return ue?(se.w=g.get(ue[0].toLowerCase()),Ee+ue[0].length):-1}function B(se,Te,Ee){var ue=A.exec(Te.slice(Ee));return ue?(se.m=k.get(ue[0].toLowerCase()),Ee+ue[0].length):-1}function ae(se,Te,Ee){var ue=x.exec(Te.slice(Ee));return ue?(se.m=w.get(ue[0].toLowerCase()),Ee+ue[0].length):-1}function ie(se,Te,Ee){return L(se,t,Te,Ee)}function oe(se,Te,Ee){return L(se,n,Te,Ee)}function z(se,Te,Ee){return L(se,r,Te,Ee)}function G(se){return l[se.getDay()]}function ne(se){return a[se.getDay()]}function ce(se){return c[se.getMonth()]}function fe(se){return s[se.getMonth()]}function N(se){return i[+(se.getHours()>=12)]}function X(se){return 1+~~(se.getMonth()/3)}function re(se){return l[se.getUTCDay()]}function le(se){return a[se.getUTCDay()]}function ge(se){return c[se.getUTCMonth()]}function Oe(se){return s[se.getUTCMonth()]}function Pe(se){return i[+(se.getUTCHours()>=12)]}function mt(se){return 1+~~(se.getUTCMonth()/3)}return{format:function(se){var Te=M(se+="",E);return Te.toString=function(){return se},Te},parse:function(se){var Te=R(se+="",!1);return Te.toString=function(){return se},Te},utcFormat:function(se){var Te=M(se+="",P);return Te.toString=function(){return se},Te},utcParse:function(se){var Te=R(se+="",!0);return Te.toString=function(){return se},Te}}}var aN={"-":"",_:" ",0:"0"},hn=/^\s*\d+/,que=/^%/,Wue=/[\\^$*+?|[\]().{}]/g;function Ge(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(t)+i:i)}function Vue(e){return e.replace(Wue,"\\$&")}function Df(e){return new RegExp("^(?:"+e.map(Vue).join("|")+")","i")}function Rf(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Kue(e,t,n){var r=hn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Xue(e,t,n){var r=hn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Que(e,t,n){var r=hn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Yue(e,t,n){var r=hn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Gue(e,t,n){var r=hn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function lN(e,t,n){var r=hn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function oN(e,t,n){var r=hn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Zue(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Jue(e,t,n){var r=hn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function ece(e,t,n){var r=hn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function sN(e,t,n){var r=hn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function tce(e,t,n){var r=hn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function uN(e,t,n){var r=hn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function nce(e,t,n){var r=hn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function rce(e,t,n){var r=hn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function ice(e,t,n){var r=hn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function ace(e,t,n){var r=hn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function lce(e,t,n){var r=que.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function oce(e,t,n){var r=hn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function sce(e,t,n){var r=hn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function cN(e,t){return Ge(e.getDate(),t,2)}function uce(e,t){return Ge(e.getHours(),t,2)}function cce(e,t){return Ge(e.getHours()%12||12,t,2)}function fce(e,t){return Ge(1+ud.count(Ka(e),e),t,3)}function H$(e,t){return Ge(e.getMilliseconds(),t,3)}function hce(e,t){return H$(e,t)+"000"}function dce(e,t){return Ge(e.getMonth()+1,t,2)}function pce(e,t){return Ge(e.getMinutes(),t,2)}function mce(e,t){return Ge(e.getSeconds(),t,2)}function gce(e){var t=e.getDay();return t===0?7:t}function vce(e,t){return Ge(Oy.count(Ka(e)-1,e),t,2)}function U$(e){var t=e.getDay();return t>=4||t===0?tc(e):tc.ceil(e)}function yce(e,t){return e=U$(e),Ge(tc.count(Ka(e),e)+(Ka(e).getDay()===4),t,2)}function bce(e){return e.getDay()}function xce(e,t){return Ge(ov.count(Ka(e)-1,e),t,2)}function Sce(e,t){return Ge(e.getFullYear()%100,t,2)}function wce(e,t){return e=U$(e),Ge(e.getFullYear()%100,t,2)}function Oce(e,t){return Ge(e.getFullYear()%1e4,t,4)}function Ace(e,t){var n=e.getDay();return e=n>=4||n===0?tc(e):tc.ceil(e),Ge(e.getFullYear()%1e4,t,4)}function kce(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ge(t/60|0,"0",2)+Ge(t%60,"0",2)}function fN(e,t){return Ge(e.getUTCDate(),t,2)}function Cce(e,t){return Ge(e.getUTCHours(),t,2)}function Ece(e,t){return Ge(e.getUTCHours()%12||12,t,2)}function Tce(e,t){return Ge(1+wy.count(Xa(e),e),t,3)}function F$(e,t){return Ge(e.getUTCMilliseconds(),t,3)}function Mce(e,t){return F$(e,t)+"000"}function Pce(e,t){return Ge(e.getUTCMonth()+1,t,2)}function Dce(e,t){return Ge(e.getUTCMinutes(),t,2)}function Rce(e,t){return Ge(e.getUTCSeconds(),t,2)}function _ce(e){var t=e.getUTCDay();return t===0?7:t}function Nce(e,t){return Ge(Ay.count(Xa(e)-1,e),t,2)}function q$(e){var t=e.getUTCDay();return t>=4||t===0?nc(e):nc.ceil(e)}function Ice(e,t){return e=q$(e),Ge(nc.count(Xa(e),e)+(Xa(e).getUTCDay()===4),t,2)}function Lce(e){return e.getUTCDay()}function jce(e,t){return Ge(sv.count(Xa(e)-1,e),t,2)}function Bce(e,t){return Ge(e.getUTCFullYear()%100,t,2)}function zce(e,t){return e=q$(e),Ge(e.getUTCFullYear()%100,t,2)}function $ce(e,t){return Ge(e.getUTCFullYear()%1e4,t,4)}function Hce(e,t){var n=e.getUTCDay();return e=n>=4||n===0?nc(e):nc.ceil(e),Ge(e.getUTCFullYear()%1e4,t,4)}function Uce(){return"+0000"}function hN(){return"%"}function dN(e){return+e}function pN(e){return Math.floor(+e/1e3)}var cu,W$,V$;Fce({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Fce(e){return cu=Fue(e),W$=cu.format,cu.parse,V$=cu.utcFormat,cu.utcParse,cu}function qce(e){return new Date(e)}function Wce(e){return e instanceof Date?+e:+new Date(+e)}function nk(e,t,n,r,i,a,l,s,c,f){var d=UA(),p=d.invert,g=d.domain,v=f(".%L"),y=f(":%S"),x=f("%I:%M"),w=f("%I %p"),A=f("%a %d"),k=f("%b %d"),E=f("%B"),P=f("%Y");function T(M){return(c(M)<M?v:s(M)<M?y:l(M)<M?x:a(M)<M?w:r(M)<M?i(M)<M?A:k:n(M)<M?E:P)(M)}return d.invert=function(M){return new Date(p(M))},d.domain=function(M){return arguments.length?g(Array.from(M,Wce)):g().map(qce)},d.ticks=function(M){var R=g();return e(R[0],R[R.length-1],M??10)},d.tickFormat=function(M,R){return R==null?T:f(R)},d.nice=function(M){var R=g();return(!M||typeof M.range!="function")&&(M=t(R[0],R[R.length-1],M??10)),M?g(R$(R,M)):d},d.copy=function(){return sd(d,nk(e,t,n,r,i,a,l,s,c,f))},d}function Vce(){return ri.apply(nk(Hue,Uue,Ka,ek,Oy,ud,ZA,YA,Ko,W$).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Kce(){return ri.apply(nk(zue,$ue,Xa,tk,Ay,wy,JA,GA,Ko,V$).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function ky(){var e=0,t=1,n,r,i,a,l=qn,s=!1,c;function f(p){return p==null||isNaN(p=+p)?c:l(i===0?.5:(p=(a(p)-n)*i,s?Math.max(0,Math.min(1,p)):p))}f.domain=function(p){return arguments.length?([e,t]=p,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),f):[e,t]},f.clamp=function(p){return arguments.length?(s=!!p,f):s},f.interpolator=function(p){return arguments.length?(l=p,f):l};function d(p){return function(g){var v,y;return arguments.length?([v,y]=g,l=p(v,y),f):[l(0),l(1)]}}return f.range=d(vc),f.rangeRound=d(HA),f.unknown=function(p){return arguments.length?(c=p,f):c},function(p){return a=p,n=p(e),r=p(t),i=n===r?0:1/(r-n),f}}function lo(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function K$(){var e=ao(ky()(qn));return e.copy=function(){return lo(e,K$())},Ja.apply(e,arguments)}function X$(){var e=WA(ky()).domain([1,10]);return e.copy=function(){return lo(e,X$()).base(e.base())},Ja.apply(e,arguments)}function Q$(){var e=VA(ky());return e.copy=function(){return lo(e,Q$()).constant(e.constant())},Ja.apply(e,arguments)}function rk(){var e=KA(ky());return e.copy=function(){return lo(e,rk()).exponent(e.exponent())},Ja.apply(e,arguments)}function Xce(){return rk.apply(null,arguments).exponent(.5)}function Y$(){var e=[],t=qn;function n(r){if(r!=null&&!isNaN(r=+r))return t((ld(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(Wl),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,a)=>_se(e,a/r))},n.copy=function(){return Y$(t).domain(e)},Ja.apply(n,arguments)}function Cy(){var e=0,t=.5,n=1,r=1,i,a,l,s,c,f=qn,d,p=!1,g;function v(x){return isNaN(x=+x)?g:(x=.5+((x=+d(x))-a)*(r*x<r*a?s:c),f(p?Math.max(0,Math.min(1,x)):x))}v.domain=function(x){return arguments.length?([e,t,n]=x,i=d(e=+e),a=d(t=+t),l=d(n=+n),s=i===a?0:.5/(a-i),c=a===l?0:.5/(l-a),r=a<i?-1:1,v):[e,t,n]},v.clamp=function(x){return arguments.length?(p=!!x,v):p},v.interpolator=function(x){return arguments.length?(f=x,v):f};function y(x){return function(w){var A,k,E;return arguments.length?([A,k,E]=w,f=lue(x,[A,k,E]),v):[f(0),f(.5),f(1)]}}return v.range=y(vc),v.rangeRound=y(HA),v.unknown=function(x){return arguments.length?(g=x,v):g},function(x){return d=x,i=x(e),a=x(t),l=x(n),s=i===a?0:.5/(a-i),c=a===l?0:.5/(l-a),r=a<i?-1:1,v}}function G$(){var e=ao(Cy()(qn));return e.copy=function(){return lo(e,G$())},Ja.apply(e,arguments)}function Z$(){var e=WA(Cy()).domain([.1,1,10]);return e.copy=function(){return lo(e,Z$()).base(e.base())},Ja.apply(e,arguments)}function J$(){var e=VA(Cy());return e.copy=function(){return lo(e,J$()).constant(e.constant())},Ja.apply(e,arguments)}function ik(){var e=KA(Cy());return e.copy=function(){return lo(e,ik()).exponent(e.exponent())},Ja.apply(e,arguments)}function Qce(){return ik.apply(null,arguments).exponent(.5)}const e4=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:BA,scaleDiverging:G$,scaleDivergingLog:Z$,scaleDivergingPow:ik,scaleDivergingSqrt:Qce,scaleDivergingSymlog:J$,scaleIdentity:D$,scaleImplicit:Sw,scaleLinear:P$,scaleLog:_$,scaleOrdinal:jA,scalePoint:Lse,scalePow:XA,scaleQuantile:L$,scaleQuantize:j$,scaleRadial:I$,scaleSequential:K$,scaleSequentialLog:X$,scaleSequentialPow:rk,scaleSequentialQuantile:Y$,scaleSequentialSqrt:Xce,scaleSequentialSymlog:Q$,scaleSqrt:Mue,scaleSymlog:N$,scaleThreshold:B$,scaleTime:Vce,scaleUtc:Kce,tickFormat:M$},Symbol.toStringTag,{value:"Module"}));function Yce(e){var t=e4;if(e in t&&typeof t[e]=="function")return t[e]();var n="scale".concat(Gh(e));if(n in t&&typeof t[n]=="function")return t[n]()}function mN(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=Yce(e);if(r!=null)return r.domain(t).range(n),r}}function ak(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?mN(e.scale,n,r):mN(t,n,r)}function Gce(e){return"scale".concat(Gh(e))}function Zce(e){return Gce(e)in e4}var t4=(e,t,n)=>{if(e!=null){var r=e.scale,i=e.type;if(r==="auto")return i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!t)?"point":i==="category"?"band":"linear";if(typeof r=="string")return Zce(r)?r:"point"}};function Jce(e,t){for(var n=0,r=e.length,i=e[0]<e[e.length-1];n<r;){var a=Math.floor((n+r)/2);(i?e[a]<t:e[a]>t)?n=a+1:r=a}return n}function n4(e,t){if(e){var n=t??e.domain(),r=n.map(a=>{var l;return(l=e(a))!==null&&l!==void 0?l:0}),i=e.range();if(!(n.length===0||i.length<2))return a=>{var l,s,c=Jce(r,a);if(c<=0)return n[0];if(c>=n.length)return n[n.length-1];var f=(l=r[c-1])!==null&&l!==void 0?l:0,d=(s=r[c])!==null&&s!==void 0?s:0;return Math.abs(a-f)<=Math.abs(a-d)?n[c-1]:n[c]}}}function efe(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):n4(e,void 0)}function gN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function uv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gN(Object(n),!0).forEach(function(r){tfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tfe(e,t,n){return(t=nfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nfe(e){var t=rfe(e,"string");return typeof t=="symbol"?t:t+""}function rfe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function r4(e,t){return ofe(e)||lfe(e,t)||afe(e,t)||ife()}function ife(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
110
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function afe(e,t){if(e){if(typeof e=="string")return vN(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vN(e,t):void 0}}function vN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function lfe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function ofe(e){if(Array.isArray(e))return e}var kw=[0,"auto"],Vt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0,niceTicks:"auto"},i4=(e,t)=>e.cartesianAxis.xAxis[t],el=(e,t)=>{var n=i4(e,t);return n??Vt},Kt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:kw,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,niceTicks:"auto",width:ed},a4=(e,t)=>e.cartesianAxis.yAxis[t],tl=(e,t)=>{var n=a4(e,t);return n??Kt},sfe={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},lk=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??sfe},Bn=(e,t,n)=>{switch(t){case"xAxis":return el(e,n);case"yAxis":return tl(e,n);case"zAxis":return lk(e,n);case"angleAxis":return DA(e,n);case"radiusAxis":return RA(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},ufe=(e,t,n)=>{switch(t){case"xAxis":return el(e,n);case"yAxis":return tl(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},cd=(e,t,n)=>{switch(t){case"xAxis":return el(e,n);case"yAxis":return tl(e,n);case"angleAxis":return DA(e,n);case"radiusAxis":return RA(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},l4=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function o4(e,t){return n=>{switch(e){case"xAxis":return"xAxisId"in n&&n.xAxisId===t;case"yAxis":return"yAxisId"in n&&n.yAxisId===t;case"zAxis":return"zAxisId"in n&&n.zAxisId===t;case"angleAxis":return"angleAxisId"in n&&n.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in n&&n.radiusAxisId===t;default:return!1}}}var Ey=e=>e.graphicalItems.cartesianItems,cfe=q([cn,yy],o4),s4=(e,t,n)=>e.filter(n).filter(r=>t?.includeHidden===!0?!0:!r.hide),yc=q([Ey,Bn,cfe],s4,{memoizeOptions:{resultEqualityCheck:xy}}),u4=q([yc],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(by)),c4=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),ffe=q([yc],c4),f4=e=>e.map(t=>t.data).filter(Boolean).flat(1),hfe=q([yc],e=>e.some(t=>!t.data)),h4=q([yc],f4,{memoizeOptions:{resultEqualityCheck:xy}}),d4=(e,t)=>{var n=t.chartData,r=n===void 0?[]:n,i=t.dataStartIndex,a=t.dataEndIndex;return e.length>0?e:r.slice(i,a+1)},ok=q([h4,id],d4),dfe=(e,t,n)=>t?.dataKey!=null?e.map(r=>({value:Bt(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:Bt(i,r)}))):e.map(r=>({value:r})),p4=(e,t,n,r,i,a)=>{var l=r.chartData,s=l===void 0?[]:l,c=r.dataStartIndex,f=r.dataEndIndex,d=dfe(e,t,n);if(i&&t?.dataKey!=null&&a.length>0){var p=s.slice(c,f+1),g=p.map(v=>({value:Bt(v,t.dataKey)})).filter(v=>v.value!=null);return[...g,...d]}return d},fd=q([ok,Bn,yc,id,hfe,h4],p4);function zu(e){if(Zi(e)||e instanceof Date){var t=Number(e);if(Ve(t))return t}}function yN(e){if(Array.isArray(e)){var t=[zu(e[0]),zu(e[1])];return Xi(t)?t:void 0}var n=zu(e);if(n!=null)return[n,n]}function Si(e){return e.map(zu).filter(sr)}function pfe(e,t){var n=zu(e),r=zu(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var mfe=q([fd],e=>e?.map(t=>t.value).sort(pfe));function m4(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function gfe(e,t,n){if(!n)return[];if(!n.length)return[];var r;if(typeof t=="number"&&!Gi(t))r=t;else if(Array.isArray(t)){var i=Si(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:Si(n.flatMap(a=>{var l=Bt(e,a.dataKey),s,c;if(Array.isArray(l)){var f=r4(l,2);s=f[0],c=f[1]}else s=c=l;if(!(!Ve(s)||!Ve(c)))return[r-s,r+c]}))}var Jt=e=>{var t=fn(e),n=gc(e);return cd(e,t,n)},rc=q([Jt],e=>e?.dataKey),vfe=q([u4,id,Jt],x$),g4=(e,t,n,r)=>{var i={},a=t.reduce((l,s)=>{if(s.stackId==null)return l;var c=l[s.stackId];return c==null&&(c=[]),c.push(s),l[s.stackId]=c,l},i);return Object.fromEntries(Object.entries(a).map(l=>{var s=r4(l,2),c=s[0],f=s[1],d=r?[...f].reverse():f,p=d.map(NA);return[c,{stackedData:Aie(e,p,n),graphicalItems:d}]}))},Cw=q([vfe,u4,py,d$],g4),v4=(e,t,n,r)=>{var i=t.dataStartIndex,a=t.dataEndIndex;if(r==null&&n!=="zAxis")return Mie(e,i,a)},yfe=q([Bn],e=>e.allowDataOverflow),sk=e=>{var t;if(e==null||!("domain"in e))return kw;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=Si(e.ticks);return[Math.min(...n),Math.max(...n)]}if(e.type==="category")return e.ticks.map(String)}return(t=e?.domain)!==null&&t!==void 0?t:kw},y4=q([Bn],sk),b4=q([y4,yfe],e$),bfe=q([Cw,ki,cn,b4],v4,{memoizeOptions:{resultEqualityCheck:ad}}),uk=e=>e.errorBars,xfe=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>m4(n,r)),cv=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.filter(Boolean);if(i.length!==0){var a=i.flat(),l=Math.min(...a),s=Math.max(...a);return[l,s]}},x4=function(t,n,r,i,a){var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],s,c;if(r.length>0&&r.forEach(f=>{var d,p=f.data!=null?[...f.data]:l,g=(d=i[f.id])===null||d===void 0?void 0:d.filter(v=>m4(a,v));p.forEach(v=>{var y,x=Bt(v,(y=n.dataKey)!==null&&y!==void 0?y:f.dataKey),w=gfe(v,x,g);if(w.length>=2){var A=Math.min(...w),k=Math.max(...w);(s==null||A<s)&&(s=A),(c==null||k>c)&&(c=k)}var E=yN(x);E!=null&&(s=s==null?E[0]:Math.min(s,E[0]),c=c==null?E[1]:Math.max(c,E[1]))})}),n?.dataKey!=null&&r.length===0&&t.forEach(f=>{var d=yN(Bt(f,n.dataKey));d!=null&&(s=s==null?d[0]:Math.min(s,d[0]),c=c==null?d[1]:Math.max(c,d[1]))}),Ve(s)&&Ve(c))return[s,c]},Sfe=q([ok,Bn,ffe,uk,cn,Goe],x4,{memoizeOptions:{resultEqualityCheck:ad}});function wfe(e){var t=e.value;if(Zi(t)||t instanceof Date)return t}var Ofe=(e,t,n)=>{var r=e.map(wfe).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&Rz(r))?J5(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},S4=e=>e.referenceElements.dots,bc=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),Afe=q([S4,cn,yy],bc),w4=e=>e.referenceElements.areas,kfe=q([w4,cn,yy],bc),O4=e=>e.referenceElements.lines,Cfe=q([O4,cn,yy],bc),A4=(e,t)=>{if(e!=null){var n=Si(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Efe=q(Afe,cn,A4),k4=(e,t)=>{if(e!=null){var n=Si(e.flatMap(r=>[t==="xAxis"?r.x1:r.y1,t==="xAxis"?r.x2:r.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Tfe=q([kfe,cn],k4);function Mfe(e){var t;if(e.x!=null)return Si([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:Si(n)}function Pfe(e){var t;if(e.y!=null)return Si([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:Si(n)}var C4=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?Mfe(r):Pfe(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Dfe=q([Cfe,cn],C4),Rfe=q(Efe,Dfe,Tfe,(e,t,n)=>cv(e,n,t)),E4=(e,t,n,r,i,a,l,s,c)=>{if(n!=null)return n;var f=l==="vertical"&&s==="xAxis"||l==="horizontal"&&s==="yAxis",d=f?cv(r,a,i):cv(a,i),p=rse(t,d,e.allowDataOverflow);return p??(e.allowDataOverflow&&d==null&&c!=null?c:p)},_fe=e=>{if(!(e==null||e.type!=="number"||!("ticks"in e)||e.ticks==null)){var t=Si(e.ticks);if(t.length!==0)return[Math.min(...t),Math.max(...t)]}},Nfe=q([Bn],_fe,{memoizeOptions:{resultEqualityCheck:ad}}),Ife=q([Bn,y4,b4,bfe,Sfe,Rfe,nt,cn,Nfe],E4,{memoizeOptions:{resultEqualityCheck:ad}}),Lfe=[0,1],T4=(e,t,n,r,i,a,l)=>{if(!((e==null||n==null||n.length===0)&&l===void 0)){var s=e.dataKey,c=e.type,f=Ya(t,a);if(f&&s==null){var d;return J5(0,(d=n?.length)!==null&&d!==void 0?d:0)}return c==="category"?Ofe(r,e,f):i==="expand"&&!f?Lfe:l}},ck=q([Bn,nt,ok,fd,py,cn,Ife],T4),xc=q([Bn,l4,TA],t4),M4=(e,t,n)=>{var r=t.niceTicks;if(r!=="none"){var i=sk(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&Xi(e)){if(a)return E_(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return T_(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&Xi(e))return E_(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&Xi(e))return T_(e,t.tickCount,t.allowDecimals,"adaptive")}}},fk=q([ck,cd,xc],M4),P4=(e,t,n,r)=>{if(r!=="angleAxis"&&e?.type==="number"&&Xi(t)&&Array.isArray(n)&&n.length>0){var i,a,l=t[0],s=(i=n[0])!==null&&i!==void 0?i:0,c=t[1],f=(a=n[n.length-1])!==null&&a!==void 0?a:0;return[Math.min(l,s),Math.max(c,f)]}return t},jfe=q([Bn,ck,fk,cn],P4),Bfe=q(fd,Bn,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(Si(e.map(p=>p.value))).sort((p,g)=>p-g),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var l=a-i;if(l===0)return 1/0;for(var s=0;s<r.length-1;s++){var c=r[s],f=r[s+1];if(!(c==null||f==null)){var d=f-c;n=Math.min(n,d)}}return n/l}}),D4=q(Bfe,nt,h$,un,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!Ve(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var l=bi(n,e*a),s=e*a/2;return s-l-(s-l)/a*l}return 0}),zfe=(e,t,n)=>{var r=el(e,t);return r==null||typeof r.padding!="string"?0:D4(e,"xAxis",t,n,r.padding)},$fe=(e,t,n)=>{var r=tl(e,t);return r==null||typeof r.padding!="string"?0:D4(e,"yAxis",t,n,r.padding)},Hfe=q(el,zfe,(e,t)=>{var n,r;if(e==null)return{left:0,right:0};var i=e.padding;return typeof i=="string"?{left:t,right:t}:{left:((n=i.left)!==null&&n!==void 0?n:0)+t,right:((r=i.right)!==null&&r!==void 0?r:0)+t}}),Ufe=q(tl,$fe,(e,t)=>{var n,r;if(e==null)return{top:0,bottom:0};var i=e.padding;return typeof i=="string"?{top:t,bottom:t}:{top:((n=i.top)!==null&&n!==void 0?n:0)+t,bottom:((r=i.bottom)!==null&&r!==void 0?r:0)+t}}),R4=q([un,Hfe,hy,fy,(e,t,n)=>n],(e,t,n,r,i)=>{var a=r.padding;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),_4=q([un,nt,Ufe,hy,fy,(e,t,n)=>n],(e,t,n,r,i,a)=>{var l=i.padding;return a?[r.height-l.bottom,l.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),hd=(e,t,n,r)=>{var i;switch(t){case"xAxis":return R4(e,n,r);case"yAxis":return _4(e,n,r);case"zAxis":return(i=lk(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return v$(e);case"radiusAxis":return y$(e,n);default:return}},N4=q([Bn,hd],my),Ffe=q([xc,jfe],Sse),hk=q([Bn,xc,Ffe,N4],ak),I4=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var i=n.type,a=n.scale,l=Ya(e,r);if(l&&(i==="number"||a!=="auto"))return t.map(s=>s.value)}},dk=q([nt,fd,cd,cn],I4),Ty=q([hk],IA);q([hk],efe);q([hk,mfe],n4);q([yc,uk,cn],xfe);function L4(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var My=(e,t)=>t,Py=(e,t,n)=>n,qfe=q(uy,My,Py,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(L4)),Wfe=q(cy,My,Py,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(L4)),j4=(e,t)=>({width:e.width,height:t.height}),Vfe=(e,t)=>{var n=typeof t.width=="number"?t.width:ed;return{width:n,height:e.height}},B4=q(un,el,j4),Kfe=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},Xfe=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},Qfe=q(Za,un,qfe,My,Py,(e,t,n,r,i)=>{var a={},l;return n.forEach(s=>{var c=j4(t,s);l==null&&(l=Kfe(t,r,e));var f=r==="top"&&!i||r==="bottom"&&i;a[s.id]=l-Number(f)*c.height,l+=(f?-1:1)*c.height}),a}),Yfe=q(Ga,un,Wfe,My,Py,(e,t,n,r,i)=>{var a={},l;return n.forEach(s=>{var c=Vfe(t,s);l==null&&(l=Xfe(t,r,e));var f=r==="left"&&!i||r==="right"&&i;a[s.id]=l-Number(f)*c.width,l+=(f?-1:1)*c.width}),a}),Gfe=(e,t)=>{var n=el(e,t);if(n!=null)return Qfe(e,n.orientation,n.mirror)},Zfe=q([un,el,Gfe,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),Jfe=(e,t)=>{var n=tl(e,t);if(n!=null)return Yfe(e,n.orientation,n.mirror)},ehe=q([un,tl,Jfe,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),z4=q(un,tl,(e,t)=>{var n=typeof t.width=="number"?t.width:ed;return{width:n,height:e.height}}),bN=(e,t,n)=>{switch(t){case"xAxis":return B4(e,n).width;case"yAxis":return z4(e,n).height;default:return}},$4=(e,t,n,r)=>{if(n!=null){var i=n.allowDuplicatedCategory,a=n.type,l=n.dataKey,s=Ya(e,r),c=t.map(d=>d.value),f=c.filter(d=>d!=null);if(l&&s&&a==="category"&&i&&Rz(f))return c}},pk=q([nt,fd,Bn,cn],$4),xN=q([nt,ufe,xc,Ty,pk,dk,hd,fk,cn],(e,t,n,r,i,a,l,s,c)=>{if(t!=null){var f=Ya(e,c);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:c,categoricalDomain:a,duplicateDomain:i,isCategorical:f,niceTicks:s,range:l,realScaleType:n,scale:r}}}),the=(e,t,n,r,i,a,l,s,c)=>{if(!(t==null||r==null)){var f=Ya(e,c),d=t.type,p=t.ticks,g=t.tickCount,v=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,y=d==="category"&&r.bandwidth?r.bandwidth()/v:0;y=c==="angleAxis"&&a!=null&&a.length>=2?or(a[0]-a[1])*2*y:y;var x=p||i;return x?x.map((w,A)=>{var k=l?l.indexOf(w):w,E=r.map(k);return Ve(E)?{index:A,coordinate:E+y,value:w,offset:y}:null}).filter(sr):f&&s?s.map((w,A)=>{var k=r.map(w);return Ve(k)?{coordinate:k+y,value:w,index:A,offset:y}:null}).filter(sr):r.ticks?r.ticks(g).map((w,A)=>{var k=r.map(w);return Ve(k)?{coordinate:k+y,value:w,index:A,offset:y}:null}).filter(sr):r.domain().map((w,A)=>{var k=r.map(w);return Ve(k)?{coordinate:k+y,value:l?l[w]:w,index:A,offset:y}:null}).filter(sr)}},H4=q([nt,cd,xc,Ty,fk,hd,pk,dk,cn],the),nhe=(e,t,n,r,i,a,l)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var s=Ya(e,l),c=t.tickCount,f=0;return f=l==="angleAxis"&&r?.length>=2?or(r[0]-r[1])*2*f:f,s&&a?a.map((d,p)=>{var g=n.map(d);return Ve(g)?{coordinate:g+f,value:d,index:p,offset:f}:null}).filter(sr):n.ticks?n.ticks(c).map((d,p)=>{var g=n.map(d);return Ve(g)?{coordinate:g+f,value:d,index:p,offset:f}:null}).filter(sr):n.domain().map((d,p)=>{var g=n.map(d);return Ve(g)?{coordinate:g+f,value:i?i[d]:d,index:p,offset:f}:null}).filter(sr)}},eo=q([nt,cd,Ty,hd,pk,dk,cn],nhe),to=q(Bn,Ty,(e,t)=>{if(!(e==null||t==null))return uv(uv({},e),{},{scale:t})}),rhe=q([Bn,xc,ck,N4],ak),ihe=q([rhe],IA);q((e,t,n)=>lk(e,n),ihe,(e,t)=>{if(!(e==null||t==null))return uv(uv({},e),{},{scale:t})});var ahe=q([nt,uy,cy],(e,t,n)=>{switch(e){case"horizontal":return t.some(r=>r.reversed)?"right-to-left":"left-to-right";case"vertical":return n.some(r=>r.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),lhe=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};q([lhe],e=>{if(!(!e||e.length===0))return t=>{var n,r=1/0,i=e[0];for(var a of e){var l=Math.abs(a.coordinate-t);l<r&&(r=l,i=a)}return(n=i)===null||n===void 0?void 0:n.value}});var U4=e=>e.options.defaultTooltipEventType,F4=e=>e.options.validateTooltipEventTypes;function q4(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function dd(e,t){var n=U4(e),r=F4(e);return q4(t,n,r)}function ohe(e){return we(t=>dd(t,e))}var W4=(e,t)=>{var n,r=Number(t);if(!(Gi(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},she=e=>e.tooltip.settings,Il={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},uhe={itemInteraction:{click:Il,hover:Il},axisInteraction:{click:Il,hover:Il},keyboardInteraction:Il,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},V4=Ln({name:"tooltip",initialState:uhe,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(Ye(t.payload))},prepare:bt()},replaceTooltipEntrySettings:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=Gr(e).tooltipItemPayloads.indexOf(Ye(r));a>-1&&(e.tooltipItemPayloads[a]=Ye(i))},prepare:bt()},removeTooltipEntrySettings:{reducer(e,t){var n=Gr(e).tooltipItemPayloads.indexOf(Ye(t.payload));n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:bt()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),ii=V4.actions,che=ii.addTooltipEntrySettings,fhe=ii.replaceTooltipEntrySettings,hhe=ii.removeTooltipEntrySettings,dhe=ii.setTooltipSettingsState,K4=ii.setActiveMouseOverItemIndex,phe=ii.mouseLeaveItem,X4=ii.mouseLeaveChart,mhe=ii.setActiveClickItemIndex,Q4=ii.setMouseOverAxisIndex,ghe=ii.setMouseClickAxisIndex,$f=ii.setSyncInteraction,fv=ii.setKeyboardInteraction,vhe=V4.reducer;function SN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Sm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SN(Object(n),!0).forEach(function(r){yhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yhe(e,t,n){return(t=bhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bhe(e){var t=xhe(e,"string");return typeof t=="symbol"?t:t+""}function xhe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function She(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function whe(e){return e.index!=null}var Y4=(e,t,n,r)=>{if(t==null)return Il;var i=She(e,t,n);if(i==null)return Il;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(whe(i)){if(a)return Sm(Sm({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return Sm(Sm({},Il),{},{coordinate:i.coordinate})};function Ohe(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function Ahe(e,t){var n=Ohe(e),r=t[0],i=t[1];if(n===void 0)return!1;var a=Math.min(r,i),l=Math.max(r,i);return n>=a&&n<=l}function khe(e,t,n){if(n==null||t==null)return!0;var r=Bt(e,t);return r==null||!Xi(n)?!0:Ahe(r,n)}var eh=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var a=Number(i);if(!Ve(a))return i;var l=0,s=1/0;t.length>0&&(s=t.length-1);var c=Math.max(l,Math.min(a,s)),f=t[c];return f==null||khe(f,n,r)?String(c):null},G4=(e,t,n,r,i,a,l)=>{if(a!=null){var s=l[0],c=s?.getPosition(a);if(c!=null)return c;var f=i?.[Number(a)];if(f)return n==="horizontal"?{x:f.coordinate,y:(r.top+t)/2}:{x:(r.left+e)/2,y:f.coordinate}}},Z4=(e,t,n,r)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(n==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(r!=null||e.keyboardInteraction.active)){var a=e.tooltipItemPayloads[0];return a!=null?[a]:[]}return e.tooltipItemPayloads.filter(l=>{var s;return((s=l.settings)===null||s===void 0?void 0:s.graphicalItemId)===i})},J4=e=>e.options.tooltipPayloadSearcher,Sc=e=>e.tooltip;function wN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ON(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wN(Object(n),!0).forEach(function(r){Che(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Che(e,t,n){return(t=Ehe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ehe(e){var t=The(e,"string");return typeof t=="symbol"?t:t+""}function The(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Mhe(e){if(typeof e=="string"||typeof e=="number")return e}function Phe(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function Dhe(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function AN(e){if(typeof e=="string")return e}function Rhe(e){if(!(e==null||typeof e!="object")){var t="name"in e?Mhe(e.name):void 0,n="unit"in e?Phe(e.unit):void 0,r="dataKey"in e?Dhe(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?AN(e.color):void 0,l="fill"in e?AN(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:l}}}function _he(e,t){return e??t}var e8=(e,t,n,r,i,a,l)=>{if(!(t==null||a==null)){var s=n.chartData,c=n.computedData,f=n.dataStartIndex,d=n.dataEndIndex,p=[];return e.reduce((g,v)=>{var y,x=v.dataDefinedOnItem,w=v.settings,A=_he(x,s),k=Array.isArray(A)?P5(A,f,d):A,E=(y=w?.dataKey)!==null&&y!==void 0?y:r,P=w?.nameKey,T;if(r&&Array.isArray(k)&&!Array.isArray(k[0])&&l==="axis"?T=_z(k,r,i):T=a(k,t,c,P),Array.isArray(T))T.forEach(R=>{var L,H,K=Rhe(R),V=K?.name,B=K?.dataKey,ae=K?.payload,ie=ON(ON({},w),{},{name:V,unit:K?.unit,color:(L=K?.color)!==null&&L!==void 0?L:w?.color,fill:(H=K?.fill)!==null&&H!==void 0?H:w?.fill});g.push(bR({tooltipEntrySettings:ie,dataKey:B,payload:ae,value:Bt(ae,B),name:V==null?void 0:String(V)}))});else{var M;g.push(bR({tooltipEntrySettings:w,dataKey:E,payload:T,value:Bt(T,E),name:(M=Bt(T,P))!==null&&M!==void 0?M:w?.name}))}return g},p)}},mk=q([Jt,l4,TA],t4),Nhe=q([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),Ihe=q([fn,gc],o4),Ss=q([Nhe,Jt,Ihe],s4,{memoizeOptions:{resultEqualityCheck:xy}}),Lhe=q([Ss],e=>e.filter(by)),t8=q([Ss],f4,{memoizeOptions:{resultEqualityCheck:xy}}),jhe=q([Ss],e=>e.some(t=>!t.data)),ds=q([t8,ki],d4),Bhe=q([Lhe,ki,Jt],x$),gk=q([ds,Jt,Ss,ki,jhe,t8],p4),n8=q([Jt],sk),zhe=q([Jt],e=>e.allowDataOverflow),r8=q([n8,zhe],e$),$he=q([Ss],e=>e.filter(by)),Hhe=q([Bhe,$he,py,d$],g4),Uhe=q([Hhe,ki,fn,r8],v4),Fhe=q([Ss],c4),qhe=q([ds,Jt,Fhe,uk,fn,Zoe],x4,{memoizeOptions:{resultEqualityCheck:ad}}),Whe=q([S4,fn,gc],bc),Vhe=q([Whe,fn],A4),Khe=q([w4,fn,gc],bc),Xhe=q([Khe,fn],k4),Qhe=q([O4,fn,gc],bc),Yhe=q([Qhe,fn],C4),Ghe=q([Vhe,Yhe,Xhe],cv),Zhe=q([Jt,n8,r8,Uhe,qhe,Ghe,nt,fn],E4),ic=q([Jt,nt,ds,gk,py,fn,Zhe],T4),Jhe=q([ic,Jt,mk],M4),ede=q([Jt,ic,Jhe,fn],P4),i8=e=>{var t=fn(e),n=gc(e),r=!1;return hd(e,t,n,r)},a8=q([Jt,i8],my),tde=q([Jt,mk,ede,a8],ak),l8=q([tde],IA),nde=q([nt,gk,Jt,fn],$4),rde=q([nt,gk,Jt,fn],I4),ide=(e,t,n,r,i,a,l,s)=>{if(t){var c=t.type,f=Ya(e,s);if(r){var d=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,p=c==="category"&&r.bandwidth?r.bandwidth()/d:0;return p=s==="angleAxis"&&i!=null&&i?.length>=2?or(i[0]-i[1])*2*p:p,f&&l?l.map((g,v)=>{var y=r.map(g);return Ve(y)?{coordinate:y+p,value:g,index:v,offset:p}:null}).filter(sr):r.domain().map((g,v)=>{var y=r.map(g);return Ve(y)?{coordinate:y+p,value:a?a[g]:g,index:v,offset:p}:null}).filter(sr)}}},nl=q([nt,Jt,mk,l8,i8,nde,rde,fn],ide),vk=q([U4,F4,she],(e,t,n)=>q4(n.shared,e,t)),o8=e=>e.tooltip.settings.trigger,yk=e=>e.tooltip.settings.defaultIndex,pd=q([Sc,vk,o8,yk],Y4),ps=q([pd,ds,rc,ic],eh),s8=q([nl,ps],W4),u8=q([pd],e=>{if(e)return e.dataKey}),ade=q([pd],e=>{if(e)return e.graphicalItemId}),c8=q([Sc,vk,o8,yk],Z4),lde=q([Ga,Za,nt,un,nl,yk,c8],G4),ode=q([pd,lde],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),sde=q([pd],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),ude=q([c8,ps,ki,rc,s8,J4,vk],e8),cde=q([ude],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function kN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function CN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kN(Object(n),!0).forEach(function(r){fde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fde(e,t,n){return(t=hde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hde(e){var t=dde(e,"string");return typeof t=="symbol"?t:t+""}function dde(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var pde=()=>we(Jt),mde=()=>{var e=pde(),t=we(nl),n=we(l8);return Zu(!e||!n?void 0:CN(CN({},e),{},{scale:n}),t)};function EN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function fu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EN(Object(n),!0).forEach(function(r){gde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gde(e,t,n){return(t=vde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vde(e){var t=yde(e,"string");return typeof t=="symbol"?t:t+""}function yde(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var bde=(e,t,n,r)=>{var i=t.find(a=>a&&a.index===n);if(i){if(e==="horizontal")return{x:i.coordinate,y:r.relativeY};if(e==="vertical")return{x:r.relativeX,y:i.coordinate}}return{x:0,y:0}},xde=(e,t,n,r)=>{var i=t.find(f=>f&&f.index===n);if(i){if(e==="centric"){var a=i.coordinate,l=r.radius;return fu(fu(fu({},r),An(r.cx,r.cy,l,a)),{},{angle:a,radius:l})}var s=i.coordinate,c=r.angle;return fu(fu(fu({},r),An(r.cx,r.cy,s,c)),{},{angle:c,radius:s})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function Sde(e,t){var n=e.relativeX,r=e.relativeY;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var f8=(e,t,n,r,i)=>{var a,l=(a=t?.length)!==null&&a!==void 0?a:0;if(l<=1||e==null)return 0;if(r==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var s=0;s<l;s++){var c,f,d,p,g,v=s>0?(c=n[s-1])===null||c===void 0?void 0:c.coordinate:(f=n[l-1])===null||f===void 0?void 0:f.coordinate,y=(d=n[s])===null||d===void 0?void 0:d.coordinate,x=s>=l-1?(p=n[0])===null||p===void 0?void 0:p.coordinate:(g=n[s+1])===null||g===void 0?void 0:g.coordinate,w=void 0;if(!(v==null||y==null||x==null))if(or(y-v)!==or(x-y)){var A=[];if(or(x-y)===or(i[1]-i[0])){w=x;var k=y+i[1]-i[0];A[0]=Math.min(k,(k+v)/2),A[1]=Math.max(k,(k+v)/2)}else{w=v;var E=x+i[1]-i[0];A[0]=Math.min(y,(E+y)/2),A[1]=Math.max(y,(E+y)/2)}var P=[Math.min(y,(w+y)/2),Math.max(y,(w+y)/2)];if(e>P[0]&&e<=P[1]||e>=A[0]&&e<=A[1]){var T;return(T=n[s])===null||T===void 0?void 0:T.index}}else{var M=Math.min(v,x),R=Math.max(v,x);if(e>(M+y)/2&&e<=(R+y)/2){var L;return(L=n[s])===null||L===void 0?void 0:L.index}}}else if(t)for(var H=0;H<l;H++){var K=t[H];if(K!=null){var V=t[H+1],B=t[H-1];if(H===0&&V!=null&&e<=(K.coordinate+V.coordinate)/2||H===l-1&&B!=null&&e>(K.coordinate+B.coordinate)/2||H>0&&H<l-1&&B!=null&&V!=null&&e>(K.coordinate+B.coordinate)/2&&e<=(K.coordinate+V.coordinate)/2)return K.index}}return-1},wde=()=>we(TA),bk=(e,t)=>t,h8=(e,t,n)=>n,xk=(e,t,n,r)=>r,Ode=q(nl,e=>Gv(e,t=>t.coordinate)),Sk=q([Sc,bk,h8,xk],Y4),wk=q([Sk,ds,rc,ic],eh),Ade=(e,t,n)=>{if(t!=null){var r=Sc(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},d8=q([Sc,bk,h8,xk],Z4),hv=q([Ga,Za,nt,un,nl,xk,d8],G4),kde=q([Sk,hv],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),p8=q([nl,wk],W4),Cde=q([d8,wk,ki,rc,p8,J4,bk],e8),Ede=q([Sk,wk],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),Tde=(e,t,n,r,i,a,l)=>{if(!(!e||!n||!r||!i)&&Sde(e,l)){var s=Pie(e,t),c=f8(s,a,i,n,r),f=bde(t,i,c,e);return{activeIndex:String(c),activeCoordinate:f}}},Mde=(e,t,n,r,i,a,l)=>{if(!(!e||!r||!i||!a||!n)){var s=Foe(e,n);if(s){var c=Die(s,t),f=f8(c,l,a,r,i),d=xde(t,a,f,s);return{activeIndex:String(f),activeCoordinate:d}}}},Pde=(e,t,n,r,i,a,l,s)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?Tde(e,t,r,i,a,l,s):Mde(e,t,n,r,i,a,l)},Dde=q(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),Rde=q(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(sn)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:xse}});function TN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function MN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TN(Object(n),!0).forEach(function(r){_de(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _de(e,t,n){return(t=Nde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nde(e){var t=Ide(e,"string");return typeof t=="symbol"?t:t+""}function Ide(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Lde={},jde={zIndexMap:Object.values(sn).reduce((e,t)=>MN(MN({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),Lde)},Bde=new Set(Object.values(sn));function zde(e){return Bde.has(e)}var m8=Ln({name:"zIndex",initialState:jde,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var n=t.payload.zIndex;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:bt()},unregisterZIndexPortal:{reducer:(e,t)=>{var n=t.payload.zIndex;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!zde(n)&&delete e.zIndexMap[n])},prepare:bt()},registerZIndexPortalElement:{reducer:(e,t)=>{var n=t.payload,r=n.zIndex,i=n.element,a=n.isPanorama;e.zIndexMap[r]?a?e.zIndexMap[r].panoramaElement=Ye(i):e.zIndexMap[r].element=Ye(i):e.zIndexMap[r]={consumers:0,element:a?void 0:Ye(i),panoramaElement:a?Ye(i):void 0}},prepare:bt()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var n=t.payload.zIndex;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:bt()}}}),Dy=m8.actions,$de=Dy.registerZIndexPortal,g1=Dy.unregisterZIndexPortal,Hde=Dy.registerZIndexPortalElement,Ude=Dy.unregisterZIndexPortalElement,Fde=m8.reducer;function ai(e){var t=e.zIndex,n=e.children,r=mae(),i=r&&t!==void 0&&t!==0,a=jn(),l=O.useRef(void 0),s=O.useRef(new Set),c=St(),f=we(p=>Dde(p,t,a));if(O.useLayoutEffect(()=>{if(!i){var p=s.current;p.forEach(v=>{c(g1({zIndex:v}))}),p.clear(),l.current=void 0;return}if(s.current.has(t)||(c($de({zIndex:t})),s.current.add(t)),f){l.current=f;var g=s.current;g.forEach(v=>{v!==t&&(c(g1({zIndex:v})),g.delete(v))})}},[c,t,i,f]),O.useLayoutEffect(()=>{var p=s.current;return()=>{p.forEach(g=>{c(g1({zIndex:g}))}),p.clear()}},[c]),!i)return n;var d=f??l.current;return d?nO.createPortal(n,d):null}function Ew(){return Ew=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ew.apply(null,arguments)}function PN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PN(Object(n),!0).forEach(function(r){qde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qde(e,t,n){return(t=Wde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wde(e){var t=Vde(e,"string");return typeof t=="symbol"?t:t+""}function Vde(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Kde(e){var t=e.cursor,n=e.cursorComp,r=e.cursorProps;return O.isValidElement(t)?O.cloneElement(t,r):O.createElement(n,r)}function Xde(e){var t,n=e.coordinate,r=e.payload,i=e.index,a=e.offset,l=e.tooltipAxisBandSize,s=e.layout,c=e.cursor,f=e.tooltipEventType,d=e.chartName,p=n,g=r,v=i;if(!c||!p||d!=="ScatterChart"&&f!=="axis")return null;var y,x,w;if(d==="ScatterChart")y=p,x=Zle,w=sn.cursorLine;else if(d==="BarChart")y=Jle(s,p,a,l),x=Y5,w=sn.cursorRectangle;else if(s==="radial"&&Lz(p)){var A=G5(p),k=A.cx,E=A.cy,P=A.radius,T=A.startAngle,M=A.endAngle;y={cx:k,cy:E,startAngle:T,endAngle:M,innerRadius:P,outerRadius:P},x=Koe,w=sn.cursorLine}else y={points:Xoe(s,p,a)},x=q5,w=sn.cursorLine;var R=typeof c=="object"&&"className"in c?c.className:void 0,L=wm(wm(wm(wm({stroke:"#ccc",pointerEvents:"none"},a),y),Yh(c)),{},{payload:g,payloadIndex:v,className:st("recharts-tooltip-cursor",R)});return O.createElement(ai,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:w},O.createElement(Kde,{cursor:c,cursorComp:x,cursorProps:L}))}function Qde(e){var t=mde(),n=j5(),r=ys(),i=wde();return t==null||n==null||r==null||i==null?null:O.createElement(Xde,Ew({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var g8=O.createContext(null),Yde=()=>O.useContext(g8),v1={exports:{}},DN;function Gde(){return DN||(DN=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,f,d){this.fn=c,this.context=f,this.once=d||!1}function a(c,f,d,p,g){if(typeof d!="function")throw new TypeError("The listener must be a function");var v=new i(d,p||c,g),y=n?n+f:f;return c._events[y]?c._events[y].fn?c._events[y]=[c._events[y],v]:c._events[y].push(v):(c._events[y]=v,c._eventsCount++),c}function l(c,f){--c._eventsCount===0?c._events=new r:delete c._events[f]}function s(){this._events=new r,this._eventsCount=0}s.prototype.eventNames=function(){var f=[],d,p;if(this._eventsCount===0)return f;for(p in d=this._events)t.call(d,p)&&f.push(n?p.slice(1):p);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(d)):f},s.prototype.listeners=function(f){var d=n?n+f:f,p=this._events[d];if(!p)return[];if(p.fn)return[p.fn];for(var g=0,v=p.length,y=new Array(v);g<v;g++)y[g]=p[g].fn;return y},s.prototype.listenerCount=function(f){var d=n?n+f:f,p=this._events[d];return p?p.fn?1:p.length:0},s.prototype.emit=function(f,d,p,g,v,y){var x=n?n+f:f;if(!this._events[x])return!1;var w=this._events[x],A=arguments.length,k,E;if(w.fn){switch(w.once&&this.removeListener(f,w.fn,void 0,!0),A){case 1:return w.fn.call(w.context),!0;case 2:return w.fn.call(w.context,d),!0;case 3:return w.fn.call(w.context,d,p),!0;case 4:return w.fn.call(w.context,d,p,g),!0;case 5:return w.fn.call(w.context,d,p,g,v),!0;case 6:return w.fn.call(w.context,d,p,g,v,y),!0}for(E=1,k=new Array(A-1);E<A;E++)k[E-1]=arguments[E];w.fn.apply(w.context,k)}else{var P=w.length,T;for(E=0;E<P;E++)switch(w[E].once&&this.removeListener(f,w[E].fn,void 0,!0),A){case 1:w[E].fn.call(w[E].context);break;case 2:w[E].fn.call(w[E].context,d);break;case 3:w[E].fn.call(w[E].context,d,p);break;case 4:w[E].fn.call(w[E].context,d,p,g);break;default:if(!k)for(T=1,k=new Array(A-1);T<A;T++)k[T-1]=arguments[T];w[E].fn.apply(w[E].context,k)}}return!0},s.prototype.on=function(f,d,p){return a(this,f,d,p,!1)},s.prototype.once=function(f,d,p){return a(this,f,d,p,!0)},s.prototype.removeListener=function(f,d,p,g){var v=n?n+f:f;if(!this._events[v])return this;if(!d)return l(this,v),this;var y=this._events[v];if(y.fn)y.fn===d&&(!g||y.once)&&(!p||y.context===p)&&l(this,v);else{for(var x=0,w=[],A=y.length;x<A;x++)(y[x].fn!==d||g&&!y[x].once||p&&y[x].context!==p)&&w.push(y[x]);w.length?this._events[v]=w.length===1?w[0]:w:l(this,v)}return this},s.prototype.removeAllListeners=function(f){var d;return f?(d=n?n+f:f,this._events[d]&&l(this,d)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s})(v1)),v1.exports}var Zde=Gde();const Jde=wv(Zde);var Bh=new Jde,Tw="recharts.syncEvent.tooltip",RN="recharts.syncEvent.brush",v8=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!Gi(n))return e[n]}},epe={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},y8=Ln({name:"options",initialState:epe,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),tpe=y8.reducer,npe=y8.actions.createEventEmitter;function rpe(e){return e.tooltip.syncInteraction}var ipe={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},b8=Ln({name:"chartData",initialState:ipe,reducers:{setChartData(e,t){if(e.chartData=Ye(t.payload),t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var n=t.payload,r=n.startIndex,i=n.endIndex;r!=null&&(e.dataStartIndex=r),i!=null&&(e.dataEndIndex=i)}}}),Ok=b8.actions,_N=Ok.setChartData,ape=Ok.setDataStartEndIndexes;Ok.setComputedData;var lpe=b8.reducer,ope=["x","y"];function NN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function hu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NN(Object(n),!0).forEach(function(r){spe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function spe(e,t,n){return(t=upe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function upe(e){var t=cpe(e,"string");return typeof t=="symbol"?t:t+""}function cpe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fpe(e,t){if(e==null)return{};var n,r,i=hpe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function hpe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function dpe(){var e=we(MA),t=we(PA),n=St(),r=we(p$),i=we(nl),a=ys(),l=dy(),s=we(c=>c.rootProps.className);O.useEffect(()=>{if(e==null)return vs;var c=(f,d,p)=>{if(t!==p&&e===f){if(d.payload.active===!1){n($f({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r==="index"){var g;if(l&&d!==null&&d!==void 0&&(g=d.payload)!==null&&g!==void 0&&g.coordinate&&d.payload.sourceViewBox){var v=d.payload.coordinate,y=v.x,x=v.y,w=fpe(v,ope),A=d.payload.sourceViewBox,k=A.x,E=A.y,P=A.width,T=A.height,M=hu(hu({},w),{},{x:l.x+(P?(y-k)/P:0)*l.width,y:l.y+(T?(x-E)/T:0)*l.height});n(hu(hu({},d),{},{payload:hu(hu({},d.payload),{},{coordinate:M})}))}else n(d);return}if(i!=null){var R;if(typeof r=="function"){var L={activeTooltipIndex:d.payload.index==null?void 0:Number(d.payload.index),isTooltipActive:d.payload.active,activeIndex:d.payload.index==null?void 0:Number(d.payload.index),activeLabel:d.payload.label,activeDataKey:d.payload.dataKey,activeCoordinate:d.payload.coordinate},H=r(i,L);R=i[H]}else r==="value"&&(R=i.find(G=>String(G.value)===d.payload.label));var K=d.payload.coordinate;if(K==null||l==null){n($f({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(R==null){n($f({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:d.payload.sourceViewBox,graphicalItemId:void 0}));return}var V=K.x,B=K.y,ae=Math.min(V,l.x+l.width),ie=Math.min(B,l.y+l.height),oe={x:a==="horizontal"?R.coordinate:ae,y:a==="horizontal"?ie:R.coordinate},z=$f({active:d.payload.active,coordinate:oe,dataKey:d.payload.dataKey,index:String(R.index),label:d.payload.label,sourceViewBox:d.payload.sourceViewBox,graphicalItemId:d.payload.graphicalItemId});n(z)}}};return Bh.on(Tw,c),()=>{Bh.off(Tw,c)}},[s,n,t,e,r,i,a,l])}function ppe(){var e=we(MA),t=we(PA),n=St();O.useEffect(()=>{if(e==null)return vs;var r=(i,a,l)=>{t!==l&&e===i&&n(ape(a))};return Bh.on(RN,r),()=>{Bh.off(RN,r)}},[n,t,e])}function mpe(){var e=St();O.useEffect(()=>{e(npe())},[e]),dpe(),ppe()}function gpe(e,t,n,r,i,a){var l=we(y=>Ade(y,e,t)),s=we(ade),c=we(PA),f=we(MA),d=we(p$),p=we(rpe),g=p?.sourceViewBox!=null,v=dy();O.useEffect(()=>{if(!g&&f!=null&&c!=null){var y=$f({active:a,coordinate:n,dataKey:l,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:v,graphicalItemId:s});Bh.emit(Tw,f,y,c)}},[g,n,l,s,i,r,c,f,d,a,v])}function IN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function LN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IN(Object(n),!0).forEach(function(r){vpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vpe(e,t,n){return(t=ype(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ype(e){var t=bpe(e,"string");return typeof t=="symbol"?t:t+""}function bpe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xpe(e,t){return Ape(e)||Ope(e,t)||wpe(e,t)||Spe()}function Spe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
111
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wpe(e,t){if(e){if(typeof e=="string")return jN(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jN(e,t):void 0}}function jN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ope(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function Ape(e){if(Array.isArray(e))return e}function kpe(e){return e.dataKey}function Cpe(e,t){return O.isValidElement(e)?O.cloneElement(e,t):typeof e=="function"?O.createElement(e,t):O.createElement(vle,t)}var BN=[],Epe={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:"auto",itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function zN(e){var t,n,r=In(e,Epe),i=r.active,a=r.allowEscapeViewBox,l=r.animationDuration,s=r.animationEasing,c=r.content,f=r.filterNull,d=r.isAnimationActive,p=r.offset,g=r.payloadUniqBy,v=r.position,y=r.reverseDirection,x=r.useTranslate3d,w=r.wrapperStyle,A=r.cursor,k=r.shared,E=r.trigger,P=r.defaultIndex,T=r.portal,M=r.axisId,R=St(),L=typeof P=="number"?String(P):P;O.useEffect(()=>{R(dhe({shared:k,trigger:E,axisId:M,active:i,defaultIndex:L}))},[R,k,E,M,i,L]);var H=dy(),K=F5(),V=ohe(k),B=(t=we(Ee=>Ede(Ee,V,E,L)))!==null&&t!==void 0?t:{},ae=B.activeIndex,ie=B.isActive,oe=we(Ee=>Cde(Ee,V,E,L)),z=we(Ee=>p8(Ee,V,E,L)),G=we(Ee=>kde(Ee,V,E,L)),ne=oe,ce=Yde(),fe=(n=i??ie)!==null&&n!==void 0?n:!1,N=e5([ne,fe]),X=xpe(N,2),re=X[0],le=X[1],ge=V==="axis"?z:void 0;gpe(V,E,G,ge,ae,fe);var Oe=T??ce;if(Oe==null||H==null||V==null)return null;var Pe=ne??BN;fe||(Pe=BN),f&&Pe.length&&(Pe=Qz(Pe.filter(Ee=>Ee.value!=null&&(Ee.hide!==!0||r.includeHidden)),g,kpe));var mt=Pe.length>0,se=LN(LN({},r),{},{payload:Pe,label:ge,active:fe,activeIndex:ae,coordinate:G,accessibilityLayer:K}),Te=O.createElement(Ble,{allowEscapeViewBox:a,animationDuration:l,animationEasing:s,isAnimationActive:d,active:fe,coordinate:G,hasPayload:mt,offset:p,position:v,reverseDirection:y,useTranslate3d:x,viewBox:H,wrapperStyle:w,lastBoundingBox:re,innerRef:le,hasPortalFromProps:!!T},Cpe(c,se));return O.createElement(O.Fragment,null,nO.createPortal(Te,Oe),fe&&O.createElement(Qde,{cursor:A,tooltipEventType:V,coordinate:G,payload:Pe,index:ae}))}var x8=e=>null;x8.displayName="Cell";function Tpe(e,t,n){return(t=Mpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mpe(e){var t=Ppe(e,"string");return typeof t=="symbol"?t:t+""}function Ppe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class Dpe{constructor(t){Tpe(this,"cache",new Map),this.maxSize=t}get(t){var n=this.cache.get(t);return n!==void 0&&(this.cache.delete(t),this.cache.set(t,n)),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var r=this.cache.keys().next().value;r!=null&&this.cache.delete(r)}this.cache.set(t,n)}clear(){this.cache.clear()}size(){return this.cache.size}}function $N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Rpe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$N(Object(n),!0).forEach(function(r){_pe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$N(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _pe(e,t,n){return(t=Npe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Npe(e){var t=Ipe(e,"string");return typeof t=="symbol"?t:t+""}function Ipe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Lpe={cacheSize:2e3,enableCache:!0},S8=Rpe({},Lpe),HN=new Dpe(S8.cacheSize),jpe={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},UN="recharts_measurement_span";function Bpe(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",a=t.fontStyle||"",l=t.letterSpacing||"",s=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(a,"|").concat(l,"|").concat(s)}var FN=(e,t)=>{try{var n=document.getElementById(UN);n||(n=document.createElement("span"),n.setAttribute("id",UN),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,jpe,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},th=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||rd.isSsr)return{width:0,height:0};if(!S8.enableCache)return FN(t,n);var r=Bpe(t,n),i=HN.get(r);if(i)return i;var a=FN(t,n);return HN.set(r,a),a},w8;function dv(e,t){return Upe(e)||Hpe(e,t)||$pe(e,t)||zpe()}function zpe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
112
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $pe(e,t){if(e){if(typeof e=="string")return qN(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qN(e,t):void 0}}function qN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Hpe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function Upe(e){if(Array.isArray(e))return e}function Fpe(e,t,n){return(t=qpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qpe(e){var t=Wpe(e,"string");return typeof t=="symbol"?t:t+""}function Wpe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var WN=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,VN=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Vpe=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,Kpe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Xpe={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Qpe=["cm","mm","pt","pc","in","Q","px"];function Ype(e){return Qpe.includes(e)}var Cu="NaN";function Gpe(e,t){return e*Xpe[t]}class wn{static parse(t){var n,r=(n=Kpe.exec(t))!==null&&n!==void 0?n:[],i=dv(r,3),a=i[1],l=i[2];return a==null?wn.NaN:new wn(parseFloat(a),l??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,Gi(t)&&(this.unit=""),n!==""&&!Vpe.test(n)&&(this.num=NaN,this.unit=""),Ype(n)&&(this.num=Gpe(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new wn(NaN,""):new wn(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new wn(NaN,""):new wn(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new wn(NaN,""):new wn(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new wn(NaN,""):new wn(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Gi(this.num)}}w8=wn;Fpe(wn,"NaN",new w8(NaN,""));function O8(e){if(e==null||e.includes(Cu))return Cu;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=WN.exec(t))!==null&&n!==void 0?n:[],i=dv(r,4),a=i[1],l=i[2],s=i[3],c=wn.parse(a??""),f=wn.parse(s??""),d=l==="*"?c.multiply(f):c.divide(f);if(d.isNaN())return Cu;t=t.replace(WN,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var p,g=(p=VN.exec(t))!==null&&p!==void 0?p:[],v=dv(g,4),y=v[1],x=v[2],w=v[3],A=wn.parse(y??""),k=wn.parse(w??""),E=x==="+"?A.add(k):A.subtract(k);if(E.isNaN())return Cu;t=t.replace(VN,E.toString())}return t}var KN=/\(([^()]*)\)/;function Zpe(e){for(var t=e,n;(n=KN.exec(t))!=null;){var r=n,i=dv(r,2),a=i[1];t=t.replace(KN,O8(a))}return t}function Jpe(e){var t=e.replace(/\s+/g,"");return t=Zpe(t),t=O8(t),t}function eme(e){try{return Jpe(e)}catch{return Cu}}function y1(e){var t=eme(e.slice(5,-1));return t===Cu?"":t}var tme=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],nme=["dx","dy","angle","className","breakAll"];function Mw(){return Mw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mw.apply(null,arguments)}function XN(e,t){if(e==null)return{};var n,r,i=rme(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function rme(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function QN(e,t){return ome(e)||lme(e,t)||ame(e,t)||ime()}function ime(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
113
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ame(e,t){if(e){if(typeof e=="string")return YN(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?YN(e,t):void 0}}function YN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function lme(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function ome(e){if(Array.isArray(e))return e}var A8=/[ \f\n\r\t\v\u2028\u2029]+/,k8=e=>{var t=e.children,n=e.breakAll,r=e.style;try{var i=[];kt(t)||(n?i=t.toString().split(""):i=t.toString().split(A8));var a=i.map(s=>({word:s,width:th(s,r).width})),l=n?0:th(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:l}}catch{return null}};function C8(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function sme(e){return kt(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var E8=(e,t,n,r)=>e.reduce((i,a)=>{var l=a.word,s=a.width,c=i[i.length-1];if(c&&s!=null&&(t==null||r||c.width+s+n<Number(t)))c.words.push(l),c.width+=s+n;else{var f={words:[l],width:s};i.push(f)}return i},[]),T8=e=>e.reduce((t,n)=>t.width>n.width?t:n),ume="…",GN=(e,t,n,r,i,a,l,s)=>{var c=e.slice(0,t),f=k8({breakAll:n,style:r,children:c+ume});if(!f)return[!1,[]];var d=E8(f.wordsWithComputedWidth,a,l,s),p=d.length>i||T8(d).width>Number(a);return[p,d]},cme=(e,t,n,r,i)=>{var a=e.maxLines,l=e.children,s=e.style,c=e.breakAll,f=be(a),d=String(l),p=E8(t,r,n,i);if(!f||i)return p;var g=p.length>a||T8(p).width>Number(r);if(!g)return p;for(var v=0,y=d.length-1,x=0,w;v<=y&&x<=d.length-1;){var A=Math.floor((v+y)/2),k=A-1,E=GN(d,k,c,s,a,r,n,i),P=QN(E,2),T=P[0],M=P[1],R=GN(d,A,c,s,a,r,n,i),L=QN(R,1),H=L[0];if(!T&&!H&&(v=A+1),T&&H&&(y=A-1),!T&&H){w=M;break}x++}return w||p},ZN=e=>{var t=kt(e)?[]:e.toString().split(A8);return[{words:t,width:void 0}]},fme=e=>{var t=e.width,n=e.scaleToFit,r=e.children,i=e.style,a=e.breakAll,l=e.maxLines;if((t||n)&&!rd.isSsr){var s,c,f=k8({breakAll:a,children:r,style:i});if(f){var d=f.wordsWithComputedWidth,p=f.spaceWidth;s=d,c=p}else return ZN(r);return cme({breakAll:a,children:r,maxLines:l,style:i},s,c,t,!!n)}return ZN(r)},M8="#808080",hme={angle:0,breakAll:!1,capHeight:"0.71em",fill:M8,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Ak=O.forwardRef((e,t)=>{var n=In(e,hme),r=n.x,i=n.y,a=n.lineHeight,l=n.capHeight,s=n.fill,c=n.scaleToFit,f=n.textAnchor,d=n.verticalAnchor,p=XN(n,tme),g=O.useMemo(()=>fme({breakAll:p.breakAll,children:p.children,maxLines:p.maxLines,scaleToFit:c,style:p.style,width:p.width}),[p.breakAll,p.children,p.maxLines,c,p.style,p.width]),v=p.dx,y=p.dy,x=p.angle,w=p.className,A=p.breakAll,k=XN(p,nme);if(!Zi(r)||!Zi(i)||g.length===0)return null;var E=Number(r)+(be(v)?v:0),P=Number(i)+(be(y)?y:0);if(!Ve(E)||!Ve(P))return null;var T;switch(d){case"start":T=y1("calc(".concat(l,")"));break;case"middle":T=y1("calc(".concat((g.length-1)/2," * -").concat(a," + (").concat(l," / 2))"));break;default:T=y1("calc(".concat(g.length-1," * -").concat(a,")"));break}var M=[],R=g[0];if(c&&R!=null){var L=R.width,H=p.width;M.push("scale(".concat(be(H)&&be(L)?H/L:1,")"))}return x&&M.push("rotate(".concat(x,", ").concat(E,", ").concat(P,")")),M.length&&(k.transform=M.join(" ")),O.createElement("text",Mw({},Dr(k),{ref:t,x:E,y:P,className:st("recharts-text",w),textAnchor:f,fill:s.includes("url")?M8:s}),g.map((K,V)=>{var B=K.words.join(A?"":" ");return O.createElement("tspan",{x:E,dy:V===0?T:a,key:"".concat(B,"-").concat(V)},B)}))});Ak.displayName="Text";function JN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ii(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JN(Object(n),!0).forEach(function(r){dme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dme(e,t,n){return(t=pme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pme(e){var t=mme(e,"string");return typeof t=="symbol"?t:t+""}function mme(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gme=e=>{var t=e.viewBox,n=e.position,r=e.offset,i=r===void 0?0:r,a=e.parentViewBox,l=xA(t),s=l.x,c=l.y,f=l.height,d=l.upperWidth,p=l.lowerWidth,g=s,v=s+(d-p)/2,y=(g+v)/2,x=(d+p)/2,w=g+d/2,A=f>=0?1:-1,k=A*i,E=A>0?"end":"start",P=A>0?"start":"end",T=d>=0?1:-1,M=T*i,R=T>0?"end":"start",L=T>0?"start":"end",H=a;if(n==="top"){var K={x:g+d/2,y:c-k,horizontalAnchor:"middle",verticalAnchor:E};return H&&(K.height=Math.max(c-H.y,0),K.width=d),K}if(n==="bottom"){var V={x:v+p/2,y:c+f+k,horizontalAnchor:"middle",verticalAnchor:P};return H&&(V.height=Math.max(H.y+H.height-(c+f),0),V.width=p),V}if(n==="left"){var B={x:y-M,y:c+f/2,horizontalAnchor:R,verticalAnchor:"middle"};return H&&(B.width=Math.max(B.x-H.x,0),B.height=f),B}if(n==="right"){var ae={x:y+x+M,y:c+f/2,horizontalAnchor:L,verticalAnchor:"middle"};return H&&(ae.width=Math.max(H.x+H.width-ae.x,0),ae.height=f),ae}var ie=H?{width:x,height:f}:{};return n==="insideLeft"?Ii({x:y+M,y:c+f/2,horizontalAnchor:L,verticalAnchor:"middle"},ie):n==="insideRight"?Ii({x:y+x-M,y:c+f/2,horizontalAnchor:R,verticalAnchor:"middle"},ie):n==="insideTop"?Ii({x:g+d/2,y:c+k,horizontalAnchor:"middle",verticalAnchor:P},ie):n==="insideBottom"?Ii({x:v+p/2,y:c+f-k,horizontalAnchor:"middle",verticalAnchor:E},ie):n==="insideTopLeft"?Ii({x:g+M,y:c+k,horizontalAnchor:L,verticalAnchor:P},ie):n==="insideTopRight"?Ii({x:g+d-M,y:c+k,horizontalAnchor:R,verticalAnchor:P},ie):n==="insideBottomLeft"?Ii({x:v+M,y:c+f-k,horizontalAnchor:L,verticalAnchor:E},ie):n==="insideBottomRight"?Ii({x:v+p-M,y:c+f-k,horizontalAnchor:R,verticalAnchor:E},ie):n&&typeof n=="object"&&(be(n.x)||cs(n.x))&&(be(n.y)||cs(n.y))?Ii({x:s+bi(n.x,x),y:c+bi(n.y,f),horizontalAnchor:"end",verticalAnchor:"end"},ie):Ii({x:w,y:c+f/2,horizontalAnchor:"middle",verticalAnchor:"middle"},ie)},vme=["labelRef"],yme=["content"];function eI(e,t){if(e==null)return{};var n,r,i=bme(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function bme(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function tI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Hf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tI(Object(n),!0).forEach(function(r){xme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xme(e,t,n){return(t=Sme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sme(e){var t=wme(e,"string");return typeof t=="symbol"?t:t+""}function wme(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ta(){return Ta=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ta.apply(null,arguments)}var P8=O.createContext(null),Ome=e=>{var t=e.x,n=e.y,r=e.upperWidth,i=e.lowerWidth,a=e.width,l=e.height,s=e.children,c=O.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:l}),[t,n,r,i,a,l]);return O.createElement(P8.Provider,{value:c},s)},D8=()=>{var e=O.useContext(P8),t=dy();return e||(t?xA(t):void 0)},Ame=O.createContext(null),kme=()=>{var e=O.useContext(Ame),t=we(b$);return e||t},Cme=e=>{var t=e.value,n=e.formatter,r=kt(e.children)?t:e.children;return typeof n=="function"?n(r):r},kk=e=>e!=null&&typeof e=="function",Eme=(e,t)=>{var n=or(t-e),r=Math.min(Math.abs(t-e),360);return n*r},Tme=(e,t,n,r,i)=>{var a=e.offset,l=e.className,s=i.cx,c=i.cy,f=i.innerRadius,d=i.outerRadius,p=i.startAngle,g=i.endAngle,v=i.clockWise,y=(f+d)/2,x=Eme(p,g),w=x>=0?1:-1,A,k;switch(t){case"insideStart":A=p+w*a,k=v;break;case"insideEnd":A=g-w*a,k=!v;break;case"end":A=g+w*a,k=v;break;default:throw new Error("Unsupported position ".concat(t))}k=x<=0?k:!k;var E=An(s,c,y,A),P=An(s,c,y,A+(k?1:-1)*359),T="M".concat(E.x,",").concat(E.y,`
|
|
114
|
+
A`).concat(y,",").concat(y,",0,1,").concat(k?0:1,`,
|
|
115
|
+
`).concat(P.x,",").concat(P.y),M=kt(e.id)?Th("recharts-radial-line-"):e.id;return O.createElement("text",Ta({},r,{dominantBaseline:"central",className:st("recharts-radial-bar-label",l)}),O.createElement("defs",null,O.createElement("path",{id:M,d:T})),O.createElement("textPath",{xlinkHref:"#".concat(M)},n))},Mme=(e,t,n)=>{var r=e.cx,i=e.cy,a=e.innerRadius,l=e.outerRadius,s=e.startAngle,c=e.endAngle,f=(s+c)/2;if(n==="outside"){var d=An(r,i,l+t,f),p=d.x,g=d.y;return{x:p,y:g,textAnchor:p>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"end"};var v=(a+l)/2,y=An(r,i,v,f),x=y.x,w=y.y;return{x,y:w,textAnchor:"middle",verticalAnchor:"middle"}},Wm=e=>e!=null&&"cx"in e&&be(e.cx),Pme={angle:0,offset:5,zIndex:sn.label,position:"middle",textBreakAll:!1};function Dme(e){if(!Wm(e))return e;var t=e.cx,n=e.cy,r=e.outerRadius,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function Rl(e){var t=In(e,Pme),n=t.viewBox,r=t.parentViewBox,i=t.position,a=t.value,l=t.children,s=t.content,c=t.className,f=c===void 0?"":c,d=t.textBreakAll,p=t.labelRef,g=kme(),v=D8(),y=i==="center"?v:g??v,x,w,A;n==null?x=y:Wm(n)?x=n:x=xA(n);var k=Dme(x);if(!x||kt(a)&&kt(l)&&!O.isValidElement(s)&&typeof s!="function")return null;var E=Hf(Hf({},t),{},{viewBox:x});if(O.isValidElement(s)){E.labelRef;var P=eI(E,vme);return O.cloneElement(s,P)}if(typeof s=="function"){E.content;var T=eI(E,yme);if(w=O.createElement(s,T),O.isValidElement(w))return w}else w=Cme(t);var M=Dr(t);if(Wm(x)){if(i==="insideStart"||i==="insideEnd"||i==="end")return Tme(t,i,w,M,x);A=Mme(x,t.offset,t.position)}else{if(!k)return null;var R=gme({viewBox:k,position:i,offset:t.offset,parentViewBox:Wm(r)?void 0:r});A=Hf(Hf({x:R.x,y:R.y,textAnchor:R.horizontalAnchor,verticalAnchor:R.verticalAnchor},R.width!==void 0?{width:R.width}:{}),R.height!==void 0?{height:R.height}:{})}return O.createElement(ai,{zIndex:t.zIndex},O.createElement(Ak,Ta({ref:p,className:st("recharts-label",f)},M,A,{textAnchor:C8(M.textAnchor)?M.textAnchor:A.textAnchor,breakAll:d}),w))}Rl.displayName="Label";var Rme=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?O.createElement(Rl,Ta({key:"label-implicit"},r)):Zi(e)?O.createElement(Rl,Ta({key:"label-implicit",value:e},r)):O.isValidElement(e)?e.type===Rl?O.cloneElement(e,Hf({key:"label-implicit"},r)):O.createElement(Rl,Ta({key:"label-implicit",content:e},r)):kk(e)?O.createElement(Rl,Ta({key:"label-implicit",content:e},r)):e&&typeof e=="object"?O.createElement(Rl,Ta({},e,{key:"label-implicit"},r)):null};function _me(e){var t=e.label,n=e.labelRef,r=D8();return Rme(t,r,n)||null}var Nme=["valueAccessor"],Ime=["dataKey","clockWise","id","textBreakAll","zIndex"];function pv(){return pv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pv.apply(null,arguments)}function nI(e,t){if(e==null)return{};var n,r,i=Lme(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Lme(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var jme=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(sme(t))return t},R8=O.createContext(void 0),_8=R8.Provider,N8=O.createContext(void 0);N8.Provider;function Bme(){return O.useContext(R8)}function zme(){return O.useContext(N8)}function Vm(e){var t=e.valueAccessor,n=t===void 0?jme:t,r=nI(e,Nme),i=r.dataKey;r.clockWise;var a=r.id,l=r.textBreakAll,s=r.zIndex,c=nI(r,Ime),f=Bme(),d=zme(),p=f||d;return!p||!p.length?null:O.createElement(ai,{zIndex:s??sn.label},O.createElement(Rr,{className:"recharts-label-list"},p.map((g,v)=>{var y,x=kt(i)?n(g,v):Bt(g.payload,i),w=kt(a)?{}:{id:"".concat(a,"-").concat(v)};return O.createElement(Rl,pv({key:"label-".concat(v)},Dr(g),c,w,{fill:(y=r.fill)!==null&&y!==void 0?y:g.fill,parentViewBox:g.parentViewBox,value:x,textBreakAll:l,viewBox:g.viewBox,index:v,zIndex:0}))})))}Vm.displayName="LabelList";function I8(e){var t=e.label;return t?t===!0?O.createElement(Vm,{key:"labelList-implicit"}):O.isValidElement(t)||kk(t)?O.createElement(Vm,{key:"labelList-implicit",content:t}):typeof t=="object"?O.createElement(Vm,pv({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function Pw(){return Pw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pw.apply(null,arguments)}var L8=e=>{var t=e.cx,n=e.cy,r=e.r,i=e.className,a=st("recharts-dot",i);return be(t)&&be(n)&&be(r)?O.createElement("circle",Pw({},yi(e),uA(e),{className:a,cx:t,cy:n,r})):null},$me={radiusAxis:{},angleAxis:{}},j8=Ln({name:"polarAxis",initialState:$me,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=Ye(t.payload)},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=Ye(t.payload)},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),Ry=j8.actions;Ry.addRadiusAxis;Ry.removeRadiusAxis;Ry.addAngleAxis;Ry.removeAngleAxis;var Hme=j8.reducer;function Ume(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var b1={exports:{}},lt={};var rI;function Fme(){if(rI)return lt;rI=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.view_transition"),v=Symbol.for("react.client.reference");function y(x){if(typeof x=="object"&&x!==null){var w=x.$$typeof;switch(w){case e:switch(x=x.type,x){case n:case i:case r:case c:case f:case g:return x;default:switch(x=x&&x.$$typeof,x){case l:case s:case p:case d:return x;case a:return x;default:return w}}case t:return w}}}return lt.ContextConsumer=a,lt.ContextProvider=l,lt.Element=e,lt.ForwardRef=s,lt.Fragment=n,lt.Lazy=p,lt.Memo=d,lt.Portal=t,lt.Profiler=i,lt.StrictMode=r,lt.Suspense=c,lt.SuspenseList=f,lt.isContextConsumer=function(x){return y(x)===a},lt.isContextProvider=function(x){return y(x)===l},lt.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===e},lt.isForwardRef=function(x){return y(x)===s},lt.isFragment=function(x){return y(x)===n},lt.isLazy=function(x){return y(x)===p},lt.isMemo=function(x){return y(x)===d},lt.isPortal=function(x){return y(x)===t},lt.isProfiler=function(x){return y(x)===i},lt.isStrictMode=function(x){return y(x)===r},lt.isSuspense=function(x){return y(x)===c},lt.isSuspenseList=function(x){return y(x)===f},lt.isValidElementType=function(x){return typeof x=="string"||typeof x=="function"||x===n||x===i||x===r||x===c||x===f||typeof x=="object"&&x!==null&&(x.$$typeof===p||x.$$typeof===d||x.$$typeof===l||x.$$typeof===a||x.$$typeof===s||x.$$typeof===v||x.getModuleId!==void 0)},lt.typeOf=y,lt}var iI;function qme(){return iI||(iI=1,b1.exports=Fme()),b1.exports}var Wme=qme(),aI=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",lI=null,x1=null,B8=e=>{if(e===lI&&Array.isArray(x1))return x1;var t=[];return O.Children.forEach(e,n=>{kt(n)||(Wme.isFragment(n)?t=t.concat(B8(n.props.children)):t.push(n))}),x1=t,lI=e,t};function Vme(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>aI(i)):r=[aI(t)],B8(e).forEach(i=>{var a=qa(i,"type.displayName")||qa(i,"type.name");a&&r.indexOf(a)!==-1&&n.push(i)}),n}var z8=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function oI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function sI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oI(Object(n),!0).forEach(function(r){Kme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kme(e,t,n){return(t=Xme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xme(e){var t=Qme(e,"string");return typeof t=="symbol"?t:t+""}function Qme(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $8(e,t){return sI(sI({},t),e)}function Yme(e){return O.isValidElement(e)?e.props:e}function Gme(e,t){return O.cloneElement(e,$8(Yme(e),t))}function Zme(e){if("index"in e){var t=e.index;return typeof t=="number"||typeof t=="string"?t:void 0}}function Jme(e){return"isActive"in e&&e.isActive===!0}function H8(e){var t=e.option,n=e.DefaultShape,r=e.shapeProps,i=e.activeClassName,a=i===void 0?"recharts-active-shape":i,l=e.inActiveClassName,s=l===void 0?"recharts-shape":l,c=Zme(r),f;return O.isValidElement(t)?f=Gme(t,r):t===n?f=O.createElement(n,r):typeof t=="function"?f=t(r,c):typeof t=="object"?f=O.createElement(n,$8(t,r)):f=O.createElement(n,r),Jme(r)?O.createElement(Rr,{className:a},f):O.createElement(Rr,{className:s},f)}var U8=(e,t,n)=>{var r=St();return(i,a)=>l=>{e?.(i,a,l),r(K4({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},F8=e=>{var t=St();return(n,r)=>i=>{e?.(n,r,i),t(phe())}},q8=(e,t,n)=>{var r=St();return(i,a)=>l=>{e?.(i,a,l),r(mhe({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function W8(e){var t=e.tooltipEntrySettings,n=St(),r=jn(),i=O.useRef(null);return O.useLayoutEffect(()=>{r||(i.current===null?n(che(t)):i.current!==t&&n(fhe({prev:i.current,next:t})),i.current=t)},[t,n,r]),O.useLayoutEffect(()=>()=>{i.current&&(n(hhe(i.current)),i.current=null)},[n]),null}function V8(e){var t=e.legendPayload,n=St(),r=jn(),i=O.useRef(null);return O.useLayoutEffect(()=>{r||(i.current===null?n(yae(t)):i.current!==t&&n(bae({prev:i.current,next:t})),i.current=t)},[n,r,t]),O.useLayoutEffect(()=>()=>{i.current&&(n(xae(i.current)),i.current=null)},[n]),null}function ege(e,t){return ige(e)||rge(e,t)||nge(e,t)||tge()}function tge(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
116
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nge(e,t){if(e){if(typeof e=="string")return uI(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?uI(e,t):void 0}}function uI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function rge(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function ige(e){if(Array.isArray(e))return e}var Ck="index",K8="append";function Ek(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r=[];for(var i of n)r.push({status:"removed",prev:i});for(var a=0;a<t.length;a++){var l=e[a],s=t[a];l!=null?r.push({status:"matched",prev:l,next:s}):r.push({status:"added",next:s})}return r}function age(e,t){var n=e.length/t.length,r=t.map((i,a)=>e[Math.floor(a*n)]);return Ek(r,t)}function lge(e,t){var n=t.map((r,i)=>e[i]);return Ek(n,t)}function oge(e,t){for(var n=new Map,r=0;r<e.length;r++){var i=e[r];if(i!=null){var a=t(i,r);a!=null&&!n.has(a)&&n.set(a,i)}}return n}function sge(e,t,n){var r=oge(e,n),i=new Set,a=t.map((p,g)=>{var v=n(p,g);if(v!=null){var y=r.get(v);if(y!==void 0)return i.add(v),y}}),l=[];for(var s of r){var c=ege(s,2),f=c[0],d=c[1];i.has(f)||l.push(d)}return Ek(a,t,l)}function uge(e,t,n){return t==null?null:e==null?t.map(r=>({status:"added",next:r})):n===Ck?age(e,t):n===K8?lge(e,t):sge(e,t,n)}function cge(e,t){var n=O.useRef(e),r=O.useRef(t.current),i=O.useRef(!0);n.current!==e&&(n.current=e,r.current=t.current,i.current=!1);var a=O.useCallback(function(l,s){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(s===0){i.current=!0;return}s===1&&(r.current=l),s>0&&i.current&&c&&(t.current=l)},[t]);return{startValue:r.current,syncStepValue:a}}function fge(e,t){return mge(e)||pge(e,t)||dge(e,t)||hge()}function hge(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
117
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dge(e,t){if(e){if(typeof e=="string")return cI(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cI(e,t):void 0}}function cI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function pge(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function mge(e){if(Array.isArray(e))return e}function X8(e,t){var n=O.useState(!1),r=fge(n,2),i=r[0],a=r[1],l=O.useCallback(()=>{typeof e=="function"&&e(),a(!0)},[e]),s=O.useCallback(()=>{typeof t=="function"&&t(),a(!1)},[t]);return{isAnimating:i,handleAnimationStart:l,handleAnimationEnd:s}}function Q8(e){var t,n=e.animationInput,r=e.animationIdPrefix,i=e.items,a=e.previousItemsRef,l=e.isAnimationActive,s=e.animationBegin,c=e.animationDuration,f=e.animationEasing,d=e.onAnimationStart,p=e.onAnimationEnd,g=e.animationInterpolateFn,v=e.animationMatchBy,y=e.shouldUpdatePreviousRef,x=e.children,w=e.layout,A=Q5(n,r),k=cge(A,a),E=(t=k.startValue)!==null&&t!==void 0?t:null,P=uge(E,i,v??Ck);return O.createElement(X5,{animationId:A,begin:s,duration:c,isActive:l,easing:f,onAnimationEnd:p,onAnimationStart:d,key:A},T=>{var M=E==null,R=i==null?i:g(P,T,w),L=y?y(T):T>0;return k.syncStepValue(R,T,L),R==null?null:x(R,T,M)})}var S1;function gge(e,t){return xge(e)||bge(e,t)||yge(e,t)||vge()}function vge(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
118
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yge(e,t){if(e){if(typeof e=="string")return fI(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fI(e,t):void 0}}function fI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function bge(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function xge(e){if(Array.isArray(e))return e}var Sge=()=>{var e=O.useState(()=>Th("uid-")),t=gge(e,1),n=t[0];return n},wge=(S1=u9.useId)!==null&&S1!==void 0?S1:Sge;function Oge(e,t){var n=wge();return t||(e?"".concat(e,"-").concat(n):n)}var Age=O.createContext(void 0),Y8=e=>{var t=e.id,n=e.type,r=e.children,i=Oge("recharts-".concat(n),t);return O.createElement(Age.Provider,{value:i},r(i))},kge={cartesianItems:[],polarItems:[]},G8=Ln({name:"graphicalItems",initialState:kge,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(Ye(t.payload))},prepare:bt()},replaceCartesianGraphicalItem:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=Gr(e).cartesianItems.indexOf(Ye(r));a>-1&&(e.cartesianItems[a]=Ye(i))},prepare:bt()},removeCartesianGraphicalItem:{reducer(e,t){var n=Gr(e).cartesianItems.indexOf(Ye(t.payload));n>-1&&e.cartesianItems.splice(n,1)},prepare:bt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(Ye(t.payload))},prepare:bt()},removePolarGraphicalItem:{reducer(e,t){var n=Gr(e).polarItems.indexOf(Ye(t.payload));n>-1&&e.polarItems.splice(n,1)},prepare:bt()},replacePolarGraphicalItem:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=Gr(e).polarItems.indexOf(Ye(r));a>-1&&(e.polarItems[a]=Ye(i))},prepare:bt()}}}),wc=G8.actions,Cge=wc.addCartesianGraphicalItem,Ege=wc.replaceCartesianGraphicalItem,Tge=wc.removeCartesianGraphicalItem;wc.addPolarGraphicalItem;wc.removePolarGraphicalItem;wc.replacePolarGraphicalItem;var Mge=G8.reducer,Pge=e=>{var t=St(),n=O.useRef(null);return O.useLayoutEffect(()=>{n.current===null?t(Cge(e)):n.current!==e&&t(Ege({prev:n.current,next:e})),n.current=e},[t,e]),O.useLayoutEffect(()=>()=>{n.current&&(t(Tge(n.current)),n.current=null)},[t]),null},Z8=O.memo(Pge),Dge=["points"];function hI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function w1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hI(Object(n),!0).forEach(function(r){Rge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rge(e,t,n){return(t=_ge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _ge(e){var t=Nge(e,"string");return typeof t=="symbol"?t:t+""}function Nge(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mv(){return mv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mv.apply(null,arguments)}function Ige(e,t){if(e==null)return{};var n,r,i=Lge(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Lge(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function jge(e){var t=e.option,n=e.dotProps,r=e.className;if(O.isValidElement(t))return O.cloneElement(t,n);if(typeof t=="function")return t(n);var i=st(r,typeof t!="boolean"?t.className:""),a=n??{};a.points;var l=Ige(a,Dge);return O.createElement(L8,mv({},l,{className:i}))}function Bge(e,t){return e==null?!1:t?!0:e.length===1}function zge(e){var t=e.points,n=e.dot,r=e.className,i=e.dotClassName,a=e.dataKey,l=e.baseProps,s=e.needClip,c=e.clipPathId,f=e.zIndex,d=f===void 0?sn.scatter:f;if(!Bge(t,n))return null;var p=z8(n),g=jee(n),v=t.map((x,w)=>{var A,k,E=w1(w1(w1({r:3},l),g),{},{index:w,cx:(A=x.x)!==null&&A!==void 0?A:void 0,cy:(k=x.y)!==null&&k!==void 0?k:void 0,dataKey:a,value:x.value,payload:x.payload,points:t});return O.createElement(jge,{key:"dot-".concat(w),option:n,dotProps:E,className:i})}),y={};return s&&c!=null&&(y.clipPath="url(#clipPath-".concat(p?"":"dots-").concat(c,")")),O.createElement(ai,{zIndex:d},O.createElement(Rr,mv({className:r},y),v))}function dI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dI(Object(n),!0).forEach(function(r){$ge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $ge(e,t,n){return(t=Hge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hge(e){var t=Uge(e,"string");return typeof t=="symbol"?t:t+""}function Uge(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var J8=0,Fge={xAxis:{},yAxis:{},zAxis:{}},e6=Ln({name:"cartesianAxis",initialState:Fge,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=Ye(t.payload)},prepare:bt()},replaceXAxis:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next;e.xAxis[r.id]!==void 0&&(r.id!==i.id&&delete e.xAxis[r.id],e.xAxis[i.id]=Ye(i))},prepare:bt()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:bt()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=Ye(t.payload)},prepare:bt()},replaceYAxis:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next;e.yAxis[r.id]!==void 0&&(r.id!==i.id&&delete e.yAxis[r.id],e.yAxis[i.id]=Ye(i))},prepare:bt()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:bt()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=Ye(t.payload)},prepare:bt()},replaceZAxis:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next;e.zAxis[r.id]!==void 0&&(r.id!==i.id&&delete e.zAxis[r.id],e.zAxis[i.id]=Ye(i))},prepare:bt()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:bt()},updateYAxisWidth(e,t){var n=t.payload,r=n.id,i=n.width,a=e.yAxis[r];if(a){var l,s=a.widthHistory||[];if(s.length===3&&s[0]===s[2]&&i===s[1]&&i!==a.width&&Math.abs(i-((l=s[0])!==null&&l!==void 0?l:0))<=1)return;var c=[...s,i].slice(-3);e.yAxis[r]=pI(pI({},a),{},{width:i,widthHistory:c})}}}}),aa=e6.actions,qge=aa.addXAxis,Wge=aa.replaceXAxis,Vge=aa.removeXAxis,Kge=aa.addYAxis,Xge=aa.replaceYAxis,Qge=aa.removeYAxis;aa.addZAxis;aa.replaceZAxis;aa.removeZAxis;var Yge=aa.updateYAxisWidth,Gge=e6.reducer,Zge=q([un],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),Jge=q([Zge,Ga,Za],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),Tk=()=>we(Jge),eve=()=>we(cde);function mI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function O1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mI(Object(n),!0).forEach(function(r){tve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tve(e,t,n){return(t=nve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nve(e){var t=rve(e,"string");return typeof t=="symbol"?t:t+""}function rve(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ive=e=>{var t=e.point,n=e.childIndex,r=e.mainColor,i=e.activeDot,a=e.dataKey,l=e.clipPath;if(i===!1||t.x==null||t.y==null)return null;var s={index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},c=O1(O1(O1({},s),Yh(i)),uA(i)),f;return O.isValidElement(i)?f=O.cloneElement(i,c):typeof i=="function"?f=i(c):f=O.createElement(L8,c),O.createElement(Rr,{className:"recharts-active-dot",clipPath:l},f)};function ave(e){var t=e.points,n=e.mainColor,r=e.activeDot,i=e.itemDataKey,a=e.clipPath,l=e.zIndex,s=l===void 0?sn.activeDot:l,c=we(ps),f=eve();if(t==null||f==null)return null;var d=t.find(p=>f.includes(p.payload));return kt(d)?null:O.createElement(ai,{zIndex:s},O.createElement(ive,{point:d,childIndex:Number(c),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}function lve(e,t){return cve(e)||uve(e,t)||sve(e,t)||ove()}function ove(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
119
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sve(e,t){if(e){if(typeof e=="string")return gI(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gI(e,t):void 0}}function gI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function uve(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function cve(e){if(Array.isArray(e))return e}var vI=(e,t,n)=>{var r=n??e;if(!kt(r))return bi(r,t,0)},fve=(e,t,n)=>{var r={},i=e.filter(by),a=e.filter(f=>f.stackId==null),l=i.reduce((f,d)=>{var p=f[d.stackId];return p==null&&(p=[]),p.push(d),f[d.stackId]=p,f},r),s=Object.entries(l).map(f=>{var d,p=lve(f,2),g=p[0],v=p[1],y=v.map(w=>w.dataKey),x=vI(t,n,(d=v[0])===null||d===void 0?void 0:d.barSize);return{stackId:g,dataKeys:y,barSize:x}}),c=a.map(f=>{var d=[f.dataKey].filter(g=>g!=null),p=vI(t,n,f.barSize);return{stackId:void 0,dataKeys:d,barSize:p}});return[...s,...c]};function yI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Om(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yI(Object(n),!0).forEach(function(r){hve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hve(e,t,n){return(t=dve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dve(e){var t=pve(e,"string");return typeof t=="symbol"?t:t+""}function pve(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mve(e,t,n,r,i){var a,l=r.length;if(!(l<1)){var s=bi(e,n,0,!0),c,f=[];if(Ve((a=r[0])===null||a===void 0?void 0:a.barSize)){var d=!1,p=n/l,g=r.reduce((k,E)=>k+(E.barSize||0),0);g+=(l-1)*s,g>=n&&(g-=(l-1)*s,s=0),g>=n&&p>0&&(d=!0,p*=.9,g=l*p);var v=Math.round((n-g)/2),y={offset:v-s,size:0};c=r.reduce((k,E)=>{var P,T={stackId:E.stackId,dataKeys:E.dataKeys,position:{offset:y.offset+y.size+s,size:d?p:(P=E.barSize)!==null&&P!==void 0?P:0}},M=[...k,T];return y=T.position,M},f)}else{var x=bi(t,n,0,!0);n-2*x-(l-1)*s<=0&&(s=0);var w=(n-2*x-(l-1)*s)/l;w>1&&(w=Math.round(w));var A=Ve(i)?Math.min(w,i):w;c=r.reduce((k,E,P)=>[...k,{stackId:E.stackId,dataKeys:E.dataKeys,position:{offset:x+(w+s)*P+(w-A)/2,size:A}}],f)}return c}}var gve=(e,t,n,r,i,a,l)=>{var s=kt(l)?t:l,c=mve(n,r,i!==a?i:a,e,s);return i!==a&&c!=null&&(c=c.map(f=>Om(Om({},f),{},{position:Om(Om({},f.position),{},{offset:f.position.offset-i/2})}))),c},vve=(e,t)=>{var n=NA(t);if(!(!e||n==null||t==null)){var r=t.stackId;if(r!=null){var i=e[r];if(i){var a=i.stackedData;if(a)return a.find(l=>l.key===n)}}}},yve=(e,t)=>{if(!(e==null||t==null)){var n=e.find(r=>r.stackId===t.stackId&&t.dataKey!=null&&r.dataKeys.includes(t.dataKey));if(n!=null)return n.position}};function bve(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&Ve(e.zIndex)?e.zIndex:t}var xve=e=>{var t=e.chartData,n=St(),r=jn();return O.useEffect(()=>r?()=>{}:(n(_N(t)),()=>{n(_N(void 0))}),[t,n,r]),null},bI={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},t6=Ln({name:"brush",initialState:bI,reducers:{setBrushSettings(e,t){return t.payload==null?bI:t.payload}}});t6.actions.setBrushSettings;var Sve=t6.reducer;function wve(e){return(e%180+180)%180}var Ove=function(t){var n=t.width,r=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=wve(i),l=a*Math.PI/180,s=Math.atan(r/n),c=l>s&&l<Math.PI-s?r/Math.sin(l):n/Math.cos(l);return Math.abs(c)},Ave={dots:[],areas:[],lines:[]},n6=Ln({name:"referenceElements",initialState:Ave,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=Gr(e).dots.findIndex(r=>r===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=Gr(e).areas.findIndex(r=>r===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(Ye(t.payload))},removeLine:(e,t)=>{var n=Gr(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),Oc=n6.actions;Oc.addDot;Oc.removeDot;Oc.addArea;Oc.removeArea;Oc.addLine;Oc.removeLine;var kve=n6.reducer;function Cve(e,t){return Pve(e)||Mve(e,t)||Tve(e,t)||Eve()}function Eve(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
120
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tve(e,t){if(e){if(typeof e=="string")return xI(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xI(e,t):void 0}}function xI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Mve(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function Pve(e){if(Array.isArray(e))return e}var Dve=O.createContext(void 0),Rve=e=>{var t=e.children,n=O.useState("".concat(Th("recharts"),"-clip")),r=Cve(n,1),i=r[0],a=Tk();if(a==null)return null;var l=a.x,s=a.y,c=a.width,f=a.height;return O.createElement(Dve.Provider,{value:i},O.createElement("defs",null,O.createElement("clipPath",{id:i},O.createElement("rect",{x:l,y:s,height:f,width:c}))),t)};function r6(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],r=0;r<e.length;r+=t){var i=e[r];i!==void 0&&n.push(i)}return n}function _ve(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Ove(r,n)}function Nve(e,t,n){var r=n==="width",i=e.x,a=e.y,l=e.width,s=e.height;return t===1?{start:r?i:a,end:r?i+l:a+s}:{start:r?i+l:a+s,end:r?i:a}}function zh(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function Ive(e,t){return r6(e,t+1)}function Lve(e,t,n,r,i){for(var a=(r||[]).slice(),l=t.start,s=t.end,c=0,f=1,d=l,p=function(){var y=r?.[c];if(y===void 0)return{v:r6(r,f)};var x=c,w,A=()=>(w===void 0&&(w=n(y,x)),w),k=y.coordinate,E=c===0||zh(e,k,A,d,s);E||(c=0,d=l,f+=1),E&&(d=k+e*(A()/2+i),c+=f)},g;f<=a.length;)if(g=p(),g)return g.v;return[]}function jve(e,t,n,r,i){var a=(r||[]).slice(),l=a.length;if(l===0)return[];for(var s=t.start,c=t.end,f=1;f<=l;f++){for(var d=(l-1)%f,p=s,g=!0,v=function(){var P=r[x];if(P==null)return 0;var T=x,M,R=()=>(M===void 0&&(M=n(P,T)),M),L=P.coordinate,H=x===d||zh(e,L,R,p,c);if(!H)return g=!1,1;H&&(p=L+e*(R()/2+i))},y,x=d;x<l&&(y=v(),!(y!==0&&y===1));x+=f);if(g){for(var w=[],A=d;A<l;A+=f){var k=r[A];k!=null&&w.push(k)}return w}}return[]}function SI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function En(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SI(Object(n),!0).forEach(function(r){Bve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bve(e,t,n){return(t=zve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zve(e){var t=$ve(e,"string");return typeof t=="symbol"?t:t+""}function $ve(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Hve(e,t,n,r,i){for(var a=(r||[]).slice(),l=a.length,s=t.start,c=t.end,f=function(g){var v=a[g];if(v==null)return 1;var y=v,x,w=()=>(x===void 0&&(x=n(v,g)),x);if(g===l-1){var A=e*(y.coordinate+e*w()/2-c);a[g]=y=En(En({},y),{},{tickCoord:A>0?y.coordinate-A*e:y.coordinate})}else a[g]=y=En(En({},y),{},{tickCoord:y.coordinate});if(y.tickCoord!=null){var k=zh(e,y.tickCoord,w,s,c);k&&(c=y.tickCoord-e*(w()/2+i),a[g]=En(En({},y),{},{isShow:!0}))}},d=l-1;d>=0;d--)f(d);return a}function Uve(e,t,n,r,i,a){var l=(r||[]).slice(),s=l.length,c=t.start,f=t.end;if(a){var d=r[s-1];if(d!=null){var p=n(d,s-1),g=e*(d.coordinate+e*p/2-f);if(l[s-1]=d=En(En({},d),{},{tickCoord:g>0?d.coordinate-g*e:d.coordinate}),d.tickCoord!=null){var v=zh(e,d.tickCoord,()=>p,c,f);v&&(f=d.tickCoord-e*(p/2+i),l[s-1]=En(En({},d),{},{isShow:!0}))}}}for(var y=a?s-1:s,x=function(k){var E=l[k];if(E==null)return 1;var P=E,T,M=()=>(T===void 0&&(T=n(E,k)),T);if(k===0){var R=e*(P.coordinate-e*M()/2-c);l[k]=P=En(En({},P),{},{tickCoord:R<0?P.coordinate-R*e:P.coordinate})}else l[k]=P=En(En({},P),{},{tickCoord:P.coordinate});if(P.tickCoord!=null){var L=zh(e,P.tickCoord,M,c,f);L&&(c=P.tickCoord+e*(M()/2+i),l[k]=En(En({},P),{},{isShow:!0}))}},w=0;w<y;w++)x(w);return l}function Mk(e,t,n){var r=e.tick,i=e.ticks,a=e.viewBox,l=e.minTickGap,s=e.orientation,c=e.interval,f=e.tickFormatter,d=e.unit,p=e.angle;if(!i||!i.length||!r)return[];if(be(c)||rd.isSsr){var g;return(g=Ive(i,be(c)?c:0))!==null&&g!==void 0?g:[]}var v=[],y=s==="top"||s==="bottom"?"width":"height",x=d&&y==="width"?th(d,{fontSize:t,letterSpacing:n}):{width:0,height:0},w=(T,M)=>{var R=typeof f=="function"?f(T.value,M):T.value;return y==="width"?_ve(th(R,{fontSize:t,letterSpacing:n}),x,p):th(R,{fontSize:t,letterSpacing:n})[y]},A=i[0],k=i[1],E=i.length>=2&&A!=null&&k!=null?or(k.coordinate-A.coordinate):1,P=Nve(a,E,y);return c==="equidistantPreserveStart"?Lve(E,P,w,i,l):c==="equidistantPreserveEnd"?jve(E,P,w,i,l):(c==="preserveStart"||c==="preserveStartEnd"?v=Uve(E,P,w,i,l,c==="preserveStartEnd"):v=Hve(E,P,w,i,l),v.filter(T=>T.isShow))}var Fve=e=>{var t=e.ticks,n=e.label,r=e.labelGapWithTick,i=r,a=e.tickSize,l=a===void 0?0:a,s=e.tickMargin,c=s===void 0?0:s,f=0;if(t){Array.from(t).forEach(v=>{if(v){var y=v.getBoundingClientRect();y.width>f&&(f=y.width)}});var d=n?n.getBoundingClientRect().width:0,p=l+c,g=f+p+d+(n?i:0);return Math.round(g)}return 0},qve={xAxis:{},yAxis:{}},i6=Ln({name:"renderedTicks",initialState:qve,reducers:{setRenderedTicks:(e,t)=>{var n=t.payload,r=n.axisType,i=n.axisId,a=n.ticks;e[r][i]=Ye(a)},removeRenderedTicks:(e,t)=>{var n=t.payload,r=n.axisType,i=n.axisId;delete e[r][i]}}}),a6=i6.actions,Wve=a6.setRenderedTicks,Vve=a6.removeRenderedTicks,Kve=i6.reducer,Xve=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function wI(e,t){return Zve(e)||Gve(e,t)||Yve(e,t)||Qve()}function Qve(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
121
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yve(e,t){if(e){if(typeof e=="string")return OI(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?OI(e,t):void 0}}function OI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Gve(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function Zve(e){if(Array.isArray(e))return e}function Jve(e,t){if(e==null)return{};var n,r,i=eye(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function eye(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function ms(){return ms=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ms.apply(null,arguments)}function AI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Mt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AI(Object(n),!0).forEach(function(r){tye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tye(e,t,n){return(t=nye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nye(e){var t=rye(e,"string");return typeof t=="symbol"?t:t+""}function rye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ja={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd",zIndex:sn.axis};function iye(e){var t=e.x,n=e.y,r=e.width,i=e.height,a=e.orientation,l=e.mirror,s=e.axisLine,c=e.otherSvgProps;if(!s)return null;var f=Mt(Mt(Mt({},c),yi(s)),{},{fill:"none"});if(a==="top"||a==="bottom"){var d=+(a==="top"&&!l||a==="bottom"&&l);f=Mt(Mt({},f),{},{x1:t,y1:n+d*i,x2:t+r,y2:n+d*i})}else{var p=+(a==="left"&&!l||a==="right"&&l);f=Mt(Mt({},f),{},{x1:t+p*r,y1:n,x2:t+p*r,y2:n+i})}return O.createElement("line",ms({},f,{className:st("recharts-cartesian-axis-line",qa(s,"className"))}))}function aye(e,t,n,r,i,a,l,s,c){var f,d,p,g,v,y,x=s?-1:1,w=e.tickSize||l,A=be(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":f=d=e.coordinate,g=n+ +!s*i,p=g-x*w,y=p-x*c,v=A;break;case"left":p=g=e.coordinate,d=t+ +!s*r,f=d-x*w,v=f-x*c,y=A;break;case"right":p=g=e.coordinate,d=t+ +s*r,f=d+x*w,v=f+x*c,y=A;break;default:f=d=e.coordinate,g=n+ +s*i,p=g+x*w,y=p+x*c,v=A;break}return{line:{x1:f,y1:p,x2:d,y2:g},tick:{x:v,y}}}function lye(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function oye(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function sye(e){var t=e.option,n=e.tickProps,r=e.value,i,a=st(n.className,"recharts-cartesian-axis-tick-value");if(O.isValidElement(t))i=O.cloneElement(t,Mt(Mt({},n),{},{className:a}));else if(typeof t=="function")i=t(Mt(Mt({},n),{},{className:a}));else{var l="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(l=st(l,Ume(t))),i=O.createElement(Ak,ms({},n,{className:l}),r)}return i}function uye(e){var t=e.ticks,n=e.axisType,r=e.axisId,i=St();return O.useEffect(()=>{if(r==null||n==null)return vs;var a=t.map(l=>({value:l.value,coordinate:l.coordinate,offset:l.offset,index:l.index}));return i(Wve({ticks:a,axisId:r,axisType:n})),()=>{i(Vve({axisId:r,axisType:n}))}},[i,t,r,n]),null}var cye=O.forwardRef((e,t)=>{var n=e.ticks,r=n===void 0?[]:n,i=e.tick,a=e.tickLine,l=e.stroke,s=e.tickFormatter,c=e.unit,f=e.padding,d=e.tickTextProps,p=e.orientation,g=e.mirror,v=e.x,y=e.y,x=e.width,w=e.height,A=e.tickSize,k=e.tickMargin,E=e.fontSize,P=e.letterSpacing,T=e.getTicksConfig,M=e.events,R=e.axisType,L=e.axisId,H=Mk(Mt(Mt({},T),{},{ticks:r}),E,P),K=yi(T),V=Yh(i),B=C8(K.textAnchor)?K.textAnchor:lye(p,g),ae=oye(p,g),ie={};typeof a=="object"&&(ie=a);var oe=Mt(Mt({},K),{},{fill:"none"},ie),z=H.map(ce=>Mt({entry:ce},aye(ce,v,y,x,w,p,A,g,k))),G=z.map(ce=>{var fe=ce.entry,N=ce.line;return O.createElement(Rr,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(fe.value,"-").concat(fe.coordinate,"-").concat(fe.tickCoord)},a&&O.createElement("line",ms({},oe,N,{className:st("recharts-cartesian-axis-tick-line",qa(a,"className"))})))}),ne=z.map((ce,fe)=>{var N,X,re=ce.entry,le=ce.tick,ge=Mt(Mt(Mt(Mt({verticalAnchor:ae},K),{},{textAnchor:B,stroke:"none",fill:l},le),{},{index:fe,payload:re,visibleTicksCount:H.length,tickFormatter:s,padding:f},d),{},{angle:(N=(X=d?.angle)!==null&&X!==void 0?X:K.angle)!==null&&N!==void 0?N:0}),Oe=Mt(Mt({},ge),V);return O.createElement(Rr,ms({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(re.value,"-").concat(re.coordinate,"-").concat(re.tickCoord)},Yv(M,re,fe)),i&&O.createElement(sye,{option:i,tickProps:Oe,value:"".concat(typeof s=="function"?s(re.value,fe):re.value).concat(c||"")}))});return O.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(R,"-ticks")},O.createElement(uye,{ticks:H,axisId:L,axisType:R}),ne.length>0&&O.createElement(ai,{zIndex:sn.label},O.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(R,"-tick-labels"),ref:t},ne)),G.length>0&&O.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(R,"-tick-lines")},G))}),fye=O.forwardRef((e,t)=>{var n=e.axisLine,r=e.width,i=e.height,a=e.className,l=e.hide,s=e.ticks,c=e.axisType,f=e.axisId,d=Jve(e,Xve),p=O.useState(""),g=wI(p,2),v=g[0],y=g[1],x=O.useState(""),w=wI(x,2),A=w[0],k=w[1],E=O.useRef(null);O.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var T;return Fve({ticks:E.current,label:(T=e.labelRef)===null||T===void 0?void 0:T.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var P=O.useCallback(T=>{if(T){var M=T.getElementsByClassName("recharts-cartesian-axis-tick-value");E.current=M;var R=M[0];if(R){var L=window.getComputedStyle(R),H=L.fontSize,K=L.letterSpacing;(H!==v||K!==A)&&(y(H),k(K))}}},[v,A]);return l||r!=null&&r<=0||i!=null&&i<=0?null:O.createElement(ai,{zIndex:e.zIndex},O.createElement(Rr,{className:st("recharts-cartesian-axis",a)},O.createElement(iye,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:yi(e)}),O.createElement(cye,{ref:P,axisType:c,events:d,fontSize:v,getTicksConfig:e,height:e.height,letterSpacing:A,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:s,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:f}),O.createElement(Ome,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},O.createElement(_me,{label:e.label,labelRef:e.labelRef}),e.children)))}),Pk=O.forwardRef((e,t)=>{var n=In(e,ja);return O.createElement(fye,ms({},n,{ref:t}))});Pk.displayName="CartesianAxis";var hye=["x1","y1","x2","y2","key"],dye=["offset"],pye=["xAxisId","yAxisId"],mye=["xAxisId","yAxisId"];function kI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Mn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kI(Object(n),!0).forEach(function(r){gye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gye(e,t,n){return(t=vye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vye(e){var t=yye(e,"string");return typeof t=="symbol"?t:t+""}function yye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xo(){return Xo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xo.apply(null,arguments)}function gv(e,t){if(e==null)return{};var n,r,i=bye(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function bye(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var xye=e=>{var t=e.fill;if(!t||t==="none")return null;var n=e.fillOpacity,r=e.x,i=e.y,a=e.width,l=e.height,s=e.ry;return O.createElement("rect",{x:r,y:i,ry:s,width:a,height:l,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function l6(e){var t=e.option,n=e.lineItemProps,r;if(O.isValidElement(t))r=O.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var i,a=n.x1,l=n.y1,s=n.x2,c=n.y2,f=n.key,d=gv(n,hye),p=(i=yi(d))!==null&&i!==void 0?i:{};p.offset;var g=gv(p,dye);r=O.createElement("line",Xo({},g,{x1:a,y1:l,x2:s,y2:c,fill:"none",key:f}))}return r}function Sye(e){var t=e.x,n=e.width,r=e.horizontal,i=r===void 0?!0:r,a=e.horizontalPoints;if(!i||!a||!a.length)return null;e.xAxisId,e.yAxisId;var l=gv(e,pye),s=a.map((c,f)=>{var d=Mn(Mn({},l),{},{x1:t,y1:c,x2:t+n,y2:c,key:"line-".concat(f),index:f});return O.createElement(l6,{key:"line-".concat(f),option:i,lineItemProps:d})});return O.createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function wye(e){var t=e.y,n=e.height,r=e.vertical,i=r===void 0?!0:r,a=e.verticalPoints;if(!i||!a||!a.length)return null;e.xAxisId,e.yAxisId;var l=gv(e,mye),s=a.map((c,f)=>{var d=Mn(Mn({},l),{},{x1:c,y1:t,x2:c,y2:t+n,key:"line-".concat(f),index:f});return O.createElement(l6,{option:i,lineItemProps:d,key:"line-".concat(f)})});return O.createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function Oye(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,i=e.y,a=e.width,l=e.height,s=e.horizontalPoints,c=e.horizontal,f=c===void 0?!0:c;if(!f||!t||!t.length||s==null)return null;var d=s.map(g=>Math.round(g+i-i)).sort((g,v)=>g-v);i!==d[0]&&d.unshift(0);var p=d.map((g,v)=>{var y=d[v+1],x=y==null,w=x?i+l-g:y-g;if(w<=0)return null;var A=v%t.length;return O.createElement("rect",{key:"react-".concat(v),y:g,x:r,height:w,width:a,stroke:"none",fill:t[A],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return O.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function Aye(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,i=e.fillOpacity,a=e.x,l=e.y,s=e.width,c=e.height,f=e.verticalPoints;if(!n||!r||!r.length)return null;var d=f.map(g=>Math.round(g+a-a)).sort((g,v)=>g-v);a!==d[0]&&d.unshift(0);var p=d.map((g,v)=>{var y=d[v+1],x=y==null,w=x?a+s-g:y-g;if(w<=0)return null;var A=v%r.length;return O.createElement("rect",{key:"react-".concat(v),x:g,y:l,width:w,height:c,stroke:"none",fill:r[A],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return O.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var kye=(e,t)=>{var n=e.xAxis,r=e.width,i=e.height,a=e.offset;return D5(Mk(Mn(Mn(Mn({},ja),n),{},{ticks:R5(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},Cye=(e,t)=>{var n=e.yAxis,r=e.width,i=e.height,a=e.offset;return D5(Mk(Mn(Mn(Mn({},ja),n),{},{ticks:R5(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},Eye={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:sn.grid};function Dw(e){var t=SA(),n=wA(),r=j5(),i=Mn(Mn({},In(e,Eye)),{},{x:be(e.x)?e.x:r.left,y:be(e.y)?e.y:r.top,width:be(e.width)?e.width:r.width,height:be(e.height)?e.height:r.height}),a=i.xAxisId,l=i.yAxisId,s=i.x,c=i.y,f=i.width,d=i.height,p=i.syncWithTicks,g=i.horizontalValues,v=i.verticalValues,y=jn(),x=we(H=>xN(H,"xAxis",a,y)),w=we(H=>xN(H,"yAxis",l,y));if(!Ji(f)||!Ji(d)||!be(s)||!be(c))return null;var A=i.verticalCoordinatesGenerator||kye,k=i.horizontalCoordinatesGenerator||Cye,E=i.horizontalPoints,P=i.verticalPoints;if((!E||!E.length)&&typeof k=="function"){var T=g&&g.length,M=k({yAxis:w?Mn(Mn({},w),{},{ticks:T?g:w.ticks}):void 0,width:t??f,height:n??d,offset:r},T?!0:p);Wg(Array.isArray(M),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof M,"]")),Array.isArray(M)&&(E=M)}if((!P||!P.length)&&typeof A=="function"){var R=v&&v.length,L=A({xAxis:x?Mn(Mn({},x),{},{ticks:R?v:x.ticks}):void 0,width:t??f,height:n??d,offset:r},R?!0:p);Wg(Array.isArray(L),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof L,"]")),Array.isArray(L)&&(P=L)}return O.createElement(ai,{zIndex:i.zIndex},O.createElement("g",{className:"recharts-cartesian-grid"},O.createElement(xye,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),O.createElement(Oye,Xo({},i,{horizontalPoints:E})),O.createElement(Aye,Xo({},i,{verticalPoints:P})),O.createElement(Sye,Xo({},i,{offset:r,horizontalPoints:E,xAxis:x,yAxis:w})),O.createElement(wye,Xo({},i,{offset:r,verticalPoints:P,xAxis:x,yAxis:w}))))}Dw.displayName="CartesianGrid";var Tye=["animationElapsedTime","isAnimating","isEntrance","visibleLength","strokeDasharray","connectNulls"];function Rw(){return Rw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rw.apply(null,arguments)}function Mye(e,t){if(e==null)return{};var n,r,i=Pye(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Pye(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Dye(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function o6(e,t){return"".concat(t,"px ").concat(e,"px")}function Rye(e){return e.length%2!==0?[...e,...e]:e}function _ye(e,t){for(var n=[],r=0;r<t;++r)n.push(...e);return n}function Nye(e,t,n){var r=Rye(n),i=r.reduce((v,y)=>v+y,0);if(!i)return o6(t,e);for(var a=Math.floor(e/i),l=e%i,s=[],c=0,f=0;c<r.length;f+=(d=r[c])!==null&&d!==void 0?d:0,++c){var d,p=r[c];if(p!=null&&f+p>l){s=[...r.slice(0,c),l-f];break}}var g=s.length%2===0?[0,t]:[t];return[..._ye(r,a),...s,...g].map(v=>"".concat(v,"px")).join(", ")}function Iye(e,t,n){if(e){var r="".concat(e).split(/[,\s]+/gim).map(i=>parseFloat(i));return Nye(n,t,r)}return o6(t,n)}function Lye(e){e.animationElapsedTime,e.isAnimating,e.isEntrance;var t=e.visibleLength,n=e.strokeDasharray,r=e.connectNulls,i=Mye(e,Tye),a=r??!1,l;if(t!=null){var s,c=i.pathRef,f=Dye((s=c?.current)!==null&&s!==void 0?s:null);l=Iye(n,f,t)}else n!=null&&(l=String(n));return O.createElement(q5,Rw({},i,{connectNulls:a,strokeDasharray:l}))}function jye(e){var t=O.useRef(0),n=O.useRef(0),r=O.useRef(!1),i=O.useRef(e);return i.current!==e&&(t.current=n.current,i.current=e),O.useCallback((a,l)=>{if(r.current)return null;var s=Math.min(Da(t.current+a*l),l);return a>0&&l>0&&(n.current=Math.max(n.current,s),s>=l)?(r.current=!0,null):s},[])}var Bye={},s6=Ln({name:"errorBars",initialState:Bye,reducers:{addErrorBar:(e,t)=>{var n=t.payload,r=n.itemId,i=n.errorBar;e[r]||(e[r]=[]),e[r].push(i)},replaceErrorBar:(e,t)=>{var n=t.payload,r=n.itemId,i=n.prev,a=n.next;e[r]&&(e[r]=e[r].map(l=>l.dataKey===i.dataKey&&l.direction===i.direction?a:l))},removeErrorBar:(e,t)=>{var n=t.payload,r=n.itemId,i=n.errorBar;e[r]&&(e[r]=e[r].filter(a=>a.dataKey!==i.dataKey||a.direction!==i.direction))}}}),Dk=s6.actions;Dk.addErrorBar;Dk.replaceErrorBar;Dk.removeErrorBar;var zye=s6.reducer,$ye=["children"];function Hye(e,t){if(e==null)return{};var n,r,i=Uye(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Uye(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Fye={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},qye=O.createContext(Fye);function u6(e){var t=e.children,n=Hye(e,$ye);return O.createElement(qye.Provider,{value:n},t)}function Rk(e,t){var n,r,i=we(f=>el(f,e)),a=we(f=>tl(f,t)),l=(n=i?.allowDataOverflow)!==null&&n!==void 0?n:Vt.allowDataOverflow,s=(r=a?.allowDataOverflow)!==null&&r!==void 0?r:Kt.allowDataOverflow,c=l||s;return{needClip:c,needClipX:l,needClipY:s}}function c6(e){var t=e.xAxisId,n=e.yAxisId,r=e.clipPathId,i=Tk(),a=Rk(t,n),l=a.needClipX,s=a.needClipY,c=a.needClip,f=we(E=>R4(E,t,!1)),d=we(E=>_4(E,n,!1));if(!c||!i)return null;var p=i.x,g=i.y,v=i.width,y=i.height,x=l&&f?Math.min(f[0],f[1]):p-v/2,w=s&&d?Math.min(d[0],d[1]):g-y/2,A=l&&f?Math.abs(f[1]-f[0]):v*2,k=s&&d?Math.abs(d[1]-d[0]):y*2;return O.createElement("clipPath",{id:"clipPath-".concat(r)},O.createElement("rect",{x,y:w,width:A,height:k}))}var f6=(e,t,n,r)=>to(e,"xAxis",t,r),h6=(e,t,n,r)=>eo(e,"xAxis",t,r),d6=(e,t,n,r)=>to(e,"yAxis",n,r),p6=(e,t,n,r)=>eo(e,"yAxis",n,r),Wye=q([nt,f6,d6,h6,p6],(e,t,n,r,i)=>Ya(e,"xAxis")?Zu(t,r,!1):Zu(n,i,!1)),Vye=(e,t,n,r,i)=>i;function Kye(e){return e.type==="line"}var Xye=q([Ey,Vye],(e,t)=>e.filter(Kye).find(n=>n.id===t)),Qye=q([nt,f6,d6,h6,p6,Xye,Wye,id],(e,t,n,r,i,a,l,s)=>{var c=s.chartData,f=s.dataStartIndex,d=s.dataEndIndex;if(!(a==null||t==null||n==null||r==null||i==null||r.length===0||i.length===0||l==null||e!=="horizontal"&&e!=="vertical")){var p=a.dataKey,g=a.data,v;if(g!=null&&g.length>0?v=g:v=c?.slice(f,d+1),v!=null)return v0e({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:p,bandSize:l,displayedData:v})}});function Yye(e){var t=Yh(e),n=3,r=2;if(t!=null){var i=t.r,a=t.strokeWidth,l=Number(i),s=Number(a);return(Number.isNaN(l)||l<0)&&(l=n),(Number.isNaN(s)||s<0)&&(s=r),{r:l,strokeWidth:s}}return{r:n,strokeWidth:r}}var Gye=["id"],Zye=["type","layout","connectNulls","needClip","shape","strokeDasharray"],Jye=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function vv(){return vv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vv.apply(null,arguments)}function _k(e,t){if(e==null)return{};var n,r,i=e0e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function e0e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function CI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Bi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CI(Object(n),!0).forEach(function(r){t0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function t0e(e,t,n){return(t=n0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n0e(e){var t=r0e(e,"string");return typeof t=="symbol"?t:t+""}function r0e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function i0e(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function a0e(e){var t=0,n=0;for(var r of e)r.status==="matched"&&r.prev.x!=null&&r.next.x!=null&&(t+=r.next.x-r.prev.x,n++);return n>0?t/n:0}var l0e=(e,t)=>{if(e==null)return[];if(t===1)return e.flatMap(s=>s.status==="removed"?[]:[s.next]);var n=a0e(e),r=[];for(var i of e)if(i.status==="matched")r.push(Bi(Bi({},i.next),{},{x:Ft(i.prev.x,i.next.x,t),y:Ft(i.prev.y,i.next.y,t)}));else if(i.status==="added")if(i.next.x!=null){var a=i.next.x-n;r.push(Bi(Bi({},i.next),{},{x:Ft(a,i.next.x,t),y:i.next.y}))}else r.push(i.next);else if(i.status==="removed"&&i.prev.x!=null){var l=i.prev.x+n;r.push(Bi(Bi({},i.prev),{},{x:Ft(i.prev.x,l,t),y:i.prev.y}))}return r},Nk={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",animationInterpolateFn:l0e,animationMatchBy:Ck,connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",shape:Lye,stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:sn.line,type:"linear"},o0e=e=>{var t=e.dataKey,n=e.name,r=e.stroke,i=e.legendType,a=e.hide;return[{inactive:a,dataKey:t,type:i,color:r,value:sy(n,t),payload:e}]},s0e=O.memo(e=>{var t=e.dataKey,n=e.data,r=e.stroke,i=e.strokeWidth,a=e.fill,l=e.name,s=e.hide,c=e.unit,f=e.formatter,d=e.tooltipType,p=e.id,g={dataDefinedOnItem:n,getPosition:vs,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:sy(l,t),hide:s,type:d,color:r,unit:c,formatter:f,graphicalItemId:p}};return O.createElement(W8,{tooltipEntrySettings:g})});function u0e(e){var t=e.clipPathId,n=e.points,r=e.props,i=r.dot,a=r.dataKey,l=r.needClip;r.id;var s=_k(r,Gye),c=yi(s);return O.createElement(zge,{points:n,dot:i,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:c,needClip:l,clipPathId:t})}function c0e(e){var t=e.showLabels,n=e.children,r=e.points,i=O.useMemo(()=>r?.map(a=>{var l,s,c={x:(l=a.x)!==null&&l!==void 0?l:0,y:(s=a.y)!==null&&s!==void 0?s:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Bi(Bi({},c),{},{value:a.value,payload:a.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[r]);return O.createElement(_8,{value:t?i:void 0},n)}function f0e(e){var t=e.clipPathId,n=e.pathRef,r=e.points,i=e.props,a=e.animationElapsedTime,l=e.isAnimating,s=e.isEntrance,c=e.visibleLength,f=i.type,d=i.layout,p=i.connectNulls,g=i.needClip,v=i.shape,y=i.strokeDasharray,x=_k(i,Zye),w=Bi(Bi({},Dr(x)),{},{fill:"none",className:"recharts-line-curve",clipPath:g?"url(#clipPath-".concat(t,")"):void 0,points:r,type:f,layout:d,connectNulls:p,strokeDasharray:y??i.strokeDasharray,pathRef:n,animationElapsedTime:a,isAnimating:l,isEntrance:i.animateNewValues?s:!1,visibleLength:c});return O.createElement(O.Fragment,null,r?.length>1&&O.createElement(H8,{option:v,DefaultShape:Nk.shape,shapeProps:w}),O.createElement(u0e,{points:r,clipPathId:t,props:i}))}function h0e(e){var t=e.clipPathId,n=e.props,r=e.pathRef,i=e.previousPointsRef,a=n.points,l=n.isAnimationActive,s=n.animationBegin,c=n.animationDuration,f=n.animationEasing,d=n.animationMatchBy,p=n.animationInterpolateFn,g=n.layout,v=i0e(r.current),y=X8(n.onAnimationStart,n.onAnimationEnd),x=y.isAnimating,w=y.handleAnimationStart,A=y.handleAnimationEnd,k=!x,E=jye(a),P=O.useCallback(T=>T>0&&v>0,[v]);return O.createElement(c0e,{points:a,showLabels:k},n.children,O.createElement(Q8,{animationInput:a,animationIdPrefix:"recharts-line-",items:a,previousItemsRef:i,isAnimationActive:l,animationBegin:s,animationDuration:c,animationEasing:f,onAnimationStart:w,onAnimationEnd:A,animationInterpolateFn:p,animationMatchBy:d,shouldUpdatePreviousRef:P,layout:g},(T,M,R)=>{var L=x||M<1,H=L?E(M,v):null;return O.createElement(f0e,{props:n,points:T,clipPathId:t,pathRef:r,animationElapsedTime:M,isAnimating:L,isEntrance:R,visibleLength:H})}),O.createElement(I8,{label:n.label}))}function d0e(e){var t=e.clipPathId,n=e.props,r=O.useRef(null),i=O.useRef(null);return O.createElement(h0e,{props:n,clipPathId:t,previousPointsRef:r,pathRef:i})}var p0e=(e,t)=>{var n,r;return{x:(n=e.x)!==null&&n!==void 0?n:void 0,y:(r=e.y)!==null&&r!==void 0?r:void 0,value:e.value,errorVal:Bt(e.payload,t)}};class m0e extends O.Component{render(){var t=this.props,n=t.hide,r=t.dot,i=t.points,a=t.className,l=t.xAxisId,s=t.yAxisId,c=t.top,f=t.left,d=t.width,p=t.height,g=t.id,v=t.needClip,y=t.zIndex;if(n)return null;var x=st("recharts-line",a),w=g,A=Yye(r),k=A.r,E=A.strokeWidth,P=z8(r),T=k*2+E,M=v?"url(#clipPath-".concat(P?"":"dots-").concat(w,")"):void 0;return O.createElement(ai,{zIndex:y},O.createElement(Rr,{className:x},v&&O.createElement("defs",null,O.createElement(c6,{clipPathId:w,xAxisId:l,yAxisId:s}),!P&&O.createElement("clipPath",{id:"clipPath-dots-".concat(w)},O.createElement("rect",{x:f-T/2,y:c-T/2,width:d+T,height:p+T}))),O.createElement(u6,{xAxisId:l,yAxisId:s,data:i,dataPointFormatter:p0e,errorBarOffset:0},O.createElement(d0e,{props:this.props,clipPathId:w}))),O.createElement(ave,{activeDot:this.props.activeDot,points:i,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:M}))}}function g0e(e){var t=In(e,Nk),n=t.activeDot,r=t.animateNewValues,i=t.animationBegin,a=t.animationDuration,l=t.animationEasing,s=t.connectNulls,c=t.dot,f=t.hide,d=t.isAnimationActive,p=t.label,g=t.legendType,v=t.xAxisId,y=t.yAxisId,x=t.id,w=_k(t,Jye),A=Rk(v,y),k=A.needClip,E=Tk(),P=ys(),T=jn(),M=we(V=>Qye(V,v,y,T,x));if(P!=="horizontal"&&P!=="vertical"||M==null||E==null)return null;var R=E.height,L=E.width,H=E.x,K=E.y;return O.createElement(m0e,vv({},w,{id:x,connectNulls:s,dot:c,activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:l,isAnimationActive:d,hide:f,label:p,legendType:g,xAxisId:v,yAxisId:y,points:M,layout:P,height:R,width:L,left:H,top:K,needClip:k}))}function v0e(e){var t=e.layout,n=e.xAxis,r=e.yAxis,i=e.xAxisTicks,a=e.yAxisTicks,l=e.dataKey,s=e.bandSize,c=e.displayedData;return c.map((f,d)=>{var p=Bt(f,l);if(t==="horizontal"){var g=mR({axis:n,ticks:i,bandSize:s,entry:f,index:d}),v=kt(p)?null:r.scale.map(p);return{x:g,y:v??null,value:p,payload:f}}var y=kt(p)?null:n.scale.map(p),x=mR({axis:r,ticks:a,bandSize:s,entry:f,index:d});return y==null||x==null?null:{x:y,y:x,value:p,payload:f}}).filter(Boolean)}function y0e(e){var t=In(e,Nk),n=jn();return O.createElement(Y8,{id:t.id,type:"line"},r=>O.createElement(O.Fragment,null,O.createElement(V8,{legendPayload:o0e(t)}),O.createElement(s0e,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,formatter:t.formatter,tooltipType:t.tooltipType,id:r}),O.createElement(Z8,{type:"line",id:r,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),O.createElement(g0e,vv({},t,{id:r}))))}var m6=O.memo(y0e,dc);m6.displayName="Line";function ws(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.xAxisId)!==null&&n!==void 0?n:J8}function Os(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.yAxisId)!==null&&n!==void 0?n:J8}var b0e="Invariant failed";function x0e(e,t){throw new Error(b0e)}var S0e=["option"];function w0e(e,t){if(e==null)return{};var n,r,i=O0e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function O0e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Ik=Y5;function Lk(e){var t=e.option,n=w0e(e,S0e);return O.createElement(H8,{option:t,DefaultShape:Ik,shapeProps:n,activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"})}var A0e=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,i)=>{if(be(t))return t;var a=be(r)||kt(r);return a?t(r,i):(a||x0e(),n)}},k0e=(e,t,n)=>n,C0e=(e,t)=>t,md=q([Ey,C0e],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),E0e=q([md],e=>e?.maxBarSize),T0e=(e,t,n,r)=>r,M0e=q([nt,Ey,ws,Os,k0e],(e,t,n,r,i)=>t.filter(a=>e==="horizontal"?a.xAxisId===n:a.yAxisId===r).filter(a=>a.isPanorama===i).filter(a=>a.hide===!1).filter(a=>a.type==="bar")),P0e=(e,t,n)=>{var r=nt(e),i=ws(e,t),a=Os(e,t);if(!(i==null||a==null))return r==="horizontal"?Cw(e,"yAxis",a,n):Cw(e,"xAxis",i,n)},D0e=(e,t)=>{var n=nt(e),r=ws(e,t),i=Os(e,t);if(!(r==null||i==null))return n==="horizontal"?bN(e,"xAxis",r):bN(e,"yAxis",i)},R0e=q([M0e,dse,D0e],fve),_0e=(e,t,n)=>{var r,i,a=md(e,t);if(a==null)return 0;var l=ws(e,t),s=Os(e,t);if(l==null||s==null)return 0;var c=nt(e),f=f$(e),d=a.maxBarSize,p=kt(d)?f:d,g,v;return c==="horizontal"?(g=to(e,"xAxis",l,n),v=eo(e,"xAxis",l,n)):(g=to(e,"yAxis",s,n),v=eo(e,"yAxis",s,n)),(r=(i=Zu(g,v,!0))!==null&&i!==void 0?i:p)!==null&&r!==void 0?r:0},g6=(e,t,n)=>{var r=nt(e),i=ws(e,t),a=Os(e,t);if(!(i==null||a==null)){var l,s;return r==="horizontal"?(l=to(e,"xAxis",i,n),s=eo(e,"xAxis",i,n)):(l=to(e,"yAxis",a,n),s=eo(e,"yAxis",a,n)),Zu(l,s)}},N0e=q([R0e,f$,hse,h$,_0e,g6,E0e],gve),I0e=(e,t,n)=>{var r=ws(e,t);if(r!=null)return to(e,"xAxis",r,n)},L0e=(e,t,n)=>{var r=Os(e,t);if(r!=null)return to(e,"yAxis",r,n)},j0e=(e,t,n)=>{var r=ws(e,t);if(r!=null)return eo(e,"xAxis",r,n)},B0e=(e,t,n)=>{var r=Os(e,t);if(r!=null)return eo(e,"yAxis",r,n)},z0e=q([N0e,md],yve),$0e=q([P0e,md],vve),H0e=q([un,yA,I0e,L0e,j0e,B0e,z0e,nt,Yoe,g6,$0e,md,T0e],(e,t,n,r,i,a,l,s,c,f,d,p,g)=>{var v=c.chartData,y=c.dataStartIndex,x=c.dataEndIndex;if(!(p==null||l==null||t==null||s!=="horizontal"&&s!=="vertical"||n==null||r==null||i==null||a==null||f==null)){var w=p.data,A;if(w!=null&&w.length>0?A=w:A=v?.slice(y,x+1),A!=null)return xbe({layout:s,barSettings:p,pos:l,parentViewBox:t,bandSize:f,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:d,displayedData:A,offset:e,cells:g,dataStartIndex:y})}}),U0e=["index"];function _w(){return _w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_w.apply(null,arguments)}function F0e(e,t){if(e==null)return{};var n,r,i=q0e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function q0e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var v6=O.createContext(void 0),W0e=e=>{var t=O.useContext(v6);if(t!=null)return t.stackId;if(e!=null)return kie(e)},V0e=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),K0e=e=>{var t=O.useContext(v6);if(t!=null){var n=t.stackId;return"url(#".concat(V0e(n,e),")")}},y6=e=>{var t=e.index,n=F0e(e,U0e),r=K0e(t);return O.createElement(Rr,_w({className:"recharts-bar-stack-layer",clipPath:r},n))},X0e=["onMouseEnter","onMouseLeave","onClick"],Q0e=["value","background","tooltipPosition"],Y0e=["id"],G0e=["onMouseEnter","onClick","onMouseLeave"];function EI(e,t){return tbe(e)||ebe(e,t)||J0e(e,t)||Z0e()}function Z0e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
122
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function J0e(e,t){if(e){if(typeof e=="string")return TI(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?TI(e,t):void 0}}function TI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ebe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function tbe(e){if(Array.isArray(e))return e}function no(){return no=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},no.apply(null,arguments)}function MI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Xt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MI(Object(n),!0).forEach(function(r){nbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nbe(e,t,n){return(t=rbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rbe(e){var t=ibe(e,"string");return typeof t=="symbol"?t:t+""}function ibe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yv(e,t){if(e==null)return{};var n,r,i=abe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function abe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var lbe=e=>{var t=e.dataKey,n=e.name,r=e.fill,i=e.legendType,a=e.hide;return[{inactive:a,dataKey:t,type:i,color:r,value:sy(n,t),payload:e}]},obe=O.memo(e=>{var t=e.dataKey,n=e.stroke,r=e.strokeWidth,i=e.fill,a=e.name,l=e.hide,s=e.unit,c=e.formatter,f=e.tooltipType,d=e.id,p={dataDefinedOnItem:void 0,getPosition:vs,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:sy(a,t),hide:l,type:f,color:i,unit:s,formatter:c,graphicalItemId:d}};return O.createElement(W8,{tooltipEntrySettings:p})});function sbe(e){var t=we(ps),n=e.data,r=e.dataKey,i=e.background,a=e.allOtherBarProps,l=a.onMouseEnter,s=a.onMouseLeave,c=a.onClick,f=yv(a,X0e),d=U8(l,r,a.id),p=F8(s),g=q8(c,r,a.id);if(!i||n==null)return null;var v=Yh(i);return O.createElement(ai,{zIndex:bve(i,sn.barBackground)},n.map((y,x)=>{y.value;var w=y.background;y.tooltipPosition;var A=yv(y,Q0e);if(!w)return null;var k=d(y,y.originalDataIndex),E=p(y,y.originalDataIndex),P=g(y,y.originalDataIndex),T=Xt(Xt(Xt(Xt(Xt({option:i,isActive:String(y.originalDataIndex)===t},A),{},{fill:"#eee"},w),v),Yv(f,y,x)),{},{onMouseEnter:k,onMouseLeave:E,onClick:P,dataKey:r,index:x,className:"recharts-bar-background-rectangle"});return O.createElement(Lk,no({key:"background-bar-".concat(x)},T))}))}function ube(e){var t=e.showLabels,n=e.children,r=e.rects,i=r?.map(a=>{var l={x:a.x,y:a.y,width:a.width,lowerWidth:a.width,upperWidth:a.width,height:a.height};return Xt(Xt({},l),{},{value:a.value,payload:a.payload,parentViewBox:a.parentViewBox,viewBox:l,fill:a.fill})});return O.createElement(_8,{value:t?i:void 0},n)}function cbe(e){var t=e.shape,n=e.activeBar,r=e.baseProps,i=e.entry,a=e.index,l=e.dataKey,s=we(ps),c=we(u8),f=n&&String(i.originalDataIndex)===s&&(c==null||l===c),d=O.useState(!1),p=EI(d,2),g=p[0],v=p[1],y=O.useState(!1),x=EI(y,2),w=x[0],A=x[1];O.useEffect(()=>{var R;return f?(v(!0),R=requestAnimationFrame(()=>{A(!0)})):A(!1),()=>{cancelAnimationFrame(R)}},[f]);var k=O.useCallback(()=>{f||v(!1)},[f]),E=f&&w,P=f||g,T;f?n===!0?T=t:T=n:T=t;var M=O.createElement(Lk,no({},r,{name:String(r.name)},i,{isActive:E,option:T,index:a,dataKey:l,animationElapsedTime:e.animationElapsedTime,isAnimating:e.isAnimating,isEntrance:e.isEntrance,onTransitionEnd:k}));return P?O.createElement(ai,{zIndex:sn.activeBar},O.createElement(y6,{index:i.originalDataIndex},M)):M}function fbe(e){var t=e.shape,n=e.baseProps,r=e.entry,i=e.index,a=e.dataKey;return O.createElement(Lk,no({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a,animationElapsedTime:e.animationElapsedTime,isAnimating:e.isAnimating,isEntrance:e.isEntrance}))}function hbe(e){var t,n=e.data,r=e.props,i=e.animationElapsedTime,a=e.isAnimating,l=e.isEntrance,s=(t=yi(r))!==null&&t!==void 0?t:{},c=s.id,f=yv(s,Y0e),d=r.shape,p=r.dataKey,g=r.activeBar,v=r.onMouseEnter,y=r.onClick,x=r.onMouseLeave,w=yv(r,G0e),A=U8(v,p,c),k=F8(x),E=q8(y,p,c);return n?O.createElement(O.Fragment,null,n.map((P,T)=>O.createElement(y6,no({index:P.originalDataIndex,key:"rectangle-".concat(P?.x,"-").concat(P?.y,"-").concat(P?.value,"-").concat(T),className:"recharts-bar-rectangle"},Yv(w,P,T),{onMouseEnter:A(P,P.originalDataIndex),onMouseLeave:k(P,P.originalDataIndex),onClick:E(P,P.originalDataIndex)}),g?O.createElement(cbe,{shape:d,activeBar:g,baseProps:f,entry:P,index:T,dataKey:p,animationElapsedTime:i,isAnimating:a,isEntrance:l}):O.createElement(fbe,{shape:d,baseProps:f,entry:P,index:T,dataKey:p,animationElapsedTime:i,isAnimating:a,isEntrance:l})))):null}var dbe=(e,t,n)=>e==null?[]:t===1?e.flatMap(r=>r.status==="removed"?[]:[r.next]):e.flatMap(r=>{if(r.status==="removed")return n==="horizontal"?[Xt(Xt({},r.prev),{},{height:Ft(r.prev.height,0,t),y:Ft(r.prev.y,r.prev.y+r.prev.height,t)})]:[Xt(Xt({},r.prev),{},{width:Ft(r.prev.width,0,t)})];if(r.status==="matched")return[Xt(Xt({},r.next),{},{x:Ft(r.prev.x,r.next.x,t),y:Ft(r.prev.y,r.next.y,t),width:Ft(r.prev.width,r.next.width,t),height:Ft(r.prev.height,r.next.height,t)})];var i=r.next;return n==="horizontal"?[Xt(Xt({},i),{},{height:Ft(0,i.height,t),y:Ft(i.stackedBarStart,i.y,t)})]:[Xt(Xt({},i),{},{width:Ft(0,i.width,t),x:Ft(i.stackedBarStart,i.x,t)})]});function pbe(e){var t=e.props,n=e.previousRectanglesRef,r=t.data,i=t.isAnimationActive,a=t.animationBegin,l=t.animationDuration,s=t.animationEasing,c=t.animationInterpolateFn,f=t.layout,d=X8(t.onAnimationStart,t.onAnimationEnd),p=d.isAnimating,g=d.handleAnimationStart,v=d.handleAnimationEnd;return O.createElement(ube,{showLabels:!p,rects:r},O.createElement(Q8,{animationInput:r,animationIdPrefix:"recharts-bar-",items:r,previousItemsRef:n,isAnimationActive:i,animationBegin:a,animationDuration:l,animationEasing:s,onAnimationStart:g,onAnimationEnd:v,animationInterpolateFn:c,animationMatchBy:t.animationMatchBy,layout:f},(y,x,w)=>O.createElement(Rr,null,O.createElement(hbe,{props:t,data:y,animationElapsedTime:x,isAnimating:p||x<1,isEntrance:w}))),O.createElement(I8,{label:t.label}),t.children)}function mbe(e){var t=O.useRef(null);return O.createElement(pbe,{previousRectanglesRef:t,props:e})}var b6=0,gbe=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:Bt(e,t)}};class vbe extends O.PureComponent{render(){var t=this.props,n=t.hide,r=t.data,i=t.dataKey,a=t.className,l=t.xAxisId,s=t.yAxisId,c=t.needClip,f=t.background,d=t.id;if(n||r==null)return null;var p=st("recharts-bar",a),g=d;return O.createElement(Rr,{className:p,id:d},c&&O.createElement("defs",null,O.createElement(c6,{clipPathId:g,xAxisId:l,yAxisId:s})),O.createElement(Rr,{className:"recharts-bar-rectangles",clipPath:c?"url(#clipPath-".concat(g,")"):void 0},O.createElement(sbe,{data:r,dataKey:i,background:f,allOtherBarProps:this.props}),O.createElement(mbe,this.props)))}}var ybe={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",animationInterpolateFn:dbe,animationMatchBy:K8,background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:b6,shape:Ik,xAxisId:0,yAxisId:0,zIndex:sn.bar};function bbe(e){var t=e.xAxisId,n=e.yAxisId,r=e.hide,i=e.legendType,a=e.minPointSize,l=e.activeBar,s=e.animationBegin,c=e.animationDuration,f=e.animationEasing,d=e.isAnimationActive,p=Rk(t,n),g=p.needClip,v=ys(),y=jn(),x=Vme(e.children,x8),w=we(E=>H0e(E,e.id,y,x));if(v!=="vertical"&&v!=="horizontal")return null;var A,k=w?.[0];return k==null||k.height==null||k.width==null?A=0:A=v==="vertical"?k.height/2:k.width/2,O.createElement(u6,{xAxisId:t,yAxisId:n,data:w,dataPointFormatter:gbe,errorBarOffset:A},O.createElement(vbe,no({},e,{layout:v,needClip:g,data:w,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:l,animationBegin:s,animationDuration:c,animationEasing:f,isAnimationActive:d})))}function xbe(e){var t=e.layout,n=e.barSettings,r=n.dataKey,i=n.minPointSize,a=n.hasCustomShape,l=e.pos,s=e.bandSize,c=e.xAxis,f=e.yAxis,d=e.xAxisTicks,p=e.yAxisTicks,g=e.stackedData,v=e.displayedData,y=e.offset,x=e.cells,w=e.parentViewBox,A=e.dataStartIndex,k=t==="horizontal"?f:c,E=g?k.scale.domain():null,P=Cie({numericAxis:k}),T=k.scale.map(P);return v.map((M,R)=>{var L,H,K,V,B,ae;if(g){var ie=g[R+A];if(ie==null)return null;L=xie(ie,E)}else L=Bt(M,r),Array.isArray(L)||(L=[P,L]);var oe=A0e(i,b6)(L[1],R);if(t==="horizontal"){var z,G=f.scale.map(L[0]),ne=f.scale.map(L[1]);if(G==null||ne==null)return null;H=gR({axis:c,ticks:d,bandSize:s,offset:l.offset,entry:M,index:R}),K=(z=ne??G)!==null&&z!==void 0?z:void 0,V=l.size;var ce=G-ne;if(B=Gi(ce)?0:ce,ae={x:H,y:y.top,width:V,height:y.height},Math.abs(oe)>0&&Math.abs(B)<Math.abs(oe)){var fe=or(B||oe)*(Math.abs(oe)-Math.abs(B));K-=fe,B+=fe}}else{var N=c.scale.map(L[0]),X=c.scale.map(L[1]);if(N==null||X==null)return null;if(H=N,K=gR({axis:f,ticks:p,bandSize:s,offset:l.offset,entry:M,index:R}),V=X-N,B=l.size,ae={x:y.left,y:K,width:y.width,height:B},Math.abs(oe)>0&&Math.abs(V)<Math.abs(oe)){var re=or(V||oe)*(Math.abs(oe)-Math.abs(V));V+=re}}if(H==null||K==null||V==null||B==null||!a&&(V===0||B===0))return null;var le=Xt(Xt({},M),{},{stackedBarStart:T,x:H,y:K,width:V,height:B,value:g?L:L[1],payload:M,background:ae,tooltipPosition:{x:H+V/2,y:K+B/2},parentViewBox:w,originalDataIndex:R},x&&x[R]&&x[R].props);return le}).filter(Boolean)}function Sbe(e){var t=In(e,ybe),n=W0e(t.stackId),r=jn();return O.createElement(Y8,{id:t.id,type:"bar"},i=>O.createElement(O.Fragment,null,O.createElement(V8,{legendPayload:lbe(t)}),O.createElement(obe,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,formatter:t.formatter,tooltipType:t.tooltipType,id:i}),O.createElement(Z8,{type:"bar",id:i,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:n,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:r,hasCustomShape:t.shape!=null&&t.shape!==Ik}),O.createElement(ai,{zIndex:t.zIndex},O.createElement(bbe,no({},t,{id:i})))))}var x6=O.memo(Sbe,dc);x6.displayName="Bar";var wbe=["domain","range"],Obe=["domain","range"];function PI(e,t){if(e==null)return{};var n,r,i=Abe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Abe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function DI(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function S6(e,t){if(e===t)return!0;var n=e.domain,r=e.range,i=PI(e,wbe),a=t.domain,l=t.range,s=PI(t,Obe);return!DI(n,a)||!DI(r,l)?!1:dc(i,s)}var kbe=["type"],Cbe=["dangerouslySetInnerHTML","ticks","scale"],Ebe=["id","scale"];function Nw(){return Nw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nw.apply(null,arguments)}function RI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _I(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RI(Object(n),!0).forEach(function(r){Tbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tbe(e,t,n){return(t=Mbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mbe(e){var t=Pbe(e,"string");return typeof t=="symbol"?t:t+""}function Pbe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Iw(e,t){if(e==null)return{};var n,r,i=Dbe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Dbe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Rbe(e){var t=St(),n=O.useRef(null),r=B5(),i=e.type,a=Iw(e,kbe),l=gy(r,"xAxis",i),s=O.useMemo(()=>{if(l!=null)return _I(_I({},a),{},{type:l})},[a,l]);return O.useLayoutEffect(()=>{s!=null&&(n.current===null?t(qge(s)):n.current!==s&&t(Wge({prev:n.current,next:s})),n.current=s)},[s,t]),O.useLayoutEffect(()=>()=>{n.current&&(t(Vge(n.current)),n.current=null)},[t]),null}var _be=e=>{var t=e.xAxisId,n=e.className,r=we(yA),i=jn(),a="xAxis",l=we(g=>H4(g,a,t,i)),s=we(g=>B4(g,t)),c=we(g=>Zfe(g,t)),f=we(g=>i4(g,t));if(s==null||c==null||f==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var d=Iw(e,Cbe);f.id,f.scale;var p=Iw(f,Ebe);return O.createElement(Pk,Nw({},d,p,{x:c.x,y:c.y,width:s.width,height:s.height,className:st("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:l,axisType:a,axisId:t}))},Nbe={allowDataOverflow:Vt.allowDataOverflow,allowDecimals:Vt.allowDecimals,allowDuplicatedCategory:Vt.allowDuplicatedCategory,angle:Vt.angle,axisLine:ja.axisLine,height:Vt.height,hide:!1,includeHidden:Vt.includeHidden,interval:Vt.interval,label:!1,minTickGap:Vt.minTickGap,mirror:Vt.mirror,orientation:Vt.orientation,padding:Vt.padding,reversed:Vt.reversed,scale:Vt.scale,tick:Vt.tick,tickCount:Vt.tickCount,tickLine:ja.tickLine,tickSize:ja.tickSize,type:Vt.type,niceTicks:Vt.niceTicks,xAxisId:0},Ibe=e=>{var t=In(e,Nbe);return O.createElement(O.Fragment,null,O.createElement(Rbe,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),O.createElement(_be,t))},Lw=O.memo(Ibe,S6);Lw.displayName="XAxis";var Lbe=["type"],jbe=["dangerouslySetInnerHTML","ticks","scale"],Bbe=["id","scale"];function jw(){return jw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jw.apply(null,arguments)}function NI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function II(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NI(Object(n),!0).forEach(function(r){zbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zbe(e,t,n){return(t=$be(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $be(e){var t=Hbe(e,"string");return typeof t=="symbol"?t:t+""}function Hbe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Bw(e,t){if(e==null)return{};var n,r,i=Ube(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ube(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Fbe(e){var t=St(),n=O.useRef(null),r=B5(),i=e.type,a=Bw(e,Lbe),l=gy(r,"yAxis",i),s=O.useMemo(()=>{if(l!=null)return II(II({},a),{},{type:l})},[l,a]);return O.useLayoutEffect(()=>{s!=null&&(n.current===null?t(Kge(s)):n.current!==s&&t(Xge({prev:n.current,next:s})),n.current=s)},[s,t]),O.useLayoutEffect(()=>()=>{n.current&&(t(Qge(n.current)),n.current=null)},[t]),null}function qbe(e){var t=e.yAxisId,n=e.className,r=e.width,i=e.label,a=O.useRef(null),l=O.useRef(null),s=we(yA),c=jn(),f=St(),d="yAxis",p=we(A=>z4(A,t)),g=we(A=>ehe(A,t)),v=we(A=>H4(A,d,t,c)),y=we(A=>a4(A,t));if(O.useLayoutEffect(()=>{if(!(r!=="auto"||!p||kk(i)||O.isValidElement(i)||y==null)){var A=a.current;if(A){var k=A.getCalculatedWidth();Math.round(p.width)!==Math.round(k)&&f(Yge({id:t,width:k}))}}},[v,p,f,i,t,r,y]),p==null||g==null||y==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var x=Bw(e,jbe);y.id,y.scale;var w=Bw(y,Bbe);return O.createElement(Pk,jw({},x,w,{ref:a,labelRef:l,x:g.x,y:g.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:p.width,height:p.height,className:st("recharts-".concat(d," ").concat(d),n),viewBox:s,ticks:v,axisType:d,axisId:t}))}var Wbe={allowDataOverflow:Kt.allowDataOverflow,allowDecimals:Kt.allowDecimals,allowDuplicatedCategory:Kt.allowDuplicatedCategory,angle:Kt.angle,axisLine:ja.axisLine,hide:!1,includeHidden:Kt.includeHidden,interval:Kt.interval,label:!1,minTickGap:Kt.minTickGap,mirror:Kt.mirror,orientation:Kt.orientation,padding:Kt.padding,reversed:Kt.reversed,scale:Kt.scale,tick:Kt.tick,tickCount:Kt.tickCount,tickLine:ja.tickLine,tickSize:ja.tickSize,type:Kt.type,niceTicks:Kt.niceTicks,width:Kt.width,yAxisId:0},Vbe=e=>{var t=In(e,Wbe);return O.createElement(O.Fragment,null,O.createElement(Fbe,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),O.createElement(qbe,t))},zw=O.memo(Vbe,S6);zw.displayName="YAxis";var Kbe=(e,t)=>t,jk=q([Kbe,nt,b$,fn,a8,nl,Ode,un],Pde);function Xbe(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function Bk(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(Xbe(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var l=(s,c)=>({relativeX:Math.round((s-t.left)/n),relativeY:Math.round((c-t.top)/r)});return"touches"in e?Array.from(e.touches).map(s=>l(s.clientX,s.clientY)):l(e.clientX,e.clientY)}var w6=_r("mouseClick"),O6=Jh();O6.startListening({actionCreator:w6,effect:(e,t)=>{var n=e.payload,r=jk(t.getState(),Bk(n));r?.activeIndex!=null&&t.dispatch(ghe({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var $w=_r("mouseMove"),A6=Jh(),du=null,Mo=null,A1=null;A6.startListening({actionCreator:$w,effect:(e,t)=>{var n=e.payload,r=t.getState(),i=r.eventSettings,a=i.throttleDelay,l=i.throttledEvents,s=l==="all"||l?.includes("mousemove");du!==null&&(cancelAnimationFrame(du),du=null),Mo!==null&&(typeof a!="number"||!s)&&(clearTimeout(Mo),Mo=null),A1=Bk(n);var c=()=>{var f=t.getState(),d=dd(f,f.tooltip.settings.shared);if(!A1){du=null,Mo=null;return}if(d==="axis"){var p=jk(f,A1);p?.activeIndex!=null?t.dispatch(Q4({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate})):t.dispatch(X4())}du=null,Mo=null};if(!s){c();return}a==="raf"?du=requestAnimationFrame(c):typeof a=="number"&&Mo===null&&(Mo=setTimeout(c,a))}});function Qbe(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<<CHILDREN>>":t}var LI={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},k6=Ln({name:"rootProps",initialState:LI,reducers:{updateOptions:(e,t)=>{var n;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(n=t.payload.barGap)!==null&&n!==void 0?n:LI.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),Ybe=k6.reducer,Gbe=k6.actions.updateOptions,Zbe=null,Jbe={updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)},C6=Ln({name:"polarOptions",initialState:Zbe,reducers:Jbe});C6.actions.updatePolarOptions;var exe=C6.reducer,E6=_r("keyDown"),T6=_r("focus"),M6=_r("blur"),_y=Jh(),pu=null,Po=null,Am=null;_y.startListening({actionCreator:E6,effect:(e,t)=>{Am=e.payload,pu!==null&&(cancelAnimationFrame(pu),pu=null);var n=t.getState(),r=n.eventSettings,i=r.throttleDelay,a=r.throttledEvents,l=a==="all"||a.includes("keydown");Po!==null&&(typeof i!="number"||!l)&&(clearTimeout(Po),Po=null);var s=()=>{try{var c=t.getState(),f=c.rootProps.accessibilityLayer!==!1;if(!f)return;var d=c.tooltip.keyboardInteraction,p=Am;if(p!=="ArrowRight"&&p!=="ArrowLeft"&&p!=="Enter")return;var g=eh(d,ds(c),rc(c),ic(c)),v=g==null?-1:Number(g),y=!Number.isFinite(v)||v<0,x=nl(c),w=ds(c),A=dd(c,c.tooltip.settings.shared);if(p==="Enter"){if(y)return;var k=hv(c,A,"hover",String(d.index));t.dispatch(fv({active:!d.active,activeIndex:d.index,activeCoordinate:k}));return}var E=ahe(c),P=E==="left-to-right"?1:-1,T=p==="ArrowRight"?1:-1,M;if(y){var R=rc(c),L=ic(c),H=T*P,K=oe=>({active:!1,index:String(oe),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(M=-1,H>0){for(var V=0;V<w.length;V++)if(eh(K(V),w,R,L)!=null){M=V;break}}else for(var B=w.length-1;B>=0;B--)if(eh(K(B),w,R,L)!=null){M=B;break}if(M<0)return}else{M=v+T*P;var ae=x?.length||w.length;if(ae===0||M>=ae||M<0)return}var ie=hv(c,A,"hover",String(M));t.dispatch(fv({active:!0,activeIndex:M.toString(),activeCoordinate:ie}))}finally{pu=null,Po=null}};if(!l){s();return}i==="raf"?pu=requestAnimationFrame(s):typeof i=="number"&&Po===null&&(s(),Am=null,Po=setTimeout(()=>{Am?s():(Po=null,pu=null)},i))}});_y.startListening({actionCreator:T6,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var i=n.tooltip.keyboardInteraction;if(!i.active&&i.index==null){var a="0",l=dd(n,n.tooltip.settings.shared),s=hv(n,l,"hover",String(a));t.dispatch(fv({active:!0,activeIndex:a,activeCoordinate:s}))}}}});_y.startListening({actionCreator:M6,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var i=n.tooltip.keyboardInteraction;i.active&&t.dispatch(fv({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function P6(e){e.persist();var t=e.currentTarget;return new Proxy(e,{get:(n,r)=>{if(r==="currentTarget")return t;var i=Reflect.get(n,r);return typeof i=="function"?i.bind(n):i}})}var Vr=_r("externalEvent"),D6=Jh(),km=new Map,_f=new Map,k1=new Map;D6.startListening({actionCreator:Vr,effect:(e,t)=>{var n=e.payload,r=n.handler,i=n.reactEvent;if(r!=null){var a=i.type,l=P6(i);k1.set(a,{handler:r,reactEvent:l});var s=km.get(a);s!==void 0&&(cancelAnimationFrame(s),km.delete(a));var c=t.getState(),f=c.eventSettings,d=f.throttleDelay,p=f.throttledEvents,g=p,v=g==="all"||g?.includes(a),y=_f.get(a);y!==void 0&&(typeof d!="number"||!v)&&(clearTimeout(y),_f.delete(a));var x=()=>{var k=k1.get(a);try{if(!k)return;var E=k.handler,P=k.reactEvent,T=t.getState(),M={activeCoordinate:ode(T),activeDataKey:u8(T),activeIndex:ps(T),activeLabel:s8(T),activeTooltipIndex:ps(T),isTooltipActive:sde(T)};E&&E(M,P)}finally{km.delete(a),_f.delete(a),k1.delete(a)}};if(!v){x();return}if(d==="raf"){var w=requestAnimationFrame(x);km.set(a,w)}else if(typeof d=="number"){if(!_f.has(a)){x();var A=setTimeout(x,d);_f.set(a,A)}}else x()}}});var txe=q([Sc],e=>e.tooltipItemPayloads),nxe=q([txe,(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(a=>a.settings.graphicalItemId===n);if(r!=null){var i=r.getPosition;if(i!=null)return i(t)}}}),R6=_r("touchMove"),_6=Jh(),Do=null,Tl=null,jI=null,Nf=null;_6.startListening({actionCreator:R6,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){Nf=P6(n);var r=t.getState(),i=r.eventSettings,a=i.throttleDelay,l=i.throttledEvents,s=l==="all"||l.includes("touchmove");Do!==null&&(cancelAnimationFrame(Do),Do=null),Tl!==null&&(typeof a!="number"||!s)&&(clearTimeout(Tl),Tl=null),jI=Array.from(n.touches).map(f=>Bk({clientX:f.clientX,clientY:f.clientY,currentTarget:n.currentTarget}));var c=()=>{if(Nf!=null){var f=t.getState(),d=dd(f,f.tooltip.settings.shared);if(d==="axis"){var p,g=(p=jI)===null||p===void 0?void 0:p[0];if(g==null){Do=null,Tl=null;return}var v=jk(f,g);v?.activeIndex!=null&&t.dispatch(Q4({activeIndex:v.activeIndex,activeDataKey:void 0,activeCoordinate:v.activeCoordinate}))}else if(d==="item"){var y,x=Nf.touches[0];if(document.elementFromPoint==null||x==null)return;var w=document.elementFromPoint(x.clientX,x.clientY);if(!w||!w.getAttribute)return;var A=w.getAttribute(_ie),k=(y=w.getAttribute(Nie))!==null&&y!==void 0?y:void 0,E=Ss(f).find(M=>M.id===k);if(A==null||E==null||k==null)return;var P=E.dataKey,T=nxe(f,A,k);t.dispatch(K4({activeDataKey:P,activeIndex:A,activeCoordinate:T,activeGraphicalItemId:k}))}Do=null,Tl=null}};if(!s){c();return}a==="raf"?Do=requestAnimationFrame(c):typeof a=="number"&&Tl===null&&(c(),Nf=null,Tl=setTimeout(()=>{Nf?c():(Tl=null,Do=null)},a))}}});var N6={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},I6=Ln({name:"eventSettings",initialState:N6,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=Ye(t.payload.throttledEvents))}}}),rxe=I6.actions.setEventSettings,ixe=I6.reducer,axe=n5({brush:Sve,cartesianAxis:Gge,chartData:lpe,errorBars:zye,eventSettings:ixe,graphicalItems:Mge,layout:mie,legend:Sae,options:tpe,polarAxis:Hme,polarOptions:exe,referenceElements:kve,renderedTicks:Kve,rootProps:Ybe,tooltip:vhe,zIndex:Fde}),lxe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return $re({reducer:axe,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([O6.middleware,A6.middleware,_y.middleware,D6.middleware,_6.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(v5({type:"raf"}))},devTools:{serialize:{replacer:Qbe},name:"recharts-".concat(n)}})};function oxe(e){var t=e.preloadedState,n=e.children,r=e.reduxStoreName,i=jn(),a=O.useRef(null);if(i)return n;a.current==null&&(a.current=lxe(t,r));var l=fA;return O.createElement(zae,{context:l,store:a.current},n)}function sxe(e){var t=e.layout,n=e.margin,r=St(),i=jn();return O.useEffect(()=>{i||(r(hie(t)),r(fie(n)))},[r,i,t,n]),null}var uxe=O.memo(sxe,dc);function cxe(e){var t=St();return O.useEffect(()=>{t(Gbe(e))},[t,e]),null}var fxe=e=>{var t=St();return O.useEffect(()=>{t(rxe(e))},[t,e]),null},hxe=O.memo(fxe,dc);function BI(e){var t=e.zIndex,n=e.isPanorama,r=O.useRef(null),i=St();return O.useLayoutEffect(()=>(r.current&&i(Hde({zIndex:t,element:r.current,isPanorama:n})),()=>{i(Ude({zIndex:t,isPanorama:n}))}),[i,t,n]),O.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function zI(e){var t=e.children,n=e.isPanorama,r=we(Rde);if(!r||r.length===0)return t;var i=r.filter(l=>l<0),a=r.filter(l=>l>0);return O.createElement(O.Fragment,null,i.map(l=>O.createElement(BI,{key:l,zIndex:l,isPanorama:n})),t,a.map(l=>O.createElement(BI,{key:l,zIndex:l,isPanorama:n})))}var dxe=["children"];function pxe(e,t){if(e==null)return{};var n,r,i=mxe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function mxe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function bv(){return bv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bv.apply(null,arguments)}var gxe={width:"100%",height:"100%",display:"block"},vxe=O.forwardRef((e,t)=>{var n=SA(),r=wA(),i=F5();if(!Ji(n)||!Ji(r))return null;var a=e.children,l=e.otherAttributes,s=e.title,c=e.desc,f,d;return l!=null&&(typeof l.tabIndex=="number"?f=l.tabIndex:f=i?0:void 0,typeof l.role=="string"?d=l.role:d=i?"application":void 0),O.createElement(rA,bv({},l,{title:s,desc:c,role:d,tabIndex:f,width:n,height:r,style:gxe,ref:t}),a)}),yxe=e=>{var t=e.children,n=we(hy);if(!n)return null;var r=n.width,i=n.height,a=n.y,l=n.x;return O.createElement(rA,{width:r,height:i,x:l,y:a},t)},$I=O.forwardRef((e,t)=>{var n=e.children,r=pxe(e,dxe),i=jn();return i?O.createElement(yxe,null,O.createElement(zI,{isPanorama:!0},n)):O.createElement(vxe,bv({ref:t},r),O.createElement(zI,{isPanorama:!1},n))});function bxe(e,t){return Oxe(e)||wxe(e,t)||Sxe(e,t)||xxe()}function xxe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
123
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sxe(e,t){if(e){if(typeof e=="string")return HI(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?HI(e,t):void 0}}function HI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function wxe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function Oxe(e){if(Array.isArray(e))return e}function Axe(){var e=St(),t=O.useState(null),n=bxe(t,2),r=n[0],i=n[1],a=we(Rie);return O.useEffect(()=>{if(r!=null){var l=r.getBoundingClientRect(),s=l.width/r.offsetWidth;Ve(s)&&s!==a&&e(pie(s))}},[r,e,a]),i}function UI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function kxe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?UI(Object(n),!0).forEach(function(r){Cxe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cxe(e,t,n){return(t=Exe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Exe(e){var t=Txe(e,"string");return typeof t=="symbol"?t:t+""}function Txe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vl(){return Vl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vl.apply(null,arguments)}function xv(e,t){return Rxe(e)||Dxe(e,t)||Pxe(e,t)||Mxe()}function Mxe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
124
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pxe(e,t){if(e){if(typeof e=="string")return FI(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?FI(e,t):void 0}}function FI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Dxe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,l,s=[],c=!0,f=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(d){f=!0,i=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(f)throw i}}return s}}function Rxe(e){if(Array.isArray(e))return e}var _xe=()=>(mpe(),null);function Sv(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var Nxe=O.forwardRef((e,t)=>{var n,r,i=O.useRef(null),a=O.useState({containerWidth:Sv((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:Sv((r=e.style)===null||r===void 0?void 0:r.height)}),l=xv(a,2),s=l[0],c=l[1],f=O.useCallback((p,g)=>{c(v=>{var y=Math.round(p),x=Math.round(g);return v.containerWidth===y&&v.containerHeight===x?v:{containerWidth:y,containerHeight:x}})},[]),d=O.useCallback(p=>{if(typeof t=="function"&&t(p),i.current!=null&&(i.current.disconnect(),i.current=null),p!=null&&typeof ResizeObserver<"u"){var g=p.getBoundingClientRect(),v=g.width,y=g.height;f(v,y);var x=A=>{var k=A[0];if(k!=null){var E=k.contentRect,P=E.width,T=E.height;f(P,T)}},w=new ResizeObserver(x);w.observe(p),i.current=w}},[t,f]);return O.useEffect(()=>()=>{var p=i.current;p?.disconnect()},[f]),O.createElement(O.Fragment,null,O.createElement(td,{width:s.containerWidth,height:s.containerHeight}),O.createElement("div",Vl({ref:d},e)))}),Ixe=O.forwardRef((e,t)=>{var n=e.width,r=e.height,i=O.useState({containerWidth:Sv(n),containerHeight:Sv(r)}),a=xv(i,2),l=a[0],s=a[1],c=O.useCallback((d,p)=>{s(g=>{var v=Math.round(d),y=Math.round(p);return g.containerWidth===v&&g.containerHeight===y?g:{containerWidth:v,containerHeight:y}})},[]),f=O.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null){var p=d.getBoundingClientRect(),g=p.width,v=p.height;c(g,v)}},[t,c]);return O.createElement(O.Fragment,null,O.createElement(td,{width:l.containerWidth,height:l.containerHeight}),O.createElement("div",Vl({ref:f},e)))}),Lxe=O.forwardRef((e,t)=>{var n=e.width,r=e.height;return O.createElement(O.Fragment,null,O.createElement(td,{width:n,height:r}),O.createElement("div",Vl({ref:t},e)))}),jxe=O.forwardRef((e,t)=>{var n=e.width,r=e.height;return typeof n=="string"||typeof r=="string"?O.createElement(Ixe,Vl({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?O.createElement(Lxe,Vl({},e,{width:n,height:r,ref:t})):O.createElement(O.Fragment,null,O.createElement(td,{width:n,height:r}),O.createElement("div",Vl({ref:t},e)))});function Bxe(e){return e?Nxe:jxe}var zxe=O.forwardRef((e,t)=>{var n=e.children,r=e.className,i=e.height,a=e.onClick,l=e.onContextMenu,s=e.onDoubleClick,c=e.onMouseDown,f=e.onMouseEnter,d=e.onMouseLeave,p=e.onMouseMove,g=e.onMouseUp,v=e.onTouchEnd,y=e.onTouchMove,x=e.onTouchStart,w=e.style,A=e.width,k=e.responsive,E=e.dispatchTouchEvents,P=E===void 0?!0:E,T=O.useRef(null),M=St(),R=O.useState(null),L=xv(R,2),H=L[0],K=L[1],V=O.useState(null),B=xv(V,2),ae=B[0],ie=B[1],oe=Axe(),z=bA(),G=z?.width>0?z.width:A,ne=z?.height>0?z.height:i,ce=O.useCallback(xe=>{oe(xe),typeof t=="function"&&t(xe),K(xe),ie(xe),xe!=null&&(T.current=xe)},[oe,t,K,ie]),fe=O.useCallback(xe=>{M(w6(xe)),M(Vr({handler:a,reactEvent:xe}))},[M,a]),N=O.useCallback(xe=>{M($w(xe)),M(Vr({handler:f,reactEvent:xe}))},[M,f]),X=O.useCallback(xe=>{M(X4()),M(Vr({handler:d,reactEvent:xe}))},[M,d]),re=O.useCallback(xe=>{M($w(xe)),M(Vr({handler:p,reactEvent:xe}))},[M,p]),le=O.useCallback(()=>{M(T6())},[M]),ge=O.useCallback(()=>{M(M6())},[M]),Oe=O.useCallback(xe=>{M(E6(xe.key))},[M]),Pe=O.useCallback(xe=>{M(Vr({handler:l,reactEvent:xe}))},[M,l]),mt=O.useCallback(xe=>{M(Vr({handler:s,reactEvent:xe}))},[M,s]),se=O.useCallback(xe=>{M(Vr({handler:c,reactEvent:xe}))},[M,c]),Te=O.useCallback(xe=>{M(Vr({handler:g,reactEvent:xe}))},[M,g]),Ee=O.useCallback(xe=>{M(Vr({handler:x,reactEvent:xe}))},[M,x]),ue=O.useCallback(xe=>{P&&M(R6(xe)),M(Vr({handler:y,reactEvent:xe}))},[M,P,y]),_t=O.useCallback(xe=>{M(Vr({handler:v,reactEvent:xe}))},[M,v]),_e=Bxe(k);return O.createElement(g8.Provider,{value:H},O.createElement(dz.Provider,{value:ae},O.createElement(_e,{width:G??w?.width,height:ne??w?.height,className:st("recharts-wrapper",r),style:kxe({position:"relative",cursor:"default",width:G,height:ne},w),onClick:fe,onContextMenu:Pe,onDoubleClick:mt,onFocus:le,onBlur:ge,onKeyDown:Oe,onMouseDown:se,onMouseEnter:N,onMouseLeave:X,onMouseMove:re,onMouseUp:Te,onTouchEnd:_t,onTouchMove:ue,onTouchStart:Ee,ref:ce},O.createElement(_xe,null),n)))}),$xe=["width","height","responsive","children","className","style","compact","title","desc"];function Hxe(e,t){if(e==null)return{};var n,r,i=Uxe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Uxe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Fxe=O.forwardRef((e,t)=>{var n=e.width,r=e.height,i=e.responsive,a=e.children,l=e.className,s=e.style,c=e.compact,f=e.title,d=e.desc,p=Hxe(e,$xe),g=yi(p);return c?O.createElement(O.Fragment,null,O.createElement(td,{width:n,height:r}),O.createElement($I,{otherAttributes:g,title:f,desc:d},a)):O.createElement(zxe,{className:l,style:s,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},O.createElement($I,{otherAttributes:g,title:f,desc:d,ref:t},O.createElement(Rve,null,a)))});function Hw(){return Hw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hw.apply(null,arguments)}function qI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function qxe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qI(Object(n),!0).forEach(function(r){Wxe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wxe(e,t,n){return(t=Vxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vxe(e){var t=Kxe(e,"string");return typeof t=="symbol"?t:t+""}function Kxe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Xxe={top:5,right:5,bottom:5,left:5},Qxe=qxe({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:Xxe,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},N6),L6=O.forwardRef(function(t,n){var r,i=In(t.categoricalChartProps,Qxe),a=t.chartName,l=t.defaultTooltipEventType,s=t.validateTooltipEventTypes,c=t.tooltipPayloadSearcher,f=t.categoricalChartProps,d={chartName:a,defaultTooltipEventType:l,validateTooltipEventTypes:s,tooltipPayloadSearcher:c,eventEmitter:void 0};return O.createElement(oxe,{preloadedState:{options:d},reduxStoreName:(r=f.id)!==null&&r!==void 0?r:a},O.createElement(xve,{chartData:f.data}),O.createElement(uxe,{layout:i.layout,margin:i.margin}),O.createElement(hxe,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),O.createElement(cxe,{baseValue:i.baseValue,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),O.createElement(Fxe,Hw({},i,{ref:n})))}),Yxe=["axis"],Gxe=O.forwardRef((e,t)=>O.createElement(L6,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Yxe,tooltipPayloadSearcher:v8,categoricalChartProps:e,ref:t})),Zxe=["axis","item"],Jxe=O.forwardRef((e,t)=>O.createElement(L6,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Zxe,tooltipPayloadSearcher:v8,categoricalChartProps:e,ref:t}));const e1e={succeeded:"var(--status-good)",failed:"var(--status-critical)",skipped:"var(--status-warning)",canceled:"var(--text-muted)"},WI=["succeeded","failed","skipped","canceled"];function Cm({label:e,value:t,sub:n}){return _.jsxs("div",{className:"rounded-lg border border-edge bg-surface px-4 py-3",children:[_.jsx("p",{className:"text-xs uppercase tracking-wide text-ink-muted",children:e}),_.jsx("p",{className:"mt-1 text-2xl font-semibold",children:t}),n&&_.jsx("p",{className:"mt-0.5 text-xs text-ink-muted",children:n})]})}function VI({active:e,payload:t,label:n,unit:r}){return!e||!t?.length?null:_.jsxs("div",{className:"rounded-md border border-edge bg-surface px-3 py-2 text-xs shadow-sm",children:[_.jsx("p",{className:"mb-1 font-medium text-ink-secondary",children:n}),t.map(i=>_.jsxs("p",{className:"flex items-center gap-2 text-ink-secondary",children:[_.jsx("span",{className:"inline-block h-2 w-2 rounded-full",style:{background:i.color}}),i.name,": ",_.jsx("span",{className:"font-medium text-ink",children:r==="s"?lh(i.value):i.value})]},i.dataKey))]})}function t1e({stats:e}){const t=O.useMemo(()=>{const l=new Map;for(const s of e.daily){const c=l.get(s.day)??{day:s.day.slice(5)};c[s.status]=s.count,l.set(s.day,c)}return[...l.values()]},[e.daily]),n=O.useMemo(()=>e.recentDurations.map(l=>({id:`#${l.id}`,duration:Math.round(l.duration_s*10)/10})),[e.recentDurations]),r=e.totals.total>0?Math.round(e.totals.succeeded/Math.max(e.totals.total-e.totals.skipped,1)*100):null,i=e.recentDurations.length>0?e.recentDurations.reduce((l,s)=>l+s.duration_s,0)/e.recentDurations.length:null,a={fill:"var(--text-muted)",fontSize:11};return _.jsxs("div",{className:"space-y-6",children:[_.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[_.jsx(Cm,{label:"Runs",value:String(e.totals.total)}),_.jsx(Cm,{label:"Success rate",value:r===null?"—":`${r}%`,sub:e.totals.failed>0?`${e.totals.failed} failed`:void 0}),_.jsx(Cm,{label:"Skipped",value:String(e.totals.skipped),sub:"overlapping schedule"}),_.jsx(Cm,{label:"Avg duration",value:i===null?"—":lh(i),sub:"last 50 runs"})]}),_.jsxs("div",{className:"rounded-lg border border-edge bg-surface p-4",children:[_.jsx("h3",{className:"mb-3 text-sm font-semibold text-ink-secondary",children:"Runs per day"}),t.length===0?_.jsx("p",{className:"py-10 text-center text-sm text-ink-muted",children:"No runs in this period."}):_.jsx(AR,{width:"100%",height:220,children:_.jsxs(Jxe,{data:t,margin:{top:4,right:8,left:-18,bottom:0},children:[_.jsx(Dw,{vertical:!1,stroke:"var(--gridline)"}),_.jsx(Lw,{dataKey:"day",tick:a,axisLine:{stroke:"var(--baseline)"},tickLine:!1}),_.jsx(zw,{tick:a,axisLine:!1,tickLine:!1,allowDecimals:!1}),_.jsx(zN,{content:_.jsx(VI,{}),cursor:{fill:"var(--gridline)",opacity:.4}}),_.jsx(H5,{wrapperStyle:{fontSize:12,color:"var(--text-secondary)"},iconSize:8}),WI.map((l,s)=>_.jsx(x6,{dataKey:l,name:l,stackId:"runs",fill:e1e[l],stroke:"var(--surface-1)",strokeWidth:1,maxBarSize:28,radius:s===WI.length-1?[3,3,0,0]:void 0,isAnimationActive:!1},l))]})})]}),_.jsxs("div",{className:"rounded-lg border border-edge bg-surface p-4",children:[_.jsxs("h3",{className:"mb-3 text-sm font-semibold text-ink-secondary",children:["Run duration (last ",n.length," runs)"]}),n.length===0?_.jsx("p",{className:"py-10 text-center text-sm text-ink-muted",children:"No finished runs yet."}):_.jsx(AR,{width:"100%",height:200,children:_.jsxs(Gxe,{data:n,margin:{top:4,right:8,left:-10,bottom:0},children:[_.jsx(Dw,{vertical:!1,stroke:"var(--gridline)"}),_.jsx(Lw,{dataKey:"id",tick:a,axisLine:{stroke:"var(--baseline)"},tickLine:!1}),_.jsx(zw,{tick:a,axisLine:!1,tickLine:!1,tickFormatter:l=>lh(l)}),_.jsx(zN,{content:_.jsx(VI,{unit:"s"}),cursor:{stroke:"var(--baseline)"}}),_.jsx(m6,{type:"monotone",dataKey:"duration",name:"duration",stroke:"var(--series-1)",strokeWidth:2,dot:!1,activeDot:{r:4,strokeWidth:2,stroke:"var(--surface-1)"},isAnimationActive:!1})]})})]})]})}function n1e(){const{id:e}=SL(),t=Number(e),n=Yw(),r=ro(),[i,a]=O.useState("runs"),[l,s]=O.useState(30),[c,f]=O.useState("form"),{data:d,error:p}=Ll({queryKey:["configs",t],queryFn:()=>an.config(t)}),{data:g}=Ll({queryKey:["health"],queryFn:an.health}),{data:v}=Ll({queryKey:["runs",{configId:t}],queryFn:()=>an.runs({configId:t,limit:100})}),{data:y}=Ll({queryKey:["runs","stats",t,l],queryFn:()=>an.configStats(t,l),enabled:i==="stats"}),x=$u({mutationFn:()=>an.triggerRun(t),onSettled:()=>r.invalidateQueries({queryKey:["configs"]})}),w=$u({mutationFn:()=>an.deleteConfig(t),onSuccess:()=>{r.invalidateQueries({queryKey:["configs"]}),n("/")}});if(p)return _.jsx("p",{className:"text-critical",children:p.message});if(!d)return _.jsx("p",{className:"text-ink-muted",children:"Loading…"});const A=g?.mode==="rw";return _.jsxs("div",{className:"space-y-6",children:[_.jsxs("div",{children:[_.jsx(za,{to:"/",className:"text-sm text-ink-muted hover:text-accent",children:"← Configurations"}),_.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-3",children:[_.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:d.name}),d.parse_error&&_.jsxs("span",{className:"rounded-full border border-critical/40 px-2 py-0.5 text-xs text-critical",title:d.parse_error,children:["invalid: ",d.parse_error]}),_.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[_.jsx("button",{onClick:()=>x.mutate(),disabled:d.busy||!!d.parse_error||x.isPending,className:"rounded-md bg-accent px-3.5 py-1.5 text-sm font-medium text-white transition hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-40",children:d.busy?"Running…":"Run now"}),A&&_.jsx("button",{onClick:()=>{window.confirm(`Delete config '${d.name}' and its file?
|
|
125
|
+
|
|
126
|
+
Run history is kept.`)&&w.mutate()},className:"rounded-md border border-critical/40 px-3.5 py-1.5 text-sm font-medium text-critical transition hover:bg-critical/10",children:"Delete"})]})]}),x.error&&_.jsx("p",{className:"mt-2 text-sm text-critical",children:x.error.message}),w.error&&_.jsx("p",{className:"mt-2 text-sm text-critical",children:w.error.message}),_.jsxs("dl",{className:"mt-3 flex flex-wrap gap-x-8 gap-y-2 text-sm",children:[_.jsxs("div",{children:[_.jsx("dt",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"Schedule"}),_.jsxs("dd",{className:"mt-0.5 text-ink-secondary",children:[iO(d.schedule),d.schedule&&_.jsx("code",{className:"ml-2 text-xs text-ink-muted",children:d.schedule})]})]}),_.jsxs("div",{children:[_.jsx("dt",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"Next run"}),_.jsx("dd",{className:"mt-0.5 text-ink-secondary",title:d.next_run?Hu(d.next_run):void 0,children:d.next_run?L1(d.next_run):"—"})]}),_.jsxs("div",{children:[_.jsx("dt",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"File"}),_.jsx("dd",{className:"mt-0.5 font-mono text-xs text-ink-muted",children:d.path})]})]}),_.jsx("div",{className:"mt-3",children:_.jsx(nj,{sources:d.source_summary})})]}),_.jsx("div",{className:"border-b border-edge",children:_.jsx("nav",{className:"flex gap-6 text-sm",children:["runs","stats","config"].map(k=>_.jsx("button",{onClick:()=>a(k),className:`-mb-px border-b-2 px-1 pb-2 font-medium capitalize transition ${i===k?"border-accent text-accent":"border-transparent text-ink-muted hover:text-ink-secondary"}`,children:k},k))})}),i==="runs"&&_.jsx(_ee,{runs:v??[]}),i==="stats"&&_.jsxs("div",{className:"space-y-4",children:[_.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[_.jsx("span",{className:"text-ink-muted",children:"Period:"}),[7,30,90].map(k=>_.jsxs("button",{onClick:()=>s(k),className:`rounded-md border px-2.5 py-1 text-xs font-medium transition ${l===k?"border-accent text-accent":"border-edge text-ink-muted hover:text-ink-secondary"}`,children:[k,"d"]},k))]}),y?_.jsx(t1e,{stats:y}):_.jsx("p",{className:"text-ink-muted",children:"Loading…"})]}),i==="config"&&_.jsxs("div",{className:"space-y-4",children:[_.jsx("div",{className:"flex items-center gap-2 text-sm",children:A?["form","yaml"].map(k=>_.jsx("button",{onClick:()=>f(k),className:`rounded-md border px-2.5 py-1 text-xs font-medium uppercase transition ${c===k?"border-accent text-accent":"border-edge text-ink-muted hover:text-ink-secondary"}`,children:k},k)):_.jsx("p",{className:"text-xs text-ink-muted",children:"Read-only mode — configs are managed from the files passed to the controller."})}),A&&c==="form"?_.jsx(tj,{mode:"edit",config:d,onSaved:()=>r.invalidateQueries({queryKey:["configs",t]})},d.content_hash):A?_.jsx(_D,{mode:"edit",config:d,onSaved:()=>r.invalidateQueries({queryKey:["configs",t]})},d.content_hash):_.jsx(_D,{mode:"view",config:d})]})]})}const C1=1e4,r1e=["error","warn","info","debug"],E1={error:"text-critical",warn:"text-warning",info:"text-ink-secondary",debug:"text-ink-muted"};function i1e({runId:e,isActive:t}){const[n,r]=O.useState([]),[i,a]=O.useState(!t),[l,s]=O.useState(!0),[c,f]=O.useState(new Set),[d,p]=O.useState(""),g=O.useRef(null),v=O.useRef(l);v.current=l,O.useEffect(()=>{r([]);const T=new EventSource(`/api/runs/${e}/logs/stream`);return T.addEventListener("log",M=>{const R=JSON.parse(M.data);r(L=>{const H=L.length>=C1?L.slice(L.length-C1+1):L.slice();return H.push(R),H})}),T.addEventListener("end",()=>{a(!0),T.close()}),T.onerror=()=>{},()=>T.close()},[e]);const y=O.useMemo(()=>{const T={};for(const M of n)T[M.level]=(T[M.level]??0)+1;return T},[n]),x=O.useMemo(()=>{const T=d.trim().toLowerCase();return c.size===0&&!T?n:n.filter(M=>c.size>0&&!c.has(M.level)?!1:T?M.message.toLowerCase().includes(T)||(M.module??"").toLowerCase().includes(T):!0)},[n,c,d]),w=O.useRef(!1);O.useLayoutEffect(()=>{v.current&&g.current&&(w.current=!0,g.current.scrollTop=g.current.scrollHeight)},[x,l]);const A=()=>{const T=g.current;if(!T)return;const M=T.scrollHeight-T.scrollTop-T.clientHeight<40;if(w.current){w.current=!1,M&&!v.current&&s(!0);return}M!==v.current&&s(M)},k=T=>{T.deltaY<0&&v.current&&s(!1)},E=T=>{f(M=>{const R=new Set(M);return R.has(T)?R.delete(T):R.add(T),R})},P=c.size>0||d.trim()!=="";return _.jsxs("div",{className:"rounded-lg border border-edge bg-surface",children:[_.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b border-edge px-4 py-2 text-xs text-ink-muted",children:[_.jsxs("span",{className:"shrink-0",children:[P?`${x.length.toLocaleString()} / `:"",n.length.toLocaleString()," lines",n.length>=C1&&" (oldest trimmed)"]}),!i&&_.jsx("span",{className:"shrink-0 text-accent",children:"● live"}),_.jsx("div",{className:"flex items-center gap-1",children:r1e.map(T=>_.jsxs("button",{onClick:()=>E(T),title:`${y[T]??0} ${T} line(s)`,className:`rounded-full border px-2 py-0.5 font-medium uppercase transition ${c.has(T)?`border-current ${E1[T]}`:"border-edge text-ink-muted hover:text-ink-secondary"}`,children:[T,(y[T]??0)>0&&_.jsx("span",{className:"ml-1 font-normal",children:y[T]})]},T))}),_.jsx("input",{value:d,onChange:T=>p(T.target.value),placeholder:"Filter by keyword…",className:"w-44 rounded-md border border-edge bg-page px-2 py-1 text-xs outline-none placeholder:text-ink-muted/60 focus:border-accent"}),P&&_.jsx("button",{onClick:()=>{f(new Set),p("")},className:"text-ink-muted underline-offset-2 hover:text-accent hover:underline",children:"clear"}),!l&&!i&&_.jsx("button",{onClick:()=>{s(!0),g.current?.scrollTo({top:g.current.scrollHeight})},className:"ml-auto rounded border border-edge px-2 py-0.5 hover:border-accent hover:text-accent",children:"↓ Follow"})]}),_.jsxs("div",{ref:g,onScroll:A,onWheel:k,className:"log-scroll max-h-[560px] overflow-auto px-4 py-3 font-mono text-xs leading-5",children:[x.length===0&&_.jsx("p",{className:"text-ink-muted",children:n.length===0?`No log output${i?"":" yet"}.`:"No lines match the current filters."}),x.map(T=>_.jsxs("div",{className:"flex gap-3 whitespace-pre-wrap break-all hover:bg-ink/[0.03]",children:[_.jsx("span",{className:"shrink-0 select-none text-ink-muted",children:T.ts.slice(11,19)}),_.jsx("span",{className:`w-10 shrink-0 select-none uppercase ${E1[T.level]??"text-ink-secondary"}`,children:T.level}),_.jsxs("span",{className:E1[T.level]??"text-ink-secondary",children:[T.module&&_.jsxs("span",{className:"text-ink-muted",children:["[",T.module.replace(/^Doc2Vec:?/,"")||"main","] "]}),T.message]})]},T.seq))]})]})}function a1e(){const{id:e}=SL(),t=Number(e),n=ro(),{data:r,error:i}=Ll({queryKey:["runs",t],queryFn:()=>an.run(t),refetchInterval:c=>c.state.data&&["queued","running"].includes(c.state.data.status)?3e3:!1}),a=$u({mutationFn:()=>an.cancelRun(t),onSettled:()=>n.invalidateQueries({queryKey:["runs",t]})});if(i)return _.jsx("p",{className:"text-critical",children:i.message});if(!r)return _.jsx("p",{className:"text-ink-muted",children:"Loading…"});const l=r.status==="queued"||r.status==="running",s=r.stats?.sources??[];return _.jsxs("div",{className:"space-y-6",children:[_.jsxs("div",{children:[_.jsxs(za,{to:`/configs/${r.config_id}`,className:"text-sm text-ink-muted hover:text-accent",children:["← ",r.config_name??`Config ${r.config_id}`]}),_.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-3",children:[_.jsxs("h1",{className:"text-xl font-semibold tracking-tight",children:["Run #",r.id]}),_.jsx(aO,{status:r.status}),l&&_.jsx("button",{onClick:()=>a.mutate(),disabled:a.isPending,className:"ml-auto rounded-md border border-critical/40 px-3.5 py-1.5 text-sm font-medium text-critical transition hover:bg-critical/10 disabled:opacity-40",children:"Cancel run"})]}),r.error&&_.jsx("p",{className:"mt-2 text-sm text-critical",children:r.error}),a.error&&_.jsx("p",{className:"mt-2 text-sm text-critical",children:a.error.message}),_.jsx("dl",{className:"mt-3 flex flex-wrap gap-x-8 gap-y-2 text-sm",children:[["Trigger",r.trigger],["Queued",Hu(r.queued_at)],["Started",Hu(r.started_at)],["Duration",l?"…":rO(r.started_at,r.finished_at)],["Exit code",r.exit_code===null?"—":String(r.exit_code)],["Warnings",String(r.stats?.warn_count??0)],["Errors",String(r.stats?.error_count??0)]].map(([c,f])=>_.jsxs("div",{children:[_.jsx("dt",{className:"text-xs uppercase tracking-wide text-ink-muted",children:c}),_.jsx("dd",{className:"mt-0.5 text-ink-secondary",children:f})]},c))})]}),s.length>0&&_.jsx("div",{className:"overflow-x-auto rounded-lg border border-edge bg-surface",children:_.jsxs("table",{className:"w-full text-sm",children:[_.jsx("thead",{children:_.jsxs("tr",{className:"border-b border-edge text-left text-xs uppercase tracking-wide text-ink-muted",children:[_.jsx("th",{className:"px-4 py-2 font-medium",children:"Source"}),_.jsx("th",{className:"px-4 py-2 font-medium",children:"Type"}),_.jsx("th",{className:"px-4 py-2 font-medium",children:"Version"}),_.jsx("th",{className:"px-4 py-2 font-medium",children:"Duration"}),_.jsx("th",{className:"px-4 py-2 font-medium",children:"Result"})]})}),_.jsx("tbody",{children:s.map(c=>_.jsxs("tr",{className:"border-b border-edge/60 last:border-0",children:[_.jsx("td",{className:"px-4 py-2 font-medium",children:c.product_name}),_.jsx("td",{className:"px-4 py-2 text-ink-secondary",children:c.type}),_.jsx("td",{className:"px-4 py-2 text-ink-secondary",children:c.version}),_.jsx("td",{className:"px-4 py-2 text-ink-secondary",children:lh(c.duration_ms/1e3)}),_.jsx("td",{className:"px-4 py-2",children:c.ok?_.jsx("span",{className:"text-good-text",children:"✓ ok"}):_.jsxs("span",{className:"text-critical",title:c.error,children:["✕ ",c.error??"failed"]})})]},`${c.product_name}-${c.type}`))})]})}),_.jsxs("div",{children:[_.jsx("h2",{className:"mb-2 text-sm font-semibold text-ink-secondary",children:"Logs"}),_.jsx(i1e,{runId:t,isActive:l})]})]})}function l1e(){const e=ro(),{data:t}=Ll({queryKey:["health"],queryFn:an.health});return O.useEffect(()=>{const n=new EventSource("/api/events"),r=()=>{e.invalidateQueries({queryKey:["configs"]}),e.invalidateQueries({queryKey:["runs"]})};return n.addEventListener("run:update",r),n.addEventListener("config:update",r),()=>n.close()},[e]),_.jsxs("div",{className:"min-h-screen",children:[_.jsx("header",{className:"border-b border-edge bg-surface",children:_.jsxs("div",{className:"mx-auto flex max-w-6xl items-center gap-3 px-6 py-4",children:[_.jsxs(za,{to:"/",className:"flex items-center gap-2 text-lg font-semibold tracking-tight",children:[_.jsx("span",{"aria-hidden":!0,children:"📚"})," doc2vec"]}),_.jsx("span",{className:"text-sm text-ink-muted",children:"controller"}),_.jsx("div",{className:"ml-auto flex items-center gap-3 text-sm",children:t&&_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"rounded-full border border-edge px-2.5 py-0.5 text-xs font-medium text-ink-secondary",title:t.mode==="rw"?"Configs can be created and edited from this UI":"Configs are managed from files only",children:t.mode==="rw"?"read-write":"read-only"}),_.jsxs("span",{className:"text-ink-muted",children:["v",t.version]})]})})]})}),_.jsx("main",{className:"mx-auto max-w-6xl px-6 py-8",children:_.jsxs(JF,{children:[_.jsx(Em,{path:"/",element:_.jsx(b7,{})}),_.jsx(Em,{path:"/configs/:id",element:_.jsx(n1e,{})}),_.jsx(Em,{path:"/runs/:id",element:_.jsx(a1e,{})})]})})]})}const o1e=new U9({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:5e3}}});g9.createRoot(document.getElementById("root")).render(_.jsx(KI.StrictMode,{children:_.jsx(F9,{client:o1e,children:_.jsx(Oq,{children:_.jsx(l1e,{})})})}));
|