doc2vec 2.16.0 → 2.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -0
- package/dist/database.js +114 -8
- package/dist/doc2vec.js +54 -3
- package/dist/eval.js +375 -0
- package/dist/ui/assets/index-ByuMPqOM.js +132 -0
- package/dist/ui/index.html +1 -1
- package/package.json +10 -5
- package/dist/ui/assets/index-C0Yy-BZB.js +0 -126
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
function p9(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 Ev(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var tx={exports:{}},Sf={};var Q2;function m9(){if(Q2)return Sf;Q2=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 Sf.Fragment=t,Sf.jsx=n,Sf.jsxs=n,Sf}var X2;function g9(){return X2||(X2=1,tx.exports=m9()),tx.exports}var T=g9(),nx={exports:{}},De={};var Y2;function v9(){if(Y2)return De;Y2=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(R){return R===null||typeof R!="object"?null:(R=g&&R[g]||R["@@iterator"],typeof R=="function"?R:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,w={};function A(R,F,ee){this.props=R,this.context=F,this.refs=w,this.updater=ee||y}A.prototype.isReactComponent={},A.prototype.setState=function(R,F){if(typeof R!="object"&&typeof R!="function"&&R!=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,R,F,"setState")},A.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function E(){}E.prototype=A.prototype;function k(R,F,ee){this.props=R,this.context=F,this.refs=w,this.updater=ee||y}var M=k.prototype=new E;M.constructor=k,x(M,A.prototype),M.isPureReactComponent=!0;var D=Array.isArray;function P(){}var N={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function U(R,F,ee){var se=ee.ref;return{$$typeof:e,type:R,key:F,ref:se!==void 0?se:null,props:ee}}function K(R,F){return U(R.type,F,R.props)}function V(R){return typeof R=="object"&&R!==null&&R.$$typeof===e}function B(R){var F={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(ee){return F[ee]})}var oe=/\/+/g;function ie(R,F){return typeof R=="object"&&R!==null&&R.key!=null?B(""+R.key):F.toString(36)}function ue(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(P,P):(R.status="pending",R.then(function(F){R.status==="pending"&&(R.status="fulfilled",R.value=F)},function(F){R.status==="pending"&&(R.status="rejected",R.reason=F)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function z(R,F,ee,se,ge){var Oe=typeof R;(Oe==="undefined"||Oe==="boolean")&&(R=null);var Pe=!1;if(R===null)Pe=!0;else switch(Oe){case"bigint":case"string":case"number":Pe=!0;break;case"object":switch(R.$$typeof){case e:case t:Pe=!0;break;case d:return Pe=R._init,z(Pe(R._payload),F,ee,se,ge)}}if(Pe)return ge=ge(R),Pe=se===""?"."+ie(R,0):se,D(ge)?(ee="",Pe!=null&&(ee=Pe.replace(oe,"$&/")+"/"),z(ge,F,ee,"",function(Te){return Te})):ge!=null&&(V(ge)&&(ge=K(ge,ee+(ge.key==null||R&&R.key===ge.key?"":(""+ge.key).replace(oe,"$&/")+"/")+Pe)),F.push(ge)),1;Pe=0;var mt=se===""?".":se+":";if(D(R))for(var ce=0;ce<R.length;ce++)se=R[ce],Oe=mt+ie(se,ce),Pe+=z(se,F,ee,Oe,ge);else if(ce=v(R),typeof ce=="function")for(R=ce.call(R),ce=0;!(se=R.next()).done;)se=se.value,Oe=mt+ie(se,ce++),Pe+=z(se,F,ee,Oe,ge);else if(Oe==="object"){if(typeof R.then=="function")return z(ue(R),F,ee,se,ge);throw F=String(R),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return Pe}function Z(R,F,ee){if(R==null)return R;var se=[],ge=0;return z(R,se,"","",function(Oe){return F.call(ee,Oe,ge++)}),se}function ae(R){if(R._status===-1){var F=R._result;F=F(),F.then(function(ee){(R._status===0||R._status===-1)&&(R._status=1,R._result=ee)},function(ee){(R._status===0||R._status===-1)&&(R._status=2,R._result=ee)}),R._status===-1&&(R._status=0,R._result=F)}if(R._status===1)return R._result.default;throw R._result}var Q=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)},le={map:Z,forEach:function(R,F,ee){Z(R,function(){F.apply(this,arguments)},ee)},count:function(R){var F=0;return Z(R,function(){F++}),F},toArray:function(R){return Z(R,function(F){return F})||[]},only:function(R){if(!V(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return De.Activity=p,De.Children=le,De.Component=A,De.Fragment=n,De.Profiler=i,De.PureComponent=k,De.StrictMode=r,De.Suspense=c,De.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=N,De.__COMPILER_RUNTIME={__proto__:null,c:function(R){return N.H.useMemoCache(R)}},De.cache=function(R){return function(){return R.apply(null,arguments)}},De.cacheSignal=function(){return null},De.cloneElement=function(R,F,ee){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var se=x({},R.props),ge=R.key;if(F!=null)for(Oe in F.key!==void 0&&(ge=""+F.key),F)!L.call(F,Oe)||Oe==="key"||Oe==="__self"||Oe==="__source"||Oe==="ref"&&F.ref===void 0||(se[Oe]=F[Oe]);var Oe=arguments.length-2;if(Oe===1)se.children=ee;else if(1<Oe){for(var Pe=Array(Oe),mt=0;mt<Oe;mt++)Pe[mt]=arguments[mt+2];se.children=Pe}return U(R.type,ge,se)},De.createContext=function(R){return R={$$typeof:l,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:a,_context:R},R},De.createElement=function(R,F,ee){var se,ge={},Oe=null;if(F!=null)for(se in F.key!==void 0&&(Oe=""+F.key),F)L.call(F,se)&&se!=="key"&&se!=="__self"&&se!=="__source"&&(ge[se]=F[se]);var Pe=arguments.length-2;if(Pe===1)ge.children=ee;else if(1<Pe){for(var mt=Array(Pe),ce=0;ce<Pe;ce++)mt[ce]=arguments[ce+2];ge.children=mt}if(R&&R.defaultProps)for(se in Pe=R.defaultProps,Pe)ge[se]===void 0&&(ge[se]=Pe[se]);return U(R,Oe,ge)},De.createRef=function(){return{current:null}},De.forwardRef=function(R){return{$$typeof:s,render:R}},De.isValidElement=V,De.lazy=function(R){return{$$typeof:d,_payload:{_status:-1,_result:R},_init:ae}},De.memo=function(R,F){return{$$typeof:f,type:R,compare:F===void 0?null:F}},De.startTransition=function(R){var F=N.T,ee={};N.T=ee;try{var se=R(),ge=N.S;ge!==null&&ge(ee,se),typeof se=="object"&&se!==null&&typeof se.then=="function"&&se.then(P,Q)}catch(Oe){Q(Oe)}finally{F!==null&&ee.types!==null&&(F.types=ee.types),N.T=F}},De.unstable_useCacheRefresh=function(){return N.H.useCacheRefresh()},De.use=function(R){return N.H.use(R)},De.useActionState=function(R,F,ee){return N.H.useActionState(R,F,ee)},De.useCallback=function(R,F){return N.H.useCallback(R,F)},De.useContext=function(R){return N.H.useContext(R)},De.useDebugValue=function(){},De.useDeferredValue=function(R,F){return N.H.useDeferredValue(R,F)},De.useEffect=function(R,F){return N.H.useEffect(R,F)},De.useEffectEvent=function(R){return N.H.useEffectEvent(R)},De.useId=function(){return N.H.useId()},De.useImperativeHandle=function(R,F,ee){return N.H.useImperativeHandle(R,F,ee)},De.useInsertionEffect=function(R,F){return N.H.useInsertionEffect(R,F)},De.useLayoutEffect=function(R,F){return N.H.useLayoutEffect(R,F)},De.useMemo=function(R,F){return N.H.useMemo(R,F)},De.useOptimistic=function(R,F){return N.H.useOptimistic(R,F)},De.useReducer=function(R,F,ee){return N.H.useReducer(R,F,ee)},De.useRef=function(R){return N.H.useRef(R)},De.useState=function(R){return N.H.useState(R)},De.useSyncExternalStore=function(R,F,ee){return N.H.useSyncExternalStore(R,F,ee)},De.useTransition=function(){return N.H.useTransition()},De.version="19.2.7",De}var G2;function uc(){return G2||(G2=1,nx.exports=v9()),nx.exports}var O=uc();const lL=Ev(O),y9=p9({__proto__:null,default:lL},[O]);var rx={exports:{}},wf={},ix={exports:{}},ax={};var Z2;function b9(){return Z2||(Z2=1,(function(e){function t(z,Z){var ae=z.length;z.push(Z);e:for(;0<ae;){var Q=ae-1>>>1,le=z[Q];if(0<i(le,Z))z[Q]=Z,z[ae]=le,ae=Q;else break e}}function n(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var Z=z[0],ae=z.pop();if(ae!==Z){z[0]=ae;e:for(var Q=0,le=z.length,R=le>>>1;Q<R;){var F=2*(Q+1)-1,ee=z[F],se=F+1,ge=z[se];if(0>i(ee,ae))se<le&&0>i(ge,ee)?(z[Q]=ge,z[se]=ae,Q=se):(z[Q]=ee,z[F]=ae,Q=F);else if(se<le&&0>i(ge,ae))z[Q]=ge,z[se]=ae,Q=se;else break e}}return Z}function i(z,Z){var ae=z.sortIndex-Z.sortIndex;return ae!==0?ae:z.id-Z.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,E=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function M(z){for(var Z=n(f);Z!==null;){if(Z.callback===null)r(f);else if(Z.startTime<=z)r(f),Z.sortIndex=Z.expirationTime,t(c,Z);else break;Z=n(f)}}function D(z){if(x=!1,M(z),!y)if(n(c)!==null)y=!0,P||(P=!0,B());else{var Z=n(f);Z!==null&&ue(D,Z.startTime-z)}}var P=!1,N=-1,L=5,U=-1;function K(){return w?!0:!(e.unstable_now()-U<L)}function V(){if(w=!1,P){var z=e.unstable_now();U=z;var Z=!0;try{e:{y=!1,x&&(x=!1,E(N),N=-1),v=!0;var ae=g;try{t:{for(M(z),p=n(c);p!==null&&!(p.expirationTime>z&&K());){var Q=p.callback;if(typeof Q=="function"){p.callback=null,g=p.priorityLevel;var le=Q(p.expirationTime<=z);if(z=e.unstable_now(),typeof le=="function"){p.callback=le,M(z),Z=!0;break t}p===n(c)&&r(c),M(z)}else r(c);p=n(c)}if(p!==null)Z=!0;else{var R=n(f);R!==null&&ue(D,R.startTime-z),Z=!1}}break e}finally{p=null,g=ae,v=!1}Z=void 0}}finally{Z?B():P=!1}}}var B;if(typeof k=="function")B=function(){k(V)};else if(typeof MessageChannel<"u"){var oe=new MessageChannel,ie=oe.port2;oe.port1.onmessage=V,B=function(){ie.postMessage(null)}}else B=function(){A(V,0)};function ue(z,Z){N=A(function(){z(e.unstable_now())},Z)}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 Z=3;break;default:Z=g}var ae=g;g=Z;try{return z()}finally{g=ae}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function(z,Z){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var ae=g;g=z;try{return Z()}finally{g=ae}},e.unstable_scheduleCallback=function(z,Z,ae){var Q=e.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?Q+ae:Q):ae=Q,z){case 1:var le=-1;break;case 2:le=250;break;case 5:le=1073741823;break;case 4:le=1e4;break;default:le=5e3}return le=ae+le,z={id:d++,callback:Z,priorityLevel:z,startTime:ae,expirationTime:le,sortIndex:-1},ae>Q?(z.sortIndex=ae,t(f,z),n(c)===null&&z===n(f)&&(x?(E(N),N=-1):x=!0,ue(D,ae-Q))):(z.sortIndex=le,t(c,z),y||v||(y=!0,P||(P=!0,B()))),z},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(z){var Z=g;return function(){var ae=g;g=Z;try{return z.apply(this,arguments)}finally{g=ae}}}})(ax)),ax}var J2;function x9(){return J2||(J2=1,ix.exports=b9()),ix.exports}var lx={exports:{}},Cn={};var eM;function S9(){if(eM)return Cn;eM=1;var e=uc();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 tM;function oL(){if(tM)return lx.exports;tM=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(),lx.exports=S9(),lx.exports}var nM;function w9(){if(nM)return wf;nM=1;var e=x9(),t=uc(),n=oL();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,_=b.child;_;){if(_===h){C=!0,h=b,m=S;break}if(_===m){C=!0,m=b,h=S;break}_=_.sibling}if(!C){for(_=S.child;_;){if(_===h){C=!0,h=S,m=b;break}if(_===m){C=!0,m=S,h=b;break}_=_.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"),E=Symbol.for("react.consumer"),k=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),U=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 oe=Symbol.for("react.client.reference");function ie(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===oe?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 D:return"Suspense";case P:return"SuspenseList";case U:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case y:return"Portal";case k:return o.displayName||"Context";case E:return(o._context.displayName||"Context")+".Consumer";case M:var u=o.render;return o=o.displayName,o||(o=u.displayName||u.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case N: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 ue=Array.isArray,z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},Q=[],le=-1;function R(o){return{current:o}}function F(o){0>le||(o.current=Q[le],Q[le]=null,le--)}function ee(o,u){le++,Q[le]=o.current,o.current=u}var se=R(null),ge=R(null),Oe=R(null),Pe=R(null);function mt(o,u){switch(ee(Oe,u),ee(ge,o),ee(se,null),u.nodeType){case 9:case 11:o=(o=u.documentElement)&&(o=o.namespaceURI)?v2(o):0;break;default:if(o=u.tagName,u=u.namespaceURI)u=v2(u),o=y2(u,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}F(se),ee(se,o)}function ce(){F(se),F(ge),F(Oe)}function Te(o){o.memoizedState!==null&&ee(Pe,o);var u=se.current,h=y2(u,o.type);u!==h&&(ee(ge,o),ee(se,h))}function Ee(o){ge.current===o&&(F(se),F(ge)),Pe.current===o&&(F(Pe),vf._currentValue=ae)}var fe,Rt;function Ne(o){if(fe===void 0)try{throw Error()}catch(h){var u=h.stack.trim().match(/\n( *(at )?)/);fe=u&&u[1]||"",Rt=-1<h.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+fe+o+Rt}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 re=function(){throw Error()};if(Object.defineProperty(re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(re,[])}catch(Y){var X=Y}Reflect.construct(o,[],re)}else{try{re.call()}catch(Y){X=Y}o.call(re.prototype)}}else{try{throw Error()}catch(Y){X=Y}(re=o())&&typeof re.catch=="function"&&re.catch(function(){})}}catch(Y){if(Y&&X&&typeof Y.stack=="string")return[Y.stack,X.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],_=S[1];if(C&&_){var j=C.split(`
|
|
4
|
-
`),q=_.split(`
|
|
5
|
-
`);for(b=m=0;m<j.length&&!j[m].includes("DetermineComponentFrameRoot");)m++;for(;b<q.length&&!q[b].includes("DetermineComponentFrameRoot");)b++;if(m===j.length||b===q.length)for(m=j.length-1,b=q.length-1;1<=m&&0<=b&&j[m]!==q[b];)b--;for(;1<=m&&0<=b;m--,b--)if(j[m]!==q[b]){if(m!==1||b!==1)do if(m--,b--,0>b||j[m]!==q[b]){var J=`
|
|
6
|
-
`+j[m].replace(" at new "," at ");return o.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",o.displayName)),J}while(1<=m&&0<=b);break}}}finally{xe=!1,Error.prepareStackTrace=h}return(h=o?o.displayName||o.name:"")?Ne(h):""}function dn(o,u){switch(o.tag){case 26:case 27:case 5:return Ne(o.type);case 16:return Ne("Lazy");case 13:return o.child!==u&&u!==null?Ne("Suspense Fallback"):Ne("Suspense");case 19:return Ne("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 Ne("Activity");default:return""}}function fa(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 $y=Object.prototype.hasOwnProperty,Uy=e.unstable_scheduleCallback,Hy=e.unstable_cancelCallback,V6=e.unstable_shouldYield,K6=e.unstable_requestPaint,pr=e.unstable_now,Q6=e.unstable_getCurrentPriorityLevel,Xk=e.unstable_ImmediatePriority,Yk=e.unstable_UserBlockingPriority,wd=e.unstable_NormalPriority,X6=e.unstable_LowPriority,Gk=e.unstable_IdlePriority,Y6=e.log,G6=e.unstable_setDisableYieldValue,Tc=null,mr=null;function ol(o){if(typeof Y6=="function"&&G6(o),mr&&typeof mr.setStrictMode=="function")try{mr.setStrictMode(Tc,o)}catch{}}var gr=Math.clz32?Math.clz32:eU,Z6=Math.log,J6=Math.LN2;function eU(o){return o>>>=0,o===0?32:31-(Z6(o)/J6|0)|0}var Od=256,Ad=262144,kd=4194304;function so(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 Cd(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 _=m&134217727;return _!==0?(m=_&~S,m!==0?b=so(m):(C&=_,C!==0?b=so(C):h||(h=_&~o,h!==0&&(b=so(h))))):(_=m&~S,_!==0?b=so(_):C!==0?b=so(C):h||(h=m&~o,h!==0&&(b=so(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 Mc(o,u){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&u)===0}function tU(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 Zk(){var o=kd;return kd<<=1,(kd&62914560)===0&&(kd=4194304),o}function Fy(o){for(var u=[],h=0;31>h;h++)u.push(o);return u}function Pc(o,u){o.pendingLanes|=u,u!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function nU(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 _=o.entanglements,j=o.expirationTimes,q=o.hiddenUpdates;for(h=C&~h;0<h;){var J=31-gr(h),re=1<<J;_[J]=0,j[J]=-1;var X=q[J];if(X!==null)for(q[J]=null,J=0;J<X.length;J++){var Y=X[J];Y!==null&&(Y.lane&=-536870913)}h&=~re}m!==0&&Jk(o,m,0),S!==0&&b===0&&o.tag!==0&&(o.suspendedLanes|=S&~(C&~u))}function Jk(o,u,h){o.pendingLanes|=u,o.suspendedLanes&=~u;var m=31-gr(u);o.entangledLanes|=u,o.entanglements[m]=o.entanglements[m]|1073741824|h&261930}function eC(o,u){var h=o.entangledLanes|=u;for(o=o.entanglements;h;){var m=31-gr(h),b=1<<m;b&u|o[m]&u&&(o[m]|=u),h&=~b}}function tC(o,u){var h=u&-u;return h=(h&42)!==0?1:qy(h),(h&(o.suspendedLanes|u))!==0?0:h}function qy(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 Wy(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function nC(){var o=Z.p;return o!==0?o:(o=window.event,o===void 0?32:U2(o.type))}function rC(o,u){var h=Z.p;try{return Z.p=o,u()}finally{Z.p=h}}var sl=Math.random().toString(36).slice(2),pn="__reactFiber$"+sl,Zn="__reactProps$"+sl,Cs="__reactContainer$"+sl,Vy="__reactEvents$"+sl,rU="__reactListeners$"+sl,iU="__reactHandles$"+sl,iC="__reactResources$"+sl,Dc="__reactMarker$"+sl;function Ky(o){delete o[pn],delete o[Zn],delete o[Vy],delete o[rU],delete o[iU]}function Es(o){var u=o[pn];if(u)return u;for(var h=o.parentNode;h;){if(u=h[Cs]||h[pn]){if(h=u.alternate,u.child!==null||h!==null&&h.child!==null)for(o=k2(o);o!==null;){if(h=o[pn])return h;o=k2(o)}return u}o=h,h=o.parentNode}return null}function Ts(o){if(o=o[pn]||o[Cs]){var u=o.tag;if(u===5||u===6||u===13||u===31||u===26||u===27||u===3)return o}return null}function _c(o){var u=o.tag;if(u===5||u===26||u===27||u===6)return o.stateNode;throw Error(r(33))}function Ms(o){var u=o[iC];return u||(u=o[iC]={hoistableStyles:new Map,hoistableScripts:new Map}),u}function tn(o){o[Dc]=!0}var aC=new Set,lC={};function uo(o,u){Ps(o,u),Ps(o+"Capture",u)}function Ps(o,u){for(lC[o]=u,o=0;o<u.length;o++)aC.add(u[o])}var aU=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]*$"),oC={},sC={};function lU(o){return $y.call(sC,o)?!0:$y.call(oC,o)?!1:aU.test(o)?sC[o]=!0:(oC[o]=!0,!1)}function Ed(o,u,h){if(lU(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 Td(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 ha(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 jr(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function uC(o){var u=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function oU(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 Qy(o){if(!o._valueTracker){var u=uC(o)?"checked":"value";o._valueTracker=oU(o,u,""+o[u])}}function cC(o){if(!o)return!1;var u=o._valueTracker;if(!u)return!0;var h=u.getValue(),m="";return o&&(m=uC(o)?o.checked?"true":"false":o.value),o=m,o!==h?(u.setValue(o),!0):!1}function Md(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 sU=/[\n"\\]/g;function Lr(o){return o.replace(sU,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function Xy(o,u,h,m,b,S,C,_){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=""+jr(u)):o.value!==""+jr(u)&&(o.value=""+jr(u)):C!=="submit"&&C!=="reset"||o.removeAttribute("value"),u!=null?Yy(o,C,jr(u)):h!=null?Yy(o,C,jr(h)):m!=null&&o.removeAttribute("value"),b==null&&S!=null&&(o.defaultChecked=!!S),b!=null&&(o.checked=b&&typeof b!="function"&&typeof b!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?o.name=""+jr(_):o.removeAttribute("name")}function fC(o,u,h,m,b,S,C,_){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)){Qy(o);return}h=h!=null?""+jr(h):"",u=u!=null?""+jr(u):h,_||u===o.value||(o.value=u),o.defaultValue=u}m=m??b,m=typeof m!="function"&&typeof m!="symbol"&&!!m,o.checked=_?o.checked:!!m,o.defaultChecked=!!m,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(o.name=C),Qy(o)}function Yy(o,u,h){u==="number"&&Md(o.ownerDocument)===o||o.defaultValue===""+h||(o.defaultValue=""+h)}function Ds(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=""+jr(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 hC(o,u,h){if(u!=null&&(u=""+jr(u),u!==o.value&&(o.value=u),h==null)){o.defaultValue!==u&&(o.defaultValue=u);return}o.defaultValue=h!=null?""+jr(h):""}function dC(o,u,h,m){if(u==null){if(m!=null){if(h!=null)throw Error(r(92));if(ue(m)){if(1<m.length)throw Error(r(93));m=m[0]}h=m}h==null&&(h=""),u=h}h=jr(u),o.defaultValue=h,m=o.textContent,m===h&&m!==""&&m!==null&&(o.value=m),Qy(o)}function _s(o,u){if(u){var h=o.firstChild;if(h&&h===o.lastChild&&h.nodeType===3){h.nodeValue=u;return}}o.textContent=u}var uU=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 pC(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||uU.has(u)?u==="float"?o.cssFloat=h:o[u]=(""+h).trim():o[u]=h+"px"}function mC(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&&pC(o,b,m)}else for(var S in u)u.hasOwnProperty(S)&&pC(o,S,u[S])}function Gy(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 cU=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"]]),fU=/^[\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 Pd(o){return fU.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function da(){}var Zy=null;function Jy(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Ns=null,Rs=null;function gC(o){var u=Ts(o);if(u&&(o=u.stateNode)){var h=o[Zn]||null;e:switch(o=u.stateNode,u.type){case"input":if(Xy(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="'+Lr(""+u)+'"][type="radio"]'),u=0;u<h.length;u++){var m=h[u];if(m!==o&&m.form===o.form){var b=m[Zn]||null;if(!b)throw Error(r(90));Xy(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&&cC(m)}break e;case"textarea":hC(o,h.value,h.defaultValue);break e;case"select":u=h.value,u!=null&&Ds(o,!!h.multiple,u,!1)}}}var e0=!1;function vC(o,u,h){if(e0)return o(u,h);e0=!0;try{var m=o(u);return m}finally{if(e0=!1,(Ns!==null||Rs!==null)&&(vp(),Ns&&(u=Ns,o=Rs,Rs=Ns=null,gC(u),o)))for(u=0;u<o.length;u++)gC(o[u])}}function Nc(o,u){var h=o.stateNode;if(h===null)return null;var m=h[Zn]||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 pa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),t0=!1;if(pa)try{var Rc={};Object.defineProperty(Rc,"passive",{get:function(){t0=!0}}),window.addEventListener("test",Rc,Rc),window.removeEventListener("test",Rc,Rc)}catch{t0=!1}var ul=null,n0=null,Dd=null;function yC(){if(Dd)return Dd;var o,u=n0,h=u.length,m,b="value"in ul?ul.value:ul.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 Dd=b.slice(o,1<m?1-m:void 0)}function _d(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 Nd(){return!0}function bC(){return!1}function Jn(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 _ in o)o.hasOwnProperty(_)&&(h=o[_],this[_]=h?h(S):S[_]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?Nd:bC,this.isPropagationStopped=bC,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=Nd)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=Nd)},persist:function(){},isPersistent:Nd}),u}var co={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Rd=Jn(co),jc=p({},co,{view:0,detail:0}),hU=Jn(jc),r0,i0,Lc,jd=p({},jc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:l0,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!==Lc&&(Lc&&o.type==="mousemove"?(r0=o.screenX-Lc.screenX,i0=o.screenY-Lc.screenY):i0=r0=0,Lc=o),r0)},movementY:function(o){return"movementY"in o?o.movementY:i0}}),xC=Jn(jd),dU=p({},jd,{dataTransfer:0}),pU=Jn(dU),mU=p({},jc,{relatedTarget:0}),a0=Jn(mU),gU=p({},co,{animationName:0,elapsedTime:0,pseudoElement:0}),vU=Jn(gU),yU=p({},co,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),bU=Jn(yU),xU=p({},co,{data:0}),SC=Jn(xU),SU={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wU={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"},OU={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function AU(o){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(o):(o=OU[o])?!!u[o]:!1}function l0(){return AU}var kU=p({},jc,{key:function(o){if(o.key){var u=SU[o.key]||o.key;if(u!=="Unidentified")return u}return o.type==="keypress"?(o=_d(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?wU[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:l0,charCode:function(o){return o.type==="keypress"?_d(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?_d(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),CU=Jn(kU),EU=p({},jd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),wC=Jn(EU),TU=p({},jc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:l0}),MU=Jn(TU),PU=p({},co,{propertyName:0,elapsedTime:0,pseudoElement:0}),DU=Jn(PU),_U=p({},jd,{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}),NU=Jn(_U),RU=p({},co,{newState:0,oldState:0}),jU=Jn(RU),LU=[9,13,27,32],o0=pa&&"CompositionEvent"in window,Ic=null;pa&&"documentMode"in document&&(Ic=document.documentMode);var IU=pa&&"TextEvent"in window&&!Ic,OC=pa&&(!o0||Ic&&8<Ic&&11>=Ic),AC=" ",kC=!1;function CC(o,u){switch(o){case"keyup":return LU.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function EC(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var js=!1;function BU(o,u){switch(o){case"compositionend":return EC(u);case"keypress":return u.which!==32?null:(kC=!0,AC);case"textInput":return o=u.data,o===AC&&kC?null:o;default:return null}}function zU(o,u){if(js)return o==="compositionend"||!o0&&CC(o,u)?(o=yC(),Dd=n0=ul=null,js=!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 OC&&u.locale!=="ko"?null:u.data;default:return null}}var $U={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 TC(o){var u=o&&o.nodeName&&o.nodeName.toLowerCase();return u==="input"?!!$U[o.type]:u==="textarea"}function MC(o,u,h,m){Ns?Rs?Rs.push(m):Rs=[m]:Ns=m,u=Ap(u,"onChange"),0<u.length&&(h=new Rd("onChange","change",null,h,m),o.push({event:h,listeners:u}))}var Bc=null,zc=null;function UU(o){f2(o,0)}function Ld(o){var u=_c(o);if(cC(u))return o}function PC(o,u){if(o==="change")return u}var DC=!1;if(pa){var s0;if(pa){var u0="oninput"in document;if(!u0){var _C=document.createElement("div");_C.setAttribute("oninput","return;"),u0=typeof _C.oninput=="function"}s0=u0}else s0=!1;DC=s0&&(!document.documentMode||9<document.documentMode)}function NC(){Bc&&(Bc.detachEvent("onpropertychange",RC),zc=Bc=null)}function RC(o){if(o.propertyName==="value"&&Ld(zc)){var u=[];MC(u,zc,o,Jy(o)),vC(UU,u)}}function HU(o,u,h){o==="focusin"?(NC(),Bc=u,zc=h,Bc.attachEvent("onpropertychange",RC)):o==="focusout"&&NC()}function FU(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Ld(zc)}function qU(o,u){if(o==="click")return Ld(u)}function WU(o,u){if(o==="input"||o==="change")return Ld(u)}function VU(o,u){return o===u&&(o!==0||1/o===1/u)||o!==o&&u!==u}var vr=typeof Object.is=="function"?Object.is:VU;function $c(o,u){if(vr(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(!$y.call(u,b)||!vr(o[b],u[b]))return!1}return!0}function jC(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function LC(o,u){var h=jC(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=jC(h)}}function IC(o,u){return o&&u?o===u?!0:o&&o.nodeType===3?!1:u&&u.nodeType===3?IC(o,u.parentNode):"contains"in o?o.contains(u):o.compareDocumentPosition?!!(o.compareDocumentPosition(u)&16):!1:!1}function BC(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var u=Md(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=Md(o.document)}return u}function c0(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 KU=pa&&"documentMode"in document&&11>=document.documentMode,Ls=null,f0=null,Uc=null,h0=!1;function zC(o,u,h){var m=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;h0||Ls==null||Ls!==Md(m)||(m=Ls,"selectionStart"in m&&c0(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}),Uc&&$c(Uc,m)||(Uc=m,m=Ap(f0,"onSelect"),0<m.length&&(u=new Rd("onSelect","select",null,u,h),o.push({event:u,listeners:m}),u.target=Ls)))}function fo(o,u){var h={};return h[o.toLowerCase()]=u.toLowerCase(),h["Webkit"+o]="webkit"+u,h["Moz"+o]="moz"+u,h}var Is={animationend:fo("Animation","AnimationEnd"),animationiteration:fo("Animation","AnimationIteration"),animationstart:fo("Animation","AnimationStart"),transitionrun:fo("Transition","TransitionRun"),transitionstart:fo("Transition","TransitionStart"),transitioncancel:fo("Transition","TransitionCancel"),transitionend:fo("Transition","TransitionEnd")},d0={},$C={};pa&&($C=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 ho(o){if(d0[o])return d0[o];if(!Is[o])return o;var u=Is[o],h;for(h in u)if(u.hasOwnProperty(h)&&h in $C)return d0[o]=u[h];return o}var UC=ho("animationend"),HC=ho("animationiteration"),FC=ho("animationstart"),QU=ho("transitionrun"),XU=ho("transitionstart"),YU=ho("transitioncancel"),qC=ho("transitionend"),WC=new Map,p0="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(" ");p0.push("scrollEnd");function si(o,u){WC.set(o,u),uo(u,[o])}var Id=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)},Ir=[],Bs=0,m0=0;function Bd(){for(var o=Bs,u=m0=Bs=0;u<o;){var h=Ir[u];Ir[u++]=null;var m=Ir[u];Ir[u++]=null;var b=Ir[u];Ir[u++]=null;var S=Ir[u];if(Ir[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&&VC(h,b,S)}}function zd(o,u,h,m){Ir[Bs++]=o,Ir[Bs++]=u,Ir[Bs++]=h,Ir[Bs++]=m,m0|=m,o.lanes|=m,o=o.alternate,o!==null&&(o.lanes|=m)}function g0(o,u,h,m){return zd(o,u,h,m),$d(o)}function po(o,u){return zd(o,null,null,u),$d(o)}function VC(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-gr(h),o=S.hiddenUpdates,m=o[b],m===null?o[b]=[u]:m.push(u),u.lane=h|536870912),S):null}function $d(o){if(50<cf)throw cf=0,kb=null,Error(r(185));for(var u=o.return;u!==null;)o=u,u=o.return;return o.tag===3?o.stateNode:null}var zs={};function GU(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 yr(o,u,h,m){return new GU(o,u,h,m)}function v0(o){return o=o.prototype,!(!o||!o.isReactComponent)}function ma(o,u){var h=o.alternate;return h===null?(h=yr(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 KC(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 Ud(o,u,h,m,b,S){var C=0;if(m=o,typeof o=="function")v0(o)&&(C=1);else if(typeof o=="string")C=n9(o,h,se.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case U:return o=yr(31,h,u,b),o.elementType=U,o.lanes=S,o;case x:return mo(h.children,b,S,u);case w:C=8,b|=24;break;case A:return o=yr(12,h,u,b|2),o.elementType=A,o.lanes=S,o;case D:return o=yr(13,h,u,b),o.elementType=D,o.lanes=S,o;case P:return o=yr(19,h,u,b),o.elementType=P,o.lanes=S,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case k:C=10;break e;case E:C=9;break e;case M:C=11;break e;case N: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=yr(C,h,u,b),u.elementType=o,u.type=m,u.lanes=S,u}function mo(o,u,h,m){return o=yr(7,o,m,u),o.lanes=h,o}function y0(o,u,h){return o=yr(6,o,null,u),o.lanes=h,o}function QC(o){var u=yr(18,null,null,0);return u.stateNode=o,u}function b0(o,u,h){return u=yr(4,o.children!==null?o.children:[],o.key,u),u.lanes=h,u.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},u}var XC=new WeakMap;function Br(o,u){if(typeof o=="object"&&o!==null){var h=XC.get(o);return h!==void 0?h:(u={value:o,source:u,stack:fa(u)},XC.set(o,u),u)}return{value:o,source:u,stack:fa(u)}}var $s=[],Us=0,Hd=null,Hc=0,zr=[],$r=0,cl=null,Mi=1,Pi="";function ga(o,u){$s[Us++]=Hc,$s[Us++]=Hd,Hd=o,Hc=u}function YC(o,u,h){zr[$r++]=Mi,zr[$r++]=Pi,zr[$r++]=cl,cl=o;var m=Mi;o=Pi;var b=32-gr(m)-1;m&=~(1<<b),h+=1;var S=32-gr(u)+b;if(30<S){var C=b-b%5;S=(m&(1<<C)-1).toString(32),m>>=C,b-=C,Mi=1<<32-gr(u)+b|h<<b|m,Pi=S+o}else Mi=1<<S|h<<b|m,Pi=o}function x0(o){o.return!==null&&(ga(o,1),YC(o,1,0))}function S0(o){for(;o===Hd;)Hd=$s[--Us],$s[Us]=null,Hc=$s[--Us],$s[Us]=null;for(;o===cl;)cl=zr[--$r],zr[$r]=null,Pi=zr[--$r],zr[$r]=null,Mi=zr[--$r],zr[$r]=null}function GC(o,u){zr[$r++]=Mi,zr[$r++]=Pi,zr[$r++]=cl,Mi=u.id,Pi=u.overflow,cl=o}var mn=null,vt=null,He=!1,fl=null,Ur=!1,w0=Error(r(519));function hl(o){var u=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Fc(Br(u,o)),w0}function ZC(o){var u=o.stateNode,h=o.type,m=o.memoizedProps;switch(u[pn]=o,u[Zn]=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<hf.length;h++)Be(hf[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),fC(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),dC(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||m2(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=da),u=!0):u=!1,u||hl(o,!0)}function JC(o){for(mn=o.return;mn;)switch(mn.tag){case 5:case 31:case 13:Ur=!1;return;case 27:case 3:Ur=!0;return;default:mn=mn.return}}function Hs(o){if(o!==mn)return!1;if(!He)return JC(o),He=!0,!1;var u=o.tag,h;if((h=u!==3&&u!==27)&&((h=u===5)&&(h=o.type,h=!(h!=="form"&&h!=="button")||$b(o.type,o.memoizedProps)),h=!h),h&&vt&&hl(o),JC(o),u===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));vt=A2(o)}else if(u===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));vt=A2(o)}else u===27?(u=vt,Cl(o.type)?(o=Wb,Wb=null,vt=o):vt=u):vt=mn?Fr(o.stateNode.nextSibling):null;return!0}function go(){vt=mn=null,He=!1}function O0(){var o=fl;return o!==null&&(rr===null?rr=o:rr.push.apply(rr,o),fl=null),o}function Fc(o){fl===null?fl=[o]:fl.push(o)}var A0=R(null),vo=null,va=null;function dl(o,u,h){ee(A0,u._currentValue),u._currentValue=h}function ya(o){o._currentValue=A0.current,F(A0)}function k0(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 C0(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 _=S;S=b;for(var j=0;j<u.length;j++)if(_.context===u[j]){S.lanes|=h,_=S.alternate,_!==null&&(_.lanes|=h),k0(S.return,h,o),m||(C=null);break e}S=_.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),k0(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 Fs(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 _=b.type;vr(b.pendingProps.value,C.value)||(o!==null?o.push(_):o=[_])}}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(vf):o=[vf])}b=b.return}o!==null&&C0(u,o,h,m),u.flags|=262144}function Fd(o){for(o=o.firstContext;o!==null;){if(!vr(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function yo(o){vo=o,va=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function gn(o){return eE(vo,o)}function qd(o,u){return vo===null&&yo(o),eE(o,u)}function eE(o,u){var h=u._currentValue;if(u={context:u,memoizedValue:h,next:null},va===null){if(o===null)throw Error(r(308));va=u,o.dependencies={lanes:0,firstContext:u},o.flags|=524288}else va=va.next=u;return h}var ZU=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()})}},JU=e.unstable_scheduleCallback,eH=e.unstable_NormalPriority,$t={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function E0(){return{controller:new ZU,data:new Map,refCount:0}}function qc(o){o.refCount--,o.refCount===0&&JU(eH,function(){o.controller.abort()})}var Wc=null,T0=0,qs=0,Ws=null;function tH(o,u){if(Wc===null){var h=Wc=[];T0=0,qs=Db(),Ws={status:"pending",value:void 0,then:function(m){h.push(m)}}}return T0++,u.then(tE,tE),u}function tE(){if(--T0===0&&Wc!==null){Ws!==null&&(Ws.status="fulfilled");var o=Wc;Wc=null,qs=0,Ws=null;for(var u=0;u<o.length;u++)(0,o[u])()}}function nH(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 nE=z.S;z.S=function(o,u){zT=pr(),typeof u=="object"&&u!==null&&typeof u.then=="function"&&tH(o,u),nE!==null&&nE(o,u)};var bo=R(null);function M0(){var o=bo.current;return o!==null?o:ut.pooledCache}function Wd(o,u){u===null?ee(bo,bo.current):ee(bo,u.pool)}function rE(){var o=M0();return o===null?null:{parent:$t._currentValue,pool:o}}var Vs=Error(r(460)),P0=Error(r(474)),Vd=Error(r(542)),Kd={then:function(){}};function iE(o){return o=o.status,o==="fulfilled"||o==="rejected"}function aE(o,u,h){switch(h=o[h],h===void 0?o.push(u):h!==u&&(u.then(da,da),u=h),u.status){case"fulfilled":return u.value;case"rejected":throw o=u.reason,oE(o),o;default:if(typeof u.status=="string")u.then(da,da);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,oE(o),o}throw So=u,Vs}}function xo(o){try{var u=o._init;return u(o._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(So=h,Vs):h}}var So=null;function lE(){if(So===null)throw Error(r(459));var o=So;return So=null,o}function oE(o){if(o===Vs||o===Vd)throw Error(r(483))}var Ks=null,Vc=0;function Qd(o){var u=Vc;return Vc+=1,Ks===null&&(Ks=[]),aE(Ks,o,u)}function Kc(o,u){u=u.props.ref,o.ref=u!==void 0?u:null}function Xd(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 sE(o){function u($,I){if(o){var H=$.deletions;H===null?($.deletions=[I],$.flags|=16):H.push(I)}}function h($,I){if(!o)return null;for(;I!==null;)u($,I),I=I.sibling;return null}function m($){for(var I=new Map;$!==null;)$.key!==null?I.set($.key,$):I.set($.index,$),$=$.sibling;return I}function b($,I){return $=ma($,I),$.index=0,$.sibling=null,$}function S($,I,H){return $.index=H,o?(H=$.alternate,H!==null?(H=H.index,H<I?($.flags|=67108866,I):H):($.flags|=67108866,I)):($.flags|=1048576,I)}function C($){return o&&$.alternate===null&&($.flags|=67108866),$}function _($,I,H,ne){return I===null||I.tag!==6?(I=y0(H,$.mode,ne),I.return=$,I):(I=b(I,H),I.return=$,I)}function j($,I,H,ne){var Ae=H.type;return Ae===x?J($,I,H.props.children,ne,H.key):I!==null&&(I.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===L&&xo(Ae)===I.type)?(I=b(I,H.props),Kc(I,H),I.return=$,I):(I=Ud(H.type,H.key,H.props,null,$.mode,ne),Kc(I,H),I.return=$,I)}function q($,I,H,ne){return I===null||I.tag!==4||I.stateNode.containerInfo!==H.containerInfo||I.stateNode.implementation!==H.implementation?(I=b0(H,$.mode,ne),I.return=$,I):(I=b(I,H.children||[]),I.return=$,I)}function J($,I,H,ne,Ae){return I===null||I.tag!==7?(I=mo(H,$.mode,ne,Ae),I.return=$,I):(I=b(I,H),I.return=$,I)}function re($,I,H){if(typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint")return I=y0(""+I,$.mode,H),I.return=$,I;if(typeof I=="object"&&I!==null){switch(I.$$typeof){case v:return H=Ud(I.type,I.key,I.props,null,$.mode,H),Kc(H,I),H.return=$,H;case y:return I=b0(I,$.mode,H),I.return=$,I;case L:return I=xo(I),re($,I,H)}if(ue(I)||B(I))return I=mo(I,$.mode,H,null),I.return=$,I;if(typeof I.then=="function")return re($,Qd(I),H);if(I.$$typeof===k)return re($,qd($,I),H);Xd($,I)}return null}function X($,I,H,ne){var Ae=I!==null?I.key:null;if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return Ae!==null?null:_($,I,""+H,ne);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case v:return H.key===Ae?j($,I,H,ne):null;case y:return H.key===Ae?q($,I,H,ne):null;case L:return H=xo(H),X($,I,H,ne)}if(ue(H)||B(H))return Ae!==null?null:J($,I,H,ne,null);if(typeof H.then=="function")return X($,I,Qd(H),ne);if(H.$$typeof===k)return X($,I,qd($,H),ne);Xd($,H)}return null}function Y($,I,H,ne,Ae){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return $=$.get(H)||null,_(I,$,""+ne,Ae);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case v:return $=$.get(ne.key===null?H:ne.key)||null,j(I,$,ne,Ae);case y:return $=$.get(ne.key===null?H:ne.key)||null,q(I,$,ne,Ae);case L:return ne=xo(ne),Y($,I,H,ne,Ae)}if(ue(ne)||B(ne))return $=$.get(H)||null,J(I,$,ne,Ae,null);if(typeof ne.then=="function")return Y($,I,H,Qd(ne),Ae);if(ne.$$typeof===k)return Y($,I,H,qd(I,ne),Ae);Xd(I,ne)}return null}function ye($,I,H,ne){for(var Ae=null,Ke=null,Se=I,je=I=0,Ue=null;Se!==null&&je<H.length;je++){Se.index>je?(Ue=Se,Se=null):Ue=Se.sibling;var Qe=X($,Se,H[je],ne);if(Qe===null){Se===null&&(Se=Ue);break}o&&Se&&Qe.alternate===null&&u($,Se),I=S(Qe,I,je),Ke===null?Ae=Qe:Ke.sibling=Qe,Ke=Qe,Se=Ue}if(je===H.length)return h($,Se),He&&ga($,je),Ae;if(Se===null){for(;je<H.length;je++)Se=re($,H[je],ne),Se!==null&&(I=S(Se,I,je),Ke===null?Ae=Se:Ke.sibling=Se,Ke=Se);return He&&ga($,je),Ae}for(Se=m(Se);je<H.length;je++)Ue=Y(Se,$,je,H[je],ne),Ue!==null&&(o&&Ue.alternate!==null&&Se.delete(Ue.key===null?je:Ue.key),I=S(Ue,I,je),Ke===null?Ae=Ue:Ke.sibling=Ue,Ke=Ue);return o&&Se.forEach(function(Dl){return u($,Dl)}),He&&ga($,je),Ae}function Me($,I,H,ne){if(H==null)throw Error(r(151));for(var Ae=null,Ke=null,Se=I,je=I=0,Ue=null,Qe=H.next();Se!==null&&!Qe.done;je++,Qe=H.next()){Se.index>je?(Ue=Se,Se=null):Ue=Se.sibling;var Dl=X($,Se,Qe.value,ne);if(Dl===null){Se===null&&(Se=Ue);break}o&&Se&&Dl.alternate===null&&u($,Se),I=S(Dl,I,je),Ke===null?Ae=Dl:Ke.sibling=Dl,Ke=Dl,Se=Ue}if(Qe.done)return h($,Se),He&&ga($,je),Ae;if(Se===null){for(;!Qe.done;je++,Qe=H.next())Qe=re($,Qe.value,ne),Qe!==null&&(I=S(Qe,I,je),Ke===null?Ae=Qe:Ke.sibling=Qe,Ke=Qe);return He&&ga($,je),Ae}for(Se=m(Se);!Qe.done;je++,Qe=H.next())Qe=Y(Se,$,je,Qe.value,ne),Qe!==null&&(o&&Qe.alternate!==null&&Se.delete(Qe.key===null?je:Qe.key),I=S(Qe,I,je),Ke===null?Ae=Qe:Ke.sibling=Qe,Ke=Qe);return o&&Se.forEach(function(d9){return u($,d9)}),He&&ga($,je),Ae}function at($,I,H,ne){if(typeof H=="object"&&H!==null&&H.type===x&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case v:e:{for(var Ae=H.key;I!==null;){if(I.key===Ae){if(Ae=H.type,Ae===x){if(I.tag===7){h($,I.sibling),ne=b(I,H.props.children),ne.return=$,$=ne;break e}}else if(I.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===L&&xo(Ae)===I.type){h($,I.sibling),ne=b(I,H.props),Kc(ne,H),ne.return=$,$=ne;break e}h($,I);break}else u($,I);I=I.sibling}H.type===x?(ne=mo(H.props.children,$.mode,ne,H.key),ne.return=$,$=ne):(ne=Ud(H.type,H.key,H.props,null,$.mode,ne),Kc(ne,H),ne.return=$,$=ne)}return C($);case y:e:{for(Ae=H.key;I!==null;){if(I.key===Ae)if(I.tag===4&&I.stateNode.containerInfo===H.containerInfo&&I.stateNode.implementation===H.implementation){h($,I.sibling),ne=b(I,H.children||[]),ne.return=$,$=ne;break e}else{h($,I);break}else u($,I);I=I.sibling}ne=b0(H,$.mode,ne),ne.return=$,$=ne}return C($);case L:return H=xo(H),at($,I,H,ne)}if(ue(H))return ye($,I,H,ne);if(B(H)){if(Ae=B(H),typeof Ae!="function")throw Error(r(150));return H=Ae.call(H),Me($,I,H,ne)}if(typeof H.then=="function")return at($,I,Qd(H),ne);if(H.$$typeof===k)return at($,I,qd($,H),ne);Xd($,H)}return typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint"?(H=""+H,I!==null&&I.tag===6?(h($,I.sibling),ne=b(I,H),ne.return=$,$=ne):(h($,I),ne=y0(H,$.mode,ne),ne.return=$,$=ne),C($)):h($,I)}return function($,I,H,ne){try{Vc=0;var Ae=at($,I,H,ne);return Ks=null,Ae}catch(Se){if(Se===Vs||Se===Vd)throw Se;var Ke=yr(29,Se,null,$.mode);return Ke.lanes=ne,Ke.return=$,Ke}}}var wo=sE(!0),uE=sE(!1),pl=!1;function D0(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function _0(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 ml(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function gl(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=$d(o),VC(o,null,h),u}return zd(o,m,u,h),$d(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,eC(o,h)}}function N0(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 R0=!1;function Xc(){if(R0){var o=Ws;if(o!==null)throw o}}function Yc(o,u,h,m){R0=!1;var b=o.updateQueue;pl=!1;var S=b.firstBaseUpdate,C=b.lastBaseUpdate,_=b.shared.pending;if(_!==null){b.shared.pending=null;var j=_,q=j.next;j.next=null,C===null?S=q:C.next=q,C=j;var J=o.alternate;J!==null&&(J=J.updateQueue,_=J.lastBaseUpdate,_!==C&&(_===null?J.firstBaseUpdate=q:_.next=q,J.lastBaseUpdate=j))}if(S!==null){var re=b.baseState;C=0,J=q=j=null,_=S;do{var X=_.lane&-536870913,Y=X!==_.lane;if(Y?($e&X)===X:(m&X)===X){X!==0&&X===qs&&(R0=!0),J!==null&&(J=J.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var ye=o,Me=_;X=u;var at=h;switch(Me.tag){case 1:if(ye=Me.payload,typeof ye=="function"){re=ye.call(at,re,X);break e}re=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=Me.payload,X=typeof ye=="function"?ye.call(at,re,X):ye,X==null)break e;re=p({},re,X);break e;case 2:pl=!0}}X=_.callback,X!==null&&(o.flags|=64,Y&&(o.flags|=8192),Y=b.callbacks,Y===null?b.callbacks=[X]:Y.push(X))}else Y={lane:X,tag:_.tag,payload:_.payload,callback:_.callback,next:null},J===null?(q=J=Y,j=re):J=J.next=Y,C|=X;if(_=_.next,_===null){if(_=b.shared.pending,_===null)break;Y=_,_=Y.next,Y.next=null,b.lastBaseUpdate=Y,b.shared.pending=null}}while(!0);J===null&&(j=re),b.baseState=j,b.firstBaseUpdate=q,b.lastBaseUpdate=J,S===null&&(b.shared.lanes=0),Sl|=C,o.lanes=C,o.memoizedState=re}}function cE(o,u){if(typeof o!="function")throw Error(r(191,o));o.call(u)}function fE(o,u){var h=o.callbacks;if(h!==null)for(o.callbacks=null,o=0;o<h.length;o++)cE(h[o],u)}var Qs=R(null),Yd=R(0);function hE(o,u){o=Ea,ee(Yd,o),ee(Qs,u),Ea=o|u.baseLanes}function j0(){ee(Yd,Ea),ee(Qs,Qs.current)}function L0(){Ea=Yd.current,F(Qs),F(Yd)}var br=R(null),Hr=null;function vl(o){var u=o.alternate;ee(jt,jt.current&1),ee(br,o),Hr===null&&(u===null||Qs.current!==null||u.memoizedState!==null)&&(Hr=o)}function I0(o){ee(jt,jt.current),ee(br,o),Hr===null&&(Hr=o)}function dE(o){o.tag===22?(ee(jt,jt.current),ee(br,o),Hr===null&&(Hr=o)):yl()}function yl(){ee(jt,jt.current),ee(br,br.current)}function xr(o){F(br),Hr===o&&(Hr=null),F(jt)}var jt=R(0);function Gd(o){for(var u=o;u!==null;){if(u.tag===13){var h=u.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||Fb(h)||qb(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 ba=0,Re=null,rt=null,Ut=null,Zd=!1,Xs=!1,Oo=!1,Jd=0,Gc=0,Ys=null,rH=0;function Tt(){throw Error(r(321))}function B0(o,u){if(u===null)return!1;for(var h=0;h<u.length&&h<o.length;h++)if(!vr(o[h],u[h]))return!1;return!0}function z0(o,u,h,m,b,S){return ba=S,Re=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,z.H=o===null||o.memoizedState===null?YE:eb,Oo=!1,S=h(m,b),Oo=!1,Xs&&(S=mE(u,h,m,b)),pE(o),S}function pE(o){z.H=ef;var u=rt!==null&&rt.next!==null;if(ba=0,Ut=rt=Re=null,Zd=!1,Gc=0,Ys=null,u)throw Error(r(300));o===null||Ht||(o=o.dependencies,o!==null&&Fd(o)&&(Ht=!0))}function mE(o,u,h,m){Re=o;var b=0;do{if(Xs&&(Ys=null),Gc=0,Xs=!1,25<=b)throw Error(r(301));if(b+=1,Ut=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=GE,S=u(h,m)}while(Xs);return S}function iH(){var o=z.H,u=o.useState()[0];return u=typeof u.then=="function"?Zc(u):u,o=o.useState()[0],(rt!==null?rt.memoizedState:null)!==o&&(Re.flags|=1024),u}function $0(){var o=Jd!==0;return Jd=0,o}function U0(o,u,h){u.updateQueue=o.updateQueue,u.flags&=-2053,o.lanes&=~h}function H0(o){if(Zd){for(o=o.memoizedState;o!==null;){var u=o.queue;u!==null&&(u.pending=null),o=o.next}Zd=!1}ba=0,Ut=rt=Re=null,Xs=!1,Gc=Jd=0,Ys=null}function Un(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ut===null?Re.memoizedState=Ut=o:Ut=Ut.next=o,Ut}function Lt(){if(rt===null){var o=Re.alternate;o=o!==null?o.memoizedState:null}else o=rt.next;var u=Ut===null?Re.memoizedState:Ut.next;if(u!==null)Ut=u,rt=o;else{if(o===null)throw Re.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},Ut===null?Re.memoizedState=Ut=o:Ut=Ut.next=o}return Ut}function ep(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Zc(o){var u=Gc;return Gc+=1,Ys===null&&(Ys=[]),o=aE(Ys,o,u),u=Re,(Ut===null?u.memoizedState:Ut.next)===null&&(u=u.alternate,z.H=u===null||u.memoizedState===null?YE:eb),o}function tp(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return Zc(o);if(o.$$typeof===k)return gn(o)}throw Error(r(438,String(o)))}function F0(o){var u=null,h=Re.updateQueue;if(h!==null&&(u=h.memoCache),u==null){var m=Re.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=ep(),Re.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 xa(o,u){return typeof u=="function"?u(o):u}function np(o){var u=Lt();return q0(u,rt,o)}function q0(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 _=C=null,j=null,q=u,J=!1;do{var re=q.lane&-536870913;if(re!==q.lane?($e&re)===re:(ba&re)===re){var X=q.revertLane;if(X===0)j!==null&&(j=j.next={lane:0,revertLane:0,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null}),re===qs&&(J=!0);else if((ba&X)===X){q=q.next,X===qs&&(J=!0);continue}else re={lane:0,revertLane:q.revertLane,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},j===null?(_=j=re,C=S):j=j.next=re,Re.lanes|=X,Sl|=X;re=q.action,Oo&&h(S,re),S=q.hasEagerState?q.eagerState:h(S,re)}else X={lane:re,revertLane:q.revertLane,gesture:q.gesture,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},j===null?(_=j=X,C=S):j=j.next=X,Re.lanes|=re,Sl|=re;q=q.next}while(q!==null&&q!==u);if(j===null?C=S:j.next=_,!vr(S,o.memoizedState)&&(Ht=!0,J&&(h=Ws,h!==null)))throw h;o.memoizedState=S,o.baseState=C,o.baseQueue=j,m.lastRenderedState=S}return b===null&&(m.lanes=0),[o.memoizedState,m.dispatch]}function W0(o){var u=Lt(),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);vr(S,u.memoizedState)||(Ht=!0),u.memoizedState=S,u.baseQueue===null&&(u.baseState=S),h.lastRenderedState=S}return[S,m]}function gE(o,u,h){var m=Re,b=Lt(),S=He;if(S){if(h===void 0)throw Error(r(407));h=h()}else h=u();var C=!vr((rt||b).memoizedState,h);if(C&&(b.memoizedState=h,Ht=!0),b=b.queue,Q0(bE.bind(null,m,b,o),[o]),b.getSnapshot!==u||C||Ut!==null&&Ut.memoizedState.tag&1){if(m.flags|=2048,Gs(9,{destroy:void 0},yE.bind(null,m,b,h,u),null),ut===null)throw Error(r(349));S||(ba&127)!==0||vE(m,u,h)}return h}function vE(o,u,h){o.flags|=16384,o={getSnapshot:u,value:h},u=Re.updateQueue,u===null?(u=ep(),Re.updateQueue=u,u.stores=[o]):(h=u.stores,h===null?u.stores=[o]:h.push(o))}function yE(o,u,h,m){u.value=h,u.getSnapshot=m,xE(u)&&SE(o)}function bE(o,u,h){return h(function(){xE(u)&&SE(o)})}function xE(o){var u=o.getSnapshot;o=o.value;try{var h=u();return!vr(o,h)}catch{return!0}}function SE(o){var u=po(o,2);u!==null&&ir(u,o,2)}function V0(o){var u=Un();if(typeof o=="function"){var h=o;if(o=h(),Oo){ol(!0);try{h()}finally{ol(!1)}}}return u.memoizedState=u.baseState=o,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xa,lastRenderedState:o},u}function wE(o,u,h,m){return o.baseState=h,q0(o,rt,typeof m=="function"?m:xa)}function aH(o,u,h,m,b){if(ap(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,OE(u,S)):(S.next=h.next,u.pending=h.next=S)}}function OE(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 _=h(b,m),j=z.S;j!==null&&j(C,_),AE(o,u,_)}catch(q){K0(o,u,q)}finally{S!==null&&C.types!==null&&(S.types=C.types),z.T=S}}else try{S=h(b,m),AE(o,u,S)}catch(q){K0(o,u,q)}}function AE(o,u,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(m){kE(o,u,m)},function(m){return K0(o,u,m)}):kE(o,u,h)}function kE(o,u,h){u.status="fulfilled",u.value=h,CE(u),o.state=h,u=o.pending,u!==null&&(h=u.next,h===u?o.pending=null:(h=h.next,u.next=h,OE(o,h)))}function K0(o,u,h){var m=o.pending;if(o.pending=null,m!==null){m=m.next;do u.status="rejected",u.reason=h,CE(u),u=u.next;while(u!==m)}o.action=null}function CE(o){o=o.listeners;for(var u=0;u<o.length;u++)(0,o[u])()}function EE(o,u){return u}function TE(o,u){if(He){var h=ut.formState;if(h!==null){e:{var m=Re;if(He){if(vt){t:{for(var b=vt,S=Ur;b.nodeType!==8;){if(!S){b=null;break t}if(b=Fr(b.nextSibling),b===null){b=null;break t}}S=b.data,b=S==="F!"||S==="F"?b:null}if(b){vt=Fr(b.nextSibling),m=b.data==="F!";break e}}hl(m)}m=!1}m&&(u=h[0])}}return h=Un(),h.memoizedState=h.baseState=u,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:EE,lastRenderedState:u},h.queue=m,h=KE.bind(null,Re,m),m.dispatch=h,m=V0(!1),S=J0.bind(null,Re,!1,m.queue),m=Un(),b={state:u,dispatch:null,action:o,pending:null},m.queue=b,h=aH.bind(null,Re,b,S,h),b.dispatch=h,m.memoizedState=o,[u,h,!1]}function ME(o){var u=Lt();return PE(u,rt,o)}function PE(o,u,h){if(u=q0(o,u,EE)[0],o=np(xa)[0],typeof u=="object"&&u!==null&&typeof u.then=="function")try{var m=Zc(u)}catch(C){throw C===Vs?Vd:C}else m=u;u=Lt();var b=u.queue,S=b.dispatch;return h!==u.memoizedState&&(Re.flags|=2048,Gs(9,{destroy:void 0},lH.bind(null,b,h),null)),[m,S,o]}function lH(o,u){o.action=u}function DE(o){var u=Lt(),h=rt;if(h!==null)return PE(u,h,o);Lt(),u=u.memoizedState,h=Lt();var m=h.queue.dispatch;return h.memoizedState=o,[u,m,!1]}function Gs(o,u,h,m){return o={tag:o,create:h,deps:m,inst:u,next:null},u=Re.updateQueue,u===null&&(u=ep(),Re.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 _E(){return Lt().memoizedState}function rp(o,u,h,m){var b=Un();Re.flags|=o,b.memoizedState=Gs(1|u,{destroy:void 0},h,m===void 0?null:m)}function ip(o,u,h,m){var b=Lt();m=m===void 0?null:m;var S=b.memoizedState.inst;rt!==null&&m!==null&&B0(m,rt.memoizedState.deps)?b.memoizedState=Gs(u,S,h,m):(Re.flags|=o,b.memoizedState=Gs(1|u,S,h,m))}function NE(o,u){rp(8390656,8,o,u)}function Q0(o,u){ip(2048,8,o,u)}function oH(o){Re.flags|=4;var u=Re.updateQueue;if(u===null)u=ep(),Re.updateQueue=u,u.events=[o];else{var h=u.events;h===null?u.events=[o]:h.push(o)}}function RE(o){var u=Lt().memoizedState;return oH({ref:u,nextImpl:o}),function(){if((Ze&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}function jE(o,u){return ip(4,2,o,u)}function LE(o,u){return ip(4,4,o,u)}function IE(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 BE(o,u,h){h=h!=null?h.concat([o]):null,ip(4,4,IE.bind(null,u,o),h)}function X0(){}function zE(o,u){var h=Lt();u=u===void 0?null:u;var m=h.memoizedState;return u!==null&&B0(u,m[1])?m[0]:(h.memoizedState=[o,u],o)}function $E(o,u){var h=Lt();u=u===void 0?null:u;var m=h.memoizedState;if(u!==null&&B0(u,m[1]))return m[0];if(m=o(),Oo){ol(!0);try{o()}finally{ol(!1)}}return h.memoizedState=[m,u],m}function Y0(o,u,h){return h===void 0||(ba&1073741824)!==0&&($e&261930)===0?o.memoizedState=u:(o.memoizedState=h,o=UT(),Re.lanes|=o,Sl|=o,h)}function UE(o,u,h,m){return vr(h,u)?h:Qs.current!==null?(o=Y0(o,h,m),vr(o,u)||(Ht=!0),o):(ba&42)===0||(ba&1073741824)!==0&&($e&261930)===0?(Ht=!0,o.memoizedState=h):(o=UT(),Re.lanes|=o,Sl|=o,u)}function HE(o,u,h,m,b){var S=Z.p;Z.p=S!==0&&8>S?S:8;var C=z.T,_={};z.T=_,J0(o,!1,u,h);try{var j=b(),q=z.S;if(q!==null&&q(_,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var J=nH(j,m);Jc(o,u,J,Or(o))}else Jc(o,u,m,Or(o))}catch(re){Jc(o,u,{then:function(){},status:"rejected",reason:re},Or())}finally{Z.p=S,C!==null&&_.types!==null&&(C.types=_.types),z.T=C}}function sH(){}function G0(o,u,h,m){if(o.tag!==5)throw Error(r(476));var b=FE(o).queue;HE(o,b,u,ae,h===null?sH:function(){return qE(o),h(m)})}function FE(o){var u=o.memoizedState;if(u!==null)return u;u={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xa,lastRenderedState:ae},next:null};var h={};return u.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xa,lastRenderedState:h},next:null},o.memoizedState=u,o=o.alternate,o!==null&&(o.memoizedState=u),u}function qE(o){var u=FE(o);u.next===null&&(u=o.alternate.memoizedState),Jc(o,u.next.queue,{},Or())}function Z0(){return gn(vf)}function WE(){return Lt().memoizedState}function VE(){return Lt().memoizedState}function uH(o){for(var u=o.return;u!==null;){switch(u.tag){case 24:case 3:var h=Or();o=ml(h);var m=gl(u,o,h);m!==null&&(ir(m,u,h),Qc(m,u,h)),u={cache:E0()},o.payload=u;return}u=u.return}}function cH(o,u,h){var m=Or();h={lane:m,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},ap(o)?QE(u,h):(h=g0(o,u,h,m),h!==null&&(ir(h,o,m),XE(h,u,m)))}function KE(o,u,h){var m=Or();Jc(o,u,h,m)}function Jc(o,u,h,m){var b={lane:m,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(ap(o))QE(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,_=S(C,h);if(b.hasEagerState=!0,b.eagerState=_,vr(_,C))return zd(o,u,b,0),ut===null&&Bd(),!1}catch{}if(h=g0(o,u,b,m),h!==null)return ir(h,o,m),XE(h,u,m),!0}return!1}function J0(o,u,h,m){if(m={lane:2,revertLane:Db(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},ap(o)){if(u)throw Error(r(479))}else u=g0(o,h,m,2),u!==null&&ir(u,o,2)}function ap(o){var u=o.alternate;return o===Re||u!==null&&u===Re}function QE(o,u){Xs=Zd=!0;var h=o.pending;h===null?u.next=u:(u.next=h.next,h.next=u),o.pending=u}function XE(o,u,h){if((h&4194048)!==0){var m=u.lanes;m&=o.pendingLanes,h|=m,u.lanes=h,eC(o,h)}}var ef={readContext:gn,use:tp,useCallback:Tt,useContext:Tt,useEffect:Tt,useImperativeHandle:Tt,useLayoutEffect:Tt,useInsertionEffect:Tt,useMemo:Tt,useReducer:Tt,useRef:Tt,useState:Tt,useDebugValue:Tt,useDeferredValue:Tt,useTransition:Tt,useSyncExternalStore:Tt,useId:Tt,useHostTransitionStatus:Tt,useFormState:Tt,useActionState:Tt,useOptimistic:Tt,useMemoCache:Tt,useCacheRefresh:Tt};ef.useEffectEvent=Tt;var YE={readContext:gn,use:tp,useCallback:function(o,u){return Un().memoizedState=[o,u===void 0?null:u],o},useContext:gn,useEffect:NE,useImperativeHandle:function(o,u,h){h=h!=null?h.concat([o]):null,rp(4194308,4,IE.bind(null,u,o),h)},useLayoutEffect:function(o,u){return rp(4194308,4,o,u)},useInsertionEffect:function(o,u){rp(4,2,o,u)},useMemo:function(o,u){var h=Un();u=u===void 0?null:u;var m=o();if(Oo){ol(!0);try{o()}finally{ol(!1)}}return h.memoizedState=[m,u],m},useReducer:function(o,u,h){var m=Un();if(h!==void 0){var b=h(u);if(Oo){ol(!0);try{h(u)}finally{ol(!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=cH.bind(null,Re,o),[m.memoizedState,o]},useRef:function(o){var u=Un();return o={current:o},u.memoizedState=o},useState:function(o){o=V0(o);var u=o.queue,h=KE.bind(null,Re,u);return u.dispatch=h,[o.memoizedState,h]},useDebugValue:X0,useDeferredValue:function(o,u){var h=Un();return Y0(h,o,u)},useTransition:function(){var o=V0(!1);return o=HE.bind(null,Re,o.queue,!0,!1),Un().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,u,h){var m=Re,b=Un();if(He){if(h===void 0)throw Error(r(407));h=h()}else{if(h=u(),ut===null)throw Error(r(349));($e&127)!==0||vE(m,u,h)}b.memoizedState=h;var S={value:h,getSnapshot:u};return b.queue=S,NE(bE.bind(null,m,S,o),[o]),m.flags|=2048,Gs(9,{destroy:void 0},yE.bind(null,m,S,h,u),null),h},useId:function(){var o=Un(),u=ut.identifierPrefix;if(He){var h=Pi,m=Mi;h=(m&~(1<<32-gr(m)-1)).toString(32)+h,u="_"+u+"R_"+h,h=Jd++,0<h&&(u+="H"+h.toString(32)),u+="_"}else h=rH++,u="_"+u+"r_"+h.toString(32)+"_";return o.memoizedState=u},useHostTransitionStatus:Z0,useFormState:TE,useActionState:TE,useOptimistic:function(o){var u=Un();u.memoizedState=u.baseState=o;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return u.queue=h,u=J0.bind(null,Re,!0,h),h.dispatch=u,[o,u]},useMemoCache:F0,useCacheRefresh:function(){return Un().memoizedState=uH.bind(null,Re)},useEffectEvent:function(o){var u=Un(),h={impl:o};return u.memoizedState=h,function(){if((Ze&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},eb={readContext:gn,use:tp,useCallback:zE,useContext:gn,useEffect:Q0,useImperativeHandle:BE,useInsertionEffect:jE,useLayoutEffect:LE,useMemo:$E,useReducer:np,useRef:_E,useState:function(){return np(xa)},useDebugValue:X0,useDeferredValue:function(o,u){var h=Lt();return UE(h,rt.memoizedState,o,u)},useTransition:function(){var o=np(xa)[0],u=Lt().memoizedState;return[typeof o=="boolean"?o:Zc(o),u]},useSyncExternalStore:gE,useId:WE,useHostTransitionStatus:Z0,useFormState:ME,useActionState:ME,useOptimistic:function(o,u){var h=Lt();return wE(h,rt,o,u)},useMemoCache:F0,useCacheRefresh:VE};eb.useEffectEvent=RE;var GE={readContext:gn,use:tp,useCallback:zE,useContext:gn,useEffect:Q0,useImperativeHandle:BE,useInsertionEffect:jE,useLayoutEffect:LE,useMemo:$E,useReducer:W0,useRef:_E,useState:function(){return W0(xa)},useDebugValue:X0,useDeferredValue:function(o,u){var h=Lt();return rt===null?Y0(h,o,u):UE(h,rt.memoizedState,o,u)},useTransition:function(){var o=W0(xa)[0],u=Lt().memoizedState;return[typeof o=="boolean"?o:Zc(o),u]},useSyncExternalStore:gE,useId:WE,useHostTransitionStatus:Z0,useFormState:DE,useActionState:DE,useOptimistic:function(o,u){var h=Lt();return rt!==null?wE(h,rt,o,u):(h.baseState=o,[o,h.queue.dispatch])},useMemoCache:F0,useCacheRefresh:VE};GE.useEffectEvent=RE;function tb(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 nb={enqueueSetState:function(o,u,h){o=o._reactInternals;var m=Or(),b=ml(m);b.payload=u,h!=null&&(b.callback=h),u=gl(o,b,m),u!==null&&(ir(u,o,m),Qc(u,o,m))},enqueueReplaceState:function(o,u,h){o=o._reactInternals;var m=Or(),b=ml(m);b.tag=1,b.payload=u,h!=null&&(b.callback=h),u=gl(o,b,m),u!==null&&(ir(u,o,m),Qc(u,o,m))},enqueueForceUpdate:function(o,u){o=o._reactInternals;var h=Or(),m=ml(h);m.tag=2,u!=null&&(m.callback=u),u=gl(o,m,h),u!==null&&(ir(u,o,h),Qc(u,o,h))}};function ZE(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?!$c(h,m)||!$c(b,S):!0}function JE(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&&nb.enqueueReplaceState(u,u.state,null)}function Ao(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 eT(o){Id(o)}function tT(o){console.error(o)}function nT(o){Id(o)}function lp(o,u){try{var h=o.onUncaughtError;h(u.value,{componentStack:u.stack})}catch(m){setTimeout(function(){throw m})}}function rT(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 rb(o,u,h){return h=ml(h),h.tag=3,h.payload={element:null},h.callback=function(){lp(o,u)},h}function iT(o){return o=ml(o),o.tag=3,o}function aT(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(){rT(u,h,m)}}var C=h.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(o.callback=function(){rT(u,h,m),typeof b!="function"&&(wl===null?wl=new Set([this]):wl.add(this));var _=m.stack;this.componentDidCatch(m.value,{componentStack:_!==null?_:""})})}function fH(o,u,h,m,b){if(h.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(u=h.alternate,u!==null&&Fs(u,h,b,!0),h=br.current,h!==null){switch(h.tag){case 31:case 13:return Hr===null?yp():h.alternate===null&&Mt===0&&(Mt=3),h.flags&=-257,h.flags|=65536,h.lanes=b,m===Kd?h.flags|=16384:(u=h.updateQueue,u===null?h.updateQueue=new Set([m]):u.add(m),Tb(o,m,b)),!1;case 22:return h.flags|=65536,m===Kd?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)),Tb(o,m,b)),!1}throw Error(r(435,h.tag))}return Tb(o,m,b),yp(),!1}if(He)return u=br.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=b,m!==w0&&(o=Error(r(422),{cause:m}),Fc(Br(o,h)))):(m!==w0&&(u=Error(r(423),{cause:m}),Fc(Br(u,h))),o=o.current.alternate,o.flags|=65536,b&=-b,o.lanes|=b,m=Br(m,h),b=rb(o.stateNode,m,b),N0(o,b),Mt!==4&&(Mt=2)),!1;var S=Error(r(520),{cause:m});if(S=Br(S,h),uf===null?uf=[S]:uf.push(S),Mt!==4&&(Mt=2),u===null)return!0;m=Br(m,h),h=u;do{switch(h.tag){case 3:return h.flags|=65536,o=b&-b,h.lanes|=o,o=rb(h.stateNode,m,o),N0(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"&&(wl===null||!wl.has(S))))return h.flags|=65536,b&=-b,h.lanes|=b,b=iT(b),aT(b,o,h,m),N0(h,b),!1}h=h.return}while(h!==null);return!1}var ib=Error(r(461)),Ht=!1;function vn(o,u,h,m){u.child=o===null?uE(u,null,h,m):wo(u,o.child,h,m)}function lT(o,u,h,m,b){h=h.render;var S=u.ref;if("ref"in m){var C={};for(var _ in m)_!=="ref"&&(C[_]=m[_])}else C=m;return yo(u),m=z0(o,u,h,C,S,b),_=$0(),o!==null&&!Ht?(U0(o,u,b),Sa(o,u,b)):(He&&_&&x0(u),u.flags|=1,vn(o,u,m,b),u.child)}function oT(o,u,h,m,b){if(o===null){var S=h.type;return typeof S=="function"&&!v0(S)&&S.defaultProps===void 0&&h.compare===null?(u.tag=15,u.type=S,sT(o,u,S,m,b)):(o=Ud(h.type,null,m,u,u.mode,b),o.ref=u.ref,o.return=u,u.child=o)}if(S=o.child,!hb(o,b)){var C=S.memoizedProps;if(h=h.compare,h=h!==null?h:$c,h(C,m)&&o.ref===u.ref)return Sa(o,u,b)}return u.flags|=1,o=ma(S,m),o.ref=u.ref,o.return=u,u.child=o}function sT(o,u,h,m,b){if(o!==null){var S=o.memoizedProps;if($c(S,m)&&o.ref===u.ref)if(Ht=!1,u.pendingProps=m=S,hb(o,b))(o.flags&131072)!==0&&(Ht=!0);else return u.lanes=o.lanes,Sa(o,u,b)}return ab(o,u,h,m,b)}function uT(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 cT(o,u,S,h,m)}if((h&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},o!==null&&Wd(u,S!==null?S.cachePool:null),S!==null?hE(u,S):j0(),dE(u);else return m=u.lanes=536870912,cT(o,u,S!==null?S.baseLanes|h:h,h,m)}else S!==null?(Wd(u,S.cachePool),hE(u,S),yl(),u.memoizedState=null):(o!==null&&Wd(u,null),j0(),yl());return vn(o,u,b,h),u.child}function tf(o,u){return o!==null&&o.tag===22||u.stateNode!==null||(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.sibling}function cT(o,u,h,m,b){var S=M0();return S=S===null?null:{parent:$t._currentValue,pool:S},u.memoizedState={baseLanes:h,cachePool:S},o!==null&&Wd(u,null),j0(),dE(u),o!==null&&Fs(o,u,m,!0),u.childLanes=b,null}function op(o,u){return u=up({mode:u.mode,children:u.children},o.mode),u.ref=o.ref,o.child=u,u.return=o,u}function fT(o,u,h){return wo(u,o.child,null,h),o=op(u,u.pendingProps),o.flags|=2,xr(u),u.memoizedState=null,o}function hH(o,u,h){var m=u.pendingProps,b=(u.flags&128)!==0;if(u.flags&=-129,o===null){if(He){if(m.mode==="hidden")return o=op(u,m),u.lanes=536870912,tf(null,o);if(I0(u),(o=vt)?(o=O2(o,Ur),o=o!==null&&o.data==="&"?o:null,o!==null&&(u.memoizedState={dehydrated:o,treeContext:cl!==null?{id:Mi,overflow:Pi}:null,retryLane:536870912,hydrationErrors:null},h=QC(o),h.return=u,u.child=h,mn=u,vt=null)):o=null,o===null)throw hl(u);return u.lanes=536870912,null}return op(u,m)}var S=o.memoizedState;if(S!==null){var C=S.dehydrated;if(I0(u),b)if(u.flags&256)u.flags&=-257,u=fT(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||Fs(o,u,h,!1),b=(h&o.childLanes)!==0,Ht||b){if(m=ut,m!==null&&(C=tC(m,h),C!==0&&C!==S.retryLane))throw S.retryLane=C,po(o,C),ir(m,o,C),ib;yp(),u=fT(o,u,h)}else o=S.treeContext,vt=Fr(C.nextSibling),mn=u,He=!0,fl=null,Ur=!1,o!==null&&GC(u,o),u=op(u,m),u.flags|=4096;return u}return o=ma(o.child,{mode:m.mode,children:m.children}),o.ref=u.ref,u.child=o,o.return=u,o}function sp(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 ab(o,u,h,m,b){return yo(u),h=z0(o,u,h,m,void 0,b),m=$0(),o!==null&&!Ht?(U0(o,u,b),Sa(o,u,b)):(He&&m&&x0(u),u.flags|=1,vn(o,u,h,b),u.child)}function hT(o,u,h,m,b,S){return yo(u),u.updateQueue=null,h=mE(u,m,h,b),pE(o),m=$0(),o!==null&&!Ht?(U0(o,u,S),Sa(o,u,S)):(He&&m&&x0(u),u.flags|=1,vn(o,u,h,S),u.child)}function dT(o,u,h,m,b){if(yo(u),u.stateNode===null){var S=zs,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=nb,u.stateNode=S,S._reactInternals=u,S=u.stateNode,S.props=m,S.state=u.memoizedState,S.refs={},D0(u),C=h.contextType,S.context=typeof C=="object"&&C!==null?gn(C):zs,S.state=u.memoizedState,C=h.getDerivedStateFromProps,typeof C=="function"&&(tb(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&&nb.enqueueReplaceState(S,S.state,null),Yc(u,m,S,b),Xc(),S.state=u.memoizedState),typeof S.componentDidMount=="function"&&(u.flags|=4194308),m=!0}else if(o===null){S=u.stateNode;var _=u.memoizedProps,j=Ao(h,_);S.props=j;var q=S.context,J=h.contextType;C=zs,typeof J=="object"&&J!==null&&(C=gn(J));var re=h.getDerivedStateFromProps;J=typeof re=="function"||typeof S.getSnapshotBeforeUpdate=="function",_=u.pendingProps!==_,J||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(_||q!==C)&&JE(u,S,m,C),pl=!1;var X=u.memoizedState;S.state=X,Yc(u,m,S,b),Xc(),q=u.memoizedState,_||X!==q||pl?(typeof re=="function"&&(tb(u,h,re,m),q=u.memoizedState),(j=pl||ZE(u,h,j,m,X,q,C))?(J||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=q),S.props=m,S.state=q,S.context=C,m=j):(typeof S.componentDidMount=="function"&&(u.flags|=4194308),m=!1)}else{S=u.stateNode,_0(o,u),C=u.memoizedProps,J=Ao(h,C),S.props=J,re=u.pendingProps,X=S.context,q=h.contextType,j=zs,typeof q=="object"&&q!==null&&(j=gn(q)),_=h.getDerivedStateFromProps,(q=typeof _=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(C!==re||X!==j)&&JE(u,S,m,j),pl=!1,X=u.memoizedState,S.state=X,Yc(u,m,S,b),Xc();var Y=u.memoizedState;C!==re||X!==Y||pl||o!==null&&o.dependencies!==null&&Fd(o.dependencies)?(typeof _=="function"&&(tb(u,h,_,m),Y=u.memoizedState),(J=pl||ZE(u,h,J,m,X,Y,j)||o!==null&&o.dependencies!==null&&Fd(o.dependencies))?(q||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(m,Y,j),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(m,Y,j)),typeof S.componentDidUpdate=="function"&&(u.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof S.componentDidUpdate!="function"||C===o.memoizedProps&&X===o.memoizedState||(u.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||C===o.memoizedProps&&X===o.memoizedState||(u.flags|=1024),u.memoizedProps=m,u.memoizedState=Y),S.props=m,S.state=Y,S.context=j,m=J):(typeof S.componentDidUpdate!="function"||C===o.memoizedProps&&X===o.memoizedState||(u.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||C===o.memoizedProps&&X===o.memoizedState||(u.flags|=1024),m=!1)}return S=m,sp(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=wo(u,o.child,null,b),u.child=wo(u,null,h,b)):vn(o,u,h,b),u.memoizedState=S.state,o=u.child):o=Sa(o,u,b),o}function pT(o,u,h,m){return go(),u.flags|=256,vn(o,u,h,m),u.child}var lb={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ob(o){return{baseLanes:o,cachePool:rE()}}function sb(o,u,h){return o=o!==null?o.childLanes&~h:0,u&&(o|=wr),o}function mT(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:(jt.current&2)!==0),C&&(b=!0,u.flags&=-129),C=(u.flags&32)!==0,u.flags&=-33,o===null){if(He){if(b?vl(u):yl(),(o=vt)?(o=O2(o,Ur),o=o!==null&&o.data!=="&"?o:null,o!==null&&(u.memoizedState={dehydrated:o,treeContext:cl!==null?{id:Mi,overflow:Pi}:null,retryLane:536870912,hydrationErrors:null},h=QC(o),h.return=u,u.child=h,mn=u,vt=null)):o=null,o===null)throw hl(u);return qb(o)?u.lanes=32:u.lanes=536870912,null}var _=m.children;return m=m.fallback,b?(yl(),b=u.mode,_=up({mode:"hidden",children:_},b),m=mo(m,b,h,null),_.return=u,m.return=u,_.sibling=m,u.child=_,m=u.child,m.memoizedState=ob(h),m.childLanes=sb(o,C,h),u.memoizedState=lb,tf(null,m)):(vl(u),ub(u,_))}var j=o.memoizedState;if(j!==null&&(_=j.dehydrated,_!==null)){if(S)u.flags&256?(vl(u),u.flags&=-257,u=cb(o,u,h)):u.memoizedState!==null?(yl(),u.child=o.child,u.flags|=128,u=null):(yl(),_=m.fallback,b=u.mode,m=up({mode:"visible",children:m.children},b),_=mo(_,b,h,null),_.flags|=2,m.return=u,_.return=u,m.sibling=_,u.child=m,wo(u,o.child,null,h),m=u.child,m.memoizedState=ob(h),m.childLanes=sb(o,C,h),u.memoizedState=lb,u=tf(null,m));else if(vl(u),qb(_)){if(C=_.nextSibling&&_.nextSibling.dataset,C)var q=C.dgst;C=q,m=Error(r(419)),m.stack="",m.digest=C,Fc({value:m,source:null,stack:null}),u=cb(o,u,h)}else if(Ht||Fs(o,u,h,!1),C=(h&o.childLanes)!==0,Ht||C){if(C=ut,C!==null&&(m=tC(C,h),m!==0&&m!==j.retryLane))throw j.retryLane=m,po(o,m),ir(C,o,m),ib;Fb(_)||yp(),u=cb(o,u,h)}else Fb(_)?(u.flags|=192,u.child=o.child,u=null):(o=j.treeContext,vt=Fr(_.nextSibling),mn=u,He=!0,fl=null,Ur=!1,o!==null&&GC(u,o),u=ub(u,m.children),u.flags|=4096);return u}return b?(yl(),_=m.fallback,b=u.mode,j=o.child,q=j.sibling,m=ma(j,{mode:"hidden",children:m.children}),m.subtreeFlags=j.subtreeFlags&65011712,q!==null?_=ma(q,_):(_=mo(_,b,h,null),_.flags|=2),_.return=u,m.return=u,m.sibling=_,u.child=m,tf(null,m),m=u.child,_=o.child.memoizedState,_===null?_=ob(h):(b=_.cachePool,b!==null?(j=$t._currentValue,b=b.parent!==j?{parent:j,pool:j}:b):b=rE(),_={baseLanes:_.baseLanes|h,cachePool:b}),m.memoizedState=_,m.childLanes=sb(o,C,h),u.memoizedState=lb,tf(o.child,m)):(vl(u),h=o.child,o=h.sibling,h=ma(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 ub(o,u){return u=up({mode:"visible",children:u},o.mode),u.return=o,o.child=u}function up(o,u){return o=yr(22,o,null,u),o.lanes=0,o}function cb(o,u,h){return wo(u,o.child,null,h),o=ub(u,u.pendingProps.children),o.flags|=2,u.memoizedState=null,o}function gT(o,u,h){o.lanes|=u;var m=o.alternate;m!==null&&(m.lanes|=u),k0(o.return,u,h)}function fb(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 vT(o,u,h){var m=u.pendingProps,b=m.revealOrder,S=m.tail;m=m.children;var C=jt.current,_=(C&2)!==0;if(_?(C=C&1|2,u.flags|=128):C&=1,ee(jt,C),vn(o,u,m,h),m=He?Hc:0,!_&&o!==null&&(o.flags&128)!==0)e:for(o=u.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&gT(o,h,u);else if(o.tag===19)gT(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&&Gd(o)===null&&(b=h),h=h.sibling;h=b,h===null?(b=u.child,u.child=null):(b=h.sibling,h.sibling=null),fb(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&&Gd(o)===null){u.child=b;break}o=b.sibling,b.sibling=h,h=b,b=o}fb(u,!0,h,null,S,m);break;case"together":fb(u,!1,null,null,void 0,m);break;default:u.memoizedState=null}return u.child}function Sa(o,u,h){if(o!==null&&(u.dependencies=o.dependencies),Sl|=u.lanes,(h&u.childLanes)===0)if(o!==null){if(Fs(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=ma(o,o.pendingProps),u.child=h,h.return=u;o.sibling!==null;)o=o.sibling,h=h.sibling=ma(o,o.pendingProps),h.return=u;h.sibling=null}return u.child}function hb(o,u){return(o.lanes&u)!==0?!0:(o=o.dependencies,!!(o!==null&&Fd(o)))}function dH(o,u,h){switch(u.tag){case 3:mt(u,u.stateNode.containerInfo),dl(u,$t,o.memoizedState.cache),go();break;case 27:case 5:Te(u);break;case 4:mt(u,u.stateNode.containerInfo);break;case 10:dl(u,u.type,u.memoizedProps.value);break;case 31:if(u.memoizedState!==null)return u.flags|=128,I0(u),null;break;case 13:var m=u.memoizedState;if(m!==null)return m.dehydrated!==null?(vl(u),u.flags|=128,null):(h&u.child.childLanes)!==0?mT(o,u,h):(vl(u),o=Sa(o,u,h),o!==null?o.sibling:null);vl(u);break;case 19:var b=(o.flags&128)!==0;if(m=(h&u.childLanes)!==0,m||(Fs(o,u,h,!1),m=(h&u.childLanes)!==0),b){if(m)return vT(o,u,h);u.flags|=128}if(b=u.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),ee(jt,jt.current),m)break;return null;case 22:return u.lanes=0,uT(o,u,h,u.pendingProps);case 24:dl(u,$t,o.memoizedState.cache)}return Sa(o,u,h)}function yT(o,u,h){if(o!==null)if(o.memoizedProps!==u.pendingProps)Ht=!0;else{if(!hb(o,h)&&(u.flags&128)===0)return Ht=!1,dH(o,u,h);Ht=(o.flags&131072)!==0}else Ht=!1,He&&(u.flags&1048576)!==0&&YC(u,Hc,u.index);switch(u.lanes=0,u.tag){case 16:e:{var m=u.pendingProps;if(o=xo(u.elementType),u.type=o,typeof o=="function")v0(o)?(m=Ao(o,m),u.tag=1,u=dT(null,u,o,m,h)):(u.tag=0,u=ab(null,u,o,m,h));else{if(o!=null){var b=o.$$typeof;if(b===M){u.tag=11,u=lT(null,u,o,m,h);break e}else if(b===N){u.tag=14,u=oT(null,u,o,m,h);break e}}throw u=ie(o)||o,Error(r(306,u,""))}}return u;case 0:return ab(o,u,u.type,u.pendingProps,h);case 1:return m=u.type,b=Ao(m,u.pendingProps),dT(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,_0(o,u),Yc(u,m,null,h);var C=u.memoizedState;if(m=C.cache,dl(u,$t,m),m!==S.cache&&C0(u,[$t],h,!0),Xc(),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=pT(o,u,m,h);break e}else if(m!==b){b=Br(Error(r(424)),u),Fc(b),u=pT(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=Fr(o.firstChild),mn=u,He=!0,fl=null,Ur=!0,h=uE(u,null,m,h),u.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(go(),m===b){u=Sa(o,u,h);break e}vn(o,u,m,h)}u=u.child}return u;case 26:return sp(o,u),o===null?(h=M2(u.type,null,u.pendingProps,null))?u.memoizedState=h:He||(h=u.type,o=u.pendingProps,m=kp(Oe.current).createElement(h),m[pn]=u,m[Zn]=o,yn(m,h,o),tn(m),u.stateNode=m):u.memoizedState=M2(u.type,o.memoizedProps,u.pendingProps,o.memoizedState),null;case 27:return Te(u),o===null&&He&&(m=u.stateNode=C2(u.type,u.pendingProps,Oe.current),mn=u,Ur=!0,b=vt,Cl(u.type)?(Wb=b,vt=Fr(m.firstChild)):vt=b),vn(o,u,u.pendingProps.children,h),sp(o,u),o===null&&(u.flags|=4194304),u.child;case 5:return o===null&&He&&((b=m=vt)&&(m=FH(m,u.type,u.pendingProps,Ur),m!==null?(u.stateNode=m,mn=u,vt=Fr(m.firstChild),Ur=!1,b=!0):b=!1),b||hl(u)),Te(u),b=u.type,S=u.pendingProps,C=o!==null?o.memoizedProps:null,m=S.children,$b(b,S)?m=null:C!==null&&$b(b,C)&&(u.flags|=32),u.memoizedState!==null&&(b=z0(o,u,iH,null,null,h),vf._currentValue=b),sp(o,u),vn(o,u,m,h),u.child;case 6:return o===null&&He&&((o=h=vt)&&(h=qH(h,u.pendingProps,Ur),h!==null?(u.stateNode=h,mn=u,vt=null,o=!0):o=!1),o||hl(u)),null;case 13:return mT(o,u,h);case 4:return mt(u,u.stateNode.containerInfo),m=u.pendingProps,o===null?u.child=wo(u,null,m,h):vn(o,u,m,h),u.child;case 11:return lT(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,dl(u,u.type,m.value),vn(o,u,m.children,h),u.child;case 9:return b=u.type._context,m=u.pendingProps.children,yo(u),b=gn(b),m=m(b),u.flags|=1,vn(o,u,m,h),u.child;case 14:return oT(o,u,u.type,u.pendingProps,h);case 15:return sT(o,u,u.type,u.pendingProps,h);case 19:return vT(o,u,h);case 31:return hH(o,u,h);case 22:return uT(o,u,h,u.pendingProps);case 24:return yo(u),m=gn($t),o===null?(b=M0(),b===null&&(b=ut,S=E0(),b.pooledCache=S,S.refCount++,S!==null&&(b.pooledCacheLanes|=h),b=S),u.memoizedState={parent:m,cache:b},D0(u),dl(u,$t,b)):((o.lanes&h)!==0&&(_0(o,u),Yc(u,null,null,h),Xc()),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),dl(u,$t,m)):(m=S.cache,dl(u,$t,m),m!==b.cache&&C0(u,[$t],h,!0))),vn(o,u,u.pendingProps.children,h),u.child;case 29:throw u.pendingProps}throw Error(r(156,u.tag))}function wa(o){o.flags|=4}function db(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(WT())o.flags|=8192;else throw So=Kd,P0}else o.flags&=-16777217}function bT(o,u){if(u.type!=="stylesheet"||(u.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!R2(u))if(WT())o.flags|=8192;else throw So=Kd,P0}function cp(o,u){u!==null&&(o.flags|=4),o.flags&16384&&(u=o.tag!==22?Zk():536870912,o.lanes|=u,tu|=u)}function nf(o,u){if(!He)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 pH(o,u,h){var m=u.pendingProps;switch(S0(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),ya($t),ce(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(o===null||o.child===null)&&(Hs(u)?wa(u):o===null||o.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,O0())),yt(u),null;case 26:var b=u.type,S=u.memoizedState;return o===null?(wa(u),S!==null?(yt(u),bT(u,S)):(yt(u),db(u,b,null,m,h))):S?S!==o.memoizedState?(wa(u),yt(u),bT(u,S)):(yt(u),u.flags&=-16777217):(o=o.memoizedProps,o!==m&&wa(u),yt(u),db(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&&wa(u);else{if(!m){if(u.stateNode===null)throw Error(r(166));return yt(u),null}o=se.current,Hs(u)?ZC(u):(o=C2(b,m,h),u.stateNode=o,wa(u))}return yt(u),null;case 5:if(Ee(u),b=u.type,o!==null&&u.stateNode!=null)o.memoizedProps!==m&&wa(u);else{if(!m){if(u.stateNode===null)throw Error(r(166));return yt(u),null}if(S=se.current,Hs(u))ZC(u);else{var C=kp(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[Zn]=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&&wa(u)}}return yt(u),db(u,u.type,o===null?null:o.memoizedProps,u.pendingProps,h),null;case 6:if(o&&u.stateNode!=null)o.memoizedProps!==m&&wa(u);else{if(typeof m!="string"&&u.stateNode===null)throw Error(r(166));if(o=Oe.current,Hs(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||m2(o.nodeValue,h)),o||hl(u,!0)}else o=kp(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=Hs(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 go(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;yt(u),o=!1}else h=O0(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=h),o=!0;if(!o)return u.flags&256?(xr(u),u):(xr(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=Hs(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 go(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;yt(u),b=!1}else b=O0(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=b),b=!0;if(!b)return u.flags&256?(xr(u),u):(xr(u),null)}return xr(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),cp(u,u.updateQueue),yt(u),null);case 4:return ce(),o===null&&jb(u.stateNode.containerInfo),yt(u),null;case 10:return ya(u.type),yt(u),null;case 19:if(F(jt),m=u.memoizedState,m===null)return yt(u),null;if(b=(u.flags&128)!==0,S=m.rendering,S===null)if(b)nf(m,!1);else{if(Mt!==0||o!==null&&(o.flags&128)!==0)for(o=u.child;o!==null;){if(S=Gd(o),S!==null){for(u.flags|=128,nf(m,!1),o=S.updateQueue,u.updateQueue=o,cp(u,o),u.subtreeFlags=0,o=h,h=u.child;h!==null;)KC(h,o),h=h.sibling;return ee(jt,jt.current&1|2),He&&ga(u,m.treeForkCount),u.child}o=o.sibling}m.tail!==null&&pr()>mp&&(u.flags|=128,b=!0,nf(m,!1),u.lanes=4194304)}else{if(!b)if(o=Gd(S),o!==null){if(u.flags|=128,b=!0,o=o.updateQueue,u.updateQueue=o,cp(u,o),nf(m,!0),m.tail===null&&m.tailMode==="hidden"&&!S.alternate&&!He)return yt(u),null}else 2*pr()-m.renderingStartTime>mp&&h!==536870912&&(u.flags|=128,b=!0,nf(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=pr(),o.sibling=null,h=jt.current,ee(jt,b?h&1|2:h&1),He&&ga(u,m.treeForkCount),o):(yt(u),null);case 22:case 23:return xr(u),L0(),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&&cp(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&&F(bo),null;case 24:return h=null,o!==null&&(h=o.memoizedState.cache),u.memoizedState.cache!==h&&(u.flags|=2048),ya($t),yt(u),null;case 25:return null;case 30:return null}throw Error(r(156,u.tag))}function mH(o,u){switch(S0(u),u.tag){case 1:return o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 3:return ya($t),ce(),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(xr(u),u.alternate===null)throw Error(r(340));go()}return o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 13:if(xr(u),o=u.memoizedState,o!==null&&o.dehydrated!==null){if(u.alternate===null)throw Error(r(340));go()}return o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 19:return F(jt),null;case 4:return ce(),null;case 10:return ya(u.type),null;case 22:case 23:return xr(u),L0(),o!==null&&F(bo),o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 24:return ya($t),null;case 25:return null;default:return null}}function xT(o,u){switch(S0(u),u.tag){case 3:ya($t),ce();break;case 26:case 27:case 5:Ee(u);break;case 4:ce();break;case 31:u.memoizedState!==null&&xr(u);break;case 13:xr(u);break;case 19:F(jt);break;case 10:ya(u.type);break;case 22:case 23:xr(u),L0(),o!==null&&F(bo);break;case 24:ya($t)}}function rf(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(_){tt(u,u.return,_)}}function bl(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,_=C.destroy;if(_!==void 0){C.destroy=void 0,b=u;var j=h,q=_;try{q()}catch(J){tt(b,j,J)}}}m=m.next}while(m!==S)}}catch(J){tt(u,u.return,J)}}function ST(o){var u=o.updateQueue;if(u!==null){var h=o.stateNode;try{fE(u,h)}catch(m){tt(o,o.return,m)}}}function wT(o,u,h){h.props=Ao(o.type,o.memoizedProps),h.state=o.memoizedState;try{h.componentWillUnmount()}catch(m){tt(o,u,m)}}function af(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 Di(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 OT(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 pb(o,u,h){try{var m=o.stateNode;IH(m,o.type,h,u),m[Zn]=u}catch(b){tt(o,o.return,b)}}function AT(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&Cl(o.type)||o.tag===4}function mb(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||AT(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&&Cl(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 gb(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=da));else if(m!==4&&(m===27&&Cl(o.type)&&(h=o.stateNode,u=null),o=o.child,o!==null))for(gb(o,u,h),o=o.sibling;o!==null;)gb(o,u,h),o=o.sibling}function fp(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&&Cl(o.type)&&(h=o.stateNode),o=o.child,o!==null))for(fp(o,u,h),o=o.sibling;o!==null;)fp(o,u,h),o=o.sibling}function kT(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[Zn]=h}catch(S){tt(o,o.return,S)}}var Oa=!1,Ft=!1,vb=!1,CT=typeof WeakSet=="function"?WeakSet:Set,nn=null;function gH(o,u){if(o=o.containerInfo,Bb=_p,o=BC(o),c0(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,_=-1,j=-1,q=0,J=0,re=o,X=null;t:for(;;){for(var Y;re!==h||b!==0&&re.nodeType!==3||(_=C+b),re!==S||m!==0&&re.nodeType!==3||(j=C+m),re.nodeType===3&&(C+=re.nodeValue.length),(Y=re.firstChild)!==null;)X=re,re=Y;for(;;){if(re===o)break t;if(X===h&&++q===b&&(_=C),X===S&&++J===m&&(j=C),(Y=re.nextSibling)!==null)break;re=X,X=re.parentNode}re=Y}h=_===-1||j===-1?null:{start:_,end:j}}else h=null}h=h||{start:0,end:0}}else h=null;for(zb={focusedElem:o,selectionRange:h},_p=!1,nn=u;nn!==null;)if(u=nn,o=u.child,(u.subtreeFlags&1028)!==0&&o!==null)o.return=u,nn=o;else for(;nn!==null;){switch(u=nn,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=Ao(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)Hb(o);else if(h===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":Hb(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,nn=o;break}nn=u.return}}function ET(o,u,h){var m=h.flags;switch(h.tag){case 0:case 11:case 15:ka(o,h),m&4&&rf(5,h);break;case 1:if(ka(o,h),m&4)if(o=h.stateNode,u===null)try{o.componentDidMount()}catch(C){tt(h,h.return,C)}else{var b=Ao(h.type,u.memoizedProps);u=u.memoizedState;try{o.componentDidUpdate(b,u,o.__reactInternalSnapshotBeforeUpdate)}catch(C){tt(h,h.return,C)}}m&64&&ST(h),m&512&&af(h,h.return);break;case 3:if(ka(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{fE(o,u)}catch(C){tt(h,h.return,C)}}break;case 27:u===null&&m&4&&kT(h);case 26:case 5:ka(o,h),u===null&&m&4&&OT(h),m&512&&af(h,h.return);break;case 12:ka(o,h);break;case 31:ka(o,h),m&4&&PT(o,h);break;case 13:ka(o,h),m&4&&DT(o,h),m&64&&(o=h.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(h=kH.bind(null,h),WH(o,h))));break;case 22:if(m=h.memoizedState!==null||Oa,!m){u=u!==null&&u.memoizedState!==null||Ft,b=Oa;var S=Ft;Oa=m,(Ft=u)&&!S?Ca(o,h,(h.subtreeFlags&8772)!==0):ka(o,h),Oa=b,Ft=S}break;case 30:break;default:ka(o,h)}}function TT(o){var u=o.alternate;u!==null&&(o.alternate=null,TT(u)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(u=o.stateNode,u!==null&&Ky(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,er=!1;function Aa(o,u,h){for(h=h.child;h!==null;)MT(o,u,h),h=h.sibling}function MT(o,u,h){if(mr&&typeof mr.onCommitFiberUnmount=="function")try{mr.onCommitFiberUnmount(Tc,h)}catch{}switch(h.tag){case 26:Ft||Di(h,u),Aa(o,u,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:Ft||Di(h,u);var m=wt,b=er;Cl(h.type)&&(wt=h.stateNode,er=!1),Aa(o,u,h),pf(h.stateNode),wt=m,er=b;break;case 5:Ft||Di(h,u);case 6:if(m=wt,b=er,wt=null,Aa(o,u,h),wt=m,er=b,wt!==null)if(er)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&&(er?(o=wt,S2(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,h.stateNode),uu(o)):S2(wt,h.stateNode));break;case 4:m=wt,b=er,wt=h.stateNode.containerInfo,er=!0,Aa(o,u,h),wt=m,er=b;break;case 0:case 11:case 14:case 15:bl(2,h,u),Ft||bl(4,h,u),Aa(o,u,h);break;case 1:Ft||(Di(h,u),m=h.stateNode,typeof m.componentWillUnmount=="function"&&wT(h,u,m)),Aa(o,u,h);break;case 21:Aa(o,u,h);break;case 22:Ft=(m=Ft)||h.memoizedState!==null,Aa(o,u,h),Ft=m;break;default:Aa(o,u,h)}}function PT(o,u){if(u.memoizedState===null&&(o=u.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{uu(o)}catch(h){tt(u,u.return,h)}}}function DT(o,u){if(u.memoizedState===null&&(o=u.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{uu(o)}catch(h){tt(u,u.return,h)}}function vH(o){switch(o.tag){case 31:case 13:case 19:var u=o.stateNode;return u===null&&(u=o.stateNode=new CT),u;case 22:return o=o.stateNode,u=o._retryCache,u===null&&(u=o._retryCache=new CT),u;default:throw Error(r(435,o.tag))}}function hp(o,u){var h=vH(o);u.forEach(function(m){if(!h.has(m)){h.add(m);var b=CH.bind(null,o,m);m.then(b,b)}})}function tr(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,_=C;e:for(;_!==null;){switch(_.tag){case 27:if(Cl(_.type)){wt=_.stateNode,er=!1;break e}break;case 5:wt=_.stateNode,er=!1;break e;case 3:case 4:wt=_.stateNode.containerInfo,er=!0;break e}_=_.return}if(wt===null)throw Error(r(160));MT(S,C,b),wt=null,er=!1,S=b.alternate,S!==null&&(S.return=null),b.return=null}if(u.subtreeFlags&13886)for(u=u.child;u!==null;)_T(u,o),u=u.sibling}var ui=null;function _T(o,u){var h=o.alternate,m=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:tr(u,o),nr(o),m&4&&(bl(3,o,o.return),rf(3,o),bl(5,o,o.return));break;case 1:tr(u,o),nr(o),m&512&&(Ft||h===null||Di(h,h.return)),m&64&&Oa&&(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=ui;if(tr(u,o),nr(o),m&512&&(Ft||h===null||Di(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[Dc]||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,tn(S),m=S;break e;case"link":var C=_2("link","href",b).get(m+(h.href||""));if(C){for(var _=0;_<C.length;_++)if(S=C[_],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(_,1);break t}}S=b.createElement(m),yn(S,m,h),b.head.appendChild(S);break;case"meta":if(C=_2("meta","content",b).get(m+(h.content||""))){for(_=0;_<C.length;_++)if(S=C[_],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(_,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,tn(S),m=S}o.stateNode=m}else N2(b,o.type,o.stateNode);else o.stateNode=D2(b,m,o.memoizedProps);else S!==m?(S===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):S.count--,m===null?N2(b,o.type,o.stateNode):D2(b,m,o.memoizedProps)):m===null&&o.stateNode!==null&&pb(o,o.memoizedProps,h.memoizedProps)}break;case 27:tr(u,o),nr(o),m&512&&(Ft||h===null||Di(h,h.return)),h!==null&&m&4&&pb(o,o.memoizedProps,h.memoizedProps);break;case 5:if(tr(u,o),nr(o),m&512&&(Ft||h===null||Di(h,h.return)),o.flags&32){b=o.stateNode;try{_s(b,"")}catch(ye){tt(o,o.return,ye)}}m&4&&o.stateNode!=null&&(b=o.memoizedProps,pb(o,b,h!==null?h.memoizedProps:b)),m&1024&&(vb=!0);break;case 6:if(tr(u,o),nr(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(Tp=null,b=ui,ui=Cp(u.containerInfo),tr(u,o),ui=b,nr(o),m&4&&h!==null&&h.memoizedState.isDehydrated)try{uu(u.containerInfo)}catch(ye){tt(o,o.return,ye)}vb&&(vb=!1,NT(o));break;case 4:m=ui,ui=Cp(o.stateNode.containerInfo),tr(u,o),nr(o),ui=m;break;case 12:tr(u,o),nr(o);break;case 31:tr(u,o),nr(o),m&4&&(m=o.updateQueue,m!==null&&(o.updateQueue=null,hp(o,m)));break;case 13:tr(u,o),nr(o),o.child.flags&8192&&o.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(pp=pr()),m&4&&(m=o.updateQueue,m!==null&&(o.updateQueue=null,hp(o,m)));break;case 22:b=o.memoizedState!==null;var j=h!==null&&h.memoizedState!==null,q=Oa,J=Ft;if(Oa=q||b,Ft=J||j,tr(u,o),Ft=J,Oa=q,nr(o),m&8192)e:for(u=o.stateNode,u._visibility=b?u._visibility&-2:u._visibility|1,b&&(h===null||j||Oa||Ft||ko(o)),h=null,u=o;;){if(u.tag===5||u.tag===26){if(h===null){j=h=u;try{if(S=j.stateNode,b)C=S.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none";else{_=j.stateNode;var re=j.memoizedProps.style,X=re!=null&&re.hasOwnProperty("display")?re.display:null;_.style.display=X==null||typeof X=="boolean"?"":(""+X).trim()}}catch(ye){tt(j,j.return,ye)}}}else if(u.tag===6){if(h===null){j=u;try{j.stateNode.nodeValue=b?"":j.memoizedProps}catch(ye){tt(j,j.return,ye)}}}else if(u.tag===18){if(h===null){j=u;try{var Y=j.stateNode;b?w2(Y,!0):w2(j.stateNode,!1)}catch(ye){tt(j,j.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,hp(o,h))));break;case 19:tr(u,o),nr(o),m&4&&(m=o.updateQueue,m!==null&&(o.updateQueue=null,hp(o,m)));break;case 30:break;case 21:break;default:tr(u,o),nr(o)}}function nr(o){var u=o.flags;if(u&2){try{for(var h,m=o.return;m!==null;){if(AT(m)){h=m;break}m=m.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var b=h.stateNode,S=mb(o);fp(o,S,b);break;case 5:var C=h.stateNode;h.flags&32&&(_s(C,""),h.flags&=-33);var _=mb(o);fp(o,_,C);break;case 3:case 4:var j=h.stateNode.containerInfo,q=mb(o);gb(o,q,j);break;default:throw Error(r(161))}}catch(J){tt(o,o.return,J)}o.flags&=-3}u&4096&&(o.flags&=-4097)}function NT(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var u=o;NT(u),u.tag===5&&u.flags&1024&&u.stateNode.reset(),o=o.sibling}}function ka(o,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)ET(o,u.alternate,u),u=u.sibling}function ko(o){for(o=o.child;o!==null;){var u=o;switch(u.tag){case 0:case 11:case 14:case 15:bl(4,u,u.return),ko(u);break;case 1:Di(u,u.return);var h=u.stateNode;typeof h.componentWillUnmount=="function"&&wT(u,u.return,h),ko(u);break;case 27:pf(u.stateNode);case 26:case 5:Di(u,u.return),ko(u);break;case 22:u.memoizedState===null&&ko(u);break;case 30:ko(u);break;default:ko(u)}o=o.sibling}}function Ca(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:Ca(b,S,h),rf(4,S);break;case 1:if(Ca(b,S,h),m=S,b=m.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(q){tt(m,m.return,q)}if(m=S,b=m.updateQueue,b!==null){var _=m.stateNode;try{var j=b.shared.hiddenCallbacks;if(j!==null)for(b.shared.hiddenCallbacks=null,b=0;b<j.length;b++)cE(j[b],_)}catch(q){tt(m,m.return,q)}}h&&C&64&&ST(S),af(S,S.return);break;case 27:kT(S);case 26:case 5:Ca(b,S,h),h&&m===null&&C&4&&OT(S),af(S,S.return);break;case 12:Ca(b,S,h);break;case 31:Ca(b,S,h),h&&C&4&&PT(b,S);break;case 13:Ca(b,S,h),h&&C&4&&DT(b,S);break;case 22:S.memoizedState===null&&Ca(b,S,h),af(S,S.return);break;case 30:break;default:Ca(b,S,h)}u=u.sibling}}function yb(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&&qc(h))}function bb(o,u){o=null,u.alternate!==null&&(o=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==o&&(u.refCount++,o!=null&&qc(o))}function ci(o,u,h,m){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)RT(o,u,h,m),u=u.sibling}function RT(o,u,h,m){var b=u.flags;switch(u.tag){case 0:case 11:case 15:ci(o,u,h,m),b&2048&&rf(9,u);break;case 1:ci(o,u,h,m);break;case 3:ci(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&&qc(o)));break;case 12:if(b&2048){ci(o,u,h,m),o=u.stateNode;try{var S=u.memoizedProps,C=S.id,_=S.onPostCommit;typeof _=="function"&&_(C,u.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(j){tt(u,u.return,j)}}else ci(o,u,h,m);break;case 31:ci(o,u,h,m);break;case 13:ci(o,u,h,m);break;case 23:break;case 22:S=u.stateNode,C=u.alternate,u.memoizedState!==null?S._visibility&2?ci(o,u,h,m):lf(o,u):S._visibility&2?ci(o,u,h,m):(S._visibility|=2,Zs(o,u,h,m,(u.subtreeFlags&10256)!==0||!1)),b&2048&&yb(C,u);break;case 24:ci(o,u,h,m),b&2048&&bb(u.alternate,u);break;default:ci(o,u,h,m)}}function Zs(o,u,h,m,b){for(b=b&&((u.subtreeFlags&10256)!==0||!1),u=u.child;u!==null;){var S=o,C=u,_=h,j=m,q=C.flags;switch(C.tag){case 0:case 11:case 15:Zs(S,C,_,j,b),rf(8,C);break;case 23:break;case 22:var J=C.stateNode;C.memoizedState!==null?J._visibility&2?Zs(S,C,_,j,b):lf(S,C):(J._visibility|=2,Zs(S,C,_,j,b)),b&&q&2048&&yb(C.alternate,C);break;case 24:Zs(S,C,_,j,b),b&&q&2048&&bb(C.alternate,C);break;default:Zs(S,C,_,j,b)}u=u.sibling}}function lf(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:lf(h,m),b&2048&&yb(m.alternate,m);break;case 24:lf(h,m),b&2048&&bb(m.alternate,m);break;default:lf(h,m)}u=u.sibling}}var of=8192;function Js(o,u,h){if(o.subtreeFlags&of)for(o=o.child;o!==null;)jT(o,u,h),o=o.sibling}function jT(o,u,h){switch(o.tag){case 26:Js(o,u,h),o.flags&of&&o.memoizedState!==null&&r9(h,ui,o.memoizedState,o.memoizedProps);break;case 5:Js(o,u,h);break;case 3:case 4:var m=ui;ui=Cp(o.stateNode.containerInfo),Js(o,u,h),ui=m;break;case 22:o.memoizedState===null&&(m=o.alternate,m!==null&&m.memoizedState!==null?(m=of,of=16777216,Js(o,u,h),of=m):Js(o,u,h));break;default:Js(o,u,h)}}function LT(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 sf(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];nn=m,BT(m,o)}LT(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)IT(o),o=o.sibling}function IT(o){switch(o.tag){case 0:case 11:case 15:sf(o),o.flags&2048&&bl(9,o,o.return);break;case 3:sf(o);break;case 12:sf(o);break;case 22:var u=o.stateNode;o.memoizedState!==null&&u._visibility&2&&(o.return===null||o.return.tag!==13)?(u._visibility&=-3,dp(o)):sf(o);break;default:sf(o)}}function dp(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];nn=m,BT(m,o)}LT(o)}for(o=o.child;o!==null;){switch(u=o,u.tag){case 0:case 11:case 15:bl(8,u,u.return),dp(u);break;case 22:h=u.stateNode,h._visibility&2&&(h._visibility&=-3,dp(u));break;default:dp(u)}o=o.sibling}}function BT(o,u){for(;nn!==null;){var h=nn;switch(h.tag){case 0:case 11:case 15:bl(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:qc(h.memoizedState.cache)}if(m=h.child,m!==null)m.return=h,nn=m;else e:for(h=o;nn!==null;){m=nn;var b=m.sibling,S=m.return;if(TT(m),m===h){nn=null;break e}if(b!==null){b.return=S,nn=b;break e}nn=S}}}var yH={getCacheForType:function(o){var u=gn($t),h=u.data.get(o);return h===void 0&&(h=o(),u.data.set(o,h)),h},cacheSignal:function(){return gn($t).controller.signal}},bH=typeof WeakMap=="function"?WeakMap:Map,Ze=0,ut=null,Ie=null,$e=0,et=0,Sr=null,xl=!1,eu=!1,xb=!1,Ea=0,Mt=0,Sl=0,Co=0,Sb=0,wr=0,tu=0,uf=null,rr=null,wb=!1,pp=0,zT=0,mp=1/0,gp=null,wl=null,Vt=0,Ol=null,nu=null,Ta=0,Ob=0,Ab=null,$T=null,cf=0,kb=null;function Or(){return(Ze&2)!==0&&$e!==0?$e&-$e:z.T!==null?Db():nC()}function UT(){if(wr===0)if(($e&536870912)===0||He){var o=Ad;Ad<<=1,(Ad&3932160)===0&&(Ad=262144),wr=o}else wr=536870912;return o=br.current,o!==null&&(o.flags|=32),wr}function ir(o,u,h){(o===ut&&(et===2||et===9)||o.cancelPendingCommit!==null)&&(ru(o,0),Al(o,$e,wr,!1)),Pc(o,h),((Ze&2)===0||o!==ut)&&(o===ut&&((Ze&2)===0&&(Co|=h),Mt===4&&Al(o,$e,wr,!1)),_i(o))}function HT(o,u,h){if((Ze&6)!==0)throw Error(r(327));var m=!h&&(u&127)===0&&(u&o.expiredLanes)===0||Mc(o,u),b=m?wH(o,u):Eb(o,u,!0),S=m;do{if(b===0){eu&&!m&&Al(o,u,0,!1);break}else{if(h=o.current.alternate,S&&!xH(h)){b=Eb(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 _=o;b=uf;var j=_.current.memoizedState.isDehydrated;if(j&&(ru(_,C).flags|=256),C=Eb(_,C,!1),C!==2){if(xb&&!j){_.errorRecoveryDisabledLanes|=S,Co|=S,b=4;break e}S=rr,rr=b,S!==null&&(rr===null?rr=S:rr.push.apply(rr,S))}b=C}if(S=!1,b!==2)continue}}if(b===1){ru(o,0),Al(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:Al(m,u,wr,!xl);break e;case 2:rr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((u&62914560)===u&&(b=pp+300-pr(),10<b)){if(Al(m,u,wr,!xl),Cd(m,0,!0)!==0)break e;Ta=u,m.timeoutHandle=b2(FT.bind(null,m,h,rr,gp,wb,u,wr,Co,tu,xl,S,"Throttled",-0,0),b);break e}FT(m,h,rr,gp,wb,u,wr,Co,tu,xl,S,null,-0,0)}}break}while(!0);_i(o)}function FT(o,u,h,m,b,S,C,_,j,q,J,re,X,Y){if(o.timeoutHandle=-1,re=u.subtreeFlags,re&8192||(re&16785408)===16785408){re={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:da},jT(u,S,re);var ye=(S&62914560)===S?pp-pr():(S&4194048)===S?zT-pr():0;if(ye=i9(re,ye),ye!==null){Ta=S,o.cancelPendingCommit=ye(GT.bind(null,o,u,S,h,m,b,C,_,j,J,re,null,X,Y)),Al(o,S,C,!q);return}}GT(o,u,S,h,m,b,C,_,j)}function xH(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(!vr(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 Al(o,u,h,m){u&=~Sb,u&=~Co,o.suspendedLanes|=u,o.pingedLanes&=~u,m&&(o.warmLanes|=u),m=o.expirationTimes;for(var b=u;0<b;){var S=31-gr(b),C=1<<S;m[S]=-1,b&=~C}h!==0&&Jk(o,h,u)}function vp(){return(Ze&6)===0?(ff(0),!1):!0}function Cb(){if(Ie!==null){if(et===0)var o=Ie.return;else o=Ie,va=vo=null,H0(o),Ks=null,Vc=0,o=Ie;for(;o!==null;)xT(o.alternate,o),o=o.return;Ie=null}}function ru(o,u){var h=o.timeoutHandle;h!==-1&&(o.timeoutHandle=-1,$H(h)),h=o.cancelPendingCommit,h!==null&&(o.cancelPendingCommit=null,h()),Ta=0,Cb(),ut=o,Ie=h=ma(o.current,null),$e=u,et=0,Sr=null,xl=!1,eu=Mc(o,u),xb=!1,tu=wr=Sb=Co=Sl=Mt=0,rr=uf=null,wb=!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-gr(m),S=1<<b;u|=o[b],m&=~S}return Ea=u,Bd(),h}function qT(o,u){Re=null,z.H=ef,u===Vs||u===Vd?(u=lE(),et=3):u===P0?(u=lE(),et=4):et=u===ib?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,Sr=u,Ie===null&&(Mt=1,lp(o,Br(u,o.current)))}function WT(){var o=br.current;return o===null?!0:($e&4194048)===$e?Hr===null:($e&62914560)===$e||($e&536870912)!==0?o===Hr:!1}function VT(){var o=z.H;return z.H=ef,o===null?ef:o}function KT(){var o=z.A;return z.A=yH,o}function yp(){Mt=4,xl||($e&4194048)!==$e&&br.current!==null||(eu=!0),(Sl&134217727)===0&&(Co&134217727)===0||ut===null||Al(ut,$e,wr,!1)}function Eb(o,u,h){var m=Ze;Ze|=2;var b=VT(),S=KT();(ut!==o||$e!==u)&&(gp=null,ru(o,u)),u=!1;var C=Mt;e:do try{if(et!==0&&Ie!==null){var _=Ie,j=Sr;switch(et){case 8:Cb(),C=6;break e;case 3:case 2:case 9:case 6:br.current===null&&(u=!0);var q=et;if(et=0,Sr=null,iu(o,_,j,q),h&&eu){C=0;break e}break;default:q=et,et=0,Sr=null,iu(o,_,j,q)}}SH(),C=Mt;break}catch(J){qT(o,J)}while(!0);return u&&o.shellSuspendCounter++,va=vo=null,Ze=m,z.H=b,z.A=S,Ie===null&&(ut=null,$e=0,Bd()),C}function SH(){for(;Ie!==null;)QT(Ie)}function wH(o,u){var h=Ze;Ze|=2;var m=VT(),b=KT();ut!==o||$e!==u?(gp=null,mp=pr()+500,ru(o,u)):eu=Mc(o,u);e:do try{if(et!==0&&Ie!==null){u=Ie;var S=Sr;t:switch(et){case 1:et=0,Sr=null,iu(o,u,S,1);break;case 2:case 9:if(iE(S)){et=0,Sr=null,XT(u);break}u=function(){et!==2&&et!==9||ut!==o||(et=7),_i(o)},S.then(u,u);break e;case 3:et=7;break e;case 4:et=5;break e;case 7:iE(S)?(et=0,Sr=null,XT(u)):(et=0,Sr=null,iu(o,u,S,7));break;case 5:var C=null;switch(Ie.tag){case 26:C=Ie.memoizedState;case 5:case 27:var _=Ie;if(C?R2(C):_.stateNode.complete){et=0,Sr=null;var j=_.sibling;if(j!==null)Ie=j;else{var q=_.return;q!==null?(Ie=q,bp(q)):Ie=null}break t}}et=0,Sr=null,iu(o,u,S,5);break;case 6:et=0,Sr=null,iu(o,u,S,6);break;case 8:Cb(),Mt=6;break e;default:throw Error(r(462))}}OH();break}catch(J){qT(o,J)}while(!0);return va=vo=null,z.H=m,z.A=b,Ze=h,Ie!==null?0:(ut=null,$e=0,Bd(),Mt)}function OH(){for(;Ie!==null&&!V6();)QT(Ie)}function QT(o){var u=yT(o.alternate,o,Ea);o.memoizedProps=o.pendingProps,u===null?bp(o):Ie=u}function XT(o){var u=o,h=u.alternate;switch(u.tag){case 15:case 0:u=hT(h,u,u.pendingProps,u.type,void 0,$e);break;case 11:u=hT(h,u,u.pendingProps,u.type.render,u.ref,$e);break;case 5:H0(u);default:xT(h,u),u=Ie=KC(u,Ea),u=yT(h,u,Ea)}o.memoizedProps=o.pendingProps,u===null?bp(o):Ie=u}function iu(o,u,h,m){va=vo=null,H0(u),Ks=null,Vc=0;var b=u.return;try{if(fH(o,b,u,h,$e)){Mt=1,lp(o,Br(h,o.current)),Ie=null;return}}catch(S){if(b!==null)throw Ie=b,S;Mt=1,lp(o,Br(h,o.current)),Ie=null;return}u.flags&32768?(He||m===1?o=!0:eu||($e&536870912)!==0?o=!1:(xl=o=!0,(m===2||m===9||m===3||m===6)&&(m=br.current,m!==null&&m.tag===13&&(m.flags|=16384))),YT(u,o)):bp(u)}function bp(o){var u=o;do{if((u.flags&32768)!==0){YT(u,xl);return}o=u.return;var h=pH(u.alternate,u,Ea);if(h!==null){Ie=h;return}if(u=u.sibling,u!==null){Ie=u;return}Ie=u=o}while(u!==null);Mt===0&&(Mt=5)}function YT(o,u){do{var h=mH(o.alternate,o);if(h!==null){h.flags&=32767,Ie=h;return}if(h=o.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!u&&(o=o.sibling,o!==null)){Ie=o;return}Ie=o=h}while(o!==null);Mt=6,Ie=null}function GT(o,u,h,m,b,S,C,_,j){o.cancelPendingCommit=null;do xp();while(Vt!==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|=m0,nU(o,h,S,C,_,j),o===ut&&(Ie=ut=null,$e=0),nu=u,Ol=o,Ta=h,Ob=S,Ab=b,$T=m,(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,EH(wd,function(){return n2(),null})):(o.callbackNode=null,o.callbackPriority=0),m=(u.flags&13878)!==0,(u.subtreeFlags&13878)!==0||m){m=z.T,z.T=null,b=Z.p,Z.p=2,C=Ze,Ze|=4;try{gH(o,u,h)}finally{Ze=C,Z.p=b,z.T=m}}Vt=1,ZT(),JT(),e2()}}function ZT(){if(Vt===1){Vt=0;var o=Ol,u=nu,h=(u.flags&13878)!==0;if((u.subtreeFlags&13878)!==0||h){h=z.T,z.T=null;var m=Z.p;Z.p=2;var b=Ze;Ze|=4;try{_T(u,o);var S=zb,C=BC(o.containerInfo),_=S.focusedElem,j=S.selectionRange;if(C!==_&&_&&_.ownerDocument&&IC(_.ownerDocument.documentElement,_)){if(j!==null&&c0(_)){var q=j.start,J=j.end;if(J===void 0&&(J=q),"selectionStart"in _)_.selectionStart=q,_.selectionEnd=Math.min(J,_.value.length);else{var re=_.ownerDocument||document,X=re&&re.defaultView||window;if(X.getSelection){var Y=X.getSelection(),ye=_.textContent.length,Me=Math.min(j.start,ye),at=j.end===void 0?Me:Math.min(j.end,ye);!Y.extend&&Me>at&&(C=at,at=Me,Me=C);var $=LC(_,Me),I=LC(_,at);if($&&I&&(Y.rangeCount!==1||Y.anchorNode!==$.node||Y.anchorOffset!==$.offset||Y.focusNode!==I.node||Y.focusOffset!==I.offset)){var H=re.createRange();H.setStart($.node,$.offset),Y.removeAllRanges(),Me>at?(Y.addRange(H),Y.extend(I.node,I.offset)):(H.setEnd(I.node,I.offset),Y.addRange(H))}}}}for(re=[],Y=_;Y=Y.parentNode;)Y.nodeType===1&&re.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<re.length;_++){var ne=re[_];ne.element.scrollLeft=ne.left,ne.element.scrollTop=ne.top}}_p=!!Bb,zb=Bb=null}finally{Ze=b,Z.p=m,z.T=h}}o.current=u,Vt=2}}function JT(){if(Vt===2){Vt=0;var o=Ol,u=nu,h=(u.flags&8772)!==0;if((u.subtreeFlags&8772)!==0||h){h=z.T,z.T=null;var m=Z.p;Z.p=2;var b=Ze;Ze|=4;try{ET(o,u.alternate,u)}finally{Ze=b,Z.p=m,z.T=h}}Vt=3}}function e2(){if(Vt===4||Vt===3){Vt=0,K6();var o=Ol,u=nu,h=Ta,m=$T;(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?Vt=5:(Vt=0,nu=Ol=null,t2(o,o.pendingLanes));var b=o.pendingLanes;if(b===0&&(wl=null),Wy(h),u=u.stateNode,mr&&typeof mr.onCommitFiberRoot=="function")try{mr.onCommitFiberRoot(Tc,u,void 0,(u.current.flags&128)===128)}catch{}if(m!==null){u=z.T,b=Z.p,Z.p=2,z.T=null;try{for(var S=o.onRecoverableError,C=0;C<m.length;C++){var _=m[C];S(_.value,{componentStack:_.stack})}}finally{z.T=u,Z.p=b}}(Ta&3)!==0&&xp(),_i(o),b=o.pendingLanes,(h&261930)!==0&&(b&42)!==0?o===kb?cf++:(cf=0,kb=o):cf=0,ff(0)}}function t2(o,u){(o.pooledCacheLanes&=u)===0&&(u=o.pooledCache,u!=null&&(o.pooledCache=null,qc(u)))}function xp(){return ZT(),JT(),e2(),n2()}function n2(){if(Vt!==5)return!1;var o=Ol,u=Ob;Ob=0;var h=Wy(Ta),m=z.T,b=Z.p;try{Z.p=32>h?32:h,z.T=null,h=Ab,Ab=null;var S=Ol,C=Ta;if(Vt=0,nu=Ol=null,Ta=0,(Ze&6)!==0)throw Error(r(331));var _=Ze;if(Ze|=4,IT(S.current),RT(S,S.current,C,h),Ze=_,ff(0,!1),mr&&typeof mr.onPostCommitFiberRoot=="function")try{mr.onPostCommitFiberRoot(Tc,S)}catch{}return!0}finally{Z.p=b,z.T=m,t2(o,u)}}function r2(o,u,h){u=Br(h,u),u=rb(o.stateNode,u,2),o=gl(o,u,2),o!==null&&(Pc(o,2),_i(o))}function tt(o,u,h){if(o.tag===3)r2(o,o,h);else for(;u!==null;){if(u.tag===3){r2(u,o,h);break}else if(u.tag===1){var m=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(wl===null||!wl.has(m))){o=Br(h,o),h=iT(2),m=gl(u,h,2),m!==null&&(aT(h,m,u,o),Pc(m,2),_i(m));break}}u=u.return}}function Tb(o,u,h){var m=o.pingCache;if(m===null){m=o.pingCache=new bH;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)||(xb=!0,b.add(h),o=AH.bind(null,o,u,h),u.then(o,o))}function AH(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&&(Mt===4||Mt===3&&($e&62914560)===$e&&300>pr()-pp?(Ze&2)===0&&ru(o,0):Sb|=h,tu===$e&&(tu=0)),_i(o)}function i2(o,u){u===0&&(u=Zk()),o=po(o,u),o!==null&&(Pc(o,u),_i(o))}function kH(o){var u=o.memoizedState,h=0;u!==null&&(h=u.retryLane),i2(o,h)}function CH(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),i2(o,h)}function EH(o,u){return Uy(o,u)}var Sp=null,au=null,Mb=!1,wp=!1,Pb=!1,kl=0;function _i(o){o!==au&&o.next===null&&(au===null?Sp=au=o:au=au.next=o),wp=!0,Mb||(Mb=!0,MH())}function ff(o,u){if(!Pb&&wp){Pb=!0;do for(var h=!1,m=Sp;m!==null;){if(o!==0){var b=m.pendingLanes;if(b===0)var S=0;else{var C=m.suspendedLanes,_=m.pingedLanes;S=(1<<31-gr(42|o)+1)-1,S&=b&~(C&~_),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(h=!0,s2(m,S))}else S=$e,S=Cd(m,m===ut?S:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(S&3)===0||Mc(m,S)||(h=!0,s2(m,S));m=m.next}while(h);Pb=!1}}function TH(){a2()}function a2(){wp=Mb=!1;var o=0;kl!==0&&zH()&&(o=kl);for(var u=pr(),h=null,m=Sp;m!==null;){var b=m.next,S=l2(m,u);S===0?(m.next=null,h===null?Sp=b:h.next=b,b===null&&(au=h)):(h=m,(o!==0||(S&3)!==0)&&(wp=!0)),m=b}Vt!==0&&Vt!==5||ff(o),kl!==0&&(kl=0)}function l2(o,u){for(var h=o.suspendedLanes,m=o.pingedLanes,b=o.expirationTimes,S=o.pendingLanes&-62914561;0<S;){var C=31-gr(S),_=1<<C,j=b[C];j===-1?((_&h)===0||(_&m)!==0)&&(b[C]=tU(_,u)):j<=u&&(o.expiredLanes|=_),S&=~_}if(u=ut,h=$e,h=Cd(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&&Hy(m),o.callbackNode=null,o.callbackPriority=0;if((h&3)===0||Mc(o,h)){if(u=h&-h,u===o.callbackPriority)return u;switch(m!==null&&Hy(m),Wy(h)){case 2:case 8:h=Yk;break;case 32:h=wd;break;case 268435456:h=Gk;break;default:h=wd}return m=o2.bind(null,o),h=Uy(h,m),o.callbackPriority=u,o.callbackNode=h,u}return m!==null&&m!==null&&Hy(m),o.callbackPriority=2,o.callbackNode=null,2}function o2(o,u){if(Vt!==0&&Vt!==5)return o.callbackNode=null,o.callbackPriority=0,null;var h=o.callbackNode;if(xp()&&o.callbackNode!==h)return null;var m=$e;return m=Cd(o,o===ut?m:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),m===0?null:(HT(o,m,u),l2(o,pr()),o.callbackNode!=null&&o.callbackNode===h?o2.bind(null,o):null)}function s2(o,u){if(xp())return null;HT(o,u,!0)}function MH(){UH(function(){(Ze&6)!==0?Uy(Xk,TH):a2()})}function Db(){if(kl===0){var o=qs;o===0&&(o=Od,Od<<=1,(Od&261888)===0&&(Od=256)),kl=o}return kl}function u2(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:Pd(""+o)}function c2(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 PH(o,u,h,m,b){if(u==="submit"&&h&&h.stateNode===b){var S=u2((b[Zn]||null).action),C=m.submitter;C&&(u=(u=C[Zn]||null)?u2(u.formAction):C.getAttribute("formAction"),u!==null&&(S=u,C=null));var _=new Rd("action","action",null,m,b);o.push({event:_,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(kl!==0){var j=C?c2(b,C):new FormData(b);G0(h,{pending:!0,data:j,method:b.method,action:S},null,j)}}else typeof S=="function"&&(_.preventDefault(),j=C?c2(b,C):new FormData(b),G0(h,{pending:!0,data:j,method:b.method,action:S},S,j))},currentTarget:b}]})}}for(var _b=0;_b<p0.length;_b++){var Nb=p0[_b],DH=Nb.toLowerCase(),_H=Nb[0].toUpperCase()+Nb.slice(1);si(DH,"on"+_H)}si(UC,"onAnimationEnd"),si(HC,"onAnimationIteration"),si(FC,"onAnimationStart"),si("dblclick","onDoubleClick"),si("focusin","onFocus"),si("focusout","onBlur"),si(QU,"onTransitionRun"),si(XU,"onTransitionStart"),si(YU,"onTransitionCancel"),si(qC,"onTransitionEnd"),Ps("onMouseEnter",["mouseout","mouseover"]),Ps("onMouseLeave",["mouseout","mouseover"]),Ps("onPointerEnter",["pointerout","pointerover"]),Ps("onPointerLeave",["pointerout","pointerover"]),uo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),uo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),uo("onBeforeInput",["compositionend","keypress","textInput","paste"]),uo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),uo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),uo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var hf="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(" "),NH=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(hf));function f2(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 _=m[C],j=_.instance,q=_.currentTarget;if(_=_.listener,j!==S&&b.isPropagationStopped())break e;S=_,b.currentTarget=q;try{S(b)}catch(J){Id(J)}b.currentTarget=null,S=j}else for(C=0;C<m.length;C++){if(_=m[C],j=_.instance,q=_.currentTarget,_=_.listener,j!==S&&b.isPropagationStopped())break e;S=_,b.currentTarget=q;try{S(b)}catch(J){Id(J)}b.currentTarget=null,S=j}}}}function Be(o,u){var h=u[Vy];h===void 0&&(h=u[Vy]=new Set);var m=o+"__bubble";h.has(m)||(h2(u,o,2,!1),h.add(m))}function Rb(o,u,h){var m=0;u&&(m|=4),h2(h,o,m,u)}var Op="_reactListening"+Math.random().toString(36).slice(2);function jb(o){if(!o[Op]){o[Op]=!0,aC.forEach(function(h){h!=="selectionchange"&&(NH.has(h)||Rb(h,!1,o),Rb(h,!0,o))});var u=o.nodeType===9?o:o.ownerDocument;u===null||u[Op]||(u[Op]=!0,Rb("selectionchange",!1,u))}}function h2(o,u,h,m){switch(U2(u)){case 2:var b=o9;break;case 8:b=s9;break;default:b=Yb}h=b.bind(null,u,h,o),b=void 0,!t0||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 Lb(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 _=m.stateNode.containerInfo;if(_===b)break;if(C===4)for(C=m.return;C!==null;){var j=C.tag;if((j===3||j===4)&&C.stateNode.containerInfo===b)return;C=C.return}for(;_!==null;){if(C=Es(_),C===null)return;if(j=C.tag,j===5||j===6||j===26||j===27){m=S=C;continue e}_=_.parentNode}}m=m.return}vC(function(){var q=S,J=Jy(h),re=[];e:{var X=WC.get(o);if(X!==void 0){var Y=Rd,ye=o;switch(o){case"keypress":if(_d(h)===0)break e;case"keydown":case"keyup":Y=CU;break;case"focusin":ye="focus",Y=a0;break;case"focusout":ye="blur",Y=a0;break;case"beforeblur":case"afterblur":Y=a0;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":Y=xC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=pU;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=MU;break;case UC:case HC:case FC:Y=vU;break;case qC:Y=DU;break;case"scroll":case"scrollend":Y=hU;break;case"wheel":Y=NU;break;case"copy":case"cut":case"paste":Y=bU;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=wC;break;case"toggle":case"beforetoggle":Y=jU}var Me=(u&4)!==0,at=!Me&&(o==="scroll"||o==="scrollend"),$=Me?X!==null?X+"Capture":null:X;Me=[];for(var I=q,H;I!==null;){var ne=I;if(H=ne.stateNode,ne=ne.tag,ne!==5&&ne!==26&&ne!==27||H===null||$===null||(ne=Nc(I,$),ne!=null&&Me.push(df(I,ne,H))),at)break;I=I.return}0<Me.length&&(X=new Y(X,ye,null,h,J),re.push({event:X,listeners:Me}))}}if((u&7)===0){e:{if(X=o==="mouseover"||o==="pointerover",Y=o==="mouseout"||o==="pointerout",X&&h!==Zy&&(ye=h.relatedTarget||h.fromElement)&&(Es(ye)||ye[Cs]))break e;if((Y||X)&&(X=J.window===J?J:(X=J.ownerDocument)?X.defaultView||X.parentWindow:window,Y?(ye=h.relatedTarget||h.toElement,Y=q,ye=ye?Es(ye):null,ye!==null&&(at=a(ye),Me=ye.tag,ye!==at||Me!==5&&Me!==27&&Me!==6)&&(ye=null)):(Y=null,ye=q),Y!==ye)){if(Me=xC,ne="onMouseLeave",$="onMouseEnter",I="mouse",(o==="pointerout"||o==="pointerover")&&(Me=wC,ne="onPointerLeave",$="onPointerEnter",I="pointer"),at=Y==null?X:_c(Y),H=ye==null?X:_c(ye),X=new Me(ne,I+"leave",Y,h,J),X.target=at,X.relatedTarget=H,ne=null,Es(J)===q&&(Me=new Me($,I+"enter",ye,h,J),Me.target=H,Me.relatedTarget=at,ne=Me),at=ne,Y&&ye)t:{for(Me=RH,$=Y,I=ye,H=0,ne=$;ne;ne=Me(ne))H++;ne=0;for(var Ae=I;Ae;Ae=Me(Ae))ne++;for(;0<H-ne;)$=Me($),H--;for(;0<ne-H;)I=Me(I),ne--;for(;H--;){if($===I||I!==null&&$===I.alternate){Me=$;break t}$=Me($),I=Me(I)}Me=null}else Me=null;Y!==null&&d2(re,X,Y,Me,!1),ye!==null&&at!==null&&d2(re,at,ye,Me,!0)}}e:{if(X=q?_c(q):window,Y=X.nodeName&&X.nodeName.toLowerCase(),Y==="select"||Y==="input"&&X.type==="file")var Ke=PC;else if(TC(X))if(DC)Ke=WU;else{Ke=FU;var Se=HU}else Y=X.nodeName,!Y||Y.toLowerCase()!=="input"||X.type!=="checkbox"&&X.type!=="radio"?q&&Gy(q.elementType)&&(Ke=PC):Ke=qU;if(Ke&&(Ke=Ke(o,q))){MC(re,Ke,h,J);break e}Se&&Se(o,X,q),o==="focusout"&&q&&X.type==="number"&&q.memoizedProps.value!=null&&Yy(X,"number",X.value)}switch(Se=q?_c(q):window,o){case"focusin":(TC(Se)||Se.contentEditable==="true")&&(Ls=Se,f0=q,Uc=null);break;case"focusout":Uc=f0=Ls=null;break;case"mousedown":h0=!0;break;case"contextmenu":case"mouseup":case"dragend":h0=!1,zC(re,h,J);break;case"selectionchange":if(KU)break;case"keydown":case"keyup":zC(re,h,J)}var je;if(o0)e:{switch(o){case"compositionstart":var Ue="onCompositionStart";break e;case"compositionend":Ue="onCompositionEnd";break e;case"compositionupdate":Ue="onCompositionUpdate";break e}Ue=void 0}else js?CC(o,h)&&(Ue="onCompositionEnd"):o==="keydown"&&h.keyCode===229&&(Ue="onCompositionStart");Ue&&(OC&&h.locale!=="ko"&&(js||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&js&&(je=yC()):(ul=J,n0="value"in ul?ul.value:ul.textContent,js=!0)),Se=Ap(q,Ue),0<Se.length&&(Ue=new SC(Ue,o,null,h,J),re.push({event:Ue,listeners:Se}),je?Ue.data=je:(je=EC(h),je!==null&&(Ue.data=je)))),(je=IU?BU(o,h):zU(o,h))&&(Ue=Ap(q,"onBeforeInput"),0<Ue.length&&(Se=new SC("onBeforeInput","beforeinput",null,h,J),re.push({event:Se,listeners:Ue}),Se.data=je)),PH(re,o,q,h,J)}f2(re,u)})}function df(o,u,h){return{instance:o,listener:u,currentTarget:h}}function Ap(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=Nc(o,h),b!=null&&m.unshift(df(o,b,S)),b=Nc(o,u),b!=null&&m.push(df(o,b,S))),o.tag===3)return m;o=o.return}return[]}function RH(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function d2(o,u,h,m,b){for(var S=u._reactName,C=[];h!==null&&h!==m;){var _=h,j=_.alternate,q=_.stateNode;if(_=_.tag,j!==null&&j===m)break;_!==5&&_!==26&&_!==27||q===null||(j=q,b?(q=Nc(h,S),q!=null&&C.unshift(df(h,q,j))):b||(q=Nc(h,S),q!=null&&C.push(df(h,q,j)))),h=h.return}C.length!==0&&o.push({event:u,listeners:C})}var jH=/\r\n?/g,LH=/\u0000|\uFFFD/g;function p2(o){return(typeof o=="string"?o:""+o).replace(jH,`
|
|
9
|
-
`).replace(LH,"")}function m2(o,u){return u=p2(u),p2(o)===u}function it(o,u,h,m,b,S){switch(h){case"children":typeof m=="string"?u==="body"||u==="textarea"&&m===""||_s(o,m):(typeof m=="number"||typeof m=="bigint")&&u!=="body"&&_s(o,""+m);break;case"className":Td(o,"class",m);break;case"tabIndex":Td(o,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":Td(o,h,m);break;case"style":mC(o,m,S);break;case"data":if(u!=="object"){Td(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=Pd(""+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=Pd(""+m),o.setAttribute(h,m);break;case"onClick":m!=null&&(o.onclick=da);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=Pd(""+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),Ed(o,"popover",m);break;case"xlinkActuate":ha(o,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":ha(o,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":ha(o,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":ha(o,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":ha(o,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":ha(o,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":ha(o,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":ha(o,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":ha(o,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":Ed(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=cU.get(h)||h,Ed(o,h,m))}}function Ib(o,u,h,m,b,S){switch(h){case"style":mC(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"?_s(o,m):(typeof m=="number"||typeof m=="bigint")&&_s(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=da);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!lC.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[Zn]||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,""):Ed(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 _=S=C=b=null,j=null,q=null;for(m in h)if(h.hasOwnProperty(m)){var J=h[m];if(J!=null)switch(m){case"name":b=J;break;case"type":C=J;break;case"checked":j=J;break;case"defaultChecked":q=J;break;case"value":S=J;break;case"defaultValue":_=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(r(137,u));break;default:it(o,u,m,J,h,null)}}fC(o,S,_,j,q,C,b,!1);return;case"select":Be("invalid",o),m=C=S=null;for(b in h)if(h.hasOwnProperty(b)&&(_=h[b],_!=null))switch(b){case"value":S=_;break;case"defaultValue":C=_;break;case"multiple":m=_;default:it(o,u,b,_,h,null)}u=S,h=C,o.multiple=!!m,u!=null?Ds(o,!!m,u,!1):h!=null&&Ds(o,!!m,h,!0);return;case"textarea":Be("invalid",o),S=b=m=null;for(C in h)if(h.hasOwnProperty(C)&&(_=h[C],_!=null))switch(C){case"value":m=_;break;case"defaultValue":b=_;break;case"children":S=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(r(91));break;default:it(o,u,C,_,h,null)}dC(o,m,b,S);return;case"option":for(j in h)h.hasOwnProperty(j)&&(m=h[j],m!=null)&&(j==="selected"?o.selected=m&&typeof m!="function"&&typeof m!="symbol":it(o,u,j,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<hf.length;m++)Be(hf[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(q in h)if(h.hasOwnProperty(q)&&(m=h[q],m!=null))switch(q){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:it(o,u,q,m,h,null)}return;default:if(Gy(u)){for(J in h)h.hasOwnProperty(J)&&(m=h[J],m!==void 0&&Ib(o,u,J,m,h,void 0));return}}for(_ in h)h.hasOwnProperty(_)&&(m=h[_],m!=null&&it(o,u,_,m,h,null))}function IH(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,_=null,j=null,q=null,J=null;for(Y in h){var re=h[Y];if(h.hasOwnProperty(Y)&&re!=null)switch(Y){case"checked":break;case"value":break;case"defaultValue":j=re;default:m.hasOwnProperty(Y)||it(o,u,Y,null,m,re)}}for(var X in m){var Y=m[X];if(re=h[X],m.hasOwnProperty(X)&&(Y!=null||re!=null))switch(X){case"type":S=Y;break;case"name":b=Y;break;case"checked":q=Y;break;case"defaultChecked":J=Y;break;case"value":C=Y;break;case"defaultValue":_=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(r(137,u));break;default:Y!==re&&it(o,u,X,Y,m,re)}}Xy(o,C,_,j,q,J,S,b);return;case"select":Y=C=_=X=null;for(S in h)if(j=h[S],h.hasOwnProperty(S)&&j!=null)switch(S){case"value":break;case"multiple":Y=j;default:m.hasOwnProperty(S)||it(o,u,S,null,m,j)}for(b in m)if(S=m[b],j=h[b],m.hasOwnProperty(b)&&(S!=null||j!=null))switch(b){case"value":X=S;break;case"defaultValue":_=S;break;case"multiple":C=S;default:S!==j&&it(o,u,b,S,m,j)}u=_,h=C,m=Y,X!=null?Ds(o,!!h,X,!1):!!m!=!!h&&(u!=null?Ds(o,!!h,u,!0):Ds(o,!!h,h?[]:"",!1));return;case"textarea":Y=X=null;for(_ in h)if(b=h[_],h.hasOwnProperty(_)&&b!=null&&!m.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:it(o,u,_,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":X=b;break;case"defaultValue":Y=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)}hC(o,X,Y);return;case"option":for(var ye in h)X=h[ye],h.hasOwnProperty(ye)&&X!=null&&!m.hasOwnProperty(ye)&&(ye==="selected"?o.selected=!1:it(o,u,ye,null,m,X));for(j in m)X=m[j],Y=h[j],m.hasOwnProperty(j)&&X!==Y&&(X!=null||Y!=null)&&(j==="selected"?o.selected=X&&typeof X!="function"&&typeof X!="symbol":it(o,u,j,X,m,Y));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)X=h[Me],h.hasOwnProperty(Me)&&X!=null&&!m.hasOwnProperty(Me)&&it(o,u,Me,null,m,X);for(q in m)if(X=m[q],Y=h[q],m.hasOwnProperty(q)&&X!==Y&&(X!=null||Y!=null))switch(q){case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(r(137,u));break;default:it(o,u,q,X,m,Y)}return;default:if(Gy(u)){for(var at in h)X=h[at],h.hasOwnProperty(at)&&X!==void 0&&!m.hasOwnProperty(at)&&Ib(o,u,at,void 0,m,X);for(J in m)X=m[J],Y=h[J],!m.hasOwnProperty(J)||X===Y||X===void 0&&Y===void 0||Ib(o,u,J,X,m,Y);return}}for(var $ in h)X=h[$],h.hasOwnProperty($)&&X!=null&&!m.hasOwnProperty($)&&it(o,u,$,null,m,X);for(re in m)X=m[re],Y=h[re],!m.hasOwnProperty(re)||X===Y||X==null&&Y==null||it(o,u,re,X,m,Y)}function g2(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function BH(){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,_=b.duration;if(S&&_&&g2(C)){for(C=0,_=b.responseEnd,m+=1;m<h.length;m++){var j=h[m],q=j.startTime;if(q>_)break;var J=j.transferSize,re=j.initiatorType;J&&g2(re)&&(j=j.responseEnd,C+=J*(j<_?1:(_-q)/(j-q)))}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 Bb=null,zb=null;function kp(o){return o.nodeType===9?o:o.ownerDocument}function v2(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 y2(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 $b(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 Ub=null;function zH(){var o=window.event;return o&&o.type==="popstate"?o===Ub?!1:(Ub=o,!0):(Ub=null,!1)}var b2=typeof setTimeout=="function"?setTimeout:void 0,$H=typeof clearTimeout=="function"?clearTimeout:void 0,x2=typeof Promise=="function"?Promise:void 0,UH=typeof queueMicrotask=="function"?queueMicrotask:typeof x2<"u"?function(o){return x2.resolve(null).then(o).catch(HH)}:b2;function HH(o){setTimeout(function(){throw o})}function Cl(o){return o==="head"}function S2(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),uu(u);return}m--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")m++;else if(h==="html")pf(o.ownerDocument.documentElement);else if(h==="head"){h=o.ownerDocument.head,pf(h);for(var S=h.firstChild;S;){var C=S.nextSibling,_=S.nodeName;S[Dc]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&S.rel.toLowerCase()==="stylesheet"||h.removeChild(S),S=C}}else h==="body"&&pf(o.ownerDocument.body);h=b}while(h);uu(u)}function w2(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 Hb(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":Hb(h),Ky(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}o.removeChild(h)}}function FH(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[Dc])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=Fr(o.nextSibling),o===null)break}return null}function qH(o,u,h){if(u==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!h||(o=Fr(o.nextSibling),o===null))return null;return o}function O2(o,u){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!u||(o=Fr(o.nextSibling),o===null))return null;return o}function Fb(o){return o.data==="$?"||o.data==="$~"}function qb(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function WH(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 Fr(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 Wb=null;function A2(o){o=o.nextSibling;for(var u=0;o;){if(o.nodeType===8){var h=o.data;if(h==="/$"||h==="/&"){if(u===0)return Fr(o.nextSibling);u--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||u++}o=o.nextSibling}return null}function k2(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 C2(o,u,h){switch(u=kp(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 pf(o){for(var u=o.attributes;u.length;)o.removeAttributeNode(u[0]);Ky(o)}var qr=new Map,E2=new Set;function Cp(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var Ma=Z.d;Z.d={f:VH,r:KH,D:QH,C:XH,L:YH,m:GH,X:JH,S:ZH,M:e9};function VH(){var o=Ma.f(),u=vp();return o||u}function KH(o){var u=Ts(o);u!==null&&u.tag===5&&u.type==="form"?qE(u):Ma.r(o)}var lu=typeof document>"u"?null:document;function T2(o,u,h){var m=lu;if(m&&typeof u=="string"&&u){var b=Lr(u);b='link[rel="'+o+'"][href="'+b+'"]',typeof h=="string"&&(b+='[crossorigin="'+h+'"]'),E2.has(b)||(E2.add(b),o={rel:o,crossOrigin:h,href:u},m.querySelector(b)===null&&(u=m.createElement("link"),yn(u,"link",o),tn(u),m.head.appendChild(u)))}}function QH(o){Ma.D(o),T2("dns-prefetch",o,null)}function XH(o,u){Ma.C(o,u),T2("preconnect",o,u)}function YH(o,u,h){Ma.L(o,u,h);var m=lu;if(m&&o&&u){var b='link[rel="preload"][as="'+Lr(u)+'"]';u==="image"&&h&&h.imageSrcSet?(b+='[imagesrcset="'+Lr(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(b+='[imagesizes="'+Lr(h.imageSizes)+'"]')):b+='[href="'+Lr(o)+'"]';var S=b;switch(u){case"style":S=ou(o);break;case"script":S=su(o)}qr.has(S)||(o=p({rel:"preload",href:u==="image"&&h&&h.imageSrcSet?void 0:o,as:u},h),qr.set(S,o),m.querySelector(b)!==null||u==="style"&&m.querySelector(mf(S))||u==="script"&&m.querySelector(gf(S))||(u=m.createElement("link"),yn(u,"link",o),tn(u),m.head.appendChild(u)))}}function GH(o,u){Ma.m(o,u);var h=lu;if(h&&o){var m=u&&typeof u.as=="string"?u.as:"script",b='link[rel="modulepreload"][as="'+Lr(m)+'"][href="'+Lr(o)+'"]',S=b;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=su(o)}if(!qr.has(S)&&(o=p({rel:"modulepreload",href:o},u),qr.set(S,o),h.querySelector(b)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(gf(S)))return}m=h.createElement("link"),yn(m,"link",o),tn(m),h.head.appendChild(m)}}}function ZH(o,u,h){Ma.S(o,u,h);var m=lu;if(m&&o){var b=Ms(m).hoistableStyles,S=ou(o);u=u||"default";var C=b.get(S);if(!C){var _={loading:0,preload:null};if(C=m.querySelector(mf(S)))_.loading=5;else{o=p({rel:"stylesheet",href:o,"data-precedence":u},h),(h=qr.get(S))&&Vb(o,h);var j=C=m.createElement("link");tn(j),yn(j,"link",o),j._p=new Promise(function(q,J){j.onload=q,j.onerror=J}),j.addEventListener("load",function(){_.loading|=1}),j.addEventListener("error",function(){_.loading|=2}),_.loading|=4,Ep(C,u,m)}C={type:"stylesheet",instance:C,count:1,state:_},b.set(S,C)}}}function JH(o,u){Ma.X(o,u);var h=lu;if(h&&o){var m=Ms(h).hoistableScripts,b=su(o),S=m.get(b);S||(S=h.querySelector(gf(b)),S||(o=p({src:o,async:!0},u),(u=qr.get(b))&&Kb(o,u),S=h.createElement("script"),tn(S),yn(S,"link",o),h.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},m.set(b,S))}}function e9(o,u){Ma.M(o,u);var h=lu;if(h&&o){var m=Ms(h).hoistableScripts,b=su(o),S=m.get(b);S||(S=h.querySelector(gf(b)),S||(o=p({src:o,async:!0,type:"module"},u),(u=qr.get(b))&&Kb(o,u),S=h.createElement("script"),tn(S),yn(S,"link",o),h.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},m.set(b,S))}}function M2(o,u,h,m){var b=(b=Oe.current)?Cp(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=ou(h.href),h=Ms(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=ou(h.href);var S=Ms(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(mf(o)))&&!S._p&&(C.instance=S,C.state.loading=5),qr.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},qr.set(o,h),S||t9(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=su(h),h=Ms(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 ou(o){return'href="'+Lr(o)+'"'}function mf(o){return'link[rel="stylesheet"]['+o+"]"}function P2(o){return p({},o,{"data-precedence":o.precedence,precedence:null})}function t9(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),tn(u),o.head.appendChild(u))}function su(o){return'[src="'+Lr(o)+'"]'}function gf(o){return"script[async]"+o}function D2(o,u,h){if(u.count++,u.instance===null)switch(u.type){case"style":var m=o.querySelector('style[data-href~="'+Lr(h.href)+'"]');if(m)return u.instance=m,tn(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"),tn(m),yn(m,"style",b),Ep(m,h.precedence,o),u.instance=m;case"stylesheet":b=ou(h.href);var S=o.querySelector(mf(b));if(S)return u.state.loading|=4,u.instance=S,tn(S),S;m=P2(h),(b=qr.get(b))&&Vb(m,b),S=(o.ownerDocument||o).createElement("link"),tn(S);var C=S;return C._p=new Promise(function(_,j){C.onload=_,C.onerror=j}),yn(S,"link",m),u.state.loading|=4,Ep(S,h.precedence,o),u.instance=S;case"script":return S=su(h.src),(b=o.querySelector(gf(S)))?(u.instance=b,tn(b),b):(m=h,(b=qr.get(S))&&(m=p({},h),Kb(m,b)),o=o.ownerDocument||o,b=o.createElement("script"),tn(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,Ep(m,h.precedence,o));return u.instance}function Ep(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 _=m[C];if(_.dataset.precedence===u)S=_;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 Vb(o,u){o.crossOrigin==null&&(o.crossOrigin=u.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=u.referrerPolicy),o.title==null&&(o.title=u.title)}function Kb(o,u){o.crossOrigin==null&&(o.crossOrigin=u.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=u.referrerPolicy),o.integrity==null&&(o.integrity=u.integrity)}var Tp=null;function _2(o,u,h){if(Tp===null){var m=new Map,b=Tp=new Map;b.set(h,m)}else b=Tp,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[Dc]||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 _=m.get(C);_?_.push(S):m.set(C,[S])}}return m}function N2(o,u,h){o=o.ownerDocument||o,o.head.insertBefore(h,u==="title"?o.querySelector("head > title"):null)}function n9(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 R2(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function r9(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=ou(m.href),S=u.querySelector(mf(b));if(S){u=S._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(o.count++,o=Mp.bind(o),u.then(o,o)),h.state.loading|=4,h.instance=S,tn(S);return}S=u.ownerDocument||u,m=P2(m),(b=qr.get(b))&&Vb(m,b),S=S.createElement("link"),tn(S);var C=S;C._p=new Promise(function(_,j){C.onload=_,C.onerror=j}),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=Mp.bind(o),u.addEventListener("load",h),u.addEventListener("error",h))}}var Qb=0;function i9(o,u){return o.stylesheets&&o.count===0&&Dp(o,o.stylesheets),0<o.count||0<o.imgCount?function(h){var m=setTimeout(function(){if(o.stylesheets&&Dp(o,o.stylesheets),o.unsuspend){var S=o.unsuspend;o.unsuspend=null,S()}},6e4+u);0<o.imgBytes&&Qb===0&&(Qb=62500*BH());var b=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&Dp(o,o.stylesheets),o.unsuspend)){var S=o.unsuspend;o.unsuspend=null,S()}},(o.imgBytes>Qb?50:800)+u);return o.unsuspend=h,function(){o.unsuspend=null,clearTimeout(m),clearTimeout(b)}}:null}function Mp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Dp(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var Pp=null;function Dp(o,u){o.stylesheets=null,o.unsuspend!==null&&(o.count++,Pp=new Map,u.forEach(a9,o),Pp=null,Mp.call(o))}function a9(o,u){if(!(u.state.loading&4)){var h=Pp.get(o);if(h)var m=h.get(null);else{h=new Map,Pp.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=Mp.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 vf={$$typeof:k,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function l9(o,u,h,m,b,S,C,_,j){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=Fy(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fy(0),this.hiddenUpdates=Fy(null),this.identifierPrefix=m,this.onUncaughtError=b,this.onCaughtError=S,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=j,this.incompleteTransitions=new Map}function j2(o,u,h,m,b,S,C,_,j,q,J,re){return o=new l9(o,u,h,C,j,q,J,re,_),u=1,S===!0&&(u|=24),S=yr(3,null,null,u),o.current=S,S.stateNode=o,u=E0(),u.refCount++,o.pooledCache=u,u.refCount++,S.memoizedState={element:m,isDehydrated:h,cache:u},D0(S),o}function L2(o){return o?(o=zs,o):zs}function I2(o,u,h,m,b,S){b=L2(b),m.context===null?m.context=b:m.pendingContext=b,m=ml(u),m.payload={element:h},S=S===void 0?null:S,S!==null&&(m.callback=S),h=gl(o,m,u),h!==null&&(ir(h,o,u),Qc(h,o,u))}function B2(o,u){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var h=o.retryLane;o.retryLane=h!==0&&h<u?h:u}}function Xb(o,u){B2(o,u),(o=o.alternate)&&B2(o,u)}function z2(o){if(o.tag===13||o.tag===31){var u=po(o,67108864);u!==null&&ir(u,o,67108864),Xb(o,67108864)}}function $2(o){if(o.tag===13||o.tag===31){var u=Or();u=qy(u);var h=po(o,u);h!==null&&ir(h,o,u),Xb(o,u)}}var _p=!0;function o9(o,u,h,m){var b=z.T;z.T=null;var S=Z.p;try{Z.p=2,Yb(o,u,h,m)}finally{Z.p=S,z.T=b}}function s9(o,u,h,m){var b=z.T;z.T=null;var S=Z.p;try{Z.p=8,Yb(o,u,h,m)}finally{Z.p=S,z.T=b}}function Yb(o,u,h,m){if(_p){var b=Gb(m);if(b===null)Lb(o,u,m,Np,h),H2(o,m);else if(c9(b,o,u,h,m))m.stopPropagation();else if(H2(o,m),u&4&&-1<u9.indexOf(o)){for(;b!==null;){var S=Ts(b);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var C=so(S.pendingLanes);if(C!==0){var _=S;for(_.pendingLanes|=2,_.entangledLanes|=2;C;){var j=1<<31-gr(C);_.entanglements[1]|=j,C&=~j}_i(S),(Ze&6)===0&&(mp=pr()+500,ff(0))}}break;case 31:case 13:_=po(S,2),_!==null&&ir(_,S,2),vp(),Xb(S,2)}if(S=Gb(m),S===null&&Lb(o,u,m,Np,h),S===b)break;b=S}b!==null&&m.stopPropagation()}else Lb(o,u,m,null,h)}}function Gb(o){return o=Jy(o),Zb(o)}var Np=null;function Zb(o){if(Np=null,o=Es(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 Np=o,null}function U2(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(Q6()){case Xk:return 2;case Yk:return 8;case wd:case X6:return 32;case Gk:return 268435456;default:return 32}default:return 32}}var Jb=!1,El=null,Tl=null,Ml=null,yf=new Map,bf=new Map,Pl=[],u9="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 H2(o,u){switch(o){case"focusin":case"focusout":El=null;break;case"dragenter":case"dragleave":Tl=null;break;case"mouseover":case"mouseout":Ml=null;break;case"pointerover":case"pointerout":yf.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":bf.delete(u.pointerId)}}function xf(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=Ts(u),u!==null&&z2(u)),o):(o.eventSystemFlags|=m,u=o.targetContainers,b!==null&&u.indexOf(b)===-1&&u.push(b),o)}function c9(o,u,h,m,b){switch(u){case"focusin":return El=xf(El,o,u,h,m,b),!0;case"dragenter":return Tl=xf(Tl,o,u,h,m,b),!0;case"mouseover":return Ml=xf(Ml,o,u,h,m,b),!0;case"pointerover":var S=b.pointerId;return yf.set(S,xf(yf.get(S)||null,o,u,h,m,b)),!0;case"gotpointercapture":return S=b.pointerId,bf.set(S,xf(bf.get(S)||null,o,u,h,m,b)),!0}return!1}function F2(o){var u=Es(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,rC(o.priority,function(){$2(h)});return}}else if(u===31){if(u=s(h),u!==null){o.blockedOn=u,rC(o.priority,function(){$2(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 Rp(o){if(o.blockedOn!==null)return!1;for(var u=o.targetContainers;0<u.length;){var h=Gb(o.nativeEvent);if(h===null){h=o.nativeEvent;var m=new h.constructor(h.type,h);Zy=m,h.target.dispatchEvent(m),Zy=null}else return u=Ts(h),u!==null&&z2(u),o.blockedOn=h,!1;u.shift()}return!0}function q2(o,u,h){Rp(o)&&h.delete(u)}function f9(){Jb=!1,El!==null&&Rp(El)&&(El=null),Tl!==null&&Rp(Tl)&&(Tl=null),Ml!==null&&Rp(Ml)&&(Ml=null),yf.forEach(q2),bf.forEach(q2)}function jp(o,u){o.blockedOn===u&&(o.blockedOn=null,Jb||(Jb=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,f9)))}var Lp=null;function W2(o){Lp!==o&&(Lp=o,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Lp===o&&(Lp=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(Zb(m||h)===null)continue;break}var S=Ts(h);S!==null&&(o.splice(u,3),u-=3,G0(S,{pending:!0,data:b,method:h.method,action:m},m,b))}}))}function uu(o){function u(j){return jp(j,o)}El!==null&&jp(El,o),Tl!==null&&jp(Tl,o),Ml!==null&&jp(Ml,o),yf.forEach(u),bf.forEach(u);for(var h=0;h<Pl.length;h++){var m=Pl[h];m.blockedOn===o&&(m.blockedOn=null)}for(;0<Pl.length&&(h=Pl[0],h.blockedOn===null);)F2(h),h.blockedOn===null&&Pl.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[Zn]||null;if(typeof S=="function")C||W2(h);else if(C){var _=null;if(S&&S.hasAttribute("formAction")){if(b=S,C=S[Zn]||null)_=C.formAction;else if(Zb(b)!==null)continue}else _=C.action;typeof _=="function"?h[m+1]=_:(h.splice(m,3),m-=3),W2(h)}}}function V2(){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 ex(o){this._internalRoot=o}Ip.prototype.render=ex.prototype.render=function(o){var u=this._internalRoot;if(u===null)throw Error(r(409));var h=u.current,m=Or();I2(h,m,o,u,null,null)},Ip.prototype.unmount=ex.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var u=o.containerInfo;I2(o.current,2,null,o,null,null),vp(),u[Cs]=null}};function Ip(o){this._internalRoot=o}Ip.prototype.unstable_scheduleHydration=function(o){if(o){var u=nC();o={blockedOn:null,target:o,priority:u};for(var h=0;h<Pl.length&&u!==0&&u<Pl[h].priority;h++);Pl.splice(h,0,o),h===0&&F2(o)}};var K2=t.version;if(K2!=="19.2.7")throw Error(r(527,K2,"19.2.7"));Z.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 h9={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Bp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bp.isDisabled&&Bp.supportsFiber)try{Tc=Bp.inject(h9),mr=Bp}catch{}}return wf.createRoot=function(o,u){if(!i(o))throw Error(r(299));var h=!1,m="",b=eT,S=tT,C=nT;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=j2(o,1,!1,null,null,h,m,null,b,S,C,V2),o[Cs]=u.current,jb(o),new ex(u)},wf.hydrateRoot=function(o,u,h){if(!i(o))throw Error(r(299));var m=!1,b="",S=eT,C=tT,_=nT,j=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&&(_=h.onRecoverableError),h.formState!==void 0&&(j=h.formState)),u=j2(o,1,!0,u,h??null,m,b,j,S,C,_,V2),u.context=L2(null),h=u.current,m=Or(),m=qy(m),b=ml(m),b.callback=null,gl(h,b,m),h=m,u.current.lanes=h,Pc(u,h),_i(u),o[Cs]=u.current,jb(o),new Ip(u)},wf.version="19.2.7",wf}var rM;function O9(){if(rM)return rx.exports;rM=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(),rx.exports=w9(),rx.exports}var A9=O9();const k9=Ev(A9);var cc=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(){}},C9=class extends cc{#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"}},eO=new C9,E9={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},T9=class{#e=E9;#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 T9;function M9(e){setTimeout(e,0)}var P9=typeof window>"u"||"Deno"in globalThis;function Fn(){}function D9(e,t){return typeof e=="function"?e(t):e}function R1(e){return typeof e=="number"&&e>=0&&e!==1/0}function sL(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Fl(e,t){return typeof e=="function"?e(t):e}function Er(e,t){return typeof e=="function"?e(t):e}function iM(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:l,stale:s}=e;if(l){if(r){if(t.queryHash!==tO(l,t.options))return!1}else if(!sh(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 aM(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(rs(t.options.mutationKey)!==rs(a))return!1}else if(!sh(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function tO(e,t){return(t?.queryKeyHashFn||rs)(e)}function rs(e){return JSON.stringify(e,(t,n)=>j1(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function sh(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>sh(e[n],t[n])):!1}var _9=Object.prototype.hasOwnProperty;function uL(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=lM(e)&&lM(t);if(!r&&!(j1(e)&&j1(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:_9.call(e,p))&&f++;continue}if(g===null||v===null||typeof g!="object"||typeof v!="object"){c[p]=v;continue}const y=uL(g,v,n+1);c[p]=y,y===g&&f++}return a===s&&f===a?e:c}function Zm(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 lM(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function j1(e){if(!oM(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!oM(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function oM(e){return Object.prototype.toString.call(e)==="[object Object]"}function N9(e){return new Promise(t=>{zo.setTimeout(t,e)})}function L1(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?uL(e,t):t}function R9(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function j9(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var nO=Symbol();function cL(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===nO?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function rO(e,t){return typeof e=="function"?e(...t):!!e}function L9(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 uh=(()=>{let e=()=>P9;return{isServer(){return e()},setIsServer(t){e=t}}})();function I1(){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 I9=M9;function B9(){let e=[],t=0,n=s=>{s()},r=s=>{s()},i=I9;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 Gt=B9(),z9=class extends cc{#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}},Jm=new z9;function $9(e){return Math.min(1e3*2**e,3e4)}function fL(e){return(e??"online")==="online"?Jm.isOnline():!0}var B1=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function hL(e){let t=!1,n=0,r;const i=I1(),a=()=>i.status!=="pending",l=x=>{if(!a()){const w=new B1(x);g(w),e.onCancel?.(w)}},s=()=>{t=!0},c=()=>{t=!1},f=()=>eO.isFocused()&&(e.networkMode==="always"||Jm.isOnline())&&e.canRun(),d=()=>fL(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 E=e.retry??(uh.isServer()?0:3),k=e.retryDelay??$9,M=typeof k=="function"?k(n,A):k,D=E===!0||typeof E=="number"&&n<E||typeof E=="function"&&E(n,A);if(t||!D){g(A);return}n++,e.onFail?.(n,A),N9(M).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 dL=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),R1(this.gcTime)&&(this.#e=zo.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(uh.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(zo.clearTimeout(this.#e),this.#e=void 0)}};function U9(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=>{L9(y,()=>t.signal,()=>d=!0)},g=cL(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 E=(()=>{const P={client:t.client,queryKey:t.queryKey,pageParam:x,direction:w?"backward":"forward",meta:t.options.meta};return p(P),P})(),k=await g(E),{maxPages:M}=t.options,D=w?j9:R9;return{pages:D(y.pages,k,M),pageParams:D(y.pageParams,x,M)}};if(i&&a.length){const y=i==="backward",x=y?H9:sM,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:sM(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 sM(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 H9(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var F9=class extends dL{#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=cM(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=cM(this.options);t.data!==void 0&&(this.setState(uM(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const n=L1(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(Fn).catch(Fn):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=>Er(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===nO||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Fl(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:!sL(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=cL(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"?U9(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=hL({initialPromise:t?.initialPromise,fn:l.fetchFn,onCancel:c=>{c instanceof B1&&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 B1){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,...pL(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...uM(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),Gt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function pL(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:fL(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function uM(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function cM(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 q9=class extends cc{constructor(e,t){super(),this.options=t,this.#e=e,this.#l=null,this.#o=I1(),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),fM(this.#t,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return z1(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return z1(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 Er(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&&!Zm(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&hM(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),r&&(this.#t!==n||Er(this.options.enabled,this.#t)!==Er(t.enabled,this.#t)||Fl(this.options.staleTime,this.#t)!==Fl(t.staleTime,this.#t))&&this.#g();const i=this.#v();r&&(this.#t!==n||Er(this.options.enabled,this.#t)!==Er(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 V9(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(Fn)),t}#g(){this.#x();const e=Fl(this.options.staleTime,this.#t);if(uh.isServer()||this.#r.isStale||!R1(e))return;const n=sL(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,!(uh.isServer()||Er(this.options.enabled,this.#t)===!1||!R1(this.#u)||this.#u===0)&&(this.#h=zo.setInterval(()=>{(this.options.refetchIntervalInBackground||eO.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(),U=!L&&fM(e,t),K=L&&hM(e,n,t,r);(U||K)&&(d={...d,...pL(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=L1(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=L1(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",E=x==="pending",k=x==="error",M=E&&A,D=g!==void 0,N={status:x,fetchStatus:d.fetchStatus,isPending:E,isSuccess:x==="success",isError:k,isInitialLoading:M,isLoading:M,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&&!E,isLoadingError:k&&!D,isPaused:d.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:k&&D,isStale:iO(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Er(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const L=N.data!==void 0,U=N.status==="error"&&!L,K=oe=>{U?oe.reject(N.error):L&&oe.resolve(N.data)},V=()=>{const oe=this.#o=N.promise=I1();K(oe)},B=this.#o;switch(B.status){case"pending":e.queryHash===n.queryHash&&K(B);break;case"fulfilled":(U||N.data!==B.value)&&V();break;case"rejected":(!U||N.error!==B.reason)&&V();break}}return N}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),Zm(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){Gt.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function W9(e,t){return Er(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Er(t.retryOnMount,e)===!1)}function fM(e,t){return W9(e,t)||e.state.data!==void 0&&z1(e,t,t.refetchOnMount)}function z1(e,t,n){if(Er(t.enabled,e)!==!1&&Fl(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&iO(e,t)}return!1}function hM(e,t,n,r){return(e!==t||Er(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&iO(e,n)}function iO(e,t){return Er(t.enabled,e)!==!1&&e.isStaleByTime(Fl(t.staleTime,e))}function V9(e,t){return!Zm(e.getCurrentResult(),t)}var K9=class extends dL{#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||mL(),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=hL({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),Gt.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function mL(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Q9=class extends cc{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 K9({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=zp(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=zp(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=zp(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=zp(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Gt.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=>aM(t,n))}findAll(e={}){return this.getAll().filter(t=>aM(e,t))}notify(e){Gt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Gt.batch(()=>Promise.all(e.map(t=>t.continue().catch(Fn))))}};function zp(e){return e.options.scope?.id}var X9=class extends cc{#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),Zm(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&rs(n.mutationKey)!==rs(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??mL();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){Gt.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)})})}},Y9=class extends cc{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,i=t.queryHash??tO(r,t);let a=this.get(i);return a||(a=new F9({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(){Gt.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=>iM(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>iM(e,n)):t}notify(e){Gt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Gt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Gt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},G9=class{#e;#t;#n;#r;#a;#i;#o;#l;constructor(e={}){this.#e=e.queryCache||new Y9,this.#t=e.mutationCache||new Q9,this.#n=e.defaultOptions||{},this.#r=new Map,this.#a=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=eO.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#l=Jm.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(Fl(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=D9(t,a);if(l!==void 0)return this.#e.build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return Gt.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;Gt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Gt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Gt.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Fn).catch(Fn)}invalidateQueries(e,t={}){return Gt.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=Gt.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(Fn)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(Fn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Fl(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Fn).catch(Fn)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Fn).catch(Fn)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Jm.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(rs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{sh(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#a.set(rs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#a.values()],n={};return t.forEach(r=>{sh(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=tO(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===nO&&(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()}},gL=O.createContext(void 0),io=e=>{const t=O.useContext(gL);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Z9=({client:e,children:t})=>(O.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),T.jsx(gL.Provider,{value:e,children:t})),vL=O.createContext(!1),J9=()=>O.useContext(vL);vL.Provider;function eF(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var tF=O.createContext(eF()),nF=()=>O.useContext(tF),rF=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?rO(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},iF=e=>{O.useEffect(()=>{e.clearReset()},[e])},aF=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||rO(n,[e.error,r])),lF=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))}},oF=(e,t)=>e.isLoading&&e.isFetching&&!t,sF=(e,t)=>e?.suspense&&t.isPending,dM=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function uF(e,t,n){const r=J9(),i=nF(),a=io(),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,lF(l),rF(l,i,s),iF(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(Gt.batchCalls(v)):Fn;return d.updateResult(),y},[d,g]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),O.useEffect(()=>{d.setOptions(l)},[l,d]),sF(l,p))throw dM(l,d,i);if(aF({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&&!uh.isServer()&&oF(p,r)&&(f?dM(l,d,i):s?.promise)?.catch(Fn).finally(()=>{d.updateResult()}),l.notifyOnChangeProps?p:d.trackResult(p)}function Wi(e,t){return uF(e,q9)}function Wh(e,t){const n=io(),[r]=O.useState(()=>new X9(n,e));O.useEffect(()=>{r.setOptions(e)},[r,e]);const i=O.useSyncExternalStore(O.useCallback(l=>r.subscribe(Gt.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=O.useCallback((l,s)=>{r.mutate(l,s).catch(Fn)},[r]);if(i.error&&rO(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var aO=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,yL=/^[\\/]{2}/;function cF(e,t){return t+e.replace(/\\/g,"/")}var pM="popstate";function mM(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function fF(e={}){function t(r,i){let a=i.state?.masked,{pathname:l,search:s,hash:c}=a||r.location;return $1("",{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:ch(i)}return dF(t,n,null,e)}function Et(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ta(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function hF(){return Math.random().toString(36).substring(2,10)}function gM(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 $1(e,t,n=null,r,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?fc(t):t,state:n,key:t&&t.key||r||hF(),mask:i}}function ch({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 fc(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 dF(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 E=mM(w)?w:$1(x.location,w,A);f=d()+1;let k=gM(E,f),M=x.createHref(E.mask||E);try{l.pushState(k,"",M)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;i.location.assign(M)}a&&c&&c({action:s,location:x.location,delta:1})}function v(w,A){s="REPLACE";let E=mM(w)?w:$1(x.location,w,A);f=d();let k=gM(E,f),M=x.createHref(E.mask||E);l.replaceState(k,"",M),a&&c&&c({action:s,location:x.location,delta:0})}function y(w){return pF(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(pM,p),c=w,()=>{i.removeEventListener(pM,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 pF(e,t,n=!1){let r="http://localhost";e&&(r=e.location.origin!=="null"?e.location.origin:e.location.href),Et(r,"No window.location.(origin|href) available to create URL");let i=typeof t=="string"?t:ch(t);return i=i.replace(/ $/,"%20"),!n&&yL.test(i)&&(i=r+i),new URL(i,r)}function bL(e,t,n="/"){return mF(e,t,n,!1)}function mF(e,t,n,r,i){let a=typeof t=="string"?fc(t):t,l=Ha(a.pathname||"/",n);if(l==null)return null;let s=gF(e),c=null,f=EF(l);for(let d=0;c==null&&d<s.length;++d)c=CF(s[d],f,r);return c}function gF(e){let t=xL(e);return vF(t),t}function xL(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;Et(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=vi([r,d.relativePath]),g=n.concat(d);l.children&&l.children.length>0&&(Et(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),xL(l.children,t,g,p,c)),!(l.path==null&&!l.index)&&t.push({path:p,score:AF(p,l.index),routesMeta:g.map((v,y)=>{let[x,w]=OL(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 vF(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:kF(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var yF=/^:[\w-]+$/,bF=3,xF=2,SF=1,wF=10,OF=-2,vM=e=>e==="*";function AF(e,t){let n=e.split("/"),r=n.length;return n.some(vM)&&(r+=OF),t&&(r+=xF),n.filter(i=>!vM(i)).reduce((i,a)=>i+(yF.test(a)?bF:a===""?SF:wF),r)}function kF(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 CF(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?wL(p,d,c.matcher,c.compiledParams):eg(p,d),v=c.route;if(!g&&f&&n&&!r[r.length-1].route.index&&(g=eg({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!g)return null;Object.assign(i,g.params),l.push({params:i,pathname:vi([a,g.pathname]),pathnameBase:PF(vi([a,g.pathnameBase])),route:v}),g.pathnameBase!=="/"&&(a=vi([a,g.pathnameBase]))}return l}function eg(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=OL(e.path,e.caseSensitive,e.end);return wL(e,t,n,r)}function wL(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 OL(e,t=!1,n=!0){ta(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 EF(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ta(!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 Ha(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 TF(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?fc(e):e,a;return n?(n=kL(n),n.startsWith("/")?a=yM(n.substring(1),"/"):a=yM(n,t)):a=t,{pathname:a,search:DF(r),hash:_F(i)}}function yM(e,t){let n=tg(t).split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function ox(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 MF(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function AL(e){let t=MF(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function lO(e,t,n,r=!1){let i;typeof e=="string"?i=fc(e):(i={...e},Et(!i.pathname||!i.pathname.includes("?"),ox("?","pathname","search",i)),Et(!i.pathname||!i.pathname.includes("#"),ox("#","pathname","hash",i)),Et(!i.search||!i.search.includes("#"),ox("#","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=TF(i,s),f=l&&l!=="/"&&l.endsWith("/"),d=(a||l===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(f||d)&&(c.pathname+="/"),c}var kL=e=>e.replace(/[\\/]{2,}/g,"/"),vi=e=>kL(e.join("/")),tg=e=>e.replace(/\/+$/,""),PF=e=>tg(e).replace(/^\/*/,"/"),DF=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,_F=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,NF=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 RF(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function jF(e){let t=e.map(n=>n.route.path).filter(Boolean);return vi(t)||"/"}var CL=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function EL(e,t){let n=e;if(typeof n!="string"||!aO.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(CL)try{let a=new URL(window.location.href),l=yL.test(n)?new URL(cF(n,a.protocol)):new URL(n),s=Ha(l.pathname,t);l.origin===a.origin&&s!=null?n=s+l.search+l.hash:i=!0}catch{ta(!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 TL=["POST","PUT","PATCH","DELETE"];new Set(TL);var LF=["GET",...TL];new Set(LF);var IF=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function BF(e){try{return IF.includes(new URL(e).protocol)}catch{return!1}}var hc=O.createContext(null);hc.displayName="DataRouter";var Tv=O.createContext(null);Tv.displayName="DataRouterState";var ML=O.createContext(!1);function zF(){return O.useContext(ML)}var PL=O.createContext({isTransitioning:!1});PL.displayName="ViewTransition";var $F=O.createContext(new Map);$F.displayName="Fetchers";var UF=O.createContext(null);UF.displayName="Await";var ri=O.createContext(null);ri.displayName="Navigation";var Vh=O.createContext(null);Vh.displayName="Location";var la=O.createContext({outlet:null,matches:[],isDataRoute:!1});la.displayName="Route";var oO=O.createContext(null);oO.displayName="RouteError";var DL="REACT_ROUTER_ERROR",HF="REDIRECT",FF="ROUTE_ERROR_RESPONSE";function qF(e){if(e.startsWith(`${DL}:${HF}:{`))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 WF(e){if(e.startsWith(`${DL}:${FF}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new NF(t.status,t.statusText,t.data)}catch{}}function VF(e,{relative:t}={}){Et(Kh(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=O.useContext(ri),{hash:i,pathname:a,search:l}=Qh(e,{relative:t}),s=a;return n!=="/"&&(s=a==="/"?n:vi([n,a])),r.createHref({pathname:s,search:l,hash:i})}function Kh(){return O.useContext(Vh)!=null}function Ja(){return Et(Kh(),"useLocation() may be used only in the context of a <Router> component."),O.useContext(Vh).location}var _L="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function NL(e){O.useContext(ri).static||O.useLayoutEffect(e)}function Mv(){let{isDataRoute:e}=O.useContext(la);return e?aq():KF()}function KF(){Et(Kh(),"useNavigate() may be used only in the context of a <Router> component.");let e=O.useContext(hc),{basename:t,navigator:n}=O.useContext(ri),{matches:r}=O.useContext(la),{pathname:i}=Ja(),a=JSON.stringify(AL(r)),l=O.useRef(!1);return NL(()=>{l.current=!0}),O.useCallback((c,f={})=>{if(ta(l.current,_L),!l.current)return;if(typeof c=="number"){n.go(c);return}let d=lO(c,JSON.parse(a),i,f.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:vi([t,d.pathname])),(f.replace?n.replace:n.push)(d,f.state,f)},[t,n,a,i,e])}O.createContext(null);function sO(){let{matches:e}=O.useContext(la);return e[e.length-1]?.params??{}}function Qh(e,{relative:t}={}){let{matches:n}=O.useContext(la),{pathname:r}=Ja(),i=JSON.stringify(AL(n));return O.useMemo(()=>lO(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function QF(e,t){return RL(e,t)}function RL(e,t,n){Et(Kh(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=O.useContext(ri),{matches:i}=O.useContext(la),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||"";LL(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=Ja(),p;if(t){let w=typeof t=="string"?fc(t):t;Et(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})):bL(e,{pathname:v});ta(f||y!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),ta(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=JF(y&&y.map(w=>Object.assign({},w,{params:Object.assign({},l,w.params),pathname:vi([c,r.encodeLocation?r.encodeLocation(w.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?c:vi([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(Vh.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...p},navigationType:"POP"}},x):x}function XF(){let e=iq(),t=RF(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 YF=O.createElement(XF,null),jL=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=WF(e.digest);n&&(e=n)}let t=e!==void 0?O.createElement(la.Provider,{value:this.props.routeContext},O.createElement(oO.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?O.createElement(GF,{error:e},t):t}};jL.contextType=ML;var sx=new WeakMap;function GF({children:e,error:t}){let{basename:n}=O.useContext(ri);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=qF(t.digest);if(r){let i=sx.get(t);if(i)throw i;let a=EL(r.location,n),l=a.absoluteURL||a.to;if(BF(l))throw new Error("Invalid redirect location");if(CL&&!sx.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 sx.set(t,s),s}return O.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l}`})}}return e}function ZF({routeContext:e,match:t,children:n}){let r=O.useContext(hc);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),O.createElement(la.Provider,{value:e},n)}function JF(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);Et(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:jF(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||YF,l&&(s<0&&g===0?(LL("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)),E=()=>{let k;return v?k=x:y?k=w:p.route.Component?k=O.createElement(p.route.Component,null):p.route.element?k=p.route.element:k=d,O.createElement(ZF,{match:p,routeContext:{outlet:d,matches:A,isDataRoute:r!=null},children:k})};return r&&(p.route.ErrorBoundary||p.route.errorElement||g===0)?O.createElement(jL,{location:r.location,revalidation:r.revalidation,component:x,error:v,children:E(),routeContext:{outlet:null,matches:A,isDataRoute:!0},onError:f}):E()},null)}function uO(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function eq(e){let t=O.useContext(hc);return Et(t,uO(e)),t}function tq(e){let t=O.useContext(Tv);return Et(t,uO(e)),t}function nq(e){let t=O.useContext(la);return Et(t,uO(e)),t}function cO(e){let t=nq(e),n=t.matches[t.matches.length-1];return Et(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function rq(){return cO("useRouteId")}function iq(){let e=O.useContext(oO),t=tq("useRouteError"),n=cO("useRouteError");return e!==void 0?e:t.errors?.[n]}function aq(){let{router:e}=eq("useNavigate"),t=cO("useNavigate"),n=O.useRef(!1);return NL(()=>{n.current=!0}),O.useCallback(async(i,a={})=>{ta(n.current,_L),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...a}))},[e,t])}var bM={};function LL(e,t,n){!t&&!bM[e]&&(bM[e]=!0,ta(!1,n))}O.memo(lq);function lq({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return RL(e,void 0,{manifest:t,state:r,isStatic:i,onError:a})}function Uf(e){Et(!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 oq({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:a=!1,useTransitions:l}){Et(!Kh(),"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=fc(n));let{pathname:f="/",search:d="",hash:p="",state:g=null,key:v="default",mask:y}=n,x=O.useMemo(()=>{let w=Ha(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 ta(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(ri.Provider,{value:c},O.createElement(Vh.Provider,{children:t,value:x}))}function sq({children:e,location:t}){return QF(U1(e),t)}function U1(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,U1(r.props.children,a));return}Et(r.type===Uf,`[${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>`),Et(!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=U1(r.props.children,a)),n.push(l)}),n}var Rm="get",jm="application/x-www-form-urlencoded";function Pv(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function uq(e){return Pv(e)&&e.tagName.toLowerCase()==="button"}function cq(e){return Pv(e)&&e.tagName.toLowerCase()==="form"}function fq(e){return Pv(e)&&e.tagName.toLowerCase()==="input"}function hq(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function dq(e,t){return e.button===0&&(!t||t==="_self")&&!hq(e)}var $p=null;function pq(){if($p===null)try{new FormData(document.createElement("form"),0),$p=!1}catch{$p=!0}return $p}var mq=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ux(e){return e!=null&&!mq.has(e)?(ta(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${jm}"`),null):e}function gq(e,t){let n,r,i,a,l;if(cq(e)){let s=e.getAttribute("action");r=s?Ha(s,t):null,n=e.getAttribute("method")||Rm,i=ux(e.getAttribute("enctype"))||jm,a=new FormData(e)}else if(uq(e)||fq(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?Ha(c,t):null,n=e.getAttribute("formmethod")||s.getAttribute("method")||Rm,i=ux(e.getAttribute("formenctype"))||ux(s.getAttribute("enctype"))||jm,a=new FormData(s,e),!pq()){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(Pv(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Rm,r=null,i=jm,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 fO(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function IL(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&&Ha(i.pathname,t)==="/"?i.pathname=`${tg(t)}/_root.${r}`:i.pathname=`${tg(i.pathname)}.${r}`,i}async function vq(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 yq(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 bq(e,t,n){let r=await Promise.all(e.map(async i=>{let a=t.routes[i.route.id];if(a){let l=await vq(a,n);return l.links?l.links():[]}return[]}));return Oq(r.flat(1).filter(yq).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function xM(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 xq(e,t,{includeHydrateFallback:n}={}){return Sq(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 Sq(e){return[...new Set(e)]}function wq(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Oq(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let a=JSON.stringify(wq(i));return n.has(a)||(n.add(a),r.push({key:a,link:i})),r},[])}function hO(){let e=O.useContext(hc);return fO(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Aq(){let e=O.useContext(Tv);return fO(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var dO=O.createContext(void 0);dO.displayName="FrameworkContext";function Dv(){let e=O.useContext(dO);return fO(e,"You must render this element inside a <HydratedRouter> element"),e}function kq(e,t){let n=O.useContext(dO),[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(E=>{l(E.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:Of(s,v),onBlur:Of(c,y),onMouseEnter:Of(f,v),onMouseLeave:Of(d,y),onTouchStart:Of(p,v)}]:[!1,g,{}]}function Of(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Cq({page:e,...t}){let n=zF(),{nonce:r}=Dv(),{router:i}=hO(),a=O.useMemo(()=>bL(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?O.createElement(Tq,{page:e,matches:a,...t}):O.createElement(Mq,{page:e,matches:a,...t})):null}function Eq(e){let{manifest:t,routeModules:n}=Dv(),[r,i]=O.useState([]);return O.useEffect(()=>{let a=!1;return bq(e,t,n).then(l=>{a||i(l)}),()=>{a=!0}},[e,t,n]),r}function Tq({page:e,matches:t,...n}){let r=Ja(),{future:i}=Dv(),{basename:a}=hO(),l=O.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let s=IL(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 Mq({page:e,matches:t,...n}){let r=Ja(),{future:i,manifest:a,routeModules:l}=Dv(),{basename:s}=hO(),{loaderData:c,matches:f}=Aq(),d=O.useMemo(()=>xM(e,t,f,a,r,"data"),[e,t,f,a,r]),p=O.useMemo(()=>xM(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(E=>{let k=a.routes[E.route.id];!k||!k.hasLoader||(!d.some(M=>M.route.id===E.route.id)&&E.route.id in c&&l[E.route.id]?.shouldRevalidate||k.hasClientLoader?w=!0:x.add(E.route.id))}),x.size===0)return[];let A=IL(e,s,i.v8_trailingSlashAwareDataRequests,"data");return w&&x.size>0&&A.searchParams.set("_routes",t.filter(E=>x.has(E.route.id)).map(E=>E.route.id).join(",")),[A.pathname+A.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,d,t,e,l]),v=O.useMemo(()=>xq(p,a),[p,a]),y=Eq(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 Pq(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var Dq=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Dq&&(window.__reactRouterVersion="7.18.2")}catch{}function _q({basename:e,children:t,useTransitions:n,window:r}){let i=O.useRef();i.current==null&&(i.current=fF({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(oq,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:a,useTransitions:n})}var yi=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:E}=O.useContext(ri),k=typeof d=="string"&&aO.test(d),M=EL(d,w);d=M.to;let D=VF(d,{relative:i}),P=Ja(),N=null;if(s){let ue=lO(s,[],P.mask?P.mask.pathname:"/",!0);w!=="/"&&(ue.pathname=ue.pathname==="/"?w:vi([w,ue.pathname])),N=A.createHref(ue)}let[L,U,K]=kq(r,y),V=Lq(d,{replace:l,mask:s,state:c,target:f,preventScrollReset:p,relative:i,viewTransition:g,defaultShouldRevalidate:v,useTransitions:E});function B(ue){t&&t(ue),ue.defaultPrevented||V(ue)}let oe=!(M.isExternal||a),ie=O.createElement("a",{...y,...K,href:(oe?N:void 0)||M.absoluteURL||D,onClick:oe?B:t,ref:Pq(x,U),target:f,"data-discover":!k&&n==="render"?"true":void 0});return L&&!k?O.createElement(O.Fragment,null,ie,O.createElement(Cq,{page:D})):ie});yi.displayName="Link";var Nq=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=Qh(l,{relative:f.relative}),g=Ja(),v=O.useContext(Tv),{navigator:y,basename:x}=O.useContext(ri),w=v!=null&&Uq(p)&&s===!0,A=y.encodeLocation?y.encodeLocation(p).pathname:p.pathname,E=g.pathname,k=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(E=E.toLowerCase(),k=k?k.toLowerCase():null,A=A.toLowerCase()),k&&x&&(k=Ha(k,x)||k);const M=A!=="/"&&A.endsWith("/")?A.length-1:A.length;let D=E===A||!i&&E.startsWith(A)&&E.charAt(M)==="/",P=k!=null&&(k===A||!i&&k.startsWith(A)&&k.charAt(A.length)==="/"),N={isActive:D,isPending:P,isTransitioning:w},L=D?t:void 0,U;typeof r=="function"?U=r(N):U=[r,D?"active":null,P?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let K=typeof a=="function"?a(N):a;return O.createElement(yi,{...f,"aria-current":L,className:U,ref:d,style:K,to:l,viewTransition:s},typeof c=="function"?c(N):c)});Nq.displayName="NavLink";var Rq=O.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:l=Rm,action:s,onSubmit:c,relative:f,preventScrollReset:d,viewTransition:p,defaultShouldRevalidate:g,...v},y)=>{let{useTransitions:x}=O.useContext(ri),w=zq(),A=$q(s,{relative:f}),E=l.toLowerCase()==="get"?"get":"post",k=typeof s=="string"&&aO.test(s),M=D=>{if(c&&c(D),D.defaultPrevented)return;D.preventDefault();let P=D.nativeEvent.submitter,N=P?.getAttribute("formmethod")||l,L=()=>w(P||D.currentTarget,{fetcherKey:t,method:N,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:E,action:A,onSubmit:r?c:M,...v,"data-discover":!k&&e==="render"?"true":void 0})});Rq.displayName="Form";function jq(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function BL(e){let t=O.useContext(hc);return Et(t,jq(e)),t}function Lq(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:l,viewTransition:s,defaultShouldRevalidate:c,useTransitions:f}={}){let d=Mv(),p=Ja(),g=Qh(e,{relative:l});return O.useCallback(v=>{if(dq(v,t)){v.preventDefault();let y=n!==void 0?n:ch(p)===ch(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 Iq=0,Bq=()=>`__${String(++Iq)}__`;function zq(){let{router:e}=BL("useSubmit"),{basename:t}=O.useContext(ri),n=rq(),r=e.fetch,i=e.navigate;return O.useCallback(async(a,l={})=>{let{action:s,method:c,encType:f,formData:d,body:p}=gq(a,t);if(l.navigate===!1){let g=l.fetcherKey||Bq();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 $q(e,{relative:t}={}){let{basename:n}=O.useContext(ri),r=O.useContext(la);Et(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),a={...Qh(e||".",{relative:t})},l=Ja();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:vi([n,a.pathname])),ch(a)}function Uq(e,{relative:t}={}){let n=O.useContext(PL);Et(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=BL("useViewTransitionState"),i=Qh(e,{relative:t});if(!n.isTransitioning)return!1;let a=Ha(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=Ha(n.nextLocation.pathname,r)||n.nextLocation.pathname;return eg(i.pathname,l)!=null||eg(i.pathname,a)!=null}var pO=oL();class fh extends Error{constructor(t,n){super(n),this.status=t}status}async function Hn(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 fh(n.status,r)}if(n.status!==204)return n.json()}const Ct={health:()=>Hn("/api/health"),configs:()=>Hn("/api/configs"),config:e=>Hn(`/api/configs/${e}`),createConfig:(e,t)=>Hn("/api/configs",{method:"POST",body:JSON.stringify({filename:e,content:t})}),updateConfig:(e,t,n)=>Hn(`/api/configs/${e}`,{method:"PUT",body:JSON.stringify({content:t,baseHash:n})}),deleteConfig:e=>Hn(`/api/configs/${e}`,{method:"DELETE"}),validateConfig:e=>Hn("/api/configs/validate",{method:"POST",body:JSON.stringify({content:e})}),triggerRun:(e,t,n)=>Hn(`/api/configs/${e}/run`,{method:"POST",...t?.length?{body:JSON.stringify({sources:t,baseHash:n})}:{}}),configStats:(e,t)=>Hn(`/api/configs/${e}/stats?days=${t}`),chunksForUrl:(e,t)=>{const n=new URLSearchParams;return n.set("product_name",t.product_name),t.type&&n.set("type",t.type),t.version&&n.set("version",t.version),n.set("url",t.url),Hn(`/api/configs/${e}/chunks?${n}`)},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)),Hn(`/api/runs?${t}`)},run:e=>Hn(`/api/runs/${e}`),runLogs:(e,t={})=>Hn(`/api/runs/${e}/logs?${SM(t)}`),runLogCounts:e=>Hn(`/api/runs/${e}/logs/counts`),runLogsDownloadUrl:(e,t={})=>{const n=SM(t);return`/api/runs/${e}/logs/download${n?`?${n}`:""}`},cancelRun:e=>Hn(`/api/runs/${e}/cancel`,{method:"POST"})};function SM(e){const t=new URLSearchParams;return e.afterSeq!==void 0&&t.set("afterSeq",String(e.afterSeq)),e.limit!==void 0&&t.set("limit",String(e.limit)),e.levels?.length&&t.set("levels",e.levels.join(",")),e.q&&t.set("q",e.q),t.toString()}var cx={exports:{}},wM;function Hq(){return wM||(wM=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,E){return A!==null&&E!==null?A-E: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(D){var P=D.replace(/\D/,""),N=P;return v.dayOfWeekStartIndexZero?P=="7"&&(N="0"):N=(parseInt(P)-1).toString(),D.replace(P,N)}),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(D){var P=D.replace(/\D/,""),N=P;return v.monthStartIndexZero&&(N=(parseInt(P)+1).toString()),D.replace(P,N)});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 E=0;E<g.length;E++)if(g[E].indexOf(",")!=-1&&(g[E]=g[E].split(",").filter(function(D){return D!==""}).join(",")||"*"),g[E]=="*/1"&&(g[E]="*"),g[E].indexOf("/")>-1&&!/^\*|\-|\,/.test(g[E])){var k=null;switch(E){case 4:k="12";break;case 5:k="6";break;case 6:k="9999";break;default:k=null;break}if(k!==null){var M=g[E].split("/");g[E]="".concat(M[0],"-").concat(k,"/").concat(M[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,E=x.verbose,k=E===void 0?!1:E,M=x.dayOfWeekStartIndexZero,D=M===void 0?!0:M,P=x.monthStartIndexZero,N=P===void 0?!1:P,L=x.use24HourTimeFormat,U=x.trimHoursLeadingZero,K=U===void 0?!1:U,V=x.locale,B=V===void 0?null:V,oe=x.logicalAndDayFields,ie=oe===void 0?!1:oe,ue={throwExceptionOnParseError:A,verbose:k,dayOfWeekStartIndexZero:D,monthStartIndexZero:N,use24HourTimeFormat:L,trimHoursLeadingZero:K,locale:B,logicalAndDayFields:ie};ue.tzOffset&&console.warn("'tzOffset' option has been deprecated and is no longer supported.");var z=new g(v,ue);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(),E=this.getDayOfMonthDescription(),k=this.getMonthDescription(),M=this.getDayOfWeekDescription(),D=this.getYearDescription();x+=A+E+M+k+D,x=this.transformVerbosity(x,!!this.options.verbose),x=x.charAt(0).toLocaleUpperCase()+x.substr(1)}catch(P){if(!this.options.throwExceptionOnParseError)x=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();else throw"".concat(P)}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 E=x.split(",");w+=this.i18n.at();for(var k=0;k<E.length;k++)w&&(w+=" "),w+=this.formatTime(E[k],y,""),k<E.length-2&&(w+=","),k==E.length-2&&(w+=this.i18n.spaceAnd())}else{var M=this.getSecondsDescription(),D=this.getMinutesDescription(),P=this.getHoursDescription();if(w+=M,w&&D&&(w+=", "),w+=D,D===P)return w;w&&P&&(w+=", "),w+=P}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 E,k;try{return A=="0"&&x.indexOf("/")==-1&&y==""?v.i18n.everyHour():A=="0"?((k=(E=v.i18n).onTheHour)===null||k===void 0?void 0:k.call(E))||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(k){var M=k.split("-");M.length===2&&w.push({value:M[1],index:x+1}),x+=M.length});var A=0,E=this.getSegmentDescription(y,this.i18n.everyHour(),function(k){var M=w.find(function(P){return P.value===k&&P.index===A}),D=M&&v.expressionParts[1]!=="0";return A++,D?v.formatTime(k,"59",""):v.formatTime(k,"0","")},function(k){return f.StringUtilities.format(v.i18n.everyX0Hours(k),k)},function(k){return v.i18n.betweenX0AndX1()},function(k){return v.i18n.atX0()});return E},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 E=w;w.indexOf("#")>-1?E=w.substring(0,w.indexOf("#")):w.indexOf("L")>-1&&(E=E.replace("L",""));var k=parseInt(E),M=v.i18n.daysOfTheWeekInCase?v.i18n.daysOfTheWeekInCase(A)[k]:y[k];if(w.indexOf("#")>-1){var D=null,P=w.substring(w.indexOf("#")+1),N=w.substring(0,w.indexOf("#"));switch(P){case"1":D=v.i18n.first(N);break;case"2":D=v.i18n.second(N);break;case"3":D=v.i18n.third(N);break;case"4":D=v.i18n.fourth(N);break;case"5":D=v.i18n.fifth(N);break}M=D+" "+M}return M},function(w){return parseInt(w)==1?"":f.StringUtilities.format(v.i18n.commaEveryX0DaysOfTheWeek(w),w)},function(w){var A=w.substring(0,w.indexOf("-")),E=v.expressionParts[3]!="*";return E?v.i18n.commaAndX0ThroughX1(A):v.i18n.commaX0ThroughX1(A)},function(w){var A=null;if(w.indexOf("#")>-1){var E=w.substring(w.indexOf("#")+1),k=w.substring(0,w.indexOf("#"));A=v.i18n.commaOnThe(E,k).trim()+v.i18n.spaceX0OfTheMonth()}else if(w.indexOf("L")>-1)A=v.i18n.commaOnTheLastX0OfTheMonth(w.replace("L",""));else{var M=v.expressionParts[3]!="*";M?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","")),E=A==1?this.i18n.firstWeekday():f.StringUtilities.format(this.i18n.weekdayNearestDayX0(),A.toString());y=f.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),E);break}else{var k=x.match(/L-(\d{1,2})/);if(k){var M=k[1];y=f.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(M),M);break}else{if(x=="*"&&this.expressionParts[5]!="*")return"";y=this.getSegmentDescription(x,this.i18n.commaEveryDay(),function(D){return D=="L"?v.i18n.lastDay():v.i18n.dayX0?f.StringUtilities.format(v.i18n.dayX0(),D):D},function(D){return D=="1"?v.i18n.commaEveryDay():v.i18n.commaEveryX0Days(D)},function(D){return v.i18n.commaBetweenDayX0AndX1OfTheMonth(D)},function(D){return v.i18n.commaOnDayX0OfTheMonth(D)})}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,E){var k=null,M=v.indexOf("/")>-1,D=v.indexOf("-")>-1,P=v.indexOf(",")>-1;if(!v)k="";else if(v==="*")k=y;else if(!M&&!D&&!P)k=f.StringUtilities.format(E(v),x(v));else if(P){for(var N=v.split(","),L="",U=this.i18n.spaceAnd(),K=0;K<N.length;K++)if(K>0&&N.length>2&&(L+=",",K<N.length-1&&(L+=" ")),K>0&&N.length>1&&(K==N.length-1||N.length==2)&&(L+=U==","&&N.length>2?" ":"".concat(U," ")),N[K].indexOf("/")>-1||N[K].indexOf("-")>-1){var V=N[K].indexOf("-")>-1&&N[K].indexOf("/")==-1,B=this.getSegmentDescription(N[K],y,x,w,V?this.i18n.commaX0ThroughX1:A,E);V&&(B=B.replace(", ","")),L+=B}else if(!M)L+=x(N[K]);else{var oe=this.getSegmentDescription(N[K],y,x,w,A,E);oe&&oe.startsWith(", ")&&(oe=oe.substring(2)),L+=oe}M?k=L:k=f.StringUtilities.format(E(v),L)}else if(M){var N=v.split("/");if(k=f.StringUtilities.format(w(N[1]),N[1]),N[0].indexOf("-")>-1){var ie=this.generateRangeSegmentDescription(N[0],A,x);ie.indexOf(", ")!=0&&(k+=", "),k+=ie}else if(N[0].indexOf("*")==-1){var ue=f.StringUtilities.format(E(N[0]),x(N[0]));ue=ue.replace(", ",""),k+=f.StringUtilities.format(this.i18n.commaStartingX0(),ue)}}else D&&(k=this.generateRangeSegmentDescription(v,A,x));return k},g.prototype.generateRangeSegmentDescription=function(v,y,x){var w="",A=v.split("-"),E=x(A[0],1),k=x(A[1],2),M=y(v);return w+=f.StringUtilities.format(M,E,k),w},g.prototype.formatTime=function(v,y,x){var w=0,A=0,E=parseInt(v)+w,k=parseInt(y)+A;k>=60?(k-=60,E+=1):k<0&&(k+=60,E-=1),E>=24?E=E-24:E<0&&(E=24+E);var M="",D=!1;this.options.use24HourTimeFormat||(D=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),M=D?"".concat(this.getPeriod(E)," "):" ".concat(this.getPeriod(E)),E>12&&(E-=12),E===0&&(E=12));var P="";x&&(P=":".concat(("00"+x).substring(x.length)));var N=E.toString(),L=("00"+N).substring(N.length),U=k.toString(),K=("00"+U).substring(U.length),V=this.options.trimHoursLeadingZero?N:L;return"".concat(D?M:"").concat(V,":").concat(K).concat(P).concat(D?"":M)},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],E=A[0],k=A[1];v=v.replace(new RegExp(E,"g"),k)}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})())})(cx)),cx.exports}var Fq=Hq();const qq=Ev(Fq);function Fu(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 mO(e,t){if(!e)return"—";const n=t?new Date(t).getTime():Date.now();return Fu((n-new Date(e).getTime())/1e3)}function Fa(e){return e?new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}function H1(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 gO(e){if(!e)return"Manual only";try{return qq.toString(e,{verbose:!1})}catch{return e}}const OM={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 _v({status:e}){const t=OM[e]??OM.queued;return T.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:[T.jsx("span",{"aria-hidden":!0,children:t.symbol}),t.label]})}var Ve=Symbol("NOT_RESOLVED");function Nn(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,represent:t.represent??(n=>String(n)),representTagName:t.representTagName??(()=>e)}}function vO(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,represent:t.represent??(r=>r),representTagName:t.representTagName??(()=>e)}}function Nv(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,represent:t.represent??(r=>r),representTagName:t.representTagName??(()=>e)}}var Wq=Nn("tag:yaml.org,2002:str",{resolve:e=>e,identify:e=>typeof e=="string"}),Vq=["","~","null","Null","NULL"],Kq=Nn("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:e=>Vq.indexOf(e)!==-1?null:Ve,identify:e=>e===null,represent:()=>"null"}),Qq=Nn("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["n"],resolve:(e,t)=>e==="null"||t&&e===""?null:Ve,identify:e=>e===null,represent:()=>"null"}),Xq=["","~","null","Null","NULL"],Yq=Nn("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:e=>Xq.indexOf(e)!==-1?null:Ve,identify:e=>e===null,represent:()=>"null"}),Gq=["true","True","TRUE"],Zq=["false","False","FALSE"],Jq=Nn("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","T","f","F"],resolve:e=>Gq.indexOf(e)!==-1?!0:Zq.indexOf(e)!==-1?!1:Ve,identify:e=>Object.prototype.toString.call(e)==="[object Boolean]",represent:e=>e?"true":"false"}),eW=["true"],tW=["false"],nW=Nn("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","f"],resolve:e=>eW.indexOf(e)!==-1?!0:tW.indexOf(e)!==-1?!1:Ve,identify:e=>Object.prototype.toString.call(e)==="[object Boolean]",represent:e=>e?"true":"false"}),rW=["true","True","TRUE","y","Y","yes","Yes","YES","on","On","ON"],iW=["false","False","FALSE","n","N","no","No","NO","off","Off","OFF"],aW=Nn("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["y","Y","n","N","t","T","f","F","o","O"],resolve:e=>rW.indexOf(e)!==-1?!0:iW.indexOf(e)!==-1?!1:Ve,identify:e=>Object.prototype.toString.call(e)==="[object Boolean]",represent:e=>e?"true":"false"}),lW=new RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$"),oW=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");function sW(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 uW(e,t){if(t){if(!oW.test(e))return Ve}else if(!lW.test(e))return Ve;const n=sW(e);return Number.isFinite(n)?n:Ve}var zL=Nn("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:uW,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:e=>e.toString(10)}),cW=new RegExp("^-?(?:0|[1-9][0-9]*)$"),fW=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");function hW(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 dW(e,t){if(t){if(!fW.test(e))return Ve}else if(!cW.test(e))return Ve;const n=hW(e);return Number.isFinite(n)?n:Ve}var pW=Nn("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:dW,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:e=>e.toString(10)}),mW=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 gW(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 vW(e){if(!mW.test(e))return Ve;const t=gW(e);return Number.isFinite(t)?t:Ve}var F1=Nn("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:vW,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:e=>e.toString(10)}),yW=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[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 Ve;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)||bW.test(e)?r:Ve}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 $L=Nn("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=new RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$"),OW=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function AW(e,t){if(t){if(!OW.test(e))return Ve;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:Ve}if(!wW.test(e))return Ve;const n=Number(e);return Number.isFinite(n)?n:Ve}function kW(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 CW=Nn("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:AW,identify:e=>typeof e=="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:kW}),EW=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))$"),TW=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function MW(e){if(!EW.test(e))return Ve;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)||TW.test(e)?r:Ve}function PW(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 q1=Nn("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:PW}),DW=Nn("tag:yaml.org,2002:merge",{implicit:!0,implicitFirstChars:["<"],resolve:(e,t)=>e==="<<"||t&&e===""?"<<":Ve,identify:()=>!1}),_W=/^[A-Za-z0-9+/]*={0,2}$/;function NW(e){const t=e.replace(/\s/g,"");if(t.length%4!==0||!_W.test(t))return Ve;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 RW(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}var jW=Nn("tag:yaml.org,2002:binary",{resolve:NW,identify:e=>Object.prototype.toString.call(e)==="[object Uint8Array]",represent:RW}),LW=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),IW=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 AM(e,t,n,r=0,i=0,a=0,l=0){const s=new Date(Date.UTC(e,t,n,r,i,a,l));return s.setUTCFullYear(e,t,n),s}function BW(e){let t=LW.exec(e);if(t===null&&(t=IW.exec(e)),t===null)return Ve;const n=+t[1],r=+t[2]-1,i=+t[3];if(!t[4]){const d=AM(n,r,i);return d.getUTCFullYear()!==n||d.getUTCMonth()!==r||d.getUTCDate()!==i?Ve:d}const a=+t[4],l=+t[5],s=+t[6];let c=0;if(a>23||l>59||s>59)return Ve;if(t[7]){let d=t[7].slice(0,3);for(;d.length<3;)d+="0";c=+d}const f=AM(n,r,i,a,l,s,c);if(f.getUTCFullYear()!==n||f.getUTCMonth()!==r||f.getUTCDate()!==i)return Ve;if(t[9]){const d=+t[10],p=+(t[11]||0);if(d>23||p>59)return Ve;const g=(d*60+p)*6e4;f.setTime(f.getTime()-(t[9]==="-"?-g:g))}return f}var zW=Nn("tag:yaml.org,2002:timestamp",{implicit:!0,implicitFirstChars:[..."0123456789"],resolve:BW,identify:e=>e instanceof Date,represent:e=>e.toISOString()}),$W=vO("tag:yaml.org,2002:seq",{create:()=>[],addItem:(e,t)=>{e.push(t)},identify:Array.isArray});function Rv(e){if(e===null||typeof e!="object"||Array.isArray(e))return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function W1(e,t){const n={};for(const r of t)e[r]!==void 0&&(n[r]=e[r]);return n}var UW=vO("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(Rv(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,identify:()=>!1}),HW=vO("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]]]),"")},identify:()=>!1}),FW=Nv("tag:yaml.org,2002:map",{create:()=>({}),identify:Rv,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)=>{const n=String(t);return Object.prototype.hasOwnProperty.call(e,n)?e[n]:null}}),qW=Nv("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 WW(){return{scalar:Object.create(null),sequence:Object.create(null),mapping:Object.create(null)}}function VW(){return{scalar:[],sequence:[],mapping:[]}}function KW(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 jv=class UL{tags;implicitScalarTags;implicitScalarByFirstChar;implicitScalarAnyFirstChar;defaultScalarTag;defaultSequenceTag;defaultMappingTag;exact;prefix;constructor(t){const n=KW(t),r=[],i=WW(),a=VW();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}lookupScalarTag(t){const n=this.exact.scalar[t];if(n)return n;for(const r of this.prefix.scalar)if(t.startsWith(r.tagName))return r}lookupSequenceTag(t){const n=this.exact.sequence[t];if(n)return n;for(const r of this.prefix.sequence)if(t.startsWith(r.tagName))return r}lookupMappingTag(t){const n=this.exact.mapping[t];if(n)return n;for(const r of this.prefix.mapping)if(t.startsWith(r.tagName))return r}resolveImplicitScalarTag(t){const n=this.implicitScalarByFirstChar.get(t.charAt(0))??this.implicitScalarAnyFirstChar;for(const i of n){const a=i.resolve(t,!1,i.tagName);if(a!==Ve)return{value:a,tag:i}}const r=this.defaultScalarTag;return{value:r.resolve(t,!1,r.tagName),tag:r}}withTags(...t){let n=[];for(const r of t)n=n.concat(r);return new UL([...this.tags,...n])}},yO=new jv([Wq,$W,FW]);new jv([...yO.tags,Qq,nW,pW,CW]);var QW=new jv([...yO.tags,Kq,Jq,zL,$L]),XW=new jv([...yO.tags,Yq,aW,F1,q1,zW,DW,jW,UW,HW,qW]),YW=XW.withTags({...F1,resolve:(e,t,n)=>{const r=F1.resolve(e,t,n);return r===Ve?zL.resolve(e,t,n):r}},{...q1,resolve:(e,t,n)=>{const r=q1.resolve(e,t,n);return r===Ve?$L.resolve(e,t,n):r}});Nv("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||Rv(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 kM(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)}Nv("tag:yaml.org,2002:map",{create:()=>({}),identify:Rv,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=kM(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=kM(t);return n!==null&&Object.prototype.hasOwnProperty.call(e,n)},keys:e=>Object.keys(e),get:(e,t)=>{const n=String(t);return Object.prototype.hasOwnProperty.call(e,n)?e[n]:null}});var GW={maxLength:79,indent:1,linesBefore:3,linesAfter:2};function fx(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 hx(e,t){return" ".repeat(Math.max(t-e.length,0))+e}function ZW(e,t){if(!e.buffer)return null;const n={...GW,...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=fx(e.buffer,i[s-g],a[s-g],e.position-(i[s]-i[s-g]),d);c=`${" ".repeat(n.indent)}${hx((e.line-g+1).toString(),f)} | ${v.str}
|
|
12
|
-
${c}`}const p=fx(e.buffer,i[s],a[s],e.position,d);c+=`${" ".repeat(n.indent)}${hx((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=fx(e.buffer,i[s+g],a[s+g],e.position-(i[s]-i[s+g]),d);c+=`${" ".repeat(n.indent)}${hx((e.line+g+1).toString(),f)} | ${v.str}
|
|
15
|
-
`}return c.replace(/\n$/,"")}function CM(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 Kl=class HL extends Error{reason;mark;constructor(t,n){super(),this.name="YAMLException",this.reason=t,this.mark=n,this.message=CM(this,!1),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toString(t){return`${this.name}: ${CM(this,t)}`}static throwAt(t,n,r,i=""){let a=0,l=0;for(let c=0;c<n;c++){const f=t.charCodeAt(c);f===10?(a++,l=c+1):f===13&&(a++,t.charCodeAt(c+1)===10&&c++,l=c+1)}const s={name:i,buffer:t,position:n,line:a,column:n-l};throw s.snippet=ZW(s),new HL(r,s)}},Mn={DOCUMENT:1,SEQUENCE:2,MAPPING:3,SCALAR:4,ALIAS:5,POP:6},Xr={PLAIN:1,SINGLE_QUOTED:2,DOUBLE_QUOTED:3,LITERAL_BLOCK:4,FOLDED_BLOCK:5},qu={BLOCK:1,FLOW:2},Vi={CLIP:1,STRIP:2,KEEP:3},JW=-1;function EM(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 FL=new Array(256),qL=new Array(256);for(let e=0;e<256;e++)FL[e]=EM(e)?1:0,qL[e]=EM(e);function eV(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function tV(e){return e>=48&&e<=57?e-48:(e|32)-97+10}function nV(e){return e===120?2:e===117?4:8}function ng(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 bO(e){return e===1?" ":`
|
|
19
|
-
`.repeat(e-1)}function rV(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=ng(e,i,n);r+=bO(c.breaks),i=a=l=c.position}else i++,s!==32&&s!==9&&(l=i)}return r+e.slice(a,l)}function iV(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=ng(e,i,n);r+=bO(c.breaks),i=a=l=c.position}else i++,s!==32&&s!==9&&(l=i)}return r+e.slice(a,n)}function aV(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=ng(e,i,n).position;else if(c<256&&FL[c])r+=qL[c],i++;else{let f=nV(c),d=0;for(;f>0;f--){i++;const p=tV(e.charCodeAt(i));d=(d<<4)+p}r+=eV(d),i++}a=l=i}else if(s===10||s===13){r+=e.slice(a,l);const c=ng(e,i,n);r+=bO(c.breaks),i=a=l=c.position}else i++,s!==32&&s!==9&&(l=i)}return r+e.slice(a,n)}function TM(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===Vi.KEEP?f+=`
|
|
27
|
-
`.repeat(d?1+p:p):i!==Vi.STRIP&&d&&(f+=`
|
|
28
|
-
`),f}function lV(e,t){if(t.valueStart===JW)return"";const{valueStart:n,valueEnd:r}=t;if(t.fast)return e.slice(n,r);switch(t.style){case Xr.SINGLE_QUOTED:return iV(e,n,r);case Xr.DOUBLE_QUOTED:return aV(e,n,r);case Xr.LITERAL_BLOCK:return TM(e,n,r,t.indent,t.chomping,!1);case Xr.FOLDED_BLOCK:return TM(e,n,r,t.indent,t.chomping,!0);default:return rV(e,n,r)}}var oV=Object.assign(Object.create(null),{"!":"!","!!":"tag:yaml.org,2002:"});function dx(e){return encodeURI(e).replace(/!/g,"%21")}function WL(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]??oV[r]??r;return decodeURIComponent(i)+decodeURIComponent(e.slice(r.length))}function VL(e){let t=e;return t.charCodeAt(0)===33?(t=t.slice(1),`!${dx(t)}`):t.slice(0,18)==="tag:yaml.org,2002:"?`!!${dx(t.slice(18))}`:`!<${dx(t)}>`}var Mu=-1,sV="tag:yaml.org,2002:merge",xO={filename:"",schema:QW,json:!1,maxTotalMergeKeys:1e4,maxAliases:-1};function uV(e){return"tagStart"in e&&e.tagStart!==Mu?e.tagStart:"anchorStart"in e&&e.anchorStart!==Mu?e.anchorStart:"valueStart"in e&&e.valueStart!==Mu?e.valueStart:"start"in e?e.start:0}function Pn(e,t){Kl.throwAt(e.source,e.position,t,e.filename)}function KL(e,t,n,r){try{return n.finalize(r)}catch(i){if(i instanceof Kl)throw i;Kl.throwAt(e.source,t,i instanceof Error?i.message:String(i),e.filename)}}function cV(e,t){const n=lV(e.source,t),r=t.tagStart===Mu?"":e.source.slice(t.tagStart,t.tagEnd),i=e.schema.defaultScalarTag;if(r!==""){if(r==="!")return{value:n,tag:i};const a=WL(r,e.tagHandlers),l=e.schema.lookupScalarTag(a);if(l){const c=l.resolve(n,!0,a);return c===Ve&&Pn(e,`cannot resolve a node with !<${a}> explicit tag`),{value:c,tag:l}}const s=e.schema.lookupMappingTag(a)??e.schema.lookupSequenceTag(a);if(s){n!==""&&Pn(e,`cannot resolve a node with !<${a}> explicit tag`);const c=s.create(a);return{value:s.carrierIsResult?c:KL(e,e.position,s,c),tag:s}}Pn(e,`unknown scalar tag !<${a}>`)}return t.style===Xr.PLAIN?e.schema.resolveImplicitScalarTag(n):{value:i.resolve(n,!1,i.tagName),tag:i}}function MM(e,t,n){const r=t.tagStart===Mu?"":e.source.slice(t.tagStart,t.tagEnd);return r===""||r==="!"?n:WL(r,e.tagHandlers)}function QL(e){return e.nodeKind==="mapping"}function PM(e,t,n,r){for(const i of r.keys(n)){if(e.maxTotalMergeKeys!==-1&&++e.totalMergeKeys>e.maxTotalMergeKeys&&Pn(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&&Pn(e,a),(t.overridable??=new Set).add(i)}}function fV(e,t,n,r){if(e.position=t.keyPosition,QL(r))PM(e,t,n,r);else if(r.nodeKind==="sequence"&&Array.isArray(n))for(const i of n){const a=e.nodeTags.get(i);a||Pn(e,"cannot merge mappings; the provided source object is unacceptable"),PM(e,t,i,a)}else Pn(e,"cannot merge mappings; the provided source object is unacceptable")}function hV(e,t,n,r,i){if(e.position=t.keyPosition,t.keyIsMerge){fV(e,t,r,i);return}!e.json&&t.tag.has(t.value,n)&&!t.overridable?.has(n)&&Pn(e,"duplicated mapping key");const a=t.tag.addPair(t.value,n,r);a&&Pn(e,a),t.overridable?.delete(n)}function px(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"){QL(n)&&e.nodeTags.set(t,n);const i=r.tag.addItem(r.value,t,r.index++);i&&Pn(e,i)}else if(r.hasKey){const i=r.key;r.key=void 0,r.hasKey=!1,hV(e,r,i,t,n)}else r.key=t,r.keyPosition=e.position,r.hasKey=!0,r.keyIsMerge=n.tagName===sV}function mx(e,t,n,r,i){if(t.anchorStart!==Mu){const a={value:n,tag:r,isValueFinal:i};return e.anchors.set(e.source.slice(t.anchorStart,t.anchorEnd),a),a}return null}function dV(e,t){const n={...xO,...t,events:e,documents:[],eventIndex:0,position:0,frames:[],anchors:new Map,nodeTags: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=uV(r),r.type){case Mn.DOCUMENT:n.anchors=new Map,n.nodeTags=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 Mn.SCALAR:{const{value:i,tag:a}=cV(n,r);mx(n,r,i,a,!0),px(n,i,a);break}case Mn.SEQUENCE:{const i=MM(n,r,"tag:yaml.org,2002:seq"),a=n.schema.lookupSequenceTag(i);a||Pn(n,`unknown sequence tag !<${i}>`);const l=a.create(i),s=mx(n,r,l,a,a.carrierIsResult);n.frames.push({kind:"sequence",position:n.position,value:l,tag:a,anchor:s,index:0});break}case Mn.MAPPING:{const i=MM(n,r,"tag:yaml.org,2002:map"),a=n.schema.lookupMappingTag(i);a||Pn(n,`unknown mapping tag !<${i}>`);const l=a.create(i),s=mx(n,r,l,a,a.carrierIsResult);n.frames.push({kind:"mapping",position:n.position,value:l,tag:a,anchor:s,key:void 0,keyPosition:n.position,hasKey:!1,keyIsMerge:!1,overridable:null});break}case Mn.ALIAS:{n.maxAliases!==-1&&++n.aliasCount>n.maxAliases&&Pn(n,`aliases exceeded maxAliases (${n.maxAliases})`);const i=n.source.slice(r.anchorStart,r.anchorEnd),a=n.anchors.get(i);a||Pn(n,`unidentified alias "${i}"`),a.isValueFinal||Pn(n,`recursive alias "${i}" is not supported for tag ${a.tag.tagName} because it uses finalize()`),px(n,a.value,a.tag);break}case Mn.POP:{const i=n.frames.pop();if(i.kind==="mapping"&&i.hasKey&&(n.position=i.keyPosition,Pn(n,"incomplete mapping pair in event stream")),i.kind==="document")n.documents.push(i.value);else{const a=i.tag.carrierIsResult?i.value:KL(n,i.position,i.tag,i.value);i.anchor&&(i.anchor.value=a,i.anchor.isValueFinal=!0),px(n,a,i.tag)}break}}}return n.documents}var Xe=-1,XL=Object.prototype.hasOwnProperty,Wu=1,V1=2,YL=3,rg=4,pV=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,mV=/[,\[\]{}]/,GL=/^(?:!|!!|![0-9A-Za-z-]+!)$/,K1=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`,ZL=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`,gV=new RegExp(`^(?:${K1})*$`),vV=new RegExp(`^(?:${ZL})+$`),yV=new RegExp(`^(?:!(?:${K1})*|${ZL}(?:${K1})*)$`),SO={filename:"",maxDepth:100};function bV(e,t,n){e.events.push({type:Mn.DOCUMENT,explicitStart:t,explicitEnd:n,directives:e.directives})}function JL(e,t,n,r,i,a,l){e.events.push({type:Mn.SEQUENCE,start:t,anchorStart:n,anchorEnd:r,tagStart:i,tagEnd:a,style:l})}function Q1(e,t,n,r,i,a,l){e.events.push({type:Mn.MAPPING,start:t,anchorStart:n,anchorEnd:r,tagStart:i,tagEnd:a,style:l})}function DM(e,t){e.events.splice(t.eventsLength,0,{type:Mn.MAPPING,start:t.position,anchorStart:Xe,anchorEnd:Xe,tagStart:Xe,tagEnd:Xe,style:qu.FLOW})}function dc(e,t,n,r,i,a,l,s,c=Vi.CLIP,f=-1,d=!1){e.events.push({type:Mn.SCALAR,valueStart:t,valueEnd:n,anchorStart:r,anchorEnd:i,tagStart:a,tagEnd:l,style:s,chomping:c,indent:f,fast:d})}function xV(e,t,n){e.events.push({type:Mn.ALIAS,anchorStart:t,anchorEnd:n})}function Pu(e){e.events.push({type:Mn.POP})}function qn(e){dc(e,Xe,Xe,Xe,Xe,Xe,Xe,Xr.PLAIN)}function _M(){return{anchorStart:Xe,anchorEnd:Xe,tagStart:Xe,tagEnd:Xe}}function Xf(e){return{position:e.position,line:e.line,lineStart:e.lineStart,lineIndent:e.lineIndent,firstTabInLine:e.firstTabInLine,eventsLength:e.events.length}}function Du(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){Kl.throwAt(e.input.slice(0,e.length),e.position,t,e.filename)}function an(e){return e===10||e===13}function is(e){return e===9||e===32}function bi(e){return is(e)||an(e)}function Ra(e){return e===0||bi(e)}function as(e){return e===44||e===91||e===93||e===123||e===125}function SV(e){return e>=48&&e<=57?e-48:-1}function wV(e){if(e>=48&&e<=57)return e-48;const t=e|32;return t>=97&&t<=102?t-97+10:-1}function OV(e){return e===120?2:e===117?4:e===85?8:0}function AV(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 ig(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 Vn(e,t){let n=0,r=e.input.charCodeAt(e.position),i=e.position===e.lineStart||bi(e.input.charCodeAt(e.position-1));for(;r!==0;){for(;is(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(!an(r)&&r!==0);if(!an(r))break;for(ig(e),n++,i=!0,r=e.input.charCodeAt(e.position);r===32;)e.lineIndent++,r=e.input.charCodeAt(++e.position)}return n}function Xo(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||bi(r)}return!1}function NM(e){let t=e.input.charCodeAt(e.position);for(;t!==0&&!an(t);)t=e.input.charCodeAt(++e.position)}function eI(e,t,n){pV.test(e.input.slice(t,n))&&ke(e,"the stream contains non-printable characters")}function kV(e,t,n){if(e.input.charCodeAt(e.position)!==33)return!1;t.tagStart!==Xe&&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&&!bi(s)&&!(n&&as(s));)s===33&&(a?ke(e,"tag suffix cannot contain exclamation marks"):(l=e.input.slice(c-1,e.position+1),GL.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),mV.test(f)&&ke(e,"tag suffix cannot contain flow indicator characters")}return f&&!(i?gV.test(f):vV.test(f))&&ke(e,`tag name cannot contain such characters: ${f}`),!i&&l!=="!"&&l!=="!!"&&!XL.call(e.tagHandlers,l)&&ke(e,`undeclared tag handle "${l}"`),t.tagStart=r,t.tagEnd=e.position,!0}function CV(e,t){if(e.input.charCodeAt(e.position)!==38)return!1;t.anchorStart!==Xe&&ke(e,"duplication of an anchor property"),e.position++;const n=e.position;for(;e.input.charCodeAt(e.position)!==0&&!bi(e.input.charCodeAt(e.position))&&!as(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 EV(e,t){if(e.input.charCodeAt(e.position)!==42)return!1;(t.anchorStart!==Xe||t.tagStart!==Xe)&&ke(e,"alias node should not have any properties"),e.position++;const n=e.position;for(;e.input.charCodeAt(e.position)!==0&&!bi(e.input.charCodeAt(e.position))&&!as(e.input.charCodeAt(e.position));)e.position++;return e.position===n&&ke(e,"name of an alias node must contain at least one character"),xV(e,n,e.position),!0}function X1(e,t){Vn(e,!1),e.lineIndent<t&&ke(e,"deficient indentation")}function TV(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++,dc(e,r,l,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,Xr.SINGLE_QUOTED,Vi.CLIP,-1,i),!0}an(a)?(i=!1,X1(e,t)):e.position===e.lineStart&&Xo(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 MV(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++,dc(e,r,l,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,Xr.DOUBLE_QUOTED,Vi.CLIP,-1,i),!0}if(a===92){i=!1;const l=e.input.charCodeAt(++e.position);if(an(l))X1(e,t);else if(AV(l))e.position++;else{let s=OV(l);for(s===0&&ke(e,"unknown escape sequence");s-- >0;)e.position++,wV(e.input.charCodeAt(e.position))<0&&ke(e,"expected hexadecimal character");e.position++}}else an(a)?(i=!1,X1(e,t)):e.position===e.lineStart&&Xo(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 PV(e,t,n){const r=e.input.charCodeAt(e.position);let i=Vi.CLIP,a=-1,l=!1;if(r!==124&&r!==62)return!1;const s=r===124?Xr.LITERAL_BLOCK:Xr.FOLDED_BLOCK;for(e.position++;e.input.charCodeAt(e.position)!==0;){const v=e.input.charCodeAt(e.position),y=SV(v);if(v===43||v===45)i!==Vi.CLIP&&ke(e,"repeat of a chomping mode identifier"),i=v===43?Vi.KEEP:Vi.STRIP,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(;is(e.input.charCodeAt(e.position));)c=!0,e.position++;c&&e.input.charCodeAt(e.position)===35&&NM(e),an(e.input.charCodeAt(e.position))?ig(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&&Xo(e,v))break;if(!l&&f===-1&&an(x)&&(d=Math.max(d,y)),!l&&f===-1&&!an(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&&!an(x)&&y<t){e.lineIndent=y,e.position=v+y;break}!l&&x!==0&&!an(x)&&f===-1&&(f=y);const w=f===-1?t+1:f;if(x!==0&&!an(x)&&y<w){e.lineIndent=y,e.position=v+y;break}NM(e),g=e.position,an(e.input.charCodeAt(e.position))&&(ig(e),g=e.position)}return eI(e,p,g),dc(e,p,g,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,s,i,f),!0}function DV(e,t){const n=e.input.charCodeAt(e.position),r=t===Wu;if(n===0||bi(n)||n===35||n===38||n===42||n===33||n===124||n===62||n===39||n===34||n===37||n===64||n===96||r&&as(n))return!1;if(n===63||n===45){const i=e.input.charCodeAt(e.position+1);if(Ra(i)||r&&as(i))return!1}return!0}function _V(e,t,n,r){if(!DV(e,n))return!1;const i=e.position;let a=e.position,l=e.input.charCodeAt(e.position);const s=n===Wu;let c=!1;for(;l!==0&&!(e.position===e.lineStart&&Xo(e));){if(l===58){const f=e.input.charCodeAt(e.position+1);if(Ra(f)||s&&as(f))break}else if(l===35){if(bi(e.input.charCodeAt(e.position-1)))break}else{if(s&&as(l))break;if(an(l)){const f=e.position,d=e.line,p=e.lineStart,g=e.lineIndent;if(Vn(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}}is(l)||(a=e.position+1),l=e.input.charCodeAt(++e.position)}return a===i?!1:(eI(e,i,a),dc(e,i,a,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,Xr.PLAIN,Vi.CLIP,-1,!c),!0)}function Af(e,t){const n=e.line;Vn(e,!0),(e.line>n&&e.lineIndent<t||e.firstTabInLine!==-1&&e.lineIndent<t)&&ke(e,"deficient indentation")}function NV(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?Q1(e,a,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,qu.FLOW):JL(e,a,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,qu.FLOW),e.position++;e.input.charCodeAt(e.position)!==0;){Af(e,t);let c=e.input.charCodeAt(e.position);if(c===s)return e.position++,Pu(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&&bi(e.input.charCodeAt(e.position+1))&&(f=d=!0,e.position+=1,Af(e,t));const p=e.line,g=Xf(e),v=Yo(e,t,Wu,!1,!0);Af(e,t),c=e.input.charCodeAt(e.position),(i||d||e.line===p)&&c===58?(f=!0,e.position++,Af(e,t),i||DM(e,g),v||qn(e),Yo(e,t,Wu,!1,!0)||qn(e),Af(e,t),i||Pu(e)):i&&f?(v||qn(e),qn(e)):i?qn(e):f&&(DM(e,g),v||qn(e),qn(e),Pu(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 RM(e,t,n){if(e.firstTabInLine!==-1||e.input.charCodeAt(e.position)!==45||!Ra(e.input.charCodeAt(e.position+1)))return!1;for(JL(e,e.position,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,qu.BLOCK);e.input.charCodeAt(e.position)===45&&Ra(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=Vn(e,!0)>0;if(e.firstTabInLine!==-1&&e.input.charCodeAt(e.position)===45&&Ra(e.input.charCodeAt(e.position+1))&&ke(e,"bad indentation of a sequence entry"),i&&e.lineIndent<=t?qn(e):Yo(e,t,YL,!1,!0),Vn(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&&Ra(e.input.charCodeAt(e.position+1))&&ke(e,"bad indentation of a sequence entry")}return Pu(e),!0}function gx(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)&&Ra(f))l||(Q1(e,e.position,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,qu.BLOCK),l=!0),c===63?(i&&qn(e),a=!0,i=!0):(i||(qn(e),a=!0),i=!1),e.position+=1,s=!0;else{i&&(qn(e),i=!1);const p=Xf(e);if(!Yo(e,n,V1,!1,!0))break;if(e.line===d){for(c=e.input.charCodeAt(e.position);is(c);)c=e.input.charCodeAt(++e.position);if(c===58){if(c=e.input.charCodeAt(++e.position),Ra(c)||ke(e,"a whitespace character is expected after the key-value separator within a block mapping"),!l){for(Du(e,p),Q1(e,p.position,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,qu.BLOCK),l=!0,Yo(e,n,V1,!1,!0),c=e.input.charCodeAt(e.position);is(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!==Xe||r.tagStart!==Xe?(Du(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!==Xe||r.tagStart!==Xe?(Du(e,p),!1):!0}if(Yo(e,t,rg,!0,s)&&(s=!1),i||s&&(qn(e),s=!1),Vn(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&&qn(e),l&&Pu(e),!0):!1}function Yo(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=_M();let p=n===rg||n===YL,g=p;const v=p;if(r&&Vn(e,!0)&&(s=!0,e.lineIndent>t?l=1:e.lineIndent===t?l=0:l=-1),l===1)for(;;){const y=e.input.charCodeAt(e.position),x=Xf(e);if(s&&l!==1&&(y===33||y===38))break;if(s&&v&&(d.tagStart!==Xe||d.anchorStart!==Xe)&&(y===33||y===38)){const w=Xf(e),A=t+1;if(gx(e,e.position-e.lineStart,A,d)&&e.events[w.eventsLength]?.type===Mn.MAPPING)return e.depth--,!0;Du(e,w)}if(s&&(y===33&&d.tagStart!==Xe||y===38&&d.anchorStart!==Xe)||!kV(e,d,n===Wu)&&!CV(e,d))break;f===null&&(f=x),Vn(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===rg){const y=n===Wu||n===V1?t:t+1,x=e.position-e.lineStart;if(l===1)if(g&&(RM(e,x,d)||gx(e,x,y,d))||NV(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=Xf(e),E=f.position-f.lineStart;Du(e,f),gx(e,E,y,_M())&&e.events[A.eventsLength]?.type===Mn.MAPPING?c=!0:Du(e,A)}!c&&(p&&PV(e,y,d)||TV(e,y,d)||MV(e,y,d)||EV(e,d)||_V(e,y,n,d))&&(c=!0)}else l===0&&(c=g&&RM(e,x,d))}return p=p&&!c,!c&&(d.anchorStart!==Xe||d.tagStart!==Xe||p)&&(dc(e,Xe,Xe,d.anchorStart,d.anchorEnd,d.tagStart,d.tagEnd,Xr.PLAIN),c=!0),e.depth--,c||d.anchorStart!==Xe||d.tagStart!==Xe}function RV(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&&!bi(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&&!an(e.input.charCodeAt(e.position));){for(;is(e.input.charCodeAt(e.position));)e.position++;if(e.input.charCodeAt(e.position)===35||an(e.input.charCodeAt(e.position))||e.input.charCodeAt(e.position)===0)break;const i=e.position;for(;e.input.charCodeAt(e.position)!==0&&!bi(e.input.charCodeAt(e.position));)e.position++;r.push(e.input.slice(i,e.position))}if(an(e.input.charCodeAt(e.position))&&ig(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;GL.test(i)||ke(e,"ill-formed tag handle (first argument) of the TAG directive"),XL.call(e.tagHandlers,i)&&ke(e,`there is a previously declared suffix for "${i}" tag handle`),yV.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 jV(e){e.directives=[],e.tagHandlers=Object.create(null);let t=!1;for(Vn(e,!0);RV(e);)t=!0,Vn(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&&Ra(e.input.charCodeAt(e.position+3))){n=!0;const s=e.line;e.position+=3,Vn(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&&Xo(e)){e.position+=3,Vn(e,!0);return}if(bV(e,n,!1),Yo(e,e.lineIndent-1,rg,!1,i,i)||qn(e),Vn(e,!0),e.position===e.lineStart&&Xo(e)&&(r=e.input.charCodeAt(e.position)===46,r)){const s=e.line;e.position+=3,Vn(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===Mn.DOCUMENT&&(l.explicitEnd=r),Pu(e),!r&&e.position<e.length&&!(e.position===e.lineStart&&Xo(e))&&ke(e,"end of the stream or a document separator is expected")}function LV(e,t){const n=e.length,r={...SO,...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&&Kl.throwAt(e,i,"null byte is not allowed in input",r.filename),r.input.charCodeAt(r.position)===65279&&r.position++;r.position<r.length&&(Vn(r,!0),!(r.position>=r.length));){const a=r.position;jV(r),r.position===a&&ke(r,"can not read a document")}return r.events}var IV={...SO,...xO};function BV(e,t={}){const n={...IV,...t},r=String(e),i=Object.keys(SO),a=Object.keys(xO);return dV(LV(r,W1(n,i)),{...W1(n,a),source:r})}function zV(e,t){const n=BV(e,t);if(n.length===0)throw new Kl("expected a document, but the input is empty");if(n.length===1)return n[0];throw new Kl("expected a single document in the stream, but found more")}var Up=class{tagged=!1;flow=!1;singleQuoted=!1;doubleQuoted=!1;literal=!1;folded=!1},_o=Symbol("INVALID");function $V(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 UV(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(t)){let l;return i.matchByTagPrefix?l=i.representTagName(t):l=i.tagName,{tag:i,tagName:l,implicitTag:a}}}return null}function Hf(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 Up,anchor:d.anchor}}const n=UV(e,t);if(!n){if(t===void 0||e.skipInvalid)return _o;throw new Kl(`unacceptable kind of an object to dump ${Object.prototype.toString.call(t)}`)}const{tag:r,tagName:i,implicitTag:a}=n,l=a?i:VL(i);if(r.nodeKind==="scalar"){const d=new Up;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 Up;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=Hf(e,d[v]);x===_o&&d[v]===void 0&&(x=Hf(e,null)),x!==_o&&g.items.push(x)}return g}const s=r.represent(t),c=new Up;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=Hf(e,d);if(g===_o)continue;const v=Hf(e,p);v!==_o&&f.items.push({key:g,value:v})}return f}function HV(e,t,n={}){const r=Hf({representTypes:$V(t),noRefs:n.noRefs??!1,skipInvalid:n.skipInvalid??!1,refs:new Map,refCounter:0},e);return[{contents:r===_o?null:r,directives:[]}]}var FV=Symbol("visit:break"),tI=Symbol("visit:skip");function Lm(e,t,n){const r=t(e,n);if(r===FV)return!0;if(r===tI)return!1;const i=n.depth+1;switch(e.kind){case"sequence":for(const a of e.items)if(Lm(a,t,{depth:i,parent:e,isKey:!1}))return!0;break;case"mapping":for(const{key:a,value:l}of e.items)if(Lm(a,t,{depth:i,parent:e,isKey:!0})||Lm(l,t,{depth:i,parent:e,isKey:!1}))return!0;break}return!1}function qV(e,t){for(const n of e)if(n.contents&&Lm(n.contents,t,{depth:0,parent:null,isKey:!1}))return}var wO=65279,WV=9,ls=10,nI=13,VV=32,KV=33,rI=34,Y1=35,QV=37,XV=38,iI=39,YV=42,G1=44,OO=45,hh=58,GV=61,ZV=62,aI=63,JV=64,Z1=91,J1=93,e7=96,eS=123,t7=124,tS=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 AO={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 n7(e){return e.style.tagged?e.tag:VL(e.tag)}function r7(e){const t={...AO,...e};return{...t,defaultScalarTagName:t.schema.defaultScalarTag.tagName}}function i7(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 jM(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 nS(e,t){return`
|
|
31
|
-
${" ".repeat(e.indent*t)}`}function a7(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 Vu(e){return e===VV||e===WV}function l7(e){const t=e.charCodeAt(0);if(t!==OO&&t!==46||e.charCodeAt(1)!==t||e.charCodeAt(2)!==t)return!1;if(e.length===3)return!0;const n=e.charCodeAt(3);return Vu(n)||n===nI||n===ls}function dh(e){return e>=32&&e<=126||e>=161&&e<=55295&&e!==8232&&e!==8233||e>=57344&&e<=65533&&e!==wO||e>=65536&&e<=1114111}function LM(e){return dh(e)&&e!==wO&&e!==nI&&e!==ls}function rS(e,t,n){const r=LM(e),i=r&&!Vu(e);return(n?r:r&&e!==G1&&e!==Z1&&e!==J1&&e!==eS&&e!==tS)&&e!==Y1&&!(t===hh&&!i)||LM(t)&&!Vu(t)&&e===Y1||t===hh&&i&&(n||e!==G1&&e!==Z1&&e!==J1&&e!==eS&&e!==tS)}function o7(e){return dh(e)&&e!==wO&&!Vu(e)&&e!==OO&&e!==aI&&e!==hh&&e!==G1&&e!==Z1&&e!==J1&&e!==eS&&e!==tS&&e!==Y1&&e!==XV&&e!==YV&&e!==KV&&e!==t7&&e!==GV&&e!==ZV&&e!==iI&&e!==rI&&e!==QV&&e!==JV&&e!==e7}function s7(e,t){const n=_u(e,0);if(o7(n))return!0;if(e.length>1&&(n===OO||n===aI||n===hh)){const r=_u(e,1);return!Vu(r)&&rS(r,n,t)}return!1}function u7(e){return!Vu(e)&&e!==hh}function _u(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 lI(e){return/^\n* /.test(e)}var ph=1,Yf=2,kO=3,CO=4,$l=5;function c7(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=!l7(t)&&s7(t,a)&&u7(_u(t,t.length-1));if(r||i)for(c=0;c<t.length;f>=65536?c+=2:c++){if(f=_u(t,c),!dh(f))return $l;x=x&&rS(f,d,a),d=f}else{for(c=0;c<t.length;f>=65536?c+=2:c++){if(f=_u(t,c),f===ls)p=!0,v&&(g=g||c-y-1>s&&!mh(t[y+1]),y=c);else if(!dh(f))return $l;x=x&&rS(f,d,a),d=f}g=g||v&&c-y-1>s&&!mh(t[y+1])}return!p&&!g?x&&!i?ph:e.quoteStyle==="double"?$l:Yf:l>9&&lI(t)?$l:g?CO:kO}function f7(e,t,n){const{indent:r,blockIndent:i,lineWidth:a}=n;switch(t){case ph:return BM(e,r);case Yf:return`'${BM(e,r).replace(/'/g,"''")}'`;case kO:return"|"+IM(e,i)+zM(jM(e,r));case CO:return">"+IM(e,i)+zM(jM(d7(e,a),r));case $l:return`"${p7(e)}"`}}function h7(e,t,n,r,i){const a=r||!i;if(t.style.singleQuoted)return Yf;if(t.style.doubleQuoted)return $l;if(!a){if(t.style.literal)return kO;if(t.style.folded)return CO}const l=t.value;if(l.length===0)return t.style.tagged||e.schema.resolveImplicitScalarTag(l).tag.tagName===t.tag?ph:e.quoteStyle==="double"?$l:Yf;const s=c7(e,l,n,a,e.forceQuotes&&!r,i);return s===ph&&!t.style.tagged&&e.schema.resolveImplicitScalarTag(l).tag.tagName!==t.tag?e.quoteStyle==="double"?$l:Yf:s}function IM(e,t){const n=lI(e)?String(t):"",r=e[e.length-1]===`
|
|
32
|
-
`;return`${n}${r&&(e[e.length-2]===`
|
|
33
|
-
`||e===`
|
|
34
|
-
`)?"+":r?"":"-"}
|
|
35
|
-
`}function BM(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 zM(e){return e[e.length-1]===`
|
|
38
|
-
`?e.slice(0,-1):e}function mh(e){return e===" "||e===" "}function d7(e,t){const n=/(\n+)([^\n]*)/g;let r=e.indexOf(`
|
|
39
|
-
`);r===-1&&(r=e.length),n.lastIndex=r;let i=$M(e.slice(0,r),t),a=e[0]===`
|
|
40
|
-
`||mh(e[0]),l,s;for(;s=n.exec(e);){const c=s[1],f=s[2];l=f!==""&&mh(f[0]),i+=c+(!a&&!l&&f!==""?`
|
|
41
|
-
`:"")+$M(f,t),a=l}return i}function $M(e,t){if(e===""||mh(e[0]))return e;const n=/ [^ \t]/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 p7(e){let t="",n=0;for(let r=0;r<e.length;n>=65536?r+=2:r++){n=_u(e,r);const i=Rn[n];if(i){t+=i;continue}if(dh(n)){t+=e[r],n>=65536&&(t+=e[r+1]);continue}t+=i7(n)}return t}function m7(e,t,n){let r="";for(let a=0,l=n.items.length;a<l;a+=1){const s=Ba(e,t,n.items[a],{});r!==""&&(r+=`,${e.flowSkipCommaSpace?"":" "}`),r+=s}const i=e.flowBracketPadding&&r!==""?" ":"";return`[${i}${r}${i}]`}function UM(e,t,n,r){let i="";for(let a=0,l=n.items.length;a<l;a+=1){const s=Ba(e,t+1,n.items[a],{block:!0,compact:e.seqInlineFirst,isblockseq:!0});(!r||i!=="")&&(i+=nS(e,t)),s===""||ls===s.charCodeAt(0)?i+="-":i+="- ",i+=s}return i}function g7(e,t,n){let r="";const i=oI(e,n.items);for(const{key:l,value:s}of i){let c="";r!==""&&(c+=`,${e.flowSkipCommaSpace?"":" "}`);const f=Ba(e,t,l,{iskey:!0}),d=f.length>1024;d?c+="? ":e.quoteFlowKeys&&(c+='"');const p=Ba(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 Hp(e){return e.kind==="scalar"?e.value:e}function oI(e,t){if(!e.sortKeys)return t;const n=t.slice();if(e.sortKeys===!0)n.sort((r,i)=>{const a=Hp(r.key),l=Hp(i.key);return a<l?-1:a>l?1:0});else{const r=e.sortKeys;n.sort((i,a)=>r(Hp(i.key),Hp(a.key)))}return n}function v7(e,t,n,r){let i="";const a=oI(e,n.items);for(let l=0,s=a.length;l<s;l+=1){let c="";(!r||i!=="")&&(c+=nS(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?Ba(e,t+1,f,{block:!0,compact:!0,isblockseq:!iS(e,f,t+1)}):Ba(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&&ls===g.charCodeAt(0)?c+="?":c+="? "),c+=g,y&&(c+=nS(e,t));const x=Ba(e,t+1,d,{block:!0,compact:y,isblockseq:y&&!iS(e,d,t+1)}),w=f.kind==="scalar"&&f.value===""&&g!==""&&g.charCodeAt(g.length-1)!==iI&&g.charCodeAt(g.length-1)!==rI,A=!y&&(f.kind==="alias"||w)?" ":"";x===""||ls===x.charCodeAt(0)?c+=`${A}:`:c+=`${A}: `,c+=x,i+=c}return i}function iS(e,t,n){return t.style.tagged||t.anchor!==void 0||e.indent<2&&n>0}function Ba(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;iS(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=v7(e,t,n,s):f=g7(e,t,n);else if(n.kind==="sequence")p?e.seqNoIndent&&!l&&t>0?f=UM(e,t-1,n,s):f=UM(e,t,n,s):f=m7(e,t,n);else{const g=a7(e,t),v=h7(e,n,g,a,i);f=f7(n.value,v,g),d=n.style.tagged||v!==ph&&n.tag!==e.defaultScalarTagName}if(p&&s&&t>0&&e.indent>2&&(f=`${" ".repeat(e.indent-2)}${f}`),d||c){const g=[],v=d?n7(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)===ls?"":" ";f=`${g.join(" ")}${x}${f}`}return f}function y7(e){return(e.kind==="sequence"||e.kind==="mapping")&&!e.style.flow&&e.items.length!==0&&!e.style.tagged&&e.anchor===void 0}function b7(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 x7(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 S7(e,t){const n=r7(t);let r="",i=!1;for(let a=0;a<e.length;a+=1){const l=e[a],s=x7(l),c=s!=="",f=l.explicitStart||c||a>0&&!i;if(r+=s,l.contents===null)f&&(r+=`---
|
|
51
|
-
`);else if(f){const d=Ba(n,0,l.contents,{block:!0,compact:!0}),p=d===""?"":c||y7(l.contents)?`
|
|
52
|
-
`:" ";r+=`---${p}${d}
|
|
53
|
-
`}else r+=Ba(n,0,l.contents,{block:!0,compact:!0})+`
|
|
54
|
-
`;i=l.explicitEnd||l.contents!==null&&b7(l.contents),i&&(r+=`...
|
|
55
|
-
`)}return r}var w7={...AO,schema:YW,skipInvalid:!1,noRefs:!1,flowLevel:-1,transform:()=>{}};function O7(e,t={}){const n={...w7,...t},r=HV(e,n.schema,{noRefs:n.noRefs,skipInvalid:n.skipInvalid});return n.flowLevel>=0&&qV(r,(i,a)=>{if(!(a.depth<n.flowLevel))return i.style.flow=!0,tI}),n.transform(r),S7(r,{...W1(n,Object.keys(AO)),schema:n.schema})}const HM=[{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"}],Fp={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:"exclude_paths",label:"Exclude paths",type:"string_list",placeholder:"vendor/**, **/*_test.go",help:"Glob patterns relative to the source root"},{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"}]}},vx={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"}]}},FM={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"}]}},A7=[{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 qp(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 k7(e,t){return t.reduce((n,r)=>n?.[r],e)}function sI(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]=sI(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 vu({field:e,value:t,onChange:n}){const[r,i]=O.useState(null);return e.type==="boolean"?T.jsxs("label",{className:"flex items-center gap-2 py-1.5 text-sm text-ink-secondary",children:[T.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&&T.jsxs("span",{className:"text-xs text-ink-muted",children:["— ",e.help]})]}):T.jsxs("label",{className:"block",children:[T.jsxs("span",{className:"mb-1 flex items-baseline gap-2 text-xs font-medium text-ink-secondary",children:[e.label,e.required&&T.jsx("span",{className:"text-critical",children:"*"}),e.secret&&T.jsxs("span",{className:"text-ink-muted",children:["use a ",T.jsx("code",{children:"${ENV_VAR}"})," placeholder"]})]}),e.type==="select"?T.jsxs("select",{value:t??"",onChange:a=>n(a.target.value||void 0),className:$o,children:[T.jsx("option",{value:"",children:"—"}),e.options.map(a=>T.jsx("option",{value:a,children:a},a))]}):e.type==="string_list"?T.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}):T.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&&T.jsx("span",{className:"mt-1 block text-xs text-ink-muted",children:e.help})]})}function yx({fields:e,doc:t,basePath:n,onSet:r}){return T.jsx("div",{className:"grid gap-x-4 gap-y-3 sm:grid-cols-2",children:e.map(i=>T.jsx("div",{className:i.type==="boolean"?"sm:col-span-2":"",children:T.jsx(vu,{field:i,value:k7(t,[...n,i.key]),onChange:a=>r([...n,i.key],a)})},i.key))})}function Wp({title:e,subtitle:t,action:n,children:r}){return T.jsxs("section",{className:"rounded-lg border border-edge bg-surface p-4",children:[T.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[T.jsx("h3",{className:"text-sm font-semibold",children:e}),t&&T.jsx("span",{className:"text-xs text-ink-muted",children:t}),T.jsx("div",{className:"ml-auto",children:n})]}),r]})}function uI(e){const t=io(),n=O.useMemo(()=>{if(e.mode==="edit"&&e.config)try{const A=zV(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:[qp("website")]},parseError:null}},[e.mode,e.config]),[r,i]=O.useState(n.doc),[a,l]=O.useState(""),[s,c]=O.useState(null),f=Wh({mutationFn:async()=>{const A=O7(r,{lineWidth:120,noRefs:!0}),E=await Ct.validateConfig(A);if(!E.valid)throw new fh(400,E.error??"invalid config");if(e.mode==="create"){const k=a.trim()||`${(r.name||"config").toString().replace(/[^A-Za-z0-9._-]+/g,"-")}.yaml`;return Ct.createConfig(k,A)}return Ct.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 T.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,E)=>i(k=>sI(k,A,E)),p=Array.isArray(r.sources)?r.sources:[],g=[];p.forEach((A,E)=>{const k=Fp[A?.type];for(const M of[...HM,...k?.fields??[]]){if(!M.required||A?.type==="code"&&M.key==="version")continue;const D=A?.[M.key];(D===void 0||D==="")&&g.push(`source ${E+1}: ${M.label}`)}});const v=r.embedding!==void 0,y=r.markdown_store!==void 0,x=f.error instanceof fh&&f.error.status===409,w=r.schedule??"";return T.jsxs("div",{className:"space-y-4",children:[x&&T.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&&T.jsx("div",{className:"rounded-md border border-critical/50 bg-surface px-3 py-2 text-sm text-critical",children:s}),T.jsx(Wp,{title:"General",children:T.jsxs("div",{className:"grid gap-x-4 gap-y-3 sm:grid-cols-2",children:[e.mode==="create"&&T.jsxs("label",{className:"block",children:[T.jsx("span",{className:"mb-1 block text-xs font-medium text-ink-secondary",children:"Filename"}),T.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`})]}),T.jsx(vu,{field:{key:"name",label:"Display name",type:"string",placeholder:"product-docs"},value:r.name,onChange:A=>d(["name"],A)}),T.jsxs("div",{children:[T.jsx(vu,{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&&T.jsx("p",{className:"mt-1 text-xs text-accent",children:gO(w)})]})]})}),p.map((A,E)=>{const k=Fp[A?.type]??Fp.website,M=A?.database_config?.type??"sqlite",D=vx[M]??vx.sqlite;return T.jsx(Wp,{title:`Source ${E+1}`,subtitle:A?.product_name||void 0,action:T.jsx("button",{onClick:()=>d(["sources"],p.filter((P,N)=>N!==E)),className:"text-xs text-ink-muted transition hover:text-critical",children:"Remove"}),children:T.jsxs("div",{className:"space-y-4",children:[T.jsxs("div",{className:"grid gap-x-4 gap-y-3 sm:grid-cols-2",children:[T.jsxs("label",{className:"block",children:[T.jsx("span",{className:"mb-1 block text-xs font-medium text-ink-secondary",children:"Type"}),T.jsx("select",{value:A?.type??"website",onChange:P=>{const N={...qp(P.target.value),product_name:A?.product_name??"",...A?.version!==void 0&&P.target.value!=="code"&&{version:A.version},...A?.max_size!==void 0&&{max_size:A.max_size},database_config:A?.database_config??qp(P.target.value).database_config};d(["sources",E],N)},className:$o,children:Object.entries(Fp).map(([P,N])=>T.jsx("option",{value:P,children:N.label},P))})]}),HM.map(P=>T.jsx(vu,{field:A?.type==="code"&&P.key==="version"?{...P,required:!1,help:"Defaults to the branch name"}:P,value:A?.[P.key],onChange:N=>d(["sources",E,P.key],N)},P.key))]}),T.jsxs("div",{children:[T.jsxs("p",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-ink-muted",children:[k.label," options"]}),T.jsx(yx,{fields:k.fields,doc:r,basePath:["sources",E],onSet:d})]}),T.jsxs("div",{children:[T.jsx("p",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-ink-muted",children:"Vector database"}),T.jsxs("div",{className:"grid gap-x-4 gap-y-3 sm:grid-cols-2",children:[T.jsxs("label",{className:"block",children:[T.jsx("span",{className:"mb-1 block text-xs font-medium text-ink-secondary",children:"Type"}),T.jsx("select",{value:M,onChange:P=>d(["sources",E,"database_config"],{type:P.target.value,params:{}}),className:$o,children:Object.entries(vx).map(([P,N])=>T.jsx("option",{value:P,children:N.label},P))})]}),D.fields.map(P=>T.jsx(vu,{field:P,value:A?.database_config?.params?.[P.key],onChange:N=>d(["sources",E,"database_config","params",P.key],N)},P.key))]})]})]})},E)}),T.jsx("button",{onClick:()=>d(["sources"],[...p,qp("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"}),T.jsx(Wp,{title:"Embedding",subtitle:"optional — defaults to OpenAI text-embedding-3-large",action:T.jsxs("label",{className:"flex items-center gap-2 text-xs text-ink-secondary",children:[T.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?T.jsxs("div",{className:"space-y-3",children:[T.jsxs("div",{className:"grid gap-x-4 gap-y-3 sm:grid-cols-2",children:[T.jsxs("label",{className:"block",children:[T.jsx("span",{className:"mb-1 block text-xs font-medium text-ink-secondary",children:"Provider"}),T.jsx("select",{value:r.embedding?.provider??"openai",onChange:A=>d(["embedding"],{provider:A.target.value}),className:$o,children:Object.entries(FM).map(([A,E])=>T.jsx("option",{value:A,children:E.label},A))})]}),T.jsx(vu,{field:{key:"dimension",label:"Dimension",type:"number",placeholder:"3072"},value:r.embedding?.dimension,onChange:A=>d(["embedding","dimension"],A)})]}),T.jsx(yx,{fields:FM[r.embedding?.provider??"openai"].fields,doc:r,basePath:["embedding",r.embedding?.provider??"openai"],onSet:d})]}):T.jsx("p",{className:"text-xs text-ink-muted",children:"Using defaults (OPENAI_API_KEY env var, text-embedding-3-large, 3072 dimensions)."})}),T.jsx(Wp,{title:"Markdown store",subtitle:"optional — store crawled markdown in Postgres",action:T.jsxs("label",{className:"flex items-center gap-2 text-xs text-ink-secondary",children:[T.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?T.jsx(yx,{fields:A7,doc:r,basePath:["markdown_store"],onSet:d}):T.jsx("p",{className:"text-xs text-ink-muted",children:"Disabled."})}),T.jsxs("div",{className:"flex items-center gap-3",children:[T.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&&T.jsx("button",{onClick:e.onCancel,className:"text-sm text-ink-muted hover:text-ink-secondary",children:"Cancel"}),g.length>0&&T.jsxs("span",{className:"text-xs text-warning",children:["missing: ",g.slice(0,3).join(", "),g.length>3?"…":""]}),p.length===0&&T.jsx("span",{className:"text-xs text-warning",children:"add at least one source"}),e.mode==="edit"&&T.jsx("span",{className:"ml-auto text-xs text-ink-muted",children:"Saving rewrites the YAML file (comments are not preserved)."})]})]})}function cI({config:e,variant:t="subtle"}){const n=io(),[r,i]=O.useState(!1),[a,l]=O.useState(new Set),[s,c]=O.useState(""),f=Wh({mutationFn:k=>Ct.triggerRun(e.id,k,e.content_hash),onSuccess:()=>{i(!1),l(new Set),c("")},onSettled:()=>n.invalidateQueries({queryKey:["configs"]})}),d=O.useMemo(()=>e.source_summary.map((k,M)=>({...k,index:M})),[e.source_summary]),p=O.useMemo(()=>{const k=s.trim().toLowerCase();return k?d.filter(M=>M.product_name.toLowerCase().includes(k)||M.type.toLowerCase().includes(k)):d},[d,s]),g=e.busy||!!e.parse_error||f.isPending,v=k=>{k.preventDefault(),k.stopPropagation()},y=k=>{l(M=>{const D=new Set(M);return D.has(k)?D.delete(k):D.add(k),D})},x=p.length>0&&p.every(k=>a.has(k.index)),w=()=>{l(k=>{const M=new Set(k);return x?p.forEach(D=>M.delete(D.index)):p.forEach(D=>M.add(D.index)),M})},A=t==="primary"?"bg-accent text-white transition hover:opacity-90 px-3.5 py-1.5 text-sm font-medium":"border border-edge bg-surface text-ink-secondary transition hover:border-accent hover:text-accent px-3 py-1 text-xs font-medium",E=t==="primary"?"bg-accent text-white transition hover:opacity-90 border-l border-white/25 px-2 py-1.5 text-sm":"border border-l-0 border-edge bg-surface text-ink-secondary transition hover:border-accent hover:text-accent px-1.5 py-1 text-xs";return T.jsxs("div",{className:"relative inline-flex items-center gap-2",onClick:v,children:[T.jsxs("span",{className:"inline-flex",children:[T.jsx("button",{onClick:k=>{v(k),f.mutate(void 0)},disabled:g,className:`${d.length>1?"rounded-l-md":"rounded-md"} ${A} disabled:cursor-not-allowed disabled:opacity-40`,children:e.busy?"Running…":"Run now"}),d.length>1&&T.jsx("button",{onClick:k=>{v(k),i(M=>!M)},disabled:g,"aria-label":"Choose sources to run",title:"Choose sources to run",className:`rounded-r-md ${E} disabled:cursor-not-allowed disabled:opacity-40`,children:"▾"})]}),f.error&&T.jsx("span",{className:"text-xs text-critical",children:f.error.message}),r&&T.jsxs(T.Fragment,{children:[T.jsx("div",{className:"fixed inset-0 z-10",onClick:k=>{v(k),i(!1)}}),T.jsxs("div",{className:"absolute right-0 top-full z-20 mt-1.5 w-80 rounded-md border border-edge bg-surface shadow-lg",children:[T.jsxs("div",{className:"flex items-center justify-between border-b border-edge px-3 py-2",children:[T.jsxs("span",{className:"text-xs font-semibold uppercase tracking-wide text-ink-muted",children:["Run sources",a.size>0&&` (${a.size}/${d.length})`]}),T.jsxs("button",{onClick:k=>{v(k),w()},className:"text-xs text-accent hover:underline",children:[x?"Clear":"Select all",s.trim()&&" shown"]})]}),d.length>8&&T.jsx("div",{className:"border-b border-edge px-3 py-2",children:T.jsx("input",{type:"text",value:s,onChange:k=>c(k.target.value),onClick:k=>k.stopPropagation(),placeholder:"Filter sources…",className:"w-full rounded-md border border-edge bg-page px-2 py-1 text-xs text-ink-secondary placeholder:text-ink-muted focus:border-accent focus:outline-none"})}),T.jsxs("ul",{className:"max-h-64 overflow-y-auto py-1",children:[p.map(k=>T.jsx("li",{children:T.jsxs("label",{className:"flex cursor-pointer items-center gap-2 px-3 py-1.5 text-sm text-ink-secondary hover:bg-edge/20",onClick:M=>M.stopPropagation(),children:[T.jsx("input",{type:"checkbox",checked:a.has(k.index),onChange:()=>y(k.index),className:"accent-accent"}),T.jsx("span",{className:"truncate",children:k.product_name}),T.jsxs("span",{className:"ml-auto shrink-0 text-xs text-ink-muted",children:[k.type,k.version?` · ${k.version}`:""]})]})},k.index)),p.length===0&&T.jsxs("li",{className:"px-3 py-2 text-xs text-ink-muted",children:["No sources match “",s,"”."]})]}),T.jsx("div",{className:"border-t border-edge px-3 py-2",children:T.jsxs("button",{onClick:k=>{v(k),f.mutate([...a])},disabled:a.size===0||g,className:"w-full rounded-md bg-accent px-3 py-1.5 text-xs font-medium text-white transition hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-40",children:["Run ",a.size>0?`${a.size} selected`:"selected"," source",a.size===1?"":"s"]})})]})]})]})}const C7={website:"🌐",github:"🐙",zendesk:"🎫",local_directory:"📁",code:"⌨️",s3:"🪣"};function fI({sources:e,max:t}){const[n,r]=O.useState(!1);if(e.length===0)return T.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 T.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[a.map((s,c)=>T.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:[T.jsx("span",{"aria-hidden":!0,className:"text-[10px]",children:C7[s.type]??"•"}),s.product_name,T.jsx("span",{className:"text-ink-muted",children:s.type})]},`${s.product_name}-${s.type}-${c}`)),l>0&&T.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 E7(){const e=Mv(),{data:t,isLoading:n,error:r}=Wi({queryKey:["configs"],queryFn:Ct.configs}),{data:i}=Wi({queryKey:["health"],queryFn:Ct.health}),[a,l]=O.useState(!1),s=t?.filter(c=>c.last_run?.status==="running"||c.last_run?.status==="queued")??[];return n?T.jsx("p",{className:"text-ink-muted",children:"Loading…"}):r?T.jsxs("p",{className:"text-critical",children:["Failed to load configs: ",String(r.message)]}):T.jsxs("div",{className:"space-y-6",children:[s.length>0&&T.jsx("div",{className:"rounded-lg border border-accent/30 bg-surface px-4 py-3",children:T.jsxs("p",{className:"text-sm text-ink-secondary",children:[T.jsxs("span",{className:"font-medium text-accent",children:["● ",s.length," config",s.length>1?"s":""," syncing now"]})," — ",s.map((c,f)=>T.jsxs("span",{children:[f>0&&", ",T.jsx(yi,{to:`/runs/${c.last_run.id}`,className:"text-accent hover:underline",children:c.name})]},c.id))]})}),T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Configurations"}),i?.mode==="rw"&&T.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&&T.jsxs("div",{className:"rounded-lg border border-edge bg-page p-4",children:[T.jsx("h2",{className:"mb-4 text-sm font-semibold",children:"Create a new config"}),T.jsx(uI,{mode:"create",onSaved:c=>{l(!1),e(`/configs/${c.id}`)},onCancel:()=>l(!1)})]}),t&&t.length===0&&T.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 ",T.jsx("code",{className:"text-ink-secondary",children:"doc2vec controller"}),i?.mode==="rw"&&" or create one with the button above","."]}),T.jsx("div",{className:"grid gap-4",children:t?.map(c=>T.jsx(yi,{to:`/configs/${c.id}`,className:"block rounded-lg border border-edge bg-surface p-4 transition hover:border-accent/50",children:T.jsxs("div",{className:"flex flex-col gap-3 md:grid md:grid-cols-[minmax(9rem,1fr)_12rem_15rem_8rem_auto] md:items-start md:gap-x-6",children:[T.jsxs("div",{className:"min-w-0",children:[T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("h2",{className:"truncate font-semibold",children:c.name}),c.parse_error&&T.jsx("span",{className:"shrink-0 rounded-full border border-critical/40 px-2 py-0.5 text-xs text-critical",title:c.parse_error,children:"invalid"})]}),T.jsx("div",{className:"mt-1.5",children:T.jsx(fI,{sources:c.source_summary,max:4})})]}),T.jsxs("div",{className:"text-sm",children:[T.jsx("p",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"Schedule"}),T.jsx("p",{className:"mt-0.5 text-ink-secondary",title:c.schedule??void 0,children:gO(c.schedule)})]}),T.jsxs("div",{className:"text-sm",children:[T.jsx("p",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"Last run"}),T.jsx("div",{className:"mt-0.5 flex flex-wrap items-center gap-2",children:c.last_run?T.jsxs(T.Fragment,{children:[T.jsx(_v,{status:c.last_run.status}),T.jsxs("span",{className:"text-xs text-ink-muted",title:Fa(c.last_run.queued_at),children:[H1(c.last_run.finished_at??c.last_run.queued_at),c.last_run.finished_at&&c.last_run.started_at&&` · ${mO(c.last_run.started_at,c.last_run.finished_at)}`]})]}):T.jsx("span",{className:"text-xs text-ink-muted",children:"never"})})]}),T.jsxs("div",{className:"text-sm",children:[T.jsx("p",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"Next run"}),T.jsx("p",{className:"mt-0.5 text-ink-secondary",title:c.next_run?Fa(c.next_run):void 0,children:c.next_run?H1(c.next_run):"—"})]}),T.jsx("div",{className:"md:self-center",children:T.jsx(cI,{config:c})})]})},c.id))})]})}function aS(){return aS=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},aS.apply(null,arguments)}function T7(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 lS=[],hI=[];(()=>{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?hI:lS).push(n=n+e[t])})();function M7(e){if(e<768)return!1;for(let t=0,n=lS.length;;){let r=t+n>>1;if(e<lS[r])n=r;else if(e>=hI[r])t=r+1;else return!0;if(t==n)return!1}}function qM(e){return e>=127462&&e<=127487}const WM=8205;function P7(e,t,n=!0,r=!0){return(n?dI:D7)(e,t,r)}function dI(e,t,n){if(t==e.length)return t;t&&pI(e.charCodeAt(t))&&mI(e.charCodeAt(t-1))&&t--;let r=bx(e,t);for(t+=VM(r);t<e.length;){let i=bx(e,t);if(r==WM||i==WM||n&&M7(i))t+=VM(i),r=i;else if(qM(i)){let a=0,l=t-2;for(;l>=0&&qM(bx(e,l));)a++,l-=2;if(a%2==0)break;t+=2}else break}return t}function D7(e,t,n){for(;t>1;){let r=dI(e,t-2,n);if(r<t)return r;t--}return 0}function bx(e,t){let n=e.charCodeAt(t);if(!mI(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return pI(r)?(n-55296<<10)+(r-56320)+65536:n}function pI(e){return e>=56320&&e<57344}function mI(e){return e>=55296&&e<56320}function VM(e){return e<65536?1:2}let Je=class gI{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]=Ku(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),Hi.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]=Ku(this,t,n);let r=[];return this.decompose(t,n,r,0),Hi.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 Gf(this),a=new Gf(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 Gf(this,t)}iterRange(t,n=this.length){return new vI(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 yI(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]?gI.empty:t.length<=32?new It(t):Hi.from(It.split(t,[]))}};class It extends Je{constructor(t,n=_7(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 N7(i,s,r,l);i=s+1,r++}}decompose(t,n,r,i){let a=t<=0&&n>=this.length?this:new It(KM(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let l=r.pop(),s=Im(a.text,l.text.slice(),0,a.length);if(s.length<=32)r.push(new It(s,l.length+a.length));else{let c=s.length>>1;r.push(new It(s.slice(0,c)),new It(s.slice(c)))}}else r.push(a)}replace(t,n,r){if(!(r instanceof It))return super.replace(t,n,r);[t,n]=Ku(this,t,n);let i=Im(this.text,Im(r.text,KM(this.text,0,t)),n),a=this.length+r.length-(n-t);return i.length<=32?new It(i,a):Hi.from(It.split(i,[]),a)}sliceString(t,n=this.length,r=`
|
|
56
|
-
`){[t,n]=Ku(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 It(r,i)),r=[],i=-1);return i>-1&&n.push(new It(r,i)),n}}class Hi 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]=Ku(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 Hi(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]=Ku(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 Hi))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 It(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 Hi)for(let x of v.children)p(x);else v.lines>l&&(c>l||!c)?(g(),s.push(v)):v instanceof It&&c&&(y=d[d.length-1])instanceof It&&v.lines+y.lines<=32?(c+=v.lines,f+=v.length+1,d[d.length-1]=new It(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]:Hi.from(d,f)),f=-1,c=d.length=0)}for(let v of t)p(v);return g(),s.length==1?s[0]:new Hi(s,n)}}Je.empty=new It([""],0);function _7(e){let t=-1;for(let n of e)t+=n.length+1;return t}function Im(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 KM(e,t,n){return Im(e,[""],t,n)}class Gf{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 It?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 It?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 It){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 It?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 vI{constructor(t,n,r){this.value="",this.done=!1,this.cursor=new Gf(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 yI{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()},Gf.prototype[Symbol.iterator]=vI.prototype[Symbol.iterator]=yI.prototype[Symbol.iterator]=function(){return this});let N7=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 Ku(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 P7(e,t,n,r)}function R7(e){return e>=56320&&e<57344}function j7(e){return e>=55296&&e<56320}function ar(e,t){let n=e.charCodeAt(t);if(!j7(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return R7(r)?(n-55296<<10)+(r-56320)+65536:n}function EO(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function Fi(e){return e<65536?1:2}const oS=/\r\n?|\n/;var Kn=(function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e})(Kn||(Kn={}));class Zi{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){sS(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 Zi(t)}composeDesc(t){return this.empty?t:t.empty?this:bI(this,t)}mapDesc(t,n=!1){return t.empty?this:uS(this,t,n)}mapPos(t,n=-1,r=Kn.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!=Kn.Simple&&f>=t&&(r==Kn.TrackDel&&i<t&&f>t||r==Kn.TrackBefore&&i<t||r==Kn.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 Zi(t)}static create(t){return new Zi(t)}}class Yt extends Zi{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 sS(this,(n,r,i,a,l)=>t=t.replace(i,i+(r-n),l),!1),t}mapDesc(t,n=!1){return uS(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 Yt(n,r)}compose(t){return this.empty?t:t.empty?this:bI(this,t,!0)}map(t,n=!1){return t.empty?this:uS(this,t,n,!0)}iterChanges(t,n=!1){sS(this,t,n)}get desc(){return Zi.create(this.sections)}filter(t){let n=[],r=[],i=[],a=new gh(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&&Ul(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 Yt(n,r),filtered:Zi.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 Yt(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 Yt){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||oS)):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),Ul(a,i,y),l=g}}return f(t),c(!s),s}static empty(t){return new Yt(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 Yt(n,r)}static createSet(t,n){return new Yt(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 Ul(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 sS(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 uS(e,t,n,r=!1){let i=[],a=r?[]:null,l=new gh(e),s=new gh(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&&Ul(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&&Ul(a,i,l.text),c=l.i,l.forward(l.len-d)}else{if(l.done&&s.done)return a?Yt.createSet(i,a):Zi.create(i);throw new Error("Mismatched change set lengths")}}}function bI(e,t,n=!1){let r=[],i=n?[]:null,a=new gh(e),l=new gh(t);for(let s=!1;;){if(a.done&&l.done)return i?Yt.createSet(r,i):Zi.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&&Ul(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&&Ul(i,r,l.text)}else l.ins==-1?(Tn(r,a.off?0:a.len,c,s),i&&Ul(i,r,a.textBit(c))):(Tn(r,a.off?0:a.len,l.off?0:l.ins,s),i&&!l.off&&Ul(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 gh{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 Il{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 Il(r,i,this.flags,this.goalColumn)}extend(t,n=t,r=0){if(t<=this.anchor&&n>=this.anchor)return te.range(t,n,void 0,void 0,r);let i=Math.abs(t-this.anchor)>Math.abs(n-this.anchor)?t:n;return te.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 te.range(t.anchor,t.head)}static create(t,n,r,i){return new Il(t,n,r,i)}}class te{constructor(t,n){this.ranges=t,this.mainIndex=n}map(t,n=-1){return t.empty?this:te.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 te([this.main],0)}addRange(t,n=!0){return te.create([t].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(t,n=this.mainIndex){let r=this.ranges.slice();return r[n]=t,te.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 te(t.ranges.map(n=>Il.fromJSON(n)),t.main)}static single(t,n=t){return new te([te.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 te.normalized(t.slice(),n);r=a.to}return new te(t,n)}static cursor(t,n=0,r,i){return Il.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?Il.create(n,t,l|32,r):Il.create(t,n,l,r)}static undirectionalRange(t,n){return Il.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?te.range(c,s):te.range(s,c))}}return new te(t,n)}}function xI(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let TO=0;class me{constructor(t,n,r,i,a){this.combine=t,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=TO++,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:MO),!!t.static,t.enables)}of(t){return new Bm([],this,0,t)}compute(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Bm(t,this,1,n)}computeN(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Bm(t,this,2,n)}from(t,n){return n||(n=r=>r),this.compute([t],r=>n(r.field(t)))}}function MO(e,t){return e==t||e.length==t.length&&e.every((n,r)=>n===t[r])}class Bm{constructor(t,n,r,i){this.dependencies=t,this.facet=n,this.type=r,this.value=i,this.id=TO++}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)||cS(p,d)){let v=r(p);if(s?!QM(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=lg(g,y);if(this.dependencies.every(w=>w instanceof me?g.facet(w)===p.facet(w):w instanceof jn?g.field(w,!1)==p.field(w,!1):!0)||(s?QM(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 QM(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 cS(e,t){let n=!1;for(let r of t)Zf(e,r)&1&&(n=!0);return n}function L7(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=lg(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)Zf(c,f);return c.values[l]=s(c),1},update(c,f){if(!cS(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=cS(c,r),p=f.config.facets[t.id],g=f.facet(t);if(p&&!d&&MO(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 Vp=me.define({static:!0});class jn{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 jn(TO++,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(Vp).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(Vp),l=i.facet(Vp),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,Vp.of({field:this,create:t})]}get extension(){return this}}const Lo={lowest:4,low:3,default:2,high:1,highest:0};function kf(e){return t=>new SI(t,e)}const ys={highest:kf(Lo.highest),high:kf(Lo.high),default:kf(Lo.default),low:kf(Lo.low),lowest:kf(Lo.lowest)};class SI{constructor(t,n){this.inner=t,this.prec=n}get extension(){return this}}class Lv{of(t){return new fS(this,t)}reconfigure(t){return Lv.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class fS{constructor(t,n){this.compartment=t,this.inner=n}get extension(){return this}}class ag{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 I7(t,n,l))g instanceof jn?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,MO(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=>L7(w,y,v))}}let p=f.map(g=>g(s));return new ag(t,l,p,s,c,a)}}function I7(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 fS&&n.delete(l.compartment)}if(i.set(l,s),Array.isArray(l))for(let f of l)a(f,s);else if(l instanceof fS){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 SI)a(l.inner,l.prec);else if(l instanceof jn)r[s].push(l),l.provides&&a(l.provides,s);else if(l instanceof Bm)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 Zf(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 lg(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}const wI=me.define(),hS=me.define({combine:e=>e.some(t=>t),static:!0}),OI=me.define({combine:e=>e.length?e[0]:void 0,static:!0}),AI=me.define(),kI=me.define(),CI=me.define(),EI=me.define({combine:e=>e.length?e[0]:!1});class oa{constructor(t,n){this.type=t,this.value=n}static define(){return new B7}}class B7{of(t){return new oa(this,t)}}class z7{constructor(t){this.map=t}of(t){return new _e(this,t)}}class _e{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 _e(this.type,n)}is(t){return this.type==t}static define(t={}){return new z7(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}}_e.reconfigure=_e.define();_e.appendConfig=_e.define();class Zt{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&&xI(r,n.newLength),a.some(s=>s.type==Zt.time)||(this.annotations=a.concat(Zt.time.of(Date.now())))}static create(t,n,r,i,a,l){return new Zt(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(Zt.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]=="."))}}Zt.time=oa.define();Zt.userEvent=oa.define();Zt.addToHistory=oa.define();Zt.remote=oa.define();function $7(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 TI(e,t,n){var r;let i,a,l;return n?(i=t.changes,a=Yt.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:_e.mapEffects(e.effects,i).concat(_e.mapEffects(t.effects,a)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function dS(e,t,n){let r=t.selection,i=Nu(t.annotations);return t.userEvent&&(i=i.concat(Zt.userEvent.of(t.userEvent))),{changes:t.changes instanceof Yt?t.changes:Yt.of(t.changes||[],n,e.facet(OI)),selection:r&&(r instanceof te?r:te.single(r.anchor,r.head)),effects:Nu(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}function MI(e,t,n){let r=dS(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=TI(r,dS(e,t[a],l?r.changes.newLength:e.doc.length),l)}let i=Zt.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return H7(n?U7(i):i)}function U7(e){let t=e.startState,n=!0;for(let i of t.facet(AI)){let a=i(e);if(a===!1){n=!1;break}Array.isArray(a)&&(n=n===!0?a:$7(n,a))}if(n!==!0){let i,a;if(n===!1)a=e.changes.invertedDesc,i=Yt.empty(t.doc.length);else{let l=e.changes.filter(n);i=l.changes,a=l.filtered.mapDesc(l.changes).invertedDesc}e=Zt.create(t,i,e.selection&&e.selection.map(a),_e.mapEffects(e.effects,a),e.annotations,e.scrollIntoView)}let r=t.facet(kI);for(let i=r.length-1;i>=0;i--){let a=r[i](e);a instanceof Zt?e=a:Array.isArray(a)&&a.length==1&&a[0]instanceof Zt?e=a[0]:e=MI(t,Nu(a),!1)}return e}function H7(e){let t=e.startState,n=t.facet(CI),r=e;for(let i=n.length-1;i>=0;i--){let a=n[i](e);a&&Object.keys(a).length&&(r=TI(r,dS(t,a,e.changes.newLength),!0))}return r==e?e:Zt.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}const F7=[];function Nu(e){return e==null?F7: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 q7=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let pS;try{pS=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function W7(e){if(pS)return pS.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||q7.test(n)))return!0}return!1}function V7(e){return t=>{if(!/\S/.test(t))return Ot.Space;if(W7(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 Fe{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++)Zf(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 Zf(this,r),lg(this,r)}update(...t){return MI(this,t,!0)}applyTransaction(t){let n=this.config,{base:r,compartments:i}=n;for(let s of t.effects)s.is(Lv.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(_e.reconfigure)?(n=null,r=s.value):s.is(_e.appendConfig)&&(n=null,r=Nu(r).concat(s.value));let a;n?a=t.startState.values.slice():(n=ag.resolve(r,i,this),a=new Fe(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(c,f)=>f.reconfigure(c,this),null).values);let l=t.startState.facet(hS)?t.newSelection:t.newSelection.asSingle();new Fe(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:te.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=Nu(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=_e.mapEffects(l,d).concat(_e.mapEffects(Nu(c.effects),p))}return{changes:i,selection:te.create(a,n.mainIndex),effects:l}}changes(t=[]){return t instanceof Yt?t:Yt.of(t,this.doc.length,this.facet(Fe.lineSeparator))}toText(t){return Je.of(t.split(this.facet(Fe.lineSeparator)||oS))}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:(Zf(this,n),lg(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 jn&&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 Fe.create({doc:t.doc,selection:te.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(t={}){let n=ag.resolve(t.extensions||[],new Map),r=t.doc instanceof Je?t.doc:Je.of((t.doc||"").split(n.staticFacet(Fe.lineSeparator)||oS)),i=t.selection?t.selection instanceof te?t.selection:te.single(t.selection.anchor,t.selection.head):te.single(0);return xI(i,r.length),n.staticFacet(hS)||(i=i.asSingle()),new Fe(n,r,i,n.dynamicSlots.map(()=>null),(a,l)=>l.create(a),null)}get tabSize(){return this.facet(Fe.tabSize)}get lineBreak(){return this.facet(Fe.lineSeparator)||`
|
|
59
|
-
`}get readOnly(){return this.facet(EI)}phrase(t,...n){for(let r of this.facet(Fe.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(wI))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 V7(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:te.range(l+r,s+r)}}Fe.allowMultipleSelections=hS;Fe.tabSize=me.define({combine:e=>e.length?e[0]:4});Fe.lineSeparator=OI;Fe.readOnly=EI;Fe.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])}});Fe.languageData=wI;Fe.changeFilter=AI;Fe.transactionFilter=kI;Fe.transactionExtender=CI;Lv.reconfigure=_e.define();function sa(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 Ql{eq(t){return this==t}range(t,n=t){return mS.create(t,n,this)}}Ql.prototype.startSide=Ql.prototype.endSide=0;Ql.prototype.point=!1;Ql.prototype.mapMode=Kn.TrackDel;function PO(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}let mS=class PI{constructor(t,n,r){this.from=t,this.to=n,this.value=r}static create(t,n,r){return new PI(t,n,r)}};function gS(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class DO{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 DO(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(gS)),this.isEmpty)return n.length?ze.of(n):this;let s=new DI(this,null,-1).goto(0),c=0,f=[],d=new qa;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(mS.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 vh.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,n=0){return vh.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=XM(l,s,r),f=new Cf(l,c,a),d=new Cf(s,c,a);r.iterGaps((p,g,v)=>YM(f,p,d,g,v,i)),r.empty&&r.length==0&&YM(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=XM(a,l),c=new Cf(a,s,0).goto(r),f=new Cf(l,s,0).goto(r);for(;;){if(c.to!=f.to||!vS(c.active,f.active)||c.point&&(!f.point||!PO(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 Cf(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 qa;for(let i of t instanceof mS?[t]:n?K7(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 K7(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(gS(t,r)>0)return e.slice().sort(gS);t=r}return e}ze.empty.nextLayer=ze.empty;class qa{finishChunk(t){this.chunks.push(new DO(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 qa)).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 XM(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 DI{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 vh{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 DI(l,n,r,a));return i.length==1?i[0]:new vh(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--)xx(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--)xx(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(),xx(this.heap,0)}}}function xx(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 Cf{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=vh.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){Kp(this.active,t),Kp(this.activeTo,t),Kp(this.activeRank,t),this.minActive=GM(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++;Qp(this.active,n,r),Qp(this.activeTo,n,i),Qp(this.activeRank,n,a),t&&Qp(t,n,this.cursor.from),this.minActive=GM(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&&Kp(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 YM(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&&PO(e.point,n.point)&&vS(e.activeForPoint(e.to),n.activeForPoint(n.to))||a.comparePoint(s,y,e.point,n.point),d=!1):(d&&a.boundChange(s),y>s&&!vS(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 vS(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!PO(e[n],t[n]))return!1;return!0}function Kp(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}function Qp(e,t,n){for(let r=e.length-1;r>=t;r--)e[r+1]=e[r];e[t]=n}function GM(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 pc(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 yS(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 bS="ͼ",ZM=typeof Symbol>"u"?"__"+bS:Symbol.for(bS),xS=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),JM=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=JM[ZM]||1;return JM[ZM]=t+1,bS+t.toString(36)}static mount(t,n,r){let i=t[xS],a=r&&r.nonce;i?a&&i.setNonce(a):i=new Q7(t,a),i.mount(Array.isArray(n)?n:[n],t)}}let eP=new Map;class Q7{constructor(t,n){let r=t.ownerDocument||t,i=r.defaultView;if(!t.head&&t.adoptedStyleSheets&&i.CSSStyleSheet){let a=eP.get(r);if(a)return t[xS]=a;this.sheet=new i.CSSStyleSheet,eP.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],t[xS]=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 Yl={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:"'"},yh={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},X7=typeof navigator<"u"&&/Mac/.test(navigator.platform),Y7=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var On=0;On<10;On++)Yl[48+On]=Yl[96+On]=String(On);for(var On=1;On<=24;On++)Yl[On+111]="F"+On;for(var On=65;On<=90;On++)Yl[On]=String.fromCharCode(On+32),yh[On]=String.fromCharCode(On);for(var Sx in Yl)yh.hasOwnProperty(Sx)||(yh[Sx]=Yl[Sx]);function G7(e){var t=X7&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||Y7&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?yh:Yl)[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++)_I(e,arguments[t]);return e}function _I(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++)_I(e,t[n]);else throw new RangeError("Unsupported child node: "+t)}let Wn=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},SS=typeof document<"u"?document:{documentElement:{style:{}}};const wS=/Edge\/(\d+)/.exec(Wn.userAgent),NI=/MSIE \d/.test(Wn.userAgent),OS=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Wn.userAgent),Iv=!!(NI||OS||wS),tP=!Iv&&/gecko\/(\d+)/i.test(Wn.userAgent),wx=!Iv&&/Chrome\/(\d+)/.exec(Wn.userAgent),nP="webkitFontSmoothing"in SS.documentElement.style,AS=!Iv&&/Apple Computer/.test(Wn.vendor),rP=AS&&(/Mobile\/\w+/.test(Wn.userAgent)||Wn.maxTouchPoints>2);var pe={mac:rP||/Mac/.test(Wn.platform),windows:/Win/.test(Wn.platform),linux:/Linux|X11/.test(Wn.platform),ie:Iv,ie_version:NI?SS.documentMode||6:OS?+OS[1]:wS?+wS[1]:0,gecko:tP,gecko_version:tP?+(/Firefox\/(\d+)/.exec(Wn.userAgent)||[0,0])[1]:0,chrome:!!wx,chrome_version:wx?+wx[1]:0,ios:rP,android:/Android\b/.test(Wn.userAgent),webkit:nP,webkit_version:nP?+(/\bAppleWebKit\/(\d+)/.exec(Wn.userAgent)||[0,0])[1]:0,safari:AS,safari_version:AS?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Wn.userAgent)||[0,0])[1]:0,tabSize:SS.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function _O(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 og=Object.create(null);function NO(e,t,n){if(e==t)return!0;e||(e=og),t||(t=og);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 Z7(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 iP(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 J7(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 ua{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 Ql{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 Xh(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 os(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}=RI(t,n);r=(a?n?-3e8:-1:5e8)-1,i=(l?n?2e8:1:-6e8)+1}return new os(t,r,i,n,t.widget||null,!0)}static line(t){return new Yh(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 Xh extends Ce{constructor(t){let{start:n,end:r}=RI(t);super(n?-1:5e8,r?1:-6e8,null,t),this.tagName=t.tagName||"span",this.attrs=t.class&&t.attributes?_O(t.attributes,{class:t.class}):t.class?{class:t.class}:t.attributes||og}eq(t){return this==t||t instanceof Xh&&this.tagName==t.tagName&&NO(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)}}Xh.prototype.point=!1;class Yh extends Ce{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof Yh&&this.spec.class==t.spec.class&&NO(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)}}Yh.prototype.mapMode=Kn.TrackBefore;Yh.prototype.point=!0;class os 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?Kn.TrackBefore:Kn.TrackAfter:Kn.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 os&&eK(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)}}os.prototype.point=!0;function RI(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 eK(e,t){return e==t||!!(e&&t&&e.compare(t))}function Ru(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 bh extends Ql{constructor(t,n,r){super(),this.tagName=t,this.attributes=n,this.rank=r}eq(t){return t==this||t instanceof bh&&this.tagName==t.tagName&&NO(this.attributes,t.attributes)}static create(t){return new bh(t.tagName,t.attributes||og,t.rank==null?50:Math.max(0,Math.min(t.rank,100)))}static set(t,n=!1){return ze.of(t,n)}}bh.prototype.startSide=bh.prototype.endSide=-1;function xh(e){let t;return e.nodeType==11?t=e.getSelection?e:e.ownerDocument:t=e,t.getSelection()}function kS(e,t){return t?e==t||e.contains(t.nodeType!=1?t.parentNode:t):!1}function Jf(e,t){if(!t.anchorNode)return!1;try{return kS(e,t.anchorNode)}catch{return!1}}function eh(e){return e.nodeType==3?wh(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function th(e,t,n,r){return n?aP(e,t,n,r,-1)||aP(e,t,n,r,1):!1}function Gl(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function sg(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function aP(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Wa(e))){if(e.nodeName=="DIV")return!1;let a=e.parentNode;if(!a||a.nodeType!=1)return!1;t=Gl(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?Wa(e):0}else return!1}}function Wa(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Sh(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 tK(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 jI(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 nK(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=tK(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 E=d.getBoundingClientRect();({scaleX:y,scaleY:x}=jI(d,E)),g={left:E.left,right:E.left+d.clientWidth*y,top:E.top,bottom:E.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 E=t.bottom-t.top,k=g.bottom-g.top;A=(i=="center"&&E<=k?t.top+E/2-k/2:i=="start"||i=="center"&&n<0?t.top-l:t.bottom-k+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 E=0,k=0;if(A){let M=d.scrollTop;d.scrollTop+=A/x,k=(d.scrollTop-M)*x}if(w){let M=d.scrollLeft;d.scrollLeft+=w/y,E=(d.scrollLeft-M)*y}t={left:t.left-E,top:t.top-k,right:t.right-E,bottom:t.bottom-k},E&&Math.abs(E-w)<1&&(r="nearest"),k&&Math.abs(k-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 LI(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 rK{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?Wa(n):0),r,Math.min(t.focusOffset,r?Wa(r):0))}set(t,n,r,i){this.anchorNode=t,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let No=null;pe.safari&&pe.safari_version>=26&&(No=!1);function II(e){if(e.setActive)return e.setActive();if(No)return e.focus(No);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(No==null?{get preventScroll(){return No={preventScroll:!0},!0}}:void 0),!No){No=!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 lP;function wh(e,t,n=t){let r=lP||(lP=document.createRange());return r.setEnd(e,n),r.setStart(e,t),r}function ju(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 iK(e){for(;e;){if(e&&(e.nodeType==9||e.nodeType==11&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}function aK(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,Wa(n));;)if(r){if(n.nodeType!=1)return!1;let i=n.childNodes[r-1];i.contentEditable=="false"?r--:(n=i,r=Wa(n))}else{if(n==e)return!0;r=Gl(n),n=n.parentNode}}function BI(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 zI(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=Wa(n)}else if(n.parentNode&&!sg(n))r=Gl(n),n=n.parentNode;else return null}}function $I(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&&!sg(n))r=Gl(n)+1,n=n.parentNode;else return null}}class mi{constructor(t,n,r=!0){this.node=t,this.offset=n,this.precise=r}static before(t,n){return new mi(t.parentNode,Gl(t),n)}static after(t,n){return new mi(t.parentNode,Gl(t)+1,n)}}var ft=(function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e})(ft||(ft={}));const ss=ft.LTR,RO=ft.RTL;function UI(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<+e[n]);return t}const lK=UI("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),oK=UI("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),CS=Object.create(null),Ni=[];for(let e of["()","[]","{}"]){let t=e.charCodeAt(0),n=e.charCodeAt(1);CS[t]=n,CS[n]=-t}function HI(e){return e<=247?lK[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?oK[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}const sK=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Ki{get dir(){return this.level%2?RO:ss}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 FI(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||!FI(r.inner,i.inner))return!1}return!0}const ct=[];function uK(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=HI(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 cK(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=CS[g=e.charCodeAt(p)])if(v<0){for(let x=s-3;x>=0;x-=3)if(Ni[x+1]==-v){let w=Ni[x+2],A=w&2?i:w&4?w&1?a:i:0;A&&(ct[p]=ct[Ni[x]]=A),s=x;break}}else{if(Ni.length==189)break;Ni[s++]=p,Ni[s++]=g,Ni[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=Ni[w+2];if(A&2)break;if(x)Ni[w+2]|=2;else{if(A&4)break;Ni[w+2]|=4}}}}}function fK(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 ES(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 Ki(c,x.from,v));let w=x.direction==ss!=!(v%2);TS(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?ES(e,c,y,r+1,i,g,l):c<y&&l.push(new Ki(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 Ki(x.to,c,v));let w=x.direction==ss!=!(v%2);TS(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?ES(e,y,c,r+1,i,g,l):y<c&&l.push(new Ki(y,c,v)),c=y}}function TS(e,t,n,r,i,a,l){let s=t%2?2:1;uK(e,i,a,r,s),cK(e,i,a,r,s),fK(i,a,r,s),ES(e,i,a,t,n,r,l)}function hK(e,t,n){if(!e)return[new Ki(0,0,t==RO?1:0)];if(t==ss&&!n.length&&!sK.test(e))return qI(e.length);if(n.length)for(;e.length>ct.length;)ct[ct.length]=256;let r=[],i=t==ss?0:1;return TS(e,i,i,n,0,e.length,r),r}function qI(e){return[new Ki(0,e,0)]}let WI="";function dK(e,t,n,r,i){var a;let l=r.head-e.from,s=Ki.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),WI=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?te.cursor(p.side(!i,n)+e.from,p.forward(i,n)?1:-1,p.level):te.cursor(d+e.from,c.forward(i,n)?-1:1,c.level)}function pK(e,t,n){for(let r=t;r<n;r++){let i=HI(e.charCodeAt(r));if(i==1)return ss;if(i==2||i==4)return RO}return ss}const VI=me.define(),KI=me.define(),QI=me.define(),XI=me.define(),MS=me.define(),YI=me.define(),GI=me.define(),jO=me.define(),LO=me.define(),ZI=me.define({combine:e=>e.some(t=>t)}),JI=me.define({combine:e=>e.some(t=>t)}),e3=me.define();class Lu{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 Lu(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 Lu(te.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Xp=_e.define({map:(e,t)=>e.map(t)}),t3=_e.define();function sr(e,t,n){let r=e.facet(XI);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 _a=me.define({combine:e=>e.length?e[0]:!0});let mK=0;const Ou=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 Nt{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(Ou.of({plugin:this,arg:void 0}))}of(t){return this.baseExtensions.concat(Ou.of({plugin:this,arg:t}))}static define(t,n){const{eventHandlers:r,eventObservers:i,provide:a,decorations:l}=n||{};return new Nt(mK++,t,r,i,s=>{let c=[];return l&&c.push(Bv.of(f=>{let d=f.plugin(s);return d?l(d):Ce.none})),a&&c.push(a(s)),c})}static fromClass(t,n){return Nt.define((r,i)=>new t(r,i),n)}}class Ox{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(sr(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){sr(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){sr(t.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const n3=me.define(),IO=me.define(),Bv=me.define(),r3=me.define(),BO=me.define(),Gh=me.define(),i3=me.define();function oP(e,t){let n=e.state.facet(i3);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=pK(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 a3=me.define();function zO(e){let t=0,n=0,r=0,i=0;for(let a of e.state.facet(a3)){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 Ff=me.define();class Yr{constructor(t,n,r,i){this.fromA=t,this.toA=n,this.fromB=r,this.toB=i}join(t){return new Yr(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 Yr(d,g,f,p))}return r}}class ug{constructor(t,n,r){this.view=t,this.state=n,this.transactions=r,this.flags=0,this.startState=t.state,this.changes=Yt.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 Yr(a,l,s,c))),this.changedRanges=i}static create(t,n,r){return new ug(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 gK=[];class _t{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 gK}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&&Z7(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=Gl(this.dom),i=this.length?t>0:n>0;return new mi(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 $v)return t;return null}static get(t){return t.cmTile}}class zv extends _t{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=sP(i);else n.insertBefore(s.dom,i);r=s.dom}for(i=r?r.nextSibling:n.firstChild,a&&i&&(a.written=!0);i;)i=sP(i);this.length=l}}function sP(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class $v extends zv{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=_t.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 za)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 za extends zv{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 za(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}}class Qu extends zv{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&&yK(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):vK(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 mi(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 mi(c.dom,0);c==r.tile&&(s=!0)}}return new mi(this.dom,0)}}function vK(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=eh(t);return n[n.length-1]||null}function yK(e,t){let n=e.coordsIn(0,1),r=t.coordsIn(0,1);return n&&r&&r.top<n.bottom}class or extends zv{constructor(t,n){super(t),this.mark=n}get domAttrs(){return this.mark.attrs}static of(t,n){let r=new or(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}}class Uo extends _t{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=wh(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:Sh(f,(s?s>0:n<0)==r)}static of(t,n){let r=new Uo(n||document.createTextNode(t),t);return n||(r.flags|=2),r}}class us extends _t{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 Sh(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 Sh(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 us(a,r,t,i)}}class cg extends _t{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:Sh(i,n>0==r)}}class bK{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 xK{constructor(t,n,r,i){this.from=t,this.to=n,this.wrapper=r,this.rank=i}}class SK{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 Uo(s.dom,s.text+t);c.parent=l}else l.append(i||Uo.of(t,(a=this.cache.find(Uo))===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)?Ax(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 or&&f.mark.eq(c.mark))f.dom!=c.dom&&f.setDOM(Ax(c.dom)),i=f;else{if(this.cache.reused.get(c)){let p=_t.get(c.dom);p&&p.setDOM(Ax(c.dom))}let d=or.of(c.mark,c.dom);i.append(d),i=d}this.cache.reused.set(c,2)}let a=_t.get(t.text);a&&this.cache.reused.set(a,2);let l=new Uo(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=l3);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 or&&s.mark.eq(l))i=s,n--;else{let c=or.of(l,(r=this.cache.find(or,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||!uP(this.curLine,!1)||t.dom.nodeName!="BR"&&t.isWidget()&&!(pe.ios&&uP(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(kx,0,32)||new us(kx.toDOM(),0,kx,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 xK(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 za&&i.wrapper.eq(r.wrapper))n=i;else{let a=za.of(r.wrapper,(t=this.cache.find(za,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(cg,void 0,1);return r&&(r.flags=n),r||new cg(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class wK{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 fg=[us,Qu,Uo,or,cg,za,$v];for(let e=0;e<fg.length;e++)fg[e].bucket=e;class OK{constructor(t){this.view=t,this.buckets=fg.map(()=>[]),this.index=fg.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 us(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 AK{constructor(t,n,r,i,a){this.view=t,this.decorations=i,this.disallowBlockEffectsFor=a,this.openWidget=!1,this.openMarks=0,this.cache=new OK(t),this.text=new wK(t.state.doc),this.builder=new SK(this.cache,new $v(t,t.contentDOM),ze.iter(r)),this.cache.reused.set(n,2),this.old=new bK(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=EK(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?us.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 cg)this.cache.add(l);else if(l instanceof or)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 or&&i.unshift(l.mark)),this.openWidget=!1},leave:l=>{l.isLine()?i.length&&(i.length=a=0):l instanceof or&&(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 os){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?Xu.block:Xu.inline),y=kK(f),x=this.cache.findWidget(v,c-s,y)||us.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=CK(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=_t.get(i);if(i==this.view.contentDOM)break;a instanceof or?n.push(a):a?.isLine()?r=a:a instanceof za||(i.nodeName=="DIV"&&!r&&i!=this.view.contentDOM?r=new Qu(i,l3):r||n.push(or.of(new Xh({tagName:i.nodeName.toLowerCase(),attributes:J7(i)}),i)))}return{line:r,marks:n}}}function uP(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 kK(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 l3={class:"cm-line"};function CK(e,t){let n=t.spec.attributes,r=t.spec.class;return!n&&!r||(e||(e={class:"cm-line"}),n&&_O(n,e),r&&(e.class+=" "+r)),e}function EK(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 or&&t.push(r.mark)}return t}function Ax(e){let t=_t.get(e);return t&&t.setDOM(e.cloneNode()),e}class Xu extends ua{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}}Xu.inline=new Xu("span");Xu.block=new Xu("div");const kx=new class extends ua{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class cP{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 $v(t,t.contentDOM),this.updateInner([new Yr(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:!LK(t.changes,this.hasComposition)&&!t.selectionSet&&(i=t.state.selection.main.head));let a=i>-1?MK(this.view,t.changes,i):null;if(this.domChanged=null,this.hasComposition){let{from:d,to:p}=this.hasComposition;r=new Yr(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=_K(l,this.decorations,t.changes);c.length&&(r=Yr.extendWithRanges(r,c));let f=RK(s,this.blockWrappers,t.changes);return f.length&&(r=Yr.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 AK(this.view,l,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&_t.get(n.text)&&s.cache.reused.set(_t.get(n.text),2),this.tile=s.run(t,n),PS(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 Cx&&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(t3)&&(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(_a)||r.tabIndex>-1)&&Jf(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&&TK(f)){let g=document.createTextNode("");this.view.observer.ignore(()=>f.node.insertBefore(g,f.node.childNodes[f.offset]||null)),f=d=new mi(g,0),s=!0}let p=this.view.observer.selectionRange;(s||!p.focusNode||(!th(f.node,f.offset,p.anchorNode,p.anchorOffset)||!th(d.node,d.offset,p.focusNode,p.focusOffset))&&!this.suppressWidgetCursorChange(p,c))&&(this.view.observer.ignore(()=>{pe.android&&pe.chrome&&r.contains(p.focusNode)&&jK(p.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let g=xh(this.view.root);if(g)if(c.empty){if(pe.gecko){let v=PK(f.node,f.offset);if(v&&v!=3){let y=(v==1?zI:$I)(f.node,f.offset);y&&(f=new mi(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 mi(p.anchorNode,p.anchorOffset),this.impreciseHead=d.precise?null:new mi(p.focusNode,p.focusOffset)}suppressWidgetCursorChange(t,n){return this.hasComposition&&n.empty&&th(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=xh(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=Wa(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&&!_t.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 Cx?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=wh(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:E}=A;if(v&&!y&&(f+=A.top-v.top),x instanceof za)w>r&&d(x,g,A);else if(g>=r&&(f>0&&n.push(-f),n.push(E+f),f=0,l)){let k=x.dom.lastChild,M=k?eh(k):[];if(M.length){let D=M[M.length-1],P=c?D.right-A.left:A.right-D.left;P>s&&(s=P,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=eh(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=eh(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 Cx(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(Bv).map(a=>(this.dynamicDecorationMap[t++]=typeof a=="function")?a(this.view):a),r=!1,i=this.view.state.facet(BO).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(r3).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(e3))try{if(f(this.view,t.range,t))return!0}catch(d){sr(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=zO(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(nK(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(){PS(this.tile)}}function PS(e,t){let n=t?.get(e);if(n!=1){n==null&&e.destroy();for(let r of e.children)PS(r,t)}}function TK(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 o3(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=zI(n.focusNode,n.focusOffset),i=$I(n.focusNode,n.focusOffset),a=r||i;if(i&&r&&i.node!=r.node){let s=_t.get(i.node);if(!s||s.isText()&&s.text!=i.node.nodeValue)a=i;else if(e.docView.lastCompositionAfterCursor){let c=_t.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 MK(e,t,n){let r=o3(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 Yr(c.mapPos(a),c.mapPos(l),a,l),text:i}}function PK(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 DK=class{constructor(){this.changes=[]}compareRange(t,n){Ru(t,n,this.changes)}comparePoint(t,n){Ru(t,n,this.changes)}boundChange(t){Ru(t,t,this.changes)}};function _K(e,t,n){let r=new DK;return ze.compare(e,t,n,r),r.changes}class NK{constructor(){this.changes=[]}compareRange(t,n){Ru(t,n,this.changes)}comparePoint(){}boundChange(t){Ru(t,t,this.changes)}}function RK(e,t,n){let r=new NK;return ze.compare(e,t,n,r),r.changes}function jK(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 LK(e,t){let n=!1;return t&&e.iterChangedRanges((r,i)=>{r<t.to&&i>t.from&&(n=!0)}),n}class Cx extends ua{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 IK(e,t,n=1){let r=e.charCategorizer(t),i=e.doc.lineAt(t),a=t-i.from;if(i.length==0)return te.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 te.undirectionalRange(l+i.from,s+i.from)}function BK(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+yS(l,a,e.state.tabSize)}function DS(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 zK(e,t,n,r){let i=DS(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 te.cursor(c,n?-1:1)}return te.cursor(n?i.to:i.from,n?-1:1)}function fP(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=dK(i,a,l,s,n),d=WI;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 $K(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 UK(e,t,n,r){let i=t.head,a=n?1:-1;if(i==(n?e.state.doc.length:0))return te.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=_S(e,{x:p,y:x},!1,a);if(n?x>c.bottom:x<c.top)return te.cursor(w.pos,w.assoc);let A=e.coordsAtPos(w.pos,w.assoc),E=A?(A.top+A.bottom)/2:0;if(!A||(n?E>s:E<s))return te.cursor(w.pos,w.assoc,void 0,l)}}function nh(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 s3(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=nh(e,i.from,0);l!=i.from&&(a=te.cursor(l,-1))}else{let l=nh(e,i.from,-1),s=nh(e,i.to,1);(l!=i.from||s!=i.to)&&(i.undirectional?a=te.undirectionalRange(i.from,i.to):a=te.range(i.from==i.anchor?l:s,i.from==i.head?l:s))}a&&(n||(n=t.ranges.slice()),n[r]=a)}return n?te.create(n,t.mainIndex):t}function Ex(e,t,n){let r=nh(e.state.facet(Gh).map(i=>i(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:te.cursor(r,r<n.from?1:-1)}class qi{constructor(t,n){this.pos=t,this.assoc=n}}function _S(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 qi(0,1);if(c>e.viewState.docHeight)return new qi(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=BK(e,i,f,l,s);return new qi(p,p==f.from?1:-1)}}if(f.type!=kn.Text)return c<(f.top+f.bottom)/2?new qi(f.from,1):new qi(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 HK(e,l,s,e.textDirectionAt(f.from)).scanTile(d,f.from)}class HK{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[Ki.find(i,t-r.from,-1,n)].level==this.baseDir}dirAt(t,n){let{line:r,spans:i}=this.bidiSpansAt(t);return i[Ki.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 E=0;E<y;E++){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 E=w[A],k=0;if(!(E.width==0&&w.length>1)){if(E.bottom<this.y)(!c||c.bottom<E.bottom)&&(c=E),k=1;else if(E.top>this.y)(!f||f.top>E.top)&&(f=E),k=-1;else{let M=E.left>this.x?this.x-E.left:E.right<this.x?this.x-E.right:0,D=Math.abs(M);D<p&&(d=x,p=D,g=E),M&&(k=M<0==(this.baseDir==ft.LTR)?-1:1)}k==-1&&(!s||this.baseDirAt(t[x],1))?a=x:k==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 wh(t.dom,l,s).getClientRects()});return i.after?new qi(r[i.i+1],-1):new qi(r[i.i],1)}scanTile(t,n){if(!t.length)return new qi(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:wh(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 qi(r[i.i+1],-1):new qi(l,1)}}const yu="";class FK{constructor(t,n){this.points=t,this.view=n,this.text="",this.lineSeparator=n.state.facet(Fe.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=yu}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=_t.get(i),s=i.nextSibling;if(s==n){l?.breakAfter&&!s&&r!=this.view.contentDOM&&this.lineBreak();break}let c=_t.get(s);(l&&c?l.breakAfter:(l?l.breakAfter:sg(i))||sg(s)&&(i.nodeName!="BR"||l?.isWidget())&&this.text.length>a)&&!WK(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=_t.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+(qK(t,r.node,r.offset)?n:0))}}function qK(e,t,n){for(;;){if(!t||n<Wa(t))return!1;if(t==e)return!0;n=Gl(t)+1,t=t.parentNode}}function WK(e,t){let n;for(;!(e==t||!e);e=e.nextSibling){let r=_t.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 hP{constructor(t,n){this.node=t,this.offset=n,this.pos=-1}}class VK{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=u3(t.docView.tile,n,r,0))){let c=a||l?[]:QK(t),f=new FK(c,t);f.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=f.text,this.newSel=XK(c,this.bounds.from)}else{let c=t.observer.selectionRange,f=a&&a.node==c.focusNode&&a.offset==c.focusOffset||!kS(t.contentDOM,c.focusNode)?s.main.head:t.docView.posFromDOM(c.focusNode,c.focusOffset),d=l&&l.node==c.anchorNode&&l.offset==c.anchorOffset||!kS(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(te.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=te.create([te.cursor(f,v)])}else this.newSel=te.single(d,f)}}}function u3(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 u3(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 c3(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,yu),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(yu))}:(v=f3(p,t.text,f-s,d))&&(pe.chrome&&l==13&&v.toB==v.from+2&&t.text.slice(v.from,v.toB)==yu+yu&&v.toB--,n={from:s+v.from,to:s+v.toA,insert:Je.of(t.text.slice(v.from,v.toB).split(yu))})}else r&&(!e.hasFocus&&i.facet(_a)||hg(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=te.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=te.single(r.main.anchor-1,r.main.head-1)),n={from:a.from,to:a.to,insert:Je.of([" "])}),n)return $O(e,n,r,l);if(r&&!hg(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=s3(i.facet(Gh).map(f=>f(e)),r))),e.dispatch({selection:r,scrollIntoView:s,userEvent:c}),!0}else return!1}function $O(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&&ju(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)&&ju(e.contentDOM,"Backspace",8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&ju(e.contentDOM,"Delete",46)))return!0;let a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let l,s=()=>l||(l=KK(e,t,n));return e.state.facet(YI).some(c=>c(e,t.from,t.to,a,s))||e.dispatch(s()),!0}function KK(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=nh(i.facet(Gh).map(p=>p(e)),f,c);t.from==d&&(l=d)}if(l>-1)r={changes:t,selection:te.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&&o3(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}),E=y.to-a.to;return{changes:A,range:f?te.range(Math.max(0,f.anchor+E),Math.max(0,f.head+E)):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 f3(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 QK(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 hP(n,r)),(i!=n||a!=r)&&t.push(new hP(i,a))),t}function XK(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?te.single(n+t,r+t):null}function hg(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}class YK{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&&hQ(t.contentDOM.ownerDocument)}handleEvent(t){!aQ(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=ZK(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&&d3.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&&(h3.some(n=>n.keyCode==t.keyCode)&&!t.ctrlKey||JK.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)&&GK(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,ju(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 GK(e){return e.visualViewport?e.visualViewport.height*e.visualViewport.scale/e.document.documentElement.clientHeight<.85:!1}function dP(e,t){return(n,r)=>{try{return t.call(e,r,n)}catch(i){sr(n.state,i)}}}function ZK(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(dP(r.value,c))}if(l)for(let s in l){let c=l[s];c&&n(s).observers.push(dP(r.value,c))}}for(let r in xi)n(r).handlers.push(xi[r]);for(let r in Yn)n(r).observers.push(Yn[r]);return t}const h3=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],JK="dthko",d3=[16,17,18,20,91,92,224,225],Yp=6;function Gp(e){return Math.max(0,e)*.7+8}function eQ(e,t){return Math.max(Math.abs(e.clientX-t.clientX),Math.abs(e.clientY-t.clientY))}class tQ{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=LI(t.contentDOM),this.atoms=t.state.facet(Gh).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(Fe.allowMultipleSelections)&&nQ(t,n),this.dragging=iQ(t,n)&&g3(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&&eQ(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=zO(this.view);t.clientX-c.left<=i+Yp?n=-Gp(i-t.clientX):t.clientX+c.right>=l-Yp&&(n=Gp(t.clientX-l)),t.clientY-c.top<=a+Yp?r=-Gp(a-t.clientY):t.clientY+c.bottom>=s-Yp&&(r=Gp(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=s3(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 nQ(e,t){let n=e.state.facet(VI);return n.length?n[0](t):pe.mac?t.metaKey:t.ctrlKey}function rQ(e,t){let n=e.state.facet(KI);return n.length?n[0](t):pe.mac?!t.altKey:!t.ctrlKey}function iQ(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let r=xh(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 aQ(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=_t.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(t))return!1;return!0}const xi=Object.create(null),Yn=Object.create(null),p3=pe.ie&&pe.ie_version<15||pe.ios&&pe.webkit_version<604;function lQ(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(),m3(e,n.value)},50)}function Uv(e,t,n){for(let r of e.facet(t))n=r(n,e);return n}function m3(e,t){t=Uv(e.state,jO,t);let{state:n}=e,r,i=1,a=n.toText(t),l=a.lines==n.selection.ranges.length;if(NS!=null&&n.selection.ranges.every(c=>c.empty)&&NS==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:te.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:te.cursor(c.from+f.length)}}):r=n.replaceSelection(a);e.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}Yn.scroll=e=>{let t=e.inputState;t.lastScrollTop=e.scrollDOM.scrollTop,t.lastScrollLeft=e.scrollDOM.scrollLeft,pe.ios&&!t.touchActive&&(t.lastIOSMomentumScroll=Date.now())};Yn.wheel=Yn.mousewheel=e=>{e.inputState.lastWheelEvent=Date.now()};xi.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),t.keyCode==27&&e.inputState.tabFocusMode!=0&&(e.inputState.tabFocusMode=Date.now()+2e3),!1);Yn.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")};Yn.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")};Yn.touchend=(e,t)=>{e.inputState.touchActive=!1};xi.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(QI))if(n=r(e,t),n)break;if(!n&&t.button==0&&(n=sQ(e,t)),n){let r=!e.hasFocus;e.inputState.startMouseSelection(new tQ(e,t,n,r)),r&&e.observer.ignore(()=>{II(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 pP(e,t,n,r){if(r==1)return te.cursor(t,n);if(r==2)return IK(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++,te.undirectionalRange(l,s)}}const oQ=pe.ie&&pe.ie_version<=11;let mP=null,gP=0,vP=0;function g3(e){if(!oQ)return e.detail;let t=mP,n=vP;return mP=e,vP=Date.now(),gP=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(gP+1)%3:1}function sQ(e,t){let n=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),r=g3(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=pP(e,c.pos,c.assoc,r);if(n.pos!=c.pos&&!l){let p=pP(e,n.pos,n.assoc,r),g=Math.min(p.from,d.from),v=Math.max(p.to,d.to);d=g<d.from?te.range(g,v,d.assoc):te.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=uQ(i,c.pos))?f:s?i.addRange(d):te.create([d])}}}function uQ(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 te.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}xi.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=te.undirectionalRange(a,l))}}let{inputState:r}=e;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",Uv(e.state,LO,e.state.sliceDoc(n.from,n.to))),t.dataTransfer.effectAllowed="copyMove"),!1};xi.dragend=e=>(e.inputState.draggedContent=null,!1);function yP(e,t,n,r){if(n=Uv(e.state,jO,n),!n)return;let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:a}=e.inputState,l=r&&a&&rQ(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}xi.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&&yP(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 yP(e,t,r,!0),!0}return!1};xi.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=p3?null:t.clipboardData;return n?(m3(e,n.getData("text/plain")||n.getData("text/uri-list")),!0):(lQ(e),!1)};function cQ(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 fQ(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:Uv(e,LO,t.join(e.lineBreak)),ranges:n,linewise:r}}let NS=null;xi.copy=xi.cut=(e,t)=>{if(!Jf(e.contentDOM,e.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=fQ(e.state);if(!n&&!i)return!1;NS=i?n:null,t.type=="cut"&&!e.state.readOnly&&e.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let a=p3?null:t.clipboardData;return a?(a.clearData(),a.setData("text/plain",n),!0):(cQ(e,n),!1)};const v3=oa.define();function y3(e,t){let n=[];for(let r of e.facet(GI)){let i=r(e,t);i&&n.push(i)}return n.length?e.update({effects:n,annotations:v3.of(!0)}):null}function b3(e){setTimeout(()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=y3(e.state,t);n?e.dispatch(n):e.update([])}},10)}Yn.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),b3(e)};Yn.blur=e=>{e.observer.clearSelectionRange(),b3(e)};Yn.compositionstart=Yn.compositionupdate=e=>{e.observer.editContext||(e.inputState.compositionFirstChange==null&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0))};Yn.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))};Yn.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()};xi.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 $O(e,{from:c,to:f,insert:e.state.toText(a)},null),!0}}let i;if(pe.chrome&&pe.android&&(i=h3.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(()=>Yn.compositionend(e,t),20),!1};const bP=new Set;function hQ(e){bP.has(e)||(bP.add(e),e.addEventListener("copy",()=>{}),e.addEventListener("cut",()=>{}))}const xP=["pre-wrap","normal","pre-line","break-spaces"];let Yu=!1;function SP(){Yu=!1}class dQ{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 xP.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=xP.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 pQ{constructor(t,n){this.from=t,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class hi{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 os?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 hi(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 zm=.001;class Xn{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)>zm&&(Yu=!0),this.height=t)}replace(t,n,r){return Xn.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=UO.build(r.setDoc(l),t,d,p);a=dg(a,a.replace(c,f,y))}return a.updateHeight(r,0)}static empty(){return new Cr(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 gQ(Xn.of(t.slice(0,n)),l,Xn.of(t.slice(r)))}}function dg(e,t){return e==t?e:(e.constructor!=t.constructor&&(Yu=!0),t)}Xn.prototype.size=1;const mQ=Ce.replace({});class x3 extends Xn{constructor(t,n,r){super(t,n),this.deco=r,this.spaceAbove=0}mainBlock(t,n){return new hi(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 hi(i,0,r,this.spaceAbove,mQ):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 Cr extends x3{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 hi(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 Cr||i instanceof xn&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof xn?i=new Cr(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):Xn.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 Xn{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 hi(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 hi(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 hi(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 hi(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 hi(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 Xn.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)>=zm&&(c=-2);let v=new Cr(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=Xn.of(l);return(c<0||Math.abs(f.height-this.height)>=zm||Math.abs(c-this.heightMetrics(t,n).perLine)>=zm)&&(Yu=!0),dg(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 gQ extends Xn{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&&wP(a,l-1),n<this.length){let s=a.length;this.decomposeRight(n,a),wP(a,s)}return Xn.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?Xn.of(this.break?[t,null,n]:[t,n]):(this.left=dg(this.left,t),this.right=dg(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 wP(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 vQ=5;class UO{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 Cr?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Cr(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 x3(l,i,r)):(l||a||i>=vQ)&&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 Cr(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 Cr)return t;let n=new Cr(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 Cr)&&!this.isCovered?this.nodes.push(new Cr(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 Cr&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(t,n,r,i){let a=new UO(r,t);return ze.spans(n,r,i,a,0),a.finish(r)}}function yQ(e,t,n){let r=new bQ;return ze.compare(e,t,n,r,0),r.changes}class bQ{constructor(){this.changes=[]}compareRange(){}comparePoint(t,n,r,i){(t<n||r&&r.heightRelevant||i&&i.heightRelevant)&&Ru(t,n,this.changes,5)}}function xQ(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 SQ(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 wQ(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class Tx{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 OQ(this.displaySize*(n?t.scaleY:t.scaleX),n)}).range(this.from,this.to)}}class OQ extends ua{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 OP{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=AP,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=ft.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let r=n.facet(IO).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new dQ(r),this.stateDeco=kP(n),this.heightMap=Xn.empty().applyChanges(this.stateDeco,Je.empty,this.heightOracle.setDoc(n.doc),[new Yr(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 Zp(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?AP:new HO(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(qf(t,this.scaler))})}update(t,n=null){this.state=t.state;let r=this.stateDeco;this.stateDeco=kP(this.state);let i=t.changedRanges,a=Yr.extendWithRanges(i,yQ(r,this.stateDeco,t?t.changes:Yt.empty(this.state.doc.length))),l=this.heightMap.height,s=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);SP(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),a),(this.heightMap.height!=l||Yu)&&(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(JI)&&(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:D,scaleY:P}=jI(n,s);(D>.005&&Math.abs(this.scaleX-D)>.005||P>.005&&Math.abs(this.scaleY-P)>.005)&&(this.scaleX=D,this.scaleY=P,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=LI(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=BI(this.scrollParent||t.win);let x=(this.printing?wQ:xQ)(n,this.paddingTop),w=x.top-this.pixelViewport.top,A=x.bottom-this.pixelViewport.bottom;this.pixelViewport=x;let E=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(E!=this.inView&&(this.inView=E,E&&(c=!0)),!this.inView&&!this.scrollTarget&&!SQ(t.dom))return 0;let k=s.width;if((this.contentDOMWidth!=k||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=s.width,this.editorHeight=t.scrollDOM.clientHeight,f|=16),c){let D=t.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(D)&&(l=!0),l||i.lineWrapping&&Math.abs(k-this.contentDOMWidth)>i.charWidth){let{lineHeight:P,charWidth:N,textHeight:L}=t.docView.measureTextSize();l=P>0&&i.refresh(a,P,N,L,Math.max(5,k/N),D),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)),SP();for(let P of this.viewports){let N=P.from==this.viewport.from?D:t.docView.measureVisibleLineHeights(P);this.heightMap=(l?Xn.empty().applyChanges(this.stateDeco,Je.empty,this.heightOracle,[new Yr(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(i,0,l,new pQ(P.from,N))}Yu&&(f|=2)}let M=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return M&&(f&2&&(f|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),f|=this.updateForViewport()),(f&2||M)&&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 Zp(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 Zp(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 Zp(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 Tx(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=kQ(t,A=>A.from>=g.from&&A.to<=g.to&&Math.abs(A.from-d)<a&&Math.abs(A.to-p)<a&&!x.some(E=>A.from<E&&A.to>E));if(!w){if(p<g.to&&n&&r&&n.visibleRanges.some(k=>k.from<=p&&k.to>=p)){let k=n.moveToLineBoundary(te.cursor(p),!1,!0).head;k>d&&(p=k)}let A=this.gapSize(g,d,p,v),E=r||A<2e6?A:2e6;w=new Tx(d,p,A,E)}s.push(w)},f=d=>{if(d.length<l||d.type!=kn.Text)return;let p=AQ(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 E=em(p,g),k=((this.visibleBottom-this.visibleTop)/2+x)/d.height;w=E-k,A=E+k}else w=(this.visibleTop-d.top-x)/d.height,A=(this.visibleBottom-d.top+x)/d.height;v=Jp(p,w),y=Jp(p,A)}else{let x=p.total*this.heightOracle.charWidth,w=i*this.heightOracle.charWidth,A=0;if(x>2e6)for(let P of t)P.from>=d.from&&P.from<d.to&&P.size!=P.displaySize&&P.from*this.heightOracle.charWidth+A<this.pixelViewport.left&&(A=P.size-P.displaySize);let E=this.pixelViewport.left+A,k=this.pixelViewport.right+A,M,D;if(g!=null){let P=em(p,g),N=((k-E)/2+w)/x;M=P-N,D=P+N}else M=(E-w)/x,D=(k+w)/x;v=Jp(p,M),y=Jp(p,D)}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=em(i,r)-em(i,n);return this.heightOracle.lineWrapping?t.height*a:i.total*this.heightOracle.charWidth*a}updateLineGaps(t){Tx.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)||qf(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)||qf(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 qf(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 Zp{constructor(t,n){this.from=t,this.to=n}}function AQ(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 Jp({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 em(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 kQ(e,t){for(let n of e)if(t(n))return n}const AP={toDOM(e){return e},fromDOM(e){return e},scale:1,eq(e){return e==this}};function kP(e){let t=e.facet(Bv).filter(r=>typeof r!="function"),n=e.facet(BO).filter(r=>typeof r!="function");return n.length&&t.push(ze.join(n)),t}class HO{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 HO?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 qf(e,t){if(t.scale==1)return e;let n=t.toDOM(e.top),r=t.toDOM(e.bottom);return new hi(e.from,e.length,n,r-n,Array.isArray(e._content)?e._content.map(i=>qf(i,t)):e._content)}const tm=me.define({combine:e=>e.join(" ")}),RS=me.define({combine:e=>e.indexOf(!0)>-1}),jS=Xl.newName(),S3=Xl.newName(),w3=Xl.newName(),O3={"&light":"."+S3,"&dark":"."+w3};function LS(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 CQ=LS("."+jS,{"&":{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"}},O3),EQ={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Mx=pe.ie&&pe.ie_version<=11;class TQ{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new rK,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 PQ(t),t.state.facet(_a)&&(t.contentDOM.editContext=this.editContext.editContext)),Mx&&(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(_a)?r.root.activeElement!=this.dom:!Jf(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&&th(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,n=xh(t.root);if(!n)return!1;let r=pe.safari&&t.root.nodeType==11&&t.root.activeElement==this.dom&&MQ(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=Jf(this.dom,r);return i&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime<Date.now()-300&&aK(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,EQ),Mx&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Mx&&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&&ju(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&&Jf(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 VK(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=c3(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!hg(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=CP(n,t.previousSibling||t.target.previousSibling,-1),i=CP(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(_a)!=t.state.facet(_a)&&(t.view.contentDOM.editContext=t.state.facet(_a)?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 CP(e,t,n){for(;t;){let r=_t.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 EP(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 th(l.node,l.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function MQ(e,t){if(t.getComposedRanges){let i=t.getComposedRanges(e.root)[0];if(i)return EP(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?EP(e,n):null}class PQ{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=f3(t.state.sliceDoc(s,c),r.text,(f?i.from:i.to)-s,f?"end":null);if(!d){let g=te.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));hg(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);$O(t,p,te.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:t3.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=xh(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||iK(t.parent)||document,this.viewState=new OP(this,t.state||Fe.create(t)),t.scrollTo&&t.scrollTo.is(Xp)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Ou).map(i=>new Ox(i));for(let i of this.plugins)i.update(this);this.observer=new TQ(this),this.inputState=new YK(this),this.inputState.ensureHandlers(this.plugins),this.docView=new cP(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 Zt?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(v3))?(this.inputState.notifiedFocused=l,s=1):l!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=l,c=y3(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(Fe.phrases)!=this.state.facet(Fe.phrases))return this.setState(a);i=ug.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 Lu(v.empty?v:te.cursor(v.head,v.head>v.anchor?-1:1),"nearest","nearest",x,y)}for(let v of g.effects)v.is(Xp)&&(p=v.value.clip(this.state))}this.viewState.update(i,p),this.bidiCache=pg.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(Ff)!=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(tm)!=i.state.facet(tm)&&(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(MS))try{g(i)}catch(v){sr(this.state,v,"update listener")}(c||d)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),d&&!c3(this,d)&&f.force&&ju(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 OP(this,t),this.plugins=t.facet(Ou).map(r=>new Ox(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new cP(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(Ou),r=t.state.facet(Ou);if(n!=r){let i=[];for(let a of r){let l=n.indexOf(a);if(l<0)i.push(new Ox(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){sr(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(BI(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 sr(this.state,y),TP}}),p=ug.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]!=TP)try{let y=f[v];y.write&&y.write(d[v],this)}catch(y){sr(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(MS))s(n)}get themeClasses(){return jS+" "+(this.state.facet(RS)?w3:S3)+" "+this.state.facet(tm)}updateAttrs(){let t=MP(this,n3,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(_a)?"true":"false",class:"cm-content",style:`${pe.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),MP(this,IO,n);let r=this.observer.ignore(()=>{let i=iP(this.contentDOM,this.contentAttrs,n),a=iP(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(Ff);let t=this.state.facet(de.cspNonce);Xl.mount(this.root,this.styleModules.concat(CQ).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 Ex(this,t,fP(this,t,n,r))}moveByGroup(t,n){return Ex(this,t,fP(this,t,n,r=>$K(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 te.cursor(a.side(n,i)+t.from,a.forward(!n,i)?1:-1)}moveToLineBoundary(t,n,r=!0){return zK(this,t,n,r)}moveVertically(t,n,r){return Ex(this,t,UK(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=_S(this,t,n);return r&&r.pos}posAndSideAtCoords(t,n=!0){return this.readMeasured(),_S(this,t,n)}coordsAtPos(t,n=1){this.readMeasured();let r=this.state.doc.lineAt(t),i=this.bidiSpans(r),a=i[Ki.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(ZI)||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>DQ)return qI(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||FI(a.isolates,r=oP(this,t))))return a.order;r||(r=oP(this,t));let i=hK(t.text,n,r);return this.bidiCache.push(new pg(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(()=>{II(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 Xp.of(new Lu(typeof t=="number"?te.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 Xp.of(new Lu(te.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 Nt.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return Nt.define(()=>({}),{eventObservers:t})}static theme(t,n){let r=Xl.newName(),i=[tm.of(r),Ff.of(LS(`.${r}`,t))];return n&&n.dark&&i.push(RS.of(!0)),i}static baseTheme(t){return ys.lowest(Ff.of(LS("."+jS,t,O3)))}static findFromDOM(t){var n;let r=t.querySelector(".cm-content"),i=r&&_t.get(r)||_t.get(t);return((n=i?.root)===null||n===void 0?void 0:n.view)||null}}de.styleModule=Ff;de.inputHandler=YI;de.clipboardInputFilter=jO;de.clipboardOutputFilter=LO;de.scrollHandler=e3;de.focusChangeEffect=GI;de.perLineTextDirection=ZI;de.exceptionSink=XI;de.updateListener=MS;de.editable=_a;de.mouseSelectionStyle=QI;de.dragMovesSelection=KI;de.clickAddsSelectionRange=VI;de.decorations=Bv;de.blockWrappers=r3;de.outerDecorations=BO;de.atomicRanges=Gh;de.bidiIsolatedRanges=i3;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=a3;de.darkTheme=RS;de.cspNonce=me.define({combine:e=>e.length?e[0]:""});de.contentAttributes=IO;de.editorAttributes=n3;de.lineWrapping=de.contentAttributes.of({class:"cm-lineWrapping"});de.announce=_e.define();const DQ=4096,TP={};class pg{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 pg(n.mapPos(l.from,1),n.mapPos(l.to,-1),l.dir,l.isolates,!1,l.order))}return r}}function MP(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&&_O(l,n)}return n}const _Q=pe.mac?"mac":pe.windows?"win":pe.linux?"linux":"key";function NQ(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 nm(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 RQ=ys.default(de.domEventHandlers({keydown(e,t){return k3(A3(t.state),e,t,"editor")}})),Hv=me.define({enables:RQ}),PP=new WeakMap;function A3(e){let t=e.facet(Hv),n=PP.get(t);return n||PP.set(t,n=IQ(t.reduce((r,i)=>r.concat(i),[]))),n}function jQ(e,t,n){return k3(A3(e.state),t,e,n)}let Bl=null;const LQ=4e3;function IQ(e,t=_Q){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=>NQ(A,t));for(let A=1;A<y.length;A++){let E=y.slice(0,A).join(" ");i(E,!0),v[E]||(v[E]={preventDefault:!0,stopPropagation:!1,run:[k=>{let M=Bl={view:k,prefix:E,scope:l};return setTimeout(()=>{Bl==M&&(Bl=null)},LQ),!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,IS))}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 IS=null;function k3(e,t,n,r){IS=t;let i=G7(t),a=ar(i,0),l=Fi(a)==i.length&&i!=" ",s="",c=!1,f=!1,d=!1;Bl&&Bl.view==n&&Bl.scope==r&&(s=Bl.prefix+" ",d3.indexOf(t.keyCode)<0&&(f=!0,Bl=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+nm(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=Yl[t.keyCode])&&y!=i?(g(v[s+nm(y,t,!0)])||t.shiftKey&&(x=yh[t.keyCode])!=i&&x!=y&&g(v[s+nm(x,t,!1)]))&&(c=!0):l&&t.shiftKey&&g(v[s+nm(i,t,!0)])&&(c=!0),!c&&g(v._any)&&(c=!0)),f&&(c=!0),c&&d&&t.stopPropagation(),IS=null,c}class Go{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=C3(t);return[new Go(n,i.left-a.left,i.top-a.top,null,i.bottom-i.top)]}else return BQ(t,n,r)}}function C3(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 DP(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 BQ(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=C3(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=DS(e,r,1),y=DS(e,i,-1),x=v.type==kn.Text?v:null,w=y.type==kn.Text?y:null;if(x&&(e.lineWrapping||v.widgetLineBreaks)&&(x=DP(e,r,1,x)),w&&(e.lineWrapping||y.widgetLineBreaks)&&(w=DP(e,i,-1,w)),x&&w&&x.from==w.from&&x.to==w.to)return E(k(n.from,n.to,x));{let D=x?k(n.from,null,x):M(v,!1),P=w?k(null,n.to,w):M(y,!0),N=[];return(x||v).to<(w||y).from-(x&&w?1:0)||v.widgetLineBreaks>1&&D.bottom+e.defaultLineHeight/2<P.top?N.push(A(p,D.bottom,g,P.top)):D.bottom<P.top&&e.elementAtHeight((D.bottom+P.top)/2).type==kn.Text&&(D.bottom=P.top=(D.bottom+P.top)/2),E(D).concat(N).concat(E(P))}function A(D,P,N,L){return new Go(t,D-c.left,P-c.top,Math.max(0,N-D),L-P)}function E({top:D,bottom:P,horizontal:N}){let L=[];for(let U=0;U<N.length;U+=2)L.push(A(N[U],D,N[U+1],P));return L}function k(D,P,N){let L=1e9,U=-1e9,K=[];function V(ie,ue,z,Z,ae){let Q=e.coordsAtPos(ie,ie==N.to?-2:2),le=e.coordsAtPos(z,z==N.from?2:-2);!Q||!le||(L=Math.min(Q.top,le.top,L),U=Math.max(Q.bottom,le.bottom,U),ae==ft.LTR?K.push(a&&ue?p:Q.left,a&&Z?g:le.right):K.push(!a&&Z?p:le.left,!a&&ue?g:Q.right))}let B=D??N.from,oe=P??N.to;for(let ie of e.visibleRanges)if(ie.to>B&&ie.from<oe)for(let ue=Math.max(ie.from,B),z=Math.min(ie.to,oe);;){let Z=e.state.doc.lineAt(ue);for(let ae of e.bidiSpans(Z)){let Q=ae.from+Z.from,le=ae.to+Z.from;if(Q>=z)break;le>ue&&V(Math.max(Q,ue),D==null&&Q<=B,Math.min(le,z),P==null&&le>=oe,ae.dir)}if(ue=Z.to+1,ue>=z)break}return K.length==0&&V(B,D==null,oe,P==null,e.textDirection),{top:L,bottom:U,horizontal:K}}function M(D,P){let N=s.top+(P?D.top:D.bottom);return{top:N,bottom:N,horizontal:[]}}}function zQ(e,t){return e.constructor==t.constructor&&e.eq(t)}class $Q{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($m)!=t.state.facet($m)&&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($m);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)=>!zQ(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 $m=me.define();function E3(e){return[Nt.define(t=>new $Q(t,e)),$m.of(e)]}const Gu=me.define({combine(e){return sa(e,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(t,n)=>Math.min(t,n),drawRangeCursor:(t,n)=>t||n})}});function UQ(e={}){return[Gu.of(e),HQ,FQ,qQ,JI.of(!0)]}function T3(e){return e.startState.facet(Gu)!=e.state.facet(Gu)}const HQ=E3({above:!0,markers(e){let{state:t}=e,n=t.facet(Gu),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:te.cursor(i.head,i.assoc);for(let c of Go.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=T3(e);return n&&_P(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){_P(t.state,e)},class:"cm-cursorLayer"});function _P(e,t){t.style.animationDuration=e.facet(Gu).cursorBlinkRate+"ms"}const FQ=E3({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 Go.forRange(e,"cm-selectionBackground",i))t.push(a);if(pe.ios&&!n.empty&&e.state.facet(Gu).iosSelectionHandles){for(let i of Go.forRange(e,"cm-selectionHandle cm-selectionHandle-start",te.cursor(n.from,1)))t.push(i);for(let i of Go.forRange(e,"cm-selectionHandle cm-selectionHandle-end",te.cursor(n.to,1)))t.push(i)}return t},update(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||T3(e)},class:"cm-selectionLayer"}),qQ=ys.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"}}}})),M3=_e.define({map(e,t){return e==null?null:t.mapPos(e)}}),Wf=jn.define({create(){return null},update(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce((n,r)=>r.is(M3)?r.value:n,e)}}),WQ=Nt.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(Wf);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(Wf)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(Wf),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(Wf)!=e&&this.view.dispatch({effects:M3.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 VQ(){return[Wf,WQ]}function NP(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 KQ(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 QQ{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 qa,r=n.add.bind(n);for(let{from:i,to:a}of KQ(t,this.maxLength))NP(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 NP(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 BS=/x/.unicode!=null?"gu":"g",XQ=new RegExp(`[\0-\b
|
|
65
|
-
--\u2028\u2029\uFEFF-]`,BS),YQ={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 Px=null;function GQ(){var e;if(Px==null&&typeof document<"u"&&document.body){let t=document.body.style;Px=((e=t.tabSize)!==null&&e!==void 0?e:t.MozTabSize)!=null}return Px||!1}const Um=me.define({combine(e){let t=sa(e,{render:null,specialChars:XQ,addSpecialChars:null});return(t.replaceTabs=!GQ())&&(t.specialChars=new RegExp(" |"+t.specialChars.source,BS)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,BS)),t}});function ZQ(e={}){return[Um.of(e),JQ()]}let RP=null;function JQ(){return RP||(RP=Nt.fromClass(class{constructor(e){this.view=e,this.decorations=Ce.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(Um)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new QQ({regexp:e.specialChars,decoration:(t,n,r)=>{let{doc:i}=n.state,a=ar(t[0],0);if(a==9){let l=i.lineAt(r),s=n.state.tabSize,c=pc(l.text,s,r-l.from);return Ce.replace({widget:new rX((s-c%s)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[a]||(this.decorationCache[a]=Ce.replace({widget:new nX(e,a)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(Um);e.startState.facet(Um)!=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 eX="•";function tX(e){return e>=32?eX:e==10?"":String.fromCharCode(9216+e)}class nX extends ua{constructor(t,n){super(),this.options=t,this.code=n}eq(t){return t.code==this.code}toDOM(t){let n=tX(this.code),r=t.state.phrase("Control character")+" "+(YQ[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 rX extends ua{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 iX(){return lX}const aX=Ce.line({class:"cm-activeLine"}),lX=Nt.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(aX.range(i.from)),t=i.from)}return Ce.set(n)}},{decorations:e=>e.decorations});class oX extends ua{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?eh(t.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(t.parentNode),i=Sh(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 sX(e){let t=Nt.fromClass(class{constructor(n){this.view=n,this.placeholder=e?Ce.set([Ce.widget({widget:new oX(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 zS=2e3;function uX(e,t,n){let r=Math.min(t.line,n.line),i=Math.max(t.line,n.line),a=[];if(t.off>zS||n.off>zS||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(te.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=yS(f.text,l,e.tabSize,!0);if(d<0)a.push(te.cursor(f.to));else{let p=yS(f.text,s,e.tabSize);a.push(te.range(f.from+d,f.from+p))}}}return a}function cX(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function jP(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>zS?-1:i==r.length?cX(e,t.clientX):pc(r.text,e.state.tabSize,n-r.from);return{line:r.number,col:a,off:i}}function fX(e,t){let n=jP(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=jP(e,i);if(!s)return r;let c=uX(e.state,n,s);return c.length?l?te.create(c.concat(r.ranges)):te.create(c):r}}:null}function hX(e){let t=(n=>n.altKey&&n.button==0);return de.mouseSelectionStyle.of((n,r)=>t(r)?fX(n,r):null)}const dX={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},pX={style:"cursor: crosshair"};function mX(e={}){let[t,n]=dX[e.key||"Alt"],r=Nt.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?pX:null})]}const rm="-10000px";class P3{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 gX(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}const Dx=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)||gX}}}),LP=new WeakMap,FO=Nt.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(Dx);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 P3(e,qO,(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(Dx);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=rm,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=zO(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(Dx).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=rm;continue}let v=c.arrow?f.dom.querySelector(".cm-tooltip-arrow"):null,y=v?7:0,x=g.right-g.left,w=(t=LP.get(f))!==null&&t!==void 0?t:g.bottom-g.top,A=f.offset||yX,E=this.view.textDirection==ft.LTR,k=g.width>r.right-r.left?E?r.left:r.right-g.width:E?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),M=this.above[s];!c.strictSide&&(M?p.top-w-y-A.y<r.top:p.bottom+w+y+A.y>r.bottom)&&M==r.bottom-p.bottom>p.top-r.top&&(M=this.above[s]=!M);let D=(M?p.top-r.top:r.bottom-p.bottom)-y;if(D<w&&f.resize!==!1){if(D<this.view.defaultLineHeight){d.style.top=rm;continue}LP.set(f,w),d.style.height=(w=D)/a+"px"}else d.style.height&&(d.style.height="");let P=M?p.top-w-y-A.y:p.bottom+y+A.y,N=k+x;if(f.overlap!==!0)for(let L of l)L.left<N&&L.right>k&&L.top<P+w&&L.bottom>P&&(P=M?L.top-w-2-y:L.bottom+y+2);if(this.position=="absolute"?(d.style.top=(P-e.parent.top)/a+"px",IP(d,(k-e.parent.left)/i)):(d.style.top=P/a+"px",IP(d,k/i)),v){let L=p.left+(E?A.x:-A.x)-(k+14-7);v.style.left=L/i+"px"}f.overlap!==!0&&l.push({left:k,top:P,right:N,bottom:P+w}),d.classList.toggle("cm-tooltip-above",M),d.classList.toggle("cm-tooltip-below",!M),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=rm}},{eventObservers:{scroll(){this.maybeMeasure()}}});function IP(e,t){let n=parseInt(e.style.left,10);(isNaN(n)||Math.abs(t-n)>1)&&(e.style.left=t+"px")}const vX=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"}}}),yX={x:0,y:0},qO=me.define({enables:[FO,vX]}),mg=me.define({combine:e=>e.reduce((t,n)=>t.concat(n),[])});class Fv{static create(t){return new Fv(t)}constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new P3(t,mg,(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 bX=qO.compute([mg],e=>{let t=e.facet(mg);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:Fv.create,above:t[0].above,arrow:t.some(n=>n.arrow)}}),D3=me.define();class xX{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=>sr(t.state,c,"hover tooltip"))}else l(a)}get tooltip(){let t=this.view.plugin(FO),n=t?t.manager.tooltips.findIndex(r=>r.create==Fv.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&&!SX(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:!wX(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 im=4;function SX(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-im&&t.clientX<=r+im&&t.clientY>=i-im&&t.clientY<=a+im}function wX(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 OX(e,t={}){let n=_e.define(),r=new WeakMap,i=jn.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,Kn.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(kX)&&!f.value||f.value==i)&&(l=[]);return l.length&&c&&r.set(l,c),l},provide:l=>mg.from(l)});const a=Nt.define(l=>new xX(l,e,i,r,n,t.hoverTime||300));return{active:i,extension:[i,a,D3.of(a),bX]}}function AX(e,t,n,r={}){var i;let a=e.state.facet(D3).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 _3(e,t){let n=e.plugin(FO);if(!n)return null;let r=n.manager.tooltips.indexOf(t);return r<0?null:n.manager.tooltipViews[r]}const kX=_e.define(),BP=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 WO(e,t){let n=e.plugin(N3),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}const N3=Nt.fromClass(class{constructor(e){this.input=e.state.facet(Oh),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(e));let t=e.state.facet(BP);this.top=new am(e,!0,t.topContainer),this.bottom=new am(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(BP);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new am(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new am(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(Oh);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 am{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=zP(t);t=t.nextSibling}else this.dom.insertBefore(n.dom,t);for(;t;)t=zP(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 zP(e){let t=e.nextSibling;return e.remove(),t}const Oh=me.define({enables:N3});function CX(e,t){let n,r=new Promise(l=>n=l),i=l=>EX(l,t,n);e.state.field(_x,!1)?e.dispatch({effects:R3.of(i)}):e.dispatch({effects:_e.appendConfig.of(_x.init(()=>[i]))});let a=j3.of(i);return{close:a,result:r.then(l=>((e.win.queueMicrotask||(c=>e.win.setTimeout(c,10)))(()=>{e.state.field(_x).indexOf(i)>-1&&e.dispatch({effects:a})}),l))}}const _x=jn.define({create(){return[]},update(e,t){for(let n of t.effects)n.is(R3)?e=[n.value].concat(e):n.is(j3)&&(e=e.filter(r=>r!=n.value));return e},provide:e=>Oh.computeN([e],t=>t.field(e))}),R3=_e.define(),j3=_e.define();function EX(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 Va extends Ql{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}Va.prototype.elementClass="";Va.prototype.toDOM=void 0;Va.prototype.mapMode=Kn.TrackBefore;Va.prototype.startSide=Va.prototype.endSide=-1;Va.prototype.point=!0;const Hm=me.define(),TX=me.define(),MX={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>ze.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},rh=me.define();function PX(e){return[L3(),rh.of({...MX,...e})]}const $P=me.define({combine:e=>e.some(t=>t)});function L3(e){return[DX]}const DX=Nt.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(rh).map(t=>new HP(e,t)),this.fixed=!e.state.facet($P);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($P)!=!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(Hm),this.view.viewport.from),r=[],i=this.gutters.map(a=>new _X(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){$S(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){$S(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(rh),n=e.state.facet(rh),r=e.docChanged||e.heightChanged||e.viewportChanged||!ze.eq(e.startState.facet(Hm),e.state.facet(Hm),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 HP(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 UP(e){return Array.isArray(e)?e:[e]}function $S(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class _X{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 I3(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=[];$S(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(TX)){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 HP{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=UP(n.markers(t)),n.initialSpacer&&(this.spacer=new I3(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=UP(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 I3{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":""),NX(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 NX(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 RX=me.define(),jX=me.define(),Au=me.define({combine(e){return sa(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 Nx extends Va{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function Rx(e,t){return e.state.facet(Au).formatNumber(t,e.state)}const LX=rh.compute([Au],e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(t){return t.state.facet(RX)},lineMarker(t,n,r){return r.some(i=>i.toDOM)?null:new Nx(Rx(t,t.state.doc.lineAt(n.from).number))},widgetMarker:(t,n,r)=>{for(let i of t.state.facet(jX)){let a=i(t,n,r);if(a)return a}return null},lineMarkerChange:t=>t.startState.facet(Au)!=t.state.facet(Au),initialSpacer(t){return new Nx(Rx(t,FP(t.state.doc.lines)))},updateSpacer(t,n){let r=Rx(n.view,FP(n.view.state.doc.lines));return r==t.number?t:new Nx(r)},domEventHandlers:e.facet(Au).domEventHandlers,side:"before"}));function IX(e={}){return[Au.of(e),L3(),LX]}function FP(e){let t=9;for(;t<e;)t=t*10+9;return t}const BX=new class extends Va{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},zX=Hm.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(BX.range(i)))}return ze.of(t)});function $X(){return zX}const B3=1024;let UX=0;class jx{constructor(t,n){this.from=t,this.to=n}}class Le{constructor(t={}){this.id=UX++,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=dr.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 ih{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 HX=Object.create(null);class dr{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):HX,r=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new dr(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}}}}dr.none=new dr("",Object.create(null),0,8);class VO{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 dr(r.name,i,r.id,r.flags):r)}return new VO(n)}}const lm=new WeakMap,qP=new WeakMap;var Dt;(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"})(Dt||(Dt={}));class Bt{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=ih.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 HS(this.topNode,t)}cursorAt(t,n=0,r=0){let i=lm.get(this)||this.topNode,a=new HS(i);return a.moveTo(t,n),lm.set(this,a._tree),a}get topNode(){return new ti(this,0,0,null)}resolve(t,n=0){let r=Ah(lm.get(this)||this.topNode,t,n,!1);return lm.set(this,r),r}resolveInner(t,n=0){let r=Ah(qP.get(this)||this.topNode,t,n,!0);return qP.set(this,r),r}resolveStack(t,n=0){return WX(this,t,n)}iterate(t){let{enter:n,leave:r,from:i=0,to:a=this.length}=t,l=t.mode||0,s=(l&Dt.IncludeAnonymous)>0;for(let c=this.cursor(l|Dt.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:XO(dr.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new Bt(this.type,n,r,i,this.propValues),t.makeTree||((n,r,i)=>new Bt(dr.none,n,r,i)))}static build(t){return VX(t)}}Bt.empty=new Bt(dr.none,[],[],0);class KO{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 KO(this.buffer,this.index)}}class Zl{constructor(t,n,r){this.buffer=t,this.length=n,this.set=r}get type(){return dr.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&&!(z3(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 Zl(a,l,this.set)}}function z3(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 Ah(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 ti&&e.index<0?null:e.parent;if(!l)return e;e=l}let a=r?0:Dt.IgnoreOverlays;if(r)for(let l=e,s=l.parent;s;l=s,s=l.parent)l instanceof ti&&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 $3{cursor(t=0){return new HS(this,t)}getChild(t,n=null,r=null){let i=WP(this,t,n,r);return i.length?i[0]:null}getChildren(t,n=null,r=null){return WP(this,t,n,r)}resolve(t,n=0){return Ah(this,t,n,!1)}resolveInner(t,n=0){return Ah(this,t,n,!0)}matchContext(t){return US(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 ti extends $3{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&Dt.EnterBracketed&&d instanceof Bt&&(g=ih.get(d))&&!g.overlay&&g.bracketed&&r>=p&&r<=p+d.length)&&!z3(i,r,p,p+d.length))){if(d instanceof Zl){if(a&Dt.ExcludeBuffers)continue;let v=d.findChild(0,d.buffer.length,n,r-p,i);if(v>-1)return new Hl(new FX(l,d,t,p),null,v)}else if(a&Dt.IncludeAnonymous||!d.type.isAnonymous||QO(d)){let v;if(!(a&Dt.IgnoreMounts)&&(v=ih.get(d))&&!v.overlay)return new ti(v.tree,p,t,l);let y=new ti(d,p,t,l);return a&Dt.IncludeAnonymous||!y.type.isAnonymous?y:y.nextChild(n<0?d.children.length-1:0,n,r,i,a)}}}if(a&Dt.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&Dt.IgnoreOverlays)&&(i=ih.get(this._tree))&&i.overlay){let a=t-this.from,l=r&Dt.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 ti(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 WP(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 US(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 FX{constructor(t,n,r,i){this.parent=t,this.buffer=n,this.index=r,this.start=i}}class Hl extends $3{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 Hl(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&Dt.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 Hl(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 Hl(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 Hl(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 Bt(this.type,t,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function U3(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 ti&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new qX(i,n)}class qX{constructor(t,n){this.heads=t,this.node=n}get next(){return U3(this.heads)}}function WX(e,t,n){let r=e.resolveInner(t,n),i=null;for(let a=r instanceof ti?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=ih.get(a.tree);if(l&&l.overlay&&l.overlay[0].from<=t&&l.overlay[l.overlay.length-1].to>=t){let s=new ti(l.tree,l.overlay[0].from+a.from,-1,a);(i||(i=[r])).push(Ah(s,t,n,!1))}}return i?U3(i):r}class HS{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&~Dt.EnterBracketed,t instanceof ti)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 ti?(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&Dt.ExcludeBuffers?!1:this.enterChild(1,t,n):this.yield(this._tree.enter(t,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Dt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&Dt.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&Dt.IncludeAnonymous||s instanceof Zl||!s.type.isAnonymous||QO(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 Hl(this.buffer,n,this.stack[i]);return this.bufferNode=new Hl(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 US(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 US(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 QO(e){return e.children.some(t=>t instanceof Zl||!t.type.isAnonymous||QO(t))}function VX(e){var t;let{buffer:n,nodeSet:r,maxBufferLength:i=B3,reused:a=[],minRepeatType:l=r.types.length}=e,s=Array.isArray(n)?new KO(n,n.length):n,c=r.types,f=0,d=0;function p(D,P,N,L,U,K){let{id:V,start:B,end:oe,size:ie}=s,ue=d,z=f;if(ie<0)if(s.next(),ie==-1){let R=a[V];N.push(R),L.push(B-D);return}else if(ie==-3){f=V;return}else if(ie==-4){d=V;return}else throw new RangeError(`Unrecognized record size: ${ie}`);let Z=c[V],ae,Q,le=B-D;if(oe-B<=i&&(Q=w(s.pos-P,U))){let R=new Uint16Array(Q.size-Q.skip),F=s.pos-Q.size,ee=R.length;for(;s.pos>F;)ee=A(Q.start,R,ee);ae=new Zl(R,oe-Q.start,r),le=Q.start-D}else{let R=s.pos-ie;s.next();let F=[],ee=[],se=V>=l?V:-1,ge=0,Oe=oe;for(;s.pos>R;)se>=0&&s.id==se&&s.size>=0?(s.end<=Oe-i&&(y(F,ee,B,ge,s.end,Oe,se,ue,z),ge=F.length,Oe=s.end),s.next()):K>2500?g(B,R,F,ee):p(B,R,F,ee,se,K+1);if(se>=0&&ge>0&&ge<F.length&&y(F,ee,B,ge,B,Oe,se,ue,z),F.reverse(),ee.reverse(),se>-1&&ge>0){let Pe=v(Z,z);ae=XO(Z,F,ee,0,F.length,0,oe-B,Pe,Pe)}else ae=x(Z,F,ee,oe-B,ue-oe,z)}N.push(ae),L.push(le)}function g(D,P,N,L){let U=[],K=0,V=-1;for(;s.pos>P;){let{id:B,start:oe,end:ie,size:ue}=s;if(ue>4)s.next();else{if(V>-1&&oe<V)break;V<0&&(V=ie-i),U.push(B,oe,ie),K++,s.next()}}if(K){let B=new Uint16Array(K*4),oe=U[U.length-2];for(let ie=U.length-3,ue=0;ie>=0;ie-=3)B[ue++]=U[ie],B[ue++]=U[ie+1]-oe,B[ue++]=U[ie+2]-oe,B[ue++]=ue;N.push(new Zl(B,U[2]-oe,r)),L.push(oe-D)}}function v(D,P){return(N,L,U)=>{let K=0,V=N.length-1,B,oe;if(V>=0&&(B=N[V])instanceof Bt){if(!V&&B.type==D&&B.length==U)return B;(oe=B.prop(Le.lookAhead))&&(K=L[V]+B.length+oe)}return x(D,N,L,U,K,P)}}function y(D,P,N,L,U,K,V,B,oe){let ie=[],ue=[];for(;D.length>L;)ie.push(D.pop()),ue.push(P.pop()+N-U);D.push(x(r.types[V],ie,ue,K-U,B-K,oe)),P.push(U-N)}function x(D,P,N,L,U,K,V){if(K){let B=[Le.contextHash,K];V=V?[B].concat(V):[B]}if(U>25){let B=[Le.lookAhead,U];V=V?[B].concat(V):[B]}return new Bt(D,P,N,L,V)}function w(D,P){let N=s.fork(),L=0,U=0,K=0,V=N.end-i,B={size:0,start:0,skip:0};e:for(let oe=N.pos-D;N.pos>oe;){let ie=N.size;if(N.id==P&&ie>=0){B.size=L,B.start=U,B.skip=K,K+=4,L+=4,N.next();continue}let ue=N.pos-ie;if(ie<0||ue<oe||N.start<V)break;let z=N.id>=l?4:0,Z=N.start;for(N.next();N.pos>ue;){if(N.size<0)if(N.size==-3||N.size==-4)z+=4;else break e;else N.id>=l&&(z+=4);N.next()}U=Z,L+=ie,K+=z}return(P<0||L==D)&&(B.size=L,B.start=U,B.skip=K),B.size>4?B:void 0}function A(D,P,N){let{id:L,start:U,end:K,size:V}=s;if(s.next(),V>=0&&L<l){let B=N;if(V>4){let oe=s.pos-(V-4);for(;s.pos>oe;)N=A(D,P,N)}P[--N]=B,P[--N]=K-D,P[--N]=U-D,P[--N]=L}else V==-3?f=L:V==-4&&(d=L);return N}let E=[],k=[];for(;s.pos>0;)p(e.start||0,e.bufferStart||0,E,k,-1,0);let M=(t=e.length)!==null&&t!==void 0?t:E.length?k[0]+E[0].length:0;return new Bt(c[e.topID],E.reverse(),k.reverse(),M)}const VP=new WeakMap;function Fm(e,t){if(!e.isAnonymous||t instanceof Zl||t.type!=e)return 1;let n=VP.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof Bt)){n=1;break}n+=Fm(e,r)}VP.set(t,n)}return n}function XO(e,t,n,r,i,a,l,s,c){let f=0;for(let y=r;y<i;y++)f+=Fm(e,t[y]);let d=Math.ceil(f*1.5/8),p=[],g=[];function v(y,x,w,A,E){for(let k=w;k<A;){let M=k,D=x[k],P=Fm(e,y[k]);for(k++;k<A;k++){let N=Fm(e,y[k]);if(P+N>=d)break;P+=N}if(k==M+1){if(P>d){let N=y[M];v(N.children,N.positions,0,N.children.length,x[M]+E);continue}p.push(y[M])}else{let N=x[k-1]+y[k-1].length-D;p.push(XO(e,y,x,M,k,D,N,null,c))}g.push(D+E-a)}}return v(t,n,r,i,0),(s||c)(p,g,l)}class Zo{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 Zo(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 Zo(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 H3{startParse(t,n,r){return typeof t=="string"&&(t=new KX(t)),r=r?r.length?r.map(i=>new jx(i.from,i.to)):[new jx(0,0)]:[new jx(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 KX{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 QX=0,Pa=class FS{constructor(t,n,r,i){this.name=t,this.set=n,this.base=r,this.modified=i,this.id=QX++}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 FS&&(n=t),n?.base)throw new Error("Can not derive from a modified tag");let i=new FS(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 gg(t);return r=>r.modified.indexOf(n)>-1?r:gg.get(r.base||r,r.modified.concat(n).sort((i,a)=>i.id-a.id))}},XX=0;class gg{constructor(t){this.name=t,this.instances=[],this.id=XX++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(s=>s.base==t&&YX(n,s.modified));if(r)return r;let i=[],a=new Pa(t.name,i,t,n);for(let s of n)s.instances.push(a);let l=GX(n);for(let s of t.set)if(!s.modified.length)for(let c of l)i.push(gg.get(s,c));return a}}function YX(e,t){return e.length==t.length&&e.every((n,r)=>n==t[r])}function GX(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 F3(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 kh(r,l,c>0?a.slice(0,c):null);t[f]=d.sort(t[f])}}return q3.add(t)}const q3=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 kh(i.tags,i.mode,i.context);n?n.next=a:r=a,n=a}return r}});class kh{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}}kh.empty=new kh([],2,null);function W3(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 ZX(e,t){let n=null;for(let r of e){let i=r.style(t);i&&(n=n?n+" "+i:i)}return n}function JX(e,t,n,r=0,i=e.length){let a=new eY(r,Array.isArray(t)?t:[t],n);a.highlightRange(e.cursor(),r,i,"",a.highlighters),a.flush(i)}class eY{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=tY(t)||kh.empty,p=ZX(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 E=w<g.overlay.length?g.overlay[w]:null,k=E?E.from+s:c,M=Math.max(n,A),D=Math.min(r,k);if(M<D&&x)for(;t.from<D&&(this.highlightRange(t,M,D,i,a),this.startSpan(Math.min(D,t.to),f),!(t.to>=k||!t.nextSibling())););if(!E||k>r)break;A=E.to+s,A>n&&(this.highlightRange(v.cursor(),Math.max(n,E.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 tY(e){let t=e.type.prop(q3);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}const he=Pa.define,om=he(),Nl=he(),KP=he(Nl),QP=he(Nl),Rl=he(),sm=he(Rl),Lx=he(Rl),zi=he(),Eo=he(zi),Ri=he(),ji=he(),qS=he(),Ef=he(qS),um=he(),G={comment:om,lineComment:he(om),blockComment:he(om),docComment:he(om),name:Nl,variableName:he(Nl),typeName:KP,tagName:he(KP),propertyName:QP,attributeName:he(QP),className:he(Nl),labelName:he(Nl),namespace:he(Nl),macroName:he(Nl),literal:Rl,string:sm,docString:he(sm),character:he(sm),attributeValue:he(sm),number:Lx,integer:he(Lx),float:he(Lx),bool:he(Rl),regexp:he(Rl),escape:he(Rl),color:he(Rl),url:he(Rl),keyword:Ri,self:he(Ri),null:he(Ri),atom:he(Ri),unit:he(Ri),modifier:he(Ri),operatorKeyword:he(Ri),controlKeyword:he(Ri),definitionKeyword:he(Ri),moduleKeyword:he(Ri),operator:ji,derefOperator:he(ji),arithmeticOperator:he(ji),logicOperator:he(ji),bitwiseOperator:he(ji),compareOperator:he(ji),updateOperator:he(ji),definitionOperator:he(ji),typeOperator:he(ji),controlOperator:he(ji),punctuation:qS,separator:he(qS),bracket:Ef,angleBracket:he(Ef),squareBracket:he(Ef),paren:he(Ef),brace:he(Ef),content:zi,heading:Eo,heading1:he(Eo),heading2:he(Eo),heading3:he(Eo),heading4:he(Eo),heading5:he(Eo),heading6:he(Eo),contentSeparator:he(zi),list:he(zi),quote:he(zi),emphasis:he(zi),strong:he(zi),link:he(zi),monospace:he(zi),strikethrough:he(zi),inserted:he(),deleted:he(),changed:he(),invalid:he(),meta:um,documentMeta:he(um),annotation:he(um),processingInstruction:he(um),definition:Pa.defineModifier("definition"),constant:Pa.defineModifier("constant"),function:Pa.defineModifier("function"),standard:Pa.defineModifier("standard"),local:Pa.defineModifier("local"),special:Pa.defineModifier("special")};for(let e in G){let t=G[e];t instanceof Pa&&(t.name=e)}W3([{tag:G.link,class:"tok-link"},{tag:G.heading,class:"tok-heading"},{tag:G.emphasis,class:"tok-emphasis"},{tag:G.strong,class:"tok-strong"},{tag:G.keyword,class:"tok-keyword"},{tag:G.atom,class:"tok-atom"},{tag:G.bool,class:"tok-bool"},{tag:G.url,class:"tok-url"},{tag:G.labelName,class:"tok-labelName"},{tag:G.inserted,class:"tok-inserted"},{tag:G.deleted,class:"tok-deleted"},{tag:G.literal,class:"tok-literal"},{tag:G.string,class:"tok-string"},{tag:G.number,class:"tok-number"},{tag:[G.regexp,G.escape,G.special(G.string)],class:"tok-string2"},{tag:G.variableName,class:"tok-variableName"},{tag:G.local(G.variableName),class:"tok-variableName tok-local"},{tag:G.definition(G.variableName),class:"tok-variableName tok-definition"},{tag:G.special(G.variableName),class:"tok-variableName2"},{tag:G.definition(G.propertyName),class:"tok-propertyName tok-definition"},{tag:G.typeName,class:"tok-typeName"},{tag:G.namespace,class:"tok-namespace"},{tag:G.className,class:"tok-className"},{tag:G.macroName,class:"tok-macroName"},{tag:G.propertyName,class:"tok-propertyName"},{tag:G.operator,class:"tok-operator"},{tag:G.comment,class:"tok-comment"},{tag:G.meta,class:"tok-meta"},{tag:G.invalid,class:"tok-invalid"},{tag:G.punctuation,class:"tok-punctuation"}]);var Ix;const ku=new Le;function nY(e){return me.define({combine:e?t=>t.concat(e):void 0})}const rY=new Le;class gi{constructor(t,n,r=[],i=""){this.data=t,this.name=i,Fe.prototype.hasOwnProperty("tree")||Object.defineProperty(Fe.prototype,"tree",{get(){return _n(this)}}),this.parser=n,this.extension=[Jl.of(this),Fe.languageData.of((a,l,s)=>{let c=XP(a,l,s),f=c.type.prop(ku);if(!f)return[];let d=a.facet(f),p=c.type.prop(rY);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 XP(t,n,r).type.prop(ku)==this.data}findRegions(t){let n=t.facet(Jl);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(ku)==this.data){r.push({from:l,to:l+a.length});return}let s=a.prop(Le.mounted);if(s){if(s.tree.prop(ku)==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 Bt&&i(f,a.positions[c]+l)}};return i(_n(t),0),r}get allowsNesting(){return!0}}gi.setState=_e.define();function XP(e,t,n){let r=e.facet(Jl),i=_n(e).topNode;if(!r||r.allowsNesting)for(let a=i;a;a=a.enter(t,n,Dt.ExcludeBuffers|Dt.EnterBracketed))a.type.isTop&&(i=a);return i}class vg extends gi{constructor(t,n,r){super(t,n,[],r),this.parser=n}static define(t){let n=nY(t.languageData);return new vg(n,t.parser.configure({props:[ku.add(r=>r.isTop?n:void 0)]}),t.name)}configure(t,n){return new vg(this.data,this.parser.configure(t),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function _n(e){let t=e.field(gi.state,!1);return t?t.tree:Bt.empty}class iY{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 Tf=null;class yg{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 yg(t,n,[],Bt.empty,0,r,[],null)}startParse(){return this.parser.startParse(new iY(this.state.doc),this.fragments)}work(t,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Bt.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(Zo.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(Zo.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let n=Tf;Tf=this;try{return t()}finally{Tf=n}}withoutTempSkipped(t){for(let n;n=this.tempSkipped.pop();)t=YP(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=Zo.applyChanges(r,c),i=Bt.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 yg(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=YP(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 H3{createParse(n,r,i){let a=i[0].from,l=i[i.length-1].to;return{parsedPos:a,advance(){let c=Tf;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 Bt(dr.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 Tf}}function YP(e,t,n){return Zo.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class Zu{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 Zu(n)}static init(t){let n=Math.min(3e3,t.doc.length),r=yg.create(t.facet(Jl).parser,t,{from:0,to:n});return r.work(20,n)||r.takeTree(),new Zu(r)}}gi.state=jn.define({create:Zu.init,update(e,t){for(let n of t.effects)if(n.is(gi.setState))return n.value;return t.startState.facet(Jl)!=t.state.facet(Jl)?Zu.init(t.state):e.apply(t)}});let V3=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(V3=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const Bx=typeof navigator<"u"&&(!((Ix=navigator.scheduling)===null||Ix===void 0)&&Ix.isInputPending)?()=>navigator.scheduling.isInputPending():null,aY=Nt.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(gi.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(gi.state);(n.tree!=n.context.tree||!n.context.isDone(t.doc.length))&&(this.working=V3(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(gi.state);if(a.tree==a.context.tree&&a.context.isDone(i+1e5))return;let l=Date.now()+Math.min(this.chunkBudget,100,t&&!Bx?Math.max(25,t.timeRemaining()-5):1e9),s=a.context.treeLen<i&&r.doc.length>i+1e3,c=a.context.work(()=>Bx&&Bx()||Date.now()>l,i+(s?0:1e5));this.chunkBudget-=Date.now()-n,(c||this.chunkBudget<=0)&&(a.context.takeTree(),this.view.dispatch({effects:gi.setState.of(new Zu(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=>sr(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()}}}),Jl=me.define({combine(e){return e.length?e[0]:null},enables:e=>[gi.state,aY,de.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class lY{constructor(t,n=[]){this.language=t,this.support=n,this.extension=[t,n]}}const oY=me.define(),qv=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 bg(e){let t=e.facet(qv);return t.charCodeAt(0)==9?e.tabSize*t.length:t.length}function Ch(e,t){let n="",r=e.tabSize,i=e.facet(qv)[0];if(i==" "){for(;t>=r;)n+=" ",t-=r;i=" "}for(let a=0;a<t;a++)n+=i;return n}function YO(e,t){e instanceof Fe&&(e=new Wv(e));for(let r of e.state.facet(oY)){let i=r(e,t);if(i!==void 0)return i}let n=_n(e.state);return n.length>=t?sY(e,n,t):null}class Wv{constructor(t,n={}){this.state=t,this.options=n,this.unit=bg(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 pc(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 K3=new Le;function sY(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 Q3(r,e,n)}function Q3(e,t,n){for(let r=e;r;r=r.next){let i=cY(r.node);if(i)return i(GO.create(t,n,r))}return 0}function uY(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}function cY(e){let t=e.type.prop(K3);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=>X3(l,!0,1,void 0,a&&!uY(l)?i.from:void 0)}return e.parent==null?fY:null}function fY(){return 0}class GO extends Wv{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 GO(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(hY(r,t))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return Q3(this.context.next,this.base,this.pos)}}function hY(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function dY(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 GP({closing:e,align:t=!0,units:n=1}){return r=>X3(r,t,n,e)}function X3(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?dY(e):null;return c?s?e.column(c.from):e.column(c.to):e.baseIndent+(s?0:e.unit*n)}const pY=200;function mY(){return Fe.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+pY)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=YO(l,d.from);if(p==null)continue;let g=/^\s*/.exec(d.text)[0],v=Ch(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 gY=me.define(),Y3=new Le;function vY(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 yY(e,t,n){let r=_n(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(Y3);if(c&&(s.to<r.length-50||r.length==e.doc.length||!bY(s))){let f=c(s,e);f&&f.from<=n&&f.from>=t&&f.to>n&&(a=f)}}return a}function bY(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function xg(e,t,n){for(let r of e.facet(gY)){let i=r(e,t,n);if(i)return i}return yY(e,t,n)}function G3(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 Vv=_e.define({map:G3}),Zh=_e.define({map:G3});function Z3(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 cs=jn.define({create(){return Ce.none},update(e,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((r,i)=>e=ZP(e,r,i)),e=e.map(t.changes);let n=[];for(let r of t.effects)r.is(Vv)&&!xY(e,r.value.from,r.value.to)?n.push(r.value):r.is(Zh)&&(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(tB),i=n.map(a=>(r?Ce.replace({widget:new EY(r(t.state,a))}):JP).range(a.from,a.to));e=e.update({add:i})}return t.selection&&(e=ZP(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(JP.range(r,i))}return Ce.set(t,!0)}});function ZP(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 Sg(e,t,n){var r;let i=null;return(r=e.field(cs,!1))===null||r===void 0||r.between(t,n,(a,l)=>{(!i||i.from>a)&&(i={from:a,to:l})}),i}function xY(e,t,n){let r=!1;return e.between(t,t,(i,a)=>{i==t&&a==n&&(r=!0)}),r}function J3(e,t){return e.field(cs,!1)?t:t.concat(_e.appendConfig.of(nB()))}const SY=e=>{for(let t of Z3(e)){let n=xg(e.state,t.from,t.to);if(n)return e.dispatch({effects:J3(e.state,[Vv.of(n),eB(e,n)])}),!0}return!1},wY=e=>{if(!e.state.field(cs,!1))return!1;let t=[];for(let n of Z3(e)){let r=Sg(e.state,n.from,n.to);r&&t.push(Zh.of(r),eB(e,r,!1))}return t.length&&e.dispatch({effects:t}),t.length>0};function eB(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 OY=e=>{let{state:t}=e,n=[];for(let r=0;r<t.doc.length;){let i=e.lineBlockAt(r),a=xg(t,i.from,i.to);a&&n.push(Vv.of(a)),r=(a?e.lineBlockAt(a.to):i).to+1}return n.length&&e.dispatch({effects:J3(e.state,n)}),!!n.length},AY=e=>{let t=e.state.field(cs,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(r,i)=>{n.push(Zh.of({from:r,to:i}))}),e.dispatch({effects:n}),!0},kY=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:SY},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:wY},{key:"Ctrl-Alt-[",run:OY},{key:"Ctrl-Alt-]",run:AY}],CY={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},tB=me.define({combine(e){return sa(e,CY)}});function nB(e){return[cs,PY]}function rB(e,t){let{state:n}=e,r=n.facet(tB),i=l=>{let s=e.lineBlockAt(e.posAtDOM(l.target)),c=Sg(e.state,s.from,s.to);c&&e.dispatch({effects:Zh.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 JP=Ce.replace({widget:new class extends ua{toDOM(e){return rB(e,null)}}});class EY extends ua{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return rB(t,this.value)}}const TY={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class zx extends Va{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 MY(e={}){let t={...TY,...e},n=new zx(t,!0),r=new zx(t,!1),i=Nt.fromClass(class{constructor(l){this.from=l.viewport.from,this.markers=this.buildMarkers(l)}update(l){(l.docChanged||l.viewportChanged||l.startState.facet(Jl)!=l.state.facet(Jl)||l.startState.field(cs,!1)!=l.state.field(cs,!1)||_n(l.startState)!=_n(l.state)||t.foldingChanged(l))&&(this.markers=this.buildMarkers(l.view))}buildMarkers(l){let s=new qa;for(let c of l.viewportLineBlocks){let f=Sg(l.state,c.from,c.to)?r:xg(l.state,c.from,c.to)?n:null;f&&s.add(c.from,c.from,f)}return s.finish()}}),{domEventHandlers:a}=t;return[i,PX({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 zx(t,!1)},domEventHandlers:{...a,click:(l,s,c)=>{if(a.click&&a.click(l,s,c))return!0;let f=Sg(l.state,s.from,s.to);if(f)return l.dispatch({effects:Zh.of(f)}),!0;let d=xg(l.state,s.from,s.to);return d?(l.dispatch({effects:Vv.of(d)}),!0):!1}}}),nB()]}const PY=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 Jh{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 gi?s=>s.prop(ku)==l.data:l?s=>s==l:void 0,this.style=W3(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 Jh(t,n||{})}}const WS=me.define(),iB=me.define({combine(e){return e.length?[e[0]]:null}});function $x(e){let t=e.facet(WS);return t.length?t:e.facet(iB)}function aB(e,t){let n=[_Y],r;return e instanceof Jh&&(e.module&&n.push(de.styleModule.of(e.module)),r=e.themeType),t?.fallback?n.push(iB.of(e)):r?n.push(WS.computeN([de.darkTheme],i=>i.facet(de.darkTheme)==(r=="dark")?[e]:[])):n.push(WS.of(e)),n}class DY{constructor(t){this.markCache=Object.create(null),this.tree=_n(t.state),this.decorations=this.buildDeco(t,$x(t.state)),this.decoratedTo=t.viewport.to}update(t){let n=_n(t.state),r=$x(t.state),i=r!=$x(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 qa;for(let{from:i,to:a}of t.visibleRanges)JX(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 _Y=ys.high(Nt.fromClass(DY,{decorations:e=>e.decorations})),NY=Jh.define([{tag:G.meta,color:"#404740"},{tag:G.link,textDecoration:"underline"},{tag:G.heading,textDecoration:"underline",fontWeight:"bold"},{tag:G.emphasis,fontStyle:"italic"},{tag:G.strong,fontWeight:"bold"},{tag:G.strikethrough,textDecoration:"line-through"},{tag:G.keyword,color:"#708"},{tag:[G.atom,G.bool,G.url,G.contentSeparator,G.labelName],color:"#219"},{tag:[G.literal,G.inserted],color:"#164"},{tag:[G.string,G.deleted],color:"#a11"},{tag:[G.regexp,G.escape,G.special(G.string)],color:"#e40"},{tag:G.definition(G.variableName),color:"#00f"},{tag:G.local(G.variableName),color:"#30a"},{tag:[G.typeName,G.namespace],color:"#085"},{tag:G.className,color:"#167"},{tag:[G.special(G.variableName),G.macroName],color:"#256"},{tag:G.definition(G.propertyName),color:"#00c"},{tag:G.comment,color:"#940"},{tag:G.invalid,color:"#f00"}]),RY=de.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),lB=1e4,oB="()[]{}",sB=me.define({combine(e){return sa(e,{afterCursor:!0,brackets:oB,maxScanDistance:lB,renderMatch:IY})}}),jY=Ce.mark({class:"cm-matchingBracket"}),LY=Ce.mark({class:"cm-nonmatchingBracket"});function IY(e){let t=[],n=e.matched?jY:LY;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 eD(e){let t=[],n=e.facet(sB);for(let r of e.selection.ranges){if(!r.empty)continue;let i=Qi(e,r.head,-1,n)||r.head>0&&Qi(e,r.head-1,1,n)||n.afterCursor&&(Qi(e,r.head,1,n)||r.head<e.doc.length&&Qi(e,r.head+1,-1,n));i&&(t=t.concat(n.renderMatch(i,e)))}return Ce.set(t,!0)}const BY=Nt.fromClass(class{constructor(e){this.paused=!1,this.decorations=eD(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=eD(e.state),this.paused=!1))}},{decorations:e=>e.decorations}),zY=[BY,RY];function $Y(e={}){return[sB.of(e),zY]}const UY=new Le;function VS(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 KS(e){let t=e.type.prop(UY);return t?t(e.node):e}function Qi(e,t,n,r={}){let i=r.maxScanDistance||lB,a=r.brackets||oB,l=_n(e),s=l.resolveInner(t,n);for(let c=s;c;c=c.parent){let f=VS(c.type,n,a);if(f&&c.from<c.to){let d=KS(c);if(d&&(n>0?t>=d.from&&t<d.to:t>d.from&&t<=d.to))return HY(e,t,n,c,d,f,a)}}return FY(e,t,n,l,s.type,i,a)}function HY(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=KS(d);return{start:c,end:p?{from:p.from,to:p.to}:void 0,matched:!0}}else if(VS(d.type,n,l))f++;else if(VS(d.type,-n,l)){if(f==0){let p=KS(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 FY(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 qY=Object.create(null),tD=[dr.none],nD=[],rD=Object.create(null),WY=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"]])WY[e]=VY(qY,t);function Ux(e,t){nD.indexOf(e)>-1||(nD.push(e),console.warn(t))}function VY(e,t){let n=[];for(let s of t.split(" ")){let c=[];for(let f of s.split(".")){let d=e[f]||G[f];d?typeof d=="function"?c.length?c=c.map(d):Ux(f,`Modifier ${f} used at start of tag`):c.length?Ux(f,`Tag ${f} used as modifier`):c=Array.isArray(d)?d:[d]:Ux(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=rD[i];if(a)return a.id;let l=rD[i]=dr.define({id:tD.length,name:r,props:[F3({[r]:n})]});return tD.push(l),l.id}ft.RTL,ft.LTR;const KY=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=JO(e.state,n.from);return r.line?QY(e):r.block?YY(e):!1};function ZO(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 QY=ZO(JY,0),XY=ZO(uB,0),YY=ZO((e,t)=>uB(e,t,ZY(t)),0);function JO(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const Mf=50;function GY(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-Mf,r),l=e.sliceDoc(i,i+Mf),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*Mf?d=p=e.sliceDoc(r,i):(d=e.sliceDoc(r,r+Mf),p=e.sliceDoc(i-Mf,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 ZY(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 uB(e,t,n=t.selection.ranges){let r=n.map(a=>JO(t,a.from).block);if(!r.every(a=>a))return null;let i=n.map((a,l)=>GY(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 JY(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=JO(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 QS=oa.define(),eG=oa.define(),tG=me.define(),cB=me.define({combine(e){return sa(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)})}}),fB=jn.define({create(){return Xi.empty},update(e,t){let n=t.state.facet(cB),r=t.annotation(QS);if(r){let c=ur.fromTransaction(t,r.selection),f=r.side,d=f==0?e.undone:e.done;return c?d=wg(d,d.length,n.minDepth,c):d=pB(d,t.startState.selection),new Xi(f==0?r.rest:d,f==0?d:r.rest)}let i=t.annotation(eG);if((i=="full"||i=="before")&&(e=e.isolate()),t.annotation(Zt.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=ur.fromTransaction(t),l=t.annotation(Zt.time),s=t.annotation(Zt.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 Xi(e.done.map(ur.fromJSON),e.undone.map(ur.fromJSON))}});function nG(e={}){return[fB,cB.of(e),de.domEventHandlers({beforeinput(t,n){let r=t.inputType=="historyUndo"?hB:t.inputType=="historyRedo"?XS:null;return r?(t.preventDefault(),r(n)):!1}})]}function Kv(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(fB,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}const hB=Kv(0,!1),XS=Kv(1,!1),rG=Kv(0,!0),iG=Kv(1,!0);class ur{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 ur(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 ur(t.changes&&Yt.fromJSON(t.changes),[],t.mapped&&Zi.fromJSON(t.mapped),t.startSelection&&te.fromJSON(t.startSelection),t.selectionsAfter.map(te.fromJSON))}static fromTransaction(t,n){let r=Gr;for(let i of t.startState.facet(tG)){let a=i(t);a.length&&(r=r.concat(a))}return!r.length&&t.changes.empty?null:new ur(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,Gr)}static selection(t){return new ur(void 0,Gr,void 0,void 0,t)}}function wg(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 aG(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 lG(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,r)=>n.empty!=t.ranges[r].empty).length===0}function dB(e,t){return e.length?t.length?e.concat(t):e:t}const Gr=[],oG=200;function pB(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-oG));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),wg(e,e.length-1,1e9,n.setSelAfter(r)))}else return[ur.selection([t])]}function sG(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 Hx(e,t){if(!e.length)return e;let n=e.length,r=Gr;for(;n;){let i=uG(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?[ur.selection(r)]:Gr}function uG(e,t,n){let r=dB(e.selectionsAfter.length?e.selectionsAfter.map(s=>s.map(t)):Gr,n);if(!e.changes)return ur.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),l=e.mapped?e.mapped.composeDesc(a):a;return new ur(i,_e.mapEffects(e.effects,t),l,e.startSelection.map(a),r)}const cG=/^(input\.type|delete)($|\.)/;class Xi{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 Xi(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||cG.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,aG(s.changes,t.changes))||r=="input.type.compose")?l=wg(l,l.length-1,i.minDepth,new ur(t.changes.compose(s.changes),dB(_e.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,Gr)):l=wg(l,l.length,i.minDepth,t),new Xi(l,Gr,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:Gr;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&lG(a[a.length-1],t)?this:new Xi(pB(this.done,t),this.undone,n,r)}addMapping(t){return new Xi(Hx(this.done,t),Hx(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:QS.of({side:t,rest:sG(i),selection:l}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(a.changes){let s=i.length==1?Gr:i.slice(0,i.length-1);return a.mapped&&(s=Hx(s,a.mapped)),n.update({changes:a.changes,selection:a.startSelection,effects:a.effects,annotations:QS.of({side:t,rest:s,selection:l}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}Xi.empty=new Xi(Gr,Gr);const fG=[{key:"Mod-z",run:hB,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:XS,preventDefault:!0},{linux:"Ctrl-Shift-z",run:XS,preventDefault:!0},{key:"Mod-u",run:rG,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:iG,preventDefault:!0}];function mc(e,t){return te.create(e.ranges.map(t),e.mainIndex)}function ki(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function Ci({state:e,dispatch:t},n){let r=mc(e.selection,n);return r.eq(e.selection,!0)?!1:(t(ki(e,r)),!0)}function Qv(e,t){return te.cursor(t?e.to:e.from)}function mB(e,t){return Ci(e,n=>n.empty?e.moveByChar(n,t):Qv(n,t))}function Ln(e){return e.textDirectionAt(e.state.selection.main.head)==ft.LTR}const gB=e=>mB(e,!Ln(e)),vB=e=>mB(e,Ln(e));function yB(e,t){return Ci(e,n=>n.empty?e.moveByGroup(n,t):Qv(n,t))}const hG=e=>yB(e,!Ln(e)),dG=e=>yB(e,Ln(e));function pG(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 Xv(e,t,n){let r=_n(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;pG(e,f,i)?r=f:c=n?f.to:f.from}let a=r.type.prop(i),l,s;return a&&(l=n?Qi(e,r.from,1):Qi(e,r.to,-1))&&l.matched?s=n?l.end.to:l.end.from:s=n?r.to:r.from,te.cursor(s,n?-1:1)}const mG=e=>Ci(e,t=>Xv(e.state,t,!Ln(e))),gG=e=>Ci(e,t=>Xv(e.state,t,Ln(e)));function bB(e,t){return Ci(e,n=>{if(!n.empty)return Qv(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}const xB=e=>bB(e,!1),SB=e=>bB(e,!0);function wB(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 OB(e,t){let n=wB(e),{state:r}=e,i=mc(r.selection,l=>l.empty?e.moveVertically(l,t,n.height):Qv(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(ki(r,i),{effects:a}),!0}const iD=e=>OB(e,!1),YS=e=>OB(e,!0);function ao(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=te.cursor(r.from+a))}return i}const vG=e=>Ci(e,t=>ao(e,t,!0)),yG=e=>Ci(e,t=>ao(e,t,!1)),bG=e=>Ci(e,t=>ao(e,t,!Ln(e))),xG=e=>Ci(e,t=>ao(e,t,Ln(e))),SG=e=>Ci(e,t=>te.cursor(e.lineBlockAt(t.head).from,1)),wG=e=>Ci(e,t=>te.cursor(e.lineBlockAt(t.head).to,-1));function OG(e,t,n){let r=!1,i=mc(e.selection,a=>{let l=Qi(e,a.head,-1)||Qi(e,a.head,1)||a.head>0&&Qi(e,a.head-1,1)||a.head<e.doc.length&&Qi(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 te.cursor(s)});return r?(t(ki(e,i)),!0):!1}const AG=({state:e,dispatch:t})=>OG(e,t);function ii(e,t,n){let r=mc(e.state.selection,i=>{i.undirectional&&i.head>=i.anchor!=t&&(i=te.range(i.head,i.anchor));let a=n(i);return te.range(i.anchor,a.head,a.goalColumn,a.bidiLevel||void 0,a.assoc)});return r.eq(e.state.selection)?!1:(e.dispatch(ki(e.state,r)),!0)}function AB(e,t){return ii(e,t,n=>e.moveByChar(n,t))}const kB=e=>AB(e,!Ln(e)),CB=e=>AB(e,Ln(e));function EB(e,t){return ii(e,t,n=>e.moveByGroup(n,t))}const kG=e=>EB(e,!Ln(e)),CG=e=>EB(e,Ln(e)),EG=e=>{let t=!Ln(e);return ii(e,t,n=>Xv(e.state,n,t))},TG=e=>{let t=Ln(e);return ii(e,t,n=>Xv(e.state,n,t))};function TB(e,t){return ii(e,t,n=>e.moveVertically(n,t))}const MB=e=>TB(e,!1),PB=e=>TB(e,!0);function DB(e,t){return ii(e,t,n=>e.moveVertically(n,t,wB(e).height))}const aD=e=>DB(e,!1),lD=e=>DB(e,!0),MG=e=>ii(e,!0,t=>ao(e,t,!0)),PG=e=>ii(e,!1,t=>ao(e,t,!1)),DG=e=>{let t=!Ln(e);return ii(e,t,n=>ao(e,n,t))},_G=e=>{let t=Ln(e);return ii(e,t,n=>ao(e,n,t))},NG=e=>ii(e,!1,t=>te.cursor(e.lineBlockAt(t.head).from)),RG=e=>ii(e,!0,t=>te.cursor(e.lineBlockAt(t.head).to)),oD=({state:e,dispatch:t})=>(t(ki(e,{anchor:0})),!0),sD=({state:e,dispatch:t})=>(t(ki(e,{anchor:e.doc.length})),!0),uD=({state:e,dispatch:t})=>(t(ki(e,{anchor:e.selection.main.anchor,head:0})),!0),cD=({state:e,dispatch:t})=>(t(ki(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),jG=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),LG=({state:e,dispatch:t})=>{let n=Yv(e).map(({from:r,to:i})=>te.range(r,Math.min(i+1,e.doc.length)));return t(e.update({selection:te.create(n),userEvent:"select"})),!0},IG=({state:e,dispatch:t})=>{let n=mc(e.selection,r=>{let i=_n(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 te.range(s.to,s.from)}return r});return n.eq(e.selection)?!1:(t(ki(e,n)),!0)};function _B(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(ki(n,te.create(i,i.length-1))),!0)}const BG=e=>_B(e,!1),zG=e=>_B(e,!0),$G=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=te.create([n.main]):n.main.empty||(r=te.create([te.cursor(n.main.head)])),r?(t(ki(e,r)),!0):!1};function ed(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=cm(e,c,!1)):c>l&&(n="delete.forward",c=cm(e,c,!0)),l=Math.min(l,c),s=Math.max(s,c)}else l=cm(e,l,!1),s=cm(e,s,!0);return l==s?{range:a}:{changes:{from:l,to:s},range:te.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 cm(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 NB=(e,t,n)=>ed(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=pc(s,a.tabSize),d=f%bg(a)||bg(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}),GS=e=>NB(e,!1,!0),RB=e=>NB(e,!0,!1),jB=(e,t)=>ed(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}),LB=e=>jB(e,!1),UG=e=>jB(e,!0),HG=e=>ed(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),FG=e=>ed(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),qG=e=>ed(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),WG=({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:te.cursor(r.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},VG=({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:te.cursor(s)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Yv(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 IB(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let a of Yv(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(te.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(te.range(c.anchor-s,c.head-s))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:te.create(i,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const KG=({state:e,dispatch:t})=>IB(e,t,!1),QG=({state:e,dispatch:t})=>IB(e,t,!0);function BB(e,t,n){if(e.readOnly)return!1;let r=[];for(let a of Yv(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 XG=({state:e,dispatch:t})=>BB(e,t,!1),YG=({state:e,dispatch:t})=>BB(e,t,!0),GG=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(Yv(t).map(({from:i,to:a})=>(i>0?i--:a<t.doc.length&&a++,{from:i,to:a}))),r=mc(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 ZG(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=_n(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 fD=zB(!1),JG=zB(!0);function zB(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&&ZG(t,a);e&&(a=l=(l<=s.to?s:t.doc.lineAt(l)).to);let f=new Wv(t,{simulateBreak:a,simulateDoubleBreak:!!c}),d=YO(f,a);for(d==null&&(d=pc(/^\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=["",Ch(t,d)];return c&&p.push(Ch(t,f.lineIndent(s.from,-1))),{changes:{from:a,to:l,insert:Je.of(p)},range:te.cursor(a+1+p[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function eA(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:te.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}const eZ=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new Wv(e,{overrideIndentation:a=>{let l=n[a];return l??-1}}),i=eA(e,(a,l,s)=>{let c=YO(r,a.from);if(c==null)return;/\S/.test(a.text)||(c=0);let f=/^\s*/.exec(a.text)[0],d=Ch(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},$B=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(eA(e,(n,r)=>{r.push({from:n.from,insert:e.facet(qv)})}),{userEvent:"input.indent"})),!0),UB=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(eA(e,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let a=pc(i,e.tabSize),l=0,s=Ch(e,Math.max(0,a-bg(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),tZ=e=>(e.setTabFocusMode(),!0),nZ=[{key:"Ctrl-b",run:gB,shift:kB,preventDefault:!0},{key:"Ctrl-f",run:vB,shift:CB},{key:"Ctrl-p",run:xB,shift:MB},{key:"Ctrl-n",run:SB,shift:PB},{key:"Ctrl-a",run:SG,shift:NG},{key:"Ctrl-e",run:wG,shift:RG},{key:"Ctrl-d",run:RB},{key:"Ctrl-h",run:GS},{key:"Ctrl-k",run:HG},{key:"Ctrl-Alt-h",run:LB},{key:"Ctrl-o",run:WG},{key:"Ctrl-t",run:VG},{key:"Ctrl-v",run:YS}],rZ=[{key:"ArrowLeft",run:gB,shift:kB,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:hG,shift:kG,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:bG,shift:DG,preventDefault:!0},{key:"ArrowRight",run:vB,shift:CB,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:dG,shift:CG,preventDefault:!0},{mac:"Cmd-ArrowRight",run:xG,shift:_G,preventDefault:!0},{key:"ArrowUp",run:xB,shift:MB,preventDefault:!0},{mac:"Cmd-ArrowUp",run:oD,shift:uD},{mac:"Ctrl-ArrowUp",run:iD,shift:aD},{key:"ArrowDown",run:SB,shift:PB,preventDefault:!0},{mac:"Cmd-ArrowDown",run:sD,shift:cD},{mac:"Ctrl-ArrowDown",run:YS,shift:lD},{key:"PageUp",run:iD,shift:aD},{key:"PageDown",run:YS,shift:lD},{key:"Home",run:yG,shift:PG,preventDefault:!0},{key:"Mod-Home",run:oD,shift:uD},{key:"End",run:vG,shift:MG,preventDefault:!0},{key:"Mod-End",run:sD,shift:cD},{key:"Enter",run:fD,shift:fD},{key:"Mod-a",run:jG},{key:"Backspace",run:GS,shift:GS,preventDefault:!0},{key:"Delete",run:RB,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:LB,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:UG,preventDefault:!0},{mac:"Mod-Backspace",run:FG,preventDefault:!0},{mac:"Mod-Delete",run:qG,preventDefault:!0}].concat(nZ.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),iZ=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:mG,shift:EG},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:gG,shift:TG},{key:"Alt-ArrowUp",run:KG},{key:"Shift-Alt-ArrowUp",run:XG},{key:"Alt-ArrowDown",run:QG},{key:"Shift-Alt-ArrowDown",run:YG},{key:"Mod-Alt-ArrowUp",run:BG},{key:"Mod-Alt-ArrowDown",run:zG},{key:"Escape",run:$G},{key:"Mod-Enter",run:JG},{key:"Alt-l",mac:"Ctrl-l",run:LG},{key:"Mod-i",run:IG,preventDefault:!0},{key:"Mod-[",run:UB},{key:"Mod-]",run:$B},{key:"Mod-Alt-\\",run:eZ},{key:"Shift-Mod-k",run:GG},{key:"Shift-Mod-\\",run:AG},{key:"Mod-/",run:KY},{key:"Alt-A",run:XY},{key:"Ctrl-m",mac:"Shift-Alt-m",run:tZ}].concat(rZ),aZ={key:"Tab",run:$B,shift:UB},hD=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class Ju{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(hD(s)):hD,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 ar(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=EO(t),r=this.bufferStart+this.bufferPos;this.bufferPos+=Fi(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"&&(Ju.prototype[Symbol.iterator]=function(){return this});const HB={from:-1,to:-1,match:/.*/.exec(""),precise:!0},tA="gm"+(/x/.unicode==null?"":"u");class FB{constructor(t,n,r,i=0,a=t.length){if(this.text=t,this.to=a,this.curLine="",this.done=!1,this.value=HB,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new qB(t,n,r,i,a);this.re=new RegExp(n,tA+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=t.iter();let l=t.lineAt(i);this.curLineStart=l.from,this.matchPos=Og(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=Og(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 Fx=new WeakMap;class Iu{constructor(t,n){this.from=t,this.text=n}get to(){return this.from+this.text.length}static get(t,n,r){let i=Fx.get(t);if(!i||i.from>=r||i.to<=n){let s=new Iu(n,t.sliceString(n,r));return Fx.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)),Fx.set(t,new Iu(l,a)),new Iu(n,a.slice(n-l,r-l))}}class qB{constructor(t,n,r,i,a){this.text=t,this.to=a,this.done=!1,this.value=HB,this.matchPos=Og(t,i),this.re=new RegExp(n,tA+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=Iu.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=Og(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Iu.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(FB.prototype[Symbol.iterator]=qB.prototype[Symbol.iterator]=function(){return this});function lZ(e){try{return new RegExp(e,tA),!0}catch{return!1}}function Og(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 oZ=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:i}=CX(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=te.cursor(y.from+Math.max(0,Math.min(g,y.length)));e.dispatch({effects:[r,de.scrollIntoView(x.from,{y:"center"})],selection:x})}),!0},sZ={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},uZ=me.define({combine(e){return sa(e,sZ,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function cZ(e){return[mZ,pZ]}const fZ=Ce.mark({class:"cm-selectionMatch"}),hZ=Ce.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function dD(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 dZ(e,t,n,r){return e(t.sliceDoc(n,n+1))==Ot.Word&&e(t.sliceDoc(r-1,r))==Ot.Word}const pZ=Nt.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(uZ),{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),!(dD(l,n,i.from,i.to)&&dZ(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 Ju(n.doc,a,c.from,c.to);for(;!f.next().done;){let{from:d,to:p}=f.value;if((!l||dD(l,n,d,p))&&(i.empty&&d<=i.from&&p>=i.to?s.push(hZ.range(d,p)):(d>=i.to||p<=i.from)&&s.push(fZ.range(d,p)),s.length>t.maxMatches))return Ce.none}}return Ce.set(s)}},{decorations:e=>e.decorations}),mZ=de.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),gZ=({state:e,dispatch:t})=>{let{selection:n}=e,r=te.create(n.ranges.map(i=>e.wordAt(i.head)||te.cursor(i.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function vZ(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 Ju(e.doc,t,r[r.length-1].to);;)if(s.next(),s.done){if(l)return null;s=new Ju(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 yZ=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(a=>a.from===a.to))return gZ({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=vZ(e,r);return i?(t(e.update({selection:e.selection.addRange(te.range(i.from,i.to),!1),effects:de.scrollIntoView(i.to)})),!0):!1},gc=me.define({combine(e){return sa(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new _Z(t),scrollToMatch:t=>de.scrollIntoView(t)})}});class WB{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||lZ(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 AZ(this):new SZ(this)}getCursor(t,n=0,r){let i=t.doc?t:Fe.create({doc:t});return r==null&&(r=i.doc.length),this.regexp?xu(this,i,n,r):bu(this,i,n,r)}}class VB{constructor(t){this.spec=t}}function bZ(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 bu(e,t,n,r){let i;return e.wholeWord&&(i=xZ(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=bZ(e.test,t,i)),new Ju(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:a=>a.toLowerCase(),i)}function xZ(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(Ag(i,n-a))!=Ot.Word||t(kg(i,n-a))!=Ot.Word)&&(t(kg(i,r-a))!=Ot.Word||t(Ag(i,r-a))!=Ot.Word))}class SZ extends VB{constructor(t){super(t)}nextMatch(t,n,r){let i=bu(this.spec,t,r,t.doc.length).nextOverlapping();if(i.done){let a=Math.min(t.doc.length,n+this.spec.unquoted.length);i=bu(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=bu(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=bu(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=bu(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 wZ(e,t,n){return(r,i,a)=>(!n||n(r,i,a))&&e(a[0],t,r,i)}function xu(e,t,n,r){let i;return e.wholeWord&&(i=OZ(t.charCategorizer(t.selection.main.head))),e.test&&(i=wZ(e.test,t,i)),new FB(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function Ag(e,t){return e.slice(on(e,t,!1),t)}function kg(e,t){return e.slice(t,on(e,t))}function OZ(e){return(t,n,r)=>!r[0].length||(e(Ag(r.input,r.index))!=Ot.Word||e(kg(r.input,r.index))!=Ot.Word)&&(e(kg(r.input,r.index+r[0].length))!=Ot.Word||e(Ag(r.input,r.index+r[0].length))!=Ot.Word)}class AZ extends VB{nextMatch(t,n,r){let i=xu(this.spec,t,r,t.doc.length).next();return i.done&&(i=xu(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=xu(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=xu(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=xu(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 Eh=_e.define(),nA=_e.define(),ql=jn.define({create(e){return new qx(ZS(e).create(),null)},update(e,t){for(let n of t.effects)n.is(Eh)?e=new qx(n.value.create(),e.panel):n.is(nA)&&(e=new qx(e.query,n.value?rA:null));return e},provide:e=>Oh.from(e,t=>t.panel)});class qx{constructor(t,n){this.query=t,this.panel=n}}const kZ=Ce.mark({class:"cm-searchMatch"}),CZ=Ce.mark({class:"cm-searchMatch cm-searchMatch-selected"}),EZ=Nt.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 qa;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?CZ:kZ)})}return r.finish()}},{decorations:e=>e.decorations});function td(e){return t=>{let n=t.state.field(ql,!1);return n&&n.query.spec.valid?e(t,n):XB(t)}}const Cg=td((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=te.single(r.from,r.to),a=e.state.facet(gc);return e.dispatch({selection:i,effects:[iA(e,r),a.scrollToMatch(i.main,e)],userEvent:"select.search"}),QB(e),!0}),Eg=td((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=te.single(i.from,i.to),l=e.state.facet(gc);return e.dispatch({selection:a,effects:[iA(e,i),l.scrollToMatch(a.main,e)],userEvent:"select.search"}),QB(e),!0}),TZ=td((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:te.create(n.map(r=>te.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),MZ=({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 Ju(e.doc,e.sliceDoc(r,i));!s.next().done;){if(a.length>1e3)return!1;s.value.from==r&&(l=a.length),a.push(te.range(s.value.from,s.value.to))}return t(e.update({selection:te.create(a,l),userEvent:"select.search.matches"})),!0},pD=td((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=te.single(l.from,l.to).map(p),d.push(iA(e,l)),d.push(n.facet(gc).scrollToMatch(c.main,e))),e.dispatch({changes:p,selection:c,effects:d,userEvent:"input.replace"}),!0}),PZ=td((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 rA(e){return e.state.facet(gc).createPanel(e)}function ZS(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(gc);return new WB({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 KB(e){let t=WO(e,rA);return t&&t.dom.querySelector("[main-field]")}function QB(e){let t=KB(e);t&&t==e.root.activeElement&&t.select()}const XB=e=>{let t=e.state.field(ql,!1);if(t&&t.panel){let n=KB(e);if(n&&n!=e.root.activeElement){let r=ZS(e.state,t.query.spec);r.valid&&e.dispatch({effects:Eh.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[nA.of(!0),t?Eh.of(ZS(e.state,t.query.spec)):_e.appendConfig.of(RZ)]});return!0},YB=e=>{let t=e.state.field(ql,!1);if(!t||!t.panel)return!1;let n=WO(e,rA);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:nA.of(!1)}),!0},DZ=[{key:"Mod-f",run:XB,scope:"editor search-panel"},{key:"F3",run:Cg,shift:Eg,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Cg,shift:Eg,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:YB,scope:"editor search-panel"},{key:"Mod-Shift-l",run:MZ},{key:"Mod-Alt-g",run:oZ},{key:"Mod-d",run:yZ,preventDefault:!0}];class _Z{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:Ar(t,"Find"),"aria-label":Ar(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:Ar(t,"Replace"),"aria-label":Ar(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",()=>Cg(t),[Ar(t,"next")]),r("prev",()=>Eg(t),[Ar(t,"previous")]),r("select",()=>TZ(t),[Ar(t,"all")]),ot("label",null,[this.caseField,Ar(t,"match case")]),ot("label",null,[this.reField,Ar(t,"regexp")]),ot("label",null,[this.wordField,Ar(t,"by word")]),...t.state.readOnly?[]:[ot("br"),this.replaceField,r("replace",()=>pD(t),[Ar(t,"replace")]),r("replaceAll",()=>PZ(t),[Ar(t,"replace all")])],ot("button",{name:"close",onclick:()=>YB(t),"aria-label":Ar(t,"close"),type:"button"},["×"])])}commit(){let t=new WB({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:Eh.of(t)}))}keydown(t){jQ(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?Eg:Cg)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),pD(this.view))}update(t){for(let n of t.transactions)for(let r of n.effects)r.is(Eh)&&!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(gc).top}}function Ar(e,t){return e.state.phrase(t)}const fm=30,hm=/[\s\.,:;?!]/;function iA(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-fm),l=Math.min(i,n+fm),s=e.state.sliceDoc(a,l);if(a!=r.from){for(let c=0;c<fm;c++)if(!hm.test(s[c+1])&&hm.test(s[c])){s=s.slice(c);break}}if(l!=i){for(let c=s.length-1;c>s.length-fm;c--)if(!hm.test(s[c-1])&&hm.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 NZ=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"}}),RZ=[ql,ys.low(EZ),NZ];class GB{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=_n(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(ZB(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 mD(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 jZ(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=mD(t)+mD(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function LZ(e){let t=e.map(i=>typeof i=="string"?{label:i}:i),[n,r]=t.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:jZ(t);return i=>{let a=i.matchBefore(r);return a||i.explicit?{from:a?a.from:i.pos,options:t,validFor:n}:null}}class gD{constructor(t,n,r,i){this.completion=t,this.source=n,this.match=r,this.score=i}}function Jo(e){return e.selection.main.from}function ZB(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 JB=oa.define();function IZ(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:te.cursor(s.from+a+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const vD=new WeakMap;function BZ(e){if(!Array.isArray(e))return e;let t=vD.get(e);return t||vD.set(e,t=LZ(e)),t}const Tg=_e.define(),Th=_e.define();class zZ{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=ar(t,n),i=Fi(r);this.chars.push(r);let a=t.slice(n,n+i),l=a.toUpperCase();this.folded.push(ar(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 E=ar(t,0),k=Fi(E),M=k==t.length?0:-100;if(E!=n[0])if(E==r[0])M+=-200;else return null;return this.ret(M,[0,k])}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 E=0,k=Math.min(t.length,200);E<k&&f<c;){let M=ar(t,E);(M==n[f]||M==r[f])&&(i[f++]=E),E+=Fi(M)}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 E=0,k=Math.min(t.length,200),M=0;E<k&&p<c;){let D=ar(t,E);s<0&&(d<c&&D==n[d]&&(a[d++]=E),v<c&&(D==n[v]||D==r[v]?(v==0&&(y=E),x=E+1,v++):v=0));let P,N=D<255?D>=48&&D<=57||D>=97&&D<=122?2:D>=65&&D<=90?1:0:(P=EO(D))!=P.toLowerCase()?1:P!=P.toUpperCase()?2:0;(!E||N==1&&w||M==0&&N!=0)&&(n[p]==D||r[p]==D&&(g=!0)?l[p++]=E:l.length&&(A=!1)),M=N,E+=Fi(D)}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?Fi(ar(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 $Z{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 sa(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:UZ,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=>yD(t(r),n(r)),optionClass:(t,n)=>r=>yD(t(r),n(r)),addToOptions:(t,n)=>t.concat(n),filterStrict:(t,n)=>t||n})}});function yD(e,t){return e?t?e+" "+t:e:t}function UZ(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 E=i.bottom-t.bottom;E>=x||E>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 aA=_e.define();function HZ(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 Wx(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 FZ{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=HZ(s),this.optionClass=s.optionClass,this.tooltipClass=s.tooltipClass,this.range=Wx(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:aA.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:Th.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=Wx(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=Wx(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=>sr(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&&WZ(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 qZ(e,t){return n=>new FZ(n,e,t)}function WZ(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 bD(e){return(e.boost||0)*100+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}function VZ(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 gD(g,d.source,p?p(g):[],1e9-n.length));else{let g=t.sliceDoc(d.from,d.to),v,y=l.filterStrict?new $Z(g):new zZ(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 gD(x,d.source,w,A)),typeof x.section=="object"&&x.section.rank==="dynamic"){let{name:E}=x.section;i||(i=Object.create(null)),i[E]=Math.max(A,i[E]||-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):bD(d.completion)>bD(c)&&(s[s.length-1]=d),c=d.completion}return s}class Cu{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 Cu(this.options,xD(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=VZ(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 Cu(s,xD(r,c),{pos:t.reduce((f,d)=>d.hasResult()?Math.min(f,d.from):f,1e8),create:ZZ,above:a.aboveCursor},i?i.timestamp:Date.now(),c,!1)}map(t){return new Cu(this.options,this.attrs,{...this.tooltip,pos:t.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Cu(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Mg{constructor(t,n,r){this.active=t,this.id=n,this.open=r}static start(){return new Mg(YZ,"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",Jo(n)).map(BZ)).map(c=>(this.active.find(d=>d.source==c)||new Zr(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(lA));l&&t.docChanged&&(l=l.map(t.changes)),t.selection||a.some(c=>c.hasResult()&&t.changes.touchesRange(c.from,c.to))||!KZ(a,this.active)||s?l=Cu.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 Zr(c.source,0):c));for(let c of t.effects)c.is(aA)&&(l=l&&l.setSelected(c.value,this.id));return a==this.active&&l==this.open?this:new Mg(a,this.id,l)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?QZ:XZ}}function KZ(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 QZ={"aria-autocomplete":"list"},XZ={};function xD(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}const YZ=[];function ez(e,t){if(e.isUserEvent("input.complete")){let r=e.annotation(JB);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 Zr{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=ez(t,n),i=this;(r&8||r&16&&this.touches(t))&&(i=new Zr(i.source,0)),r&4&&i.state==0&&(i=new Zr(this.source,1)),i=i.updateFor(t,r);for(let a of t.effects)if(a.is(Tg))i=new Zr(i.source,1,a.value);else if(a.is(Th))i=new Zr(i.source,0);else if(a.is(lA))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(Jo(t.state))}}class Bu extends Zr{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=Jo(t.state);if(s>l||!i||n&2&&(Jo(t.startState)==this.from||s<this.limit))return new Zr(this.source,n&4?1:0);let c=t.changes.mapPos(this.limit);return GZ(i.validFor,t.state,a,l)?new Bu(this.source,this.explicit,c,i,a,l):i.update&&(i=i.update(i,a,l,new GB(t.state,s,!1)))?new Bu(this.source,this.explicit,c,i,i.from,(r=i.to)!==null&&r!==void 0?r:Jo(t.state)):new Zr(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 Bu(this.source,this.explicit,t.mapPos(this.limit),n,t.mapPos(this.from),t.mapPos(this.to,1)):new Zr(this.source,0)}touches(t){return t.changes.touchesRange(this.from,this.to)}}function GZ(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return typeof e=="function"?e(i,n,r,t):ZB(e,!0).test(i)}const lA=_e.define({map(e,t){return e.map(n=>n.map(t))}}),lr=jn.define({create(){return Mg.start()},update(e,t){return e.update(t)},provide:e=>[qO.from(e,t=>t.tooltip),de.contentAttributes.from(e,t=>t.attrs)]});function oA(e,t){const n=t.completion.apply||t.completion.label;let r=e.state.field(lr).active.find(i=>i.source==t.source);return r instanceof Bu?(typeof n=="string"?e.dispatch({...IZ(e.state,n,r.from,r.to),annotations:JB.of(t.completion)}):n(e,t.completion,r.from,r.to),!0):!1}const ZZ=qZ(lr,oA);function dm(e,t="option"){return n=>{let r=n.state.field(lr,!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=_3(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:aA.of(s)}),!0}}const JZ=e=>{let t=e.state.field(lr,!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:oA(e,t.open.options[t.open.selected])},Vx=e=>e.state.field(lr,!1)?(e.dispatch({effects:Tg.of(!0)}),!0):!1,eJ=e=>{let t=e.state.field(lr,!1);return!t||!t.active.some(n=>n.state!=0)?!1:(e.dispatch({effects:Th.of(null)}),!0)};class tJ{constructor(t,n){this.active=t,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const nJ=50,rJ=1e3,iJ=Nt.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(lr).active)t.isPending&&this.startQuery(t)}update(e){let t=e.state.field(lr),n=e.state.facet(ln);if(!e.selectionSet&&!e.docChanged&&e.startState.field(lr)==t)return;let r=e.transactions.some(a=>{let l=ez(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>nJ&&Date.now()-l.time>rJ){for(let s of l.context.abortListeners)try{s()}catch(c){sr(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(Tg)))&&(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(lr);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=Jo(t),r=new GB(t,n,e.explicit,this.view),i=new tJ(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:Th.of(null)}),sr(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(lr);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=Jo(a.updates.length?a.updates[0].startState:this.view.state),c=Math.min(s,a.done.from+(a.active.explicit?0:1)),f=new Bu(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 Zr(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:lA.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(lr,!1);if(t&&t.tooltip&&this.view.state.facet(ln).closeOnBlur){let n=t.open&&_3(this.view,t.open.tooltip);(!n||!n.dom.contains(e.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Th.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Tg.of(!1)}),20),this.composing=0}}}),aJ=typeof navigator=="object"&&/Win/.test(navigator.platform),lJ=ys.highest(de.domEventHandlers({keydown(e,t){let n=t.state.field(lr,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(aJ&&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&&oA(t,r),!1}})),oJ=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"}}}),Mh={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Ho=_e.define({map(e,t){let n=t.mapPos(e,-1,Kn.TrackAfter);return n??void 0}}),sA=new class extends Ql{};sA.startSide=1;sA.endSide=-1;const tz=jn.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(Ho)&&(e=e.update({add:[sA.range(n.value,n.value+1)]}));return e}});function sJ(){return[cJ,tz]}const Kx="()[]{}<>«»»«[]{}";function nz(e){for(let t=0;t<Kx.length;t+=2)if(Kx.charCodeAt(t)==e)return Kx.charAt(t+1);return EO(e<128?e:e+1)}function rz(e,t){return e.languageDataAt("closeBrackets",t)[0]||Mh}const uJ=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),cJ=de.inputHandler.of((e,t,n,r)=>{if((uJ?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let i=e.state.selection.main;if(r.length>2||r.length==2&&Fi(ar(r,0))==1||t!=i.from||n!=i.to)return!1;let a=dJ(e.state,r);return a?(e.dispatch(a),!0):!1}),fJ=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=rz(e,e.selection.main.head).brackets||Mh.brackets,i=null,a=e.changeByRange(l=>{if(l.empty){let s=pJ(e.doc,l.head);for(let c of r)if(c==s&&Gv(e.doc,l.head)==nz(ar(c,0)))return{changes:{from:l.head-c.length,to:l.head+c.length},range:te.cursor(l.head-c.length)}}return{range:i=l}});return i||t(e.update(a,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},hJ=[{key:"Backspace",run:fJ}];function dJ(e,t){let n=rz(e,e.selection.main.head),r=n.brackets||Mh.brackets;for(let i of r){let a=nz(ar(i,0));if(t==i)return a==i?vJ(e,i,r.indexOf(i+i+i)>-1,n):mJ(e,i,a,n.before||Mh.before);if(t==a&&iz(e,e.selection.main.from))return gJ(e,i,a)}return null}function iz(e,t){let n=!1;return e.field(tz).between(0,e.doc.length,r=>{r==t&&(n=!0)}),n}function Gv(e,t){let n=e.sliceString(t,t+2);return n.slice(0,Fi(ar(n,0)))}function pJ(e,t){let n=e.sliceString(t-2,t);return Fi(ar(n,0))==n.length?n:n.slice(1)}function mJ(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:Ho.of(l.to+t.length),range:te.range(l.anchor+t.length,l.head+t.length)};let s=Gv(e.doc,l.head);return!s||/\s/.test(s)||r.indexOf(s)>-1?{changes:{insert:t+n,from:l.head},effects:Ho.of(l.head+t.length),range:te.cursor(l.head+t.length)}:{range:i=l}});return i?null:e.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function gJ(e,t,n){let r=null,i=e.changeByRange(a=>a.empty&&Gv(e.doc,a.head)==n?{changes:{from:a.head,to:a.head+n.length,insert:n},range:te.cursor(a.head+n.length)}:r={range:a});return r?null:e.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function vJ(e,t,n,r){let i=r.stringPrefixes||Mh.stringPrefixes,a=null,l=e.changeByRange(s=>{if(!s.empty)return{changes:[{insert:t,from:s.from},{insert:t,from:s.to}],effects:Ho.of(s.to+t.length),range:te.range(s.anchor+t.length,s.head+t.length)};let c=s.head,f=Gv(e.doc,c),d;if(f==t){if(SD(e,c))return{changes:{insert:t+t,from:c},effects:Ho.of(c+t.length),range:te.cursor(c+t.length)};if(iz(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:te.cursor(c+g.length)}}}else{if(n&&e.sliceDoc(c-2*t.length,c)==t+t&&(d=wD(e,c-2*t.length,i))>-1&&SD(e,d))return{changes:{insert:t+t+t+t,from:c},effects:Ho.of(c+t.length),range:te.cursor(c+t.length)};if(e.charCategorizer(c)(f)!=Ot.Word&&wD(e,c,i)>-1&&!yJ(e,c,t,i))return{changes:{insert:t+t,from:c},effects:Ho.of(c+t.length),range:te.cursor(c+t.length)}}return{range:a=s}});return a?null:e.update(l,{scrollIntoView:!0,userEvent:"input.type"})}function SD(e,t){let n=_n(e).resolveInner(t+1);return n.parent&&n.from==t}function yJ(e,t,n,r){let i=_n(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 wD(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 bJ(e={}){return[lJ,lr,ln.of(e),iJ,xJ,oJ]}const az=[{key:"Ctrl-Space",run:Vx},{mac:"Alt-`",run:Vx},{mac:"Alt-i",run:Vx},{key:"Escape",run:eJ},{key:"ArrowDown",run:dm(!0)},{key:"ArrowUp",run:dm(!1)},{key:"PageDown",run:dm(!0,"page")},{key:"PageUp",run:dm(!1,"page")},{key:"Enter",run:JZ}],xJ=ys.highest(Hv.computeN([ln],e=>e.facet(ln).defaultKeymap?[az]:[]));class OD{constructor(t,n,r){this.from=t,this.to=n,this.diagnostic=r}}class Io{constructor(t,n,r){this.diagnostics=t,this.panel=n,this.selected=r}static init(t,n,r){let i=r.facet(Ph).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((v,y)=>v.from-y.from||v.to-y.to),l=new qa,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((k,M)=>Math.min(k,M.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 k=a[v];if(k.from==x&&(k.to>k.from||k.to==x))s.push(k),v++,w=Math.min(k.to,w);else{w=Math.min(k.from,w);break}}w=Math.min(w,p);let A=!1;if(s.some(k=>k.from==x&&(k.to==w||w==p))&&(A=x==w,!A&&w-x<10)){let k=x-(d+f.value.length);k>0&&(f.next(k),d=x);for(let M=x;;){if(M>=w){A=!0;break}if(!f.lineBreak&&d+f.value.length>M)break;M=d+f.value.length,d+=f.value.length,f.next()}}let E=NJ(s);if(A)l.add(x,x,Ce.widget({widget:new MJ(E),diagnostics:s.slice()}));else{let k=s.reduce((M,D)=>D.markClass?M+" "+D.markClass:M,"");l.add(x,w,Ce.mark({class:"cm-lintRange cm-lintRange-"+E+k,diagnostics:s.slice(),inclusiveEnd:s.some(M=>M.to>w)}))}if(c=w,c==p)break;for(let k=0;k<s.length;k++)s[k].to<=c&&s.splice(k--,1)}let g=l.finish();return new Io(g,n,eo(g))}}function eo(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 OD(i,a,t||l.diagnostics[0]);else{if(l.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new OD(r.from,a,r.diagnostic)}}),r}function SJ(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(Ph).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(l=>l.is(lz))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function wJ(e,t){return e.field(Mr,!1)?t:t.concat(_e.appendConfig.of(RJ))}const lz=_e.define(),uA=_e.define(),oz=_e.define(),Mr=jn.define({create(){return new Io(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=eo(n,e.selected.diagnostic,a)||eo(n,null,a)}!n.size&&i&&t.state.facet(Ph).autoPanel&&(i=null),e=new Io(n,i,r)}for(let n of t.effects)if(n.is(lz)){let r=t.state.facet(Ph).autoPanel?n.value.length?Dh.open:null:e.panel;e=Io.init(n.value,r,t.state)}else n.is(uA)?e=new Io(e.diagnostics,n.value?Dh.open:null,e.selected):n.is(oz)&&(e=new Io(e.diagnostics,e.panel,n.value));return e},provide:e=>[Oh.from(e,t=>t.panel),de.decorations.from(e,t=>t.diagnostics)]}),OJ=Ce.mark({class:"cm-lintRange cm-lintRange-active"});function AJ(e,t,n){let{diagnostics:r}=e.state.field(Mr),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(Ph).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:l,above:!0,create(){return{dom:kJ(e,i)}}}:null}function kJ(e,t){return ot("ul",{class:"cm-tooltip-lint"},t.map(n=>uz(e,n,!1)))}const CJ=e=>{let t=e.state.field(Mr,!1);(!t||!t.panel)&&e.dispatch({effects:wJ(e.state,[uA.of(!0)])});let n=WO(e,Dh.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},AD=e=>{let t=e.state.field(Mr,!1);return!t||!t.panel?!1:(e.dispatch({effects:uA.of(!1)}),!0)},EJ=e=>{let t=e.state.field(Mr,!1);if(!t)return!1;let n=e.state.selection.main,r=eo(t.diagnostics,null,n.to+1);return!r&&(r=eo(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}),AX(e,r.from,1,{tooltip:cz,until:i=>i.docChanged||i.newSelection.main.head<r.from||i.newSelection.main.head>r.to}),!0)},TJ=[{key:"Mod-Shift-m",run:CJ,preventDefault:!0},{key:"F8",run:EJ}],Ph=me.define({combine(e){return{sources:e.map(t=>t.source).filter(t=>t!=null),...sa(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:kD,tooltipFilter:kD,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 kD(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function sz(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 uz(e,t,n){var r;let i=n?sz(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=eo(e.state.field(Mr).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 MJ extends ua{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 CD{constructor(t,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=uz(t,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Dh{constructor(t){this.view=t,this.items=[];let n=i=>{if(!(i.ctrlKey||i.altKey||i.metaKey)){if(i.keyCode==27)AD(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=sz(a.actions);for(let s=0;s<l.length;s++)if(l[s].toUpperCase().charCodeAt(0)==i.keyCode){let c=eo(this.view.state.field(Mr).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:()=>AD(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(Mr).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(Mr),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 CD(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 CD(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(Mr),r=eo(n.diagnostics,this.items[t].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:oz.of(r)})}static open(t){return new Dh(t)}}function PJ(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 pm(e){return PJ(`<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 DJ=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:pm("#f11")},".cm-lintRange-warning":{backgroundImage:pm("orange")},".cm-lintRange-info":{backgroundImage:pm("#999")},".cm-lintRange-hint":{backgroundImage:pm("#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 _J(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function NJ(e){let t="hint",n=1;for(let r of e){let i=_J(r.severity);i>n&&(n=i,t=r.severity)}return t}const cz=OX(AJ,{hideOn:SJ}),RJ=[Mr,de.decorations.compute([Mr],e=>{let{selected:t,panel:n}=e.field(Mr);return!t||!n||t.from==t.to?Ce.none:Ce.set([OJ.range(t.from,t.to)])}),cz,DJ];var ED=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(hJ)),t.defaultKeymap!==!1&&(a=a.concat(iZ)),t.searchKeymap!==!1&&(a=a.concat(DZ)),t.historyKeymap!==!1&&(a=a.concat(fG)),t.foldKeymap!==!1&&(a=a.concat(kY)),t.completionKeymap!==!1&&(a=a.concat(az)),t.lintKeymap!==!1&&(a=a.concat(TJ));var l=[];return t.lineNumbers!==!1&&l.push(IX()),t.highlightActiveLineGutter!==!1&&l.push($X()),t.highlightSpecialChars!==!1&&l.push(ZQ()),t.history!==!1&&l.push(nG()),t.foldGutter!==!1&&l.push(MY()),t.drawSelection!==!1&&l.push(UQ()),t.dropCursor!==!1&&l.push(VQ()),t.allowMultipleSelections!==!1&&l.push(Fe.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&l.push(mY()),t.syntaxHighlighting!==!1&&l.push(aB(NY,{fallback:!0})),t.bracketMatching!==!1&&l.push($Y()),t.closeBrackets!==!1&&l.push(sJ()),t.autocompletion!==!1&&l.push(bJ()),t.rectangularSelection!==!1&&l.push(hX()),i!==!1&&l.push(mX()),t.highlightActiveLine!==!1&&l.push(iX()),t.highlightSelectionMatches!==!1&&l.push(cZ()),t.tabSize&&typeof t.tabSize=="number"&&l.push(qv.of(" ".repeat(t.tabSize))),l.concat([Hv.of(a.flat())]).filter(Boolean)};const jJ="#e5c07b",TD="#e06c75",LJ="#56b6c2",IJ="#ffffff",qm="#abb2bf",JS="#7d8799",BJ="#61afef",zJ="#98c379",MD="#d19a66",$J="#c678dd",UJ="#21252b",PD="#2c313a",DD="#282c34",Qx="#353a42",HJ="#3E4451",_D="#528bff",FJ=de.theme({"&":{color:qm,backgroundColor:DD},".cm-content":{caretColor:_D},".cm-cursor, .cm-dropCursor":{borderLeftColor:_D},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:HJ},".cm-panels":{backgroundColor:UJ,color:qm},".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:DD,color:JS,border:"none"},".cm-activeLineGutter":{backgroundColor:PD},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Qx},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Qx,borderBottomColor:Qx},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:PD,color:qm}}},{dark:!0}),qJ=Jh.define([{tag:G.keyword,color:$J},{tag:[G.name,G.deleted,G.character,G.propertyName,G.macroName],color:TD},{tag:[G.function(G.variableName),G.labelName],color:BJ},{tag:[G.color,G.constant(G.name),G.standard(G.name)],color:MD},{tag:[G.definition(G.name),G.separator],color:qm},{tag:[G.typeName,G.className,G.number,G.changed,G.annotation,G.modifier,G.self,G.namespace],color:jJ},{tag:[G.operator,G.operatorKeyword,G.url,G.escape,G.regexp,G.link,G.special(G.string)],color:LJ},{tag:[G.meta,G.comment],color:JS},{tag:G.strong,fontWeight:"bold"},{tag:G.emphasis,fontStyle:"italic"},{tag:G.strikethrough,textDecoration:"line-through"},{tag:G.link,color:JS,textDecoration:"underline"},{tag:G.heading,fontWeight:"bold",color:TD},{tag:[G.atom,G.bool,G.special(G.variableName)],color:MD},{tag:[G.processingInstruction,G.string,G.inserted],color:zJ},{tag:G.invalid,color:IJ}]),WJ=[FJ,aB(qJ)];var VJ=de.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),KJ=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(Hv.of([aZ])),y&&(typeof y=="boolean"?x.unshift(ED()):x.unshift(ED(y))),g&&x.unshift(sX(g)),d){case"light":x.push(VJ);break;case"dark":x.push(WJ);break;case"none":break;default:x.push(d);break}return l===!1&&x.push(de.editable.of(!1)),c&&x.push(Fe.readOnly.of(!0)),[...x]},QJ=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 XJ{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 ND{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 Xx=null,YJ=()=>typeof window>"u"?new ND:(Xx||(Xx=new ND),Xx),RD=oa.define(),GJ=200,ZJ=[];function JJ(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?ZJ: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,E=e.width,k=E===void 0?null:E,M=e.minWidth,D=M===void 0?null:M,P=e.maxWidth,N=P===void 0?null:P,L=e.placeholder,U=L===void 0?"":L,K=e.editable,V=K===void 0?!0:K,B=e.readOnly,oe=B===void 0?!1:B,ie=e.indentWithTab,ue=ie===void 0?!0:ie,z=e.basicSetup,Z=z===void 0?!0:z,ae=e.root,Q=e.initialState,le=O.useState(),R=le[0],F=le[1],ee=O.useState(),se=ee[0],ge=ee[1],Oe=O.useState(),Pe=Oe[0],mt=Oe[1],ce=O.useState(()=>({current:null}))[0],Te=O.useState(()=>({current:null}))[0],Ee=de.theme({"&":{height:v,minHeight:x,maxHeight:A,width:k,minWidth:D,maxWidth:N},"& .cm-scroller":{height:"100% !important"}}),fe=de.updateListener.of(xe=>{if(xe.docChanged&&typeof r=="function"&&!xe.transactions.some(fa=>fa.annotation(RD))){ce.current?ce.current.reset():(ce.current=new XJ(()=>{if(Te.current){var fa=Te.current;Te.current=null,fa()}ce.current=null},GJ),YJ().add(ce.current));var gt=xe.state.doc,dn=gt.toString();r(dn,xe)}i&&i(QJ(xe))}),Rt=KJ({theme:p,editable:V,readOnly:oe,placeholder:U,indentWithTab:ue,basicSetup:Z}),Ne=[fe,Ee,...Rt];return l&&typeof l=="function"&&Ne.push(de.updateListener.of(l)),Ne=Ne.concat(c),O.useLayoutEffect(()=>{if(R&&!Pe){var xe={doc:t,selection:n,extensions:Ne},gt=Q?Fe.fromJSON(Q.json,xe,Q.fields):Fe.create(xe);if(mt(gt),!se){var dn=new de({state:gt,parent:R,root:ae});ge(dn),a&&a(dn,gt)}}return()=>{se&&(mt(void 0),ge(void 0))}},[R,Pe]),O.useEffect(()=>{e.container&&F(e.container)},[e.container]),O.useEffect(()=>()=>{se&&(se.destroy(),ge(void 0)),ce.current&&(ce.current.cancel(),ce.current=null)},[se]),O.useEffect(()=>{f&&se&&se.focus()},[f,se]),O.useEffect(()=>{se&&se.dispatch({effects:_e.reconfigure.of(Ne)})},[p,c,v,x,A,k,D,N,U,V,oe,ue,Z,r,l]),O.useEffect(()=>{if(t!==void 0){var xe=se?se.state.doc.toString():"";if(se&&t!==xe){var gt=ce.current&&!ce.current.isDone,dn=()=>{se&&t!==se.state.doc.toString()&&se.dispatch({changes:{from:0,to:se.state.doc.toString().length,insert:t||""},annotations:[RD.of(!0)]})};gt?Te.current=dn:dn()}}},[t,se]),{state:Pe,setState:mt,view:se,setView:ge,container:R,setContainer:F}}var eee=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],fz=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,E=e.width,k=e.minWidth,M=e.maxWidth,D=e.basicSetup,P=e.placeholder,N=e.indentWithTab,L=e.editable,U=e.readOnly,K=e.root,V=e.initialState,B=T7(e,eee),oe=O.useRef(null),ie=JJ({root:K,value:i,autoFocus:g,theme:y,height:x,minHeight:w,maxHeight:A,width:E,minWidth:k,maxWidth:M,basicSetup:D,placeholder:P,indentWithTab:N,editable:L,readOnly:U,selection:a,onChange:c,onStatistics:f,onCreateEditor:d,onUpdate:p,extensions:s,initialState:V}),ue=ie.state,z=ie.view,Z=ie.container,ae=ie.setContainer;O.useImperativeHandle(t,()=>({editor:oe.current,state:ue,view:z}),[oe,Z,ue,z]);var Q=O.useCallback(R=>{oe.current=R,ae(R)},[ae]);if(typeof i!="string")throw new Error("value must be typeof string but got "+typeof i);var le=typeof y=="string"?"cm-theme-"+y:"cm-theme";return T.jsx("div",aS({ref:Q,className:""+le+(n?" "+n:"")},B))});fz.displayName="CodeMirror";var jD={};class Pg{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 Pg(t,[],n,r,r,0,[],0,i?new LD(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 Pg(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 tee(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 LD(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 LD{constructor(t,n){this.tracker=t,this.context=n,this.hash=t.strict?t.hash(n):0}}class tee{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 Dg{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 Dg(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 Dg(this.stack,this.pos,this.index)}}function mm(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 Wm{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const ID=new Wm;class nee{constructor(t,n){this.input=t,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=ID,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=ID,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 zu{constructor(t,n){this.data=t,this.id=n}token(t,n){let{parser:r}=n.p;ree(this.data,t,n,this.id,r.data,r.tokenPrecTable)}}zu.prototype.contextual=zu.prototype.fallback=zu.prototype.extend=!1;zu.prototype.fallback=zu.prototype.extend=!1;class Zv{constructor(t,n={}){this.token=t,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function ree(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||iee(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 BD(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function iee(e,t,n,r){let i=BD(n,r,t);return i<0||BD(n,r,e)<i}const kr=typeof process<"u"&&jD&&/\bparse\b/.test(jD.LOG);let Yx=null;function zD(e,t,n){let r=e.cursor(Dt.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 aee{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?zD(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?zD(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 Bt){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 lee{constructor(t,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(r=>new Wm)}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 Wm,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 Wm,{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=Da(s,f+2);else{i==0&&s[f+1]==2&&(i=this.putAction(Da(s,f+2),n,r,i));break}s[f]==n&&(i=this.putAction(Da(s,f+1),n,r,i))}return i}}class oee{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 nee(n,i),this.tokens=new lee(t,this.stream),this.topTerm=t.top[1];let{from:a}=i[0];this.stacks=[Pg.start(this,t.top[0],a)],this.fragments=r.length&&this.stream.end-a>t.bufferLength*4?new aee(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&&cee(i);if(l)return kr&&console.log("Finish with "+this.stackID(l)),this.stackToTree(l);if(this.parser.strict)throw kr&&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 kr&&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=kr?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),kr&&console.log(l+this.stackID(t)+` (via reuse of ${a.getName(p.type.id)})`),!0;if(!(p instanceof Bt)||p.children.length==0||p.positions[0]>0)break;let v=p.children[0];if(v instanceof Bt&&p.positions[0]==0)p=v;else break}}let s=a.stateSlot(t.state,4);if(s>0)return t.reduce(s),kr&&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),kr&&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 $D(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=kr?this.stackID(s)+" -> ":"";if(s.deadEnd&&(a||(a=!0,s.restart(),kr&&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()&&(kr&&console.log(g+this.stackID(p)+" (via force-reduce)"),!this.advanceFully(p,r));v++)kr&&(g=this.stackID(p)+" -> ");for(let v of s.recoverByInsert(c))kr&&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),kr&&console.log(d+this.stackID(s)+` (via recover-delete ${this.parser.getName(c)})`),$D(s,r)):(!i||i.score<p.score)&&(i=p)}return i}stackToTree(t){return t.close(),Bt.build({buffer:Dg.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=(Yx||(Yx=new WeakMap)).get(t);return n||Yx.set(t,n=String.fromCodePoint(this.nextStackID++)),n+t}}function $D(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 see{constructor(t,n,r){this.source=t,this.flags=n,this.disabled=r}allows(t){return!this.disabled||this.disabled[t]==0}}const Gx=e=>e;class uee{constructor(t){this.start=t.start,this.shift=t.shift||Gx,this.reduce=t.reduce||Gx,this.reuse=t.reuse||Gx,this.hash=t.hash||(()=>0),this.strict=t.strict!==!1}}class _g extends H3{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 VO(n.map((s,c)=>dr.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=B3;let l=mm(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(UD),this.states=mm(t.states,Uint32Array),this.data=mm(t.stateData),this.goto=mm(t.goto),this.maxTerm=t.maxTerm,this.tokenizers=t.tokenizers.map(s=>typeof s=="number"?new zu(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 oee(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=Da(r,a+2)];else{if(r[a+1]==2)return Da(r,a+2);break}if(l==n||l==0)return Da(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=Da(this.data,a+2);else break;i=n(Da(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=Da(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(_g.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]=UD(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 see(t,r,i)}static deserialize(t){return new _g(t)}}function Da(e,t){return e[t]|e[t+1]<<16}function cee(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 UD(e){if(e.external){let t=e.extend?1:0;return(n,r)=>e.external(n,r)<<1|t}return e.get}const Su=63,HD=64,fee=1,hee=2,hz=3,dee=4,dz=5,pee=6,mee=7,pz=65,gee=66,vee=8,yee=9,bee=10,xee=11,See=12,mz=13,wee=19,Oee=20,Aee=29,kee=33,Cee=34,Eee=47,Tee=0,cA=1,ew=2,_h=3,tw=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,Tee);function ah(e,t){for(let n=0,r=t-e.pos-1;;r--,n++){let i=e.peek(r);if(Ka(i)||i==-1)return n}}function nw(e){return e==32||e==9}function Ka(e){return e==10||e==13}function gz(e){return nw(e)||Ka(e)}function Fo(e){return e<0||gz(e)}const Mee=new uee({start:Bo.top,reduce(e,t){return e.type==_h&&(t==Oee||t==Cee)?e.parent:e},shift(e,t,n,r){if(t==hz)return new Bo(e,ah(r,r.pos),cA);if(t==pz||t==dz)return new Bo(e,ah(r,r.pos),ew);if(t==Su)return e.parent;if(t==wee||t==kee)return new Bo(e,0,_h);if(t==mz&&e.type==tw)return e.parent;if(t==Eee){let i=/[1-9]/.exec(r.read(r.pos,n.pos));if(i)return new Bo(e,e.depth+ +i[0],tw)}return e},hash(e){return e.hash}});function ec(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 Pee=new Zv((e,t)=>{if(e.next==-1&&t.canShift(HD))return e.acceptToken(HD);let n=e.peek(-1);if((Ka(n)||n<0)&&t.context.type!=_h){if(ec(e,45))if(t.canShift(Su))e.acceptToken(Su);else return e.acceptToken(fee,3);if(ec(e,46))if(t.canShift(Su))e.acceptToken(Su);else return e.acceptToken(hee,3);let r=0;for(;e.next==32;)r++,e.advance();(r<t.context.depth||r==t.context.depth&&t.context.type==cA&&(e.next!=45||!Fo(e.peek(1))))&&e.next!=-1&&!Ka(e.next)&&e.next!=35&&e.acceptToken(Su,-r)}},{contextual:!0}),Dee=new Zv((e,t)=>{if(t.context.type==_h){e.next==63&&(e.advance(),Fo(e.next)&&e.acceptToken(mee));return}if(e.next==45)e.advance(),Fo(e.next)&&e.acceptToken(t.context.type==cA&&t.context.depth==ah(e,e.pos-1)?dee:hz);else if(e.next==63)e.advance(),Fo(e.next)&&e.acceptToken(t.context.type==ew&&t.context.depth==ah(e,e.pos-1)?pee:dz);else{let n=e.pos;for(;;)if(nw(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)vz(e);else if(e.next==38)rw(e);else if(e.next==42){rw(e);break}else if(e.next==39||e.next==34){if(fA(e,!0))break;return}else if(e.next==91||e.next==123){if(!Nee(e))return;break}else{yz(e,!0,!1,0);break}for(;nw(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(Aee))return;let r=e.peek(1);Fo(r)&&e.acceptTokenTo(t.context.type==ew&&t.context.depth==ah(e,n)?gee:pz,n)}}},{contextual:!0});function _ee(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 FD(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function qD(e,t){return e.next==37?(e.advance(),FD(e.next)&&e.advance(),FD(e.next)&&e.advance(),!0):_ee(e.next)||t&&e.next==44?(e.advance(),!0):!1}function vz(e){if(e.advance(),e.next==60){for(e.advance();;)if(!qD(e,!0)){e.next==62&&e.advance();break}}else for(;qD(e,!1););}function rw(e){for(e.advance();!Fo(e.next)&&Ng(e.next)!="f";)e.advance()}function fA(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(Ka(a)){if(t)return!1;r=!0}else if(t&&e.pos>=i+1024)return!1}return!r}function Nee(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(!fA(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||Ka(e.next))return!1;e.advance()}}const Ree="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function Ng(e){return e<33?"u":e>125?"s":Ree[e-33]}function Zx(e,t){let n=Ng(e);return n!="u"&&!(t&&n=="f")}function yz(e,t,n,r){if(Ng(e.next)=="s"||(e.next==63||e.next==58||e.next==45)&&Zx(e.peek(1),n))e.advance();else return!1;let i=e.pos;for(;;){let a=e.next,l=0,s=r+1;for(;gz(a);){if(Ka(a)){if(t)return!1;s=0}else s++;a=e.peek(++l)}if(!(a>=0&&(a==58?Zx(e.peek(l+1),n):a==35?e.peek(l-1)!=32:Zx(a,n)))||!n&&s<=r||s==0&&!n&&(ec(e,45,l)||ec(e,46,l)))break;if(t&&Ng(a)=="f")return!1;for(let f=l;f>=0;f--)e.advance();if(t&&e.pos>i+1024)return!1}return!0}const jee=new Zv((e,t)=>{if(e.next==33)vz(e),e.acceptToken(See);else if(e.next==38||e.next==42){let n=e.next==38?bee:xee;rw(e),e.acceptToken(n)}else e.next==39||e.next==34?(fA(e,!1),e.acceptToken(yee)):yz(e,!1,t.context.type==_h,t.context.depth)&&e.acceptToken(vee)}),Lee=new Zv((e,t)=>{let n=t.context.type==tw?t.context.depth:-1,r=e.pos;e:for(;;){let i=0,a=e.next;for(;a==32;)a=e.peek(++i);if(!i&&(ec(e,45,i)||ec(e,46,i))||!Ka(a)&&(n<0&&(n=Math.max(t.context.depth+1,i)),i<n))break;for(;;){if(e.next<0)break e;let l=Ka(e.next);if(e.advance(),l)continue e;r=e.pos}}e.acceptTokenTo(mz,r)}),Iee=F3({DirectiveName:G.keyword,DirectiveContent:G.attributeValue,"DirectiveEnd DocEnd":G.meta,QuotedLiteral:G.string,BlockLiteralHeader:G.special(G.string),BlockLiteralContent:G.content,Literal:G.content,"Key/Literal Key/QuotedLiteral":G.definition(G.propertyName),"Anchor Alias":G.labelName,Tag:G.typeName,Comment:G.lineComment,": , -":G.separator,"?":G.punctuation,"[ ]":G.squareBracket,"{ }":G.brace}),Bee=_g.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:Mee,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[Iee],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:[Pee,Dee,jee,Lee,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),zee=vg.define({name:"yaml",parser:Bee.configure({props:[K3.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:GP({closing:"}"}),FlowSequence:GP({closing:"]"})}),Y3.add({"FlowMapping FlowSequence":vY,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function $ee(){return new lY(zee)}function WD(e){const t=io(),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=Wh({mutationFn:async()=>{const y=await Ct.validateConfig(r);if(!y.valid)throw new fh(400,y.error??"invalid config");if(e.mode==="create")return Ct.createConfig(a,r);if(e.mode==="edit")return Ct.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 fh&&p.error.status===409,v=e.mode==="view";return T.jsxs("div",{className:"space-y-3",children:[e.mode==="create"&&T.jsxs("label",{className:"block text-sm",children:[T.jsx("span",{className:"mb-1 block text-xs uppercase tracking-wide text-ink-muted",children:"Filename"}),T.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&&T.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&&T.jsx("div",{className:"rounded-md border border-critical/50 bg-surface px-3 py-2 text-sm text-critical",children:s}),T.jsx("div",{className:"overflow-hidden rounded-md border border-edge",children:T.jsx(fz,{value:r,onChange:i,extensions:[$ee()],editable:!v,theme:d?"dark":"light",minHeight:"240px",maxHeight:"560px"})}),!v&&T.jsxs("div",{className:"flex items-center gap-3",children:[T.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"&&T.jsx("button",{onClick:()=>e.onCancel?.(),className:"text-sm text-ink-muted hover:text-ink-secondary",children:"Cancel"}),e.mode==="edit"&&f&&T.jsx("span",{className:"text-xs text-ink-muted",children:"unsaved changes"}),T.jsxs("span",{className:"ml-auto text-xs text-ink-muted",children:["Secrets stay as ",T.jsx("code",{children:"${ENV_VAR}"})," placeholders — they are resolved only inside sync jobs."]})]})]})}function Uee({runs:e,showConfig:t=!1,configNames:n}){return e.length===0?T.jsx("p",{className:"py-8 text-center text-sm text-ink-muted",children:"No runs yet."}):T.jsx("div",{className:"overflow-x-auto",children:T.jsxs("table",{className:"w-full text-sm",children:[T.jsx("thead",{children:T.jsxs("tr",{className:"border-b border-edge text-left text-xs uppercase tracking-wide text-ink-muted",children:[T.jsx("th",{className:"py-2 pr-4 font-medium",children:"Run"}),t&&T.jsx("th",{className:"py-2 pr-4 font-medium",children:"Config"}),T.jsx("th",{className:"py-2 pr-4 font-medium",children:"Status"}),T.jsx("th",{className:"py-2 pr-4 font-medium",children:"Trigger"}),T.jsx("th",{className:"py-2 pr-4 font-medium",children:"Started"}),T.jsx("th",{className:"py-2 pr-4 font-medium",children:"Duration"}),T.jsx("th",{className:"py-2 font-medium",children:"Detail"})]})}),T.jsx("tbody",{children:e.map(r=>T.jsxs("tr",{className:"border-b border-edge/60 hover:bg-ink/[0.03]",children:[T.jsx("td",{className:"py-2.5 pr-4",children:T.jsxs(yi,{to:`/runs/${r.id}`,className:"font-medium text-accent hover:underline",children:["#",r.id]})}),t&&T.jsx("td",{className:"py-2.5 pr-4",children:T.jsx(yi,{to:`/configs/${r.config_id}`,className:"hover:underline",children:n?.get(r.config_id)??r.config_name??`config ${r.config_id}`})}),T.jsx("td",{className:"py-2.5 pr-4",children:T.jsx(_v,{status:r.status})}),T.jsxs("td",{className:"py-2.5 pr-4 text-ink-secondary",children:[r.trigger,r.requested_sources&&r.requested_sources.length>0&&T.jsxs("span",{className:"ml-1.5 rounded-full border border-edge px-1.5 py-0.5 text-xs text-ink-muted",title:`Selected sources: ${r.requested_sources.map(i=>`${i.product_name} (${i.type})`).join(", ")}`,children:[r.requested_sources.length," source",r.requested_sources.length>1?"s":""]})]}),T.jsx("td",{className:"py-2.5 pr-4 text-ink-secondary",children:Fa(r.started_at??r.queued_at)}),T.jsx("td",{className:"py-2.5 pr-4 text-ink-secondary",children:r.status==="running"||r.status==="queued"?"…":mO(r.started_at,r.finished_at)}),T.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 bz(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=bz(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=bz(e))&&(r&&(r+=" "),r+=t);return r}var Hee=["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 hA(e){if(typeof e!="string")return!1;var t=Hee;return t.includes(e)}var Fee=["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"],qee=new Set(Fee);function xz(e){return typeof e!="string"?!1:qee.has(e)}function Sz(e){return typeof e=="string"&&e.startsWith("data-")}function Si(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(xz(n)||Sz(n))&&(t[n]=e[n]);return t}function nd(e){if(e==null)return null;if(O.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Si(t)}return typeof e=="object"&&!Array.isArray(e)?Si(e):null}function _r(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(xz(n)||Sz(n)||hA(n))&&(t[n]=e[n]);return t}function Wee(e){return e==null?null:O.isValidElement(e)?_r(e.props):typeof e=="object"&&!Array.isArray(e)?_r(e):null}var Vee=["children","width","height","viewBox","className","style","title","desc"];function iw(){return iw=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},iw.apply(null,arguments)}function Kee(e,t){if(e==null)return{};var n,r,i=Qee(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 Qee(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 dA=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=Kee(e,Vee),p=a||{width:r,height:i,x:0,y:0},g=st("recharts-surface",l);return O.createElement("svg",iw({},_r(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)}),Xee=["children","className"];function aw(){return aw=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},aw.apply(null,arguments)}function Yee(e,t){if(e==null)return{};var n,r,i=Gee(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 Gee(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 Nr=O.forwardRef((e,t)=>{var n=e.children,r=e.className,i=Yee(e,Xee),a=st("recharts-layer",r);return O.createElement("g",aw({className:a},_r(i),{ref:t}),n)}),wz=O.createContext(null),Zee=()=>O.useContext(wz);function dt(e){return function(){return e}}const Oz=Math.cos,Rg=Math.sin,Ei=Math.sqrt,jg=Math.PI,Jv=2*jg,lw=Math.PI,ow=2*lw,Ro=1e-6,Jee=ow-Ro;function Az(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function ete(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Az;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 tte{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Az:ete(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>Ro)if(!(Math.abs(p*c-f*d)>Ro)||!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),E=Math.sqrt(g),k=a*Math.tan((lw-Math.acos((x+g-w)/(2*A*E)))/2),M=k/E,D=k/A;Math.abs(M-1)>Ro&&this._append`L${t+M*d},${n+M*p}`,this._append`A${a},${a},0,0,${+(p*v>d*y)},${this._x1=t+D*c},${this._y1=n+D*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)>Ro||Math.abs(this._y1-d)>Ro)&&this._append`L${f},${d}`,r&&(g<0&&(g=g%ow+ow),g>Jee?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>Ro&&this._append`A${r},${r},0,${+(g>=lw)},${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 pA(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 tte(t)}function mA(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function kz(e){this._context=e}kz.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 ey(e){return new kz(e)}function Cz(e){return e[0]}function Ez(e){return e[1]}function Tz(e,t){var n=dt(!0),r=null,i=ey,a=null,l=pA(s);e=typeof e=="function"?e:e===void 0?Cz:dt(e),t=typeof t=="function"?t:t===void 0?Ez:dt(t);function s(c){var f,d=(c=mA(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 gm(e,t,n){var r=null,i=dt(!0),a=null,l=ey,s=null,c=pA(f);e=typeof e=="function"?e:e===void 0?Cz:dt(+e),t=typeof t=="function"?t:dt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?Ez:dt(+n);function f(p){var g,v,y,x=(p=mA(p)).length,w,A=!1,E,k=new Array(x),M=new Array(x);for(a==null&&(s=l(E=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(k[y],M[y]);s.lineEnd(),s.areaEnd()}A&&(k[g]=+e(w,g,p),M[g]=+t(w,g,p),s.point(r?+r(w,g,p):k[g],n?+n(w,g,p):M[g]))}if(E)return s=null,E+""||null}function d(){return Tz().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 Mz{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 nte(e){return new Mz(e,!0)}function rte(e){return new Mz(e,!1)}const gA={draw(e,t){const n=Ei(t/jg);e.moveTo(n,0),e.arc(0,0,n,0,Jv)}},ite={draw(e,t){const n=Ei(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()}},Pz=Ei(1/3),ate=Pz*2,lte={draw(e,t){const n=Ei(t/ate),r=n*Pz;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},ote={draw(e,t){const n=Ei(t),r=-n/2;e.rect(r,r,n,n)}},ste=.8908130915292852,Dz=Rg(jg/10)/Rg(7*jg/10),ute=Rg(Jv/10)*Dz,cte=-Oz(Jv/10)*Dz,fte={draw(e,t){const n=Ei(t*ste),r=ute*n,i=cte*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const l=Jv*a/5,s=Oz(l),c=Rg(l);e.lineTo(c*n,-s*n),e.lineTo(s*r-c*i,c*r+s*i)}e.closePath()}},Jx=Ei(3),hte={draw(e,t){const n=-Ei(t/(Jx*3));e.moveTo(0,n*2),e.lineTo(-Jx*n,-n),e.lineTo(Jx*n,-n),e.closePath()}},Wr=-.5,Vr=Ei(3)/2,sw=1/Ei(12),dte=(sw/2+1)*3,pte={draw(e,t){const n=Ei(t/dte),r=n/2,i=n*sw,a=r,l=n*sw+n,s=-a,c=l;e.moveTo(r,i),e.lineTo(a,l),e.lineTo(s,c),e.lineTo(Wr*r-Vr*i,Vr*r+Wr*i),e.lineTo(Wr*a-Vr*l,Vr*a+Wr*l),e.lineTo(Wr*s-Vr*c,Vr*s+Wr*c),e.lineTo(Wr*r+Vr*i,Wr*i-Vr*r),e.lineTo(Wr*a+Vr*l,Wr*l-Vr*a),e.lineTo(Wr*s+Vr*c,Wr*c-Vr*s),e.closePath()}};function mte(e,t){let n=null,r=pA(i);e=typeof e=="function"?e:dt(e||gA),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 Lg(){}function Ig(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 _z(e){this._context=e}_z.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:Ig(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:Ig(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function gte(e){return new _z(e)}function Nz(e){this._context=e}Nz.prototype={areaStart:Lg,areaEnd:Lg,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:Ig(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function vte(e){return new Nz(e)}function Rz(e){this._context=e}Rz.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:Ig(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function yte(e){return new Rz(e)}function jz(e){this._context=e}jz.prototype={areaStart:Lg,areaEnd:Lg,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 bte(e){return new jz(e)}function VD(e){return e<0?-1:1}function KD(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(VD(a)+VD(l))*Math.min(Math.abs(a),Math.abs(l),.5*Math.abs(s))||0}function QD(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function e1(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 Bg(e){this._context=e}Bg.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:e1(this,this._t0,QD(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,e1(this,QD(this,n=KD(this,e,t)),n);break;default:e1(this,this._t0,n=KD(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Lz(e){this._context=new Iz(e)}(Lz.prototype=Object.create(Bg.prototype)).point=function(e,t){Bg.prototype.point.call(this,t,e)};function Iz(e){this._context=e}Iz.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 xte(e){return new Bg(e)}function Ste(e){return new Lz(e)}function Bz(e){this._context=e}Bz.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=XD(e),i=XD(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 XD(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 wte(e){return new Bz(e)}function ty(e,t){this._context=e,this._t=t}ty.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 Ote(e){return new ty(e,.5)}function Ate(e){return new ty(e,0)}function kte(e){return new ty(e,1)}function fs(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 uw(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Cte(e,t){return e[t]}function Ete(e){const t=[];return t.key=e,t}function Tte(){var e=dt([]),t=uw,n=fs,r=Cte;function i(a){var l=Array.from(e.apply(this,arguments),Ete),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=mA(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?uw:typeof a=="function"?a:dt(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??fs,i):n},i}function Mte(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}fs(e,t)}}function Pte(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}fs(e,t)}}function Dte(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,fs(e,t)}}function cw(e){return e==="__proto__"}function zz(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return e.includes(".")||e.includes("[")||e.includes("]")}}function vA(e){return typeof e=="string"||typeof e=="symbol"?e:Object.is(e?.valueOf?.(),-0)?"-0":String(e)}function $z(e){if(e==null)return"";if(typeof e=="string")return e;if(Array.isArray(e))return e.map($z).join(",");const t=String(e);return t==="0"&&Object.is(Number(e),-0)?"-0":t}function yA(e){if(Array.isArray(e))return e.map(vA);if(typeof e=="symbol")return[e];e=$z(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(cw(t))return n;const r=e[t];return r===void 0?zz(t)&&!Object.hasOwn(e,t)?Qa(e,yA(t),n):n:r}case"number":case"symbol":{typeof t=="number"&&(t=vA(t));const r=e[t];return r===void 0?n:r}default:{if(Array.isArray(t))return _te(e,t,n);if(Object.is(t?.valueOf(),-0)?t="-0":t=String(t),cw(t))return n;const r=e[t];return r===void 0?n:r}}}function _te(e,t,n){if(t.length===0)return n;let r=e;for(let i=0;i<t.length;i++){if(r==null||cw(t[i]))return n;r=r[t[i]]}return r===void 0?n:r}var Nte=4;function ja(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Nte,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+ja(s)+a:i+a},"")}var cr=e=>e===0?0:e>0?1:-1,na=e=>typeof e=="number"&&e!=+e,hs=e=>typeof e=="string"&&e.length>1&&e.indexOf("%")===e.length-1,be=e=>(typeof e=="number"||e instanceof Number)&&!na(e),ra=e=>be(e)||typeof e=="string",Rte=0,Nh=e=>{var t=++Rte;return"".concat(e||"").concat(t)},wi=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(hs(t)){if(n==null)return r;var l=t.indexOf("%");a=n*parseFloat(t.slice(0,l))/100}else a=+t;return na(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},Uz=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 qt(e,t,n){return be(e)&&be(t)?ja(e+n*(t-e)):t}function Hz(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",rd=e=>kt(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function fr(e){return e!=null}function bs(){}var jte=["type","size","sizeType"];function fw(){return fw=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},fw.apply(null,arguments)}function YD(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 GD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YD(Object(n),!0).forEach(function(r){Lte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lte(e,t,n){return(t=Ite(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ite(e){var t=Bte(e,"string");return typeof t=="symbol"?t:t+""}function Bte(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 zte(e,t){if(e==null)return{};var n,r,i=$te(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 $te(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 Fz={symbolCircle:gA,symbolCross:ite,symbolDiamond:lte,symbolSquare:ote,symbolStar:fte,symbolTriangle:hte,symbolWye:pte},Ute=Math.PI/180,Hte=e=>{var t="symbol".concat(rd(e));return Fz[t]||gA},Fte=(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*Ute;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}},qte=(e,t)=>{Fz["symbol".concat(rd(e))]=t},qz=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=zte(e,jte),c=GD(GD({},s),{},{type:n,size:i,sizeType:l}),f="circle";typeof n=="string"&&(f=n);var d=()=>{var x=Hte(f),w=mte().type(x).size(Fte(i,l,f)),A=w();if(A!==null)return A},p=c.className,g=c.cx,v=c.cy,y=_r(c);return be(g)&&be(v)&&be(i)?O.createElement("path",fw({},y,{className:st("recharts-symbols",p),transform:"translate(".concat(g,", ").concat(v,")"),d:d()})):null};qz.registerSymbol=qte;var Wz=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,bA=(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=>{hA(i)&&typeof n[i]=="function"&&(r[i]=(a=>n[i](n,a)))}),r},Wte=(e,t,n)=>r=>(e(t,n,r),null),ny=(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];hA(i)&&typeof a=="function"&&(r||(r={}),r[i]=Wte(a,t,n))}),r};function ZD(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 Vte(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZD(Object(n),!0).forEach(function(r){Kte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kte(e,t,n){return(t=Qte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qte(e){var t=Xte(e,"string");return typeof t=="symbol"?t:t+""}function Xte(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=Vte({},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 zg(){return zg=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},zg.apply(null,arguments)}function JD(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 Vz(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JD(Object(n),!0).forEach(function(r){Yte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yte(e,t,n){return(t=Gte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gte(e){var t=Zte(e,"string");return typeof t=="symbol"?t:t+""}function Zte(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 Qr=32,Jte={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function ene(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function tne(e){var t=e.data,n=e.iconType,r=e.inactiveColor,i=Qr/2,a=Qr/6,l=Qr/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:ene(t.payload),x1:0,y1:i,x2:Qr,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(Qr,"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(Qr/8,"h").concat(Qr,"v").concat(Qr*3/4,"h").concat(-Qr,"z"),className:"recharts-legend-icon"});if(O.isValidElement(t.legendIcon)){var f=Vz({},t);return delete f.legendIcon,O.cloneElement(t.legendIcon,f)}return O.createElement(qz,{fill:s,cx:i,cy:i,size:Qr,sizeType:"diameter",type:c})}function nne(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:Qr,height:Qr},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"?Vz({},s):{};x.color=p.inactive?a:x.color||p.color;var w=v?v(p.value,p,g):p.value;return O.createElement("li",zg({className:y,style:f,key:"legend-item-".concat(g)},ny(e,p,g)),O.createElement(dA,{width:n,height:n,viewBox:c,style:d,"aria-label":p.value==null?"legend icon":"".concat(p.value," legend icon")},O.createElement(tne,{data:p,iconType:l,inactiveColor:a})),O.createElement("span",{className:"recharts-legend-item-text",style:x},w))})}var rne=e=>{var t=In(e,Jte),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(nne,zg({},t,{payload:n})))};function ine(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 ane(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}function Kz(e){return e}function lne(e){return function(t){return Qa(t,e)}}function hw(e){return e==null||typeof e!="object"&&typeof e!="function"}function one(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function sne(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function xA(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const une="[object RegExp]",Qz="[object String]",Xz="[object Number]",Yz="[object Boolean]",Gz="[object Arguments]",cne="[object Symbol]",fne="[object Date]",hne="[object Map]",dne="[object Set]",pne="[object Array]",mne="[object ArrayBuffer]",gne="[object Object]",vne="[object DataView]",yne="[object Uint8Array]",bne="[object Uint8ClampedArray]",xne="[object Uint16Array]",Sne="[object Uint32Array]",wne="[object Int8Array]",One="[object Int16Array]",Ane="[object Int32Array]",kne="[object Float32Array]",Cne="[object Float64Array]",e_=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function Ene(e){return typeof e_.Buffer<"u"&&e_.Buffer.isBuffer(e)}function Tne(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(hw(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(Ene(e))return e.subarray();if(one(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),fi(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),fi(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),fi(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,fi(l,e,n,r,i),l}if(e instanceof Boolean){const l=new Boolean(e.valueOf());return r.set(e,l),fi(l,e,n,r,i),l}if(e instanceof Number){const l=new Number(e.valueOf());return r.set(e,l),fi(l,e,n,r,i),l}if(e instanceof String){const l=new String(e.valueOf());return r.set(e,l),fi(l,e,n,r,i),l}if(typeof e=="object"&&Mne(e)){const l=Object.create(Object.getPrototypeOf(e));return r.set(e,l),fi(l,e,n,r,i),l}return e}function fi(e,t,n=e,r,i){const a=[...Object.keys(t),...sne(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 Mne(e){switch(xA(e)){case Gz:case pne:case mne:case vne:case Yz:case fne:case kne:case Cne:case wne:case One:case Ane:case hne:case Xz:case gne:case une:case dne:case Qz:case cne:case yne:case bne:case xne:case Sne:return!0;default:return!1}}function Pne(e){return qo(e,void 0,e,new Map,void 0)}function Vm(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function Zz(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function Jz(e,t,n){return typeof n!="function"?Jz(e,t,()=>{}):dw(e,t,function r(i,a,l,s,c,f){const d=n(i,a,l,s,c,f);return d!==void 0?!!d:dw(i,a,r,f,!1)},new Map,!0)}function dw(e,t,n,r,i=!1){if(t===e)return!0;switch(typeof t){case"object":return Dne(e,t,n,r);case"function":return Object.keys(t).length>0?dw(e,{...t},n,r,i):Vm(e,t);default:return Zz(e)&&i?typeof t=="string"?t==="":!0:Vm(e,t)}}function Dne(e,t,n,r){if(t==null)return!0;if(Array.isArray(t))return e5(e,t,n,r);if(t instanceof Map)return _ne(e,t,n,r);if(t instanceof Set)return Nne(e,t,n,r);const i=Object.keys(t);if(e==null||hw(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(!hw(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 _ne(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 e5(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 Nne(e,t,n,r){return t.size===0?!0:e instanceof Set?e5([...e],[...t],n,r):!1}function t5(e,t){return Jz(e,t,()=>{})}function Rne(e){return e=Pne(e),t=>t5(t,e)}function jne(e,t){return Tne(e,(n,r,i,a)=>{if(typeof e=="object"){if(xA(e)==="[object Object]"&&typeof e.constructor!="function"){const l={};return a.set(e,l),fi(l,e,i,a),l}switch(Object.prototype.toString.call(e)){case Xz:case Qz:case Yz:{const l=new e.constructor(e?.valueOf());return fi(l,e),l}case Gz:{const l={};return fi(l,e),l.length=e.length,l[Symbol.iterator]=e[Symbol.iterator],l}default:return}}})}function Lne(e){return jne(e)}const Ine=/^(?:0|[1-9]\d*)$/;function n5(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 Ine.test(e)}}function Bne(e){return e!==null&&typeof e=="object"&&xA(e)==="[object Arguments]"}function zne(e,t){let n;if(Array.isArray(t)?n=t:typeof t=="string"&&zz(t)&&e?.[t]==null?n=yA(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)||Bne(r))&&n5(a)&&a<r.length))return!1;r=r[a]}return!0}function $ne(e,t){switch(typeof e){case"object":Object.is(e?.valueOf(),-0)&&(e="-0");break;case"number":e=vA(e);break}return t=Lne(t),function(n){const r=Qa(n,e);return r===void 0?zne(n,e):t===void 0?r===void 0:t5(r,t)}}function Une(e){if(e==null)return Kz;switch(typeof e){case"function":return e;case"object":return Array.isArray(e)&&e.length===2?$ne(e[0],e[1]):Rne(e);case"string":case"symbol":case"number":return lne(e)}}function Hne(e){return Number.isSafeInteger(e)&&e>=0}function r5(e){return e!=null&&typeof e!="function"&&Hne(e.length)}function Fne(e){return typeof e=="object"&&e!==null}function qne(e){return Fne(e)&&r5(e)}function t_(e,t=Kz){return qne(e)?ine(Array.from(e),ane(Une(t),1)):[]}function i5(e,t,n){return t===!0?t_(e,n):typeof t=="function"?t_(e,t):e}var t1={exports:{}},n1={},r1={exports:{}},i1={};var n_;function Wne(){if(n_)return i1;n_=1;var e=uc();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 i1.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,i1}var r_;function Vne(){return r_||(r_=1,r1.exports=Wne()),r1.exports}var i_;function Kne(){if(i_)return n1;i_=1;var e=uc(),t=Vne();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 n1.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(P){if(!E){if(E=!0,k=P,P=g(P),v!==void 0&&x.hasValue){var N=x.value;if(v(N,P))return M=N}return M=P}if(N=M,r(k,P))return N;var L=g(P);return v!==void 0&&v(N,L)?(k=P,N):(k=P,M=L)}var E=!1,k,M,D=p===void 0?null:p;return[function(){return A(d())},D===null?void 0:function(){return A(D())}]},[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},n1}var a_;function Qne(){return a_||(a_=1,t1.exports=Kne()),t1.exports}var Xne=Qne(),SA=O.createContext(null),Yne=e=>e,St=()=>{var e=O.useContext(SA);return e?e.store.dispatch:Yne},Km=()=>{},Gne=()=>Km,Zne=(e,t)=>e===t;function we(e){var t=O.useContext(SA),n=O.useMemo(()=>t?r=>{if(r!=null)return e(r)}:Km,[t,e]);return Xne.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:Gne,t?t.store.getState:Km,t?t.store.getState:Km,n,Zne)}function Jne(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function ere(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 l_=e=>Array.isArray(e)?e:[e];function tre(e){const t=Array.isArray(e[0])?e[0]:e;return ere(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function nre(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var rre=class{constructor(e){this.value=e}deref(){return this.value}},ire=()=>typeof WeakRef>"u"?rre:WeakRef,a5=ire(),are=0,o_=1;function vm(){return{s:are,v:void 0,o:null,p:null}}function lre(e){return e instanceof a5?e.deref():e}function l5(e,t={}){let n=vm();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=vm(),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=vm(),y.set(v,s)):s=x}}const f=s;let d;if(s.s===o_)d=s.v;else if(d=e.apply(null,arguments),a++,r){const p=lre(i);p!=null&&r(p,d)&&(d=p,a!==0&&a--),i=typeof d=="object"&&d!==null||typeof d=="function"?new a5(d):d}return f.s=o_,f.v=d,d}return l.clearCache=()=>{n=vm(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}function ore(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()),Jne(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const d={...n,...c},{memoize:p,memoizeOptions:g=[],argsMemoize:v=l5,argsMemoizeOptions:y=[]}=d,x=l_(g),w=l_(y),A=tre(i),E=p(function(){return a++,f.apply(null,arguments)},...x),k=v(function(){l++;const D=nre(A,arguments);return s=E.apply(null,D),s},...w);return Object.assign(k,{resultFunc:f,memoizedResultFunc:E,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 W=ore(l5);function sre(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 pw(e,t,n){return Zz(n)&&(typeof t=="number"&&r5(n)&&n5(t)&&t<n.length||typeof t=="string"&&t in n)?Vm(n[t],e):!1}function s_(e){return typeof e=="symbol"?1:e===null?2:e===void 0?3:e!==e?4:0}const ure=(e,t,n)=>{if(e!==t){const r=s_(e),i=s_(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 o5(e){return typeof e=="symbol"||e instanceof Symbol}const cre=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,fre=/^\w*$/;function hre(e,t){return Array.isArray(e)?!1:typeof e=="number"||typeof e=="boolean"||e==null||o5(e)?!0:typeof e=="string"&&(fre.test(e)||!cre.test(e))||t!=null}function dre(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)||hre(s)?s:{key:s,path:yA(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=ure(s.criteria[f],c.criteria[f],n[f]);if(d!==0)return d}return 0}).map(s=>s.original)}function ry(e,...t){const n=t.length;return n>1&&pw(e,t[0],t[1])?t=[]:n>2&&pw(t[0],t[1],t[2])&&(t=[t[0]]),dre(e,sre(t),["asc"])}var s5=e=>e.legend.settings,pre=e=>e.legend.size,mre=e=>e.legend.payload,gre=W([mre,s5],(e,t)=>{var n=t.itemSorter,r=e.flat(1);return n?ry(r,n):r});function vre(){return we(gre)}function yre(e,t){return wre(e)||Sre(e,t)||xre(e,t)||bre()}function bre(){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 xre(e,t){if(e){if(typeof e=="string")return u_(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)?u_(e,t):void 0}}function u_(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 Sre(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 wre(e){if(Array.isArray(e))return e}var ym=1;function c_(e,t){return Math.abs(e.height-t.height)>ym||Math.abs(e.left-t.left)>ym||Math.abs(e.top-t.top)>ym||Math.abs(e.width-t.width)>ym}function f_(e){var t=e.getBoundingClientRect();return{height:t.height,left:t.left,top:t.top,width:t.width}}function u5(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=O.useState({height:0,left:0,top:0,width:0}),n=yre(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=f_(c);if(c_(f,l.current)&&i(f),typeof ResizeObserver<"u"){var d=new ResizeObserver(()=>{var p=f_(c);c_(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 Ore=typeof Symbol=="function"&&Symbol.observable||"@@observable",h_=Ore,a1=()=>Math.random().toString(36).substring(7).split("").join("."),Are={INIT:`@@redux/INIT${a1()}`,REPLACE:`@@redux/REPLACE${a1()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${a1()}`},$g=Are;function wA(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 c5(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(c5)(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 E=s++;return l.set(E,w),function(){if(A){if(c)throw new Error(bn(6));A=!1,f(),l.delete(E),a=null}}}function g(w){if(!wA(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(E=>{E()}),w}function v(w){if(typeof w!="function")throw new Error(bn(10));r=w,g({type:$g.REPLACE})}function y(){const w=p;return{subscribe(A){if(typeof A!="object"||A===null)throw new Error(bn(11));function E(){const M=A;M.next&&M.next(d())}return E(),{unsubscribe:w(E)}},[h_](){return this}}}return g({type:$g.INIT}),{dispatch:g,subscribe:p,getState:d,replaceReducer:v,[h_]:y}}function kre(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:$g.INIT})>"u")throw new Error(bn(12));if(typeof n(void 0,{type:$g.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(bn(13))})}function f5(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{kre(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 Ug(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function Cre(...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=Ug(...s)(i.dispatch),{...i,dispatch:a}}}function h5(e){return wA(e)&&"type"in e&&typeof e.type=="string"}var d5=Symbol.for("immer-nothing"),d_=Symbol.for("immer-draftable"),Gn=Symbol.for("immer-state");function di(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Pr=Object,tc=Pr.getPrototypeOf,Hg="constructor",iy="prototype",mw="configurable",Fg="enumerable",Qm="writable",Rh="value",Xa=e=>!!e&&!!e[Gn];function Oi(e){return e?p5(e)||ly(e)||!!e[d_]||!!e[Hg]?.[d_]||oy(e)||sy(e):!1}var Ere=Pr[iy][Hg].toString(),p_=new WeakMap;function p5(e){if(!e||!OA(e))return!1;const t=tc(e);if(t===null||t===Pr[iy])return!0;const n=Pr.hasOwnProperty.call(t,Hg)&&t[Hg];if(n===Object)return!0;if(!wu(n))return!1;let r=p_.get(n);return r===void 0&&(r=Function.toString.call(n),p_.set(n,r)),r===Ere}function ay(e,t,n=!0){id(e)===0?(n?Reflect.ownKeys(e):Pr.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function id(e){const t=e[Gn];return t?t.type_:ly(e)?1:oy(e)?2:sy(e)?3:0}var l1=(e,t,n=id(e))=>n===2?e.has(t):Pr[iy].hasOwnProperty.call(e,t),gw=(e,t,n=id(e))=>n===2?e.get(t):e[t],qg=(e,t,n,r=id(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function Tre(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var ly=Array.isArray,oy=e=>e instanceof Map,sy=e=>e instanceof Set,OA=e=>typeof e=="object",wu=e=>typeof e=="function",o1=e=>typeof e=="boolean";function Mre(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var $i=e=>e.copy_||e.base_,AA=e=>e.modified_?e.copy_:e.base_;function vw(e,t){if(oy(e))return new Map(e);if(sy(e))return new Set(e);if(ly(e))return Array[iy].slice.call(e);const n=p5(e);if(t===!0||t==="class_only"&&!n){const r=Pr.getOwnPropertyDescriptors(e);delete r[Gn];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const l=i[a],s=r[l];s[Qm]===!1&&(s[Qm]=!0,s[mw]=!0),(s.get||s.set)&&(r[l]={[mw]:!0,[Qm]:!0,[Fg]:s[Fg],[Rh]:e[l]})}return Pr.create(tc(e),r)}else{const r=tc(e);if(r!==null&&n)return{...e};const i=Pr.create(r);return Pr.assign(i,e)}}function kA(e,t=!1){return uy(e)||Xa(e)||!Oi(e)||(id(e)>1&&Pr.defineProperties(e,{set:bm,add:bm,clear:bm,delete:bm}),Pr.freeze(e),t&&ay(e,(n,r)=>{kA(r,!0)},!1)),e}function Pre(){di(2)}var bm={[Rh]:Pre};function uy(e){return e===null||!OA(e)?!0:Pr.isFrozen(e)}var Wg="MapSet",yw="Patches",m_="ArrayMethods",m5={};function ds(e){const t=m5[e];return t||di(0,e),t}var g_=e=>!!m5[e],jh,g5=()=>jh,Dre=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:g_(Wg)?ds(Wg):void 0,arrayMethodsPlugin_:g_(m_)?ds(m_):void 0});function v_(e,t){t&&(e.patchPlugin_=ds(yw),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function bw(e){xw(e),e.drafts_.forEach(_re),e.drafts_=null}function xw(e){e===jh&&(jh=e.parent_)}var y_=e=>jh=Dre(jh,e);function _re(e){const t=e[Gn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function b_(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[Gn].modified_&&(bw(t),di(4)),Oi(e)&&(e=x_(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[Gn].base_,e,t)}else e=x_(t,n);return Nre(t,e,!0),bw(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==d5?e:void 0}function x_(e,t){if(uy(t))return t;const n=t[Gn];if(!n)return Vg(t,e.handledSet_,e);if(!cy(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);b5(n,e)}return n.copy_}function Nre(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&kA(t,n)}function v5(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var cy=(e,t)=>e.scope_===t,Rre=[];function y5(e,t,n,r){const i=$i(e),a=e.type_;if(r!==void 0&&gw(i,r,a)===t){qg(i,r,n,a);return}if(!e.draftLocations_){const s=e.draftLocations_=new Map;ay(i,(c,f)=>{if(Xa(f)){const d=s.get(f)||[];d.push(c),s.set(f,d)}})}const l=e.draftLocations_.get(t)??Rre;for(const s of l)qg(i,s,n,a)}function jre(e,t,n){e.callbacks_.push(function(i){const a=t;if(!a||!cy(a,i))return;i.mapSetPlugin_?.fixSetContents(a);const l=AA(a);y5(e,a.draft_??a,l,n),b5(a,i)})}function b5(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)}v5(e)}}function Lre(e,t,n){const{scope_:r}=e;if(Xa(n)){const i=n[Gn];cy(i,r)&&i.callbacks_.push(function(){Xm(e);const l=AA(i);y5(e,n,l,t)})}else Oi(n)&&e.callbacks_.push(function(){const a=$i(e);e.type_===3?a.has(n)&&Vg(n,r.handledSet_,r):gw(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Vg(gw(e.copy_,t,e.type_),r.handledSet_,r)})}function Vg(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Xa(e)||t.has(e)||!Oi(e)||uy(e)||(t.add(e),ay(e,(r,i)=>{if(Xa(i)){const a=i[Gn];if(cy(a,n)){const l=AA(a);qg(e,r,l,e.type_),v5(a)}}else Oi(i)&&Vg(i,t,n)})),e}function Ire(e,t){const n=ly(e),r={type_:n?1:0,scope_:t?t.scope_:g5(),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=Kg;n&&(i=[r],a=Lh);const{revoke:l,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=l,[s,r]}var Kg={get(e,t){if(t===Gn)return e;if(t==="constructor"||t==="__proto__"){const s=$i(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=$i(e);if(!l1(i,t,e.type_))return Bre(e,i,t);const a=i[t];if(e.finalized_||!Oi(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Mre(t))return a;if(a===s1(e.base_,t)){Xm(e);const l=e.type_===1?+t:t,s=ww(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 $i(e)},ownKeys(e){return Reflect.ownKeys($i(e))},set(e,t,n){if(t==="constructor"||t==="__proto__"||t==="prototype")return!0;const r=x5($i(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=s1($i(e),t),a=i?.[Gn];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(Tre(n,i)&&(n!==void 0||l1(e.base_,t,e.type_)))return!0;Xm(e),Sw(e)}return e.copy_[t]===n&&(n!==void 0||l1(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),Lre(e,t,n)),!0},deleteProperty(e,t){return Xm(e),s1(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Sw(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=$i(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Qm]:!0,[mw]:e.type_!==1||t!=="length",[Fg]:r[Fg],[Rh]:n[t]}},defineProperty(){di(11)},getPrototypeOf(e){return tc(e.base_)},setPrototypeOf(){di(12)}},Lh={};for(let e in Kg){let t=Kg[e];Lh[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Lh.deleteProperty=function(e,t){return Lh.set.call(this,e,t,void 0)};Lh.set=function(e,t,n){return Kg.set.call(this,e[0],t,n,e[0])};function s1(e,t){const n=e[Gn];return(n?$i(n):e)[t]}function Bre(e,t,n){const r=x5(t,n);return r?Rh in r?r[Rh]:r.get?.call(e.draft_):void 0}function x5(e,t){if(!(t in e))return;let n=tc(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=tc(n)}}function Sw(e){e.modified_||(e.modified_=!0,e.parent_&&Sw(e.parent_))}function Xm(e){e.copy_||(e.assigned_=new Map,e.copy_=vw(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var zre=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,n,r)=>{if(wu(t)&&!wu(n)){const a=n;n=t;const l=this;return function(c=a,...f){return l.produce(c,d=>n.call(this,d,...f))}}wu(n)||di(6),r!==void 0&&!wu(r)&&di(7);let i;if(Oi(t)){const a=y_(this),l=ww(a,t,void 0);let s=!0;try{i=n(l),s=!1}finally{s?bw(a):xw(a)}return v_(a,r),b_(i,a)}else if(!t||!OA(t)){if(i=n(t),i===void 0&&(i=t),i===d5&&(i=void 0),this.autoFreeze_&&kA(i,!0),r){const a=[],l=[];ds(yw).generateReplacementPatches_(t,i,{patches_:a,inversePatches_:l}),r(a,l)}return i}else di(1,t)},this.produceWithPatches=(t,n)=>{if(wu(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]},o1(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),o1(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),o1(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Oi(e)||di(8),Xa(e)&&(e=Jr(e));const t=y_(this),n=ww(t,e,void 0);return n[Gn].isManual_=!0,xw(t),n}finishDraft(e,t){const n=e&&e[Gn];(!n||!n.isManual_)&&di(9);const{scope_:r}=n;return v_(r,t),b_(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=ds(yw).applyPatches_;return Xa(e)?r(e,t):this.produce(e,i=>r(i,t))}};function ww(e,t,n,r){const[i,a]=oy(t)?ds(Wg).proxyMap_(t,n):sy(t)?ds(Wg).proxySet_(t,n):Ire(t,n);return(n?.scope_??g5()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?jre(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 Jr(e){return Xa(e)||di(10,e),S5(e)}function S5(e){if(!Oi(e)||uy(e))return e;const t=e[Gn];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=vw(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=vw(e,!0);return ay(n,(i,a)=>{qg(n,i,S5(a))},r),t&&(t.finalized_=!1),n}var $re=new zre,w5=$re.produce,Ye=e=>e;function O5(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var Ure=O5(),Hre=O5,Fre=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Ug:Ug.apply(null,arguments)};function Rr(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(Dr(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=>h5(r)&&r.type===e,n}var A5=class Vf extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Vf.prototype)}static get[Symbol.species](){return Vf}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Vf(...t[0].concat(this)):new Vf(...t.concat(this))}};function S_(e){return Oi(e)?w5(e,()=>{}):e}function xm(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function qre(e){return typeof e=="boolean"}var Wre=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let l=new A5;return n&&(qre(n)?l.push(Ure):l.push(Hre(n.extraArgument))),l},k5="RTK_autoBatch",bt=()=>e=>({payload:e,meta:{[k5]:!0}}),w_=e=>t=>{setTimeout(t,e)},Vre=(e,t)=>n=>{let r=!1;const i=()=>{r||(r=!0,cancelAnimationFrame(a),clearTimeout(l),n())},a=e(i),l=setTimeout(i,t)},C5=(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?Vre(window.requestAnimationFrame,100):w_(10):e.type==="callback"?e.queueNotification:w_(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?.[k5],a=!i,a&&(l||(l=!0,c(f))),r.dispatch(d)}finally{i=!0}}})},Kre=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new A5(e);return r&&i.push(C5(typeof r=="object"?r:void 0)),i};function Qre(e){const t=Wre(),{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(wA(n))s=f5(n);else throw new Error(Dr(1));let c;typeof r=="function"?c=r(t):c=t();let f=Ug;i&&(f=Fre({trace:!1,...typeof i=="object"&&i}));const d=Cre(...c),p=Kre(d);let g=typeof l=="function"?l(p):p();const v=f(...g);return c5(s,a,v)}function E5(e){const t={},n=[];let r;const i={addCase(a,l){const s=typeof a=="string"?a:a.type;if(!s)throw new Error(Dr(28));if(s in t)throw new Error(Dr(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 Xre(e){return typeof e=="function"}function Yre(e,t){let[n,r,i]=E5(t),a;if(Xre(e))a=()=>S_(e());else{const s=S_(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(Xa(d)){const v=p(d,c);return v===void 0?d:v}else{if(Oi(d))return w5(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 Gre="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Zre=(e=21)=>{let t="",n=e;for(;n--;)t+=Gre[Math.random()*64|0];return t},Jre=Symbol.for("rtk-slice-createasyncthunk");function eie(e,t){return`${e}/${t}`}function tie({creators:e}={}){const t=e?.asyncThunk?.[Jre];return function(r){const{name:i,reducerPath:a=i}=r;if(!i)throw new Error(Dr(11));const l=(typeof r.reducers=="function"?r.reducers(rie()):r.reducers)||{},s=Object.keys(l),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(k,M){const D=typeof k=="string"?k:k.type;if(!D)throw new Error(Dr(12));if(D in c.sliceCaseReducersByType)throw new Error(Dr(13));return c.sliceCaseReducersByType[D]=M,f},addMatcher(k,M){return c.sliceMatchers.push({matcher:k,reducer:M}),f},exposeAction(k,M){return c.actionCreators[k]=M,f},exposeCaseReducer(k,M){return c.sliceCaseReducersByName[k]=M,f}};s.forEach(k=>{const M=l[k],D={reducerName:k,type:eie(i,k),createNotation:typeof r.reducers=="function"};aie(M)?oie(D,M,f,t):iie(D,M,f)});function d(){const[k={},M=[],D=void 0]=typeof r.extraReducers=="function"?E5(r.extraReducers):[r.extraReducers],P={...k,...c.sliceCaseReducersByType};return Yre(r.initialState,N=>{for(let L in P)N.addCase(L,P[L]);for(let L of c.sliceMatchers)N.addMatcher(L.matcher,L.reducer);for(let L of M)N.addMatcher(L.matcher,L.reducer);D&&N.addDefaultCase(D)})}const p=k=>k,g=new Map,v=new WeakMap;let y;function x(k,M){return y||(y=d()),y(k,M)}function w(){return y||(y=d()),y.getInitialState()}function A(k,M=!1){function D(N){let L=N[k];return typeof L>"u"&&M&&(L=xm(v,D,w)),L}function P(N=p){const L=xm(g,M,()=>new WeakMap);return xm(L,N,()=>{const U={};for(const[K,V]of Object.entries(r.selectors??{}))U[K]=nie(V,N,()=>xm(v,N,w),M);return U})}return{reducerPath:k,getSelectors:P,get selectors(){return P(D)},selectSlice:D}}const E={name:i,reducer:x,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:w,...A(a),injectInto(k,{reducerPath:M,...D}={}){const P=M??a;return k.inject({reducerPath:P,reducer:x},D),{...E,...A(P,!0)}}};return E}}function nie(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 Bn=tie();function rie(){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 iie({type:e,reducerName:t,createNotation:n},r,i){let a,l;if("reducer"in r){if(n&&!lie(r))throw new Error(Dr(17));a=r.reducer,l=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,l?Rr(e,l):Rr(e))}function aie(e){return e._reducerDefinitionType==="asyncThunk"}function lie(e){return e._reducerDefinitionType==="reducerWithPrepare"}function oie({type:e,reducerName:t},n,r,i){if(!i)throw new Error(Dr(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||Sm,pending:s||Sm,rejected:c||Sm,settled:f||Sm})}function Sm(){}var sie="task",T5="listener",M5="completed",CA="cancelled",uie=`task-${CA}`,cie=`task-${M5}`,Ow=`${T5}-${CA}`,fie=`${T5}-${M5}`,fy=class{constructor(e){this.code=e,this.message=`${sie} ${CA} (reason: ${e})`}code;name="TaskAbortError";message},EA=(e,t)=>{if(typeof e!="function")throw new TypeError(Dr(32))},Qg=()=>{},P5=(e,t=Qg)=>(e.catch(t),e),D5=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),es=e=>{if(e.aborted)throw new fy(e.reason)};function _5(e,t){let n=Qg;return new Promise((r,i)=>{const a=()=>i(new fy(e.reason));if(e.aborted){a();return}n=D5(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Qg})}var hie=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof fy?"cancelled":"rejected",error:n}}finally{t?.()}},Xg=e=>t=>P5(_5(e,t).then(n=>(es(e),n))),N5=e=>{const t=Xg(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:$u}=Object,O_={},hy="listenerMiddleware",die=(e,t)=>{const n=r=>D5(e,()=>r.abort(e.reason));return(r,i)=>{EA(r);const a=new AbortController;n(a);const l=hie(async()=>{es(e),es(a.signal);const s=await r({pause:Xg(a.signal),delay:N5(a.signal),signal:a.signal});return es(a.signal),s},()=>a.abort(cie));return i?.autoJoin&&t.push(l.catch(Qg)),{result:Xg(e)(l),cancel(){a.abort(uie)}}}},pie=(e,t)=>{const n=async(r,i)=>{es(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 _5(t,Promise.race(s));return es(t),c}finally{a()}};return((r,i)=>P5(n(r,i)))},R5=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=Rr(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(Dr(21));return EA(a),{predicate:i,type:t,effect:a}},j5=$u(e=>{const{type:t,predicate:n,effect:r}=R5(e);return{id:Zre(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Dr(22))}}},{withTypes:()=>j5}),A_=(e,t)=>{const{type:n,effect:r,predicate:i}=R5(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},Aw=e=>{e.pending.forEach(t=>{t.abort(Ow)})},mie=(e,t)=>()=>{for(const n of t.keys())Aw(n);e.clear()},k_=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},L5=$u(Rr(`${hy}/add`),{withTypes:()=>L5}),gie=Rr(`${hy}/removeAll`),I5=$u(Rr(`${hy}/remove`),{withTypes:()=>I5}),vie=(...e)=>{console.error(`${hy}/error`,...e)},ad=(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=vie}=e;EA(l);const s=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),y=>{v.unsubscribe(),y?.cancelActive&&Aw(v)}),c=(v=>{const y=A_(t,v)??j5(v);return s(y)});$u(c,{withTypes:()=>c});const f=v=>{const y=A_(t,v);return y&&(y.unsubscribe(),v.cancelActive&&Aw(y)),!!y};$u(f,{withTypes:()=>f});const d=async(v,y,x,w)=>{const A=new AbortController,E=pie(c,A.signal),k=[];try{v.pending.add(A),r(v),await Promise.resolve(v.effect(y,$u({},x,{getOriginalState:w,condition:(M,D)=>E(M,D).then(Boolean),take:E,delay:N5(A.signal),pause:Xg(A.signal),extra:a,signal:A.signal,fork:die(A.signal,k),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((M,D,P)=>{M!==A&&(M.abort(Ow),P.delete(M))})},cancel:()=>{A.abort(Ow),v.pending.delete(A)},throwIfCancelled:()=>{es(A.signal)}})))}catch(M){M instanceof fy||k_(l,M,{raisedBy:"effect"})}finally{await Promise.all(k),A.abort(fie),i(v),v.pending.delete(A)}},p=mie(t,n);return{middleware:v=>y=>x=>{if(!h5(x))return y(x);if(L5.match(x))return c(x.payload);if(gie.match(x)){p();return}if(I5.match(x))return f(x.payload);let w=v.getState();const A=()=>{if(w===O_)throw new Error(Dr(23));return w};let E;try{if(E=y(x),t.size>0){const k=v.getState(),M=Array.from(t.values());for(const D of M){let P=!1;try{P=D.predicate(x,k,w)}catch(N){P=!1,k_(l,N,{raisedBy:"predicate"})}P&&d(D,x,v,A)}}}finally{w=O_}return E},startListening:c,stopListening:f,clearListeners:p}};function Dr(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 yie={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},B5=Bn({name:"chartLayout",initialState:yie,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}}}),dy=B5.actions,bie=dy.setMargin,xie=dy.setLayout,Sie=dy.setChartSize,wie=dy.setScale,Oie=B5.reducer;function z5(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function We(e){return Number.isFinite(e)}function ia(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function C_(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 Eu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?C_(Object(n),!0).forEach(function(r){Aie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Aie(e,t,n){return(t=kie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kie(e){var t=Cie(e,"string");return typeof t=="symbol"?t:t+""}function Cie(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 zt(e,t,n){return kt(e)||kt(t)?n:ra(t)?Qa(e,t,n):typeof t=="function"?t(e):n}var Eie=(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 Eu(Eu({},e),{},{[a]:e[a]+(r||0)});if((s==="horizontal"||s==="vertical"&&a==="center")&&l!=="middle"&&be(e[l]))return Eu(Eu({},e),{},{[l]:e[l]+(i||0)})}return e},el=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",$5=(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},U5=(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?cr(a[0]-a[1])*2*x:x,p||g){var w=(p||g||[]).map((A,E)=>{var k=r?r.indexOf(A):A,M=l.map(k);return We(M)?{coordinate:M+x,value:A,offset:x,index:E}:null}).filter(fr);return w}return c&&f?f.map((A,E)=>{var k=l.map(A);return We(k)?{coordinate:k+x,value:A,index:E,offset:x}:null}).filter(fr):l.ticks&&d!=null?l.ticks(d).map((A,E)=>{var k=l.map(A);return We(k)?{coordinate:k+x,value:A,index:E,offset:x}:null}).filter(fr):l.domain().map((A,E)=>{var k=l.map(A);return We(k)?{coordinate:k+x,value:r?r[A]:A,index:E,offset:x}:null}).filter(fr)},Tie=(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},Mie=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=na(d)?p:d;g>=0?(f[0]=a,a+=g,f[1]=a):(f[0]=l,l+=g,f[1]=l)}}}},Pie=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=na(c[1])?c[0]:c[1];f>=0?(c[0]=a,a+=f,c[1]=a):(c[0]=0,c[1]=0)}}}},Die={sign:Mie,expand:Mte,none:fs,silhouette:Pte,wiggle:Dte,positive:Pie},_ie=(e,t,n)=>{var r,i=(r=Die[n])!==null&&r!==void 0?r:fs,a=Tte().keys(t).value((s,c)=>Number(zt(s,c,0))).order(uw).offset(i),l=a(e);return l.forEach((s,c)=>{s.forEach((f,d)=>{var p=zt(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 Nie(e){return e==null?void 0:String(e)}function E_(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=Hz(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=zt(i,kt(l)?t.dataKey:l),f=t.scale.map(c);return be(f)?f:null}var T_=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=zt(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},Rie=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]},jie=e=>{var t=e.flat(2).filter(be);return[Math.min(...t),Math.max(...t)]},Lie=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],Iie=(e,t,n)=>{if(!(e==null||Object.keys(e).length===0))return Lie(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=z5(f,t,n),p=jie(d);return!We(p[0])||!We(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]))},M_=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,P_=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,nc=(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=ry(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 D_(e){var t=e.tooltipEntrySettings,n=e.dataKey,r=e.payload,i=e.value,a=e.name;return Eu(Eu({},t),{},{dataKey:n,payload:r,value:i,name:a})}function py(e,t){if(e!=null)return String(e);if(typeof t=="string")return t}var Bie=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},zie=(e,t)=>t==="centric"?e.angle:e.radius,tl=e=>e.layout.width,nl=e=>e.layout.height,$ie=e=>e.layout.scale,H5=e=>e.layout.margin,my=W(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),gy=W(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),Uie="data-recharts-item-index",Hie="data-recharts-item-id",ld=60;function __(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?__(Object(n),!0).forEach(function(r){Fie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):__(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fie(e,t,n){return(t=qie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qie(e){var t=Wie(e,"string");return typeof t=="symbol"?t:t+""}function Wie(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 Vie=e=>e.brush.height;function Kie(e){var t=gy(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:ld;return n+i}return n},0)}function Qie(e){var t=gy(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:ld;return n+i}return n},0)}function Xie(e){var t=my(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function Yie(e){var t=my(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var un=W([tl,nl,H5,Vie,Kie,Qie,Xie,Yie,s5,pre],(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=wm(wm({},p),d),v=g.bottom;g.bottom+=r,g=Eie(g,c,f);var y=e-g.left-g.right,x=t-g.top-g.bottom;return wm(wm({brushBottom:v},g),{},{width:Math.max(y,0),height:Math.max(x,0)})}),Gie=W(un,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),TA=W(tl,nl,(e,t)=>({x:0,y:0,width:e,height:t})),Zie=O.createContext(null),zn=()=>O.useContext(Zie)!=null,vy=e=>e.brush,yy=W([vy,un,H5],(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 Jie(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 eae(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=Jie(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 tae(e,t=0,n={}){const{leading:r=!0,trailing:i=!0}=n;return eae(e,t,{leading:r,maxWait:t,trailing:i})}var Yg=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++]))}},Yi={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},F5=(e,t,n)=>{var r=n.width,i=r===void 0?Yi.width:r,a=n.height,l=a===void 0?Yi.height:a,s=n.aspect,c=n.maxHeight,f=hs(i)?e:Number(i),d=hs(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}},nae={width:0,height:0,overflow:"visible"},rae={width:0,overflowX:"visible"},iae={height:0,overflowY:"visible"},aae={},lae=e=>{var t=e.width,n=e.height,r=hs(t),i=hs(n);return r&&i?nae:r?rae:i?iae:aae};function oae(e){var t=e.width,n=e.height,r=e.aspect,i=t,a=n;return i===void 0&&a===void 0?(i=Yi.width,a=Yi.height):i===void 0?i=r&&r>0?void 0:Yi.width:a===void 0&&(a=r&&r>0?void 0:Yi.height),{width:i,height:a}}var sae=["aspect","initialDimension","width","height","minWidth","minHeight","maxHeight","children","debounce","id","className","onResize","style"];function Gg(){return Gg=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},Gg.apply(null,arguments)}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 R_(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){uae(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 uae(e,t,n){return(t=cae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cae(e){var t=fae(e,"string");return typeof t=="symbol"?t:t+""}function fae(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 hae(e,t){return gae(e)||mae(e,t)||pae(e,t)||dae()}function dae(){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 pae(e,t){if(e){if(typeof e=="string")return j_(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)?j_(e,t):void 0}}function j_(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 mae(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 gae(e){if(Array.isArray(e))return e}function vae(e,t){if(e==null)return{};var n,r,i=yae(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 yae(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 q5=O.createContext(Yi.initialDimension);function bae(e){return ia(e.width)&&ia(e.height)}function W5(e){var t=e.children,n=e.width,r=e.height,i=O.useMemo(()=>({width:n,height:r}),[n,r]);return bae(i)?O.createElement(q5.Provider,{value:i},t):null}var MA=()=>O.useContext(q5),xae=O.forwardRef((e,t)=>{var n=e.aspect,r=e.initialDimension,i=r===void 0?Yi.initialDimension:r,a=e.width,l=e.height,s=e.minWidth,c=s===void 0?Yi.minWidth:s,f=e.minHeight,d=e.maxHeight,p=e.children,g=e.debounce,v=g===void 0?Yi.debounce:g,y=e.id,x=e.className,w=e.onResize,A=e.style,E=A===void 0?{}:A,k=vae(e,sae),M=O.useRef(null),D=O.useRef();D.current=w,O.useImperativeHandle(t,()=>M.current);var P=O.useState({containerWidth:i.width,containerHeight:i.height}),N=hae(P,2),L=N[0],U=N[1],K=O.useCallback((z,Z)=>{U(ae=>{var Q=Math.round(z),le=Math.round(Z);return ae.containerWidth===Q&&ae.containerHeight===le?ae:{containerWidth:Q,containerHeight:le}})},[]);O.useEffect(()=>{if(M.current==null||typeof ResizeObserver>"u")return bs;var z=R=>{var F,ee=R[0];if(ee!=null){var se=ee.contentRect,ge=se.width,Oe=se.height;K(ge,Oe),(F=D.current)===null||F===void 0||F.call(D,ge,Oe)}};v>0&&(z=tae(z,v,{trailing:!0,leading:!1}));var Z=new ResizeObserver(z),ae=M.current.getBoundingClientRect(),Q=ae.width,le=ae.height;return K(Q,le),Z.observe(M.current),()=>{Z.disconnect()}},[K,v]);var V=L.containerWidth,B=L.containerHeight;Yg(!n||n>0,"The aspect(%s) must be greater than zero.",n);var oe=F5(V,B,{width:a,height:l,aspect:n,maxHeight:d}),ie=oe.calculatedWidth,ue=oe.calculatedHeight;return Yg(V<0||B<0||ie!=null&&ie>0||ue!=null&&ue>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,ue,a,l,c,f,n),O.createElement("div",Gg({id:y?"".concat(y):void 0,className:st("recharts-responsive-container",x),style:R_(R_({},E),{},{width:a,height:l,minWidth:c,minHeight:f,maxHeight:d}),ref:M},k),O.createElement("div",{style:lae({width:a,height:l})},O.createElement(W5,{width:ie,height:ue},p)))}),L_=O.forwardRef((e,t)=>{var n=MA();if(ia(n.width)&&ia(n.height))return e.children;var r=oae({width:e.width,height:e.height,aspect:e.aspect}),i=r.width,a=r.height,l=F5(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(W5,{width:s,height:c},e.children):O.createElement(xae,Gg({},e,{width:i,height:a,ref:t}))});function PA(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 by=()=>{var e,t=zn(),n=we(Gie),r=we(yy),i=(e=we(vy))===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}},Sae={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},V5=()=>{var e;return(e=we(un))!==null&&e!==void 0?e:Sae},DA=()=>we(tl),_A=()=>we(nl),wae=()=>we(e=>e.layout.margin),nt=e=>e.layout.layoutType,xs=()=>we(nt),K5=()=>{var e=xs();if(e==="horizontal"||e==="vertical")return e},Q5=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},Oae=()=>{var e=xs();return e!==void 0},od=e=>{var t=St(),n=zn(),r=e.width,i=e.height,a=MA(),l=r,s=i;return a&&(l=a.width>0?a.width:r,s=a.height>0?a.height:i),O.useEffect(()=>{!n&&ia(l)&&ia(s)&&t(Sie({width:l,height:s}))},[t,n,l,s]),null},Aae={settings:{layout:"horizontal",align:"center",verticalAlign:"bottom",itemSorter:"value"},size:{width:0,height:0},payload:[]},X5=Bn({name:"legend",initialState:Aae,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=Jr(e).payload.indexOf(Ye(r));a>-1&&(e.payload[a]=Ye(i))},prepare:bt()},removeLegendPayload:{reducer(e,t){var n=Jr(e).payload.indexOf(Ye(t.payload));n>-1&&e.payload.splice(n,1)},prepare:bt()}}}),sd=X5.actions,I_=sd.setLegendSize,kae=sd.setLegendSettings,Cae=sd.addLegendPayload,Eae=sd.replaceLegendPayload,Tae=sd.removeLegendPayload,Mae=X5.reducer,u1={exports:{}},c1={};var B_;function Pae(){if(B_)return c1;B_=1;var e=uc();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 c1.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(D){if(!A){if(A=!0,E=D,D=p(D),g!==void 0&&y.hasValue){var P=y.value;if(g(P,D))return k=P}return k=D}if(P=k,n(E,D))return P;var N=p(D);return g!==void 0&&g(P,N)?(E=D,P):(E=D,k=N)}var A=!1,E,k,M=d===void 0?null:d;return[function(){return w(f())},M===null?void 0:function(){return w(M())}]},[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},c1}var z_;function Dae(){return z_||(z_=1,u1.exports=Pae()),u1.exports}Dae();function _ae(e){e()}function Nae(){let e=null,t=null;return{clear(){e=null,t=null},notify(){_ae(()=>{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 $_={notify(){},get:()=>[]};function Rae(e,t){let n,r=$_,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=Nae())}function p(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=$_)}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 jae=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Lae=jae(),Iae=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Bae=Iae(),zae=()=>Lae||Bae?O.useLayoutEffect:O.useEffect,$ae=zae();function U_(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function Uae(e,t){if(U_(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])||!U_(e[n[i]],t[n[i]]))return!1;return!0}var Hae=Symbol.for("react-redux-context"),Fae=typeof globalThis<"u"?globalThis:{};function qae(){if(!O.createContext)return{};const e=Fae[Hae]??=new Map;let t=e.get(O.createContext);return t||(t=O.createContext(null),e.set(O.createContext,t)),t}var Wae=qae();function Vae(e){const{children:t,context:n,serverState:r,store:i}=e,a=O.useMemo(()=>{const c=Rae(i);return{store:i,subscription:c,getServerState:r?()=>r:void 0}},[i,r]),l=O.useMemo(()=>i.getState(),[i]);$ae(()=>{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||Wae;return O.createElement(s.Provider,{value:a},t)}var Kae=Vae,Qae=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function Xae(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function vc(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(Qae.has(r)){if(e[r]==null&&t[r]==null)continue;if(!Uae(e[r],t[r]))return!1}else if(!Xae(e[r],t[r]))return!1;return!0}var Yae=["contextPayload"];function kw(){return kw=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},kw.apply(null,arguments)}function Gae(e,t){return tle(e)||ele(e,t)||Jae(e,t)||Zae()}function Zae(){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 Jae(e,t){if(e){if(typeof e=="string")return H_(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)?H_(e,t):void 0}}function H_(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 ele(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 tle(e){if(Array.isArray(e))return e}function F_(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 rc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?F_(Object(n),!0).forEach(function(r){nle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nle(e,t,n){return(t=rle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rle(e){var t=ile(e,"string");return typeof t=="symbol"?t:t+""}function ile(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 ale(e,t){if(e==null)return{};var n,r,i=lle(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 lle(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 ole(e){return e.value}function sle(e){var t=e.contextPayload,n=ale(e,Yae),r=i5(t,e.payloadUniqBy,ole),i=rc(rc({},n),{},{payload:r});return O.isValidElement(e.content)?O.cloneElement(e.content,i):typeof e.content=="function"?O.createElement(e.content,i):O.createElement(rne,i)}function ule(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}),rc(rc({},f),d)}function cle(e){var t=e.align,n=e.layout,r=e.verticalAlign,i=e.itemSorter,a=St();return O.useLayoutEffect(()=>{a(kae({align:t,layout:n,verticalAlign:r,itemSorter:i}))},[a,t,n,r,i]),null}function fle(e){var t=e.width,n=e.height,r=St();return O.useLayoutEffect(()=>{r(I_({width:t,height:n}))},[r,t,n]),O.useLayoutEffect(()=>()=>{r(I_({width:0,height:0}))},[r]),null}function hle(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var dle={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",labelStyle:{},layout:"horizontal",verticalAlign:"bottom"};function ple(e){var t=In(e,dle),n=vre(),r=Zee(),i=wae(),a=t.width,l=t.height,s=t.wrapperStyle,c=t.portal,f=u5([n]),d=Gae(f,2),p=d[0],g=d[1],v=DA(),y=_A();if(v==null||y==null)return null;var x=v-(i?.left||0)-(i?.right||0),w=hle(t.layout,l,a,x),A=c?s:rc(rc({position:"absolute",width:w?.width||a||"auto",height:w?.height||l||"auto"},ule(s,t,i,v,y,p)),s),E=c??r;if(E==null||n==null)return null;var k=O.createElement("div",{className:"recharts-legend-wrapper",style:A,ref:g},O.createElement(cle,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!c&&O.createElement(fle,{width:p.width,height:p.height}),O.createElement(sle,kw({},t,w,{margin:i,chartWidth:v,chartHeight:y,contextPayload:n})));return pO.createPortal(k,E)}var Y5=O.memo(ple,vc);Y5.displayName="Legend";function Cw(){return Cw=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},Cw.apply(null,arguments)}function q_(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 Pf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?q_(Object(n),!0).forEach(function(r){mle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mle(e,t,n){return(t=gle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gle(e){var t=vle(e,"string");return typeof t=="symbol"?t:t+""}function vle(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 yle(e,t){return wle(e)||Sle(e,t)||xle(e,t)||ble()}function ble(){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 xle(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 Sle(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 wle(e){if(Array.isArray(e))return e}function Ole(e){return Array.isArray(e)&&ra(e[0])&&ra(e[1])?e.join(" ~ "):e}var cu={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 Ale(e,t){return t==null?e:ry(e,t)}var kle=e=>{var t=e.separator,n=t===void 0?cu.separator:t,r=e.contentStyle,i=e.itemStyle,a=e.labelStyle,l=a===void 0?cu.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?cu.accessibilityLayer:y,w=()=>{if(s&&s.length){var L={padding:0,margin:0},U=Ale(s,f),K=U.map((V,B)=>{if(!V||V.type==="none")return null;var oe=V.formatter||c||Ole,ie=V.value,ue=V.name,z=ie,Z=ue;if(oe){var ae=oe(ie,ue,V,B,s);if(Array.isArray(ae)){var Q=yle(ae,2);z=Q[0],Z=Q[1]}else if(ae!=null)z=ae;else return null}var le=Pf(Pf({},cu.itemStyle),{},{color:V.color||cu.itemStyle.color},i);return O.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(B),style:le},ra(Z)?O.createElement("span",{className:"recharts-tooltip-item-name"},Z):null,ra(Z)?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=Pf(Pf({},cu.contentStyle),r),E=Pf({margin:0},l),k=!kt(g),M=k?g:"",D=st("recharts-default-tooltip",d),P=st("recharts-tooltip-label",p);k&&v&&s!==void 0&&s!==null&&(M=v(g,s));var N=x?{role:"status","aria-live":"assertive"}:{};return O.createElement("div",Cw({className:D,style:A},N),O.createElement("p",{className:P,style:E},O.isValidElement(M)?M:"".concat(M)),w())},Df="recharts-tooltip-wrapper",Cle={visibility:"hidden"};function Ele(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return st(Df,{["".concat(Df,"-right")]:be(n)&&t&&be(t.x)&&n>=t.x,["".concat(Df,"-left")]:be(n)&&t&&be(t.x)&&n<t.x,["".concat(Df,"-bottom")]:be(r)&&t&&be(t.y)&&r>=t.y,["".concat(Df,"-top")]:be(r)&&t&&be(t.y)&&r<t.y})}function V_(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 Tle(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 Mle(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=V_({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:l,tooltipDimension:s.width,viewBox:f,viewBoxDimension:f.width}),g=V_({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:l,tooltipDimension:s.height,viewBox:f,viewBoxDimension:f.height}),d=Tle({translateX:p,translateY:g,useTranslate3d:c})):d=Cle,{cssProperties:d,cssClasses:Ele({translateX:p,translateY:g,coordinate:n})}}var Ple=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),ud={isSsr:Ple()};function Dle(e,t){return jle(e)||Rle(e,t)||Nle(e,t)||_le()}function _le(){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 Nle(e,t){if(e){if(typeof e=="string")return K_(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)?K_(e,t):void 0}}function K_(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 Rle(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 jle(e){if(Array.isArray(e))return e}function G5(){var e=O.useState(()=>ud.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches),t=Dle(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 Q_(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?Q_(Object(n),!0).forEach(function(r){Lle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Q_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lle(e,t,n){return(t=Ile(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ile(e){var t=Ble(e,"string");return typeof t=="symbol"?t:t+""}function Ble(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 zle(e,t){return Fle(e)||Hle(e,t)||Ule(e,t)||$le()}function $le(){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 Ule(e,t){if(e){if(typeof e=="string")return X_(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)?X_(e,t):void 0}}function X_(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 Hle(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 Fle(e){if(Array.isArray(e))return e}function qle(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 Wle(e){var t,n,r,i,a,l,s=G5(),c=O.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}})),f=zle(c,2),d=f[0],p=f[1];O.useEffect(()=>{var A=E=>{if(E.key==="Escape"){var k,M,D,P;p({dismissed:!0,dismissedAtCoordinate:{x:(k=(M=e.coordinate)===null||M===void 0?void 0:M.x)!==null&&k!==void 0?k:0,y:(D=(P=e.coordinate)===null||P===void 0?void 0:P.y)!==null&&D!==void 0?D: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(fu(fu({},d),{},{dismissed:!1}));var g=Mle({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?{}:fu(fu({transition:qle({prefersReducedMotion:s,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},y),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),w=fu(fu({},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 Vle=O.memo(Wle),Z5=()=>{var e;return(e=we(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};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 Y_(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 G_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Y_(Object(n),!0).forEach(function(r){Kle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kle(e,t,n){return(t=Qle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qle(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)}var Z_={curveBasisClosed:vte,curveBasisOpen:yte,curveBasis:gte,curveBumpX:nte,curveBumpY:rte,curveLinearClosed:bte,curveLinear:ey,curveMonotoneX:xte,curveMonotoneY:Ste,curveNatural:wte,curveStep:Ote,curveStepAfter:kte,curveStepBefore:Ate},Zg=e=>We(e.x)&&We(e.y),J_=e=>e.base!=null&&Zg(e.base)&&Zg(e),_f=e=>e.x,Nf=e=>e.y,Yle=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(rd(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=Z_["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return Z_[n]||ey},eN={connectNulls:!1,type:"linear"},Gle=e=>{var t=e.type,n=t===void 0?eN.type:t,r=e.points,i=r===void 0?[]:r,a=e.baseLine,l=e.layout,s=e.connectNulls,c=s===void 0?eN.connectNulls:s,f=Yle(n,l),d=c?i.filter(Zg):i;if(Array.isArray(a)){var p,g=i.map((A,E)=>G_(G_({},A),{},{base:a[E]}));l==="vertical"?p=gm().y(Nf).x1(_f).x0(A=>A.base.x):p=gm().x(_f).y1(Nf).y0(A=>A.base.y);var v=p.defined(J_).curve(f),y=c?g.filter(J_):g;return v(y)}var x;l==="vertical"&&be(a)?x=gm().y(Nf).x1(_f).x0(a):be(a)?x=gm().x(_f).y1(Nf).y0(a):x=Tz().x(_f).y(Nf);var w=x.defined(Zg).curve(f);return w(d)},J5=e=>{var t=e.className,n=e.points,r=e.path,i=e.pathRef,a=xs();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?Gle(l):r;return O.createElement("path",Ew({},Si(e),bA(e),{className:st("recharts-curve",t),d:s===null?void 0:s,ref:i}))},Zle=["x","y","top","left","width","height","className"];function Tw(){return Tw=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},Tw.apply(null,arguments)}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 Jle(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){eoe(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 eoe(e,t,n){return(t=toe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function toe(e){var t=noe(e,"string");return typeof t=="symbol"?t:t+""}function noe(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 roe(e,t){if(e==null)return{};var n,r,i=ioe(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 ioe(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 aoe=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),loe=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=roe(e,Zle),x=Jle({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",Tw({},_r(x),{className:st("recharts-cross",v),d:aoe(n,i,d,g,l,c)}))};function ooe(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 Jg=1e-4,e$=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],t$=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),nN=(e,t)=>n=>{var r=e$(e,t);return t$(r,n)},soe=(e,t)=>n=>{var r=e$(e,t),i=[...r.map((a,l)=>a*l).slice(1),0];return t$(i,n)},uoe=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]]},coe=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=uoe(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},foe=(e,t,n,r)=>{var i=nN(e,n),a=nN(t,r),l=soe(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)<Jg||y<Jg)return a(p);p=s(p-v/y)}return a(p)};return c.isStepper=!1,c},rN=function(){return foe(...coe(...arguments))},hoe=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)<Jg&&Math.abs(p)<Jg)break;v++}f[f.length-1]=c;var w=f.length-1;return A=>{var E,k,M;if(A<=0)return 0;if(A>=1)return c;var D=A*w,P=Math.floor(D),N=D-P;return((E=f[P])!==null&&E!==void 0?E:0)+(((k=f[P+1])!==null&&k!==void 0?k:0)-((M=f[P])!==null&&M!==void 0?M:0))*N}},doe=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return rN(e);case"spring":return hoe();default:if(e.split("(")[0]==="cubic-bezier")return rN(e)}return typeof e=="function"?e:null},poe=(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()}},n$=O.createContext(poe);n$.Provider;function moe(e){var t=O.useContext(n$);return O.useMemo(()=>e??t,[e,t])}function goe(e,t,n){return(t=voe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function voe(e){var t=yoe(e,"string");return typeof t=="symbol"?t:t+""}function yoe(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 iN="init",aN="pending",lN="active",boe="completed";function f1(e){return Math.max(0,e)}class xoe{getAnimationStartedTime(){return this.animationStartedTime}getBeginStartedTime(){return this.beginStartedTime}constructor(t){var n;goe(this,"state",iN),this.animationId=t.animationId,this.onAnimationEnd=t.onAnimationEnd,this.animationDuration=f1(t.animationDuration),this.animationBegin=f1(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()===iN)return this.state=aN,this.beginStartedTime=t,this.animationBegin;if(this.getState()===aN){if(this.beginStartedTime==null)throw new Error;var n=t-this.beginStartedTime;return n>=this.animationBegin?(this.state=lN,this.animationStartedTime=t,this.nextAnimationUpdate(0)):f1(this.animationBegin-n)}if(this.getState()===lN){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=boe}getFrom(){return this.from}getTo(){return this.to}getAnimationId(){return this.animationId}getAnimationBegin(){return this.animationBegin}}class Soe extends xoe{nextAnimationUpdate(){return 0}getInterpolated(){return this.easing(qt(this.getFrom(),this.getTo(),this.getProgress()))}}class woe{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 Ooe(e,t){return Eoe(e)||Coe(e,t)||koe(e,t)||Aoe()}function Aoe(){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 koe(e,t){if(e){if(typeof e=="string")return oN(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)?oN(e,t):void 0}}function oN(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 Coe(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 Eoe(e){if(Array.isArray(e))return e}var Toe={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},sN=0,h1=1;function r$(e){var t=In(e,Toe),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=G5(),g=r==="auto"?!ud.isSsr&&!p:r,v=moe(t.animationController),y=O.useState(g?sN:h1),x=Ooe(y,2),w=x[0],A=x[1];return O.useEffect(()=>{g||A(h1)},[g]),O.useEffect(()=>{var E=doe(l);if(!g||!i||E==null)return bs;var k=new woe,M=new Soe({animationId:n,easing:E,animationDuration:a,animationBegin:s,onAnimationStart:f,onAnimationEnd:c,from:sN,to:h1});return v(k,M,A)},[v,n,g,i,a,l,s,f,c]),d(Number(w))}function i$(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=O.useRef(Nh(t)),r=O.useRef(e);return r.current!==e&&(n.current=Nh(t),r.current=e),n.current}var Moe=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),Poe=(e,t,n)=>e.map(r=>"".concat(Moe(r)," ").concat(t,"ms ").concat(n)).join(","),Doe=["radius"],_oe=["radius"],uN,cN,fN,hN,dN,pN,mN,gN,vN,yN;function bN(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 xN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bN(Object(n),!0).forEach(function(r){Noe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Noe(e,t,n){return(t=Roe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Roe(e){var t=joe(e,"string");return typeof t=="symbol"?t:t+""}function joe(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 ev(){return ev=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},ev.apply(null,arguments)}function SN(e,t){if(e==null)return{};var n,r,i=Loe(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 Loe(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 Ioe(e,t){return Uoe(e)||$oe(e,t)||zoe(e,t)||Boe()}function Boe(){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 zoe(e,t){if(e){if(typeof e=="string")return wN(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)?wN(e,t):void 0}}function wN(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 $oe(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 Uoe(e){if(Array.isArray(e))return e}function Li(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var ON=(e,t,n,r,i)=>{var a=ja(n),l=ja(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(uN||(uN=Li(["M",",",""])),e,t+c*g[0]),g[0]>0&&(p+=Sn(cN||(cN=Li(["A ",",",",0,0,",",",",",""])),g[0],g[0],d,e+f*g[0],t)),p+=Sn(fN||(fN=Li(["L ",",",""])),e+n-f*g[1],t),g[1]>0&&(p+=Sn(hN||(hN=Li(["A ",",",",0,0,",`,
|
|
81
|
-
`,",",""])),g[1],g[1],d,e+n,t+c*g[1])),p+=Sn(dN||(dN=Li(["L ",",",""])),e+n,t+r-c*g[2]),g[2]>0&&(p+=Sn(pN||(pN=Li(["A ",",",",0,0,",`,
|
|
82
|
-
`,",",""])),g[2],g[2],d,e+n-f*g[2],t+r)),p+=Sn(mN||(mN=Li(["L ",",",""])),e+f*g[3],t+r),g[3]>0&&(p+=Sn(gN||(gN=Li(["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(vN||(vN=Li(["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(yN||(yN=Li(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return p},AN={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},a$=e=>{var t=In(e,AN),n=O.useRef(null),r=O.useState(-1),i=Ioe(r,2),a=i[0],l=i[1];O.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var ae=n.current.getTotalLength();ae&&l(ae)}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,E=O.useRef(f),k=O.useRef(d),M=O.useRef(s),D=O.useRef(c),P=O.useMemo(()=>({x:s,y:c,width:f,height:d,radius:p}),[s,c,f,d,p]),N=i$(P,"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 U=_r(t);U.radius;var K=SN(U,Doe);return O.createElement("path",ev({},K,{x:ja(s),y:ja(c),width:ja(f),height:ja(d),radius:typeof p=="number"?p:void 0,className:L,d:ON(s,c,f,d,p)}))}var V=E.current,B=k.current,oe=M.current,ie=D.current,ue="0px ".concat(a===-1?1:a,"px"),z="".concat(a,"px ").concat(a,"px"),Z=Poe(["strokeDasharray"],y,typeof v=="string"?v:AN.animationEasing);return O.createElement(r$,{animationId:N,key:N,canBegin:a>0,duration:y,easing:v,isActive:A,begin:x},ae=>{var Q=qt(V,f,ae),le=qt(B,d,ae),R=qt(oe,s,ae),F=qt(ie,c,ae);n.current&&(E.current=Q,k.current=le,M.current=R,D.current=F);var ee;w?ae>0?ee={transition:Z,strokeDasharray:z}:ee={strokeDasharray:ue}:ee={strokeDasharray:z};var se=_r(t);se.radius;var ge=SN(se,_oe);return O.createElement("path",ev({},ge,{radius:typeof p=="number"?p:void 0,className:L,d:ON(R,F,Q,le,p),ref:n,style:xN(xN({},ee),t.style)}))})};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){Hoe(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 Hoe(e,t,n){return(t=Foe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Foe(e){var t=qoe(e,"string");return typeof t=="symbol"?t:t+""}function qoe(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 tv=Math.PI/180,Woe=e=>e*180/Math.PI,An=(e,t,n,r)=>({x:e+Math.cos(-tv*r)*n,y:t+Math.sin(-tv*r)*n}),Voe=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},Koe=(e,t)=>{var n=e.x,r=e.y,i=t.x,a=t.y;return Math.sqrt((n-i)**2+(r-a)**2)},Qoe=(e,t)=>{var n=e.x,r=e.y,i=t.cx,a=t.cy,l=Koe({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:Woe(c),angleInRadian:c}},Xoe=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}},Yoe=(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},Goe=(e,t)=>{var n=e.relativeX,r=e.relativeY,i=Qoe({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=Xoe(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?CN(CN({},t),{},{radius:a,angle:Yoe(g,t)}):null};function l$(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 EN,TN,MN,PN,DN,_N,NN;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 Wo(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Zoe=(e,t)=>{var n=cr(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},Om=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)/tv,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*tv),y);return{center:g,circleTangency:v,lineTangency:x,theta:d}},o$=e=>{var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.startAngle,l=e.endAngle,s=Zoe(a,l),c=a+s,f=An(t,n,i,a),d=An(t,n,i,c),p=Sn(EN||(EN=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(TN||(TN=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(MN||(MN=Wo(["L ",","," Z"])),t,n);return p},Joe=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=cr(f-c),p=Om({cx:t,cy:n,radius:i,angle:c,sign:d,cornerRadius:a,cornerIsExternal:s}),g=p.circleTangency,v=p.lineTangency,y=p.theta,x=Om({cx:t,cy:n,radius:i,angle:f,sign:-d,cornerRadius:a,cornerIsExternal:s}),w=x.circleTangency,A=x.lineTangency,E=x.theta,k=s?Math.abs(c-f):Math.abs(c-f)-y-E;if(k<0)return l?Sn(PN||(PN=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):o$({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:f});var M=Sn(DN||(DN=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,+(k>180),+(d<0),w.x,w.y,a,a,+(d<0),A.x,A.y);if(r>0){var D=Om({cx:t,cy:n,radius:r,angle:c,sign:d,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),P=D.circleTangency,N=D.lineTangency,L=D.theta,U=Om({cx:t,cy:n,radius:r,angle:f,sign:-d,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),K=U.circleTangency,V=U.lineTangency,B=U.theta,oe=s?Math.abs(c-f):Math.abs(c-f)-L-B;if(oe<0&&a===0)return"".concat(M,"L").concat(t,",").concat(n,"Z");M+=Sn(_N||(_N=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,+(oe>180),+(d>0),P.x,P.y,a,a,+(d<0),N.x,N.y)}else M+=Sn(NN||(NN=Wo(["L",",","Z"])),t,n);return M},ese={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},tse=e=>{var t=In(e,ese),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=wi(l,v,0,!0),x;return y>0&&Math.abs(f-d)<360?x=Joe({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(y,v/2),forceCornerRadius:s,cornerIsExternal:c,startAngle:f,endAngle:d}):x=o$({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:f,endAngle:d}),O.createElement("path",Mw({},_r(t),{className:g,d:x}))};function nse(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(Wz(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 l$(t)}}function rse(e){return o5(e)?NaN:Number(e)}function d1(e){return e?(e=rse(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}function s$(e,t,n){n&&typeof n!="number"&&pw(e,t,n)&&(t=n=void 0),e=d1(e),t===void 0?(t=e,e=0):t=d1(t),n=n===void 0?e<t?1:-1:d1(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 Ti=e=>e.chartData,NA=W([Ti],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),cd=(e,t,n,r)=>r?NA(e):Ti(e),ise=(e,t,n)=>n?NA(e):Ti(e),ase=W([cd],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t!=null?t.slice(n,r+1):[]});W([NA],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t!=null?t.slice(n,r+1):[]});var lse=W([Ti],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t!=null?t.slice(n,r+1):[]});function RA(e,t){return cse(e)||use(e,t)||sse(e,t)||ose()}function ose(){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 sse(e,t){if(e){if(typeof e=="string")return RN(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)?RN(e,t):void 0}}function RN(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}function Ji(e){if(Array.isArray(e)&&e.length===2){var t=RA(e,2),n=t[0],r=t[1];if(We(n)&&We(r))return!0}return!1}function jN(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function u$(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var n=RA(e,2),r=n[0],i=n[1],a,l;if(We(r))a=r;else if(typeof r=="function")return;if(We(i))l=i;else if(typeof i=="function")return;var s=[a,l];if(Ji(s))return s}}function fse(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(Ji(r))return jN(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var i=RA(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"&&M_.test(a)){var f=M_.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"&&P_.test(l)){var p=P_.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(Ji(v))return t==null?v:jN(v,t,n)}}}var yc=1e9,hse={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},LA,At=!0,ni="[DecimalError] ",ts=ni+"Invalid argument: ",jA=ni+"Exponent out of range: ",bc=Math.floor,jo=Math.pow,dse=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Tr,rn=1e7,xt=7,c$=9007199254740991,nv=bc(c$/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 $a(this,new this.constructor(e))};ve.dividedToIntegerBy=ve.idiv=function(e){var t=this,n=t.constructor;return ht($a(t,new n(e),0,1),n.precision)};ve.equals=ve.eq=function(e){return!this.cmp(e)};ve.exponent=function(){return Wt(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(Tr))throw Error(ni+"NaN");if(n.s<1)throw Error(ni+(n.s?"NaN":"-Infinity"));return n.eq(Tr)?new r(0):(At=!1,t=$a(Ih(n,a),Ih(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?d$(t,e):f$(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(ni+"NaN");return n.s?(At=!1,t=$a(n,e,0,1).times(e),At=!0,n.minus(t)):ht(new r(n),i)};ve.naturalExponential=ve.exp=function(){return h$(this)};ve.naturalLogarithm=ve.ln=function(){return Ih(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?f$(t,e):d$(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(ts+e);if(t=Wt(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(ni+"NaN")}for(e=Wt(s),At=!1,i=Math.sqrt(+s),i==0||i==1/0?(t=Gi(s.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=bc((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($a(s,a,l+2)).times(.5),Gi(a.d).slice(0,l)===(t=Gi(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%rn|0,t=s/rn|0;a[i]=(a[i]+t)%rn|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:(aa(e,0,yc),t===void 0?t=r.rounding:aa(t,0,8),ht(n,e+Wt(n)+1,t))};ve.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=ps(r,!0):(aa(e,0,yc),t===void 0?t=i.rounding:aa(t,0,8),r=ht(new i(r),e+1,t),n=ps(r,!0,e+1)),n};ve.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?ps(i):(aa(e,0,yc),t===void 0?t=a.rounding:aa(t,0,8),r=ht(new a(i),e+Wt(i)+1,t),n=ps(r.abs(),!1,e+Wt(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};ve.toInteger=ve.toint=function(){var e=this,t=e.constructor;return ht(new t(e),Wt(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(Tr);if(s=new c(s),!s.s){if(e.s<1)throw Error(ni+"Infinity");return s}if(s.eq(Tr))return s;if(r=c.precision,e.eq(Tr))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)<=c$){for(i=new c(Tr),t=Math.ceil(r/xt+4),At=!1;n%2&&(i=i.times(s),IN(i.d,t)),n=bc(n/2),n!==0;)s=s.times(s),IN(s.d,t);return At=!0,e.s<0?new c(Tr).div(i):ht(i,r)}}else if(a<0)throw Error(ni+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,s.s=1,At=!1,i=e.times(Ih(s,r+f)),At=!0,i=h$(i),i.s=a,i};ve.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=Wt(i),r=ps(i,n<=a.toExpNeg||n>=a.toExpPos)):(aa(e,1,yc),t===void 0?t=a.rounding:aa(t,0,8),i=ht(new a(i),e,t),n=Wt(i),r=ps(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):(aa(e,1,yc),t===void 0?t=r.rounding:aa(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=Wt(e),n=e.constructor;return ps(e,t<=n.toExpNeg||t>=n.toExpPos)};function f$(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)/rn|0,c[a]%=rn;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 aa(e,t,n){if(e!==~~e||e<t||e>n)throw Error(ts+e)}function Gi(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+=jl(n)),a+=r;l=e[t],r=l+"",n=xt-r.length,n&&(a+=jl(n))}else if(l===0)return"0";for(;l%10===0;)l/=10;return a+l}var $a=(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%rn|0,l=a/rn|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*rn+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,E,k,M,D,P,N,L,U=r.constructor,K=r.s==i.s?1:-1,V=r.d,B=i.d;if(!r.s)return new U(r);if(!i.s)throw Error(ni+"Division by zero");for(c=r.e-i.e,N=B.length,D=V.length,v=new U(K),y=v.d=[],f=0;B[f]==(V[f]||0);)++f;if(B[f]>(V[f]||0)&&--c,a==null?E=a=U.precision:l?E=a+(Wt(r)-Wt(i))+1:E=a,E<0)return new U(0);if(E=E/xt+2|0,f=0,N==1)for(d=0,B=B[0],E++;(f<D||d)&&E--;f++)k=d*rn+(V[f]||0),y[f]=k/B|0,d=k%B|0;else{for(d=rn/(B[0]+1)|0,d>1&&(B=e(B,d),V=e(V,d),N=B.length,D=V.length),M=N,x=V.slice(0,N),w=x.length;w<N;)x[w++]=0;L=B.slice(),L.unshift(0),P=B[0],B[1]>=rn/2&&++P;do d=0,s=t(B,x,N,w),s<0?(A=x[0],N!=w&&(A=A*rn+(x[1]||0)),d=A/P|0,d>1?(d>=rn&&(d=rn-1),p=e(B,d),g=p.length,w=x.length,s=t(p,x,g,w),s==1&&(d--,n(p,N<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,N,w),s<1&&(d++,n(x,N<w?L:B,w))),w=x.length):s===0&&(d++,x=[0]),y[f++]=d,s&&x[0]?x[w++]=V[M]||0:(x=[V[M]],w=1);while((M++<D||x[0]!==void 0)&&E--)}return y[0]||y.shift(),v.e=c,ht(v,l?a+Wt(v)+1:a)}})();function h$(e,t){var n,r,i,a,l,s,c=0,f=0,d=e.constructor,p=d.precision;if(Wt(e)>16)throw Error(jA+Wt(e));if(!e.s)return new d(Tr);for(At=!1,s=p,l=new d(.03125);e.abs().gte(.1);)e=e.times(l),f+=5;for(r=Math.log(jo(2,f))/Math.LN10*2+5|0,s+=r,n=i=a=new d(Tr),d.precision=s;;){if(i=ht(i.times(e),s),n=n.times(++c),l=a.plus($a(i,n,s)),Gi(l.d).slice(0,s)===Gi(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 Wt(e){for(var t=e.e*xt,n=e.d[0];n>=10;n/=10)t++;return t}function p1(e,t,n){if(t>e.LN10.sd())throw At=!0,n&&(e.precision=n),Error(ni+"LN10 precision limit exceeded");return ht(new e(e.LN10),t)}function jl(e){for(var t="";e--;)t+="0";return t}function Ih(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(ni+(v.s?"NaN":"-Infinity"));if(v.eq(Tr))return new x(0);if(t==null?(At=!1,f=w):f=t,v.eq(10))return t==null&&(At=!0),p1(x,f);if(f+=g,x.precision=f,n=Gi(y),r=n.charAt(0),a=Wt(v),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)v=v.times(e),n=Gi(v.d),r=n.charAt(0),p++;a=Wt(v),r>1?(v=new x("0."+n),a++):v=new x(r+"."+n.slice(1))}else return c=p1(x,f+2,w).times(a+""),v=Ih(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=$a(v.minus(Tr),v.plus(Tr),f),d=ht(v.times(v),f),i=3;;){if(l=ht(l.times(d),f),c=s.plus($a(l,new x(i),f)),Gi(c.d).slice(0,f)===Gi(s.d).slice(0,f))return s=s.times(2),a!==0&&(s=s.plus(p1(x,f+2,w).times(a+""))),s=$a(s,new x(p),f),x.precision=w,t==null?(At=!0,ht(s,w)):s;s=c,i+=2}}function LN(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=bc(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>nv||e.e<-nv))throw Error(jA+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=jo(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/jo(10,l-i):0:p[d-1])%10&1||n==(e.s<0?8:7))),t<1||!p[0])return c?(a=Wt(e),p.length=1,t=t-a-1,p[0]=jo(10,(xt-t%xt)%xt),e.e=bc(-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=jo(10,xt-r),p[d]=i>0?(f/jo(10,l-i)%jo(10,i)|0)*a:0),c)for(;;)if(d==0){(p[0]+=a)==rn&&(p[0]=1,++e.e);break}else{if(p[d]+=a,p[d]!=rn)break;p[d--]=0,a=1}for(r=p.length;p[--r]===0;)p.pop();if(At&&(e.e>nv||e.e<-nv))throw Error(jA+Wt(e));return e}function d$(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]=rn-1;--c[a],c[i]+=rn}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 ps(e,t,n){var r,i=Wt(e),a=Gi(e.d),l=a.length;return t?(n&&(r=n-l)>0?a=a.charAt(0)+"."+a.slice(1)+jl(r):l>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+jl(-i-1)+a,n&&(r=n-l)>0&&(a+=jl(r))):i>=l?(a+=jl(i+1-l),n&&(r=n-i-1)>0&&(a=a+"."+jl(r))):((r=i+1)<l&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-l)>0&&(i+1===l&&(a+="."),a+=jl(r))),e.s<0?"-"+a:a}function IN(e,t){if(e.length>t)return e.length=t,!0}function p$(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(ts+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 LN(l,a.toString())}else if(typeof a!="string")throw Error(ts+a);if(a.charCodeAt(0)===45?(a=a.slice(1),l.s=-1):l.s=1,dse.test(a))LN(l,a);else throw Error(ts+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=p$,i.config=i.set=pse,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 pse(e){if(!e||typeof e!="object")throw Error(ni+"Object expected");var t,n,r,i=["precision",1,yc,"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(bc(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(ts+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(ts+n+": "+r);return this}var LA=p$(hse);Tr=new LA(1);const qe=LA;function m$(e){var t;return e===0?t=1:t=Math.floor(new qe(e).abs().log(10).toNumber())+1,t}function g$(e,t,n){for(var r=new qe(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}function Bh(e,t){return yse(e)||vse(e,t)||gse(e,t)||mse()}function mse(){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 gse(e,t){if(e){if(typeof e=="string")return BN(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)?BN(e,t):void 0}}function BN(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 vse(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 yse(e){if(Array.isArray(e))return e}var v$=e=>{var t=Bh(e,2),n=t[0],r=t[1],i=n,a=r;return n>r&&(i=r,a=n),[i,a]},IA=(e,t,n)=>{if(e.lte(0))return new qe(0);var r=m$(e.toNumber()),i=new qe(10).pow(r),a=e.div(i),l=r!==1?.05:.1,s=new qe(Math.ceil(a.div(l).toNumber())).add(n).mul(l),c=s.mul(i);return t?new qe(c.toNumber()):new qe(Math.ceil(c.toNumber()))},y$=(e,t,n)=>{var r;if(e.lte(0))return new qe(0);var i=[1,2,2.5,5],a=e.toNumber(),l=Math.floor(new qe(a).abs().log(10).toNumber()),s=new qe(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 qe(10).pow(d))}var p=(r=i[f])!==null&&r!==void 0?r:1,g=new qe(p).mul(s);return t?g:new qe(Math.ceil(g.toNumber()))},bse=(e,t,n)=>{var r=new qe(1),i=new qe(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new qe(10).pow(m$(e)-1),i=new qe(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new qe(Math.floor(e)))}else e===0?i=new qe(Math.floor((t-1)/2)):n||(i=new qe(Math.floor(e)));for(var l=Math.floor((t-1)/2),s=[],c=0;c<t;c++)s.push(i.add(new qe(c-l).mul(r)).toNumber());return s},b$=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]:IA;if(!Number.isFinite((n-t)/(r-1)))return{step:new qe(0),tickMin:new qe(0),tickMax:new qe(0)};var s=l(new qe(n).sub(t).div(r-1),i,a),c;t<=0&&n>=0?c=new qe(0):(c=new qe(t).add(n).div(2),c=c.sub(new qe(c).mod(s)));var f=Math.ceil(c.sub(t).div(s).toNumber()),d=Math.ceil(new qe(n).sub(c).div(s).toNumber()),p=f+d+1;return p>r?b$(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 qe(f).mul(s)),tickMax:c.add(new qe(d).mul(s))})},zN=function(t){var n=Bh(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=v$([r,i]),d=Bh(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 bse(p,a,l);var y=s==="snap125"?y$:IA,x=b$(p,g,c,l,0,y),w=x.step,A=x.tickMin,E=x.tickMax,k=g$(A,E.add(new qe(.1).mul(w)),w);return r>i?k.reverse():k},$N=function(t,n){var r=Bh(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=v$([i,a]),f=Bh(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"?y$:IA,v=Math.max(n,2),y=g(new qe(p).sub(d).div(v-1),l,0),x=[...g$(new qe(d),new qe(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},x$=e=>e.rootProps.maxBarSize,xse=e=>e.rootProps.barGap,S$=e=>e.rootProps.barCategoryGap,Sse=e=>e.rootProps.barSize,xy=e=>e.rootProps.stackOffset,w$=e=>e.rootProps.reverseStackOrder,BA=e=>e.options.chartName,zA=e=>e.rootProps.syncId,O$=e=>e.rootProps.syncMethod,$A=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"},Ii={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},Sy=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function wy(e,t,n){if(n!=="auto")return n;if(e!=null)return el(e,t)?"category":"number"}function UN(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 rv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?UN(Object(n),!0).forEach(function(r){wse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wse(e,t,n){return(t=Ose(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ose(e){var t=Ase(e,"string");return typeof t=="symbol"?t:t+""}function Ase(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 HN={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"},FN={allowDataOverflow:Ii.allowDataOverflow,allowDecimals:Ii.allowDecimals,allowDuplicatedCategory:Ii.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:Ii.radiusAxisId,includeHidden:Ii.includeHidden,name:void 0,reversed:Ii.reversed,scale:Ii.scale,tick:Ii.tick,tickCount:Ii.tickCount,ticks:void 0,type:Ii.type,unit:void 0,niceTicks:"auto"},kse=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},UA=W([kse,Q5],(e,t)=>{var n;if(e!=null)return e;var r=(n=wy(t,"angleAxis",HN.type))!==null&&n!==void 0?n:"category";return rv(rv({},HN),{},{type:r})}),Cse=(e,t)=>e.polarAxis.radiusAxis[t],HA=W([Cse,Q5],(e,t)=>{var n;if(e!=null)return e;var r=(n=wy(t,"radiusAxis",FN.type))!==null&&n!==void 0?n:"category";return rv(rv({},FN),{},{type:r})}),Oy=e=>e.polarOptions,FA=W([tl,nl,un],Voe),A$=W([Oy,FA],(e,t)=>{if(e!=null)return wi(e.innerRadius,t,0)}),k$=W([Oy,FA],(e,t)=>{if(e!=null)return wi(e.outerRadius,t,t*.8)}),Ese=e=>{if(e==null)return[0,0];var t=e.startAngle,n=e.endAngle;return[t,n]},C$=W([Oy],Ese);W([UA,C$],Sy);var E$=W([FA,A$,k$],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});W([HA,E$],Sy);var T$=W([nt,Oy,A$,k$,tl,nl],(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:wi(l,i,i/2),cy:wi(s,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:f,clockWise:!1}}}),cn=(e,t)=>t,Ay=(e,t,n)=>n;function qA(e){return e?.id}function M$(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=qA(c);d.forEach((g,v)=>{var y=l==null||a?v:String(zt(g,l,null)),x=zt(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 ky(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var fd=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Cy(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function Tse(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"},xc=e=>e.tooltip.settings.axisId;function WA(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 Mse=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Ji(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];We(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 Pse(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function VA(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===Pse?e:Dse,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 Dse(){return 0}function P$(e){return e===null?NaN:+e}function*_se(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Nse=VA(Wl),hd=Nse.right;VA(P$).center;class qN extends Map{constructor(t,n=Lse){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(WN(this,t))}has(t){return super.has(WN(this,t))}set(t,n){return super.set(Rse(this,t),n)}delete(t){return super.delete(jse(this,t))}}function WN({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Rse({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function jse({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Lse(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Ise(e=Wl){if(e===Wl)return D$;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 D$(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Bse=Math.sqrt(50),zse=Math.sqrt(10),$se=Math.sqrt(2);function iv(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>=Bse?10:a>=zse?5:a>=$se?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?iv(e,t,n*2):[s,c,f]}function Pw(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?iv(t,e,n):iv(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 Dw(e,t,n){return t=+t,e=+e,n=+n,iv(e,t,n)[2]}function _w(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?Dw(t,e,n):Dw(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function VN(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function KN(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function _$(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?D$:Ise(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));_$(e,t,v,y,i)}const a=e[t];let l=n,s=r;for(Rf(e,n,t),i(e[r],a)>0&&Rf(e,n,r);l<s;){for(Rf(e,l,s),++l,--s;i(e[l],a)<0;)++l;for(;i(e[s],a)>0;)--s}i(e[n],a)===0?Rf(e,n,s):(++s,Rf(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function Rf(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Use(e,t,n){if(e=Float64Array.from(_se(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return KN(e);if(t>=1)return VN(e);var r,i=(r-1)*t,a=Math.floor(i),l=VN(_$(e,a).subarray(0,a+1)),s=KN(e.subarray(a+1));return l+(s-l)*(i-a)}}function Hse(e,t,n=P$){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 Fse(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 ai(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function rl(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 Nw=Symbol("implicit");function KA(){var e=new qN,t=[],n=[],r=Nw;function i(a){let l=e.get(a);if(l===void 0){if(r!==Nw)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 qN;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 KA(t,n).unknown(r)},ai.apply(i,arguments),i}function QA(){var e=KA().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=Fse(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 QA(t(),[r,i]).round(s).paddingInner(c).paddingOuter(f).align(d)},ai.apply(p(),arguments)}function N$(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return N$(t())},e}function qse(){return N$(QA.apply(null,arguments).paddingInner(1))}function XA(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function R$(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function dd(){}var zh=.7,av=1/zh,Uu="\\s*([+-]?\\d+)\\s*",$h="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ea="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Wse=/^#([0-9a-f]{3,8})$/,Vse=new RegExp(`^rgb\\(${Uu},${Uu},${Uu}\\)$`),Kse=new RegExp(`^rgb\\(${ea},${ea},${ea}\\)$`),Qse=new RegExp(`^rgba\\(${Uu},${Uu},${Uu},${$h}\\)$`),Xse=new RegExp(`^rgba\\(${ea},${ea},${ea},${$h}\\)$`),Yse=new RegExp(`^hsl\\(${$h},${ea},${ea}\\)$`),Gse=new RegExp(`^hsla\\(${$h},${ea},${ea},${$h}\\)$`),QN={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};XA(dd,Uh,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:XN,formatHex:XN,formatHex8:Zse,formatHsl:Jse,formatRgb:YN,toString:YN});function XN(){return this.rgb().formatHex()}function Zse(){return this.rgb().formatHex8()}function Jse(){return j$(this).formatHsl()}function YN(){return this.rgb().formatRgb()}function Uh(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Wse.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?GN(t):n===3?new hr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Am(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Am(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=Vse.exec(e))?new hr(t[1],t[2],t[3],1):(t=Kse.exec(e))?new hr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Qse.exec(e))?Am(t[1],t[2],t[3],t[4]):(t=Xse.exec(e))?Am(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Yse.exec(e))?eR(t[1],t[2]/100,t[3]/100,1):(t=Gse.exec(e))?eR(t[1],t[2]/100,t[3]/100,t[4]):QN.hasOwnProperty(e)?GN(QN[e]):e==="transparent"?new hr(NaN,NaN,NaN,0):null}function GN(e){return new hr(e>>16&255,e>>8&255,e&255,1)}function Am(e,t,n,r){return r<=0&&(e=t=n=NaN),new hr(e,t,n,r)}function eue(e){return e instanceof dd||(e=Uh(e)),e?(e=e.rgb(),new hr(e.r,e.g,e.b,e.opacity)):new hr}function Rw(e,t,n,r){return arguments.length===1?eue(e):new hr(e,t,n,r??1)}function hr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}XA(hr,Rw,R$(dd,{brighter(e){return e=e==null?av:Math.pow(av,e),new hr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?zh:Math.pow(zh,e),new hr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new hr(ns(this.r),ns(this.g),ns(this.b),lv(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:ZN,formatHex:ZN,formatHex8:tue,formatRgb:JN,toString:JN}));function ZN(){return`#${Vo(this.r)}${Vo(this.g)}${Vo(this.b)}`}function tue(){return`#${Vo(this.r)}${Vo(this.g)}${Vo(this.b)}${Vo((isNaN(this.opacity)?1:this.opacity)*255)}`}function JN(){const e=lv(this.opacity);return`${e===1?"rgb(":"rgba("}${ns(this.r)}, ${ns(this.g)}, ${ns(this.b)}${e===1?")":`, ${e})`}`}function lv(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ns(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Vo(e){return e=ns(e),(e<16?"0":"")+e.toString(16)}function eR(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new pi(e,t,n,r)}function j$(e){if(e instanceof pi)return new pi(e.h,e.s,e.l,e.opacity);if(e instanceof dd||(e=Uh(e)),!e)return new pi;if(e instanceof pi)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 pi(l,s,c,e.opacity)}function nue(e,t,n,r){return arguments.length===1?j$(e):new pi(e,t,n,r??1)}function pi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}XA(pi,nue,R$(dd,{brighter(e){return e=e==null?av:Math.pow(av,e),new pi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?zh:Math.pow(zh,e),new pi(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 hr(m1(e>=240?e-240:e+120,i,r),m1(e,i,r),m1(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new pi(tR(this.h),km(this.s),km(this.l),lv(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=lv(this.opacity);return`${e===1?"hsl(":"hsla("}${tR(this.h)}, ${km(this.s)*100}%, ${km(this.l)*100}%${e===1?")":`, ${e})`}`}}));function tR(e){return e=(e||0)%360,e<0?e+360:e}function km(e){return Math.max(0,Math.min(1,e||0))}function m1(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 YA=e=>()=>e;function rue(e,t){return function(n){return e+n*t}}function iue(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 aue(e){return(e=+e)==1?L$:function(t,n){return n-t?iue(t,n,e):YA(isNaN(t)?n:t)}}function L$(e,t){var n=t-e;return n?rue(e,n):YA(isNaN(e)?t:e)}const nR=(function e(t){var n=aue(t);function r(i,a){var l=n((i=Rw(i)).r,(a=Rw(a)).r),s=n(i.g,a.g),c=n(i.b,a.b),f=L$(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 lue(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 oue(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function sue(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]=Sc(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 uue(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function ov(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function cue(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]=Sc(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var jw=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,g1=new RegExp(jw.source,"g");function fue(e){return function(){return e}}function hue(e){return function(t){return e(t)+""}}function due(e,t){var n=jw.lastIndex=g1.lastIndex=0,r,i,a,l=-1,s=[],c=[];for(e=e+"",t=t+"";(r=jw.exec(e))&&(i=g1.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:ov(r,i)})),n=g1.lastIndex;return n<t.length&&(a=t.slice(n),s[l]?s[l]+=a:s[++l]=a),s.length<2?c[0]?hue(c[0].x):fue(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 Sc(e,t){var n=typeof t,r;return t==null||n==="boolean"?YA(t):(n==="number"?ov:n==="string"?(r=Uh(t))?(t=r,nR):due:t instanceof Uh?nR:t instanceof Date?uue:oue(t)?lue:Array.isArray(t)?sue:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?cue:ov)(e,t)}function GA(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function pue(e,t){t===void 0&&(t=e,e=Sc);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 mue(e){return function(){return e}}function sv(e){return+e}var rR=[0,1];function Qn(e){return e}function Lw(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:mue(isNaN(t)?NaN:.5)}function gue(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function vue(e,t,n){var r=e[0],i=e[1],a=t[0],l=t[1];return i<r?(r=Lw(i,r),a=n(l,a)):(r=Lw(r,i),a=n(a,l)),function(s){return a(r(s))}}function yue(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]=Lw(e[l],e[l+1]),a[l]=n(t[l],t[l+1]);return function(s){var c=hd(e,s,1,r)-1;return a[c](i[c](s))}}function pd(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Ey(){var e=rR,t=rR,n=Sc,r,i,a,l=Qn,s,c,f;function d(){var g=Math.min(e.length,t.length);return l!==Qn&&(l=gue(e[0],e[g-1])),s=g>2?yue:vue,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),ov)))(g)))},p.domain=function(g){return arguments.length?(e=Array.from(g,sv),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=GA,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 ZA(){return Ey()(Qn,Qn)}function bue(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function uv(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 ic(e){return e=uv(Math.abs(e)),e?e[1]:NaN}function xue(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 Sue(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var wue=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Hh(e){if(!(t=wue.exec(e)))throw new Error("invalid format: "+e);var t;return new JA({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]})}Hh.prototype=JA.prototype;function JA(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+""}JA.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 Oue(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 cv;function Aue(e,t){var n=uv(e,t);if(!n)return cv=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(cv=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")+uv(e,Math.max(0,t+a-1))[0]}function iR(e,t){var n=uv(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 aR={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:bue,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)=>iR(e*100,t),r:iR,s:Aue,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function lR(e){return e}var oR=Array.prototype.map,sR=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function kue(e){var t=e.grouping===void 0||e.thousands===void 0?lR:xue(oR.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?lR:Sue(oR.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=Hh(p);var v=p.fill,y=p.align,x=p.sign,w=p.symbol,A=p.zero,E=p.width,k=p.comma,M=p.precision,D=p.trim,P=p.type;P==="n"?(k=!0,P="g"):aR[P]||(M===void 0&&(M=12),D=!0,P="g"),(A||v==="0"&&y==="=")&&(A=!0,v="0",y="=");var N=(g&&g.prefix!==void 0?g.prefix:"")+(w==="$"?n:w==="#"&&/[boxX]/.test(P)?"0"+P.toLowerCase():""),L=(w==="$"?r:/[%p]/.test(P)?l:"")+(g&&g.suffix!==void 0?g.suffix:""),U=aR[P],K=/[defgprs%]/.test(P);M=M===void 0?6:/[gprs]/.test(P)?Math.max(1,Math.min(21,M)):Math.max(0,Math.min(20,M));function V(B){var oe=N,ie=L,ue,z,Z;if(P==="c")ie=U(B)+ie,B="";else{B=+B;var ae=B<0||1/B<0;if(B=isNaN(B)?c:U(Math.abs(B),M),D&&(B=Oue(B)),ae&&+B==0&&x!=="+"&&(ae=!1),oe=(ae?x==="("?x:s:x==="-"||x==="("?"":x)+oe,ie=(P==="s"&&!isNaN(B)&&cv!==void 0?sR[8+cv/3]:"")+ie+(ae&&x==="("?")":""),K){for(ue=-1,z=B.length;++ue<z;)if(Z=B.charCodeAt(ue),48>Z||Z>57){ie=(Z===46?i+B.slice(ue+1):B.slice(ue))+ie,B=B.slice(0,ue);break}}}k&&!A&&(B=t(B,1/0));var Q=oe.length+B.length+ie.length,le=Q<E?new Array(E-Q+1).join(v):"";switch(k&&A&&(B=t(le+B,le.length?E-ie.length:1/0),le=""),y){case"<":B=oe+B+ie+le;break;case"=":B=oe+le+B+ie;break;case"^":B=le.slice(0,Q=le.length>>1)+oe+B+ie+le.slice(Q);break;default:B=le+oe+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(ic(g)/3)))*3,y=Math.pow(10,-v),x=f((p=Hh(p),p.type="f",p),{suffix:sR[8+v/3]});return function(w){return x(y*w)}}return{format:f,formatPrefix:d}}var Cm,ek,I$;Cue({thousands:",",grouping:[3],currency:["$",""]});function Cue(e){return Cm=kue(e),ek=Cm.format,I$=Cm.formatPrefix,Cm}function Eue(e){return Math.max(0,-ic(Math.abs(e)))}function Tue(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ic(t)/3)))*3-ic(Math.abs(e)))}function Mue(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ic(t)-ic(e))+1}function B$(e,t,n,r){var i=_w(e,t,n),a;switch(r=Hh(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Tue(i,l))&&(r.precision=a),I$(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=Mue(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=Eue(i))&&(r.precision=a-(r.type==="%")*2);break}}return ek(r)}function lo(e){var t=e.domain;return e.ticks=function(n){var r=t();return Pw(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return B$(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=Dw(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 z$(){var e=ZA();return e.copy=function(){return pd(e,z$())},ai.apply(e,arguments),lo(e)}function $$(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,sv),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return $$(e).unknown(t)},e=arguments.length?Array.from(e,sv):[0,1],lo(n)}function U$(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 uR(e){return Math.log(e)}function cR(e){return Math.exp(e)}function Pue(e){return-Math.log(-e)}function Due(e){return-Math.exp(-e)}function _ue(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Nue(e){return e===10?_ue:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Rue(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 fR(e){return(t,n)=>-e(-t,n)}function tk(e){const t=e(uR,cR),n=t.domain;let r=10,i,a;function l(){return i=Rue(r),a=Nue(r),n()[0]<0?(i=fR(i),a=fR(a),e(Pue,Due)):e(uR,cR),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=Pw(f,d,w))}else A=Pw(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=Hh(c)).precision==null&&(c.trim=!0),c=ek(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(U$(n(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),t}function H$(){const e=tk(Ey()).domain([1,10]);return e.copy=()=>pd(e,H$()).base(e.base()),ai.apply(e,arguments),e}function hR(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function dR(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function nk(e){var t=1,n=e(hR(t),dR(t));return n.constant=function(r){return arguments.length?e(hR(t=+r),dR(t)):t},lo(n)}function F$(){var e=nk(Ey());return e.copy=function(){return pd(e,F$()).constant(e.constant())},ai.apply(e,arguments)}function pR(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function jue(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Lue(e){return e<0?-e*e:e*e}function rk(e){var t=e(Qn,Qn),n=1;function r(){return n===1?e(Qn,Qn):n===.5?e(jue,Lue):e(pR(n),pR(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},lo(t)}function ik(){var e=rk(Ey());return e.copy=function(){return pd(e,ik()).exponent(e.exponent())},ai.apply(e,arguments),e}function Iue(){return ik.apply(null,arguments).exponent(.5)}function mR(e){return Math.sign(e)*e*e}function Bue(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function q$(){var e=ZA(),t=[0,1],n=!1,r;function i(a){var l=Bue(e(a));return isNaN(l)?r:n?Math.round(l):l}return i.invert=function(a){return e.invert(mR(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,sv)).map(mR)),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 q$(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},ai.apply(i,arguments),lo(i)}function W$(){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]=Hse(e,l/s);return a}function a(l){return l==null||isNaN(l=+l)?r:t[hd(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 W$().domain(e).range(t).unknown(r)},ai.apply(a,arguments)}function V$(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function l(c){return c!=null&&c<=c?i[hd(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 V$().domain([e,t]).range(i).unknown(a)},ai.apply(lo(l),arguments)}function K$(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[hd(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 K$().domain(e).range(t).unknown(n)},ai.apply(i,arguments)}const v1=new Date,y1=new Date;function Jt(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=>Jt(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)=>(v1.setTime(+a),y1.setTime(+l),e(v1),e(y1),Math.floor(n(v1,y1))),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 fv=Jt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);fv.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Jt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):fv);fv.range;const La=1e3,ei=La*60,Ia=ei*60,Ya=Ia*24,ak=Ya*7,gR=Ya*30,b1=Ya*365,Ko=Jt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*La)},(e,t)=>(t-e)/La,e=>e.getUTCSeconds());Ko.range;const lk=Jt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*La)},(e,t)=>{e.setTime(+e+t*ei)},(e,t)=>(t-e)/ei,e=>e.getMinutes());lk.range;const ok=Jt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ei)},(e,t)=>(t-e)/ei,e=>e.getUTCMinutes());ok.range;const sk=Jt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*La-e.getMinutes()*ei)},(e,t)=>{e.setTime(+e+t*Ia)},(e,t)=>(t-e)/Ia,e=>e.getHours());sk.range;const uk=Jt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ia)},(e,t)=>(t-e)/Ia,e=>e.getUTCHours());uk.range;const md=Jt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ei)/Ya,e=>e.getDate()-1);md.range;const Ty=Jt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ya,e=>e.getUTCDate()-1);Ty.range;const Q$=Jt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ya,e=>Math.floor(e/Ya));Q$.range;function Ss(e){return Jt(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())*ei)/ak)}const My=Ss(0),hv=Ss(1),zue=Ss(2),$ue=Ss(3),ac=Ss(4),Uue=Ss(5),Hue=Ss(6);My.range;hv.range;zue.range;$ue.range;ac.range;Uue.range;Hue.range;function ws(e){return Jt(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)/ak)}const Py=ws(0),dv=ws(1),Fue=ws(2),que=ws(3),lc=ws(4),Wue=ws(5),Vue=ws(6);Py.range;dv.range;Fue.range;que.range;lc.range;Wue.range;Vue.range;const ck=Jt(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());ck.range;const fk=Jt(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());fk.range;const Ga=Jt(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());Ga.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Jt(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)});Ga.range;const Za=Jt(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());Za.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Jt(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)});Za.range;function X$(e,t,n,r,i,a){const l=[[Ko,1,La],[Ko,5,5*La],[Ko,15,15*La],[Ko,30,30*La],[a,1,ei],[a,5,5*ei],[a,15,15*ei],[a,30,30*ei],[i,1,Ia],[i,3,3*Ia],[i,6,6*Ia],[i,12,12*Ia],[r,1,Ya],[r,2,2*Ya],[n,1,ak],[t,1,gR],[t,3,3*gR],[e,1,b1]];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=VA(([,,w])=>w).right(l,g);if(v===l.length)return e.every(_w(f/b1,d/b1,p));if(v===0)return fv.every(Math.max(_w(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[Kue,Que]=X$(Za,fk,Py,Q$,uk,ok),[Xue,Yue]=X$(Ga,ck,My,md,sk,lk);function x1(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 S1(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 jf(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Gue(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=Lf(i),d=If(i),p=Lf(a),g=If(a),v=Lf(l),y=If(l),x=Lf(s),w=If(s),A=Lf(c),E=If(c),k={a:Z,A:ae,b:Q,B:le,c:null,d:wR,e:wR,f:xce,g:Pce,G:_ce,H:vce,I:yce,j:bce,L:Y$,m:Sce,M:wce,p:R,q:F,Q:kR,s:CR,S:Oce,u:Ace,U:kce,V:Cce,w:Ece,W:Tce,x:null,X:null,y:Mce,Y:Dce,Z:Nce,"%":AR},M={a:ee,A:se,b:ge,B:Oe,c:null,d:OR,e:OR,f:Ice,g:Kce,G:Xce,H:Rce,I:jce,j:Lce,L:Z$,m:Bce,M:zce,p:Pe,q:mt,Q:kR,s:CR,S:$ce,u:Uce,U:Hce,V:Fce,w:qce,W:Wce,x:null,X:null,y:Vce,Y:Qce,Z:Yce,"%":AR},D={a:K,A:V,b:B,B:oe,c:ie,d:xR,e:xR,f:dce,g:bR,G:yR,H:SR,I:SR,j:uce,L:hce,m:sce,M:cce,p:U,q:oce,Q:mce,s:gce,S:fce,u:nce,U:rce,V:ice,w:tce,W:ace,x:ue,X:z,y:bR,Y:yR,Z:lce,"%":pce};k.x=P(n,k),k.X=P(r,k),k.c=P(t,k),M.x=P(n,M),M.X=P(r,M),M.c=P(t,M);function P(ce,Te){return function(Ee){var fe=[],Rt=-1,Ne=0,xe=ce.length,gt,dn,fa;for(Ee instanceof Date||(Ee=new Date(+Ee));++Rt<xe;)ce.charCodeAt(Rt)===37&&(fe.push(ce.slice(Ne,Rt)),(dn=vR[gt=ce.charAt(++Rt)])!=null?gt=ce.charAt(++Rt):dn=gt==="e"?" ":"0",(fa=Te[gt])&&(gt=fa(Ee,dn)),fe.push(gt),Ne=Rt+1);return fe.push(ce.slice(Ne,Rt)),fe.join("")}}function N(ce,Te){return function(Ee){var fe=jf(1900,void 0,1),Rt=L(fe,ce,Ee+="",0),Ne,xe;if(Rt!=Ee.length)return null;if("Q"in fe)return new Date(fe.Q);if("s"in fe)return new Date(fe.s*1e3+("L"in fe?fe.L:0));if(Te&&!("Z"in fe)&&(fe.Z=0),"p"in fe&&(fe.H=fe.H%12+fe.p*12),fe.m===void 0&&(fe.m="q"in fe?fe.q:0),"V"in fe){if(fe.V<1||fe.V>53)return null;"w"in fe||(fe.w=1),"Z"in fe?(Ne=S1(jf(fe.y,0,1)),xe=Ne.getUTCDay(),Ne=xe>4||xe===0?dv.ceil(Ne):dv(Ne),Ne=Ty.offset(Ne,(fe.V-1)*7),fe.y=Ne.getUTCFullYear(),fe.m=Ne.getUTCMonth(),fe.d=Ne.getUTCDate()+(fe.w+6)%7):(Ne=x1(jf(fe.y,0,1)),xe=Ne.getDay(),Ne=xe>4||xe===0?hv.ceil(Ne):hv(Ne),Ne=md.offset(Ne,(fe.V-1)*7),fe.y=Ne.getFullYear(),fe.m=Ne.getMonth(),fe.d=Ne.getDate()+(fe.w+6)%7)}else("W"in fe||"U"in fe)&&("w"in fe||(fe.w="u"in fe?fe.u%7:"W"in fe?1:0),xe="Z"in fe?S1(jf(fe.y,0,1)).getUTCDay():x1(jf(fe.y,0,1)).getDay(),fe.m=0,fe.d="W"in fe?(fe.w+6)%7+fe.W*7-(xe+5)%7:fe.w+fe.U*7-(xe+6)%7);return"Z"in fe?(fe.H+=fe.Z/100|0,fe.M+=fe.Z%100,S1(fe)):x1(fe)}}function L(ce,Te,Ee,fe){for(var Rt=0,Ne=Te.length,xe=Ee.length,gt,dn;Rt<Ne;){if(fe>=xe)return-1;if(gt=Te.charCodeAt(Rt++),gt===37){if(gt=Te.charAt(Rt++),dn=D[gt in vR?Te.charAt(Rt++):gt],!dn||(fe=dn(ce,Ee,fe))<0)return-1}else if(gt!=Ee.charCodeAt(fe++))return-1}return fe}function U(ce,Te,Ee){var fe=f.exec(Te.slice(Ee));return fe?(ce.p=d.get(fe[0].toLowerCase()),Ee+fe[0].length):-1}function K(ce,Te,Ee){var fe=v.exec(Te.slice(Ee));return fe?(ce.w=y.get(fe[0].toLowerCase()),Ee+fe[0].length):-1}function V(ce,Te,Ee){var fe=p.exec(Te.slice(Ee));return fe?(ce.w=g.get(fe[0].toLowerCase()),Ee+fe[0].length):-1}function B(ce,Te,Ee){var fe=A.exec(Te.slice(Ee));return fe?(ce.m=E.get(fe[0].toLowerCase()),Ee+fe[0].length):-1}function oe(ce,Te,Ee){var fe=x.exec(Te.slice(Ee));return fe?(ce.m=w.get(fe[0].toLowerCase()),Ee+fe[0].length):-1}function ie(ce,Te,Ee){return L(ce,t,Te,Ee)}function ue(ce,Te,Ee){return L(ce,n,Te,Ee)}function z(ce,Te,Ee){return L(ce,r,Te,Ee)}function Z(ce){return l[ce.getDay()]}function ae(ce){return a[ce.getDay()]}function Q(ce){return c[ce.getMonth()]}function le(ce){return s[ce.getMonth()]}function R(ce){return i[+(ce.getHours()>=12)]}function F(ce){return 1+~~(ce.getMonth()/3)}function ee(ce){return l[ce.getUTCDay()]}function se(ce){return a[ce.getUTCDay()]}function ge(ce){return c[ce.getUTCMonth()]}function Oe(ce){return s[ce.getUTCMonth()]}function Pe(ce){return i[+(ce.getUTCHours()>=12)]}function mt(ce){return 1+~~(ce.getUTCMonth()/3)}return{format:function(ce){var Te=P(ce+="",k);return Te.toString=function(){return ce},Te},parse:function(ce){var Te=N(ce+="",!1);return Te.toString=function(){return ce},Te},utcFormat:function(ce){var Te=P(ce+="",M);return Te.toString=function(){return ce},Te},utcParse:function(ce){var Te=N(ce+="",!0);return Te.toString=function(){return ce},Te}}}var vR={"-":"",_:" ",0:"0"},hn=/^\s*\d+/,Zue=/^%/,Jue=/[\\^$*+?|[\]().{}]/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 ece(e){return e.replace(Jue,"\\$&")}function Lf(e){return new RegExp("^(?:"+e.map(ece).join("|")+")","i")}function If(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function tce(e,t,n){var r=hn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function nce(e,t,n){var r=hn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function rce(e,t,n){var r=hn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function ice(e,t,n){var r=hn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function ace(e,t,n){var r=hn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function yR(e,t,n){var r=hn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function bR(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 lce(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 oce(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 sce(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 xR(e,t,n){var r=hn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function uce(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 SR(e,t,n){var r=hn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function cce(e,t,n){var r=hn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function fce(e,t,n){var r=hn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function hce(e,t,n){var r=hn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function dce(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 pce(e,t,n){var r=Zue.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function mce(e,t,n){var r=hn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function gce(e,t,n){var r=hn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function wR(e,t){return Ge(e.getDate(),t,2)}function vce(e,t){return Ge(e.getHours(),t,2)}function yce(e,t){return Ge(e.getHours()%12||12,t,2)}function bce(e,t){return Ge(1+md.count(Ga(e),e),t,3)}function Y$(e,t){return Ge(e.getMilliseconds(),t,3)}function xce(e,t){return Y$(e,t)+"000"}function Sce(e,t){return Ge(e.getMonth()+1,t,2)}function wce(e,t){return Ge(e.getMinutes(),t,2)}function Oce(e,t){return Ge(e.getSeconds(),t,2)}function Ace(e){var t=e.getDay();return t===0?7:t}function kce(e,t){return Ge(My.count(Ga(e)-1,e),t,2)}function G$(e){var t=e.getDay();return t>=4||t===0?ac(e):ac.ceil(e)}function Cce(e,t){return e=G$(e),Ge(ac.count(Ga(e),e)+(Ga(e).getDay()===4),t,2)}function Ece(e){return e.getDay()}function Tce(e,t){return Ge(hv.count(Ga(e)-1,e),t,2)}function Mce(e,t){return Ge(e.getFullYear()%100,t,2)}function Pce(e,t){return e=G$(e),Ge(e.getFullYear()%100,t,2)}function Dce(e,t){return Ge(e.getFullYear()%1e4,t,4)}function _ce(e,t){var n=e.getDay();return e=n>=4||n===0?ac(e):ac.ceil(e),Ge(e.getFullYear()%1e4,t,4)}function Nce(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ge(t/60|0,"0",2)+Ge(t%60,"0",2)}function OR(e,t){return Ge(e.getUTCDate(),t,2)}function Rce(e,t){return Ge(e.getUTCHours(),t,2)}function jce(e,t){return Ge(e.getUTCHours()%12||12,t,2)}function Lce(e,t){return Ge(1+Ty.count(Za(e),e),t,3)}function Z$(e,t){return Ge(e.getUTCMilliseconds(),t,3)}function Ice(e,t){return Z$(e,t)+"000"}function Bce(e,t){return Ge(e.getUTCMonth()+1,t,2)}function zce(e,t){return Ge(e.getUTCMinutes(),t,2)}function $ce(e,t){return Ge(e.getUTCSeconds(),t,2)}function Uce(e){var t=e.getUTCDay();return t===0?7:t}function Hce(e,t){return Ge(Py.count(Za(e)-1,e),t,2)}function J$(e){var t=e.getUTCDay();return t>=4||t===0?lc(e):lc.ceil(e)}function Fce(e,t){return e=J$(e),Ge(lc.count(Za(e),e)+(Za(e).getUTCDay()===4),t,2)}function qce(e){return e.getUTCDay()}function Wce(e,t){return Ge(dv.count(Za(e)-1,e),t,2)}function Vce(e,t){return Ge(e.getUTCFullYear()%100,t,2)}function Kce(e,t){return e=J$(e),Ge(e.getUTCFullYear()%100,t,2)}function Qce(e,t){return Ge(e.getUTCFullYear()%1e4,t,4)}function Xce(e,t){var n=e.getUTCDay();return e=n>=4||n===0?lc(e):lc.ceil(e),Ge(e.getUTCFullYear()%1e4,t,4)}function Yce(){return"+0000"}function AR(){return"%"}function kR(e){return+e}function CR(e){return Math.floor(+e/1e3)}var hu,e4,t4;Gce({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 Gce(e){return hu=Gue(e),e4=hu.format,hu.parse,t4=hu.utcFormat,hu.utcParse,hu}function Zce(e){return new Date(e)}function Jce(e){return e instanceof Date?+e:+new Date(+e)}function hk(e,t,n,r,i,a,l,s,c,f){var d=ZA(),p=d.invert,g=d.domain,v=f(".%L"),y=f(":%S"),x=f("%I:%M"),w=f("%I %p"),A=f("%a %d"),E=f("%b %d"),k=f("%B"),M=f("%Y");function D(P){return(c(P)<P?v:s(P)<P?y:l(P)<P?x:a(P)<P?w:r(P)<P?i(P)<P?A:E:n(P)<P?k:M)(P)}return d.invert=function(P){return new Date(p(P))},d.domain=function(P){return arguments.length?g(Array.from(P,Jce)):g().map(Zce)},d.ticks=function(P){var N=g();return e(N[0],N[N.length-1],P??10)},d.tickFormat=function(P,N){return N==null?D:f(N)},d.nice=function(P){var N=g();return(!P||typeof P.range!="function")&&(P=t(N[0],N[N.length-1],P??10)),P?g(U$(N,P)):d},d.copy=function(){return pd(d,hk(e,t,n,r,i,a,l,s,c,f))},d}function efe(){return ai.apply(hk(Xue,Yue,Ga,ck,My,md,sk,lk,Ko,e4).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function tfe(){return ai.apply(hk(Kue,Que,Za,fk,Py,Ty,uk,ok,Ko,t4).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Dy(){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(Sc),f.rangeRound=d(GA),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 oo(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function n4(){var e=lo(Dy()(Qn));return e.copy=function(){return oo(e,n4())},rl.apply(e,arguments)}function r4(){var e=tk(Dy()).domain([1,10]);return e.copy=function(){return oo(e,r4()).base(e.base())},rl.apply(e,arguments)}function i4(){var e=nk(Dy());return e.copy=function(){return oo(e,i4()).constant(e.constant())},rl.apply(e,arguments)}function dk(){var e=rk(Dy());return e.copy=function(){return oo(e,dk()).exponent(e.exponent())},rl.apply(e,arguments)}function nfe(){return dk.apply(null,arguments).exponent(.5)}function a4(){var e=[],t=Qn;function n(r){if(r!=null&&!isNaN(r=+r))return t((hd(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)=>Use(e,a/r))},n.copy=function(){return a4(t).domain(e)},rl.apply(n,arguments)}function _y(){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,E,k;return arguments.length?([A,E,k]=w,f=pue(x,[A,E,k]),v):[f(0),f(.5),f(1)]}}return v.range=y(Sc),v.rangeRound=y(GA),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 l4(){var e=lo(_y()(Qn));return e.copy=function(){return oo(e,l4())},rl.apply(e,arguments)}function o4(){var e=tk(_y()).domain([.1,1,10]);return e.copy=function(){return oo(e,o4()).base(e.base())},rl.apply(e,arguments)}function s4(){var e=nk(_y());return e.copy=function(){return oo(e,s4()).constant(e.constant())},rl.apply(e,arguments)}function pk(){var e=rk(_y());return e.copy=function(){return oo(e,pk()).exponent(e.exponent())},rl.apply(e,arguments)}function rfe(){return pk.apply(null,arguments).exponent(.5)}const u4=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:QA,scaleDiverging:l4,scaleDivergingLog:o4,scaleDivergingPow:pk,scaleDivergingSqrt:rfe,scaleDivergingSymlog:s4,scaleIdentity:$$,scaleImplicit:Nw,scaleLinear:z$,scaleLog:H$,scaleOrdinal:KA,scalePoint:qse,scalePow:ik,scaleQuantile:W$,scaleQuantize:V$,scaleRadial:q$,scaleSequential:n4,scaleSequentialLog:r4,scaleSequentialPow:dk,scaleSequentialQuantile:a4,scaleSequentialSqrt:nfe,scaleSequentialSymlog:i4,scaleSqrt:Iue,scaleSymlog:F$,scaleThreshold:K$,scaleTime:efe,scaleUtc:tfe,tickFormat:B$},Symbol.toStringTag,{value:"Module"}));function ife(e){var t=u4;if(e in t&&typeof t[e]=="function")return t[e]();var n="scale".concat(rd(e));if(n in t&&typeof t[n]=="function")return t[n]()}function ER(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=ife(e);if(r!=null)return r.domain(t).range(n),r}}function mk(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?ER(e.scale,n,r):ER(t,n,r)}function afe(e){return"scale".concat(rd(e))}function lfe(e){return afe(e)in u4}var c4=(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 lfe(r)?r:"point"}};function ofe(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 f4(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=ofe(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 sfe(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):f4(e,void 0)}function TR(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 pv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TR(Object(n),!0).forEach(function(r){ufe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ufe(e,t,n){return(t=cfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cfe(e){var t=ffe(e,"string");return typeof t=="symbol"?t:t+""}function ffe(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 h4(e,t){return mfe(e)||pfe(e,t)||dfe(e,t)||hfe()}function hfe(){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 dfe(e,t){if(e){if(typeof e=="string")return MR(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)?MR(e,t):void 0}}function MR(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 pfe(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 mfe(e){if(Array.isArray(e))return e}var Iw=[0,"auto"],Kt={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"},d4=(e,t)=>e.cartesianAxis.xAxis[t],il=(e,t)=>{var n=d4(e,t);return n??Kt},Qt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:Iw,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:ld},p4=(e,t)=>e.cartesianAxis.yAxis[t],al=(e,t)=>{var n=p4(e,t);return n??Qt},gfe={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:""},gk=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??gfe},$n=(e,t,n)=>{switch(t){case"xAxis":return il(e,n);case"yAxis":return al(e,n);case"zAxis":return gk(e,n);case"angleAxis":return UA(e,n);case"radiusAxis":return HA(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},vfe=(e,t,n)=>{switch(t){case"xAxis":return il(e,n);case"yAxis":return al(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},gd=(e,t,n)=>{switch(t){case"xAxis":return il(e,n);case"yAxis":return al(e,n);case"angleAxis":return UA(e,n);case"radiusAxis":return HA(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},m4=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function g4(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 Ny=e=>e.graphicalItems.cartesianItems,yfe=W([cn,Ay],g4),v4=(e,t,n)=>e.filter(n).filter(r=>t?.includeHidden===!0?!0:!r.hide),wc=W([Ny,$n,yfe],v4,{memoizeOptions:{resultEqualityCheck:Cy}}),y4=W([wc],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(ky)),b4=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),bfe=W([wc],b4),x4=e=>e.map(t=>t.data).filter(Boolean).flat(1),xfe=W([wc],e=>e.some(t=>!t.data)),S4=W([wc],x4,{memoizeOptions:{resultEqualityCheck:Cy}}),w4=(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)},vk=W([S4,cd],w4),Sfe=(e,t,n)=>t?.dataKey!=null?e.map(r=>({value:zt(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:zt(i,r)}))):e.map(r=>({value:r})),O4=(e,t,n,r,i,a)=>{var l=r.chartData,s=l===void 0?[]:l,c=r.dataStartIndex,f=r.dataEndIndex,d=Sfe(e,t,n);if(i&&t?.dataKey!=null&&a.length>0){var p=s.slice(c,f+1),g=p.map(v=>({value:zt(v,t.dataKey)})).filter(v=>v.value!=null);return[...g,...d]}return d},vd=W([vk,$n,wc,cd,xfe,S4],O4);function Hu(e){if(ra(e)||e instanceof Date){var t=Number(e);if(We(t))return t}}function PR(e){if(Array.isArray(e)){var t=[Hu(e[0]),Hu(e[1])];return Ji(t)?t:void 0}var n=Hu(e);if(n!=null)return[n,n]}function Ai(e){return e.map(Hu).filter(fr)}function wfe(e,t){var n=Hu(e),r=Hu(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var Ofe=W([vd],e=>e?.map(t=>t.value).sort(wfe));function A4(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function Afe(e,t,n){if(!n)return[];if(!n.length)return[];var r;if(typeof t=="number"&&!na(t))r=t;else if(Array.isArray(t)){var i=Ai(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:Ai(n.flatMap(a=>{var l=zt(e,a.dataKey),s,c;if(Array.isArray(l)){var f=h4(l,2);s=f[0],c=f[1]}else s=c=l;if(!(!We(s)||!We(c)))return[r-s,r+c]}))}var en=e=>{var t=fn(e),n=xc(e);return gd(e,t,n)},oc=W([en],e=>e?.dataKey),kfe=W([y4,cd,en],M$),k4=(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=h4(l,2),c=s[0],f=s[1],d=r?[...f].reverse():f,p=d.map(qA);return[c,{stackedData:_ie(e,p,n),graphicalItems:d}]}))},Bw=W([kfe,y4,xy,w$],k4),C4=(e,t,n,r)=>{var i=t.dataStartIndex,a=t.dataEndIndex;if(r==null&&n!=="zAxis")return Iie(e,i,a)},Cfe=W([$n],e=>e.allowDataOverflow),yk=e=>{var t;if(e==null||!("domain"in e))return Iw;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=Ai(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:Iw},E4=W([$n],yk),T4=W([E4,Cfe],u$),Efe=W([Bw,Ti,cn,T4],C4,{memoizeOptions:{resultEqualityCheck:fd}}),bk=e=>e.errorBars,Tfe=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>A4(n,r)),mv=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]}},M4=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=>A4(a,v));p.forEach(v=>{var y,x=zt(v,(y=n.dataKey)!==null&&y!==void 0?y:f.dataKey),w=Afe(v,x,g);if(w.length>=2){var A=Math.min(...w),E=Math.max(...w);(s==null||A<s)&&(s=A),(c==null||E>c)&&(c=E)}var k=PR(x);k!=null&&(s=s==null?k[0]:Math.min(s,k[0]),c=c==null?k[1]:Math.max(c,k[1]))})}),n?.dataKey!=null&&r.length===0&&t.forEach(f=>{var d=PR(zt(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]))}),We(s)&&We(c))return[s,c]},Mfe=W([vk,$n,bfe,bk,cn,ase],M4,{memoizeOptions:{resultEqualityCheck:fd}});function Pfe(e){var t=e.value;if(ra(t)||t instanceof Date)return t}var Dfe=(e,t,n)=>{var r=e.map(Pfe).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&Uz(r))?s$(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},P4=e=>e.referenceElements.dots,Oc=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),_fe=W([P4,cn,Ay],Oc),D4=e=>e.referenceElements.areas,Nfe=W([D4,cn,Ay],Oc),_4=e=>e.referenceElements.lines,Rfe=W([_4,cn,Ay],Oc),N4=(e,t)=>{if(e!=null){var n=Ai(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},jfe=W(_fe,cn,N4),R4=(e,t)=>{if(e!=null){var n=Ai(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)]}},Lfe=W([Nfe,cn],R4);function Ife(e){var t;if(e.x!=null)return Ai([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:Ai(n)}function Bfe(e){var t;if(e.y!=null)return Ai([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:Ai(n)}var j4=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?Ife(r):Bfe(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},zfe=W([Rfe,cn],j4),$fe=W(jfe,zfe,Lfe,(e,t,n)=>mv(e,n,t)),L4=(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?mv(r,a,i):mv(a,i),p=fse(t,d,e.allowDataOverflow);return p??(e.allowDataOverflow&&d==null&&c!=null?c:p)},Ufe=e=>{if(!(e==null||e.type!=="number"||!("ticks"in e)||e.ticks==null)){var t=Ai(e.ticks);if(t.length!==0)return[Math.min(...t),Math.max(...t)]}},Hfe=W([$n],Ufe,{memoizeOptions:{resultEqualityCheck:fd}}),Ffe=W([$n,E4,T4,Efe,Mfe,$fe,nt,cn,Hfe],L4,{memoizeOptions:{resultEqualityCheck:fd}}),qfe=[0,1],I4=(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=el(t,a);if(f&&s==null){var d;return s$(0,(d=n?.length)!==null&&d!==void 0?d:0)}return c==="category"?Dfe(r,e,f):i==="expand"&&!f?qfe:l}},xk=W([$n,nt,vk,vd,xy,cn,Ffe],I4),Ac=W([$n,m4,BA],c4),B4=(e,t,n)=>{var r=t.niceTicks;if(r!=="none"){var i=yk(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&Ji(e)){if(a)return zN(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return $N(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&Ji(e))return zN(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&Ji(e))return $N(e,t.tickCount,t.allowDecimals,"adaptive")}}},Sk=W([xk,gd,Ac],B4),z4=(e,t,n,r)=>{if(r!=="angleAxis"&&e?.type==="number"&&Ji(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},Wfe=W([$n,xk,Sk,cn],z4),Vfe=W(vd,$n,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(Ai(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}}),$4=W(Vfe,nt,S$,un,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!We(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var l=wi(n,e*a),s=e*a/2;return s-l-(s-l)/a*l}return 0}),Kfe=(e,t,n)=>{var r=il(e,t);return r==null||typeof r.padding!="string"?0:$4(e,"xAxis",t,n,r.padding)},Qfe=(e,t,n)=>{var r=al(e,t);return r==null||typeof r.padding!="string"?0:$4(e,"yAxis",t,n,r.padding)},Xfe=W(il,Kfe,(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}}),Yfe=W(al,Qfe,(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}}),U4=W([un,Xfe,yy,vy,(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]}),H4=W([un,nt,Yfe,yy,vy,(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]}),yd=(e,t,n,r)=>{var i;switch(t){case"xAxis":return U4(e,n,r);case"yAxis":return H4(e,n,r);case"zAxis":return(i=gk(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return C$(e);case"radiusAxis":return E$(e,n);default:return}},F4=W([$n,yd],Sy),Gfe=W([Ac,Wfe],Mse),wk=W([$n,Ac,Gfe,F4],mk),q4=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var i=n.type,a=n.scale,l=el(e,r);if(l&&(i==="number"||a!=="auto"))return t.map(s=>s.value)}},Ok=W([nt,vd,gd,cn],q4),Ry=W([wk],WA);W([wk],sfe);W([wk,Ofe],f4);W([wc,bk,cn],Tfe);function W4(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var jy=(e,t)=>t,Ly=(e,t,n)=>n,Zfe=W(my,jy,Ly,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(W4)),Jfe=W(gy,jy,Ly,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(W4)),V4=(e,t)=>({width:e.width,height:t.height}),ehe=(e,t)=>{var n=typeof t.width=="number"?t.width:ld;return{width:n,height:e.height}},K4=W(un,il,V4),the=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},nhe=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},rhe=W(nl,un,Zfe,jy,Ly,(e,t,n,r,i)=>{var a={},l;return n.forEach(s=>{var c=V4(t,s);l==null&&(l=the(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}),ihe=W(tl,un,Jfe,jy,Ly,(e,t,n,r,i)=>{var a={},l;return n.forEach(s=>{var c=ehe(t,s);l==null&&(l=nhe(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}),ahe=(e,t)=>{var n=il(e,t);if(n!=null)return rhe(e,n.orientation,n.mirror)},lhe=W([un,il,ahe,(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}}}),ohe=(e,t)=>{var n=al(e,t);if(n!=null)return ihe(e,n.orientation,n.mirror)},she=W([un,al,ohe,(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}}}),Q4=W(un,al,(e,t)=>{var n=typeof t.width=="number"?t.width:ld;return{width:n,height:e.height}}),DR=(e,t,n)=>{switch(t){case"xAxis":return K4(e,n).width;case"yAxis":return Q4(e,n).height;default:return}},X4=(e,t,n,r)=>{if(n!=null){var i=n.allowDuplicatedCategory,a=n.type,l=n.dataKey,s=el(e,r),c=t.map(d=>d.value),f=c.filter(d=>d!=null);if(l&&s&&a==="category"&&i&&Uz(f))return c}},Ak=W([nt,vd,$n,cn],X4),_R=W([nt,vfe,Ac,Ry,Ak,Ok,yd,Sk,cn],(e,t,n,r,i,a,l,s,c)=>{if(t!=null){var f=el(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}}}),uhe=(e,t,n,r,i,a,l,s,c)=>{if(!(t==null||r==null)){var f=el(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?cr(a[0]-a[1])*2*y:y;var x=p||i;return x?x.map((w,A)=>{var E=l?l.indexOf(w):w,k=r.map(E);return We(k)?{index:A,coordinate:k+y,value:w,offset:y}:null}).filter(fr):f&&s?s.map((w,A)=>{var E=r.map(w);return We(E)?{coordinate:E+y,value:w,index:A,offset:y}:null}).filter(fr):r.ticks?r.ticks(g).map((w,A)=>{var E=r.map(w);return We(E)?{coordinate:E+y,value:w,index:A,offset:y}:null}).filter(fr):r.domain().map((w,A)=>{var E=r.map(w);return We(E)?{coordinate:E+y,value:l?l[w]:w,index:A,offset:y}:null}).filter(fr)}},Y4=W([nt,gd,Ac,Ry,Sk,yd,Ak,Ok,cn],uhe),che=(e,t,n,r,i,a,l)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var s=el(e,l),c=t.tickCount,f=0;return f=l==="angleAxis"&&r?.length>=2?cr(r[0]-r[1])*2*f:f,s&&a?a.map((d,p)=>{var g=n.map(d);return We(g)?{coordinate:g+f,value:d,index:p,offset:f}:null}).filter(fr):n.ticks?n.ticks(c).map((d,p)=>{var g=n.map(d);return We(g)?{coordinate:g+f,value:d,index:p,offset:f}:null}).filter(fr):n.domain().map((d,p)=>{var g=n.map(d);return We(g)?{coordinate:g+f,value:i?i[d]:d,index:p,offset:f}:null}).filter(fr)}},to=W([nt,gd,Ry,yd,Ak,Ok,cn],che),no=W($n,Ry,(e,t)=>{if(!(e==null||t==null))return pv(pv({},e),{},{scale:t})}),fhe=W([$n,Ac,xk,F4],mk),hhe=W([fhe],WA);W((e,t,n)=>gk(e,n),hhe,(e,t)=>{if(!(e==null||t==null))return pv(pv({},e),{},{scale:t})});var dhe=W([nt,my,gy],(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}}),phe=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};W([phe],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 G4=e=>e.options.defaultTooltipEventType,Z4=e=>e.options.validateTooltipEventTypes;function J4(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function bd(e,t){var n=G4(e),r=Z4(e);return J4(t,n,r)}function mhe(e){return we(t=>bd(t,e))}var e8=(e,t)=>{var n,r=Number(t);if(!(na(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},ghe=e=>e.tooltip.settings,zl={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},vhe={itemInteraction:{click:zl,hover:zl},axisInteraction:{click:zl,hover:zl},keyboardInteraction:zl,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}},t8=Bn({name:"tooltip",initialState:vhe,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=Jr(e).tooltipItemPayloads.indexOf(Ye(r));a>-1&&(e.tooltipItemPayloads[a]=Ye(i))},prepare:bt()},removeTooltipEntrySettings:{reducer(e,t){var n=Jr(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}}}),li=t8.actions,yhe=li.addTooltipEntrySettings,bhe=li.replaceTooltipEntrySettings,xhe=li.removeTooltipEntrySettings,She=li.setTooltipSettingsState,n8=li.setActiveMouseOverItemIndex,whe=li.mouseLeaveItem,r8=li.mouseLeaveChart,Ohe=li.setActiveClickItemIndex,i8=li.setMouseOverAxisIndex,Ahe=li.setMouseClickAxisIndex,Kf=li.setSyncInteraction,gv=li.setKeyboardInteraction,khe=t8.reducer;function NR(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 Em(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NR(Object(n),!0).forEach(function(r){Che(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NR(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,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function Phe(e){return e.index!=null}var a8=(e,t,n,r)=>{if(t==null)return zl;var i=Mhe(e,t,n);if(i==null)return zl;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(Phe(i)){if(a)return Em(Em({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return Em(Em({},zl),{},{coordinate:i.coordinate})};function Dhe(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 _he(e,t){var n=Dhe(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 Nhe(e,t,n){if(n==null||t==null)return!0;var r=zt(e,t);return r==null||!Ji(n)?!0:_he(r,n)}var lh=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var a=Number(i);if(!We(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||Nhe(f,n,r)?String(c):null},l8=(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}}},o8=(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})},s8=e=>e.options.tooltipPayloadSearcher,kc=e=>e.tooltip;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 jR(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){Rhe(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 Rhe(e,t,n){return(t=jhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jhe(e){var t=Lhe(e,"string");return typeof t=="symbol"?t:t+""}function Lhe(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 Ihe(e){if(typeof e=="string"||typeof e=="number")return e}function Bhe(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function zhe(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function LR(e){if(typeof e=="string")return e}function $he(e){if(!(e==null||typeof e!="object")){var t="name"in e?Ihe(e.name):void 0,n="unit"in e?Bhe(e.unit):void 0,r="dataKey"in e?zhe(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?LR(e.color):void 0,l="fill"in e?LR(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:l}}}function Uhe(e,t){return e??t}var u8=(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=Uhe(x,s),E=Array.isArray(A)?z5(A,f,d):A,k=(y=w?.dataKey)!==null&&y!==void 0?y:r,M=w?.nameKey,D;if(r&&Array.isArray(E)&&!Array.isArray(E[0])&&l==="axis"?D=Hz(E,r,i):D=a(E,t,c,M),Array.isArray(D))D.forEach(N=>{var L,U,K=$he(N),V=K?.name,B=K?.dataKey,oe=K?.payload,ie=jR(jR({},w),{},{name:V,unit:K?.unit,color:(L=K?.color)!==null&&L!==void 0?L:w?.color,fill:(U=K?.fill)!==null&&U!==void 0?U:w?.fill});g.push(D_({tooltipEntrySettings:ie,dataKey:B,payload:oe,value:zt(oe,B),name:V==null?void 0:String(V)}))});else{var P;g.push(D_({tooltipEntrySettings:w,dataKey:k,payload:D,value:zt(D,k),name:(P=zt(D,M))!==null&&P!==void 0?P:w?.name}))}return g},p)}},kk=W([en,m4,BA],c4),Hhe=W([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),Fhe=W([fn,xc],g4),Os=W([Hhe,en,Fhe],v4,{memoizeOptions:{resultEqualityCheck:Cy}}),qhe=W([Os],e=>e.filter(ky)),c8=W([Os],x4,{memoizeOptions:{resultEqualityCheck:Cy}}),Whe=W([Os],e=>e.some(t=>!t.data)),ms=W([c8,Ti],w4),Vhe=W([qhe,Ti,en],M$),Ck=W([ms,en,Os,Ti,Whe,c8],O4),f8=W([en],yk),Khe=W([en],e=>e.allowDataOverflow),h8=W([f8,Khe],u$),Qhe=W([Os],e=>e.filter(ky)),Xhe=W([Vhe,Qhe,xy,w$],k4),Yhe=W([Xhe,Ti,fn,h8],C4),Ghe=W([Os],b4),Zhe=W([ms,en,Ghe,bk,fn,lse],M4,{memoizeOptions:{resultEqualityCheck:fd}}),Jhe=W([P4,fn,xc],Oc),ede=W([Jhe,fn],N4),tde=W([D4,fn,xc],Oc),nde=W([tde,fn],R4),rde=W([_4,fn,xc],Oc),ide=W([rde,fn],j4),ade=W([ede,ide,nde],mv),lde=W([en,f8,h8,Yhe,Zhe,ade,nt,fn],L4),sc=W([en,nt,ms,Ck,xy,fn,lde],I4),ode=W([sc,en,kk],B4),sde=W([en,sc,ode,fn],z4),d8=e=>{var t=fn(e),n=xc(e),r=!1;return yd(e,t,n,r)},p8=W([en,d8],Sy),ude=W([en,kk,sde,p8],mk),m8=W([ude],WA),cde=W([nt,Ck,en,fn],X4),fde=W([nt,Ck,en,fn],q4),hde=(e,t,n,r,i,a,l,s)=>{if(t){var c=t.type,f=el(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?cr(i[0]-i[1])*2*p:p,f&&l?l.map((g,v)=>{var y=r.map(g);return We(y)?{coordinate:y+p,value:g,index:v,offset:p}:null}).filter(fr):r.domain().map((g,v)=>{var y=r.map(g);return We(y)?{coordinate:y+p,value:a?a[g]:g,index:v,offset:p}:null}).filter(fr)}}},ll=W([nt,en,kk,m8,d8,cde,fde,fn],hde),Ek=W([G4,Z4,ghe],(e,t,n)=>J4(n.shared,e,t)),g8=e=>e.tooltip.settings.trigger,Tk=e=>e.tooltip.settings.defaultIndex,xd=W([kc,Ek,g8,Tk],a8),gs=W([xd,ms,oc,sc],lh),v8=W([ll,gs],e8),y8=W([xd],e=>{if(e)return e.dataKey}),dde=W([xd],e=>{if(e)return e.graphicalItemId}),b8=W([kc,Ek,g8,Tk],o8),pde=W([tl,nl,nt,un,ll,Tk,b8],l8),mde=W([xd,pde],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),gde=W([xd],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),vde=W([b8,gs,Ti,oc,v8,s8,Ek],u8),yde=W([vde],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function IR(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 BR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IR(Object(n),!0).forEach(function(r){bde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bde(e,t,n){return(t=xde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xde(e){var t=Sde(e,"string");return typeof t=="symbol"?t:t+""}function Sde(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 wde=()=>we(en),Ode=()=>{var e=wde(),t=we(ll),n=we(m8);return nc(!e||!n?void 0:BR(BR({},e),{},{scale:n}),t)};function zR(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 du(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zR(Object(n),!0).forEach(function(r){Ade(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ade(e,t,n){return(t=kde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kde(e){var t=Cde(e,"string");return typeof t=="symbol"?t:t+""}function Cde(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 Ede=(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}},Tde=(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 du(du(du({},r),An(r.cx,r.cy,l,a)),{},{angle:a,radius:l})}var s=i.coordinate,c=r.angle;return du(du(du({},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 Mde(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 x8=(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(cr(y-v)!==cr(x-y)){var A=[];if(cr(x-y)===cr(i[1]-i[0])){w=x;var E=y+i[1]-i[0];A[0]=Math.min(E,(E+v)/2),A[1]=Math.max(E,(E+v)/2)}else{w=v;var k=x+i[1]-i[0];A[0]=Math.min(y,(k+y)/2),A[1]=Math.max(y,(k+y)/2)}var M=[Math.min(y,(w+y)/2),Math.max(y,(w+y)/2)];if(e>M[0]&&e<=M[1]||e>=A[0]&&e<=A[1]){var D;return(D=n[s])===null||D===void 0?void 0:D.index}}else{var P=Math.min(v,x),N=Math.max(v,x);if(e>(P+y)/2&&e<=(N+y)/2){var L;return(L=n[s])===null||L===void 0?void 0:L.index}}}else if(t)for(var U=0;U<l;U++){var K=t[U];if(K!=null){var V=t[U+1],B=t[U-1];if(U===0&&V!=null&&e<=(K.coordinate+V.coordinate)/2||U===l-1&&B!=null&&e>(K.coordinate+B.coordinate)/2||U>0&&U<l-1&&B!=null&&V!=null&&e>(K.coordinate+B.coordinate)/2&&e<=(K.coordinate+V.coordinate)/2)return K.index}}return-1},Pde=()=>we(BA),Mk=(e,t)=>t,S8=(e,t,n)=>n,Pk=(e,t,n,r)=>r,Dde=W(ll,e=>ry(e,t=>t.coordinate)),Dk=W([kc,Mk,S8,Pk],a8),_k=W([Dk,ms,oc,sc],lh),_de=(e,t,n)=>{if(t!=null){var r=kc(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},w8=W([kc,Mk,S8,Pk],o8),vv=W([tl,nl,nt,un,ll,Pk,w8],l8),Nde=W([Dk,vv],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),O8=W([ll,_k],e8),Rde=W([w8,_k,Ti,oc,O8,s8,Mk],u8),jde=W([Dk,_k],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),Lde=(e,t,n,r,i,a,l)=>{if(!(!e||!n||!r||!i)&&Mde(e,l)){var s=Bie(e,t),c=x8(s,a,i,n,r),f=Ede(t,i,c,e);return{activeIndex:String(c),activeCoordinate:f}}},Ide=(e,t,n,r,i,a,l)=>{if(!(!e||!r||!i||!a||!n)){var s=Goe(e,n);if(s){var c=zie(s,t),f=x8(c,l,a,r,i),d=Tde(t,a,f,s);return{activeIndex:String(f),activeCoordinate:d}}}},Bde=(e,t,n,r,i,a,l,s)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?Lde(e,t,r,i,a,l,s):Ide(e,t,n,r,i,a,l)},zde=W(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}}),$de=W(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:Tse}});function $R(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 UR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$R(Object(n),!0).forEach(function(r){Ude(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$R(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ude(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=Fde(e,"string");return typeof t=="symbol"?t:t+""}function Fde(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 qde={},Wde={zIndexMap:Object.values(sn).reduce((e,t)=>UR(UR({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),qde)},Vde=new Set(Object.values(sn));function Kde(e){return Vde.has(e)}var A8=Bn({name:"zIndex",initialState:Wde,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&&!Kde(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()}}}),Iy=A8.actions,Qde=Iy.registerZIndexPortal,w1=Iy.unregisterZIndexPortal,Xde=Iy.registerZIndexPortalElement,Yde=Iy.unregisterZIndexPortalElement,Gde=A8.reducer;function oi(e){var t=e.zIndex,n=e.children,r=Oae(),i=r&&t!==void 0&&t!==0,a=zn(),l=O.useRef(void 0),s=O.useRef(new Set),c=St(),f=we(p=>zde(p,t,a));if(O.useLayoutEffect(()=>{if(!i){var p=s.current;p.forEach(v=>{c(w1({zIndex:v}))}),p.clear(),l.current=void 0;return}if(s.current.has(t)||(c(Qde({zIndex:t})),s.current.add(t)),f){l.current=f;var g=s.current;g.forEach(v=>{v!==t&&(c(w1({zIndex:v})),g.delete(v))})}},[c,t,i,f]),O.useLayoutEffect(()=>{var p=s.current;return()=>{p.forEach(g=>{c(w1({zIndex:g}))}),p.clear()}},[c]),!i)return n;var d=f??l.current;return d?pO.createPortal(n,d):null}function zw(){return zw=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},zw.apply(null,arguments)}function HR(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 Tm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HR(Object(n),!0).forEach(function(r){Zde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Zde(e,t,n){return(t=Jde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jde(e){var t=epe(e,"string");return typeof t=="symbol"?t:t+""}function epe(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 tpe(e){var t=e.cursor,n=e.cursorComp,r=e.cursorProps;return O.isValidElement(t)?O.cloneElement(t,r):O.createElement(n,r)}function npe(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=loe,w=sn.cursorLine;else if(d==="BarChart")y=ooe(s,p,a,l),x=a$,w=sn.cursorRectangle;else if(s==="radial"&&Wz(p)){var A=l$(p),E=A.cx,k=A.cy,M=A.radius,D=A.startAngle,P=A.endAngle;y={cx:E,cy:k,startAngle:D,endAngle:P,innerRadius:M,outerRadius:M},x=tse,w=sn.cursorLine}else y={points:nse(s,p,a)},x=J5,w=sn.cursorLine;var N=typeof c=="object"&&"className"in c?c.className:void 0,L=Tm(Tm(Tm(Tm({stroke:"#ccc",pointerEvents:"none"},a),y),nd(c)),{},{payload:g,payloadIndex:v,className:st("recharts-tooltip-cursor",N)});return O.createElement(oi,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:w},O.createElement(tpe,{cursor:c,cursorComp:x,cursorProps:L}))}function rpe(e){var t=Ode(),n=V5(),r=xs(),i=Pde();return t==null||n==null||r==null||i==null?null:O.createElement(npe,zw({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var k8=O.createContext(null),ipe=()=>O.useContext(k8),O1={exports:{}},FR;function ape(){return FR||(FR=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,E,k;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(k=1,E=new Array(A-1);k<A;k++)E[k-1]=arguments[k];w.fn.apply(w.context,E)}else{var M=w.length,D;for(k=0;k<M;k++)switch(w[k].once&&this.removeListener(f,w[k].fn,void 0,!0),A){case 1:w[k].fn.call(w[k].context);break;case 2:w[k].fn.call(w[k].context,d);break;case 3:w[k].fn.call(w[k].context,d,p);break;case 4:w[k].fn.call(w[k].context,d,p,g);break;default:if(!E)for(D=1,E=new Array(A-1);D<A;D++)E[D-1]=arguments[D];w[k].fn.apply(w[k].context,E)}}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})(O1)),O1.exports}var lpe=ape();const ope=Ev(lpe);var Fh=new ope,$w="recharts.syncEvent.tooltip",qR="recharts.syncEvent.brush",C8=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!na(n))return e[n]}},spe={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},E8=Bn({name:"options",initialState:spe,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),upe=E8.reducer,cpe=E8.actions.createEventEmitter;function fpe(e){return e.tooltip.syncInteraction}var hpe={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},T8=Bn({name:"chartData",initialState:hpe,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)}}}),Nk=T8.actions,WR=Nk.setChartData,dpe=Nk.setDataStartEndIndexes;Nk.setComputedData;var ppe=T8.reducer,mpe=["x","y"];function VR(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 pu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VR(Object(n),!0).forEach(function(r){gpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gpe(e,t,n){return(t=vpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vpe(e){var t=ype(e,"string");return typeof t=="symbol"?t:t+""}function ype(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 bpe(e,t){if(e==null)return{};var n,r,i=xpe(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 xpe(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 Spe(){var e=we(zA),t=we($A),n=St(),r=we(O$),i=we(ll),a=xs(),l=by(),s=we(c=>c.rootProps.className);O.useEffect(()=>{if(e==null)return bs;var c=(f,d,p)=>{if(t!==p&&e===f){if(d.payload.active===!1){n(Kf({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=bpe(v,mpe),A=d.payload.sourceViewBox,E=A.x,k=A.y,M=A.width,D=A.height,P=pu(pu({},w),{},{x:l.x+(M?(y-E)/M:0)*l.width,y:l.y+(D?(x-k)/D:0)*l.height});n(pu(pu({},d),{},{payload:pu(pu({},d.payload),{},{coordinate:P})}))}else n(d);return}if(i!=null){var N;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},U=r(i,L);N=i[U]}else r==="value"&&(N=i.find(Z=>String(Z.value)===d.payload.label));var K=d.payload.coordinate;if(K==null||l==null){n(Kf({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(N==null){n(Kf({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,oe=Math.min(V,l.x+l.width),ie=Math.min(B,l.y+l.height),ue={x:a==="horizontal"?N.coordinate:oe,y:a==="horizontal"?ie:N.coordinate},z=Kf({active:d.payload.active,coordinate:ue,dataKey:d.payload.dataKey,index:String(N.index),label:d.payload.label,sourceViewBox:d.payload.sourceViewBox,graphicalItemId:d.payload.graphicalItemId});n(z)}}};return Fh.on($w,c),()=>{Fh.off($w,c)}},[s,n,t,e,r,i,a,l])}function wpe(){var e=we(zA),t=we($A),n=St();O.useEffect(()=>{if(e==null)return bs;var r=(i,a,l)=>{t!==l&&e===i&&n(dpe(a))};return Fh.on(qR,r),()=>{Fh.off(qR,r)}},[n,t,e])}function Ope(){var e=St();O.useEffect(()=>{e(cpe())},[e]),Spe(),wpe()}function Ape(e,t,n,r,i,a){var l=we(y=>_de(y,e,t)),s=we(dde),c=we($A),f=we(zA),d=we(O$),p=we(fpe),g=p?.sourceViewBox!=null,v=by();O.useEffect(()=>{if(!g&&f!=null&&c!=null){var y=Kf({active:a,coordinate:n,dataKey:l,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:v,graphicalItemId:s});Fh.emit($w,f,y,c)}},[g,n,l,s,i,r,c,f,d,a,v])}function KR(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 QR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KR(Object(n),!0).forEach(function(r){kpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kpe(e,t,n){return(t=Cpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cpe(e){var t=Epe(e,"string");return typeof t=="symbol"?t:t+""}function Epe(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 Tpe(e,t){return _pe(e)||Dpe(e,t)||Ppe(e,t)||Mpe()}function Mpe(){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 Ppe(e,t){if(e){if(typeof e=="string")return XR(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)?XR(e,t):void 0}}function XR(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 Dpe(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 _pe(e){if(Array.isArray(e))return e}function Npe(e){return e.dataKey}function Rpe(e,t){return O.isValidElement(e)?O.cloneElement(e,t):typeof e=="function"?O.createElement(e,t):O.createElement(kle,t)}var YR=[],jpe={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 GR(e){var t,n,r=In(e,jpe),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,E=r.shared,k=r.trigger,M=r.defaultIndex,D=r.portal,P=r.axisId,N=St(),L=typeof M=="number"?String(M):M;O.useEffect(()=>{N(She({shared:E,trigger:k,axisId:P,active:i,defaultIndex:L}))},[N,E,k,P,i,L]);var U=by(),K=Z5(),V=mhe(E),B=(t=we(Ee=>jde(Ee,V,k,L)))!==null&&t!==void 0?t:{},oe=B.activeIndex,ie=B.isActive,ue=we(Ee=>Rde(Ee,V,k,L)),z=we(Ee=>O8(Ee,V,k,L)),Z=we(Ee=>Nde(Ee,V,k,L)),ae=ue,Q=ipe(),le=(n=i??ie)!==null&&n!==void 0?n:!1,R=u5([ae,le]),F=Tpe(R,2),ee=F[0],se=F[1],ge=V==="axis"?z:void 0;Ape(V,k,Z,ge,oe,le);var Oe=D??Q;if(Oe==null||U==null||V==null)return null;var Pe=ae??YR;le||(Pe=YR),f&&Pe.length&&(Pe=i5(Pe.filter(Ee=>Ee.value!=null&&(Ee.hide!==!0||r.includeHidden)),g,Npe));var mt=Pe.length>0,ce=QR(QR({},r),{},{payload:Pe,label:ge,active:le,activeIndex:oe,coordinate:Z,accessibilityLayer:K}),Te=O.createElement(Vle,{allowEscapeViewBox:a,animationDuration:l,animationEasing:s,isAnimationActive:d,active:le,coordinate:Z,hasPayload:mt,offset:p,position:v,reverseDirection:y,useTranslate3d:x,viewBox:U,wrapperStyle:w,lastBoundingBox:ee,innerRef:se,hasPortalFromProps:!!D},Rpe(c,ce));return O.createElement(O.Fragment,null,pO.createPortal(Te,Oe),le&&O.createElement(rpe,{cursor:A,tooltipEventType:V,coordinate:Z,payload:Pe,index:oe}))}var M8=e=>null;M8.displayName="Cell";function Lpe(e,t,n){return(t=Ipe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ipe(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)}class zpe{constructor(t){Lpe(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 ZR(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 $pe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZR(Object(n),!0).forEach(function(r){Upe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Upe(e,t,n){return(t=Hpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hpe(e){var t=Fpe(e,"string");return typeof t=="symbol"?t:t+""}function Fpe(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 qpe={cacheSize:2e3,enableCache:!0},P8=$pe({},qpe),JR=new zpe(P8.cacheSize),Wpe={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},ej="recharts_measurement_span";function Vpe(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 tj=(e,t)=>{try{var n=document.getElementById(ej);n||(n=document.createElement("span"),n.setAttribute("id",ej),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,Wpe,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},oh=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||ud.isSsr)return{width:0,height:0};if(!P8.enableCache)return tj(t,n);var r=Vpe(t,n),i=JR.get(r);if(i)return i;var a=tj(t,n);return JR.set(r,a),a},D8;function yv(e,t){return Ype(e)||Xpe(e,t)||Qpe(e,t)||Kpe()}function Kpe(){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 Qpe(e,t){if(e){if(typeof e=="string")return nj(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)?nj(e,t):void 0}}function nj(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 Xpe(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 Ype(e){if(Array.isArray(e))return e}function Gpe(e,t,n){return(t=Zpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zpe(e){var t=Jpe(e,"string");return typeof t=="symbol"?t:t+""}function Jpe(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 rj=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,ij=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,eme=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,tme=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,nme={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},rme=["cm","mm","pt","pc","in","Q","px"];function ime(e){return rme.includes(e)}var Tu="NaN";function ame(e,t){return e*nme[t]}class wn{static parse(t){var n,r=(n=tme.exec(t))!==null&&n!==void 0?n:[],i=yv(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,na(t)&&(this.unit=""),n!==""&&!eme.test(n)&&(this.num=NaN,this.unit=""),ime(n)&&(this.num=ame(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 na(this.num)}}D8=wn;Gpe(wn,"NaN",new D8(NaN,""));function _8(e){if(e==null||e.includes(Tu))return Tu;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=rj.exec(t))!==null&&n!==void 0?n:[],i=yv(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 Tu;t=t.replace(rj,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var p,g=(p=ij.exec(t))!==null&&p!==void 0?p:[],v=yv(g,4),y=v[1],x=v[2],w=v[3],A=wn.parse(y??""),E=wn.parse(w??""),k=x==="+"?A.add(E):A.subtract(E);if(k.isNaN())return Tu;t=t.replace(ij,k.toString())}return t}var aj=/\(([^()]*)\)/;function lme(e){for(var t=e,n;(n=aj.exec(t))!=null;){var r=n,i=yv(r,2),a=i[1];t=t.replace(aj,_8(a))}return t}function ome(e){var t=e.replace(/\s+/g,"");return t=lme(t),t=_8(t),t}function sme(e){try{return ome(e)}catch{return Tu}}function A1(e){var t=sme(e.slice(5,-1));return t===Tu?"":t}var ume=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],cme=["dx","dy","angle","className","breakAll"];function Uw(){return Uw=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},Uw.apply(null,arguments)}function lj(e,t){if(e==null)return{};var n,r,i=fme(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 fme(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 oj(e,t){return mme(e)||pme(e,t)||dme(e,t)||hme()}function hme(){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 dme(e,t){if(e){if(typeof e=="string")return sj(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)?sj(e,t):void 0}}function sj(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 pme(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 mme(e){if(Array.isArray(e))return e}var N8=/[ \f\n\r\t\v\u2028\u2029]+/,R8=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(N8));var a=i.map(s=>({word:s,width:oh(s,r).width})),l=n?0:oh(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:l}}catch{return null}};function j8(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function gme(e){return kt(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var L8=(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},[]),I8=e=>e.reduce((t,n)=>t.width>n.width?t:n),vme="…",uj=(e,t,n,r,i,a,l,s)=>{var c=e.slice(0,t),f=R8({breakAll:n,style:r,children:c+vme});if(!f)return[!1,[]];var d=L8(f.wordsWithComputedWidth,a,l,s),p=d.length>i||I8(d).width>Number(a);return[p,d]},yme=(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=L8(t,r,n,i);if(!f||i)return p;var g=p.length>a||I8(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),E=A-1,k=uj(d,E,c,s,a,r,n,i),M=oj(k,2),D=M[0],P=M[1],N=uj(d,A,c,s,a,r,n,i),L=oj(N,1),U=L[0];if(!D&&!U&&(v=A+1),D&&U&&(y=A-1),!D&&U){w=P;break}x++}return w||p},cj=e=>{var t=kt(e)?[]:e.toString().split(N8);return[{words:t,width:void 0}]},bme=e=>{var t=e.width,n=e.scaleToFit,r=e.children,i=e.style,a=e.breakAll,l=e.maxLines;if((t||n)&&!ud.isSsr){var s,c,f=R8({breakAll:a,children:r,style:i});if(f){var d=f.wordsWithComputedWidth,p=f.spaceWidth;s=d,c=p}else return cj(r);return yme({breakAll:a,children:r,maxLines:l,style:i},s,c,t,!!n)}return cj(r)},B8="#808080",xme={angle:0,breakAll:!1,capHeight:"0.71em",fill:B8,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Rk=O.forwardRef((e,t)=>{var n=In(e,xme),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=lj(n,ume),g=O.useMemo(()=>bme({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,E=lj(p,cme);if(!ra(r)||!ra(i)||g.length===0)return null;var k=Number(r)+(be(v)?v:0),M=Number(i)+(be(y)?y:0);if(!We(k)||!We(M))return null;var D;switch(d){case"start":D=A1("calc(".concat(l,")"));break;case"middle":D=A1("calc(".concat((g.length-1)/2," * -").concat(a," + (").concat(l," / 2))"));break;default:D=A1("calc(".concat(g.length-1," * -").concat(a,")"));break}var P=[],N=g[0];if(c&&N!=null){var L=N.width,U=p.width;P.push("scale(".concat(be(U)&&be(L)?U/L:1,")"))}return x&&P.push("rotate(".concat(x,", ").concat(k,", ").concat(M,")")),P.length&&(E.transform=P.join(" ")),O.createElement("text",Uw({},_r(E),{ref:t,x:k,y:M,className:st("recharts-text",w),textAnchor:f,fill:s.includes("url")?B8:s}),g.map((K,V)=>{var B=K.words.join(A?"":" ");return O.createElement("tspan",{x:k,dy:V===0?D:a,key:"".concat(B,"-").concat(V)},B)}))});Rk.displayName="Text";function fj(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?fj(Object(n),!0).forEach(function(r){Sme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Sme(e,t,n){return(t=wme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wme(e){var t=Ome(e,"string");return typeof t=="symbol"?t:t+""}function Ome(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 Ame=e=>{var t=e.viewBox,n=e.position,r=e.offset,i=r===void 0?0:r,a=e.parentViewBox,l=PA(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,E=A*i,k=A>0?"end":"start",M=A>0?"start":"end",D=d>=0?1:-1,P=D*i,N=D>0?"end":"start",L=D>0?"start":"end",U=a;if(n==="top"){var K={x:g+d/2,y:c-E,horizontalAnchor:"middle",verticalAnchor:k};return U&&(K.height=Math.max(c-U.y,0),K.width=d),K}if(n==="bottom"){var V={x:v+p/2,y:c+f+E,horizontalAnchor:"middle",verticalAnchor:M};return U&&(V.height=Math.max(U.y+U.height-(c+f),0),V.width=p),V}if(n==="left"){var B={x:y-P,y:c+f/2,horizontalAnchor:N,verticalAnchor:"middle"};return U&&(B.width=Math.max(B.x-U.x,0),B.height=f),B}if(n==="right"){var oe={x:y+x+P,y:c+f/2,horizontalAnchor:L,verticalAnchor:"middle"};return U&&(oe.width=Math.max(U.x+U.width-oe.x,0),oe.height=f),oe}var ie=U?{width:x,height:f}:{};return n==="insideLeft"?Bi({x:y+P,y:c+f/2,horizontalAnchor:L,verticalAnchor:"middle"},ie):n==="insideRight"?Bi({x:y+x-P,y:c+f/2,horizontalAnchor:N,verticalAnchor:"middle"},ie):n==="insideTop"?Bi({x:g+d/2,y:c+E,horizontalAnchor:"middle",verticalAnchor:M},ie):n==="insideBottom"?Bi({x:v+p/2,y:c+f-E,horizontalAnchor:"middle",verticalAnchor:k},ie):n==="insideTopLeft"?Bi({x:g+P,y:c+E,horizontalAnchor:L,verticalAnchor:M},ie):n==="insideTopRight"?Bi({x:g+d-P,y:c+E,horizontalAnchor:N,verticalAnchor:M},ie):n==="insideBottomLeft"?Bi({x:v+P,y:c+f-E,horizontalAnchor:L,verticalAnchor:k},ie):n==="insideBottomRight"?Bi({x:v+p-P,y:c+f-E,horizontalAnchor:N,verticalAnchor:k},ie):n&&typeof n=="object"&&(be(n.x)||hs(n.x))&&(be(n.y)||hs(n.y))?Bi({x:s+wi(n.x,x),y:c+wi(n.y,f),horizontalAnchor:"end",verticalAnchor:"end"},ie):Bi({x:w,y:c+f/2,horizontalAnchor:"middle",verticalAnchor:"middle"},ie)},kme=["labelRef"],Cme=["content"];function hj(e,t){if(e==null)return{};var n,r,i=Eme(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 Eme(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 dj(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 Qf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dj(Object(n),!0).forEach(function(r){Tme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tme(e,t,n){return(t=Mme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mme(e){var t=Pme(e,"string");return typeof t=="symbol"?t:t+""}function Pme(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 Na(){return Na=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},Na.apply(null,arguments)}var z8=O.createContext(null),Dme=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(z8.Provider,{value:c},s)},$8=()=>{var e=O.useContext(z8),t=by();return e||(t?PA(t):void 0)},_me=O.createContext(null),Nme=()=>{var e=O.useContext(_me),t=we(T$);return e||t},Rme=e=>{var t=e.value,n=e.formatter,r=kt(e.children)?t:e.children;return typeof n=="function"?n(r):r},jk=e=>e!=null&&typeof e=="function",jme=(e,t)=>{var n=cr(t-e),r=Math.min(Math.abs(t-e),360);return n*r},Lme=(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=jme(p,g),w=x>=0?1:-1,A,E;switch(t){case"insideStart":A=p+w*a,E=v;break;case"insideEnd":A=g-w*a,E=!v;break;case"end":A=g+w*a,E=v;break;default:throw new Error("Unsupported position ".concat(t))}E=x<=0?E:!E;var k=An(s,c,y,A),M=An(s,c,y,A+(E?1:-1)*359),D="M".concat(k.x,",").concat(k.y,`
|
|
114
|
-
A`).concat(y,",").concat(y,",0,1,").concat(E?0:1,`,
|
|
115
|
-
`).concat(M.x,",").concat(M.y),P=kt(e.id)?Nh("recharts-radial-line-"):e.id;return O.createElement("text",Na({},r,{dominantBaseline:"central",className:st("recharts-radial-bar-label",l)}),O.createElement("defs",null,O.createElement("path",{id:P,d:D})),O.createElement("textPath",{xlinkHref:"#".concat(P)},n))},Ime=(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"}},Ym=e=>e!=null&&"cx"in e&&be(e.cx),Bme={angle:0,offset:5,zIndex:sn.label,position:"middle",textBreakAll:!1};function zme(e){if(!Ym(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 Ll(e){var t=In(e,Bme),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=Nme(),v=$8(),y=i==="center"?v:g??v,x,w,A;n==null?x=y:Ym(n)?x=n:x=PA(n);var E=zme(x);if(!x||kt(a)&&kt(l)&&!O.isValidElement(s)&&typeof s!="function")return null;var k=Qf(Qf({},t),{},{viewBox:x});if(O.isValidElement(s)){k.labelRef;var M=hj(k,kme);return O.cloneElement(s,M)}if(typeof s=="function"){k.content;var D=hj(k,Cme);if(w=O.createElement(s,D),O.isValidElement(w))return w}else w=Rme(t);var P=_r(t);if(Ym(x)){if(i==="insideStart"||i==="insideEnd"||i==="end")return Lme(t,i,w,P,x);A=Ime(x,t.offset,t.position)}else{if(!E)return null;var N=Ame({viewBox:E,position:i,offset:t.offset,parentViewBox:Ym(r)?void 0:r});A=Qf(Qf({x:N.x,y:N.y,textAnchor:N.horizontalAnchor,verticalAnchor:N.verticalAnchor},N.width!==void 0?{width:N.width}:{}),N.height!==void 0?{height:N.height}:{})}return O.createElement(oi,{zIndex:t.zIndex},O.createElement(Rk,Na({ref:p,className:st("recharts-label",f)},P,A,{textAnchor:j8(P.textAnchor)?P.textAnchor:A.textAnchor,breakAll:d}),w))}Ll.displayName="Label";var $me=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?O.createElement(Ll,Na({key:"label-implicit"},r)):ra(e)?O.createElement(Ll,Na({key:"label-implicit",value:e},r)):O.isValidElement(e)?e.type===Ll?O.cloneElement(e,Qf({key:"label-implicit"},r)):O.createElement(Ll,Na({key:"label-implicit",content:e},r)):jk(e)?O.createElement(Ll,Na({key:"label-implicit",content:e},r)):e&&typeof e=="object"?O.createElement(Ll,Na({},e,{key:"label-implicit"},r)):null};function Ume(e){var t=e.label,n=e.labelRef,r=$8();return $me(t,r,n)||null}var Hme=["valueAccessor"],Fme=["dataKey","clockWise","id","textBreakAll","zIndex"];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)}function pj(e,t){if(e==null)return{};var n,r,i=qme(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 qme(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 Wme=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(gme(t))return t},U8=O.createContext(void 0),H8=U8.Provider,F8=O.createContext(void 0);F8.Provider;function Vme(){return O.useContext(U8)}function Kme(){return O.useContext(F8)}function Gm(e){var t=e.valueAccessor,n=t===void 0?Wme:t,r=pj(e,Hme),i=r.dataKey;r.clockWise;var a=r.id,l=r.textBreakAll,s=r.zIndex,c=pj(r,Fme),f=Vme(),d=Kme(),p=f||d;return!p||!p.length?null:O.createElement(oi,{zIndex:s??sn.label},O.createElement(Nr,{className:"recharts-label-list"},p.map((g,v)=>{var y,x=kt(i)?n(g,v):zt(g.payload,i),w=kt(a)?{}:{id:"".concat(a,"-").concat(v)};return O.createElement(Ll,bv({key:"label-".concat(v)},_r(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}))})))}Gm.displayName="LabelList";function q8(e){var t=e.label;return t?t===!0?O.createElement(Gm,{key:"labelList-implicit"}):O.isValidElement(t)||jk(t)?O.createElement(Gm,{key:"labelList-implicit",content:t}):typeof t=="object"?O.createElement(Gm,bv({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}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)}var W8=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",Hw({},Si(e),bA(e),{className:a,cx:t,cy:n,r})):null},Qme={radiusAxis:{},angleAxis:{}},V8=Bn({name:"polarAxis",initialState:Qme,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]}}}),By=V8.actions;By.addRadiusAxis;By.removeRadiusAxis;By.addAngleAxis;By.removeAngleAxis;var Xme=V8.reducer;function Yme(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var k1={exports:{}},lt={};var mj;function Gme(){if(mj)return lt;mj=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 gj;function Zme(){return gj||(gj=1,k1.exports=Gme()),k1.exports}var Jme=Zme(),vj=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",yj=null,C1=null,K8=e=>{if(e===yj&&Array.isArray(C1))return C1;var t=[];return O.Children.forEach(e,n=>{kt(n)||(Jme.isFragment(n)?t=t.concat(K8(n.props.children)):t.push(n))}),C1=t,yj=e,t};function ege(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>vj(i)):r=[vj(t)],K8(e).forEach(i=>{var a=Qa(i,"type.displayName")||Qa(i,"type.name");a&&r.indexOf(a)!==-1&&n.push(i)}),n}var Q8=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function bj(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 xj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bj(Object(n),!0).forEach(function(r){tge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tge(e,t,n){return(t=nge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nge(e){var t=rge(e,"string");return typeof t=="symbol"?t:t+""}function rge(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 X8(e,t){return xj(xj({},t),e)}function ige(e){return O.isValidElement(e)?e.props:e}function age(e,t){return O.cloneElement(e,X8(ige(e),t))}function lge(e){if("index"in e){var t=e.index;return typeof t=="number"||typeof t=="string"?t:void 0}}function oge(e){return"isActive"in e&&e.isActive===!0}function Y8(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=lge(r),f;return O.isValidElement(t)?f=age(t,r):t===n?f=O.createElement(n,r):typeof t=="function"?f=t(r,c):typeof t=="object"?f=O.createElement(n,X8(t,r)):f=O.createElement(n,r),oge(r)?O.createElement(Nr,{className:a},f):O.createElement(Nr,{className:s},f)}var G8=(e,t,n)=>{var r=St();return(i,a)=>l=>{e?.(i,a,l),r(n8({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},Z8=e=>{var t=St();return(n,r)=>i=>{e?.(n,r,i),t(whe())}},J8=(e,t,n)=>{var r=St();return(i,a)=>l=>{e?.(i,a,l),r(Ohe({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function e6(e){var t=e.tooltipEntrySettings,n=St(),r=zn(),i=O.useRef(null);return O.useLayoutEffect(()=>{r||(i.current===null?n(yhe(t)):i.current!==t&&n(bhe({prev:i.current,next:t})),i.current=t)},[t,n,r]),O.useLayoutEffect(()=>()=>{i.current&&(n(xhe(i.current)),i.current=null)},[n]),null}function t6(e){var t=e.legendPayload,n=St(),r=zn(),i=O.useRef(null);return O.useLayoutEffect(()=>{r||(i.current===null?n(Cae(t)):i.current!==t&&n(Eae({prev:i.current,next:t})),i.current=t)},[n,r,t]),O.useLayoutEffect(()=>()=>{i.current&&(n(Tae(i.current)),i.current=null)},[n]),null}function sge(e,t){return hge(e)||fge(e,t)||cge(e,t)||uge()}function uge(){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 cge(e,t){if(e){if(typeof e=="string")return Sj(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)?Sj(e,t):void 0}}function Sj(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 fge(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 hge(e){if(Array.isArray(e))return e}var Lk="index",n6="append";function Ik(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 dge(e,t){var n=e.length/t.length,r=t.map((i,a)=>e[Math.floor(a*n)]);return Ik(r,t)}function pge(e,t){var n=t.map((r,i)=>e[i]);return Ik(n,t)}function mge(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 gge(e,t,n){var r=mge(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=sge(s,2),f=c[0],d=c[1];i.has(f)||l.push(d)}return Ik(a,t,l)}function vge(e,t,n){return t==null?null:e==null?t.map(r=>({status:"added",next:r})):n===Lk?dge(e,t):n===n6?pge(e,t):gge(e,t,n)}function yge(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 bge(e,t){return Oge(e)||wge(e,t)||Sge(e,t)||xge()}function xge(){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 Sge(e,t){if(e){if(typeof e=="string")return wj(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)?wj(e,t):void 0}}function wj(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 wge(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 Oge(e){if(Array.isArray(e))return e}function r6(e,t){var n=O.useState(!1),r=bge(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 i6(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=i$(n,r),E=yge(A,a),k=(t=E.startValue)!==null&&t!==void 0?t:null,M=vge(k,i,v??Lk);return O.createElement(r$,{animationId:A,begin:s,duration:c,isActive:l,easing:f,onAnimationEnd:p,onAnimationStart:d,key:A},D=>{var P=k==null,N=i==null?i:g(M,D,w),L=y?y(D):D>0;return E.syncStepValue(N,D,L),N==null?null:x(N,D,P)})}var E1;function Age(e,t){return Tge(e)||Ege(e,t)||Cge(e,t)||kge()}function kge(){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 Cge(e,t){if(e){if(typeof e=="string")return Oj(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)?Oj(e,t):void 0}}function Oj(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 Ege(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 Tge(e){if(Array.isArray(e))return e}var Mge=()=>{var e=O.useState(()=>Nh("uid-")),t=Age(e,1),n=t[0];return n},Pge=(E1=y9.useId)!==null&&E1!==void 0?E1:Mge;function Dge(e,t){var n=Pge();return t||(e?"".concat(e,"-").concat(n):n)}var _ge=O.createContext(void 0),a6=e=>{var t=e.id,n=e.type,r=e.children,i=Dge("recharts-".concat(n),t);return O.createElement(_ge.Provider,{value:i},r(i))},Nge={cartesianItems:[],polarItems:[]},l6=Bn({name:"graphicalItems",initialState:Nge,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=Jr(e).cartesianItems.indexOf(Ye(r));a>-1&&(e.cartesianItems[a]=Ye(i))},prepare:bt()},removeCartesianGraphicalItem:{reducer(e,t){var n=Jr(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=Jr(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=Jr(e).polarItems.indexOf(Ye(r));a>-1&&(e.polarItems[a]=Ye(i))},prepare:bt()}}}),Cc=l6.actions,Rge=Cc.addCartesianGraphicalItem,jge=Cc.replaceCartesianGraphicalItem,Lge=Cc.removeCartesianGraphicalItem;Cc.addPolarGraphicalItem;Cc.removePolarGraphicalItem;Cc.replacePolarGraphicalItem;var Ige=l6.reducer,Bge=e=>{var t=St(),n=O.useRef(null);return O.useLayoutEffect(()=>{n.current===null?t(Rge(e)):n.current!==e&&t(jge({prev:n.current,next:e})),n.current=e},[t,e]),O.useLayoutEffect(()=>()=>{n.current&&(t(Lge(n.current)),n.current=null)},[t]),null},o6=O.memo(Bge),zge=["points"];function Aj(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 T1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Aj(Object(n),!0).forEach(function(r){$ge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Aj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $ge(e,t,n){return(t=Uge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Uge(e){var t=Hge(e,"string");return typeof t=="symbol"?t:t+""}function Hge(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 xv(){return xv=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},xv.apply(null,arguments)}function Fge(e,t){if(e==null)return{};var n,r,i=qge(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 qge(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 Wge(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=Fge(a,zge);return O.createElement(W8,xv({},l,{className:i}))}function Vge(e,t){return e==null?!1:t?!0:e.length===1}function Kge(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(!Vge(t,n))return null;var p=Q8(n),g=Wee(n),v=t.map((x,w)=>{var A,E,k=T1(T1(T1({r:3},l),g),{},{index:w,cx:(A=x.x)!==null&&A!==void 0?A:void 0,cy:(E=x.y)!==null&&E!==void 0?E:void 0,dataKey:a,value:x.value,payload:x.payload,points:t});return O.createElement(Wge,{key:"dot-".concat(w),option:n,dotProps:k,className:i})}),y={};return s&&c!=null&&(y.clipPath="url(#clipPath-".concat(p?"":"dots-").concat(c,")")),O.createElement(oi,{zIndex:d},O.createElement(Nr,xv({className:r},y),v))}function kj(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 Cj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kj(Object(n),!0).forEach(function(r){Qge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qge(e,t,n){return(t=Xge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xge(e){var t=Yge(e,"string");return typeof t=="symbol"?t:t+""}function Yge(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 s6=0,Gge={xAxis:{},yAxis:{},zAxis:{}},u6=Bn({name:"cartesianAxis",initialState:Gge,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]=Cj(Cj({},a),{},{width:i,widthHistory:c})}}}}),ca=u6.actions,Zge=ca.addXAxis,Jge=ca.replaceXAxis,eve=ca.removeXAxis,tve=ca.addYAxis,nve=ca.replaceYAxis,rve=ca.removeYAxis;ca.addZAxis;ca.replaceZAxis;ca.removeZAxis;var ive=ca.updateYAxisWidth,ave=u6.reducer,lve=W([un],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),ove=W([lve,tl,nl],(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)}}),Bk=()=>we(ove),sve=()=>we(yde);function Ej(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 M1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ej(Object(n),!0).forEach(function(r){uve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ej(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uve(e,t,n){return(t=cve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cve(e){var t=fve(e,"string");return typeof t=="symbol"?t:t+""}function fve(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 hve=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=M1(M1(M1({},s),nd(i)),bA(i)),f;return O.isValidElement(i)?f=O.cloneElement(i,c):typeof i=="function"?f=i(c):f=O.createElement(W8,c),O.createElement(Nr,{className:"recharts-active-dot",clipPath:l},f)};function dve(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(gs),f=sve();if(t==null||f==null)return null;var d=t.find(p=>f.includes(p.payload));return kt(d)?null:O.createElement(oi,{zIndex:s},O.createElement(hve,{point:d,childIndex:Number(c),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}function pve(e,t){return yve(e)||vve(e,t)||gve(e,t)||mve()}function mve(){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 gve(e,t){if(e){if(typeof e=="string")return Tj(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)?Tj(e,t):void 0}}function Tj(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 vve(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 yve(e){if(Array.isArray(e))return e}var Mj=(e,t,n)=>{var r=n??e;if(!kt(r))return wi(r,t,0)},bve=(e,t,n)=>{var r={},i=e.filter(ky),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=pve(f,2),g=p[0],v=p[1],y=v.map(w=>w.dataKey),x=Mj(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=Mj(t,n,f.barSize);return{stackId:void 0,dataKeys:d,barSize:p}});return[...s,...c]};function Pj(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 Mm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Pj(Object(n),!0).forEach(function(r){xve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xve(e,t,n){return(t=Sve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sve(e){var t=wve(e,"string");return typeof t=="symbol"?t:t+""}function wve(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 Ove(e,t,n,r,i){var a,l=r.length;if(!(l<1)){var s=wi(e,n,0,!0),c,f=[];if(We((a=r[0])===null||a===void 0?void 0:a.barSize)){var d=!1,p=n/l,g=r.reduce((E,k)=>E+(k.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((E,k)=>{var M,D={stackId:k.stackId,dataKeys:k.dataKeys,position:{offset:y.offset+y.size+s,size:d?p:(M=k.barSize)!==null&&M!==void 0?M:0}},P=[...E,D];return y=D.position,P},f)}else{var x=wi(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=We(i)?Math.min(w,i):w;c=r.reduce((E,k,M)=>[...E,{stackId:k.stackId,dataKeys:k.dataKeys,position:{offset:x+(w+s)*M+(w-A)/2,size:A}}],f)}return c}}var Ave=(e,t,n,r,i,a,l)=>{var s=kt(l)?t:l,c=Ove(n,r,i!==a?i:a,e,s);return i!==a&&c!=null&&(c=c.map(f=>Mm(Mm({},f),{},{position:Mm(Mm({},f.position),{},{offset:f.position.offset-i/2})}))),c},kve=(e,t)=>{var n=qA(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)}}}},Cve=(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 Eve(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&We(e.zIndex)?e.zIndex:t}var Tve=e=>{var t=e.chartData,n=St(),r=zn();return O.useEffect(()=>r?()=>{}:(n(WR(t)),()=>{n(WR(void 0))}),[t,n,r]),null},Dj={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},c6=Bn({name:"brush",initialState:Dj,reducers:{setBrushSettings(e,t){return t.payload==null?Dj:t.payload}}});c6.actions.setBrushSettings;var Mve=c6.reducer;function Pve(e){return(e%180+180)%180}var Dve=function(t){var n=t.width,r=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Pve(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)},_ve={dots:[],areas:[],lines:[]},f6=Bn({name:"referenceElements",initialState:_ve,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=Jr(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=Jr(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=Jr(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),Ec=f6.actions;Ec.addDot;Ec.removeDot;Ec.addArea;Ec.removeArea;Ec.addLine;Ec.removeLine;var Nve=f6.reducer;function Rve(e,t){return Bve(e)||Ive(e,t)||Lve(e,t)||jve()}function jve(){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 Lve(e,t){if(e){if(typeof e=="string")return _j(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)?_j(e,t):void 0}}function _j(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 Ive(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 Bve(e){if(Array.isArray(e))return e}var zve=O.createContext(void 0),$ve=e=>{var t=e.children,n=O.useState("".concat(Nh("recharts"),"-clip")),r=Rve(n,1),i=r[0],a=Bk();if(a==null)return null;var l=a.x,s=a.y,c=a.width,f=a.height;return O.createElement(zve.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 h6(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 Uve(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Dve(r,n)}function Hve(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 qh(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 Fve(e,t){return h6(e,t+1)}function qve(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:h6(r,f)};var x=c,w,A=()=>(w===void 0&&(w=n(y,x)),w),E=y.coordinate,k=c===0||qh(e,E,A,d,s);k||(c=0,d=l,f+=1),k&&(d=E+e*(A()/2+i),c+=f)},g;f<=a.length;)if(g=p(),g)return g.v;return[]}function Wve(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 M=r[x];if(M==null)return 0;var D=x,P,N=()=>(P===void 0&&(P=n(M,D)),P),L=M.coordinate,U=x===d||qh(e,L,N,p,c);if(!U)return g=!1,1;U&&(p=L+e*(N()/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 E=r[A];E!=null&&w.push(E)}return w}}return[]}function Nj(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?Nj(Object(n),!0).forEach(function(r){Vve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Vve(e,t,n){return(t=Kve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kve(e){var t=Qve(e,"string");return typeof t=="symbol"?t:t+""}function Qve(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 Xve(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 E=qh(e,y.tickCoord,w,s,c);E&&(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 Yve(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=qh(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(E){var k=l[E];if(k==null)return 1;var M=k,D,P=()=>(D===void 0&&(D=n(k,E)),D);if(E===0){var N=e*(M.coordinate-e*P()/2-c);l[E]=M=En(En({},M),{},{tickCoord:N<0?M.coordinate-N*e:M.coordinate})}else l[E]=M=En(En({},M),{},{tickCoord:M.coordinate});if(M.tickCoord!=null){var L=qh(e,M.tickCoord,P,c,f);L&&(c=M.tickCoord+e*(P()/2+i),l[E]=En(En({},M),{},{isShow:!0}))}},w=0;w<y;w++)x(w);return l}function zk(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)||ud.isSsr){var g;return(g=Fve(i,be(c)?c:0))!==null&&g!==void 0?g:[]}var v=[],y=s==="top"||s==="bottom"?"width":"height",x=d&&y==="width"?oh(d,{fontSize:t,letterSpacing:n}):{width:0,height:0},w=(D,P)=>{var N=typeof f=="function"?f(D.value,P):D.value;return y==="width"?Uve(oh(N,{fontSize:t,letterSpacing:n}),x,p):oh(N,{fontSize:t,letterSpacing:n})[y]},A=i[0],E=i[1],k=i.length>=2&&A!=null&&E!=null?cr(E.coordinate-A.coordinate):1,M=Hve(a,k,y);return c==="equidistantPreserveStart"?qve(k,M,w,i,l):c==="equidistantPreserveEnd"?Wve(k,M,w,i,l):(c==="preserveStart"||c==="preserveStartEnd"?v=Yve(k,M,w,i,l,c==="preserveStartEnd"):v=Xve(k,M,w,i,l),v.filter(D=>D.isShow))}var Gve=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},Zve={xAxis:{},yAxis:{}},d6=Bn({name:"renderedTicks",initialState:Zve,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]}}}),p6=d6.actions,Jve=p6.setRenderedTicks,eye=p6.removeRenderedTicks,tye=d6.reducer,nye=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function Rj(e,t){return lye(e)||aye(e,t)||iye(e,t)||rye()}function rye(){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 iye(e,t){if(e){if(typeof e=="string")return jj(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)?jj(e,t):void 0}}function jj(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 aye(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 lye(e){if(Array.isArray(e))return e}function oye(e,t){if(e==null)return{};var n,r,i=sye(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 sye(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 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 Lj(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 Pt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Lj(Object(n),!0).forEach(function(r){uye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uye(e,t,n){return(t=cye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cye(e){var t=fye(e,"string");return typeof t=="symbol"?t:t+""}function fye(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 Ua={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 hye(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=Pt(Pt(Pt({},c),Si(s)),{},{fill:"none"});if(a==="top"||a==="bottom"){var d=+(a==="top"&&!l||a==="bottom"&&l);f=Pt(Pt({},f),{},{x1:t,y1:n+d*i,x2:t+r,y2:n+d*i})}else{var p=+(a==="left"&&!l||a==="right"&&l);f=Pt(Pt({},f),{},{x1:t+p*r,y1:n,x2:t+p*r,y2:n+i})}return O.createElement("line",vs({},f,{className:st("recharts-cartesian-axis-line",Qa(s,"className"))}))}function dye(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 pye(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function mye(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function gye(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,Pt(Pt({},n),{},{className:a}));else if(typeof t=="function")i=t(Pt(Pt({},n),{},{className:a}));else{var l="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(l=st(l,Yme(t))),i=O.createElement(Rk,vs({},n,{className:l}),r)}return i}function vye(e){var t=e.ticks,n=e.axisType,r=e.axisId,i=St();return O.useEffect(()=>{if(r==null||n==null)return bs;var a=t.map(l=>({value:l.value,coordinate:l.coordinate,offset:l.offset,index:l.index}));return i(Jve({ticks:a,axisId:r,axisType:n})),()=>{i(eye({axisId:r,axisType:n}))}},[i,t,r,n]),null}var yye=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,E=e.tickMargin,k=e.fontSize,M=e.letterSpacing,D=e.getTicksConfig,P=e.events,N=e.axisType,L=e.axisId,U=zk(Pt(Pt({},D),{},{ticks:r}),k,M),K=Si(D),V=nd(i),B=j8(K.textAnchor)?K.textAnchor:pye(p,g),oe=mye(p,g),ie={};typeof a=="object"&&(ie=a);var ue=Pt(Pt({},K),{},{fill:"none"},ie),z=U.map(Q=>Pt({entry:Q},dye(Q,v,y,x,w,p,A,g,E))),Z=z.map(Q=>{var le=Q.entry,R=Q.line;return O.createElement(Nr,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(le.value,"-").concat(le.coordinate,"-").concat(le.tickCoord)},a&&O.createElement("line",vs({},ue,R,{className:st("recharts-cartesian-axis-tick-line",Qa(a,"className"))})))}),ae=z.map((Q,le)=>{var R,F,ee=Q.entry,se=Q.tick,ge=Pt(Pt(Pt(Pt({verticalAnchor:oe},K),{},{textAnchor:B,stroke:"none",fill:l},se),{},{index:le,payload:ee,visibleTicksCount:U.length,tickFormatter:s,padding:f},d),{},{angle:(R=(F=d?.angle)!==null&&F!==void 0?F:K.angle)!==null&&R!==void 0?R:0}),Oe=Pt(Pt({},ge),V);return O.createElement(Nr,vs({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(ee.value,"-").concat(ee.coordinate,"-").concat(ee.tickCoord)},ny(P,ee,le)),i&&O.createElement(gye,{option:i,tickProps:Oe,value:"".concat(typeof s=="function"?s(ee.value,le):ee.value).concat(c||"")}))});return O.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(N,"-ticks")},O.createElement(vye,{ticks:U,axisId:L,axisType:N}),ae.length>0&&O.createElement(oi,{zIndex:sn.label},O.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(N,"-tick-labels"),ref:t},ae)),Z.length>0&&O.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(N,"-tick-lines")},Z))}),bye=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=oye(e,nye),p=O.useState(""),g=Rj(p,2),v=g[0],y=g[1],x=O.useState(""),w=Rj(x,2),A=w[0],E=w[1],k=O.useRef(null);O.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var D;return Gve({ticks:k.current,label:(D=e.labelRef)===null||D===void 0?void 0:D.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var M=O.useCallback(D=>{if(D){var P=D.getElementsByClassName("recharts-cartesian-axis-tick-value");k.current=P;var N=P[0];if(N){var L=window.getComputedStyle(N),U=L.fontSize,K=L.letterSpacing;(U!==v||K!==A)&&(y(U),E(K))}}},[v,A]);return l||r!=null&&r<=0||i!=null&&i<=0?null:O.createElement(oi,{zIndex:e.zIndex},O.createElement(Nr,{className:st("recharts-cartesian-axis",a)},O.createElement(hye,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:Si(e)}),O.createElement(yye,{ref:M,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(Dme,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},O.createElement(Ume,{label:e.label,labelRef:e.labelRef}),e.children)))}),$k=O.forwardRef((e,t)=>{var n=In(e,Ua);return O.createElement(bye,vs({},n,{ref:t}))});$k.displayName="CartesianAxis";var xye=["x1","y1","x2","y2","key"],Sye=["offset"],wye=["xAxisId","yAxisId"],Oye=["xAxisId","yAxisId"];function Ij(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 Dn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ij(Object(n),!0).forEach(function(r){Aye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ij(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Aye(e,t,n){return(t=kye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kye(e){var t=Cye(e,"string");return typeof t=="symbol"?t:t+""}function Cye(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 Qo(){return Qo=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},Qo.apply(null,arguments)}function Sv(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}var Tye=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 m6(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=Sv(n,xye),p=(i=Si(d))!==null&&i!==void 0?i:{};p.offset;var g=Sv(p,Sye);r=O.createElement("line",Qo({},g,{x1:a,y1:l,x2:s,y2:c,fill:"none",key:f}))}return r}function Mye(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=Sv(e,wye),s=a.map((c,f)=>{var d=Dn(Dn({},l),{},{x1:t,y1:c,x2:t+n,y2:c,key:"line-".concat(f),index:f});return O.createElement(m6,{key:"line-".concat(f),option:i,lineItemProps:d})});return O.createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function Pye(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=Sv(e,Oye),s=a.map((c,f)=>{var d=Dn(Dn({},l),{},{x1:c,y1:t,x2:c,y2:t+n,key:"line-".concat(f),index:f});return O.createElement(m6,{option:i,lineItemProps:d,key:"line-".concat(f)})});return O.createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function Dye(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 _ye(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 Nye=(e,t)=>{var n=e.xAxis,r=e.width,i=e.height,a=e.offset;return $5(zk(Dn(Dn(Dn({},Ua),n),{},{ticks:U5(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},Rye=(e,t)=>{var n=e.yAxis,r=e.width,i=e.height,a=e.offset;return $5(zk(Dn(Dn(Dn({},Ua),n),{},{ticks:U5(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},jye={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:sn.grid};function Fw(e){var t=DA(),n=_A(),r=V5(),i=Dn(Dn({},In(e,jye)),{},{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=zn(),x=we(U=>_R(U,"xAxis",a,y)),w=we(U=>_R(U,"yAxis",l,y));if(!ia(f)||!ia(d)||!be(s)||!be(c))return null;var A=i.verticalCoordinatesGenerator||Nye,E=i.horizontalCoordinatesGenerator||Rye,k=i.horizontalPoints,M=i.verticalPoints;if((!k||!k.length)&&typeof E=="function"){var D=g&&g.length,P=E({yAxis:w?Dn(Dn({},w),{},{ticks:D?g:w.ticks}):void 0,width:t??f,height:n??d,offset:r},D?!0:p);Yg(Array.isArray(P),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof P,"]")),Array.isArray(P)&&(k=P)}if((!M||!M.length)&&typeof A=="function"){var N=v&&v.length,L=A({xAxis:x?Dn(Dn({},x),{},{ticks:N?v:x.ticks}):void 0,width:t??f,height:n??d,offset:r},N?!0:p);Yg(Array.isArray(L),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof L,"]")),Array.isArray(L)&&(M=L)}return O.createElement(oi,{zIndex:i.zIndex},O.createElement("g",{className:"recharts-cartesian-grid"},O.createElement(Tye,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),O.createElement(Dye,Qo({},i,{horizontalPoints:k})),O.createElement(_ye,Qo({},i,{verticalPoints:M})),O.createElement(Mye,Qo({},i,{offset:r,horizontalPoints:k,xAxis:x,yAxis:w})),O.createElement(Pye,Qo({},i,{offset:r,verticalPoints:M,xAxis:x,yAxis:w}))))}Fw.displayName="CartesianGrid";var Lye=["animationElapsedTime","isAnimating","isEntrance","visibleLength","strokeDasharray","connectNulls"];function qw(){return qw=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},qw.apply(null,arguments)}function Iye(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}function zye(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function g6(e,t){return"".concat(t,"px ").concat(e,"px")}function $ye(e){return e.length%2!==0?[...e,...e]:e}function Uye(e,t){for(var n=[],r=0;r<t;++r)n.push(...e);return n}function Hye(e,t,n){var r=$ye(n),i=r.reduce((v,y)=>v+y,0);if(!i)return g6(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[...Uye(r,a),...s,...g].map(v=>"".concat(v,"px")).join(", ")}function Fye(e,t,n){if(e){var r="".concat(e).split(/[,\s]+/gim).map(i=>parseFloat(i));return Hye(n,t,r)}return g6(t,n)}function qye(e){e.animationElapsedTime,e.isAnimating,e.isEntrance;var t=e.visibleLength,n=e.strokeDasharray,r=e.connectNulls,i=Iye(e,Lye),a=r??!1,l;if(t!=null){var s,c=i.pathRef,f=zye((s=c?.current)!==null&&s!==void 0?s:null);l=Fye(n,f,t)}else n!=null&&(l=String(n));return O.createElement(J5,qw({},i,{connectNulls:a,strokeDasharray:l}))}function Wye(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(ja(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 Vye={},v6=Bn({name:"errorBars",initialState:Vye,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))}}}),Uk=v6.actions;Uk.addErrorBar;Uk.replaceErrorBar;Uk.removeErrorBar;var Kye=v6.reducer,Qye=["children"];function Xye(e,t){if(e==null)return{};var n,r,i=Yye(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 Yye(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 Gye={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},Zye=O.createContext(Gye);function y6(e){var t=e.children,n=Xye(e,Qye);return O.createElement(Zye.Provider,{value:n},t)}function Hk(e,t){var n,r,i=we(f=>il(f,e)),a=we(f=>al(f,t)),l=(n=i?.allowDataOverflow)!==null&&n!==void 0?n:Kt.allowDataOverflow,s=(r=a?.allowDataOverflow)!==null&&r!==void 0?r:Qt.allowDataOverflow,c=l||s;return{needClip:c,needClipX:l,needClipY:s}}function b6(e){var t=e.xAxisId,n=e.yAxisId,r=e.clipPathId,i=Bk(),a=Hk(t,n),l=a.needClipX,s=a.needClipY,c=a.needClip,f=we(k=>U4(k,t,!1)),d=we(k=>H4(k,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,E=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:E}))}var x6=(e,t,n,r)=>no(e,"xAxis",t,r),S6=(e,t,n,r)=>to(e,"xAxis",t,r),w6=(e,t,n,r)=>no(e,"yAxis",n,r),O6=(e,t,n,r)=>to(e,"yAxis",n,r),Jye=W([nt,x6,w6,S6,O6],(e,t,n,r,i)=>el(e,"xAxis")?nc(t,r,!1):nc(n,i,!1)),e0e=(e,t,n,r,i)=>i;function t0e(e){return e.type==="line"}var n0e=W([Ny,e0e],(e,t)=>e.filter(t0e).find(n=>n.id===t)),r0e=W([nt,x6,w6,S6,O6,n0e,Jye,cd],(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 k0e({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:p,bandSize:l,displayedData:v})}});function i0e(e){var t=nd(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 a0e=["id"],l0e=["type","layout","connectNulls","needClip","shape","strokeDasharray"],o0e=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function wv(){return wv=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},wv.apply(null,arguments)}function Fk(e,t){if(e==null)return{};var n,r,i=s0e(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 s0e(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 Bj(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 Ui(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Bj(Object(n),!0).forEach(function(r){u0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function u0e(e,t,n){return(t=c0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c0e(e){var t=f0e(e,"string");return typeof t=="symbol"?t:t+""}function f0e(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 h0e(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function d0e(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 p0e=(e,t)=>{if(e==null)return[];if(t===1)return e.flatMap(s=>s.status==="removed"?[]:[s.next]);var n=d0e(e),r=[];for(var i of e)if(i.status==="matched")r.push(Ui(Ui({},i.next),{},{x:qt(i.prev.x,i.next.x,t),y:qt(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(Ui(Ui({},i.next),{},{x:qt(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(Ui(Ui({},i.prev),{},{x:qt(i.prev.x,l,t),y:i.prev.y}))}return r},qk={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",animationInterpolateFn:p0e,animationMatchBy:Lk,connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",shape:qye,stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:sn.line,type:"linear"},m0e=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:py(n,t),payload:e}]},g0e=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:bs,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:py(l,t),hide:s,type:d,color:r,unit:c,formatter:f,graphicalItemId:p}};return O.createElement(e6,{tooltipEntrySettings:g})});function v0e(e){var t=e.clipPathId,n=e.points,r=e.props,i=r.dot,a=r.dataKey,l=r.needClip;r.id;var s=Fk(r,a0e),c=Si(s);return O.createElement(Kge,{points:n,dot:i,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:c,needClip:l,clipPathId:t})}function y0e(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 Ui(Ui({},c),{},{value:a.value,payload:a.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[r]);return O.createElement(H8,{value:t?i:void 0},n)}function b0e(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=Fk(i,l0e),w=Ui(Ui({},_r(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(Y8,{option:v,DefaultShape:qk.shape,shapeProps:w}),O.createElement(v0e,{points:r,clipPathId:t,props:i}))}function x0e(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=h0e(r.current),y=r6(n.onAnimationStart,n.onAnimationEnd),x=y.isAnimating,w=y.handleAnimationStart,A=y.handleAnimationEnd,E=!x,k=Wye(a),M=O.useCallback(D=>D>0&&v>0,[v]);return O.createElement(y0e,{points:a,showLabels:E},n.children,O.createElement(i6,{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:M,layout:g},(D,P,N)=>{var L=x||P<1,U=L?k(P,v):null;return O.createElement(b0e,{props:n,points:D,clipPathId:t,pathRef:r,animationElapsedTime:P,isAnimating:L,isEntrance:N,visibleLength:U})}),O.createElement(q8,{label:n.label}))}function S0e(e){var t=e.clipPathId,n=e.props,r=O.useRef(null),i=O.useRef(null);return O.createElement(x0e,{props:n,clipPathId:t,previousPointsRef:r,pathRef:i})}var w0e=(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:zt(e.payload,t)}};class O0e 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=i0e(r),E=A.r,k=A.strokeWidth,M=Q8(r),D=E*2+k,P=v?"url(#clipPath-".concat(M?"":"dots-").concat(w,")"):void 0;return O.createElement(oi,{zIndex:y},O.createElement(Nr,{className:x},v&&O.createElement("defs",null,O.createElement(b6,{clipPathId:w,xAxisId:l,yAxisId:s}),!M&&O.createElement("clipPath",{id:"clipPath-dots-".concat(w)},O.createElement("rect",{x:f-D/2,y:c-D/2,width:d+D,height:p+D}))),O.createElement(y6,{xAxisId:l,yAxisId:s,data:i,dataPointFormatter:w0e,errorBarOffset:0},O.createElement(S0e,{props:this.props,clipPathId:w}))),O.createElement(dve,{activeDot:this.props.activeDot,points:i,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:P}))}}function A0e(e){var t=In(e,qk),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=Fk(t,o0e),A=Hk(v,y),E=A.needClip,k=Bk(),M=xs(),D=zn(),P=we(V=>r0e(V,v,y,D,x));if(M!=="horizontal"&&M!=="vertical"||P==null||k==null)return null;var N=k.height,L=k.width,U=k.x,K=k.y;return O.createElement(O0e,wv({},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:P,layout:M,height:N,width:L,left:U,top:K,needClip:E}))}function k0e(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=zt(f,l);if(t==="horizontal"){var g=E_({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=E_({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 C0e(e){var t=In(e,qk),n=zn();return O.createElement(a6,{id:t.id,type:"line"},r=>O.createElement(O.Fragment,null,O.createElement(t6,{legendPayload:m0e(t)}),O.createElement(g0e,{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(o6,{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(A0e,wv({},t,{id:r}))))}var A6=O.memo(C0e,vc);A6.displayName="Line";function As(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:s6}function ks(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:s6}var E0e="Invariant failed";function T0e(e,t){throw new Error(E0e)}var M0e=["option"];function P0e(e,t){if(e==null)return{};var n,r,i=D0e(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 D0e(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 Wk=a$;function Vk(e){var t=e.option,n=P0e(e,M0e);return O.createElement(Y8,{option:t,DefaultShape:Wk,shapeProps:n,activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"})}var _0e=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||T0e(),n)}},N0e=(e,t,n)=>n,R0e=(e,t)=>t,Sd=W([Ny,R0e],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),j0e=W([Sd],e=>e?.maxBarSize),L0e=(e,t,n,r)=>r,I0e=W([nt,Ny,As,ks,N0e],(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")),B0e=(e,t,n)=>{var r=nt(e),i=As(e,t),a=ks(e,t);if(!(i==null||a==null))return r==="horizontal"?Bw(e,"yAxis",a,n):Bw(e,"xAxis",i,n)},z0e=(e,t)=>{var n=nt(e),r=As(e,t),i=ks(e,t);if(!(r==null||i==null))return n==="horizontal"?DR(e,"xAxis",r):DR(e,"yAxis",i)},$0e=W([I0e,Sse,z0e],bve),U0e=(e,t,n)=>{var r,i,a=Sd(e,t);if(a==null)return 0;var l=As(e,t),s=ks(e,t);if(l==null||s==null)return 0;var c=nt(e),f=x$(e),d=a.maxBarSize,p=kt(d)?f:d,g,v;return c==="horizontal"?(g=no(e,"xAxis",l,n),v=to(e,"xAxis",l,n)):(g=no(e,"yAxis",s,n),v=to(e,"yAxis",s,n)),(r=(i=nc(g,v,!0))!==null&&i!==void 0?i:p)!==null&&r!==void 0?r:0},k6=(e,t,n)=>{var r=nt(e),i=As(e,t),a=ks(e,t);if(!(i==null||a==null)){var l,s;return r==="horizontal"?(l=no(e,"xAxis",i,n),s=to(e,"xAxis",i,n)):(l=no(e,"yAxis",a,n),s=to(e,"yAxis",a,n)),nc(l,s)}},H0e=W([$0e,x$,xse,S$,U0e,k6,j0e],Ave),F0e=(e,t,n)=>{var r=As(e,t);if(r!=null)return no(e,"xAxis",r,n)},q0e=(e,t,n)=>{var r=ks(e,t);if(r!=null)return no(e,"yAxis",r,n)},W0e=(e,t,n)=>{var r=As(e,t);if(r!=null)return to(e,"xAxis",r,n)},V0e=(e,t,n)=>{var r=ks(e,t);if(r!=null)return to(e,"yAxis",r,n)},K0e=W([H0e,Sd],Cve),Q0e=W([B0e,Sd],kve),X0e=W([un,TA,F0e,q0e,W0e,V0e,K0e,nt,ise,k6,Q0e,Sd,L0e],(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 Tbe({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})}}),Y0e=["index"];function Ww(){return Ww=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},Ww.apply(null,arguments)}function G0e(e,t){if(e==null)return{};var n,r,i=Z0e(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 Z0e(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 C6=O.createContext(void 0),J0e=e=>{var t=O.useContext(C6);if(t!=null)return t.stackId;if(e!=null)return Nie(e)},ebe=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),tbe=e=>{var t=O.useContext(C6);if(t!=null){var n=t.stackId;return"url(#".concat(ebe(n,e),")")}},E6=e=>{var t=e.index,n=G0e(e,Y0e),r=tbe(t);return O.createElement(Nr,Ww({className:"recharts-bar-stack-layer",clipPath:r},n))},nbe=["onMouseEnter","onMouseLeave","onClick"],rbe=["value","background","tooltipPosition"],ibe=["id"],abe=["onMouseEnter","onClick","onMouseLeave"];function zj(e,t){return ube(e)||sbe(e,t)||obe(e,t)||lbe()}function lbe(){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 obe(e,t){if(e){if(typeof e=="string")return $j(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)?$j(e,t):void 0}}function $j(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 sbe(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 ube(e){if(Array.isArray(e))return e}function ro(){return ro=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},ro.apply(null,arguments)}function Uj(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?Uj(Object(n),!0).forEach(function(r){cbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cbe(e,t,n){return(t=fbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fbe(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 Ov(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}var pbe=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:py(n,t),payload:e}]},mbe=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:bs,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:py(a,t),hide:l,type:f,color:i,unit:s,formatter:c,graphicalItemId:d}};return O.createElement(e6,{tooltipEntrySettings:p})});function gbe(e){var t=we(gs),n=e.data,r=e.dataKey,i=e.background,a=e.allOtherBarProps,l=a.onMouseEnter,s=a.onMouseLeave,c=a.onClick,f=Ov(a,nbe),d=G8(l,r,a.id),p=Z8(s),g=J8(c,r,a.id);if(!i||n==null)return null;var v=nd(i);return O.createElement(oi,{zIndex:Eve(i,sn.barBackground)},n.map((y,x)=>{y.value;var w=y.background;y.tooltipPosition;var A=Ov(y,rbe);if(!w)return null;var E=d(y,y.originalDataIndex),k=p(y,y.originalDataIndex),M=g(y,y.originalDataIndex),D=Xt(Xt(Xt(Xt(Xt({option:i,isActive:String(y.originalDataIndex)===t},A),{},{fill:"#eee"},w),v),ny(f,y,x)),{},{onMouseEnter:E,onMouseLeave:k,onClick:M,dataKey:r,index:x,className:"recharts-bar-background-rectangle"});return O.createElement(Vk,ro({key:"background-bar-".concat(x)},D))}))}function vbe(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(H8,{value:t?i:void 0},n)}function ybe(e){var t=e.shape,n=e.activeBar,r=e.baseProps,i=e.entry,a=e.index,l=e.dataKey,s=we(gs),c=we(y8),f=n&&String(i.originalDataIndex)===s&&(c==null||l===c),d=O.useState(!1),p=zj(d,2),g=p[0],v=p[1],y=O.useState(!1),x=zj(y,2),w=x[0],A=x[1];O.useEffect(()=>{var N;return f?(v(!0),N=requestAnimationFrame(()=>{A(!0)})):A(!1),()=>{cancelAnimationFrame(N)}},[f]);var E=O.useCallback(()=>{f||v(!1)},[f]),k=f&&w,M=f||g,D;f?n===!0?D=t:D=n:D=t;var P=O.createElement(Vk,ro({},r,{name:String(r.name)},i,{isActive:k,option:D,index:a,dataKey:l,animationElapsedTime:e.animationElapsedTime,isAnimating:e.isAnimating,isEntrance:e.isEntrance,onTransitionEnd:E}));return M?O.createElement(oi,{zIndex:sn.activeBar},O.createElement(E6,{index:i.originalDataIndex},P)):P}function bbe(e){var t=e.shape,n=e.baseProps,r=e.entry,i=e.index,a=e.dataKey;return O.createElement(Vk,ro({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a,animationElapsedTime:e.animationElapsedTime,isAnimating:e.isAnimating,isEntrance:e.isEntrance}))}function xbe(e){var t,n=e.data,r=e.props,i=e.animationElapsedTime,a=e.isAnimating,l=e.isEntrance,s=(t=Si(r))!==null&&t!==void 0?t:{},c=s.id,f=Ov(s,ibe),d=r.shape,p=r.dataKey,g=r.activeBar,v=r.onMouseEnter,y=r.onClick,x=r.onMouseLeave,w=Ov(r,abe),A=G8(v,p,c),E=Z8(x),k=J8(y,p,c);return n?O.createElement(O.Fragment,null,n.map((M,D)=>O.createElement(E6,ro({index:M.originalDataIndex,key:"rectangle-".concat(M?.x,"-").concat(M?.y,"-").concat(M?.value,"-").concat(D),className:"recharts-bar-rectangle"},ny(w,M,D),{onMouseEnter:A(M,M.originalDataIndex),onMouseLeave:E(M,M.originalDataIndex),onClick:k(M,M.originalDataIndex)}),g?O.createElement(ybe,{shape:d,activeBar:g,baseProps:f,entry:M,index:D,dataKey:p,animationElapsedTime:i,isAnimating:a,isEntrance:l}):O.createElement(bbe,{shape:d,baseProps:f,entry:M,index:D,dataKey:p,animationElapsedTime:i,isAnimating:a,isEntrance:l})))):null}var Sbe=(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:qt(r.prev.height,0,t),y:qt(r.prev.y,r.prev.y+r.prev.height,t)})]:[Xt(Xt({},r.prev),{},{width:qt(r.prev.width,0,t)})];if(r.status==="matched")return[Xt(Xt({},r.next),{},{x:qt(r.prev.x,r.next.x,t),y:qt(r.prev.y,r.next.y,t),width:qt(r.prev.width,r.next.width,t),height:qt(r.prev.height,r.next.height,t)})];var i=r.next;return n==="horizontal"?[Xt(Xt({},i),{},{height:qt(0,i.height,t),y:qt(i.stackedBarStart,i.y,t)})]:[Xt(Xt({},i),{},{width:qt(0,i.width,t),x:qt(i.stackedBarStart,i.x,t)})]});function wbe(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=r6(t.onAnimationStart,t.onAnimationEnd),p=d.isAnimating,g=d.handleAnimationStart,v=d.handleAnimationEnd;return O.createElement(vbe,{showLabels:!p,rects:r},O.createElement(i6,{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(Nr,null,O.createElement(xbe,{props:t,data:y,animationElapsedTime:x,isAnimating:p||x<1,isEntrance:w}))),O.createElement(q8,{label:t.label}),t.children)}function Obe(e){var t=O.useRef(null);return O.createElement(wbe,{previousRectanglesRef:t,props:e})}var T6=0,Abe=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:zt(e,t)}};class kbe 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(Nr,{className:p,id:d},c&&O.createElement("defs",null,O.createElement(b6,{clipPathId:g,xAxisId:l,yAxisId:s})),O.createElement(Nr,{className:"recharts-bar-rectangles",clipPath:c?"url(#clipPath-".concat(g,")"):void 0},O.createElement(gbe,{data:r,dataKey:i,background:f,allOtherBarProps:this.props}),O.createElement(Obe,this.props)))}}var Cbe={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",animationInterpolateFn:Sbe,animationMatchBy:n6,background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:T6,shape:Wk,xAxisId:0,yAxisId:0,zIndex:sn.bar};function Ebe(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=Hk(t,n),g=p.needClip,v=xs(),y=zn(),x=ege(e.children,M8),w=we(k=>X0e(k,e.id,y,x));if(v!=="vertical"&&v!=="horizontal")return null;var A,E=w?.[0];return E==null||E.height==null||E.width==null?A=0:A=v==="vertical"?E.height/2:E.width/2,O.createElement(y6,{xAxisId:t,yAxisId:n,data:w,dataPointFormatter:Abe,errorBarOffset:A},O.createElement(kbe,ro({},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 Tbe(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,E=t==="horizontal"?f:c,k=g?E.scale.domain():null,M=Rie({numericAxis:E}),D=E.scale.map(M);return v.map((P,N)=>{var L,U,K,V,B,oe;if(g){var ie=g[N+A];if(ie==null)return null;L=Tie(ie,k)}else L=zt(P,r),Array.isArray(L)||(L=[M,L]);var ue=_0e(i,T6)(L[1],N);if(t==="horizontal"){var z,Z=f.scale.map(L[0]),ae=f.scale.map(L[1]);if(Z==null||ae==null)return null;U=T_({axis:c,ticks:d,bandSize:s,offset:l.offset,entry:P,index:N}),K=(z=ae??Z)!==null&&z!==void 0?z:void 0,V=l.size;var Q=Z-ae;if(B=na(Q)?0:Q,oe={x:U,y:y.top,width:V,height:y.height},Math.abs(ue)>0&&Math.abs(B)<Math.abs(ue)){var le=cr(B||ue)*(Math.abs(ue)-Math.abs(B));K-=le,B+=le}}else{var R=c.scale.map(L[0]),F=c.scale.map(L[1]);if(R==null||F==null)return null;if(U=R,K=T_({axis:f,ticks:p,bandSize:s,offset:l.offset,entry:P,index:N}),V=F-R,B=l.size,oe={x:y.left,y:K,width:y.width,height:B},Math.abs(ue)>0&&Math.abs(V)<Math.abs(ue)){var ee=cr(V||ue)*(Math.abs(ue)-Math.abs(V));V+=ee}}if(U==null||K==null||V==null||B==null||!a&&(V===0||B===0))return null;var se=Xt(Xt({},P),{},{stackedBarStart:D,x:U,y:K,width:V,height:B,value:g?L:L[1],payload:P,background:oe,tooltipPosition:{x:U+V/2,y:K+B/2},parentViewBox:w,originalDataIndex:N},x&&x[N]&&x[N].props);return se}).filter(Boolean)}function Mbe(e){var t=In(e,Cbe),n=J0e(t.stackId),r=zn();return O.createElement(a6,{id:t.id,type:"bar"},i=>O.createElement(O.Fragment,null,O.createElement(t6,{legendPayload:pbe(t)}),O.createElement(mbe,{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(o6,{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!==Wk}),O.createElement(oi,{zIndex:t.zIndex},O.createElement(Ebe,ro({},t,{id:i})))))}var M6=O.memo(Mbe,vc);M6.displayName="Bar";var Pbe=["domain","range"],Dbe=["domain","range"];function Hj(e,t){if(e==null)return{};var n,r,i=_be(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 _be(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 Fj(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 P6(e,t){if(e===t)return!0;var n=e.domain,r=e.range,i=Hj(e,Pbe),a=t.domain,l=t.range,s=Hj(t,Dbe);return!Fj(n,a)||!Fj(r,l)?!1:vc(i,s)}var Nbe=["type"],Rbe=["dangerouslySetInnerHTML","ticks","scale"],jbe=["id","scale"];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 qj(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 Wj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qj(Object(n),!0).forEach(function(r){Lbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lbe(e,t,n){return(t=Ibe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ibe(e){var t=Bbe(e,"string");return typeof t=="symbol"?t:t+""}function Bbe(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 Kw(e,t){if(e==null)return{};var n,r,i=zbe(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 zbe(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 $be(e){var t=St(),n=O.useRef(null),r=K5(),i=e.type,a=Kw(e,Nbe),l=wy(r,"xAxis",i),s=O.useMemo(()=>{if(l!=null)return Wj(Wj({},a),{},{type:l})},[a,l]);return O.useLayoutEffect(()=>{s!=null&&(n.current===null?t(Zge(s)):n.current!==s&&t(Jge({prev:n.current,next:s})),n.current=s)},[s,t]),O.useLayoutEffect(()=>()=>{n.current&&(t(eve(n.current)),n.current=null)},[t]),null}var Ube=e=>{var t=e.xAxisId,n=e.className,r=we(TA),i=zn(),a="xAxis",l=we(g=>Y4(g,a,t,i)),s=we(g=>K4(g,t)),c=we(g=>lhe(g,t)),f=we(g=>d4(g,t));if(s==null||c==null||f==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var d=Kw(e,Rbe);f.id,f.scale;var p=Kw(f,jbe);return O.createElement($k,Vw({},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}))},Hbe={allowDataOverflow:Kt.allowDataOverflow,allowDecimals:Kt.allowDecimals,allowDuplicatedCategory:Kt.allowDuplicatedCategory,angle:Kt.angle,axisLine:Ua.axisLine,height:Kt.height,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:Ua.tickLine,tickSize:Ua.tickSize,type:Kt.type,niceTicks:Kt.niceTicks,xAxisId:0},Fbe=e=>{var t=In(e,Hbe);return O.createElement(O.Fragment,null,O.createElement($be,{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(Ube,t))},Qw=O.memo(Fbe,P6);Qw.displayName="XAxis";var qbe=["type"],Wbe=["dangerouslySetInnerHTML","ticks","scale"],Vbe=["id","scale"];function Xw(){return Xw=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},Xw.apply(null,arguments)}function Vj(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 Kj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Vj(Object(n),!0).forEach(function(r){Kbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vj(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kbe(e,t,n){return(t=Qbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qbe(e){var t=Xbe(e,"string");return typeof t=="symbol"?t:t+""}function Xbe(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 Yw(e,t){if(e==null)return{};var n,r,i=Ybe(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 Ybe(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 Gbe(e){var t=St(),n=O.useRef(null),r=K5(),i=e.type,a=Yw(e,qbe),l=wy(r,"yAxis",i),s=O.useMemo(()=>{if(l!=null)return Kj(Kj({},a),{},{type:l})},[l,a]);return O.useLayoutEffect(()=>{s!=null&&(n.current===null?t(tve(s)):n.current!==s&&t(nve({prev:n.current,next:s})),n.current=s)},[s,t]),O.useLayoutEffect(()=>()=>{n.current&&(t(rve(n.current)),n.current=null)},[t]),null}function Zbe(e){var t=e.yAxisId,n=e.className,r=e.width,i=e.label,a=O.useRef(null),l=O.useRef(null),s=we(TA),c=zn(),f=St(),d="yAxis",p=we(A=>Q4(A,t)),g=we(A=>she(A,t)),v=we(A=>Y4(A,d,t,c)),y=we(A=>p4(A,t));if(O.useLayoutEffect(()=>{if(!(r!=="auto"||!p||jk(i)||O.isValidElement(i)||y==null)){var A=a.current;if(A){var E=A.getCalculatedWidth();Math.round(p.width)!==Math.round(E)&&f(ive({id:t,width:E}))}}},[v,p,f,i,t,r,y]),p==null||g==null||y==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var x=Yw(e,Wbe);y.id,y.scale;var w=Yw(y,Vbe);return O.createElement($k,Xw({},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 Jbe={allowDataOverflow:Qt.allowDataOverflow,allowDecimals:Qt.allowDecimals,allowDuplicatedCategory:Qt.allowDuplicatedCategory,angle:Qt.angle,axisLine:Ua.axisLine,hide:!1,includeHidden:Qt.includeHidden,interval:Qt.interval,label:!1,minTickGap:Qt.minTickGap,mirror:Qt.mirror,orientation:Qt.orientation,padding:Qt.padding,reversed:Qt.reversed,scale:Qt.scale,tick:Qt.tick,tickCount:Qt.tickCount,tickLine:Ua.tickLine,tickSize:Ua.tickSize,type:Qt.type,niceTicks:Qt.niceTicks,width:Qt.width,yAxisId:0},exe=e=>{var t=In(e,Jbe);return O.createElement(O.Fragment,null,O.createElement(Gbe,{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(Zbe,t))},Gw=O.memo(exe,P6);Gw.displayName="YAxis";var txe=(e,t)=>t,Kk=W([txe,nt,T$,fn,p8,ll,Dde,un],Bde);function nxe(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function Qk(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(nxe(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 D6=Rr("mouseClick"),_6=ad();_6.startListening({actionCreator:D6,effect:(e,t)=>{var n=e.payload,r=Kk(t.getState(),Qk(n));r?.activeIndex!=null&&t.dispatch(Ahe({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var Zw=Rr("mouseMove"),N6=ad(),mu=null,Mo=null,P1=null;N6.startListening({actionCreator:Zw,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");mu!==null&&(cancelAnimationFrame(mu),mu=null),Mo!==null&&(typeof a!="number"||!s)&&(clearTimeout(Mo),Mo=null),P1=Qk(n);var c=()=>{var f=t.getState(),d=bd(f,f.tooltip.settings.shared);if(!P1){mu=null,Mo=null;return}if(d==="axis"){var p=Kk(f,P1);p?.activeIndex!=null?t.dispatch(i8({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate})):t.dispatch(r8())}mu=null,Mo=null};if(!s){c();return}a==="raf"?mu=requestAnimationFrame(c):typeof a=="number"&&Mo===null&&(Mo=setTimeout(c,a))}});function rxe(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 Qj={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},R6=Bn({name:"rootProps",initialState:Qj,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:Qj.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}}}),ixe=R6.reducer,axe=R6.actions.updateOptions,lxe=null,oxe={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)},j6=Bn({name:"polarOptions",initialState:lxe,reducers:oxe});j6.actions.updatePolarOptions;var sxe=j6.reducer,L6=Rr("keyDown"),I6=Rr("focus"),B6=Rr("blur"),zy=ad(),gu=null,Po=null,Pm=null;zy.startListening({actionCreator:L6,effect:(e,t)=>{Pm=e.payload,gu!==null&&(cancelAnimationFrame(gu),gu=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=Pm;if(p!=="ArrowRight"&&p!=="ArrowLeft"&&p!=="Enter")return;var g=lh(d,ms(c),oc(c),sc(c)),v=g==null?-1:Number(g),y=!Number.isFinite(v)||v<0,x=ll(c),w=ms(c),A=bd(c,c.tooltip.settings.shared);if(p==="Enter"){if(y)return;var E=vv(c,A,"hover",String(d.index));t.dispatch(gv({active:!d.active,activeIndex:d.index,activeCoordinate:E}));return}var k=dhe(c),M=k==="left-to-right"?1:-1,D=p==="ArrowRight"?1:-1,P;if(y){var N=oc(c),L=sc(c),U=D*M,K=ue=>({active:!1,index:String(ue),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(P=-1,U>0){for(var V=0;V<w.length;V++)if(lh(K(V),w,N,L)!=null){P=V;break}}else for(var B=w.length-1;B>=0;B--)if(lh(K(B),w,N,L)!=null){P=B;break}if(P<0)return}else{P=v+D*M;var oe=x?.length||w.length;if(oe===0||P>=oe||P<0)return}var ie=vv(c,A,"hover",String(P));t.dispatch(gv({active:!0,activeIndex:P.toString(),activeCoordinate:ie}))}finally{gu=null,Po=null}};if(!l){s();return}i==="raf"?gu=requestAnimationFrame(s):typeof i=="number"&&Po===null&&(s(),Pm=null,Po=setTimeout(()=>{Pm?s():(Po=null,gu=null)},i))}});zy.startListening({actionCreator:I6,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=bd(n,n.tooltip.settings.shared),s=vv(n,l,"hover",String(a));t.dispatch(gv({active:!0,activeIndex:a,activeCoordinate:s}))}}}});zy.startListening({actionCreator:B6,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var i=n.tooltip.keyboardInteraction;i.active&&t.dispatch(gv({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function z6(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 Kr=Rr("externalEvent"),$6=ad(),Dm=new Map,Bf=new Map,D1=new Map;$6.startListening({actionCreator:Kr,effect:(e,t)=>{var n=e.payload,r=n.handler,i=n.reactEvent;if(r!=null){var a=i.type,l=z6(i);D1.set(a,{handler:r,reactEvent:l});var s=Dm.get(a);s!==void 0&&(cancelAnimationFrame(s),Dm.delete(a));var c=t.getState(),f=c.eventSettings,d=f.throttleDelay,p=f.throttledEvents,g=p,v=g==="all"||g?.includes(a),y=Bf.get(a);y!==void 0&&(typeof d!="number"||!v)&&(clearTimeout(y),Bf.delete(a));var x=()=>{var E=D1.get(a);try{if(!E)return;var k=E.handler,M=E.reactEvent,D=t.getState(),P={activeCoordinate:mde(D),activeDataKey:y8(D),activeIndex:gs(D),activeLabel:v8(D),activeTooltipIndex:gs(D),isTooltipActive:gde(D)};k&&k(P,M)}finally{Dm.delete(a),Bf.delete(a),D1.delete(a)}};if(!v){x();return}if(d==="raf"){var w=requestAnimationFrame(x);Dm.set(a,w)}else if(typeof d=="number"){if(!Bf.has(a)){x();var A=setTimeout(x,d);Bf.set(a,A)}}else x()}}});var uxe=W([kc],e=>e.tooltipItemPayloads),cxe=W([uxe,(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)}}}),U6=Rr("touchMove"),H6=ad(),Do=null,_l=null,Xj=null,zf=null;H6.startListening({actionCreator:U6,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){zf=z6(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),_l!==null&&(typeof a!="number"||!s)&&(clearTimeout(_l),_l=null),Xj=Array.from(n.touches).map(f=>Qk({clientX:f.clientX,clientY:f.clientY,currentTarget:n.currentTarget}));var c=()=>{if(zf!=null){var f=t.getState(),d=bd(f,f.tooltip.settings.shared);if(d==="axis"){var p,g=(p=Xj)===null||p===void 0?void 0:p[0];if(g==null){Do=null,_l=null;return}var v=Kk(f,g);v?.activeIndex!=null&&t.dispatch(i8({activeIndex:v.activeIndex,activeDataKey:void 0,activeCoordinate:v.activeCoordinate}))}else if(d==="item"){var y,x=zf.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(Uie),E=(y=w.getAttribute(Hie))!==null&&y!==void 0?y:void 0,k=Os(f).find(P=>P.id===E);if(A==null||k==null||E==null)return;var M=k.dataKey,D=cxe(f,A,E);t.dispatch(n8({activeDataKey:M,activeIndex:A,activeCoordinate:D,activeGraphicalItemId:E}))}Do=null,_l=null}};if(!s){c();return}a==="raf"?Do=requestAnimationFrame(c):typeof a=="number"&&_l===null&&(c(),zf=null,_l=setTimeout(()=>{zf?c():(_l=null,Do=null)},a))}}});var F6={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},q6=Bn({name:"eventSettings",initialState:F6,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=Ye(t.payload.throttledEvents))}}}),fxe=q6.actions.setEventSettings,hxe=q6.reducer,dxe=f5({brush:Mve,cartesianAxis:ave,chartData:ppe,errorBars:Kye,eventSettings:hxe,graphicalItems:Ige,layout:Oie,legend:Mae,options:upe,polarAxis:Xme,polarOptions:sxe,referenceElements:Nve,renderedTicks:tye,rootProps:ixe,tooltip:khe,zIndex:Gde}),pxe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return Qre({reducer:dxe,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([_6.middleware,N6.middleware,zy.middleware,$6.middleware,H6.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(C5({type:"raf"}))},devTools:{serialize:{replacer:rxe},name:"recharts-".concat(n)}})};function mxe(e){var t=e.preloadedState,n=e.children,r=e.reduxStoreName,i=zn(),a=O.useRef(null);if(i)return n;a.current==null&&(a.current=pxe(t,r));var l=SA;return O.createElement(Kae,{context:l,store:a.current},n)}function gxe(e){var t=e.layout,n=e.margin,r=St(),i=zn();return O.useEffect(()=>{i||(r(xie(t)),r(bie(n)))},[r,i,t,n]),null}var vxe=O.memo(gxe,vc);function yxe(e){var t=St();return O.useEffect(()=>{t(axe(e))},[t,e]),null}var bxe=e=>{var t=St();return O.useEffect(()=>{t(fxe(e))},[t,e]),null},xxe=O.memo(bxe,vc);function Yj(e){var t=e.zIndex,n=e.isPanorama,r=O.useRef(null),i=St();return O.useLayoutEffect(()=>(r.current&&i(Xde({zIndex:t,element:r.current,isPanorama:n})),()=>{i(Yde({zIndex:t,isPanorama:n}))}),[i,t,n]),O.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function Gj(e){var t=e.children,n=e.isPanorama,r=we($de);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(Yj,{key:l,zIndex:l,isPanorama:n})),t,a.map(l=>O.createElement(Yj,{key:l,zIndex:l,isPanorama:n})))}var Sxe=["children"];function wxe(e,t){if(e==null)return{};var n,r,i=Oxe(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 Oxe(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 Av(){return Av=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},Av.apply(null,arguments)}var Axe={width:"100%",height:"100%",display:"block"},kxe=O.forwardRef((e,t)=>{var n=DA(),r=_A(),i=Z5();if(!ia(n)||!ia(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(dA,Av({},l,{title:s,desc:c,role:d,tabIndex:f,width:n,height:r,style:Axe,ref:t}),a)}),Cxe=e=>{var t=e.children,n=we(yy);if(!n)return null;var r=n.width,i=n.height,a=n.y,l=n.x;return O.createElement(dA,{width:r,height:i,x:l,y:a},t)},Zj=O.forwardRef((e,t)=>{var n=e.children,r=wxe(e,Sxe),i=zn();return i?O.createElement(Cxe,null,O.createElement(Gj,{isPanorama:!0},n)):O.createElement(kxe,Av({ref:t},r),O.createElement(Gj,{isPanorama:!1},n))});function Exe(e,t){return Dxe(e)||Pxe(e,t)||Mxe(e,t)||Txe()}function Txe(){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 Mxe(e,t){if(e){if(typeof e=="string")return Jj(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)?Jj(e,t):void 0}}function Jj(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 Pxe(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 Dxe(e){if(Array.isArray(e))return e}function _xe(){var e=St(),t=O.useState(null),n=Exe(t,2),r=n[0],i=n[1],a=we($ie);return O.useEffect(()=>{if(r!=null){var l=r.getBoundingClientRect(),s=l.width/r.offsetWidth;We(s)&&s!==a&&e(wie(s))}},[r,e,a]),i}function eL(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 Nxe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eL(Object(n),!0).forEach(function(r){Rxe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rxe(e,t,n){return(t=jxe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jxe(e){var t=Lxe(e,"string");return typeof t=="symbol"?t:t+""}function Lxe(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 kv(e,t){return $xe(e)||zxe(e,t)||Bxe(e,t)||Ixe()}function Ixe(){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 Bxe(e,t){if(e){if(typeof e=="string")return tL(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)?tL(e,t):void 0}}function tL(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 zxe(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 $xe(e){if(Array.isArray(e))return e}var Uxe=()=>(Ope(),null);function Cv(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var Hxe=O.forwardRef((e,t)=>{var n,r,i=O.useRef(null),a=O.useState({containerWidth:Cv((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:Cv((r=e.style)===null||r===void 0?void 0:r.height)}),l=kv(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 E=A[0];if(E!=null){var k=E.contentRect,M=k.width,D=k.height;f(M,D)}},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(od,{width:s.containerWidth,height:s.containerHeight}),O.createElement("div",Vl({ref:d},e)))}),Fxe=O.forwardRef((e,t)=>{var n=e.width,r=e.height,i=O.useState({containerWidth:Cv(n),containerHeight:Cv(r)}),a=kv(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(od,{width:l.containerWidth,height:l.containerHeight}),O.createElement("div",Vl({ref:f},e)))}),qxe=O.forwardRef((e,t)=>{var n=e.width,r=e.height;return O.createElement(O.Fragment,null,O.createElement(od,{width:n,height:r}),O.createElement("div",Vl({ref:t},e)))}),Wxe=O.forwardRef((e,t)=>{var n=e.width,r=e.height;return typeof n=="string"||typeof r=="string"?O.createElement(Fxe,Vl({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?O.createElement(qxe,Vl({},e,{width:n,height:r,ref:t})):O.createElement(O.Fragment,null,O.createElement(od,{width:n,height:r}),O.createElement("div",Vl({ref:t},e)))});function Vxe(e){return e?Hxe:Wxe}var Kxe=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,E=e.responsive,k=e.dispatchTouchEvents,M=k===void 0?!0:k,D=O.useRef(null),P=St(),N=O.useState(null),L=kv(N,2),U=L[0],K=L[1],V=O.useState(null),B=kv(V,2),oe=B[0],ie=B[1],ue=_xe(),z=MA(),Z=z?.width>0?z.width:A,ae=z?.height>0?z.height:i,Q=O.useCallback(xe=>{ue(xe),typeof t=="function"&&t(xe),K(xe),ie(xe),xe!=null&&(D.current=xe)},[ue,t,K,ie]),le=O.useCallback(xe=>{P(D6(xe)),P(Kr({handler:a,reactEvent:xe}))},[P,a]),R=O.useCallback(xe=>{P(Zw(xe)),P(Kr({handler:f,reactEvent:xe}))},[P,f]),F=O.useCallback(xe=>{P(r8()),P(Kr({handler:d,reactEvent:xe}))},[P,d]),ee=O.useCallback(xe=>{P(Zw(xe)),P(Kr({handler:p,reactEvent:xe}))},[P,p]),se=O.useCallback(()=>{P(I6())},[P]),ge=O.useCallback(()=>{P(B6())},[P]),Oe=O.useCallback(xe=>{P(L6(xe.key))},[P]),Pe=O.useCallback(xe=>{P(Kr({handler:l,reactEvent:xe}))},[P,l]),mt=O.useCallback(xe=>{P(Kr({handler:s,reactEvent:xe}))},[P,s]),ce=O.useCallback(xe=>{P(Kr({handler:c,reactEvent:xe}))},[P,c]),Te=O.useCallback(xe=>{P(Kr({handler:g,reactEvent:xe}))},[P,g]),Ee=O.useCallback(xe=>{P(Kr({handler:x,reactEvent:xe}))},[P,x]),fe=O.useCallback(xe=>{M&&P(U6(xe)),P(Kr({handler:y,reactEvent:xe}))},[P,M,y]),Rt=O.useCallback(xe=>{P(Kr({handler:v,reactEvent:xe}))},[P,v]),Ne=Vxe(E);return O.createElement(k8.Provider,{value:U},O.createElement(wz.Provider,{value:oe},O.createElement(Ne,{width:Z??w?.width,height:ae??w?.height,className:st("recharts-wrapper",r),style:Nxe({position:"relative",cursor:"default",width:Z,height:ae},w),onClick:le,onContextMenu:Pe,onDoubleClick:mt,onFocus:se,onBlur:ge,onKeyDown:Oe,onMouseDown:ce,onMouseEnter:R,onMouseLeave:F,onMouseMove:ee,onMouseUp:Te,onTouchEnd:Rt,onTouchMove:fe,onTouchStart:Ee,ref:Q},O.createElement(Uxe,null),n)))}),Qxe=["width","height","responsive","children","className","style","compact","title","desc"];function Xxe(e,t){if(e==null)return{};var n,r,i=Yxe(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 Yxe(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 Gxe=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=Xxe(e,Qxe),g=Si(p);return c?O.createElement(O.Fragment,null,O.createElement(od,{width:n,height:r}),O.createElement(Zj,{otherAttributes:g,title:f,desc:d},a)):O.createElement(Kxe,{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(Zj,{otherAttributes:g,title:f,desc:d,ref:t},O.createElement($ve,null,a)))});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 nL(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 Zxe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nL(Object(n),!0).forEach(function(r){Jxe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jxe(e,t,n){return(t=e1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function e1e(e){var t=t1e(e,"string");return typeof t=="symbol"?t:t+""}function t1e(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 n1e={top:5,right:5,bottom:5,left:5},r1e=Zxe({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:n1e,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},F6),W6=O.forwardRef(function(t,n){var r,i=In(t.categoricalChartProps,r1e),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(mxe,{preloadedState:{options:d},reduxStoreName:(r=f.id)!==null&&r!==void 0?r:a},O.createElement(Tve,{chartData:f.data}),O.createElement(vxe,{layout:i.layout,margin:i.margin}),O.createElement(xxe,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),O.createElement(yxe,{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(Gxe,Jw({},i,{ref:n})))}),i1e=["axis"],a1e=O.forwardRef((e,t)=>O.createElement(W6,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:i1e,tooltipPayloadSearcher:C8,categoricalChartProps:e,ref:t})),l1e=["axis","item"],o1e=O.forwardRef((e,t)=>O.createElement(W6,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:l1e,tooltipPayloadSearcher:C8,categoricalChartProps:e,ref:t}));const s1e={succeeded:"var(--status-good)",failed:"var(--status-critical)",skipped:"var(--status-warning)",canceled:"var(--text-muted)"},rL=["succeeded","failed","skipped","canceled"];function _m({label:e,value:t,sub:n}){return T.jsxs("div",{className:"rounded-lg border border-edge bg-surface px-4 py-3",children:[T.jsx("p",{className:"text-xs uppercase tracking-wide text-ink-muted",children:e}),T.jsx("p",{className:"mt-1 text-2xl font-semibold",children:t}),n&&T.jsx("p",{className:"mt-0.5 text-xs text-ink-muted",children:n})]})}function iL({active:e,payload:t,label:n,unit:r}){return!e||!t?.length?null:T.jsxs("div",{className:"rounded-md border border-edge bg-surface px-3 py-2 text-xs shadow-sm",children:[T.jsx("p",{className:"mb-1 font-medium text-ink-secondary",children:n}),t.map(i=>T.jsxs("p",{className:"flex items-center gap-2 text-ink-secondary",children:[T.jsx("span",{className:"inline-block h-2 w-2 rounded-full",style:{background:i.color}}),i.name,": ",T.jsx("span",{className:"font-medium text-ink",children:r==="s"?Fu(i.value):i.value})]},i.dataKey))]})}function u1e({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 T.jsxs("div",{className:"space-y-6",children:[T.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[T.jsx(_m,{label:"Runs",value:String(e.totals.total)}),T.jsx(_m,{label:"Success rate",value:r===null?"—":`${r}%`,sub:e.totals.failed>0?`${e.totals.failed} failed`:void 0}),T.jsx(_m,{label:"Skipped",value:String(e.totals.skipped),sub:"overlapping schedule"}),T.jsx(_m,{label:"Avg duration",value:i===null?"—":Fu(i),sub:"last 50 runs"})]}),T.jsxs("div",{className:"rounded-lg border border-edge bg-surface p-4",children:[T.jsx("h3",{className:"mb-3 text-sm font-semibold text-ink-secondary",children:"Runs per day"}),t.length===0?T.jsx("p",{className:"py-10 text-center text-sm text-ink-muted",children:"No runs in this period."}):T.jsx(L_,{width:"100%",height:220,children:T.jsxs(o1e,{data:t,margin:{top:4,right:8,left:-18,bottom:0},children:[T.jsx(Fw,{vertical:!1,stroke:"var(--gridline)"}),T.jsx(Qw,{dataKey:"day",tick:a,axisLine:{stroke:"var(--baseline)"},tickLine:!1}),T.jsx(Gw,{tick:a,axisLine:!1,tickLine:!1,allowDecimals:!1}),T.jsx(GR,{content:T.jsx(iL,{}),cursor:{fill:"var(--gridline)",opacity:.4}}),T.jsx(Y5,{wrapperStyle:{fontSize:12,color:"var(--text-secondary)"},iconSize:8}),rL.map((l,s)=>T.jsx(M6,{dataKey:l,name:l,stackId:"runs",fill:s1e[l],stroke:"var(--surface-1)",strokeWidth:1,maxBarSize:28,radius:s===rL.length-1?[3,3,0,0]:void 0,isAnimationActive:!1},l))]})})]}),T.jsxs("div",{className:"rounded-lg border border-edge bg-surface p-4",children:[T.jsxs("h3",{className:"mb-3 text-sm font-semibold text-ink-secondary",children:["Run duration (last ",n.length," runs)"]}),n.length===0?T.jsx("p",{className:"py-10 text-center text-sm text-ink-muted",children:"No finished runs yet."}):T.jsx(L_,{width:"100%",height:200,children:T.jsxs(a1e,{data:n,margin:{top:4,right:8,left:-10,bottom:0},children:[T.jsx(Fw,{vertical:!1,stroke:"var(--gridline)"}),T.jsx(Qw,{dataKey:"id",tick:a,axisLine:{stroke:"var(--baseline)"},tickLine:!1}),T.jsx(Gw,{tick:a,axisLine:!1,tickLine:!1,tickFormatter:l=>Fu(l)}),T.jsx(GR,{content:T.jsx(iL,{unit:"s"}),cursor:{stroke:"var(--baseline)"}}),T.jsx(A6,{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 c1e(){const{id:e}=sO(),t=Number(e),n=Mv(),r=io(),[i,a]=O.useState("runs"),[l,s]=O.useState(30),[c,f]=O.useState("form"),{data:d,error:p}=Wi({queryKey:["configs",t],queryFn:()=>Ct.config(t)}),{data:g}=Wi({queryKey:["health"],queryFn:Ct.health}),{data:v}=Wi({queryKey:["runs",{configId:t}],queryFn:()=>Ct.runs({configId:t,limit:100})}),{data:y}=Wi({queryKey:["runs","stats",t,l],queryFn:()=>Ct.configStats(t,l),enabled:i==="stats"}),x=Wh({mutationFn:()=>Ct.deleteConfig(t),onSuccess:()=>{r.invalidateQueries({queryKey:["configs"]}),n("/")}});if(p)return T.jsx("p",{className:"text-critical",children:p.message});if(!d)return T.jsx("p",{className:"text-ink-muted",children:"Loading…"});const w=g?.mode==="rw";return T.jsxs("div",{className:"space-y-6",children:[T.jsxs("div",{children:[T.jsx(yi,{to:"/",className:"text-sm text-ink-muted hover:text-accent",children:"← Configurations"}),T.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-3",children:[T.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:d.name}),d.parse_error&&T.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]}),T.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[T.jsx(cI,{config:d,variant:"primary"}),w&&T.jsx("button",{onClick:()=>{window.confirm(`Delete config '${d.name}' and its file?
|
|
125
|
-
|
|
126
|
-
Run history is kept.`)&&x.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&&T.jsx("p",{className:"mt-2 text-sm text-critical",children:x.error.message}),T.jsxs("dl",{className:"mt-3 flex flex-wrap gap-x-8 gap-y-2 text-sm",children:[T.jsxs("div",{children:[T.jsx("dt",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"Schedule"}),T.jsxs("dd",{className:"mt-0.5 text-ink-secondary",children:[gO(d.schedule),d.schedule&&T.jsx("code",{className:"ml-2 text-xs text-ink-muted",children:d.schedule})]})]}),T.jsxs("div",{children:[T.jsx("dt",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"Next run"}),T.jsx("dd",{className:"mt-0.5 text-ink-secondary",title:d.next_run?Fa(d.next_run):void 0,children:d.next_run?H1(d.next_run):"—"})]}),T.jsxs("div",{children:[T.jsx("dt",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"File"}),T.jsx("dd",{className:"mt-0.5 font-mono text-xs text-ink-muted",children:d.path})]})]}),T.jsx("div",{className:"mt-3",children:T.jsx(fI,{sources:d.source_summary})})]}),T.jsx("div",{className:"border-b border-edge",children:T.jsx("nav",{className:"flex gap-6 text-sm",children:["runs","stats","config"].map(A=>T.jsx("button",{onClick:()=>a(A),className:`-mb-px border-b-2 px-1 pb-2 font-medium capitalize transition ${i===A?"border-accent text-accent":"border-transparent text-ink-muted hover:text-ink-secondary"}`,children:A},A))})}),i==="runs"&&T.jsx(Uee,{runs:v??[]}),i==="stats"&&T.jsxs("div",{className:"space-y-4",children:[T.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[T.jsx("span",{className:"text-ink-muted",children:"Period:"}),[7,30,90].map(A=>T.jsxs("button",{onClick:()=>s(A),className:`rounded-md border px-2.5 py-1 text-xs font-medium transition ${l===A?"border-accent text-accent":"border-edge text-ink-muted hover:text-ink-secondary"}`,children:[A,"d"]},A))]}),y?T.jsx(u1e,{stats:y}):T.jsx("p",{className:"text-ink-muted",children:"Loading…"})]}),i==="config"&&T.jsxs("div",{className:"space-y-4",children:[T.jsx("div",{className:"flex items-center gap-2 text-sm",children:w?["form","yaml"].map(A=>T.jsx("button",{onClick:()=>f(A),className:`rounded-md border px-2.5 py-1 text-xs font-medium uppercase transition ${c===A?"border-accent text-accent":"border-edge text-ink-muted hover:text-ink-secondary"}`,children:A},A)):T.jsx("p",{className:"text-xs text-ink-muted",children:"Read-only mode — configs are managed from the files passed to the controller."})}),w&&c==="form"?T.jsx(uI,{mode:"edit",config:d,onSaved:()=>r.invalidateQueries({queryKey:["configs",t]})},d.content_hash):w?T.jsx(WD,{mode:"edit",config:d,onSaved:()=>r.invalidateQueries({queryKey:["configs",t]})},d.content_hash):T.jsx(WD,{mode:"view",config:d})]})]})}const _1=1e4,$f=2e3,f1e=1e4,h1e=["error","warn","info","debug"],N1={error:"text-critical",warn:"text-warning",info:"text-ink-secondary",debug:"text-ink-muted"};function d1e({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,v]=O.useState(""),[y,x]=O.useState(null),[w,A]=O.useState({rows:[],loading:!1,hasMore:!1,error:null}),E=O.useRef(null),k=O.useRef(l);k.current=l;const M=O.useMemo(()=>[...c].sort(),[c]),D=M.join(","),P=M.length>0||g!=="";O.useEffect(()=>{const Q=setTimeout(()=>v(d.trim()),300);return()=>clearTimeout(Q)},[d]);const N=O.useRef({match:()=>!1,enabled:!1});N.current={enabled:P&&!w.loading&&!w.hasMore&&!w.error,match:Q=>{if(M.length>0&&!M.includes(Q.level))return!1;if(!g)return!0;const le=g.toLowerCase();return Q.message.toLowerCase().includes(le)||(Q.module??"").toLowerCase().includes(le)}},O.useEffect(()=>{r([]);const Q=new EventSource(`/api/runs/${e}/logs/stream?tail=${_1}`);return Q.addEventListener("log",le=>{const R=JSON.parse(le.data);r(ee=>{const se=ee.length>=_1?ee.slice(ee.length-_1+1):ee.slice();return se.push(R),se});const F=N.current;F.enabled&&F.match(R)&&A(ee=>ee.rows.length>0&&R.seq<=ee.rows[ee.rows.length-1].seq?ee:{...ee,rows:[...ee.rows,R]})}),Q.addEventListener("end",()=>{a(!0),Q.close()}),Q.onerror=()=>{},()=>Q.close()},[e]),O.useEffect(()=>{let Q=!1;const le=()=>{Ct.runLogCounts(e).then(F=>!Q&&x(F)).catch(()=>{})};if(le(),i)return()=>{Q=!0};const R=setInterval(le,f1e);return()=>{Q=!0,clearInterval(R)}},[e,i]),O.useEffect(()=>{if(!P){A({rows:[],loading:!1,hasMore:!1,error:null});return}let Q=!1;return A({rows:[],loading:!0,hasMore:!1,error:null}),Ct.runLogs(e,{levels:M,q:g,limit:$f}).then(le=>{Q||A({rows:le,loading:!1,hasMore:le.length===$f,error:null})}).catch(le=>{Q||A({rows:[],loading:!1,hasMore:!1,error:le.message})}),()=>{Q=!0}},[e,D,g,P]);const L=O.useCallback(()=>{A(Q=>{if(Q.loading||!Q.hasMore)return Q;const le=Q.rows.length>0?Q.rows[Q.rows.length-1].seq:0;return Ct.runLogs(e,{levels:M,q:g,afterSeq:le,limit:$f}).then(R=>A(F=>({...F,rows:[...F.rows,...R],loading:!1,hasMore:R.length===$f}))).catch(R=>A(F=>({...F,loading:!1,error:R.message}))),{...Q,loading:!0}})},[e,D,g]),U=O.useMemo(()=>{const Q={};for(const le of n)Q[le.level]=(Q[le.level]??0)+1;return Q},[n]),K=y??U,V=y?Object.values(y).reduce((Q,le)=>Q+le,0):n.length,B=V>n.length,oe=P?w.rows:n,ie=O.useRef(!1);O.useLayoutEffect(()=>{k.current&&E.current&&(ie.current=!0,E.current.scrollTop=E.current.scrollHeight)},[oe,l]);const ue=()=>{const Q=E.current;if(!Q)return;const le=Q.scrollHeight-Q.scrollTop-Q.clientHeight<40;if(ie.current){ie.current=!1,le&&!k.current&&s(!0);return}le!==k.current&&s(le)},z=Q=>{Q.deltaY<0&&k.current&&s(!1)},Z=Q=>{f(le=>{const R=new Set(le);return R.has(Q)?R.delete(Q):R.add(Q),R})},ae=c.size>0||d.trim()!=="";return T.jsxs("div",{className:"rounded-lg border border-edge bg-surface",children:[T.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b border-edge px-4 py-2 text-xs text-ink-muted",children:[T.jsx("span",{className:"shrink-0",children:P?`${w.rows.length.toLocaleString()}${w.hasMore?"+":""} / ${V.toLocaleString()} lines`:`${V.toLocaleString()} lines${B?` (showing last ${n.length.toLocaleString()})`:""}`}),!i&&T.jsx("span",{className:"shrink-0 text-accent",children:"● live"}),T.jsx("div",{className:"flex items-center gap-1",children:h1e.map(Q=>T.jsxs("button",{onClick:()=>Z(Q),title:`${K[Q]??0} ${Q} line(s) in this run`,className:`rounded-full border px-2 py-0.5 font-medium uppercase transition ${c.has(Q)?`border-current ${N1[Q]}`:"border-edge text-ink-muted hover:text-ink-secondary"}`,children:[Q,(K[Q]??0)>0&&T.jsx("span",{className:"ml-1 font-normal",children:K[Q]})]},Q))}),T.jsx("input",{value:d,onChange:Q=>p(Q.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"}),ae&&T.jsx("button",{onClick:()=>{f(new Set),p("")},className:"text-ink-muted underline-offset-2 hover:text-accent hover:underline",children:"clear"}),T.jsxs("a",{href:Ct.runLogsDownloadUrl(e,P?{levels:M,q:g}:{}),className:"text-ink-muted underline-offset-2 hover:text-accent hover:underline",title:P?"Download the matching lines":"Download the full log",children:["↓ ",P?"download matches":"download log"]}),!l&&!i&&T.jsx("button",{onClick:()=>{s(!0),E.current?.scrollTo({top:E.current.scrollHeight})},className:"ml-auto rounded border border-edge px-2 py-0.5 hover:border-accent hover:text-accent",children:"↓ Follow"})]}),T.jsxs("div",{ref:E,onScroll:ue,onWheel:z,className:"log-scroll max-h-[560px] overflow-auto px-4 py-3 font-mono text-xs leading-5",children:[w.error&&T.jsxs("p",{className:"text-critical",children:["Log search failed: ",w.error]}),!w.error&&oe.length===0&&T.jsx("p",{className:"text-ink-muted",children:w.loading?"Searching…":P?"No lines match the current filters.":`No log output${i?"":" yet"}.`}),oe.map(Q=>T.jsxs("div",{className:"flex gap-3 whitespace-pre-wrap break-all hover:bg-ink/[0.03]",children:[T.jsx("span",{className:"shrink-0 select-none text-ink-muted",children:Q.ts.slice(11,19)}),T.jsx("span",{className:`w-10 shrink-0 select-none uppercase ${N1[Q.level]??"text-ink-secondary"}`,children:Q.level}),T.jsxs("span",{className:N1[Q.level]??"text-ink-secondary",children:[Q.module&&T.jsxs("span",{className:"text-ink-muted",children:["[",Q.module.replace(/^Doc2Vec:?/,"")||"main","] "]}),Q.message]})]},Q.seq)),P&&w.hasMore&&T.jsx("button",{onClick:L,disabled:w.loading,className:"mt-2 rounded border border-edge px-2 py-1 text-ink-muted hover:border-accent hover:text-accent disabled:opacity-50",children:w.loading?"Loading…":`Load ${$f.toLocaleString()} more`})]})]})}function aL(e,t){switch(t){case"source":return e.product_name;case"type":return e.type;case"version":return e.version??"";case"duration":return e.duration_ms;case"changes":{const n=e.counters;return n?n.items_new+n.items_updated+n.items_deleted:-1}case"result":return e.ok?1:0}}function p1e(){const{id:e}=sO(),t=Number(e),n=io(),r=Mv(),{data:i,error:a}=Wi({queryKey:["runs",t],queryFn:()=>Ct.run(t),refetchInterval:g=>g.state.data&&["queued","running"].includes(g.state.data.status)?3e3:!1}),l=Wh({mutationFn:()=>Ct.cancelRun(t),onSettled:()=>n.invalidateQueries({queryKey:["runs",t]})}),[s,c]=O.useState(null),f=O.useMemo(()=>{const g=(i?.stats?.sources??[]).map((v,y)=>({source:v,index:y}));return s?[...g].sort((v,y)=>{const x=aL(v.source,s.key),w=aL(y.source,s.key);return(typeof x=="string"&&typeof w=="string"?x.localeCompare(w):Number(x)-Number(w))*s.dir}):g},[i,s]);if(a)return T.jsx("p",{className:"text-critical",children:a.message});if(!i)return T.jsx("p",{className:"text-ink-muted",children:"Loading…"});const d=i.status==="queued"||i.status==="running",p=(g,v)=>T.jsx("th",{className:"px-4 py-2 font-medium",children:T.jsxs("button",{onClick:()=>c(y=>y?.key!==v?{key:v,dir:1}:y.dir===1?{key:v,dir:-1}:null),className:`inline-flex items-center gap-1 uppercase tracking-wide transition hover:text-ink-secondary ${s?.key===v?"text-ink-secondary":""}`,children:[g,T.jsx("span",{className:"text-[10px]",children:s?.key===v?s.dir===1?"▲":"▼":""})]})});return T.jsxs("div",{className:"space-y-6",children:[T.jsxs("div",{children:[T.jsxs(yi,{to:`/configs/${i.config_id}`,className:"text-sm text-ink-muted hover:text-accent",children:["← ",i.config_name??`Config ${i.config_id}`]}),T.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-3",children:[T.jsxs("h1",{className:"text-xl font-semibold tracking-tight",children:["Run #",i.id]}),T.jsx(_v,{status:i.status}),d&&T.jsx("button",{onClick:()=>l.mutate(),disabled:l.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"})]}),i.error&&T.jsx("p",{className:"mt-2 text-sm text-critical",children:i.error}),l.error&&T.jsx("p",{className:"mt-2 text-sm text-critical",children:l.error.message}),T.jsx("dl",{className:"mt-3 flex flex-wrap gap-x-8 gap-y-2 text-sm",children:[["Trigger",i.requested_sources?.length?`${i.trigger} (partial)`:i.trigger],["Queued",Fa(i.queued_at)],["Started",Fa(i.started_at)],["Duration",d?"…":mO(i.started_at,i.finished_at)],["Exit code",i.exit_code===null?"—":String(i.exit_code)],["Warnings",String(i.stats?.warn_count??0)],["Errors",String(i.stats?.error_count??0)]].map(([g,v])=>T.jsxs("div",{children:[T.jsx("dt",{className:"text-xs uppercase tracking-wide text-ink-muted",children:g}),T.jsx("dd",{className:"mt-0.5 text-ink-secondary",children:v})]},g))}),i.requested_sources&&i.requested_sources.length>0&&T.jsxs("p",{className:"mt-2 text-sm text-ink-secondary",children:[T.jsx("span",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"Selected sources"})," ",T.jsx("span",{className:"ml-1 inline-flex flex-wrap gap-1.5 align-middle",children:i.requested_sources.map(g=>T.jsxs("span",{className:"rounded-full border border-edge bg-page px-2 py-0.5 text-xs",children:[g.product_name,T.jsxs("span",{className:"ml-1 text-ink-muted",children:[g.type,g.version?` · ${g.version}`:""]})]},g.index))})]})]}),f.length>0&&T.jsx("div",{className:"overflow-x-auto rounded-lg border border-edge bg-surface",children:T.jsxs("table",{className:"w-full text-sm",children:[T.jsx("thead",{children:T.jsxs("tr",{className:"border-b border-edge text-left text-xs uppercase tracking-wide text-ink-muted",children:[p("Source","source"),p("Type","type"),p("Version","version"),p("Duration","duration"),p("Changes","changes"),p("Result","result"),T.jsx("th",{className:"px-4 py-2"})]})}),T.jsx("tbody",{children:f.map(({source:g,index:v})=>T.jsxs("tr",{onClick:()=>r(`/runs/${i.id}/sources/${v}`),className:"cursor-pointer border-b border-edge/60 transition last:border-0 hover:bg-edge/20",children:[T.jsx("td",{className:"px-4 py-2 font-medium",children:g.product_name}),T.jsx("td",{className:"px-4 py-2 text-ink-secondary",children:g.type}),T.jsx("td",{className:"px-4 py-2 text-ink-secondary",children:g.version}),T.jsx("td",{className:"px-4 py-2 text-ink-secondary",children:Fu(g.duration_ms/1e3)}),T.jsx("td",{className:"px-4 py-2 text-ink-secondary",children:g.counters?T.jsxs("span",{className:"whitespace-nowrap tabular-nums",children:[T.jsxs("span",{className:g.counters.items_new>0?"text-good-text":"",children:["+",g.counters.items_new]})," ",T.jsxs("span",{children:["~",g.counters.items_updated]})," ",T.jsxs("span",{className:g.counters.items_deleted>0?"text-critical":"",children:["−",g.counters.items_deleted]}),T.jsx("span",{className:"ml-1 text-xs text-ink-muted",children:g.counters.items_kind})]}):"—"}),T.jsx("td",{className:"px-4 py-2",children:g.ok?T.jsx("span",{className:"text-good-text",children:"✓ ok"}):T.jsxs("span",{className:"text-critical",title:g.error,children:["✕ ",g.error??"failed"]})}),T.jsx("td",{className:"px-4 py-2 text-ink-muted",children:"›"})]},`${g.product_name}-${g.type}-${v}`))})]})}),T.jsxs("div",{children:[T.jsx("h2",{className:"mb-2 text-sm font-semibold text-ink-secondary",children:"Logs"}),T.jsx(d1e,{runId:t,isActive:d})]})]})}function m1e(e){const t=e.items_kind||"items";return[{label:`New ${t}`,value:e.items_new,tone:"good"},{label:`Updated ${t}`,value:e.items_updated},{label:`Unchanged ${t}`,value:e.items_unchanged},{label:`Deleted ${t}`,value:e.items_deleted,tone:"bad"},{label:"Chunks added",value:e.chunks_added,tone:"good"},{label:"Chunks deleted",value:e.chunks_deleted,tone:"bad"}]}const g1e={chunk_id:"asc",position:"asc",section:"asc",size:"desc"};function v1e(e,t,n,r){const i=r==="asc"?1:-1;switch(n){case"chunk_id":return e.chunk_id.localeCompare(t.chunk_id)*i;case"position":return((e.chunk_index??Number.MAX_SAFE_INTEGER)-(t.chunk_index??Number.MAX_SAFE_INTEGER))*i;case"section":return(e.section??"").localeCompare(t.section??"")*i;case"size":return(e.content.length-t.content.length)*i}}function Nm({label:e,sortKey:t,sort:n,onSort:r,align:i="left"}){const a=n.key===t;return T.jsx("th",{className:`px-4 py-2 font-medium ${i==="right"?"text-right":"text-left"}`,children:T.jsxs("button",{type:"button",onClick:()=>r(t),className:`inline-flex items-center gap-1 uppercase tracking-wide transition hover:text-accent ${a?"text-accent":""}`,title:`Sort by ${e.toLowerCase()}`,children:[e,T.jsx("span",{className:a?"":"opacity-30",children:a?n.dir==="asc"?"▲":"▼":"↕"})]})})}function y1e({chunk:e}){const[t,n]=O.useState(!1);return T.jsxs(T.Fragment,{children:[T.jsxs("tr",{onClick:()=>n(r=>!r),className:"cursor-pointer border-b border-edge/60 transition last:border-0 hover:bg-edge/20",children:[T.jsxs("td",{className:"px-4 py-2 font-mono text-xs text-ink-secondary",title:e.chunk_id,children:[e.chunk_id.slice(0,10),"…"]}),T.jsx("td",{className:"px-4 py-2 text-ink-secondary",children:e.chunk_index!==null&&e.total_chunks!==null?`${e.chunk_index+1} / ${e.total_chunks}`:"—"}),T.jsx("td",{className:"max-w-xs truncate px-4 py-2 text-ink-secondary",title:e.section??void 0,children:e.section||"—"}),T.jsxs("td",{className:"px-4 py-2 text-right text-ink-muted",children:[e.content.length.toLocaleString()," chars"]}),T.jsx("td",{className:"px-4 py-2 text-ink-muted",children:t?"▾":"▸"})]}),t&&T.jsx("tr",{className:"border-b border-edge/60 last:border-0",children:T.jsxs("td",{colSpan:5,className:"bg-edge/10 px-4 py-3",children:[T.jsxs("dl",{className:"mb-3 flex flex-wrap gap-x-8 gap-y-1 text-xs",children:[T.jsxs("div",{children:[T.jsx("dt",{className:"uppercase tracking-wide text-ink-muted",children:"Chunk ID"}),T.jsx("dd",{className:"mt-0.5 font-mono text-ink-secondary",children:e.chunk_id})]}),e.hash&&T.jsxs("div",{children:[T.jsx("dt",{className:"uppercase tracking-wide text-ink-muted",children:"Content hash"}),T.jsx("dd",{className:"mt-0.5 font-mono text-ink-secondary",children:e.hash})]}),e.created_at&&T.jsxs("div",{children:[T.jsx("dt",{className:"uppercase tracking-wide text-ink-muted",children:"Created / Updated"}),T.jsx("dd",{className:"mt-0.5 text-ink-secondary",children:Fa(e.created_at)})]}),e.heading_hierarchy.length>0&&T.jsxs("div",{children:[T.jsx("dt",{className:"uppercase tracking-wide text-ink-muted",children:"Headings"}),T.jsx("dd",{className:"mt-0.5 text-ink-secondary",children:e.heading_hierarchy.join(" › ")})]}),e.product_name&&T.jsxs("div",{children:[T.jsx("dt",{className:"uppercase tracking-wide text-ink-muted",children:"Product"}),T.jsxs("dd",{className:"mt-0.5 text-ink-secondary",children:[e.product_name,e.version?` @ ${e.version}`:""]})]})]}),T.jsx("pre",{className:"max-h-96 overflow-auto whitespace-pre-wrap rounded-md border border-edge bg-surface p-3 text-xs text-ink-secondary",children:e.content})]})})]})}function b1e(){const{id:e,sourceIndex:t}=sO(),n=Number(e),r=Number(t),{data:i,error:a}=Wi({queryKey:["runs",n],queryFn:()=>Ct.run(n)}),[l,s]=O.useState(""),[c,f]=O.useState(null),[d,p]=O.useState({key:"position",dir:"asc"}),g=k=>p(M=>M.key===k?{key:k,dir:M.dir==="asc"?"desc":"asc"}:{key:k,dir:g1e[k]}),v=i?.stats?.sources?.[r],y=Wi({queryKey:["chunks",i?.config_id,v?.product_name,v?.version,c],queryFn:()=>Ct.chunksForUrl(i.config_id,{product_name:v.product_name,type:v.type,version:v.version,url:c}),enabled:i!==void 0&&v!==void 0&&c!==null,retry:!1}),x=O.useMemo(()=>y.data?[...y.data.chunks].sort((k,M)=>v1e(k,M,d.key,d.dir)):[],[y.data,d]),w=O.useMemo(()=>{const k=(y.data?.chunks??[]).map(M=>M.created_at).filter(M=>!!M);return k.length>0?k.reduce((M,D)=>M>D?M:D):null},[y.data]);if(a)return T.jsx("p",{className:"text-critical",children:a.message});if(!i)return T.jsx("p",{className:"text-ink-muted",children:"Loading…"});if(!v)return T.jsxs("div",{className:"space-y-2",children:[T.jsxs(yi,{to:`/runs/${n}`,className:"text-sm text-ink-muted hover:text-accent",children:["← Run #",n]}),T.jsx("p",{className:"text-ink-muted",children:"No per-source stats were recorded for this source in this run."})]});const A=v.counters,E=k=>{k.preventDefault();const M=l.trim();M&&f(M)};return T.jsxs("div",{className:"space-y-6",children:[T.jsxs("div",{children:[T.jsxs(yi,{to:`/runs/${n}`,className:"text-sm text-ink-muted hover:text-accent",children:["← Run #",n]}),T.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-3",children:[T.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:v.product_name}),T.jsx(_v,{status:i.status}),v.ok?T.jsx("span",{className:"text-sm text-good-text",children:"✓ ok"}):T.jsxs("span",{className:"text-sm text-critical",children:["✕ ",v.error??"failed"]})]}),T.jsx("dl",{className:"mt-3 flex flex-wrap gap-x-8 gap-y-2 text-sm",children:[["Type",v.type],["Version",v.version],["Duration",Fu(v.duration_ms/1e3)],["Run started",Fa(i.started_at)]].map(([k,M])=>T.jsxs("div",{children:[T.jsx("dt",{className:"text-xs uppercase tracking-wide text-ink-muted",children:k}),T.jsx("dd",{className:"mt-0.5 text-ink-secondary",children:M})]},k))})]}),T.jsxs("div",{children:[T.jsx("h2",{className:"mb-2 text-sm font-semibold text-ink-secondary",children:"Changes in this run"}),A?T.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-6",children:m1e(A).map(k=>T.jsxs("div",{className:"rounded-lg border border-edge bg-surface px-4 py-3",children:[T.jsx("div",{className:`text-2xl font-semibold tabular-nums ${k.value===0?"text-ink-muted":k.tone==="good"?"text-good-text":k.tone==="bad"?"text-critical":""}`,children:k.value.toLocaleString()}),T.jsx("div",{className:"mt-1 text-xs uppercase tracking-wide text-ink-muted",children:k.label})]},k.label))}):T.jsx("p",{className:"text-sm text-ink-muted",children:"This run predates detailed source statistics — trigger a new run to collect them."})]}),T.jsxs("div",{children:[T.jsx("h2",{className:"mb-2 text-sm font-semibold text-ink-secondary",children:"Chunk lookup"}),T.jsx("p",{className:"mb-2 text-xs text-ink-muted",children:"Shows the chunks currently stored in this source's vector database for a URL (live view, ordered by position — click a column heading to sort)."}),T.jsxs("form",{onSubmit:E,className:"flex gap-2",children:[T.jsx("input",{type:"text",value:l,onChange:k=>s(k.target.value),placeholder:"https://…",className:"w-full max-w-2xl rounded-md border border-edge bg-surface px-3 py-1.5 text-sm outline-none focus:border-accent"}),T.jsx("button",{type:"submit",disabled:!l.trim()||y.isFetching,className:"rounded-md border border-edge px-3.5 py-1.5 text-sm font-medium transition hover:border-accent hover:text-accent disabled:opacity-40",children:y.isFetching?"Looking up…":"Look up"})]}),y.error&&T.jsx("p",{className:"mt-3 text-sm text-critical",children:y.error.message}),y.data&&T.jsxs("div",{className:"mt-4 space-y-3",children:[T.jsxs("dl",{className:"flex flex-wrap gap-x-8 gap-y-2 text-sm",children:[T.jsxs("div",{children:[T.jsx("dt",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"Chunks"}),T.jsx("dd",{className:"mt-0.5 text-ink-secondary",children:y.data.chunks.length})]}),y.data.chunks.length>0&&T.jsxs("div",{children:[T.jsx("dt",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"Created / Updated"}),T.jsx("dd",{className:"mt-0.5 text-ink-secondary",title:w??"No date recorded: these chunks were stored before dates were tracked. A date is set when the page content changes and its chunks are recreated.",children:w?Fa(w):"unknown (synced before dates were recorded)"})]}),T.jsxs("div",{children:[T.jsx("dt",{className:"text-xs uppercase tracking-wide text-ink-muted",children:"Store"}),T.jsx("dd",{className:"mt-0.5 text-ink-secondary",children:y.data.database.type==="qdrant"?`Qdrant collection '${y.data.database.collection}'`:`SQLite ${y.data.database.path}`})]})]}),y.data.chunks.length>0&&T.jsx("div",{className:"overflow-x-auto rounded-lg border border-edge bg-surface",children:T.jsxs("table",{className:"w-full text-sm",children:[T.jsx("thead",{children:T.jsxs("tr",{className:"border-b border-edge text-xs text-ink-muted",children:[T.jsx(Nm,{label:"Chunk",sortKey:"chunk_id",sort:d,onSort:g}),T.jsx(Nm,{label:"Position",sortKey:"position",sort:d,onSort:g}),T.jsx(Nm,{label:"Section",sortKey:"section",sort:d,onSort:g}),T.jsx(Nm,{label:"Size",sortKey:"size",sort:d,onSort:g,align:"right"}),T.jsx("th",{className:"px-4 py-2"})]})}),T.jsx("tbody",{children:x.map(k=>T.jsx(y1e,{chunk:k},k.chunk_id))})]})})]})]})]})}function x1e(){const e=io(),{data:t}=Wi({queryKey:["health"],queryFn:Ct.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]),T.jsxs("div",{className:"min-h-screen",children:[T.jsx("header",{className:"border-b border-edge bg-surface",children:T.jsxs("div",{className:"mx-auto flex max-w-6xl items-center gap-3 px-6 py-4",children:[T.jsxs(yi,{to:"/",className:"flex items-center gap-2 text-lg font-semibold tracking-tight",children:[T.jsx("span",{"aria-hidden":!0,children:"📚"})," doc2vec"]}),T.jsx("span",{className:"text-sm text-ink-muted",children:"controller"}),T.jsx("div",{className:"ml-auto flex items-center gap-3 text-sm",children:t&&T.jsxs(T.Fragment,{children:[T.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"}),T.jsxs("span",{className:"text-ink-muted",children:["v",t.version]})]})})]})}),T.jsx("main",{className:"mx-auto max-w-6xl px-6 py-8",children:T.jsxs(sq,{children:[T.jsx(Uf,{path:"/",element:T.jsx(E7,{})}),T.jsx(Uf,{path:"/configs/:id",element:T.jsx(c1e,{})}),T.jsx(Uf,{path:"/runs/:id",element:T.jsx(p1e,{})}),T.jsx(Uf,{path:"/runs/:id/sources/:sourceIndex",element:T.jsx(b1e,{})})]})})]})}const S1e=new G9({defaultOptions:{queries:{refetchOnWindowFocus:!1,staleTime:5e3}}});k9.createRoot(document.getElementById("root")).render(T.jsx(lL.StrictMode,{children:T.jsx(Z9,{client:S1e,children:T.jsx(_q,{children:T.jsx(x1e,{})})})}));
|