heyio 3.1.6 → 3.1.7

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.
@@ -0,0 +1,505 @@
1
+ var eL=Object.defineProperty;var tL=(t,e,r)=>e in t?eL(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var bt=(t,e,r)=>tL(t,typeof e!="symbol"?e+"":e,r);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(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 n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var Xd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var pg={exports:{}},sc={},mg={exports:{}},Je={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var mk;function rL(){if(mk)return Je;mk=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),f=Symbol.iterator;function g(z){return z===null||typeof z!="object"?null:(z=f&&z[f]||z["@@iterator"],typeof z=="function"?z:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,_={};function b(z,L,Z){this.props=z,this.context=L,this.refs=_,this.updater=Z||v}b.prototype.isReactComponent={},b.prototype.setState=function(z,L){if(typeof z!="object"&&typeof z!="function"&&z!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,z,L,"setState")},b.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function k(){}k.prototype=b.prototype;function A(z,L,Z){this.props=z,this.context=L,this.refs=_,this.updater=Z||v}var O=A.prototype=new k;O.constructor=A,x(O,b.prototype),O.isPureReactComponent=!0;var C=Array.isArray,E=Object.prototype.hasOwnProperty,T={current:null},P={key:!0,ref:!0,__self:!0,__source:!0};function R(z,L,Z){var se,le={},ve=null,qe=null;if(L!=null)for(se in L.ref!==void 0&&(qe=L.ref),L.key!==void 0&&(ve=""+L.key),L)E.call(L,se)&&!P.hasOwnProperty(se)&&(le[se]=L[se]);var xe=arguments.length-2;if(xe===1)le.children=Z;else if(1<xe){for(var ae=Array(xe),Se=0;Se<xe;Se++)ae[Se]=arguments[Se+2];le.children=ae}if(z&&z.defaultProps)for(se in xe=z.defaultProps,xe)le[se]===void 0&&(le[se]=xe[se]);return{$$typeof:t,type:z,key:ve,ref:qe,props:le,_owner:T.current}}function I(z,L){return{$$typeof:t,type:z.type,key:L,ref:z.ref,props:z.props,_owner:z._owner}}function Y(z){return typeof z=="object"&&z!==null&&z.$$typeof===t}function W(z){var L={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(Z){return L[Z]})}var B=/\/+/g;function X(z,L){return typeof z=="object"&&z!==null&&z.key!=null?W(""+z.key):L.toString(36)}function K(z,L,Z,se,le){var ve=typeof z;(ve==="undefined"||ve==="boolean")&&(z=null);var qe=!1;if(z===null)qe=!0;else switch(ve){case"string":case"number":qe=!0;break;case"object":switch(z.$$typeof){case t:case e:qe=!0}}if(qe)return qe=z,le=le(qe),z=se===""?"."+X(qe,0):se,C(le)?(Z="",z!=null&&(Z=z.replace(B,"$&/")+"/"),K(le,L,Z,"",function(Se){return Se})):le!=null&&(Y(le)&&(le=I(le,Z+(!le.key||qe&&qe.key===le.key?"":(""+le.key).replace(B,"$&/")+"/")+z)),L.push(le)),1;if(qe=0,se=se===""?".":se+":",C(z))for(var xe=0;xe<z.length;xe++){ve=z[xe];var ae=se+X(ve,xe);qe+=K(ve,L,Z,ae,le)}else if(ae=g(z),typeof ae=="function")for(z=ae.call(z),xe=0;!(ve=z.next()).done;)ve=ve.value,ae=se+X(ve,xe++),qe+=K(ve,L,Z,ae,le);else if(ve==="object")throw L=String(z),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.");return qe}function U(z,L,Z){if(z==null)return z;var se=[],le=0;return K(z,se,"","",function(ve){return L.call(Z,ve,le++)}),se}function G(z){if(z._status===-1){var L=z._result;L=L(),L.then(function(Z){(z._status===0||z._status===-1)&&(z._status=1,z._result=Z)},function(Z){(z._status===0||z._status===-1)&&(z._status=2,z._result=Z)}),z._status===-1&&(z._status=0,z._result=L)}if(z._status===1)return z._result.default;throw z._result}var J={current:null},F={transition:null},te={ReactCurrentDispatcher:J,ReactCurrentBatchConfig:F,ReactCurrentOwner:T};function q(){throw Error("act(...) is not supported in production builds of React.")}return Je.Children={map:U,forEach:function(z,L,Z){U(z,function(){L.apply(this,arguments)},Z)},count:function(z){var L=0;return U(z,function(){L++}),L},toArray:function(z){return U(z,function(L){return L})||[]},only:function(z){if(!Y(z))throw Error("React.Children.only expected to receive a single React element child.");return z}},Je.Component=b,Je.Fragment=r,Je.Profiler=i,Je.PureComponent=A,Je.StrictMode=n,Je.Suspense=u,Je.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=te,Je.act=q,Je.cloneElement=function(z,L,Z){if(z==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+z+".");var se=x({},z.props),le=z.key,ve=z.ref,qe=z._owner;if(L!=null){if(L.ref!==void 0&&(ve=L.ref,qe=T.current),L.key!==void 0&&(le=""+L.key),z.type&&z.type.defaultProps)var xe=z.type.defaultProps;for(ae in L)E.call(L,ae)&&!P.hasOwnProperty(ae)&&(se[ae]=L[ae]===void 0&&xe!==void 0?xe[ae]:L[ae])}var ae=arguments.length-2;if(ae===1)se.children=Z;else if(1<ae){xe=Array(ae);for(var Se=0;Se<ae;Se++)xe[Se]=arguments[Se+2];se.children=xe}return{$$typeof:t,type:z.type,key:le,ref:ve,props:se,_owner:qe}},Je.createContext=function(z){return z={$$typeof:o,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},z.Provider={$$typeof:a,_context:z},z.Consumer=z},Je.createElement=R,Je.createFactory=function(z){var L=R.bind(null,z);return L.type=z,L},Je.createRef=function(){return{current:null}},Je.forwardRef=function(z){return{$$typeof:l,render:z}},Je.isValidElement=Y,Je.lazy=function(z){return{$$typeof:p,_payload:{_status:-1,_result:z},_init:G}},Je.memo=function(z,L){return{$$typeof:d,type:z,compare:L===void 0?null:L}},Je.startTransition=function(z){var L=F.transition;F.transition={};try{z()}finally{F.transition=L}},Je.unstable_act=q,Je.useCallback=function(z,L){return J.current.useCallback(z,L)},Je.useContext=function(z){return J.current.useContext(z)},Je.useDebugValue=function(){},Je.useDeferredValue=function(z){return J.current.useDeferredValue(z)},Je.useEffect=function(z,L){return J.current.useEffect(z,L)},Je.useId=function(){return J.current.useId()},Je.useImperativeHandle=function(z,L,Z){return J.current.useImperativeHandle(z,L,Z)},Je.useInsertionEffect=function(z,L){return J.current.useInsertionEffect(z,L)},Je.useLayoutEffect=function(z,L){return J.current.useLayoutEffect(z,L)},Je.useMemo=function(z,L){return J.current.useMemo(z,L)},Je.useReducer=function(z,L,Z){return J.current.useReducer(z,L,Z)},Je.useRef=function(z){return J.current.useRef(z)},Je.useState=function(z){return J.current.useState(z)},Je.useSyncExternalStore=function(z,L,Z){return J.current.useSyncExternalStore(z,L,Z)},Je.useTransition=function(){return J.current.useTransition()},Je.version="18.3.1",Je}var gk;function _w(){return gk||(gk=1,mg.exports=rL()),mg.exports}/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var yk;function nL(){if(yk)return sc;yk=1;var t=_w(),e=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function o(l,u,d){var p,f={},g=null,v=null;d!==void 0&&(g=""+d),u.key!==void 0&&(g=""+u.key),u.ref!==void 0&&(v=u.ref);for(p in u)n.call(u,p)&&!a.hasOwnProperty(p)&&(f[p]=u[p]);if(l&&l.defaultProps)for(p in u=l.defaultProps,u)f[p]===void 0&&(f[p]=u[p]);return{$$typeof:e,type:l,key:g,ref:v,props:f,_owner:i.current}}return sc.Fragment=r,sc.jsx=o,sc.jsxs=o,sc}var vk;function iL(){return vk||(vk=1,pg.exports=nL()),pg.exports}var y=iL(),N=_w();const $=vt(N);var Yd={},gg={exports:{}},Vr={},yg={exports:{}},vg={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var bk;function aL(){return bk||(bk=1,(function(t){function e(F,te){var q=F.length;F.push(te);e:for(;0<q;){var z=q-1>>>1,L=F[z];if(0<i(L,te))F[z]=te,F[q]=L,q=z;else break e}}function r(F){return F.length===0?null:F[0]}function n(F){if(F.length===0)return null;var te=F[0],q=F.pop();if(q!==te){F[0]=q;e:for(var z=0,L=F.length,Z=L>>>1;z<Z;){var se=2*(z+1)-1,le=F[se],ve=se+1,qe=F[ve];if(0>i(le,q))ve<L&&0>i(qe,le)?(F[z]=qe,F[ve]=q,z=ve):(F[z]=le,F[se]=q,z=se);else if(ve<L&&0>i(qe,q))F[z]=qe,F[ve]=q,z=ve;else break e}}return te}function i(F,te){var q=F.sortIndex-te.sortIndex;return q!==0?q:F.id-te.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var u=[],d=[],p=1,f=null,g=3,v=!1,x=!1,_=!1,b=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function O(F){for(var te=r(d);te!==null;){if(te.callback===null)n(d);else if(te.startTime<=F)n(d),te.sortIndex=te.expirationTime,e(u,te);else break;te=r(d)}}function C(F){if(_=!1,O(F),!x)if(r(u)!==null)x=!0,G(E);else{var te=r(d);te!==null&&J(C,te.startTime-F)}}function E(F,te){x=!1,_&&(_=!1,k(R),R=-1),v=!0;var q=g;try{for(O(te),f=r(u);f!==null&&(!(f.expirationTime>te)||F&&!W());){var z=f.callback;if(typeof z=="function"){f.callback=null,g=f.priorityLevel;var L=z(f.expirationTime<=te);te=t.unstable_now(),typeof L=="function"?f.callback=L:f===r(u)&&n(u),O(te)}else n(u);f=r(u)}if(f!==null)var Z=!0;else{var se=r(d);se!==null&&J(C,se.startTime-te),Z=!1}return Z}finally{f=null,g=q,v=!1}}var T=!1,P=null,R=-1,I=5,Y=-1;function W(){return!(t.unstable_now()-Y<I)}function B(){if(P!==null){var F=t.unstable_now();Y=F;var te=!0;try{te=P(!0,F)}finally{te?X():(T=!1,P=null)}}else T=!1}var X;if(typeof A=="function")X=function(){A(B)};else if(typeof MessageChannel<"u"){var K=new MessageChannel,U=K.port2;K.port1.onmessage=B,X=function(){U.postMessage(null)}}else X=function(){b(B,0)};function G(F){P=F,T||(T=!0,X())}function J(F,te){R=b(function(){F(t.unstable_now())},te)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(F){F.callback=null},t.unstable_continueExecution=function(){x||v||(x=!0,G(E))},t.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<F?Math.floor(1e3/F):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_getFirstCallbackNode=function(){return r(u)},t.unstable_next=function(F){switch(g){case 1:case 2:case 3:var te=3;break;default:te=g}var q=g;g=te;try{return F()}finally{g=q}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(F,te){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var q=g;g=F;try{return te()}finally{g=q}},t.unstable_scheduleCallback=function(F,te,q){var z=t.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?z+q:z):q=z,F){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=q+L,F={id:p++,callback:te,priorityLevel:F,startTime:q,expirationTime:L,sortIndex:-1},q>z?(F.sortIndex=q,e(d,F),r(u)===null&&F===r(d)&&(_?(k(R),R=-1):_=!0,J(C,q-z))):(F.sortIndex=L,e(u,F),x||v||(x=!0,G(E))),F},t.unstable_shouldYield=W,t.unstable_wrapCallback=function(F){var te=g;return function(){var q=g;g=te;try{return F.apply(this,arguments)}finally{g=q}}}})(vg)),vg}var xk;function oL(){return xk||(xk=1,yg.exports=aL()),yg.exports}/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var wk;function sL(){if(wk)return Vr;wk=1;var t=_w(),e=oL();function r(s){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+s,h=1;h<arguments.length;h++)c+="&args[]="+encodeURIComponent(arguments[h]);return"Minified React error #"+s+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,i={};function a(s,c){o(s,c),o(s+"Capture",c)}function o(s,c){for(i[s]=c,s=0;s<c.length;s++)n.add(c[s])}var l=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},f={};function g(s){return u.call(f,s)?!0:u.call(p,s)?!1:d.test(s)?f[s]=!0:(p[s]=!0,!1)}function v(s,c,h,m){if(h!==null&&h.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return m?!1:h!==null?!h.acceptsBooleans:(s=s.toLowerCase().slice(0,5),s!=="data-"&&s!=="aria-");default:return!1}}function x(s,c,h,m){if(c===null||typeof c>"u"||v(s,c,h,m))return!0;if(m)return!1;if(h!==null)switch(h.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function _(s,c,h,m,w,S,j){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=m,this.attributeNamespace=w,this.mustUseProperty=h,this.propertyName=s,this.type=c,this.sanitizeURL=S,this.removeEmptyString=j}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(s){b[s]=new _(s,0,!1,s,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(s){var c=s[0];b[c]=new _(c,1,!1,s[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(s){b[s]=new _(s,2,!1,s.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(s){b[s]=new _(s,2,!1,s,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(s){b[s]=new _(s,3,!1,s.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(s){b[s]=new _(s,3,!0,s,null,!1,!1)}),["capture","download"].forEach(function(s){b[s]=new _(s,4,!1,s,null,!1,!1)}),["cols","rows","size","span"].forEach(function(s){b[s]=new _(s,6,!1,s,null,!1,!1)}),["rowSpan","start"].forEach(function(s){b[s]=new _(s,5,!1,s.toLowerCase(),null,!1,!1)});var k=/[\-:]([a-z])/g;function A(s){return s[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(s){var c=s.replace(k,A);b[c]=new _(c,1,!1,s,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(s){var c=s.replace(k,A);b[c]=new _(c,1,!1,s,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(s){var c=s.replace(k,A);b[c]=new _(c,1,!1,s,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(s){b[s]=new _(s,1,!1,s.toLowerCase(),null,!1,!1)}),b.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(s){b[s]=new _(s,1,!1,s.toLowerCase(),null,!0,!0)});function O(s,c,h,m){var w=b.hasOwnProperty(c)?b[c]:null;(w!==null?w.type!==0:m||!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(x(c,h,w,m)&&(h=null),m||w===null?g(c)&&(h===null?s.removeAttribute(c):s.setAttribute(c,""+h)):w.mustUseProperty?s[w.propertyName]=h===null?w.type===3?!1:"":h:(c=w.attributeName,m=w.attributeNamespace,h===null?s.removeAttribute(c):(w=w.type,h=w===3||w===4&&h===!0?"":""+h,m?s.setAttributeNS(m,c,h):s.setAttribute(c,h))))}var C=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,E=Symbol.for("react.element"),T=Symbol.for("react.portal"),P=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),I=Symbol.for("react.profiler"),Y=Symbol.for("react.provider"),W=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),J=Symbol.for("react.offscreen"),F=Symbol.iterator;function te(s){return s===null||typeof s!="object"?null:(s=F&&s[F]||s["@@iterator"],typeof s=="function"?s:null)}var q=Object.assign,z;function L(s){if(z===void 0)try{throw Error()}catch(h){var c=h.stack.trim().match(/\n( *(at )?)/);z=c&&c[1]||""}return`
34
+ `+z+s}var Z=!1;function se(s,c){if(!s||Z)return"";Z=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(re){var m=re}Reflect.construct(s,[],c)}else{try{c.call()}catch(re){m=re}s.call(c.prototype)}else{try{throw Error()}catch(re){m=re}s()}}catch(re){if(re&&m&&typeof re.stack=="string"){for(var w=re.stack.split(`
35
+ `),S=m.stack.split(`
36
+ `),j=w.length-1,D=S.length-1;1<=j&&0<=D&&w[j]!==S[D];)D--;for(;1<=j&&0<=D;j--,D--)if(w[j]!==S[D]){if(j!==1||D!==1)do if(j--,D--,0>D||w[j]!==S[D]){var H=`
37
+ `+w[j].replace(" at new "," at ");return s.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",s.displayName)),H}while(1<=j&&0<=D);break}}}finally{Z=!1,Error.prepareStackTrace=h}return(s=s?s.displayName||s.name:"")?L(s):""}function le(s){switch(s.tag){case 5:return L(s.type);case 16:return L("Lazy");case 13:return L("Suspense");case 19:return L("SuspenseList");case 0:case 2:case 15:return s=se(s.type,!1),s;case 11:return s=se(s.type.render,!1),s;case 1:return s=se(s.type,!0),s;default:return""}}function ve(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case P:return"Fragment";case T:return"Portal";case I:return"Profiler";case R:return"StrictMode";case X:return"Suspense";case K:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case W:return(s.displayName||"Context")+".Consumer";case Y:return(s._context.displayName||"Context")+".Provider";case B:var c=s.render;return s=s.displayName,s||(s=c.displayName||c.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case U:return c=s.displayName||null,c!==null?c:ve(s.type)||"Memo";case G:c=s._payload,s=s._init;try{return ve(s(c))}catch{}}return null}function qe(s){var c=s.type;switch(s.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return s=c.render,s=s.displayName||s.name||"",c.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ve(c);case 8:return c===R?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function xe(s){switch(typeof s){case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function ae(s){var c=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function Se(s){var c=ae(s)?"checked":"value",h=Object.getOwnPropertyDescriptor(s.constructor.prototype,c),m=""+s[c];if(!s.hasOwnProperty(c)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var w=h.get,S=h.set;return Object.defineProperty(s,c,{configurable:!0,get:function(){return w.call(this)},set:function(j){m=""+j,S.call(this,j)}}),Object.defineProperty(s,c,{enumerable:h.enumerable}),{getValue:function(){return m},setValue:function(j){m=""+j},stopTracking:function(){s._valueTracker=null,delete s[c]}}}}function Me(s){s._valueTracker||(s._valueTracker=Se(s))}function oe(s){if(!s)return!1;var c=s._valueTracker;if(!c)return!0;var h=c.getValue(),m="";return s&&(m=ae(s)?s.checked?"true":"false":s.value),s=m,s!==h?(c.setValue(s),!0):!1}function tt(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}function Fe(s,c){var h=c.checked;return q({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:h??s._wrapperState.initialChecked})}function kt(s,c){var h=c.defaultValue==null?"":c.defaultValue,m=c.checked!=null?c.checked:c.defaultChecked;h=xe(c.value!=null?c.value:h),s._wrapperState={initialChecked:m,initialValue:h,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function wt(s,c){c=c.checked,c!=null&&O(s,"checked",c,!1)}function Et(s,c){wt(s,c);var h=xe(c.value),m=c.type;if(h!=null)m==="number"?(h===0&&s.value===""||s.value!=h)&&(s.value=""+h):s.value!==""+h&&(s.value=""+h);else if(m==="submit"||m==="reset"){s.removeAttribute("value");return}c.hasOwnProperty("value")?Bt(s,c.type,h):c.hasOwnProperty("defaultValue")&&Bt(s,c.type,xe(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(s.defaultChecked=!!c.defaultChecked)}function Sr(s,c,h){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var m=c.type;if(!(m!=="submit"&&m!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+s._wrapperState.initialValue,h||c===s.value||(s.value=c),s.defaultValue=c}h=s.name,h!==""&&(s.name=""),s.defaultChecked=!!s._wrapperState.initialChecked,h!==""&&(s.name=h)}function Bt(s,c,h){(c!=="number"||tt(s.ownerDocument)!==s)&&(h==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+h&&(s.defaultValue=""+h))}var Rr=Array.isArray;function lr(s,c,h,m){if(s=s.options,c){c={};for(var w=0;w<h.length;w++)c["$"+h[w]]=!0;for(h=0;h<s.length;h++)w=c.hasOwnProperty("$"+s[h].value),s[h].selected!==w&&(s[h].selected=w),w&&m&&(s[h].defaultSelected=!0)}else{for(h=""+xe(h),c=null,w=0;w<s.length;w++){if(s[w].value===h){s[w].selected=!0,m&&(s[w].defaultSelected=!0);return}c!==null||s[w].disabled||(c=s[w])}c!==null&&(c.selected=!0)}}function _t(s,c){if(c.dangerouslySetInnerHTML!=null)throw Error(r(91));return q({},c,{value:void 0,defaultValue:void 0,children:""+s._wrapperState.initialValue})}function kr(s,c){var h=c.value;if(h==null){if(h=c.children,c=c.defaultValue,h!=null){if(c!=null)throw Error(r(92));if(Rr(h)){if(1<h.length)throw Error(r(93));h=h[0]}c=h}c==null&&(c=""),h=c}s._wrapperState={initialValue:xe(h)}}function Ir(s,c){var h=xe(c.value),m=xe(c.defaultValue);h!=null&&(h=""+h,h!==s.value&&(s.value=h),c.defaultValue==null&&s.defaultValue!==h&&(s.defaultValue=h)),m!=null&&(s.defaultValue=""+m)}function ni(s){var c=s.textContent;c===s._wrapperState.initialValue&&c!==""&&c!==null&&(s.value=c)}function Ur(s){switch(s){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ii(s,c){return s==null||s==="http://www.w3.org/1999/xhtml"?Ur(c):s==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":s}var ai,aa=(function(s){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,h,m,w){MSApp.execUnsafeLocalFunction(function(){return s(c,h,m,w)})}:s})(function(s,c){if(s.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in s)s.innerHTML=c;else{for(ai=ai||document.createElement("div"),ai.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=ai.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;c.firstChild;)s.appendChild(c.firstChild)}});function qr(s,c){if(c){var h=s.firstChild;if(h&&h===s.lastChild&&h.nodeType===3){h.nodeValue=c;return}}s.textContent=c}var oi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},si=["Webkit","ms","Moz","O"];Object.keys(oi).forEach(function(s){si.forEach(function(c){c=c+s.charAt(0).toUpperCase()+s.substring(1),oi[c]=oi[s]})});function Ho(s,c,h){return c==null||typeof c=="boolean"||c===""?"":h||typeof c!="number"||c===0||oi.hasOwnProperty(s)&&oi[s]?(""+c).trim():c+"px"}function Ka(s,c){s=s.style;for(var h in c)if(c.hasOwnProperty(h)){var m=h.indexOf("--")===0,w=Ho(h,c[h],m);h==="float"&&(h="cssFloat"),m?s.setProperty(h,w):s[h]=w}}var Wo=q({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function oa(s,c){if(c){if(Wo[s]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(r(137,s));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(r(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(r(61))}if(c.style!=null&&typeof c.style!="object")throw Error(r(62))}}function Va(s,c){if(s.indexOf("-")===-1)return typeof c.is=="string";switch(s){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 Rn=null;function $r(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var sa=null,li=null,hn=null;function pn(s){if(s=Gl(s)){if(typeof sa!="function")throw Error(r(280));var c=s.stateNode;c&&(c=ud(c),sa(s.stateNode,s.type,c))}}function M(s){li?hn?hn.push(s):hn=[s]:li=s}function ne(){if(li){var s=li,c=hn;if(hn=li=null,pn(s),c)for(s=0;s<c.length;s++)pn(c[s])}}function de(s,c){return s(c)}function Re(){}var ht=!1;function Ke(s,c,h){if(ht)return s(c,h);ht=!0;try{return de(s,c,h)}finally{ht=!1,(li!==null||hn!==null)&&(Re(),ne())}}function ye(s,c){var h=s.stateNode;if(h===null)return null;var m=ud(h);if(m===null)return null;h=m[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(s=s.type,m=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!m;break e;default:s=!1}if(s)return null;if(h&&typeof h!="function")throw Error(r(231,c,typeof h));return h}var we=!1;if(l)try{var Ce={};Object.defineProperty(Ce,"passive",{get:function(){we=!0}}),window.addEventListener("test",Ce,Ce),window.removeEventListener("test",Ce,Ce)}catch{we=!1}function ct(s,c,h,m,w,S,j,D,H){var re=Array.prototype.slice.call(arguments,3);try{c.apply(h,re)}catch(ue){this.onError(ue)}}var gt=!1,cr=null,Oi=!1,Xa=null,Ip={onError:function(s){gt=!0,cr=s}};function Ol(s,c,h,m,w,S,j,D,H){gt=!1,cr=null,ct.apply(Ip,arguments)}function $p(s,c,h,m,w,S,j,D,H){if(Ol.apply(this,arguments),gt){if(gt){var re=cr;gt=!1,cr=null}else throw Error(r(198));Oi||(Oi=!0,Xa=re)}}function Ai(s){var c=s,h=s;if(s.alternate)for(;c.return;)c=c.return;else{s=c;do c=s,(c.flags&4098)!==0&&(h=c.return),s=c.return;while(s)}return c.tag===3?h:null}function qu(s){if(s.tag===13){var c=s.memoizedState;if(c===null&&(s=s.alternate,s!==null&&(c=s.memoizedState)),c!==null)return c.dehydrated}return null}function Al(s){if(Ai(s)!==s)throw Error(r(188))}function Go(s){var c=s.alternate;if(!c){if(c=Ai(s),c===null)throw Error(r(188));return c!==s?null:s}for(var h=s,m=c;;){var w=h.return;if(w===null)break;var S=w.alternate;if(S===null){if(m=w.return,m!==null){h=m;continue}break}if(w.child===S.child){for(S=w.child;S;){if(S===h)return Al(w),s;if(S===m)return Al(w),c;S=S.sibling}throw Error(r(188))}if(h.return!==m.return)h=w,m=S;else{for(var j=!1,D=w.child;D;){if(D===h){j=!0,h=w,m=S;break}if(D===m){j=!0,m=w,h=S;break}D=D.sibling}if(!j){for(D=S.child;D;){if(D===h){j=!0,h=S,m=w;break}if(D===m){j=!0,m=S,h=w;break}D=D.sibling}if(!j)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?s:c}function Fu(s){return s=Go(s),s!==null?Hu(s):null}function Hu(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var c=Hu(s);if(c!==null)return c;s=s.sibling}return null}var Wu=e.unstable_scheduleCallback,In=e.unstable_cancelCallback,Gu=e.unstable_shouldYield,Ku=e.unstable_requestPaint,Mt=e.unstable_now,Mp=e.unstable_getCurrentPriorityLevel,Tl=e.unstable_ImmediatePriority,Ya=e.unstable_UserBlockingPriority,Ko=e.unstable_NormalPriority,he=e.unstable_LowPriority,$e=e.unstable_IdlePriority,Ve=null,Ze=null;function Wt(s){if(Ze&&typeof Ze.onCommitFiberRoot=="function")try{Ze.onCommitFiberRoot(Ve,s,void 0,(s.current.flags&128)===128)}catch{}}var Lt=Math.clz32?Math.clz32:Mr,ci=Math.log,Vo=Math.LN2;function Mr(s){return s>>>=0,s===0?32:31-(ci(s)/Vo|0)|0}var Lr=64,Ja=4194304;function la(s){switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function Za(s,c){var h=s.pendingLanes;if(h===0)return 0;var m=0,w=s.suspendedLanes,S=s.pingedLanes,j=h&268435455;if(j!==0){var D=j&~w;D!==0?m=la(D):(S&=j,S!==0&&(m=la(S)))}else j=h&~w,j!==0?m=la(j):S!==0&&(m=la(S));if(m===0)return 0;if(c!==0&&c!==m&&(c&w)===0&&(w=m&-m,S=c&-c,w>=S||w===16&&(S&4194240)!==0))return c;if((m&4)!==0&&(m|=h&16),c=s.entangledLanes,c!==0)for(s=s.entanglements,c&=m;0<c;)h=31-Lt(c),w=1<<h,m|=s[h],c&=~w;return m}function Lp(s,c){switch(s){case 1:case 2:case 4:return c+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Dp(s,c){for(var h=s.suspendedLanes,m=s.pingedLanes,w=s.expirationTimes,S=s.pendingLanes;0<S;){var j=31-Lt(S),D=1<<j,H=w[j];H===-1?((D&h)===0||(D&m)!==0)&&(w[j]=Lp(D,c)):H<=c&&(s.expiredLanes|=D),S&=~D}}function Cl(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function Vu(){var s=Lr;return Lr<<=1,(Lr&4194240)===0&&(Lr=64),s}function ca(s){for(var c=[],h=0;31>h;h++)c.push(s);return c}function ua(s,c,h){s.pendingLanes|=c,c!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,c=31-Lt(c),s[c]=h}function mn(s,c){var h=s.pendingLanes&~c;s.pendingLanes=c,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=c,s.mutableReadLanes&=c,s.entangledLanes&=c,c=s.entanglements;var m=s.eventTimes;for(s=s.expirationTimes;0<h;){var w=31-Lt(h),S=1<<w;c[w]=0,m[w]=-1,s[w]=-1,h&=~S}}function jl(s,c){var h=s.entangledLanes|=c;for(s=s.entanglements;h;){var m=31-Lt(h),w=1<<m;w&c|s[m]&c&&(s[m]|=c),h&=~w}}var st=0;function Ge(s){return s&=-s,1<s?4<s?(s&268435455)!==0?16:536870912:4:1}var Pl,Gt,yt,Qa,ui,eo=!1,da=[],me=null,Ee=null,He=null,rt=new Map,Ut=new Map,ur=[],zp="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Xu(s,c){switch(s){case"focusin":case"focusout":me=null;break;case"dragenter":case"dragleave":Ee=null;break;case"mouseover":case"mouseout":He=null;break;case"pointerover":case"pointerout":rt.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ut.delete(c.pointerId)}}function Nl(s,c,h,m,w,S){return s===null||s.nativeEvent!==S?(s={blockedOn:c,domEventName:h,eventSystemFlags:m,nativeEvent:S,targetContainers:[w]},c!==null&&(c=Gl(c),c!==null&&Gt(c)),s):(s.eventSystemFlags|=m,c=s.targetContainers,w!==null&&c.indexOf(w)===-1&&c.push(w),s)}function SM(s,c,h,m,w){switch(c){case"focusin":return me=Nl(me,s,c,h,m,w),!0;case"dragenter":return Ee=Nl(Ee,s,c,h,m,w),!0;case"mouseover":return He=Nl(He,s,c,h,m,w),!0;case"pointerover":var S=w.pointerId;return rt.set(S,Nl(rt.get(S)||null,s,c,h,m,w)),!0;case"gotpointercapture":return S=w.pointerId,Ut.set(S,Nl(Ut.get(S)||null,s,c,h,m,w)),!0}return!1}function Q1(s){var c=to(s.target);if(c!==null){var h=Ai(c);if(h!==null){if(c=h.tag,c===13){if(c=qu(h),c!==null){s.blockedOn=c,ui(s.priority,function(){yt(h)});return}}else if(c===3&&h.stateNode.current.memoizedState.isDehydrated){s.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Yu(s){if(s.blockedOn!==null)return!1;for(var c=s.targetContainers;0<c.length;){var h=Up(s.domEventName,s.eventSystemFlags,c[0],s.nativeEvent);if(h===null){h=s.nativeEvent;var m=new h.constructor(h.type,h);Rn=m,h.target.dispatchEvent(m),Rn=null}else return c=Gl(h),c!==null&&Gt(c),s.blockedOn=h,!1;c.shift()}return!0}function e_(s,c,h){Yu(s)&&h.delete(c)}function kM(){eo=!1,me!==null&&Yu(me)&&(me=null),Ee!==null&&Yu(Ee)&&(Ee=null),He!==null&&Yu(He)&&(He=null),rt.forEach(e_),Ut.forEach(e_)}function Rl(s,c){s.blockedOn===c&&(s.blockedOn=null,eo||(eo=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,kM)))}function Il(s){function c(w){return Rl(w,s)}if(0<da.length){Rl(da[0],s);for(var h=1;h<da.length;h++){var m=da[h];m.blockedOn===s&&(m.blockedOn=null)}}for(me!==null&&Rl(me,s),Ee!==null&&Rl(Ee,s),He!==null&&Rl(He,s),rt.forEach(c),Ut.forEach(c),h=0;h<ur.length;h++)m=ur[h],m.blockedOn===s&&(m.blockedOn=null);for(;0<ur.length&&(h=ur[0],h.blockedOn===null);)Q1(h),h.blockedOn===null&&ur.shift()}var Xo=C.ReactCurrentBatchConfig,Ju=!0;function EM(s,c,h,m){var w=st,S=Xo.transition;Xo.transition=null;try{st=1,Bp(s,c,h,m)}finally{st=w,Xo.transition=S}}function OM(s,c,h,m){var w=st,S=Xo.transition;Xo.transition=null;try{st=4,Bp(s,c,h,m)}finally{st=w,Xo.transition=S}}function Bp(s,c,h,m){if(Ju){var w=Up(s,c,h,m);if(w===null)im(s,c,m,Zu,h),Xu(s,m);else if(SM(w,s,c,h,m))m.stopPropagation();else if(Xu(s,m),c&4&&-1<zp.indexOf(s)){for(;w!==null;){var S=Gl(w);if(S!==null&&Pl(S),S=Up(s,c,h,m),S===null&&im(s,c,m,Zu,h),S===w)break;w=S}w!==null&&m.stopPropagation()}else im(s,c,m,null,h)}}var Zu=null;function Up(s,c,h,m){if(Zu=null,s=$r(m),s=to(s),s!==null)if(c=Ai(s),c===null)s=null;else if(h=c.tag,h===13){if(s=qu(c),s!==null)return s;s=null}else if(h===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;s=null}else c!==s&&(s=null);return Zu=s,null}function t_(s){switch(s){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Mp()){case Tl:return 1;case Ya:return 4;case Ko:case he:return 16;case $e:return 536870912;default:return 16}default:return 16}}var fa=null,qp=null,Qu=null;function r_(){if(Qu)return Qu;var s,c=qp,h=c.length,m,w="value"in fa?fa.value:fa.textContent,S=w.length;for(s=0;s<h&&c[s]===w[s];s++);var j=h-s;for(m=1;m<=j&&c[h-m]===w[S-m];m++);return Qu=w.slice(s,1<m?1-m:void 0)}function ed(s){var c=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&c===13&&(s=13)):s=c,s===10&&(s=13),32<=s||s===13?s:0}function td(){return!0}function n_(){return!1}function Qr(s){function c(h,m,w,S,j){this._reactName=h,this._targetInst=w,this.type=m,this.nativeEvent=S,this.target=j,this.currentTarget=null;for(var D in s)s.hasOwnProperty(D)&&(h=s[D],this[D]=h?h(S):S[D]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?td:n_,this.isPropagationStopped=n_,this}return q(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=td)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=td)},persist:function(){},isPersistent:td}),c}var Yo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fp=Qr(Yo),$l=q({},Yo,{view:0,detail:0}),AM=Qr($l),Hp,Wp,Ml,rd=q({},$l,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Kp,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Ml&&(Ml&&s.type==="mousemove"?(Hp=s.screenX-Ml.screenX,Wp=s.screenY-Ml.screenY):Wp=Hp=0,Ml=s),Hp)},movementY:function(s){return"movementY"in s?s.movementY:Wp}}),i_=Qr(rd),TM=q({},rd,{dataTransfer:0}),CM=Qr(TM),jM=q({},$l,{relatedTarget:0}),Gp=Qr(jM),PM=q({},Yo,{animationName:0,elapsedTime:0,pseudoElement:0}),NM=Qr(PM),RM=q({},Yo,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),IM=Qr(RM),$M=q({},Yo,{data:0}),a_=Qr($M),MM={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},LM={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"},DM={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zM(s){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(s):(s=DM[s])?!!c[s]:!1}function Kp(){return zM}var BM=q({},$l,{key:function(s){if(s.key){var c=MM[s.key]||s.key;if(c!=="Unidentified")return c}return s.type==="keypress"?(s=ed(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?LM[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Kp,charCode:function(s){return s.type==="keypress"?ed(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?ed(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),UM=Qr(BM),qM=q({},rd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),o_=Qr(qM),FM=q({},$l,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Kp}),HM=Qr(FM),WM=q({},Yo,{propertyName:0,elapsedTime:0,pseudoElement:0}),GM=Qr(WM),KM=q({},rd,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),VM=Qr(KM),XM=[9,13,27,32],Vp=l&&"CompositionEvent"in window,Ll=null;l&&"documentMode"in document&&(Ll=document.documentMode);var YM=l&&"TextEvent"in window&&!Ll,s_=l&&(!Vp||Ll&&8<Ll&&11>=Ll),l_=" ",c_=!1;function u_(s,c){switch(s){case"keyup":return XM.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function d_(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Jo=!1;function JM(s,c){switch(s){case"compositionend":return d_(c);case"keypress":return c.which!==32?null:(c_=!0,l_);case"textInput":return s=c.data,s===l_&&c_?null:s;default:return null}}function ZM(s,c){if(Jo)return s==="compositionend"||!Vp&&u_(s,c)?(s=r_(),Qu=qp=fa=null,Jo=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return s_&&c.locale!=="ko"?null:c.data;default:return null}}var QM={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 f_(s){var c=s&&s.nodeName&&s.nodeName.toLowerCase();return c==="input"?!!QM[s.type]:c==="textarea"}function h_(s,c,h,m){M(m),c=sd(c,"onChange"),0<c.length&&(h=new Fp("onChange","change",null,h,m),s.push({event:h,listeners:c}))}var Dl=null,zl=null;function e3(s){P_(s,0)}function nd(s){var c=rs(s);if(oe(c))return s}function t3(s,c){if(s==="change")return c}var p_=!1;if(l){var Xp;if(l){var Yp="oninput"in document;if(!Yp){var m_=document.createElement("div");m_.setAttribute("oninput","return;"),Yp=typeof m_.oninput=="function"}Xp=Yp}else Xp=!1;p_=Xp&&(!document.documentMode||9<document.documentMode)}function g_(){Dl&&(Dl.detachEvent("onpropertychange",y_),zl=Dl=null)}function y_(s){if(s.propertyName==="value"&&nd(zl)){var c=[];h_(c,zl,s,$r(s)),Ke(e3,c)}}function r3(s,c,h){s==="focusin"?(g_(),Dl=c,zl=h,Dl.attachEvent("onpropertychange",y_)):s==="focusout"&&g_()}function n3(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return nd(zl)}function i3(s,c){if(s==="click")return nd(c)}function a3(s,c){if(s==="input"||s==="change")return nd(c)}function o3(s,c){return s===c&&(s!==0||1/s===1/c)||s!==s&&c!==c}var $n=typeof Object.is=="function"?Object.is:o3;function Bl(s,c){if($n(s,c))return!0;if(typeof s!="object"||s===null||typeof c!="object"||c===null)return!1;var h=Object.keys(s),m=Object.keys(c);if(h.length!==m.length)return!1;for(m=0;m<h.length;m++){var w=h[m];if(!u.call(c,w)||!$n(s[w],c[w]))return!1}return!0}function v_(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function b_(s,c){var h=v_(s);s=0;for(var m;h;){if(h.nodeType===3){if(m=s+h.textContent.length,s<=c&&m>=c)return{node:h,offset:c-s};s=m}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=v_(h)}}function x_(s,c){return s&&c?s===c?!0:s&&s.nodeType===3?!1:c&&c.nodeType===3?x_(s,c.parentNode):"contains"in s?s.contains(c):s.compareDocumentPosition?!!(s.compareDocumentPosition(c)&16):!1:!1}function w_(){for(var s=window,c=tt();c instanceof s.HTMLIFrameElement;){try{var h=typeof c.contentWindow.location.href=="string"}catch{h=!1}if(h)s=c.contentWindow;else break;c=tt(s.document)}return c}function Jp(s){var c=s&&s.nodeName&&s.nodeName.toLowerCase();return c&&(c==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||c==="textarea"||s.contentEditable==="true")}function s3(s){var c=w_(),h=s.focusedElem,m=s.selectionRange;if(c!==h&&h&&h.ownerDocument&&x_(h.ownerDocument.documentElement,h)){if(m!==null&&Jp(h)){if(c=m.start,s=m.end,s===void 0&&(s=c),"selectionStart"in h)h.selectionStart=c,h.selectionEnd=Math.min(s,h.value.length);else if(s=(c=h.ownerDocument||document)&&c.defaultView||window,s.getSelection){s=s.getSelection();var w=h.textContent.length,S=Math.min(m.start,w);m=m.end===void 0?S:Math.min(m.end,w),!s.extend&&S>m&&(w=m,m=S,S=w),w=b_(h,S);var j=b_(h,m);w&&j&&(s.rangeCount!==1||s.anchorNode!==w.node||s.anchorOffset!==w.offset||s.focusNode!==j.node||s.focusOffset!==j.offset)&&(c=c.createRange(),c.setStart(w.node,w.offset),s.removeAllRanges(),S>m?(s.addRange(c),s.extend(j.node,j.offset)):(c.setEnd(j.node,j.offset),s.addRange(c)))}}for(c=[],s=h;s=s.parentNode;)s.nodeType===1&&c.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<c.length;h++)s=c[h],s.element.scrollLeft=s.left,s.element.scrollTop=s.top}}var l3=l&&"documentMode"in document&&11>=document.documentMode,Zo=null,Zp=null,Ul=null,Qp=!1;function __(s,c,h){var m=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Qp||Zo==null||Zo!==tt(m)||(m=Zo,"selectionStart"in m&&Jp(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}),Ul&&Bl(Ul,m)||(Ul=m,m=sd(Zp,"onSelect"),0<m.length&&(c=new Fp("onSelect","select",null,c,h),s.push({event:c,listeners:m}),c.target=Zo)))}function id(s,c){var h={};return h[s.toLowerCase()]=c.toLowerCase(),h["Webkit"+s]="webkit"+c,h["Moz"+s]="moz"+c,h}var Qo={animationend:id("Animation","AnimationEnd"),animationiteration:id("Animation","AnimationIteration"),animationstart:id("Animation","AnimationStart"),transitionend:id("Transition","TransitionEnd")},em={},S_={};l&&(S_=document.createElement("div").style,"AnimationEvent"in window||(delete Qo.animationend.animation,delete Qo.animationiteration.animation,delete Qo.animationstart.animation),"TransitionEvent"in window||delete Qo.transitionend.transition);function ad(s){if(em[s])return em[s];if(!Qo[s])return s;var c=Qo[s],h;for(h in c)if(c.hasOwnProperty(h)&&h in S_)return em[s]=c[h];return s}var k_=ad("animationend"),E_=ad("animationiteration"),O_=ad("animationstart"),A_=ad("transitionend"),T_=new Map,C_="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ha(s,c){T_.set(s,c),a(c,[s])}for(var tm=0;tm<C_.length;tm++){var rm=C_[tm],c3=rm.toLowerCase(),u3=rm[0].toUpperCase()+rm.slice(1);ha(c3,"on"+u3)}ha(k_,"onAnimationEnd"),ha(E_,"onAnimationIteration"),ha(O_,"onAnimationStart"),ha("dblclick","onDoubleClick"),ha("focusin","onFocus"),ha("focusout","onBlur"),ha(A_,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ql="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),d3=new Set("cancel close invalid load scroll toggle".split(" ").concat(ql));function j_(s,c,h){var m=s.type||"unknown-event";s.currentTarget=h,$p(m,c,void 0,s),s.currentTarget=null}function P_(s,c){c=(c&4)!==0;for(var h=0;h<s.length;h++){var m=s[h],w=m.event;m=m.listeners;e:{var S=void 0;if(c)for(var j=m.length-1;0<=j;j--){var D=m[j],H=D.instance,re=D.currentTarget;if(D=D.listener,H!==S&&w.isPropagationStopped())break e;j_(w,D,re),S=H}else for(j=0;j<m.length;j++){if(D=m[j],H=D.instance,re=D.currentTarget,D=D.listener,H!==S&&w.isPropagationStopped())break e;j_(w,D,re),S=H}}}if(Oi)throw s=Xa,Oi=!1,Xa=null,s}function Ct(s,c){var h=c[um];h===void 0&&(h=c[um]=new Set);var m=s+"__bubble";h.has(m)||(N_(c,s,2,!1),h.add(m))}function nm(s,c,h){var m=0;c&&(m|=4),N_(h,s,m,c)}var od="_reactListening"+Math.random().toString(36).slice(2);function Fl(s){if(!s[od]){s[od]=!0,n.forEach(function(h){h!=="selectionchange"&&(d3.has(h)||nm(h,!1,s),nm(h,!0,s))});var c=s.nodeType===9?s:s.ownerDocument;c===null||c[od]||(c[od]=!0,nm("selectionchange",!1,c))}}function N_(s,c,h,m){switch(t_(c)){case 1:var w=EM;break;case 4:w=OM;break;default:w=Bp}h=w.bind(null,c,h,s),w=void 0,!we||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(w=!0),m?w!==void 0?s.addEventListener(c,h,{capture:!0,passive:w}):s.addEventListener(c,h,!0):w!==void 0?s.addEventListener(c,h,{passive:w}):s.addEventListener(c,h,!1)}function im(s,c,h,m,w){var S=m;if((c&1)===0&&(c&2)===0&&m!==null)e:for(;;){if(m===null)return;var j=m.tag;if(j===3||j===4){var D=m.stateNode.containerInfo;if(D===w||D.nodeType===8&&D.parentNode===w)break;if(j===4)for(j=m.return;j!==null;){var H=j.tag;if((H===3||H===4)&&(H=j.stateNode.containerInfo,H===w||H.nodeType===8&&H.parentNode===w))return;j=j.return}for(;D!==null;){if(j=to(D),j===null)return;if(H=j.tag,H===5||H===6){m=S=j;continue e}D=D.parentNode}}m=m.return}Ke(function(){var re=S,ue=$r(h),fe=[];e:{var ce=T_.get(s);if(ce!==void 0){var _e=Fp,je=s;switch(s){case"keypress":if(ed(h)===0)break e;case"keydown":case"keyup":_e=UM;break;case"focusin":je="focus",_e=Gp;break;case"focusout":je="blur",_e=Gp;break;case"beforeblur":case"afterblur":_e=Gp;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":_e=i_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":_e=CM;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":_e=HM;break;case k_:case E_:case O_:_e=NM;break;case A_:_e=GM;break;case"scroll":_e=AM;break;case"wheel":_e=VM;break;case"copy":case"cut":case"paste":_e=IM;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":_e=o_}var Ne=(c&4)!==0,Kt=!Ne&&s==="scroll",Q=Ne?ce!==null?ce+"Capture":null:ce;Ne=[];for(var V=re,ee;V!==null;){ee=V;var pe=ee.stateNode;if(ee.tag===5&&pe!==null&&(ee=pe,Q!==null&&(pe=ye(V,Q),pe!=null&&Ne.push(Hl(V,pe,ee)))),Kt)break;V=V.return}0<Ne.length&&(ce=new _e(ce,je,null,h,ue),fe.push({event:ce,listeners:Ne}))}}if((c&7)===0){e:{if(ce=s==="mouseover"||s==="pointerover",_e=s==="mouseout"||s==="pointerout",ce&&h!==Rn&&(je=h.relatedTarget||h.fromElement)&&(to(je)||je[Ti]))break e;if((_e||ce)&&(ce=ue.window===ue?ue:(ce=ue.ownerDocument)?ce.defaultView||ce.parentWindow:window,_e?(je=h.relatedTarget||h.toElement,_e=re,je=je?to(je):null,je!==null&&(Kt=Ai(je),je!==Kt||je.tag!==5&&je.tag!==6)&&(je=null)):(_e=null,je=re),_e!==je)){if(Ne=i_,pe="onMouseLeave",Q="onMouseEnter",V="mouse",(s==="pointerout"||s==="pointerover")&&(Ne=o_,pe="onPointerLeave",Q="onPointerEnter",V="pointer"),Kt=_e==null?ce:rs(_e),ee=je==null?ce:rs(je),ce=new Ne(pe,V+"leave",_e,h,ue),ce.target=Kt,ce.relatedTarget=ee,pe=null,to(ue)===re&&(Ne=new Ne(Q,V+"enter",je,h,ue),Ne.target=ee,Ne.relatedTarget=Kt,pe=Ne),Kt=pe,_e&&je)t:{for(Ne=_e,Q=je,V=0,ee=Ne;ee;ee=es(ee))V++;for(ee=0,pe=Q;pe;pe=es(pe))ee++;for(;0<V-ee;)Ne=es(Ne),V--;for(;0<ee-V;)Q=es(Q),ee--;for(;V--;){if(Ne===Q||Q!==null&&Ne===Q.alternate)break t;Ne=es(Ne),Q=es(Q)}Ne=null}else Ne=null;_e!==null&&R_(fe,ce,_e,Ne,!1),je!==null&&Kt!==null&&R_(fe,Kt,je,Ne,!0)}}e:{if(ce=re?rs(re):window,_e=ce.nodeName&&ce.nodeName.toLowerCase(),_e==="select"||_e==="input"&&ce.type==="file")var Ie=t3;else if(f_(ce))if(p_)Ie=a3;else{Ie=n3;var Le=r3}else(_e=ce.nodeName)&&_e.toLowerCase()==="input"&&(ce.type==="checkbox"||ce.type==="radio")&&(Ie=i3);if(Ie&&(Ie=Ie(s,re))){h_(fe,Ie,h,ue);break e}Le&&Le(s,ce,re),s==="focusout"&&(Le=ce._wrapperState)&&Le.controlled&&ce.type==="number"&&Bt(ce,"number",ce.value)}switch(Le=re?rs(re):window,s){case"focusin":(f_(Le)||Le.contentEditable==="true")&&(Zo=Le,Zp=re,Ul=null);break;case"focusout":Ul=Zp=Zo=null;break;case"mousedown":Qp=!0;break;case"contextmenu":case"mouseup":case"dragend":Qp=!1,__(fe,h,ue);break;case"selectionchange":if(l3)break;case"keydown":case"keyup":__(fe,h,ue)}var De;if(Vp)e:{switch(s){case"compositionstart":var We="onCompositionStart";break e;case"compositionend":We="onCompositionEnd";break e;case"compositionupdate":We="onCompositionUpdate";break e}We=void 0}else Jo?u_(s,h)&&(We="onCompositionEnd"):s==="keydown"&&h.keyCode===229&&(We="onCompositionStart");We&&(s_&&h.locale!=="ko"&&(Jo||We!=="onCompositionStart"?We==="onCompositionEnd"&&Jo&&(De=r_()):(fa=ue,qp="value"in fa?fa.value:fa.textContent,Jo=!0)),Le=sd(re,We),0<Le.length&&(We=new a_(We,s,null,h,ue),fe.push({event:We,listeners:Le}),De?We.data=De:(De=d_(h),De!==null&&(We.data=De)))),(De=YM?JM(s,h):ZM(s,h))&&(re=sd(re,"onBeforeInput"),0<re.length&&(ue=new a_("onBeforeInput","beforeinput",null,h,ue),fe.push({event:ue,listeners:re}),ue.data=De))}P_(fe,c)})}function Hl(s,c,h){return{instance:s,listener:c,currentTarget:h}}function sd(s,c){for(var h=c+"Capture",m=[];s!==null;){var w=s,S=w.stateNode;w.tag===5&&S!==null&&(w=S,S=ye(s,h),S!=null&&m.unshift(Hl(s,S,w)),S=ye(s,c),S!=null&&m.push(Hl(s,S,w))),s=s.return}return m}function es(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5);return s||null}function R_(s,c,h,m,w){for(var S=c._reactName,j=[];h!==null&&h!==m;){var D=h,H=D.alternate,re=D.stateNode;if(H!==null&&H===m)break;D.tag===5&&re!==null&&(D=re,w?(H=ye(h,S),H!=null&&j.unshift(Hl(h,H,D))):w||(H=ye(h,S),H!=null&&j.push(Hl(h,H,D)))),h=h.return}j.length!==0&&s.push({event:c,listeners:j})}var f3=/\r\n?/g,h3=/\u0000|\uFFFD/g;function I_(s){return(typeof s=="string"?s:""+s).replace(f3,`
38
+ `).replace(h3,"")}function ld(s,c,h){if(c=I_(c),I_(s)!==c&&h)throw Error(r(425))}function cd(){}var am=null,om=null;function sm(s,c){return s==="textarea"||s==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var lm=typeof setTimeout=="function"?setTimeout:void 0,p3=typeof clearTimeout=="function"?clearTimeout:void 0,$_=typeof Promise=="function"?Promise:void 0,m3=typeof queueMicrotask=="function"?queueMicrotask:typeof $_<"u"?function(s){return $_.resolve(null).then(s).catch(g3)}:lm;function g3(s){setTimeout(function(){throw s})}function cm(s,c){var h=c,m=0;do{var w=h.nextSibling;if(s.removeChild(h),w&&w.nodeType===8)if(h=w.data,h==="/$"){if(m===0){s.removeChild(w),Il(c);return}m--}else h!=="$"&&h!=="$?"&&h!=="$!"||m++;h=w}while(h);Il(c)}function pa(s){for(;s!=null;s=s.nextSibling){var c=s.nodeType;if(c===1||c===3)break;if(c===8){if(c=s.data,c==="$"||c==="$!"||c==="$?")break;if(c==="/$")return null}}return s}function M_(s){s=s.previousSibling;for(var c=0;s;){if(s.nodeType===8){var h=s.data;if(h==="$"||h==="$!"||h==="$?"){if(c===0)return s;c--}else h==="/$"&&c++}s=s.previousSibling}return null}var ts=Math.random().toString(36).slice(2),di="__reactFiber$"+ts,Wl="__reactProps$"+ts,Ti="__reactContainer$"+ts,um="__reactEvents$"+ts,y3="__reactListeners$"+ts,v3="__reactHandles$"+ts;function to(s){var c=s[di];if(c)return c;for(var h=s.parentNode;h;){if(c=h[Ti]||h[di]){if(h=c.alternate,c.child!==null||h!==null&&h.child!==null)for(s=M_(s);s!==null;){if(h=s[di])return h;s=M_(s)}return c}s=h,h=s.parentNode}return null}function Gl(s){return s=s[di]||s[Ti],!s||s.tag!==5&&s.tag!==6&&s.tag!==13&&s.tag!==3?null:s}function rs(s){if(s.tag===5||s.tag===6)return s.stateNode;throw Error(r(33))}function ud(s){return s[Wl]||null}var dm=[],ns=-1;function ma(s){return{current:s}}function jt(s){0>ns||(s.current=dm[ns],dm[ns]=null,ns--)}function Ot(s,c){ns++,dm[ns]=s.current,s.current=c}var ga={},Er=ma(ga),Fr=ma(!1),ro=ga;function is(s,c){var h=s.type.contextTypes;if(!h)return ga;var m=s.stateNode;if(m&&m.__reactInternalMemoizedUnmaskedChildContext===c)return m.__reactInternalMemoizedMaskedChildContext;var w={},S;for(S in h)w[S]=c[S];return m&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=c,s.__reactInternalMemoizedMaskedChildContext=w),w}function Hr(s){return s=s.childContextTypes,s!=null}function dd(){jt(Fr),jt(Er)}function L_(s,c,h){if(Er.current!==ga)throw Error(r(168));Ot(Er,c),Ot(Fr,h)}function D_(s,c,h){var m=s.stateNode;if(c=c.childContextTypes,typeof m.getChildContext!="function")return h;m=m.getChildContext();for(var w in m)if(!(w in c))throw Error(r(108,qe(s)||"Unknown",w));return q({},h,m)}function fd(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||ga,ro=Er.current,Ot(Er,s),Ot(Fr,Fr.current),!0}function z_(s,c,h){var m=s.stateNode;if(!m)throw Error(r(169));h?(s=D_(s,c,ro),m.__reactInternalMemoizedMergedChildContext=s,jt(Fr),jt(Er),Ot(Er,s)):jt(Fr),Ot(Fr,h)}var Ci=null,hd=!1,fm=!1;function B_(s){Ci===null?Ci=[s]:Ci.push(s)}function b3(s){hd=!0,B_(s)}function ya(){if(!fm&&Ci!==null){fm=!0;var s=0,c=st;try{var h=Ci;for(st=1;s<h.length;s++){var m=h[s];do m=m(!0);while(m!==null)}Ci=null,hd=!1}catch(w){throw Ci!==null&&(Ci=Ci.slice(s+1)),Wu(Tl,ya),w}finally{st=c,fm=!1}}return null}var as=[],os=0,pd=null,md=0,gn=[],yn=0,no=null,ji=1,Pi="";function io(s,c){as[os++]=md,as[os++]=pd,pd=s,md=c}function U_(s,c,h){gn[yn++]=ji,gn[yn++]=Pi,gn[yn++]=no,no=s;var m=ji;s=Pi;var w=32-Lt(m)-1;m&=~(1<<w),h+=1;var S=32-Lt(c)+w;if(30<S){var j=w-w%5;S=(m&(1<<j)-1).toString(32),m>>=j,w-=j,ji=1<<32-Lt(c)+w|h<<w|m,Pi=S+s}else ji=1<<S|h<<w|m,Pi=s}function hm(s){s.return!==null&&(io(s,1),U_(s,1,0))}function pm(s){for(;s===pd;)pd=as[--os],as[os]=null,md=as[--os],as[os]=null;for(;s===no;)no=gn[--yn],gn[yn]=null,Pi=gn[--yn],gn[yn]=null,ji=gn[--yn],gn[yn]=null}var en=null,tn=null,Nt=!1,Mn=null;function q_(s,c){var h=wn(5,null,null,0);h.elementType="DELETED",h.stateNode=c,h.return=s,c=s.deletions,c===null?(s.deletions=[h],s.flags|=16):c.push(h)}function F_(s,c){switch(s.tag){case 5:var h=s.type;return c=c.nodeType!==1||h.toLowerCase()!==c.nodeName.toLowerCase()?null:c,c!==null?(s.stateNode=c,en=s,tn=pa(c.firstChild),!0):!1;case 6:return c=s.pendingProps===""||c.nodeType!==3?null:c,c!==null?(s.stateNode=c,en=s,tn=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(h=no!==null?{id:ji,overflow:Pi}:null,s.memoizedState={dehydrated:c,treeContext:h,retryLane:1073741824},h=wn(18,null,null,0),h.stateNode=c,h.return=s,s.child=h,en=s,tn=null,!0):!1;default:return!1}}function mm(s){return(s.mode&1)!==0&&(s.flags&128)===0}function gm(s){if(Nt){var c=tn;if(c){var h=c;if(!F_(s,c)){if(mm(s))throw Error(r(418));c=pa(h.nextSibling);var m=en;c&&F_(s,c)?q_(m,h):(s.flags=s.flags&-4097|2,Nt=!1,en=s)}}else{if(mm(s))throw Error(r(418));s.flags=s.flags&-4097|2,Nt=!1,en=s}}}function H_(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;en=s}function gd(s){if(s!==en)return!1;if(!Nt)return H_(s),Nt=!0,!1;var c;if((c=s.tag!==3)&&!(c=s.tag!==5)&&(c=s.type,c=c!=="head"&&c!=="body"&&!sm(s.type,s.memoizedProps)),c&&(c=tn)){if(mm(s))throw W_(),Error(r(418));for(;c;)q_(s,c),c=pa(c.nextSibling)}if(H_(s),s.tag===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));e:{for(s=s.nextSibling,c=0;s;){if(s.nodeType===8){var h=s.data;if(h==="/$"){if(c===0){tn=pa(s.nextSibling);break e}c--}else h!=="$"&&h!=="$!"&&h!=="$?"||c++}s=s.nextSibling}tn=null}}else tn=en?pa(s.stateNode.nextSibling):null;return!0}function W_(){for(var s=tn;s;)s=pa(s.nextSibling)}function ss(){tn=en=null,Nt=!1}function ym(s){Mn===null?Mn=[s]:Mn.push(s)}var x3=C.ReactCurrentBatchConfig;function Kl(s,c,h){if(s=h.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(h._owner){if(h=h._owner,h){if(h.tag!==1)throw Error(r(309));var m=h.stateNode}if(!m)throw Error(r(147,s));var w=m,S=""+s;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===S?c.ref:(c=function(j){var D=w.refs;j===null?delete D[S]:D[S]=j},c._stringRef=S,c)}if(typeof s!="string")throw Error(r(284));if(!h._owner)throw Error(r(290,s))}return s}function yd(s,c){throw s=Object.prototype.toString.call(c),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":s))}function G_(s){var c=s._init;return c(s._payload)}function K_(s){function c(Q,V){if(s){var ee=Q.deletions;ee===null?(Q.deletions=[V],Q.flags|=16):ee.push(V)}}function h(Q,V){if(!s)return null;for(;V!==null;)c(Q,V),V=V.sibling;return null}function m(Q,V){for(Q=new Map;V!==null;)V.key!==null?Q.set(V.key,V):Q.set(V.index,V),V=V.sibling;return Q}function w(Q,V){return Q=Ea(Q,V),Q.index=0,Q.sibling=null,Q}function S(Q,V,ee){return Q.index=ee,s?(ee=Q.alternate,ee!==null?(ee=ee.index,ee<V?(Q.flags|=2,V):ee):(Q.flags|=2,V)):(Q.flags|=1048576,V)}function j(Q){return s&&Q.alternate===null&&(Q.flags|=2),Q}function D(Q,V,ee,pe){return V===null||V.tag!==6?(V=lg(ee,Q.mode,pe),V.return=Q,V):(V=w(V,ee),V.return=Q,V)}function H(Q,V,ee,pe){var Ie=ee.type;return Ie===P?ue(Q,V,ee.props.children,pe,ee.key):V!==null&&(V.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===G&&G_(Ie)===V.type)?(pe=w(V,ee.props),pe.ref=Kl(Q,V,ee),pe.return=Q,pe):(pe=Ud(ee.type,ee.key,ee.props,null,Q.mode,pe),pe.ref=Kl(Q,V,ee),pe.return=Q,pe)}function re(Q,V,ee,pe){return V===null||V.tag!==4||V.stateNode.containerInfo!==ee.containerInfo||V.stateNode.implementation!==ee.implementation?(V=cg(ee,Q.mode,pe),V.return=Q,V):(V=w(V,ee.children||[]),V.return=Q,V)}function ue(Q,V,ee,pe,Ie){return V===null||V.tag!==7?(V=ho(ee,Q.mode,pe,Ie),V.return=Q,V):(V=w(V,ee),V.return=Q,V)}function fe(Q,V,ee){if(typeof V=="string"&&V!==""||typeof V=="number")return V=lg(""+V,Q.mode,ee),V.return=Q,V;if(typeof V=="object"&&V!==null){switch(V.$$typeof){case E:return ee=Ud(V.type,V.key,V.props,null,Q.mode,ee),ee.ref=Kl(Q,null,V),ee.return=Q,ee;case T:return V=cg(V,Q.mode,ee),V.return=Q,V;case G:var pe=V._init;return fe(Q,pe(V._payload),ee)}if(Rr(V)||te(V))return V=ho(V,Q.mode,ee,null),V.return=Q,V;yd(Q,V)}return null}function ce(Q,V,ee,pe){var Ie=V!==null?V.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number")return Ie!==null?null:D(Q,V,""+ee,pe);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case E:return ee.key===Ie?H(Q,V,ee,pe):null;case T:return ee.key===Ie?re(Q,V,ee,pe):null;case G:return Ie=ee._init,ce(Q,V,Ie(ee._payload),pe)}if(Rr(ee)||te(ee))return Ie!==null?null:ue(Q,V,ee,pe,null);yd(Q,ee)}return null}function _e(Q,V,ee,pe,Ie){if(typeof pe=="string"&&pe!==""||typeof pe=="number")return Q=Q.get(ee)||null,D(V,Q,""+pe,Ie);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case E:return Q=Q.get(pe.key===null?ee:pe.key)||null,H(V,Q,pe,Ie);case T:return Q=Q.get(pe.key===null?ee:pe.key)||null,re(V,Q,pe,Ie);case G:var Le=pe._init;return _e(Q,V,ee,Le(pe._payload),Ie)}if(Rr(pe)||te(pe))return Q=Q.get(ee)||null,ue(V,Q,pe,Ie,null);yd(V,pe)}return null}function je(Q,V,ee,pe){for(var Ie=null,Le=null,De=V,We=V=0,hr=null;De!==null&&We<ee.length;We++){De.index>We?(hr=De,De=null):hr=De.sibling;var ut=ce(Q,De,ee[We],pe);if(ut===null){De===null&&(De=hr);break}s&&De&&ut.alternate===null&&c(Q,De),V=S(ut,V,We),Le===null?Ie=ut:Le.sibling=ut,Le=ut,De=hr}if(We===ee.length)return h(Q,De),Nt&&io(Q,We),Ie;if(De===null){for(;We<ee.length;We++)De=fe(Q,ee[We],pe),De!==null&&(V=S(De,V,We),Le===null?Ie=De:Le.sibling=De,Le=De);return Nt&&io(Q,We),Ie}for(De=m(Q,De);We<ee.length;We++)hr=_e(De,Q,We,ee[We],pe),hr!==null&&(s&&hr.alternate!==null&&De.delete(hr.key===null?We:hr.key),V=S(hr,V,We),Le===null?Ie=hr:Le.sibling=hr,Le=hr);return s&&De.forEach(function(Oa){return c(Q,Oa)}),Nt&&io(Q,We),Ie}function Ne(Q,V,ee,pe){var Ie=te(ee);if(typeof Ie!="function")throw Error(r(150));if(ee=Ie.call(ee),ee==null)throw Error(r(151));for(var Le=Ie=null,De=V,We=V=0,hr=null,ut=ee.next();De!==null&&!ut.done;We++,ut=ee.next()){De.index>We?(hr=De,De=null):hr=De.sibling;var Oa=ce(Q,De,ut.value,pe);if(Oa===null){De===null&&(De=hr);break}s&&De&&Oa.alternate===null&&c(Q,De),V=S(Oa,V,We),Le===null?Ie=Oa:Le.sibling=Oa,Le=Oa,De=hr}if(ut.done)return h(Q,De),Nt&&io(Q,We),Ie;if(De===null){for(;!ut.done;We++,ut=ee.next())ut=fe(Q,ut.value,pe),ut!==null&&(V=S(ut,V,We),Le===null?Ie=ut:Le.sibling=ut,Le=ut);return Nt&&io(Q,We),Ie}for(De=m(Q,De);!ut.done;We++,ut=ee.next())ut=_e(De,Q,We,ut.value,pe),ut!==null&&(s&&ut.alternate!==null&&De.delete(ut.key===null?We:ut.key),V=S(ut,V,We),Le===null?Ie=ut:Le.sibling=ut,Le=ut);return s&&De.forEach(function(Q3){return c(Q,Q3)}),Nt&&io(Q,We),Ie}function Kt(Q,V,ee,pe){if(typeof ee=="object"&&ee!==null&&ee.type===P&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case E:e:{for(var Ie=ee.key,Le=V;Le!==null;){if(Le.key===Ie){if(Ie=ee.type,Ie===P){if(Le.tag===7){h(Q,Le.sibling),V=w(Le,ee.props.children),V.return=Q,Q=V;break e}}else if(Le.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===G&&G_(Ie)===Le.type){h(Q,Le.sibling),V=w(Le,ee.props),V.ref=Kl(Q,Le,ee),V.return=Q,Q=V;break e}h(Q,Le);break}else c(Q,Le);Le=Le.sibling}ee.type===P?(V=ho(ee.props.children,Q.mode,pe,ee.key),V.return=Q,Q=V):(pe=Ud(ee.type,ee.key,ee.props,null,Q.mode,pe),pe.ref=Kl(Q,V,ee),pe.return=Q,Q=pe)}return j(Q);case T:e:{for(Le=ee.key;V!==null;){if(V.key===Le)if(V.tag===4&&V.stateNode.containerInfo===ee.containerInfo&&V.stateNode.implementation===ee.implementation){h(Q,V.sibling),V=w(V,ee.children||[]),V.return=Q,Q=V;break e}else{h(Q,V);break}else c(Q,V);V=V.sibling}V=cg(ee,Q.mode,pe),V.return=Q,Q=V}return j(Q);case G:return Le=ee._init,Kt(Q,V,Le(ee._payload),pe)}if(Rr(ee))return je(Q,V,ee,pe);if(te(ee))return Ne(Q,V,ee,pe);yd(Q,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"?(ee=""+ee,V!==null&&V.tag===6?(h(Q,V.sibling),V=w(V,ee),V.return=Q,Q=V):(h(Q,V),V=lg(ee,Q.mode,pe),V.return=Q,Q=V),j(Q)):h(Q,V)}return Kt}var ls=K_(!0),V_=K_(!1),vd=ma(null),bd=null,cs=null,vm=null;function bm(){vm=cs=bd=null}function xm(s){var c=vd.current;jt(vd),s._currentValue=c}function wm(s,c,h){for(;s!==null;){var m=s.alternate;if((s.childLanes&c)!==c?(s.childLanes|=c,m!==null&&(m.childLanes|=c)):m!==null&&(m.childLanes&c)!==c&&(m.childLanes|=c),s===h)break;s=s.return}}function us(s,c){bd=s,vm=cs=null,s=s.dependencies,s!==null&&s.firstContext!==null&&((s.lanes&c)!==0&&(Wr=!0),s.firstContext=null)}function vn(s){var c=s._currentValue;if(vm!==s)if(s={context:s,memoizedValue:c,next:null},cs===null){if(bd===null)throw Error(r(308));cs=s,bd.dependencies={lanes:0,firstContext:s}}else cs=cs.next=s;return c}var ao=null;function _m(s){ao===null?ao=[s]:ao.push(s)}function X_(s,c,h,m){var w=c.interleaved;return w===null?(h.next=h,_m(c)):(h.next=w.next,w.next=h),c.interleaved=h,Ni(s,m)}function Ni(s,c){s.lanes|=c;var h=s.alternate;for(h!==null&&(h.lanes|=c),h=s,s=s.return;s!==null;)s.childLanes|=c,h=s.alternate,h!==null&&(h.childLanes|=c),h=s,s=s.return;return h.tag===3?h.stateNode:null}var va=!1;function Sm(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Y_(s,c){s=s.updateQueue,c.updateQueue===s&&(c.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,effects:s.effects})}function Ri(s,c){return{eventTime:s,lane:c,tag:0,payload:null,callback:null,next:null}}function ba(s,c,h){var m=s.updateQueue;if(m===null)return null;if(m=m.shared,(lt&2)!==0){var w=m.pending;return w===null?c.next=c:(c.next=w.next,w.next=c),m.pending=c,Ni(s,h)}return w=m.interleaved,w===null?(c.next=c,_m(m)):(c.next=w.next,w.next=c),m.interleaved=c,Ni(s,h)}function xd(s,c,h){if(c=c.updateQueue,c!==null&&(c=c.shared,(h&4194240)!==0)){var m=c.lanes;m&=s.pendingLanes,h|=m,c.lanes=h,jl(s,h)}}function J_(s,c){var h=s.updateQueue,m=s.alternate;if(m!==null&&(m=m.updateQueue,h===m)){var w=null,S=null;if(h=h.firstBaseUpdate,h!==null){do{var j={eventTime:h.eventTime,lane:h.lane,tag:h.tag,payload:h.payload,callback:h.callback,next:null};S===null?w=S=j:S=S.next=j,h=h.next}while(h!==null);S===null?w=S=c:S=S.next=c}else w=S=c;h={baseState:m.baseState,firstBaseUpdate:w,lastBaseUpdate:S,shared:m.shared,effects:m.effects},s.updateQueue=h;return}s=h.lastBaseUpdate,s===null?h.firstBaseUpdate=c:s.next=c,h.lastBaseUpdate=c}function wd(s,c,h,m){var w=s.updateQueue;va=!1;var S=w.firstBaseUpdate,j=w.lastBaseUpdate,D=w.shared.pending;if(D!==null){w.shared.pending=null;var H=D,re=H.next;H.next=null,j===null?S=re:j.next=re,j=H;var ue=s.alternate;ue!==null&&(ue=ue.updateQueue,D=ue.lastBaseUpdate,D!==j&&(D===null?ue.firstBaseUpdate=re:D.next=re,ue.lastBaseUpdate=H))}if(S!==null){var fe=w.baseState;j=0,ue=re=H=null,D=S;do{var ce=D.lane,_e=D.eventTime;if((m&ce)===ce){ue!==null&&(ue=ue.next={eventTime:_e,lane:0,tag:D.tag,payload:D.payload,callback:D.callback,next:null});e:{var je=s,Ne=D;switch(ce=c,_e=h,Ne.tag){case 1:if(je=Ne.payload,typeof je=="function"){fe=je.call(_e,fe,ce);break e}fe=je;break e;case 3:je.flags=je.flags&-65537|128;case 0:if(je=Ne.payload,ce=typeof je=="function"?je.call(_e,fe,ce):je,ce==null)break e;fe=q({},fe,ce);break e;case 2:va=!0}}D.callback!==null&&D.lane!==0&&(s.flags|=64,ce=w.effects,ce===null?w.effects=[D]:ce.push(D))}else _e={eventTime:_e,lane:ce,tag:D.tag,payload:D.payload,callback:D.callback,next:null},ue===null?(re=ue=_e,H=fe):ue=ue.next=_e,j|=ce;if(D=D.next,D===null){if(D=w.shared.pending,D===null)break;ce=D,D=ce.next,ce.next=null,w.lastBaseUpdate=ce,w.shared.pending=null}}while(!0);if(ue===null&&(H=fe),w.baseState=H,w.firstBaseUpdate=re,w.lastBaseUpdate=ue,c=w.shared.interleaved,c!==null){w=c;do j|=w.lane,w=w.next;while(w!==c)}else S===null&&(w.shared.lanes=0);lo|=j,s.lanes=j,s.memoizedState=fe}}function Z_(s,c,h){if(s=c.effects,c.effects=null,s!==null)for(c=0;c<s.length;c++){var m=s[c],w=m.callback;if(w!==null){if(m.callback=null,m=h,typeof w!="function")throw Error(r(191,w));w.call(m)}}}var Vl={},fi=ma(Vl),Xl=ma(Vl),Yl=ma(Vl);function oo(s){if(s===Vl)throw Error(r(174));return s}function km(s,c){switch(Ot(Yl,c),Ot(Xl,s),Ot(fi,Vl),s=c.nodeType,s){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:ii(null,"");break;default:s=s===8?c.parentNode:c,c=s.namespaceURI||null,s=s.tagName,c=ii(c,s)}jt(fi),Ot(fi,c)}function ds(){jt(fi),jt(Xl),jt(Yl)}function Q_(s){oo(Yl.current);var c=oo(fi.current),h=ii(c,s.type);c!==h&&(Ot(Xl,s),Ot(fi,h))}function Em(s){Xl.current===s&&(jt(fi),jt(Xl))}var Dt=ma(0);function _d(s){for(var c=s;c!==null;){if(c.tag===13){var h=c.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||h.data==="$?"||h.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var Om=[];function Am(){for(var s=0;s<Om.length;s++)Om[s]._workInProgressVersionPrimary=null;Om.length=0}var Sd=C.ReactCurrentDispatcher,Tm=C.ReactCurrentBatchConfig,so=0,zt=null,tr=null,dr=null,kd=!1,Jl=!1,Zl=0,w3=0;function Or(){throw Error(r(321))}function Cm(s,c){if(c===null)return!1;for(var h=0;h<c.length&&h<s.length;h++)if(!$n(s[h],c[h]))return!1;return!0}function jm(s,c,h,m,w,S){if(so=S,zt=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,Sd.current=s===null||s.memoizedState===null?E3:O3,s=h(m,w),Jl){S=0;do{if(Jl=!1,Zl=0,25<=S)throw Error(r(301));S+=1,dr=tr=null,c.updateQueue=null,Sd.current=A3,s=h(m,w)}while(Jl)}if(Sd.current=Ad,c=tr!==null&&tr.next!==null,so=0,dr=tr=zt=null,kd=!1,c)throw Error(r(300));return s}function Pm(){var s=Zl!==0;return Zl=0,s}function hi(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dr===null?zt.memoizedState=dr=s:dr=dr.next=s,dr}function bn(){if(tr===null){var s=zt.alternate;s=s!==null?s.memoizedState:null}else s=tr.next;var c=dr===null?zt.memoizedState:dr.next;if(c!==null)dr=c,tr=s;else{if(s===null)throw Error(r(310));tr=s,s={memoizedState:tr.memoizedState,baseState:tr.baseState,baseQueue:tr.baseQueue,queue:tr.queue,next:null},dr===null?zt.memoizedState=dr=s:dr=dr.next=s}return dr}function Ql(s,c){return typeof c=="function"?c(s):c}function Nm(s){var c=bn(),h=c.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=s;var m=tr,w=m.baseQueue,S=h.pending;if(S!==null){if(w!==null){var j=w.next;w.next=S.next,S.next=j}m.baseQueue=w=S,h.pending=null}if(w!==null){S=w.next,m=m.baseState;var D=j=null,H=null,re=S;do{var ue=re.lane;if((so&ue)===ue)H!==null&&(H=H.next={lane:0,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),m=re.hasEagerState?re.eagerState:s(m,re.action);else{var fe={lane:ue,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null};H===null?(D=H=fe,j=m):H=H.next=fe,zt.lanes|=ue,lo|=ue}re=re.next}while(re!==null&&re!==S);H===null?j=m:H.next=D,$n(m,c.memoizedState)||(Wr=!0),c.memoizedState=m,c.baseState=j,c.baseQueue=H,h.lastRenderedState=m}if(s=h.interleaved,s!==null){w=s;do S=w.lane,zt.lanes|=S,lo|=S,w=w.next;while(w!==s)}else w===null&&(h.lanes=0);return[c.memoizedState,h.dispatch]}function Rm(s){var c=bn(),h=c.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=s;var m=h.dispatch,w=h.pending,S=c.memoizedState;if(w!==null){h.pending=null;var j=w=w.next;do S=s(S,j.action),j=j.next;while(j!==w);$n(S,c.memoizedState)||(Wr=!0),c.memoizedState=S,c.baseQueue===null&&(c.baseState=S),h.lastRenderedState=S}return[S,m]}function eS(){}function tS(s,c){var h=zt,m=bn(),w=c(),S=!$n(m.memoizedState,w);if(S&&(m.memoizedState=w,Wr=!0),m=m.queue,Im(iS.bind(null,h,m,s),[s]),m.getSnapshot!==c||S||dr!==null&&dr.memoizedState.tag&1){if(h.flags|=2048,ec(9,nS.bind(null,h,m,w,c),void 0,null),fr===null)throw Error(r(349));(so&30)!==0||rS(h,c,w)}return w}function rS(s,c,h){s.flags|=16384,s={getSnapshot:c,value:h},c=zt.updateQueue,c===null?(c={lastEffect:null,stores:null},zt.updateQueue=c,c.stores=[s]):(h=c.stores,h===null?c.stores=[s]:h.push(s))}function nS(s,c,h,m){c.value=h,c.getSnapshot=m,aS(c)&&oS(s)}function iS(s,c,h){return h(function(){aS(c)&&oS(s)})}function aS(s){var c=s.getSnapshot;s=s.value;try{var h=c();return!$n(s,h)}catch{return!0}}function oS(s){var c=Ni(s,1);c!==null&&Bn(c,s,1,-1)}function sS(s){var c=hi();return typeof s=="function"&&(s=s()),c.memoizedState=c.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ql,lastRenderedState:s},c.queue=s,s=s.dispatch=k3.bind(null,zt,s),[c.memoizedState,s]}function ec(s,c,h,m){return s={tag:s,create:c,destroy:h,deps:m,next:null},c=zt.updateQueue,c===null?(c={lastEffect:null,stores:null},zt.updateQueue=c,c.lastEffect=s.next=s):(h=c.lastEffect,h===null?c.lastEffect=s.next=s:(m=h.next,h.next=s,s.next=m,c.lastEffect=s)),s}function lS(){return bn().memoizedState}function Ed(s,c,h,m){var w=hi();zt.flags|=s,w.memoizedState=ec(1|c,h,void 0,m===void 0?null:m)}function Od(s,c,h,m){var w=bn();m=m===void 0?null:m;var S=void 0;if(tr!==null){var j=tr.memoizedState;if(S=j.destroy,m!==null&&Cm(m,j.deps)){w.memoizedState=ec(c,h,S,m);return}}zt.flags|=s,w.memoizedState=ec(1|c,h,S,m)}function cS(s,c){return Ed(8390656,8,s,c)}function Im(s,c){return Od(2048,8,s,c)}function uS(s,c){return Od(4,2,s,c)}function dS(s,c){return Od(4,4,s,c)}function fS(s,c){if(typeof c=="function")return s=s(),c(s),function(){c(null)};if(c!=null)return s=s(),c.current=s,function(){c.current=null}}function hS(s,c,h){return h=h!=null?h.concat([s]):null,Od(4,4,fS.bind(null,c,s),h)}function $m(){}function pS(s,c){var h=bn();c=c===void 0?null:c;var m=h.memoizedState;return m!==null&&c!==null&&Cm(c,m[1])?m[0]:(h.memoizedState=[s,c],s)}function mS(s,c){var h=bn();c=c===void 0?null:c;var m=h.memoizedState;return m!==null&&c!==null&&Cm(c,m[1])?m[0]:(s=s(),h.memoizedState=[s,c],s)}function gS(s,c,h){return(so&21)===0?(s.baseState&&(s.baseState=!1,Wr=!0),s.memoizedState=h):($n(h,c)||(h=Vu(),zt.lanes|=h,lo|=h,s.baseState=!0),c)}function _3(s,c){var h=st;st=h!==0&&4>h?h:4,s(!0);var m=Tm.transition;Tm.transition={};try{s(!1),c()}finally{st=h,Tm.transition=m}}function yS(){return bn().memoizedState}function S3(s,c,h){var m=Sa(s);if(h={lane:m,action:h,hasEagerState:!1,eagerState:null,next:null},vS(s))bS(c,h);else if(h=X_(s,c,h,m),h!==null){var w=zr();Bn(h,s,m,w),xS(h,c,m)}}function k3(s,c,h){var m=Sa(s),w={lane:m,action:h,hasEagerState:!1,eagerState:null,next:null};if(vS(s))bS(c,w);else{var S=s.alternate;if(s.lanes===0&&(S===null||S.lanes===0)&&(S=c.lastRenderedReducer,S!==null))try{var j=c.lastRenderedState,D=S(j,h);if(w.hasEagerState=!0,w.eagerState=D,$n(D,j)){var H=c.interleaved;H===null?(w.next=w,_m(c)):(w.next=H.next,H.next=w),c.interleaved=w;return}}catch{}finally{}h=X_(s,c,w,m),h!==null&&(w=zr(),Bn(h,s,m,w),xS(h,c,m))}}function vS(s){var c=s.alternate;return s===zt||c!==null&&c===zt}function bS(s,c){Jl=kd=!0;var h=s.pending;h===null?c.next=c:(c.next=h.next,h.next=c),s.pending=c}function xS(s,c,h){if((h&4194240)!==0){var m=c.lanes;m&=s.pendingLanes,h|=m,c.lanes=h,jl(s,h)}}var Ad={readContext:vn,useCallback:Or,useContext:Or,useEffect:Or,useImperativeHandle:Or,useInsertionEffect:Or,useLayoutEffect:Or,useMemo:Or,useReducer:Or,useRef:Or,useState:Or,useDebugValue:Or,useDeferredValue:Or,useTransition:Or,useMutableSource:Or,useSyncExternalStore:Or,useId:Or,unstable_isNewReconciler:!1},E3={readContext:vn,useCallback:function(s,c){return hi().memoizedState=[s,c===void 0?null:c],s},useContext:vn,useEffect:cS,useImperativeHandle:function(s,c,h){return h=h!=null?h.concat([s]):null,Ed(4194308,4,fS.bind(null,c,s),h)},useLayoutEffect:function(s,c){return Ed(4194308,4,s,c)},useInsertionEffect:function(s,c){return Ed(4,2,s,c)},useMemo:function(s,c){var h=hi();return c=c===void 0?null:c,s=s(),h.memoizedState=[s,c],s},useReducer:function(s,c,h){var m=hi();return c=h!==void 0?h(c):c,m.memoizedState=m.baseState=c,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:c},m.queue=s,s=s.dispatch=S3.bind(null,zt,s),[m.memoizedState,s]},useRef:function(s){var c=hi();return s={current:s},c.memoizedState=s},useState:sS,useDebugValue:$m,useDeferredValue:function(s){return hi().memoizedState=s},useTransition:function(){var s=sS(!1),c=s[0];return s=_3.bind(null,s[1]),hi().memoizedState=s,[c,s]},useMutableSource:function(){},useSyncExternalStore:function(s,c,h){var m=zt,w=hi();if(Nt){if(h===void 0)throw Error(r(407));h=h()}else{if(h=c(),fr===null)throw Error(r(349));(so&30)!==0||rS(m,c,h)}w.memoizedState=h;var S={value:h,getSnapshot:c};return w.queue=S,cS(iS.bind(null,m,S,s),[s]),m.flags|=2048,ec(9,nS.bind(null,m,S,h,c),void 0,null),h},useId:function(){var s=hi(),c=fr.identifierPrefix;if(Nt){var h=Pi,m=ji;h=(m&~(1<<32-Lt(m)-1)).toString(32)+h,c=":"+c+"R"+h,h=Zl++,0<h&&(c+="H"+h.toString(32)),c+=":"}else h=w3++,c=":"+c+"r"+h.toString(32)+":";return s.memoizedState=c},unstable_isNewReconciler:!1},O3={readContext:vn,useCallback:pS,useContext:vn,useEffect:Im,useImperativeHandle:hS,useInsertionEffect:uS,useLayoutEffect:dS,useMemo:mS,useReducer:Nm,useRef:lS,useState:function(){return Nm(Ql)},useDebugValue:$m,useDeferredValue:function(s){var c=bn();return gS(c,tr.memoizedState,s)},useTransition:function(){var s=Nm(Ql)[0],c=bn().memoizedState;return[s,c]},useMutableSource:eS,useSyncExternalStore:tS,useId:yS,unstable_isNewReconciler:!1},A3={readContext:vn,useCallback:pS,useContext:vn,useEffect:Im,useImperativeHandle:hS,useInsertionEffect:uS,useLayoutEffect:dS,useMemo:mS,useReducer:Rm,useRef:lS,useState:function(){return Rm(Ql)},useDebugValue:$m,useDeferredValue:function(s){var c=bn();return tr===null?c.memoizedState=s:gS(c,tr.memoizedState,s)},useTransition:function(){var s=Rm(Ql)[0],c=bn().memoizedState;return[s,c]},useMutableSource:eS,useSyncExternalStore:tS,useId:yS,unstable_isNewReconciler:!1};function Ln(s,c){if(s&&s.defaultProps){c=q({},c),s=s.defaultProps;for(var h in s)c[h]===void 0&&(c[h]=s[h]);return c}return c}function Mm(s,c,h,m){c=s.memoizedState,h=h(m,c),h=h==null?c:q({},c,h),s.memoizedState=h,s.lanes===0&&(s.updateQueue.baseState=h)}var Td={isMounted:function(s){return(s=s._reactInternals)?Ai(s)===s:!1},enqueueSetState:function(s,c,h){s=s._reactInternals;var m=zr(),w=Sa(s),S=Ri(m,w);S.payload=c,h!=null&&(S.callback=h),c=ba(s,S,w),c!==null&&(Bn(c,s,w,m),xd(c,s,w))},enqueueReplaceState:function(s,c,h){s=s._reactInternals;var m=zr(),w=Sa(s),S=Ri(m,w);S.tag=1,S.payload=c,h!=null&&(S.callback=h),c=ba(s,S,w),c!==null&&(Bn(c,s,w,m),xd(c,s,w))},enqueueForceUpdate:function(s,c){s=s._reactInternals;var h=zr(),m=Sa(s),w=Ri(h,m);w.tag=2,c!=null&&(w.callback=c),c=ba(s,w,m),c!==null&&(Bn(c,s,m,h),xd(c,s,m))}};function wS(s,c,h,m,w,S,j){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(m,S,j):c.prototype&&c.prototype.isPureReactComponent?!Bl(h,m)||!Bl(w,S):!0}function _S(s,c,h){var m=!1,w=ga,S=c.contextType;return typeof S=="object"&&S!==null?S=vn(S):(w=Hr(c)?ro:Er.current,m=c.contextTypes,S=(m=m!=null)?is(s,w):ga),c=new c(h,S),s.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Td,s.stateNode=c,c._reactInternals=s,m&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=w,s.__reactInternalMemoizedMaskedChildContext=S),c}function SS(s,c,h,m){s=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(h,m),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(h,m),c.state!==s&&Td.enqueueReplaceState(c,c.state,null)}function Lm(s,c,h,m){var w=s.stateNode;w.props=h,w.state=s.memoizedState,w.refs={},Sm(s);var S=c.contextType;typeof S=="object"&&S!==null?w.context=vn(S):(S=Hr(c)?ro:Er.current,w.context=is(s,S)),w.state=s.memoizedState,S=c.getDerivedStateFromProps,typeof S=="function"&&(Mm(s,c,S,h),w.state=s.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(c=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),c!==w.state&&Td.enqueueReplaceState(w,w.state,null),wd(s,h,w,m),w.state=s.memoizedState),typeof w.componentDidMount=="function"&&(s.flags|=4194308)}function fs(s,c){try{var h="",m=c;do h+=le(m),m=m.return;while(m);var w=h}catch(S){w=`
39
+ Error generating stack: `+S.message+`
40
+ `+S.stack}return{value:s,source:c,stack:w,digest:null}}function Dm(s,c,h){return{value:s,source:null,stack:h??null,digest:c??null}}function zm(s,c){try{console.error(c.value)}catch(h){setTimeout(function(){throw h})}}var T3=typeof WeakMap=="function"?WeakMap:Map;function kS(s,c,h){h=Ri(-1,h),h.tag=3,h.payload={element:null};var m=c.value;return h.callback=function(){$d||($d=!0,eg=m),zm(s,c)},h}function ES(s,c,h){h=Ri(-1,h),h.tag=3;var m=s.type.getDerivedStateFromError;if(typeof m=="function"){var w=c.value;h.payload=function(){return m(w)},h.callback=function(){zm(s,c)}}var S=s.stateNode;return S!==null&&typeof S.componentDidCatch=="function"&&(h.callback=function(){zm(s,c),typeof m!="function"&&(wa===null?wa=new Set([this]):wa.add(this));var j=c.stack;this.componentDidCatch(c.value,{componentStack:j!==null?j:""})}),h}function OS(s,c,h){var m=s.pingCache;if(m===null){m=s.pingCache=new T3;var w=new Set;m.set(c,w)}else w=m.get(c),w===void 0&&(w=new Set,m.set(c,w));w.has(h)||(w.add(h),s=q3.bind(null,s,c,h),c.then(s,s))}function AS(s){do{var c;if((c=s.tag===13)&&(c=s.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return s;s=s.return}while(s!==null);return null}function TS(s,c,h,m,w){return(s.mode&1)===0?(s===c?s.flags|=65536:(s.flags|=128,h.flags|=131072,h.flags&=-52805,h.tag===1&&(h.alternate===null?h.tag=17:(c=Ri(-1,1),c.tag=2,ba(h,c,1))),h.lanes|=1),s):(s.flags|=65536,s.lanes=w,s)}var C3=C.ReactCurrentOwner,Wr=!1;function Dr(s,c,h,m){c.child=s===null?V_(c,null,h,m):ls(c,s.child,h,m)}function CS(s,c,h,m,w){h=h.render;var S=c.ref;return us(c,w),m=jm(s,c,h,m,S,w),h=Pm(),s!==null&&!Wr?(c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~w,Ii(s,c,w)):(Nt&&h&&hm(c),c.flags|=1,Dr(s,c,m,w),c.child)}function jS(s,c,h,m,w){if(s===null){var S=h.type;return typeof S=="function"&&!sg(S)&&S.defaultProps===void 0&&h.compare===null&&h.defaultProps===void 0?(c.tag=15,c.type=S,PS(s,c,S,m,w)):(s=Ud(h.type,null,m,c,c.mode,w),s.ref=c.ref,s.return=c,c.child=s)}if(S=s.child,(s.lanes&w)===0){var j=S.memoizedProps;if(h=h.compare,h=h!==null?h:Bl,h(j,m)&&s.ref===c.ref)return Ii(s,c,w)}return c.flags|=1,s=Ea(S,m),s.ref=c.ref,s.return=c,c.child=s}function PS(s,c,h,m,w){if(s!==null){var S=s.memoizedProps;if(Bl(S,m)&&s.ref===c.ref)if(Wr=!1,c.pendingProps=m=S,(s.lanes&w)!==0)(s.flags&131072)!==0&&(Wr=!0);else return c.lanes=s.lanes,Ii(s,c,w)}return Bm(s,c,h,m,w)}function NS(s,c,h){var m=c.pendingProps,w=m.children,S=s!==null?s.memoizedState:null;if(m.mode==="hidden")if((c.mode&1)===0)c.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ot(ps,rn),rn|=h;else{if((h&1073741824)===0)return s=S!==null?S.baseLanes|h:h,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:s,cachePool:null,transitions:null},c.updateQueue=null,Ot(ps,rn),rn|=s,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},m=S!==null?S.baseLanes:h,Ot(ps,rn),rn|=m}else S!==null?(m=S.baseLanes|h,c.memoizedState=null):m=h,Ot(ps,rn),rn|=m;return Dr(s,c,w,h),c.child}function RS(s,c){var h=c.ref;(s===null&&h!==null||s!==null&&s.ref!==h)&&(c.flags|=512,c.flags|=2097152)}function Bm(s,c,h,m,w){var S=Hr(h)?ro:Er.current;return S=is(c,S),us(c,w),h=jm(s,c,h,m,S,w),m=Pm(),s!==null&&!Wr?(c.updateQueue=s.updateQueue,c.flags&=-2053,s.lanes&=~w,Ii(s,c,w)):(Nt&&m&&hm(c),c.flags|=1,Dr(s,c,h,w),c.child)}function IS(s,c,h,m,w){if(Hr(h)){var S=!0;fd(c)}else S=!1;if(us(c,w),c.stateNode===null)jd(s,c),_S(c,h,m),Lm(c,h,m,w),m=!0;else if(s===null){var j=c.stateNode,D=c.memoizedProps;j.props=D;var H=j.context,re=h.contextType;typeof re=="object"&&re!==null?re=vn(re):(re=Hr(h)?ro:Er.current,re=is(c,re));var ue=h.getDerivedStateFromProps,fe=typeof ue=="function"||typeof j.getSnapshotBeforeUpdate=="function";fe||typeof j.UNSAFE_componentWillReceiveProps!="function"&&typeof j.componentWillReceiveProps!="function"||(D!==m||H!==re)&&SS(c,j,m,re),va=!1;var ce=c.memoizedState;j.state=ce,wd(c,m,j,w),H=c.memoizedState,D!==m||ce!==H||Fr.current||va?(typeof ue=="function"&&(Mm(c,h,ue,m),H=c.memoizedState),(D=va||wS(c,h,D,m,ce,H,re))?(fe||typeof j.UNSAFE_componentWillMount!="function"&&typeof j.componentWillMount!="function"||(typeof j.componentWillMount=="function"&&j.componentWillMount(),typeof j.UNSAFE_componentWillMount=="function"&&j.UNSAFE_componentWillMount()),typeof j.componentDidMount=="function"&&(c.flags|=4194308)):(typeof j.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=m,c.memoizedState=H),j.props=m,j.state=H,j.context=re,m=D):(typeof j.componentDidMount=="function"&&(c.flags|=4194308),m=!1)}else{j=c.stateNode,Y_(s,c),D=c.memoizedProps,re=c.type===c.elementType?D:Ln(c.type,D),j.props=re,fe=c.pendingProps,ce=j.context,H=h.contextType,typeof H=="object"&&H!==null?H=vn(H):(H=Hr(h)?ro:Er.current,H=is(c,H));var _e=h.getDerivedStateFromProps;(ue=typeof _e=="function"||typeof j.getSnapshotBeforeUpdate=="function")||typeof j.UNSAFE_componentWillReceiveProps!="function"&&typeof j.componentWillReceiveProps!="function"||(D!==fe||ce!==H)&&SS(c,j,m,H),va=!1,ce=c.memoizedState,j.state=ce,wd(c,m,j,w);var je=c.memoizedState;D!==fe||ce!==je||Fr.current||va?(typeof _e=="function"&&(Mm(c,h,_e,m),je=c.memoizedState),(re=va||wS(c,h,re,m,ce,je,H)||!1)?(ue||typeof j.UNSAFE_componentWillUpdate!="function"&&typeof j.componentWillUpdate!="function"||(typeof j.componentWillUpdate=="function"&&j.componentWillUpdate(m,je,H),typeof j.UNSAFE_componentWillUpdate=="function"&&j.UNSAFE_componentWillUpdate(m,je,H)),typeof j.componentDidUpdate=="function"&&(c.flags|=4),typeof j.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof j.componentDidUpdate!="function"||D===s.memoizedProps&&ce===s.memoizedState||(c.flags|=4),typeof j.getSnapshotBeforeUpdate!="function"||D===s.memoizedProps&&ce===s.memoizedState||(c.flags|=1024),c.memoizedProps=m,c.memoizedState=je),j.props=m,j.state=je,j.context=H,m=re):(typeof j.componentDidUpdate!="function"||D===s.memoizedProps&&ce===s.memoizedState||(c.flags|=4),typeof j.getSnapshotBeforeUpdate!="function"||D===s.memoizedProps&&ce===s.memoizedState||(c.flags|=1024),m=!1)}return Um(s,c,h,m,S,w)}function Um(s,c,h,m,w,S){RS(s,c);var j=(c.flags&128)!==0;if(!m&&!j)return w&&z_(c,h,!1),Ii(s,c,S);m=c.stateNode,C3.current=c;var D=j&&typeof h.getDerivedStateFromError!="function"?null:m.render();return c.flags|=1,s!==null&&j?(c.child=ls(c,s.child,null,S),c.child=ls(c,null,D,S)):Dr(s,c,D,S),c.memoizedState=m.state,w&&z_(c,h,!0),c.child}function $S(s){var c=s.stateNode;c.pendingContext?L_(s,c.pendingContext,c.pendingContext!==c.context):c.context&&L_(s,c.context,!1),km(s,c.containerInfo)}function MS(s,c,h,m,w){return ss(),ym(w),c.flags|=256,Dr(s,c,h,m),c.child}var qm={dehydrated:null,treeContext:null,retryLane:0};function Fm(s){return{baseLanes:s,cachePool:null,transitions:null}}function LS(s,c,h){var m=c.pendingProps,w=Dt.current,S=!1,j=(c.flags&128)!==0,D;if((D=j)||(D=s!==null&&s.memoizedState===null?!1:(w&2)!==0),D?(S=!0,c.flags&=-129):(s===null||s.memoizedState!==null)&&(w|=1),Ot(Dt,w&1),s===null)return gm(c),s=c.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?((c.mode&1)===0?c.lanes=1:s.data==="$!"?c.lanes=8:c.lanes=1073741824,null):(j=m.children,s=m.fallback,S?(m=c.mode,S=c.child,j={mode:"hidden",children:j},(m&1)===0&&S!==null?(S.childLanes=0,S.pendingProps=j):S=qd(j,m,0,null),s=ho(s,m,h,null),S.return=c,s.return=c,S.sibling=s,c.child=S,c.child.memoizedState=Fm(h),c.memoizedState=qm,s):Hm(c,j));if(w=s.memoizedState,w!==null&&(D=w.dehydrated,D!==null))return j3(s,c,j,m,D,w,h);if(S){S=m.fallback,j=c.mode,w=s.child,D=w.sibling;var H={mode:"hidden",children:m.children};return(j&1)===0&&c.child!==w?(m=c.child,m.childLanes=0,m.pendingProps=H,c.deletions=null):(m=Ea(w,H),m.subtreeFlags=w.subtreeFlags&14680064),D!==null?S=Ea(D,S):(S=ho(S,j,h,null),S.flags|=2),S.return=c,m.return=c,m.sibling=S,c.child=m,m=S,S=c.child,j=s.child.memoizedState,j=j===null?Fm(h):{baseLanes:j.baseLanes|h,cachePool:null,transitions:j.transitions},S.memoizedState=j,S.childLanes=s.childLanes&~h,c.memoizedState=qm,m}return S=s.child,s=S.sibling,m=Ea(S,{mode:"visible",children:m.children}),(c.mode&1)===0&&(m.lanes=h),m.return=c,m.sibling=null,s!==null&&(h=c.deletions,h===null?(c.deletions=[s],c.flags|=16):h.push(s)),c.child=m,c.memoizedState=null,m}function Hm(s,c){return c=qd({mode:"visible",children:c},s.mode,0,null),c.return=s,s.child=c}function Cd(s,c,h,m){return m!==null&&ym(m),ls(c,s.child,null,h),s=Hm(c,c.pendingProps.children),s.flags|=2,c.memoizedState=null,s}function j3(s,c,h,m,w,S,j){if(h)return c.flags&256?(c.flags&=-257,m=Dm(Error(r(422))),Cd(s,c,j,m)):c.memoizedState!==null?(c.child=s.child,c.flags|=128,null):(S=m.fallback,w=c.mode,m=qd({mode:"visible",children:m.children},w,0,null),S=ho(S,w,j,null),S.flags|=2,m.return=c,S.return=c,m.sibling=S,c.child=m,(c.mode&1)!==0&&ls(c,s.child,null,j),c.child.memoizedState=Fm(j),c.memoizedState=qm,S);if((c.mode&1)===0)return Cd(s,c,j,null);if(w.data==="$!"){if(m=w.nextSibling&&w.nextSibling.dataset,m)var D=m.dgst;return m=D,S=Error(r(419)),m=Dm(S,m,void 0),Cd(s,c,j,m)}if(D=(j&s.childLanes)!==0,Wr||D){if(m=fr,m!==null){switch(j&-j){case 4:w=2;break;case 16:w=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:w=32;break;case 536870912:w=268435456;break;default:w=0}w=(w&(m.suspendedLanes|j))!==0?0:w,w!==0&&w!==S.retryLane&&(S.retryLane=w,Ni(s,w),Bn(m,s,w,-1))}return og(),m=Dm(Error(r(421))),Cd(s,c,j,m)}return w.data==="$?"?(c.flags|=128,c.child=s.child,c=F3.bind(null,s),w._reactRetry=c,null):(s=S.treeContext,tn=pa(w.nextSibling),en=c,Nt=!0,Mn=null,s!==null&&(gn[yn++]=ji,gn[yn++]=Pi,gn[yn++]=no,ji=s.id,Pi=s.overflow,no=c),c=Hm(c,m.children),c.flags|=4096,c)}function DS(s,c,h){s.lanes|=c;var m=s.alternate;m!==null&&(m.lanes|=c),wm(s.return,c,h)}function Wm(s,c,h,m,w){var S=s.memoizedState;S===null?s.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:m,tail:h,tailMode:w}:(S.isBackwards=c,S.rendering=null,S.renderingStartTime=0,S.last=m,S.tail=h,S.tailMode=w)}function zS(s,c,h){var m=c.pendingProps,w=m.revealOrder,S=m.tail;if(Dr(s,c,m.children,h),m=Dt.current,(m&2)!==0)m=m&1|2,c.flags|=128;else{if(s!==null&&(s.flags&128)!==0)e:for(s=c.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&DS(s,h,c);else if(s.tag===19)DS(s,h,c);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===c)break e;for(;s.sibling===null;){if(s.return===null||s.return===c)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}m&=1}if(Ot(Dt,m),(c.mode&1)===0)c.memoizedState=null;else switch(w){case"forwards":for(h=c.child,w=null;h!==null;)s=h.alternate,s!==null&&_d(s)===null&&(w=h),h=h.sibling;h=w,h===null?(w=c.child,c.child=null):(w=h.sibling,h.sibling=null),Wm(c,!1,w,h,S);break;case"backwards":for(h=null,w=c.child,c.child=null;w!==null;){if(s=w.alternate,s!==null&&_d(s)===null){c.child=w;break}s=w.sibling,w.sibling=h,h=w,w=s}Wm(c,!0,h,null,S);break;case"together":Wm(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function jd(s,c){(c.mode&1)===0&&s!==null&&(s.alternate=null,c.alternate=null,c.flags|=2)}function Ii(s,c,h){if(s!==null&&(c.dependencies=s.dependencies),lo|=c.lanes,(h&c.childLanes)===0)return null;if(s!==null&&c.child!==s.child)throw Error(r(153));if(c.child!==null){for(s=c.child,h=Ea(s,s.pendingProps),c.child=h,h.return=c;s.sibling!==null;)s=s.sibling,h=h.sibling=Ea(s,s.pendingProps),h.return=c;h.sibling=null}return c.child}function P3(s,c,h){switch(c.tag){case 3:$S(c),ss();break;case 5:Q_(c);break;case 1:Hr(c.type)&&fd(c);break;case 4:km(c,c.stateNode.containerInfo);break;case 10:var m=c.type._context,w=c.memoizedProps.value;Ot(vd,m._currentValue),m._currentValue=w;break;case 13:if(m=c.memoizedState,m!==null)return m.dehydrated!==null?(Ot(Dt,Dt.current&1),c.flags|=128,null):(h&c.child.childLanes)!==0?LS(s,c,h):(Ot(Dt,Dt.current&1),s=Ii(s,c,h),s!==null?s.sibling:null);Ot(Dt,Dt.current&1);break;case 19:if(m=(h&c.childLanes)!==0,(s.flags&128)!==0){if(m)return zS(s,c,h);c.flags|=128}if(w=c.memoizedState,w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),Ot(Dt,Dt.current),m)break;return null;case 22:case 23:return c.lanes=0,NS(s,c,h)}return Ii(s,c,h)}var BS,Gm,US,qS;BS=function(s,c){for(var h=c.child;h!==null;){if(h.tag===5||h.tag===6)s.appendChild(h.stateNode);else if(h.tag!==4&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===c)break;for(;h.sibling===null;){if(h.return===null||h.return===c)return;h=h.return}h.sibling.return=h.return,h=h.sibling}},Gm=function(){},US=function(s,c,h,m){var w=s.memoizedProps;if(w!==m){s=c.stateNode,oo(fi.current);var S=null;switch(h){case"input":w=Fe(s,w),m=Fe(s,m),S=[];break;case"select":w=q({},w,{value:void 0}),m=q({},m,{value:void 0}),S=[];break;case"textarea":w=_t(s,w),m=_t(s,m),S=[];break;default:typeof w.onClick!="function"&&typeof m.onClick=="function"&&(s.onclick=cd)}oa(h,m);var j;h=null;for(re in w)if(!m.hasOwnProperty(re)&&w.hasOwnProperty(re)&&w[re]!=null)if(re==="style"){var D=w[re];for(j in D)D.hasOwnProperty(j)&&(h||(h={}),h[j]="")}else re!=="dangerouslySetInnerHTML"&&re!=="children"&&re!=="suppressContentEditableWarning"&&re!=="suppressHydrationWarning"&&re!=="autoFocus"&&(i.hasOwnProperty(re)?S||(S=[]):(S=S||[]).push(re,null));for(re in m){var H=m[re];if(D=w!=null?w[re]:void 0,m.hasOwnProperty(re)&&H!==D&&(H!=null||D!=null))if(re==="style")if(D){for(j in D)!D.hasOwnProperty(j)||H&&H.hasOwnProperty(j)||(h||(h={}),h[j]="");for(j in H)H.hasOwnProperty(j)&&D[j]!==H[j]&&(h||(h={}),h[j]=H[j])}else h||(S||(S=[]),S.push(re,h)),h=H;else re==="dangerouslySetInnerHTML"?(H=H?H.__html:void 0,D=D?D.__html:void 0,H!=null&&D!==H&&(S=S||[]).push(re,H)):re==="children"?typeof H!="string"&&typeof H!="number"||(S=S||[]).push(re,""+H):re!=="suppressContentEditableWarning"&&re!=="suppressHydrationWarning"&&(i.hasOwnProperty(re)?(H!=null&&re==="onScroll"&&Ct("scroll",s),S||D===H||(S=[])):(S=S||[]).push(re,H))}h&&(S=S||[]).push("style",h);var re=S;(c.updateQueue=re)&&(c.flags|=4)}},qS=function(s,c,h,m){h!==m&&(c.flags|=4)};function tc(s,c){if(!Nt)switch(s.tailMode){case"hidden":c=s.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?s.tail=null:h.sibling=null;break;case"collapsed":h=s.tail;for(var m=null;h!==null;)h.alternate!==null&&(m=h),h=h.sibling;m===null?c||s.tail===null?s.tail=null:s.tail.sibling=null:m.sibling=null}}function Ar(s){var c=s.alternate!==null&&s.alternate.child===s.child,h=0,m=0;if(c)for(var w=s.child;w!==null;)h|=w.lanes|w.childLanes,m|=w.subtreeFlags&14680064,m|=w.flags&14680064,w.return=s,w=w.sibling;else for(w=s.child;w!==null;)h|=w.lanes|w.childLanes,m|=w.subtreeFlags,m|=w.flags,w.return=s,w=w.sibling;return s.subtreeFlags|=m,s.childLanes=h,c}function N3(s,c,h){var m=c.pendingProps;switch(pm(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ar(c),null;case 1:return Hr(c.type)&&dd(),Ar(c),null;case 3:return m=c.stateNode,ds(),jt(Fr),jt(Er),Am(),m.pendingContext&&(m.context=m.pendingContext,m.pendingContext=null),(s===null||s.child===null)&&(gd(c)?c.flags|=4:s===null||s.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,Mn!==null&&(ng(Mn),Mn=null))),Gm(s,c),Ar(c),null;case 5:Em(c);var w=oo(Yl.current);if(h=c.type,s!==null&&c.stateNode!=null)US(s,c,h,m,w),s.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!m){if(c.stateNode===null)throw Error(r(166));return Ar(c),null}if(s=oo(fi.current),gd(c)){m=c.stateNode,h=c.type;var S=c.memoizedProps;switch(m[di]=c,m[Wl]=S,s=(c.mode&1)!==0,h){case"dialog":Ct("cancel",m),Ct("close",m);break;case"iframe":case"object":case"embed":Ct("load",m);break;case"video":case"audio":for(w=0;w<ql.length;w++)Ct(ql[w],m);break;case"source":Ct("error",m);break;case"img":case"image":case"link":Ct("error",m),Ct("load",m);break;case"details":Ct("toggle",m);break;case"input":kt(m,S),Ct("invalid",m);break;case"select":m._wrapperState={wasMultiple:!!S.multiple},Ct("invalid",m);break;case"textarea":kr(m,S),Ct("invalid",m)}oa(h,S),w=null;for(var j in S)if(S.hasOwnProperty(j)){var D=S[j];j==="children"?typeof D=="string"?m.textContent!==D&&(S.suppressHydrationWarning!==!0&&ld(m.textContent,D,s),w=["children",D]):typeof D=="number"&&m.textContent!==""+D&&(S.suppressHydrationWarning!==!0&&ld(m.textContent,D,s),w=["children",""+D]):i.hasOwnProperty(j)&&D!=null&&j==="onScroll"&&Ct("scroll",m)}switch(h){case"input":Me(m),Sr(m,S,!0);break;case"textarea":Me(m),ni(m);break;case"select":case"option":break;default:typeof S.onClick=="function"&&(m.onclick=cd)}m=w,c.updateQueue=m,m!==null&&(c.flags|=4)}else{j=w.nodeType===9?w:w.ownerDocument,s==="http://www.w3.org/1999/xhtml"&&(s=Ur(h)),s==="http://www.w3.org/1999/xhtml"?h==="script"?(s=j.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild)):typeof m.is=="string"?s=j.createElement(h,{is:m.is}):(s=j.createElement(h),h==="select"&&(j=s,m.multiple?j.multiple=!0:m.size&&(j.size=m.size))):s=j.createElementNS(s,h),s[di]=c,s[Wl]=m,BS(s,c,!1,!1),c.stateNode=s;e:{switch(j=Va(h,m),h){case"dialog":Ct("cancel",s),Ct("close",s),w=m;break;case"iframe":case"object":case"embed":Ct("load",s),w=m;break;case"video":case"audio":for(w=0;w<ql.length;w++)Ct(ql[w],s);w=m;break;case"source":Ct("error",s),w=m;break;case"img":case"image":case"link":Ct("error",s),Ct("load",s),w=m;break;case"details":Ct("toggle",s),w=m;break;case"input":kt(s,m),w=Fe(s,m),Ct("invalid",s);break;case"option":w=m;break;case"select":s._wrapperState={wasMultiple:!!m.multiple},w=q({},m,{value:void 0}),Ct("invalid",s);break;case"textarea":kr(s,m),w=_t(s,m),Ct("invalid",s);break;default:w=m}oa(h,w),D=w;for(S in D)if(D.hasOwnProperty(S)){var H=D[S];S==="style"?Ka(s,H):S==="dangerouslySetInnerHTML"?(H=H?H.__html:void 0,H!=null&&aa(s,H)):S==="children"?typeof H=="string"?(h!=="textarea"||H!=="")&&qr(s,H):typeof H=="number"&&qr(s,""+H):S!=="suppressContentEditableWarning"&&S!=="suppressHydrationWarning"&&S!=="autoFocus"&&(i.hasOwnProperty(S)?H!=null&&S==="onScroll"&&Ct("scroll",s):H!=null&&O(s,S,H,j))}switch(h){case"input":Me(s),Sr(s,m,!1);break;case"textarea":Me(s),ni(s);break;case"option":m.value!=null&&s.setAttribute("value",""+xe(m.value));break;case"select":s.multiple=!!m.multiple,S=m.value,S!=null?lr(s,!!m.multiple,S,!1):m.defaultValue!=null&&lr(s,!!m.multiple,m.defaultValue,!0);break;default:typeof w.onClick=="function"&&(s.onclick=cd)}switch(h){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}}m&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return Ar(c),null;case 6:if(s&&c.stateNode!=null)qS(s,c,s.memoizedProps,m);else{if(typeof m!="string"&&c.stateNode===null)throw Error(r(166));if(h=oo(Yl.current),oo(fi.current),gd(c)){if(m=c.stateNode,h=c.memoizedProps,m[di]=c,(S=m.nodeValue!==h)&&(s=en,s!==null))switch(s.tag){case 3:ld(m.nodeValue,h,(s.mode&1)!==0);break;case 5:s.memoizedProps.suppressHydrationWarning!==!0&&ld(m.nodeValue,h,(s.mode&1)!==0)}S&&(c.flags|=4)}else m=(h.nodeType===9?h:h.ownerDocument).createTextNode(m),m[di]=c,c.stateNode=m}return Ar(c),null;case 13:if(jt(Dt),m=c.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(Nt&&tn!==null&&(c.mode&1)!==0&&(c.flags&128)===0)W_(),ss(),c.flags|=98560,S=!1;else if(S=gd(c),m!==null&&m.dehydrated!==null){if(s===null){if(!S)throw Error(r(318));if(S=c.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(r(317));S[di]=c}else ss(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Ar(c),S=!1}else Mn!==null&&(ng(Mn),Mn=null),S=!0;if(!S)return c.flags&65536?c:null}return(c.flags&128)!==0?(c.lanes=h,c):(m=m!==null,m!==(s!==null&&s.memoizedState!==null)&&m&&(c.child.flags|=8192,(c.mode&1)!==0&&(s===null||(Dt.current&1)!==0?rr===0&&(rr=3):og())),c.updateQueue!==null&&(c.flags|=4),Ar(c),null);case 4:return ds(),Gm(s,c),s===null&&Fl(c.stateNode.containerInfo),Ar(c),null;case 10:return xm(c.type._context),Ar(c),null;case 17:return Hr(c.type)&&dd(),Ar(c),null;case 19:if(jt(Dt),S=c.memoizedState,S===null)return Ar(c),null;if(m=(c.flags&128)!==0,j=S.rendering,j===null)if(m)tc(S,!1);else{if(rr!==0||s!==null&&(s.flags&128)!==0)for(s=c.child;s!==null;){if(j=_d(s),j!==null){for(c.flags|=128,tc(S,!1),m=j.updateQueue,m!==null&&(c.updateQueue=m,c.flags|=4),c.subtreeFlags=0,m=h,h=c.child;h!==null;)S=h,s=m,S.flags&=14680066,j=S.alternate,j===null?(S.childLanes=0,S.lanes=s,S.child=null,S.subtreeFlags=0,S.memoizedProps=null,S.memoizedState=null,S.updateQueue=null,S.dependencies=null,S.stateNode=null):(S.childLanes=j.childLanes,S.lanes=j.lanes,S.child=j.child,S.subtreeFlags=0,S.deletions=null,S.memoizedProps=j.memoizedProps,S.memoizedState=j.memoizedState,S.updateQueue=j.updateQueue,S.type=j.type,s=j.dependencies,S.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),h=h.sibling;return Ot(Dt,Dt.current&1|2),c.child}s=s.sibling}S.tail!==null&&Mt()>ms&&(c.flags|=128,m=!0,tc(S,!1),c.lanes=4194304)}else{if(!m)if(s=_d(j),s!==null){if(c.flags|=128,m=!0,h=s.updateQueue,h!==null&&(c.updateQueue=h,c.flags|=4),tc(S,!0),S.tail===null&&S.tailMode==="hidden"&&!j.alternate&&!Nt)return Ar(c),null}else 2*Mt()-S.renderingStartTime>ms&&h!==1073741824&&(c.flags|=128,m=!0,tc(S,!1),c.lanes=4194304);S.isBackwards?(j.sibling=c.child,c.child=j):(h=S.last,h!==null?h.sibling=j:c.child=j,S.last=j)}return S.tail!==null?(c=S.tail,S.rendering=c,S.tail=c.sibling,S.renderingStartTime=Mt(),c.sibling=null,h=Dt.current,Ot(Dt,m?h&1|2:h&1),c):(Ar(c),null);case 22:case 23:return ag(),m=c.memoizedState!==null,s!==null&&s.memoizedState!==null!==m&&(c.flags|=8192),m&&(c.mode&1)!==0?(rn&1073741824)!==0&&(Ar(c),c.subtreeFlags&6&&(c.flags|=8192)):Ar(c),null;case 24:return null;case 25:return null}throw Error(r(156,c.tag))}function R3(s,c){switch(pm(c),c.tag){case 1:return Hr(c.type)&&dd(),s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 3:return ds(),jt(Fr),jt(Er),Am(),s=c.flags,(s&65536)!==0&&(s&128)===0?(c.flags=s&-65537|128,c):null;case 5:return Em(c),null;case 13:if(jt(Dt),s=c.memoizedState,s!==null&&s.dehydrated!==null){if(c.alternate===null)throw Error(r(340));ss()}return s=c.flags,s&65536?(c.flags=s&-65537|128,c):null;case 19:return jt(Dt),null;case 4:return ds(),null;case 10:return xm(c.type._context),null;case 22:case 23:return ag(),null;case 24:return null;default:return null}}var Pd=!1,Tr=!1,I3=typeof WeakSet=="function"?WeakSet:Set,Oe=null;function hs(s,c){var h=s.ref;if(h!==null)if(typeof h=="function")try{h(null)}catch(m){qt(s,c,m)}else h.current=null}function Km(s,c,h){try{h()}catch(m){qt(s,c,m)}}var FS=!1;function $3(s,c){if(am=Ju,s=w_(),Jp(s)){if("selectionStart"in s)var h={start:s.selectionStart,end:s.selectionEnd};else e:{h=(h=s.ownerDocument)&&h.defaultView||window;var m=h.getSelection&&h.getSelection();if(m&&m.rangeCount!==0){h=m.anchorNode;var w=m.anchorOffset,S=m.focusNode;m=m.focusOffset;try{h.nodeType,S.nodeType}catch{h=null;break e}var j=0,D=-1,H=-1,re=0,ue=0,fe=s,ce=null;t:for(;;){for(var _e;fe!==h||w!==0&&fe.nodeType!==3||(D=j+w),fe!==S||m!==0&&fe.nodeType!==3||(H=j+m),fe.nodeType===3&&(j+=fe.nodeValue.length),(_e=fe.firstChild)!==null;)ce=fe,fe=_e;for(;;){if(fe===s)break t;if(ce===h&&++re===w&&(D=j),ce===S&&++ue===m&&(H=j),(_e=fe.nextSibling)!==null)break;fe=ce,ce=fe.parentNode}fe=_e}h=D===-1||H===-1?null:{start:D,end:H}}else h=null}h=h||{start:0,end:0}}else h=null;for(om={focusedElem:s,selectionRange:h},Ju=!1,Oe=c;Oe!==null;)if(c=Oe,s=c.child,(c.subtreeFlags&1028)!==0&&s!==null)s.return=c,Oe=s;else for(;Oe!==null;){c=Oe;try{var je=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(je!==null){var Ne=je.memoizedProps,Kt=je.memoizedState,Q=c.stateNode,V=Q.getSnapshotBeforeUpdate(c.elementType===c.type?Ne:Ln(c.type,Ne),Kt);Q.__reactInternalSnapshotBeforeUpdate=V}break;case 3:var ee=c.stateNode.containerInfo;ee.nodeType===1?ee.textContent="":ee.nodeType===9&&ee.documentElement&&ee.removeChild(ee.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(pe){qt(c,c.return,pe)}if(s=c.sibling,s!==null){s.return=c.return,Oe=s;break}Oe=c.return}return je=FS,FS=!1,je}function rc(s,c,h){var m=c.updateQueue;if(m=m!==null?m.lastEffect:null,m!==null){var w=m=m.next;do{if((w.tag&s)===s){var S=w.destroy;w.destroy=void 0,S!==void 0&&Km(c,h,S)}w=w.next}while(w!==m)}}function Nd(s,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var h=c=c.next;do{if((h.tag&s)===s){var m=h.create;h.destroy=m()}h=h.next}while(h!==c)}}function Vm(s){var c=s.ref;if(c!==null){var h=s.stateNode;switch(s.tag){case 5:s=h;break;default:s=h}typeof c=="function"?c(s):c.current=s}}function HS(s){var c=s.alternate;c!==null&&(s.alternate=null,HS(c)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(c=s.stateNode,c!==null&&(delete c[di],delete c[Wl],delete c[um],delete c[y3],delete c[v3])),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function WS(s){return s.tag===5||s.tag===3||s.tag===4}function GS(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||WS(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Xm(s,c,h){var m=s.tag;if(m===5||m===6)s=s.stateNode,c?h.nodeType===8?h.parentNode.insertBefore(s,c):h.insertBefore(s,c):(h.nodeType===8?(c=h.parentNode,c.insertBefore(s,h)):(c=h,c.appendChild(s)),h=h._reactRootContainer,h!=null||c.onclick!==null||(c.onclick=cd));else if(m!==4&&(s=s.child,s!==null))for(Xm(s,c,h),s=s.sibling;s!==null;)Xm(s,c,h),s=s.sibling}function Ym(s,c,h){var m=s.tag;if(m===5||m===6)s=s.stateNode,c?h.insertBefore(s,c):h.appendChild(s);else if(m!==4&&(s=s.child,s!==null))for(Ym(s,c,h),s=s.sibling;s!==null;)Ym(s,c,h),s=s.sibling}var yr=null,Dn=!1;function xa(s,c,h){for(h=h.child;h!==null;)KS(s,c,h),h=h.sibling}function KS(s,c,h){if(Ze&&typeof Ze.onCommitFiberUnmount=="function")try{Ze.onCommitFiberUnmount(Ve,h)}catch{}switch(h.tag){case 5:Tr||hs(h,c);case 6:var m=yr,w=Dn;yr=null,xa(s,c,h),yr=m,Dn=w,yr!==null&&(Dn?(s=yr,h=h.stateNode,s.nodeType===8?s.parentNode.removeChild(h):s.removeChild(h)):yr.removeChild(h.stateNode));break;case 18:yr!==null&&(Dn?(s=yr,h=h.stateNode,s.nodeType===8?cm(s.parentNode,h):s.nodeType===1&&cm(s,h),Il(s)):cm(yr,h.stateNode));break;case 4:m=yr,w=Dn,yr=h.stateNode.containerInfo,Dn=!0,xa(s,c,h),yr=m,Dn=w;break;case 0:case 11:case 14:case 15:if(!Tr&&(m=h.updateQueue,m!==null&&(m=m.lastEffect,m!==null))){w=m=m.next;do{var S=w,j=S.destroy;S=S.tag,j!==void 0&&((S&2)!==0||(S&4)!==0)&&Km(h,c,j),w=w.next}while(w!==m)}xa(s,c,h);break;case 1:if(!Tr&&(hs(h,c),m=h.stateNode,typeof m.componentWillUnmount=="function"))try{m.props=h.memoizedProps,m.state=h.memoizedState,m.componentWillUnmount()}catch(D){qt(h,c,D)}xa(s,c,h);break;case 21:xa(s,c,h);break;case 22:h.mode&1?(Tr=(m=Tr)||h.memoizedState!==null,xa(s,c,h),Tr=m):xa(s,c,h);break;default:xa(s,c,h)}}function VS(s){var c=s.updateQueue;if(c!==null){s.updateQueue=null;var h=s.stateNode;h===null&&(h=s.stateNode=new I3),c.forEach(function(m){var w=H3.bind(null,s,m);h.has(m)||(h.add(m),m.then(w,w))})}}function zn(s,c){var h=c.deletions;if(h!==null)for(var m=0;m<h.length;m++){var w=h[m];try{var S=s,j=c,D=j;e:for(;D!==null;){switch(D.tag){case 5:yr=D.stateNode,Dn=!1;break e;case 3:yr=D.stateNode.containerInfo,Dn=!0;break e;case 4:yr=D.stateNode.containerInfo,Dn=!0;break e}D=D.return}if(yr===null)throw Error(r(160));KS(S,j,w),yr=null,Dn=!1;var H=w.alternate;H!==null&&(H.return=null),w.return=null}catch(re){qt(w,c,re)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)XS(c,s),c=c.sibling}function XS(s,c){var h=s.alternate,m=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(zn(c,s),pi(s),m&4){try{rc(3,s,s.return),Nd(3,s)}catch(Ne){qt(s,s.return,Ne)}try{rc(5,s,s.return)}catch(Ne){qt(s,s.return,Ne)}}break;case 1:zn(c,s),pi(s),m&512&&h!==null&&hs(h,h.return);break;case 5:if(zn(c,s),pi(s),m&512&&h!==null&&hs(h,h.return),s.flags&32){var w=s.stateNode;try{qr(w,"")}catch(Ne){qt(s,s.return,Ne)}}if(m&4&&(w=s.stateNode,w!=null)){var S=s.memoizedProps,j=h!==null?h.memoizedProps:S,D=s.type,H=s.updateQueue;if(s.updateQueue=null,H!==null)try{D==="input"&&S.type==="radio"&&S.name!=null&&wt(w,S),Va(D,j);var re=Va(D,S);for(j=0;j<H.length;j+=2){var ue=H[j],fe=H[j+1];ue==="style"?Ka(w,fe):ue==="dangerouslySetInnerHTML"?aa(w,fe):ue==="children"?qr(w,fe):O(w,ue,fe,re)}switch(D){case"input":Et(w,S);break;case"textarea":Ir(w,S);break;case"select":var ce=w._wrapperState.wasMultiple;w._wrapperState.wasMultiple=!!S.multiple;var _e=S.value;_e!=null?lr(w,!!S.multiple,_e,!1):ce!==!!S.multiple&&(S.defaultValue!=null?lr(w,!!S.multiple,S.defaultValue,!0):lr(w,!!S.multiple,S.multiple?[]:"",!1))}w[Wl]=S}catch(Ne){qt(s,s.return,Ne)}}break;case 6:if(zn(c,s),pi(s),m&4){if(s.stateNode===null)throw Error(r(162));w=s.stateNode,S=s.memoizedProps;try{w.nodeValue=S}catch(Ne){qt(s,s.return,Ne)}}break;case 3:if(zn(c,s),pi(s),m&4&&h!==null&&h.memoizedState.isDehydrated)try{Il(c.containerInfo)}catch(Ne){qt(s,s.return,Ne)}break;case 4:zn(c,s),pi(s);break;case 13:zn(c,s),pi(s),w=s.child,w.flags&8192&&(S=w.memoizedState!==null,w.stateNode.isHidden=S,!S||w.alternate!==null&&w.alternate.memoizedState!==null||(Qm=Mt())),m&4&&VS(s);break;case 22:if(ue=h!==null&&h.memoizedState!==null,s.mode&1?(Tr=(re=Tr)||ue,zn(c,s),Tr=re):zn(c,s),pi(s),m&8192){if(re=s.memoizedState!==null,(s.stateNode.isHidden=re)&&!ue&&(s.mode&1)!==0)for(Oe=s,ue=s.child;ue!==null;){for(fe=Oe=ue;Oe!==null;){switch(ce=Oe,_e=ce.child,ce.tag){case 0:case 11:case 14:case 15:rc(4,ce,ce.return);break;case 1:hs(ce,ce.return);var je=ce.stateNode;if(typeof je.componentWillUnmount=="function"){m=ce,h=ce.return;try{c=m,je.props=c.memoizedProps,je.state=c.memoizedState,je.componentWillUnmount()}catch(Ne){qt(m,h,Ne)}}break;case 5:hs(ce,ce.return);break;case 22:if(ce.memoizedState!==null){ZS(fe);continue}}_e!==null?(_e.return=ce,Oe=_e):ZS(fe)}ue=ue.sibling}e:for(ue=null,fe=s;;){if(fe.tag===5){if(ue===null){ue=fe;try{w=fe.stateNode,re?(S=w.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none"):(D=fe.stateNode,H=fe.memoizedProps.style,j=H!=null&&H.hasOwnProperty("display")?H.display:null,D.style.display=Ho("display",j))}catch(Ne){qt(s,s.return,Ne)}}}else if(fe.tag===6){if(ue===null)try{fe.stateNode.nodeValue=re?"":fe.memoizedProps}catch(Ne){qt(s,s.return,Ne)}}else if((fe.tag!==22&&fe.tag!==23||fe.memoizedState===null||fe===s)&&fe.child!==null){fe.child.return=fe,fe=fe.child;continue}if(fe===s)break e;for(;fe.sibling===null;){if(fe.return===null||fe.return===s)break e;ue===fe&&(ue=null),fe=fe.return}ue===fe&&(ue=null),fe.sibling.return=fe.return,fe=fe.sibling}}break;case 19:zn(c,s),pi(s),m&4&&VS(s);break;case 21:break;default:zn(c,s),pi(s)}}function pi(s){var c=s.flags;if(c&2){try{e:{for(var h=s.return;h!==null;){if(WS(h)){var m=h;break e}h=h.return}throw Error(r(160))}switch(m.tag){case 5:var w=m.stateNode;m.flags&32&&(qr(w,""),m.flags&=-33);var S=GS(s);Ym(s,S,w);break;case 3:case 4:var j=m.stateNode.containerInfo,D=GS(s);Xm(s,D,j);break;default:throw Error(r(161))}}catch(H){qt(s,s.return,H)}s.flags&=-3}c&4096&&(s.flags&=-4097)}function M3(s,c,h){Oe=s,YS(s)}function YS(s,c,h){for(var m=(s.mode&1)!==0;Oe!==null;){var w=Oe,S=w.child;if(w.tag===22&&m){var j=w.memoizedState!==null||Pd;if(!j){var D=w.alternate,H=D!==null&&D.memoizedState!==null||Tr;D=Pd;var re=Tr;if(Pd=j,(Tr=H)&&!re)for(Oe=w;Oe!==null;)j=Oe,H=j.child,j.tag===22&&j.memoizedState!==null?QS(w):H!==null?(H.return=j,Oe=H):QS(w);for(;S!==null;)Oe=S,YS(S),S=S.sibling;Oe=w,Pd=D,Tr=re}JS(s)}else(w.subtreeFlags&8772)!==0&&S!==null?(S.return=w,Oe=S):JS(s)}}function JS(s){for(;Oe!==null;){var c=Oe;if((c.flags&8772)!==0){var h=c.alternate;try{if((c.flags&8772)!==0)switch(c.tag){case 0:case 11:case 15:Tr||Nd(5,c);break;case 1:var m=c.stateNode;if(c.flags&4&&!Tr)if(h===null)m.componentDidMount();else{var w=c.elementType===c.type?h.memoizedProps:Ln(c.type,h.memoizedProps);m.componentDidUpdate(w,h.memoizedState,m.__reactInternalSnapshotBeforeUpdate)}var S=c.updateQueue;S!==null&&Z_(c,S,m);break;case 3:var j=c.updateQueue;if(j!==null){if(h=null,c.child!==null)switch(c.child.tag){case 5:h=c.child.stateNode;break;case 1:h=c.child.stateNode}Z_(c,j,h)}break;case 5:var D=c.stateNode;if(h===null&&c.flags&4){h=D;var H=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":H.autoFocus&&h.focus();break;case"img":H.src&&(h.src=H.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var re=c.alternate;if(re!==null){var ue=re.memoizedState;if(ue!==null){var fe=ue.dehydrated;fe!==null&&Il(fe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}Tr||c.flags&512&&Vm(c)}catch(ce){qt(c,c.return,ce)}}if(c===s){Oe=null;break}if(h=c.sibling,h!==null){h.return=c.return,Oe=h;break}Oe=c.return}}function ZS(s){for(;Oe!==null;){var c=Oe;if(c===s){Oe=null;break}var h=c.sibling;if(h!==null){h.return=c.return,Oe=h;break}Oe=c.return}}function QS(s){for(;Oe!==null;){var c=Oe;try{switch(c.tag){case 0:case 11:case 15:var h=c.return;try{Nd(4,c)}catch(H){qt(c,h,H)}break;case 1:var m=c.stateNode;if(typeof m.componentDidMount=="function"){var w=c.return;try{m.componentDidMount()}catch(H){qt(c,w,H)}}var S=c.return;try{Vm(c)}catch(H){qt(c,S,H)}break;case 5:var j=c.return;try{Vm(c)}catch(H){qt(c,j,H)}}}catch(H){qt(c,c.return,H)}if(c===s){Oe=null;break}var D=c.sibling;if(D!==null){D.return=c.return,Oe=D;break}Oe=c.return}}var L3=Math.ceil,Rd=C.ReactCurrentDispatcher,Jm=C.ReactCurrentOwner,xn=C.ReactCurrentBatchConfig,lt=0,fr=null,Yt=null,vr=0,rn=0,ps=ma(0),rr=0,nc=null,lo=0,Id=0,Zm=0,ic=null,Gr=null,Qm=0,ms=1/0,$i=null,$d=!1,eg=null,wa=null,Md=!1,_a=null,Ld=0,ac=0,tg=null,Dd=-1,zd=0;function zr(){return(lt&6)!==0?Mt():Dd!==-1?Dd:Dd=Mt()}function Sa(s){return(s.mode&1)===0?1:(lt&2)!==0&&vr!==0?vr&-vr:x3.transition!==null?(zd===0&&(zd=Vu()),zd):(s=st,s!==0||(s=window.event,s=s===void 0?16:t_(s.type)),s)}function Bn(s,c,h,m){if(50<ac)throw ac=0,tg=null,Error(r(185));ua(s,h,m),((lt&2)===0||s!==fr)&&(s===fr&&((lt&2)===0&&(Id|=h),rr===4&&ka(s,vr)),Kr(s,m),h===1&&lt===0&&(c.mode&1)===0&&(ms=Mt()+500,hd&&ya()))}function Kr(s,c){var h=s.callbackNode;Dp(s,c);var m=Za(s,s===fr?vr:0);if(m===0)h!==null&&In(h),s.callbackNode=null,s.callbackPriority=0;else if(c=m&-m,s.callbackPriority!==c){if(h!=null&&In(h),c===1)s.tag===0?b3(tk.bind(null,s)):B_(tk.bind(null,s)),m3(function(){(lt&6)===0&&ya()}),h=null;else{switch(Ge(m)){case 1:h=Tl;break;case 4:h=Ya;break;case 16:h=Ko;break;case 536870912:h=$e;break;default:h=Ko}h=ck(h,ek.bind(null,s))}s.callbackPriority=c,s.callbackNode=h}}function ek(s,c){if(Dd=-1,zd=0,(lt&6)!==0)throw Error(r(327));var h=s.callbackNode;if(gs()&&s.callbackNode!==h)return null;var m=Za(s,s===fr?vr:0);if(m===0)return null;if((m&30)!==0||(m&s.expiredLanes)!==0||c)c=Bd(s,m);else{c=m;var w=lt;lt|=2;var S=nk();(fr!==s||vr!==c)&&($i=null,ms=Mt()+500,uo(s,c));do try{B3();break}catch(D){rk(s,D)}while(!0);bm(),Rd.current=S,lt=w,Yt!==null?c=0:(fr=null,vr=0,c=rr)}if(c!==0){if(c===2&&(w=Cl(s),w!==0&&(m=w,c=rg(s,w))),c===1)throw h=nc,uo(s,0),ka(s,m),Kr(s,Mt()),h;if(c===6)ka(s,m);else{if(w=s.current.alternate,(m&30)===0&&!D3(w)&&(c=Bd(s,m),c===2&&(S=Cl(s),S!==0&&(m=S,c=rg(s,S))),c===1))throw h=nc,uo(s,0),ka(s,m),Kr(s,Mt()),h;switch(s.finishedWork=w,s.finishedLanes=m,c){case 0:case 1:throw Error(r(345));case 2:fo(s,Gr,$i);break;case 3:if(ka(s,m),(m&130023424)===m&&(c=Qm+500-Mt(),10<c)){if(Za(s,0)!==0)break;if(w=s.suspendedLanes,(w&m)!==m){zr(),s.pingedLanes|=s.suspendedLanes&w;break}s.timeoutHandle=lm(fo.bind(null,s,Gr,$i),c);break}fo(s,Gr,$i);break;case 4:if(ka(s,m),(m&4194240)===m)break;for(c=s.eventTimes,w=-1;0<m;){var j=31-Lt(m);S=1<<j,j=c[j],j>w&&(w=j),m&=~S}if(m=w,m=Mt()-m,m=(120>m?120:480>m?480:1080>m?1080:1920>m?1920:3e3>m?3e3:4320>m?4320:1960*L3(m/1960))-m,10<m){s.timeoutHandle=lm(fo.bind(null,s,Gr,$i),m);break}fo(s,Gr,$i);break;case 5:fo(s,Gr,$i);break;default:throw Error(r(329))}}}return Kr(s,Mt()),s.callbackNode===h?ek.bind(null,s):null}function rg(s,c){var h=ic;return s.current.memoizedState.isDehydrated&&(uo(s,c).flags|=256),s=Bd(s,c),s!==2&&(c=Gr,Gr=h,c!==null&&ng(c)),s}function ng(s){Gr===null?Gr=s:Gr.push.apply(Gr,s)}function D3(s){for(var c=s;;){if(c.flags&16384){var h=c.updateQueue;if(h!==null&&(h=h.stores,h!==null))for(var m=0;m<h.length;m++){var w=h[m],S=w.getSnapshot;w=w.value;try{if(!$n(S(),w))return!1}catch{return!1}}}if(h=c.child,c.subtreeFlags&16384&&h!==null)h.return=c,c=h;else{if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function ka(s,c){for(c&=~Zm,c&=~Id,s.suspendedLanes|=c,s.pingedLanes&=~c,s=s.expirationTimes;0<c;){var h=31-Lt(c),m=1<<h;s[h]=-1,c&=~m}}function tk(s){if((lt&6)!==0)throw Error(r(327));gs();var c=Za(s,0);if((c&1)===0)return Kr(s,Mt()),null;var h=Bd(s,c);if(s.tag!==0&&h===2){var m=Cl(s);m!==0&&(c=m,h=rg(s,m))}if(h===1)throw h=nc,uo(s,0),ka(s,c),Kr(s,Mt()),h;if(h===6)throw Error(r(345));return s.finishedWork=s.current.alternate,s.finishedLanes=c,fo(s,Gr,$i),Kr(s,Mt()),null}function ig(s,c){var h=lt;lt|=1;try{return s(c)}finally{lt=h,lt===0&&(ms=Mt()+500,hd&&ya())}}function co(s){_a!==null&&_a.tag===0&&(lt&6)===0&&gs();var c=lt;lt|=1;var h=xn.transition,m=st;try{if(xn.transition=null,st=1,s)return s()}finally{st=m,xn.transition=h,lt=c,(lt&6)===0&&ya()}}function ag(){rn=ps.current,jt(ps)}function uo(s,c){s.finishedWork=null,s.finishedLanes=0;var h=s.timeoutHandle;if(h!==-1&&(s.timeoutHandle=-1,p3(h)),Yt!==null)for(h=Yt.return;h!==null;){var m=h;switch(pm(m),m.tag){case 1:m=m.type.childContextTypes,m!=null&&dd();break;case 3:ds(),jt(Fr),jt(Er),Am();break;case 5:Em(m);break;case 4:ds();break;case 13:jt(Dt);break;case 19:jt(Dt);break;case 10:xm(m.type._context);break;case 22:case 23:ag()}h=h.return}if(fr=s,Yt=s=Ea(s.current,null),vr=rn=c,rr=0,nc=null,Zm=Id=lo=0,Gr=ic=null,ao!==null){for(c=0;c<ao.length;c++)if(h=ao[c],m=h.interleaved,m!==null){h.interleaved=null;var w=m.next,S=h.pending;if(S!==null){var j=S.next;S.next=w,m.next=j}h.pending=m}ao=null}return s}function rk(s,c){do{var h=Yt;try{if(bm(),Sd.current=Ad,kd){for(var m=zt.memoizedState;m!==null;){var w=m.queue;w!==null&&(w.pending=null),m=m.next}kd=!1}if(so=0,dr=tr=zt=null,Jl=!1,Zl=0,Jm.current=null,h===null||h.return===null){rr=1,nc=c,Yt=null;break}e:{var S=s,j=h.return,D=h,H=c;if(c=vr,D.flags|=32768,H!==null&&typeof H=="object"&&typeof H.then=="function"){var re=H,ue=D,fe=ue.tag;if((ue.mode&1)===0&&(fe===0||fe===11||fe===15)){var ce=ue.alternate;ce?(ue.updateQueue=ce.updateQueue,ue.memoizedState=ce.memoizedState,ue.lanes=ce.lanes):(ue.updateQueue=null,ue.memoizedState=null)}var _e=AS(j);if(_e!==null){_e.flags&=-257,TS(_e,j,D,S,c),_e.mode&1&&OS(S,re,c),c=_e,H=re;var je=c.updateQueue;if(je===null){var Ne=new Set;Ne.add(H),c.updateQueue=Ne}else je.add(H);break e}else{if((c&1)===0){OS(S,re,c),og();break e}H=Error(r(426))}}else if(Nt&&D.mode&1){var Kt=AS(j);if(Kt!==null){(Kt.flags&65536)===0&&(Kt.flags|=256),TS(Kt,j,D,S,c),ym(fs(H,D));break e}}S=H=fs(H,D),rr!==4&&(rr=2),ic===null?ic=[S]:ic.push(S),S=j;do{switch(S.tag){case 3:S.flags|=65536,c&=-c,S.lanes|=c;var Q=kS(S,H,c);J_(S,Q);break e;case 1:D=H;var V=S.type,ee=S.stateNode;if((S.flags&128)===0&&(typeof V.getDerivedStateFromError=="function"||ee!==null&&typeof ee.componentDidCatch=="function"&&(wa===null||!wa.has(ee)))){S.flags|=65536,c&=-c,S.lanes|=c;var pe=ES(S,D,c);J_(S,pe);break e}}S=S.return}while(S!==null)}ak(h)}catch(Ie){c=Ie,Yt===h&&h!==null&&(Yt=h=h.return);continue}break}while(!0)}function nk(){var s=Rd.current;return Rd.current=Ad,s===null?Ad:s}function og(){(rr===0||rr===3||rr===2)&&(rr=4),fr===null||(lo&268435455)===0&&(Id&268435455)===0||ka(fr,vr)}function Bd(s,c){var h=lt;lt|=2;var m=nk();(fr!==s||vr!==c)&&($i=null,uo(s,c));do try{z3();break}catch(w){rk(s,w)}while(!0);if(bm(),lt=h,Rd.current=m,Yt!==null)throw Error(r(261));return fr=null,vr=0,rr}function z3(){for(;Yt!==null;)ik(Yt)}function B3(){for(;Yt!==null&&!Gu();)ik(Yt)}function ik(s){var c=lk(s.alternate,s,rn);s.memoizedProps=s.pendingProps,c===null?ak(s):Yt=c,Jm.current=null}function ak(s){var c=s;do{var h=c.alternate;if(s=c.return,(c.flags&32768)===0){if(h=N3(h,c,rn),h!==null){Yt=h;return}}else{if(h=R3(h,c),h!==null){h.flags&=32767,Yt=h;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{rr=6,Yt=null;return}}if(c=c.sibling,c!==null){Yt=c;return}Yt=c=s}while(c!==null);rr===0&&(rr=5)}function fo(s,c,h){var m=st,w=xn.transition;try{xn.transition=null,st=1,U3(s,c,h,m)}finally{xn.transition=w,st=m}return null}function U3(s,c,h,m){do gs();while(_a!==null);if((lt&6)!==0)throw Error(r(327));h=s.finishedWork;var w=s.finishedLanes;if(h===null)return null;if(s.finishedWork=null,s.finishedLanes=0,h===s.current)throw Error(r(177));s.callbackNode=null,s.callbackPriority=0;var S=h.lanes|h.childLanes;if(mn(s,S),s===fr&&(Yt=fr=null,vr=0),(h.subtreeFlags&2064)===0&&(h.flags&2064)===0||Md||(Md=!0,ck(Ko,function(){return gs(),null})),S=(h.flags&15990)!==0,(h.subtreeFlags&15990)!==0||S){S=xn.transition,xn.transition=null;var j=st;st=1;var D=lt;lt|=4,Jm.current=null,$3(s,h),XS(h,s),s3(om),Ju=!!am,om=am=null,s.current=h,M3(h),Ku(),lt=D,st=j,xn.transition=S}else s.current=h;if(Md&&(Md=!1,_a=s,Ld=w),S=s.pendingLanes,S===0&&(wa=null),Wt(h.stateNode),Kr(s,Mt()),c!==null)for(m=s.onRecoverableError,h=0;h<c.length;h++)w=c[h],m(w.value,{componentStack:w.stack,digest:w.digest});if($d)throw $d=!1,s=eg,eg=null,s;return(Ld&1)!==0&&s.tag!==0&&gs(),S=s.pendingLanes,(S&1)!==0?s===tg?ac++:(ac=0,tg=s):ac=0,ya(),null}function gs(){if(_a!==null){var s=Ge(Ld),c=xn.transition,h=st;try{if(xn.transition=null,st=16>s?16:s,_a===null)var m=!1;else{if(s=_a,_a=null,Ld=0,(lt&6)!==0)throw Error(r(331));var w=lt;for(lt|=4,Oe=s.current;Oe!==null;){var S=Oe,j=S.child;if((Oe.flags&16)!==0){var D=S.deletions;if(D!==null){for(var H=0;H<D.length;H++){var re=D[H];for(Oe=re;Oe!==null;){var ue=Oe;switch(ue.tag){case 0:case 11:case 15:rc(8,ue,S)}var fe=ue.child;if(fe!==null)fe.return=ue,Oe=fe;else for(;Oe!==null;){ue=Oe;var ce=ue.sibling,_e=ue.return;if(HS(ue),ue===re){Oe=null;break}if(ce!==null){ce.return=_e,Oe=ce;break}Oe=_e}}}var je=S.alternate;if(je!==null){var Ne=je.child;if(Ne!==null){je.child=null;do{var Kt=Ne.sibling;Ne.sibling=null,Ne=Kt}while(Ne!==null)}}Oe=S}}if((S.subtreeFlags&2064)!==0&&j!==null)j.return=S,Oe=j;else e:for(;Oe!==null;){if(S=Oe,(S.flags&2048)!==0)switch(S.tag){case 0:case 11:case 15:rc(9,S,S.return)}var Q=S.sibling;if(Q!==null){Q.return=S.return,Oe=Q;break e}Oe=S.return}}var V=s.current;for(Oe=V;Oe!==null;){j=Oe;var ee=j.child;if((j.subtreeFlags&2064)!==0&&ee!==null)ee.return=j,Oe=ee;else e:for(j=V;Oe!==null;){if(D=Oe,(D.flags&2048)!==0)try{switch(D.tag){case 0:case 11:case 15:Nd(9,D)}}catch(Ie){qt(D,D.return,Ie)}if(D===j){Oe=null;break e}var pe=D.sibling;if(pe!==null){pe.return=D.return,Oe=pe;break e}Oe=D.return}}if(lt=w,ya(),Ze&&typeof Ze.onPostCommitFiberRoot=="function")try{Ze.onPostCommitFiberRoot(Ve,s)}catch{}m=!0}return m}finally{st=h,xn.transition=c}}return!1}function ok(s,c,h){c=fs(h,c),c=kS(s,c,1),s=ba(s,c,1),c=zr(),s!==null&&(ua(s,1,c),Kr(s,c))}function qt(s,c,h){if(s.tag===3)ok(s,s,h);else for(;c!==null;){if(c.tag===3){ok(c,s,h);break}else if(c.tag===1){var m=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(wa===null||!wa.has(m))){s=fs(h,s),s=ES(c,s,1),c=ba(c,s,1),s=zr(),c!==null&&(ua(c,1,s),Kr(c,s));break}}c=c.return}}function q3(s,c,h){var m=s.pingCache;m!==null&&m.delete(c),c=zr(),s.pingedLanes|=s.suspendedLanes&h,fr===s&&(vr&h)===h&&(rr===4||rr===3&&(vr&130023424)===vr&&500>Mt()-Qm?uo(s,0):Zm|=h),Kr(s,c)}function sk(s,c){c===0&&((s.mode&1)===0?c=1:(c=Ja,Ja<<=1,(Ja&130023424)===0&&(Ja=4194304)));var h=zr();s=Ni(s,c),s!==null&&(ua(s,c,h),Kr(s,h))}function F3(s){var c=s.memoizedState,h=0;c!==null&&(h=c.retryLane),sk(s,h)}function H3(s,c){var h=0;switch(s.tag){case 13:var m=s.stateNode,w=s.memoizedState;w!==null&&(h=w.retryLane);break;case 19:m=s.stateNode;break;default:throw Error(r(314))}m!==null&&m.delete(c),sk(s,h)}var lk;lk=function(s,c,h){if(s!==null)if(s.memoizedProps!==c.pendingProps||Fr.current)Wr=!0;else{if((s.lanes&h)===0&&(c.flags&128)===0)return Wr=!1,P3(s,c,h);Wr=(s.flags&131072)!==0}else Wr=!1,Nt&&(c.flags&1048576)!==0&&U_(c,md,c.index);switch(c.lanes=0,c.tag){case 2:var m=c.type;jd(s,c),s=c.pendingProps;var w=is(c,Er.current);us(c,h),w=jm(null,c,m,s,w,h);var S=Pm();return c.flags|=1,typeof w=="object"&&w!==null&&typeof w.render=="function"&&w.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,Hr(m)?(S=!0,fd(c)):S=!1,c.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,Sm(c),w.updater=Td,c.stateNode=w,w._reactInternals=c,Lm(c,m,s,h),c=Um(null,c,m,!0,S,h)):(c.tag=0,Nt&&S&&hm(c),Dr(null,c,w,h),c=c.child),c;case 16:m=c.elementType;e:{switch(jd(s,c),s=c.pendingProps,w=m._init,m=w(m._payload),c.type=m,w=c.tag=G3(m),s=Ln(m,s),w){case 0:c=Bm(null,c,m,s,h);break e;case 1:c=IS(null,c,m,s,h);break e;case 11:c=CS(null,c,m,s,h);break e;case 14:c=jS(null,c,m,Ln(m.type,s),h);break e}throw Error(r(306,m,""))}return c;case 0:return m=c.type,w=c.pendingProps,w=c.elementType===m?w:Ln(m,w),Bm(s,c,m,w,h);case 1:return m=c.type,w=c.pendingProps,w=c.elementType===m?w:Ln(m,w),IS(s,c,m,w,h);case 3:e:{if($S(c),s===null)throw Error(r(387));m=c.pendingProps,S=c.memoizedState,w=S.element,Y_(s,c),wd(c,m,null,h);var j=c.memoizedState;if(m=j.element,S.isDehydrated)if(S={element:m,isDehydrated:!1,cache:j.cache,pendingSuspenseBoundaries:j.pendingSuspenseBoundaries,transitions:j.transitions},c.updateQueue.baseState=S,c.memoizedState=S,c.flags&256){w=fs(Error(r(423)),c),c=MS(s,c,m,h,w);break e}else if(m!==w){w=fs(Error(r(424)),c),c=MS(s,c,m,h,w);break e}else for(tn=pa(c.stateNode.containerInfo.firstChild),en=c,Nt=!0,Mn=null,h=V_(c,null,m,h),c.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(ss(),m===w){c=Ii(s,c,h);break e}Dr(s,c,m,h)}c=c.child}return c;case 5:return Q_(c),s===null&&gm(c),m=c.type,w=c.pendingProps,S=s!==null?s.memoizedProps:null,j=w.children,sm(m,w)?j=null:S!==null&&sm(m,S)&&(c.flags|=32),RS(s,c),Dr(s,c,j,h),c.child;case 6:return s===null&&gm(c),null;case 13:return LS(s,c,h);case 4:return km(c,c.stateNode.containerInfo),m=c.pendingProps,s===null?c.child=ls(c,null,m,h):Dr(s,c,m,h),c.child;case 11:return m=c.type,w=c.pendingProps,w=c.elementType===m?w:Ln(m,w),CS(s,c,m,w,h);case 7:return Dr(s,c,c.pendingProps,h),c.child;case 8:return Dr(s,c,c.pendingProps.children,h),c.child;case 12:return Dr(s,c,c.pendingProps.children,h),c.child;case 10:e:{if(m=c.type._context,w=c.pendingProps,S=c.memoizedProps,j=w.value,Ot(vd,m._currentValue),m._currentValue=j,S!==null)if($n(S.value,j)){if(S.children===w.children&&!Fr.current){c=Ii(s,c,h);break e}}else for(S=c.child,S!==null&&(S.return=c);S!==null;){var D=S.dependencies;if(D!==null){j=S.child;for(var H=D.firstContext;H!==null;){if(H.context===m){if(S.tag===1){H=Ri(-1,h&-h),H.tag=2;var re=S.updateQueue;if(re!==null){re=re.shared;var ue=re.pending;ue===null?H.next=H:(H.next=ue.next,ue.next=H),re.pending=H}}S.lanes|=h,H=S.alternate,H!==null&&(H.lanes|=h),wm(S.return,h,c),D.lanes|=h;break}H=H.next}}else if(S.tag===10)j=S.type===c.type?null:S.child;else if(S.tag===18){if(j=S.return,j===null)throw Error(r(341));j.lanes|=h,D=j.alternate,D!==null&&(D.lanes|=h),wm(j,h,c),j=S.sibling}else j=S.child;if(j!==null)j.return=S;else for(j=S;j!==null;){if(j===c){j=null;break}if(S=j.sibling,S!==null){S.return=j.return,j=S;break}j=j.return}S=j}Dr(s,c,w.children,h),c=c.child}return c;case 9:return w=c.type,m=c.pendingProps.children,us(c,h),w=vn(w),m=m(w),c.flags|=1,Dr(s,c,m,h),c.child;case 14:return m=c.type,w=Ln(m,c.pendingProps),w=Ln(m.type,w),jS(s,c,m,w,h);case 15:return PS(s,c,c.type,c.pendingProps,h);case 17:return m=c.type,w=c.pendingProps,w=c.elementType===m?w:Ln(m,w),jd(s,c),c.tag=1,Hr(m)?(s=!0,fd(c)):s=!1,us(c,h),_S(c,m,w),Lm(c,m,w,h),Um(null,c,m,!0,s,h);case 19:return zS(s,c,h);case 22:return NS(s,c,h)}throw Error(r(156,c.tag))};function ck(s,c){return Wu(s,c)}function W3(s,c,h,m){this.tag=s,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wn(s,c,h,m){return new W3(s,c,h,m)}function sg(s){return s=s.prototype,!(!s||!s.isReactComponent)}function G3(s){if(typeof s=="function")return sg(s)?1:0;if(s!=null){if(s=s.$$typeof,s===B)return 11;if(s===U)return 14}return 2}function Ea(s,c){var h=s.alternate;return h===null?(h=wn(s.tag,c,s.key,s.mode),h.elementType=s.elementType,h.type=s.type,h.stateNode=s.stateNode,h.alternate=s,s.alternate=h):(h.pendingProps=c,h.type=s.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=s.flags&14680064,h.childLanes=s.childLanes,h.lanes=s.lanes,h.child=s.child,h.memoizedProps=s.memoizedProps,h.memoizedState=s.memoizedState,h.updateQueue=s.updateQueue,c=s.dependencies,h.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},h.sibling=s.sibling,h.index=s.index,h.ref=s.ref,h}function Ud(s,c,h,m,w,S){var j=2;if(m=s,typeof s=="function")sg(s)&&(j=1);else if(typeof s=="string")j=5;else e:switch(s){case P:return ho(h.children,w,S,c);case R:j=8,w|=8;break;case I:return s=wn(12,h,c,w|2),s.elementType=I,s.lanes=S,s;case X:return s=wn(13,h,c,w),s.elementType=X,s.lanes=S,s;case K:return s=wn(19,h,c,w),s.elementType=K,s.lanes=S,s;case J:return qd(h,w,S,c);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case Y:j=10;break e;case W:j=9;break e;case B:j=11;break e;case U:j=14;break e;case G:j=16,m=null;break e}throw Error(r(130,s==null?s:typeof s,""))}return c=wn(j,h,c,w),c.elementType=s,c.type=m,c.lanes=S,c}function ho(s,c,h,m){return s=wn(7,s,m,c),s.lanes=h,s}function qd(s,c,h,m){return s=wn(22,s,m,c),s.elementType=J,s.lanes=h,s.stateNode={isHidden:!1},s}function lg(s,c,h){return s=wn(6,s,null,c),s.lanes=h,s}function cg(s,c,h){return c=wn(4,s.children!==null?s.children:[],s.key,c),c.lanes=h,c.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},c}function K3(s,c,h,m,w){this.tag=c,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ca(0),this.expirationTimes=ca(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ca(0),this.identifierPrefix=m,this.onRecoverableError=w,this.mutableSourceEagerHydrationData=null}function ug(s,c,h,m,w,S,j,D,H){return s=new K3(s,c,h,D,H),c===1?(c=1,S===!0&&(c|=8)):c=0,S=wn(3,null,null,c),s.current=S,S.stateNode=s,S.memoizedState={element:m,isDehydrated:h,cache:null,transitions:null,pendingSuspenseBoundaries:null},Sm(S),s}function V3(s,c,h){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:m==null?null:""+m,children:s,containerInfo:c,implementation:h}}function uk(s){if(!s)return ga;s=s._reactInternals;e:{if(Ai(s)!==s||s.tag!==1)throw Error(r(170));var c=s;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(Hr(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(r(171))}if(s.tag===1){var h=s.type;if(Hr(h))return D_(s,h,c)}return c}function dk(s,c,h,m,w,S,j,D,H){return s=ug(h,m,!0,s,w,S,j,D,H),s.context=uk(null),h=s.current,m=zr(),w=Sa(h),S=Ri(m,w),S.callback=c??null,ba(h,S,w),s.current.lanes=w,ua(s,w,m),Kr(s,m),s}function Fd(s,c,h,m){var w=c.current,S=zr(),j=Sa(w);return h=uk(h),c.context===null?c.context=h:c.pendingContext=h,c=Ri(S,j),c.payload={element:s},m=m===void 0?null:m,m!==null&&(c.callback=m),s=ba(w,c,j),s!==null&&(Bn(s,w,j,S),xd(s,w,j)),j}function Hd(s){if(s=s.current,!s.child)return null;switch(s.child.tag){case 5:return s.child.stateNode;default:return s.child.stateNode}}function fk(s,c){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var h=s.retryLane;s.retryLane=h!==0&&h<c?h:c}}function dg(s,c){fk(s,c),(s=s.alternate)&&fk(s,c)}function X3(){return null}var hk=typeof reportError=="function"?reportError:function(s){console.error(s)};function fg(s){this._internalRoot=s}Wd.prototype.render=fg.prototype.render=function(s){var c=this._internalRoot;if(c===null)throw Error(r(409));Fd(s,c,null,null)},Wd.prototype.unmount=fg.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var c=s.containerInfo;co(function(){Fd(null,s,null,null)}),c[Ti]=null}};function Wd(s){this._internalRoot=s}Wd.prototype.unstable_scheduleHydration=function(s){if(s){var c=Qa();s={blockedOn:null,target:s,priority:c};for(var h=0;h<ur.length&&c!==0&&c<ur[h].priority;h++);ur.splice(h,0,s),h===0&&Q1(s)}};function hg(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function Gd(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11&&(s.nodeType!==8||s.nodeValue!==" react-mount-point-unstable "))}function pk(){}function Y3(s,c,h,m,w){if(w){if(typeof m=="function"){var S=m;m=function(){var re=Hd(j);S.call(re)}}var j=dk(c,m,s,0,null,!1,!1,"",pk);return s._reactRootContainer=j,s[Ti]=j.current,Fl(s.nodeType===8?s.parentNode:s),co(),j}for(;w=s.lastChild;)s.removeChild(w);if(typeof m=="function"){var D=m;m=function(){var re=Hd(H);D.call(re)}}var H=ug(s,0,!1,null,null,!1,!1,"",pk);return s._reactRootContainer=H,s[Ti]=H.current,Fl(s.nodeType===8?s.parentNode:s),co(function(){Fd(c,H,h,m)}),H}function Kd(s,c,h,m,w){var S=h._reactRootContainer;if(S){var j=S;if(typeof w=="function"){var D=w;w=function(){var H=Hd(j);D.call(H)}}Fd(c,j,s,w)}else j=Y3(h,c,s,w,m);return Hd(j)}Pl=function(s){switch(s.tag){case 3:var c=s.stateNode;if(c.current.memoizedState.isDehydrated){var h=la(c.pendingLanes);h!==0&&(jl(c,h|1),Kr(c,Mt()),(lt&6)===0&&(ms=Mt()+500,ya()))}break;case 13:co(function(){var m=Ni(s,1);if(m!==null){var w=zr();Bn(m,s,1,w)}}),dg(s,1)}},Gt=function(s){if(s.tag===13){var c=Ni(s,134217728);if(c!==null){var h=zr();Bn(c,s,134217728,h)}dg(s,134217728)}},yt=function(s){if(s.tag===13){var c=Sa(s),h=Ni(s,c);if(h!==null){var m=zr();Bn(h,s,c,m)}dg(s,c)}},Qa=function(){return st},ui=function(s,c){var h=st;try{return st=s,c()}finally{st=h}},sa=function(s,c,h){switch(c){case"input":if(Et(s,h),c=h.name,h.type==="radio"&&c!=null){for(h=s;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<h.length;c++){var m=h[c];if(m!==s&&m.form===s.form){var w=ud(m);if(!w)throw Error(r(90));oe(m),Et(m,w)}}}break;case"textarea":Ir(s,h);break;case"select":c=h.value,c!=null&&lr(s,!!h.multiple,c,!1)}},de=ig,Re=co;var J3={usingClientEntryPoint:!1,Events:[Gl,rs,ud,M,ne,ig]},oc={findFiberByHostInstance:to,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Z3={bundleType:oc.bundleType,version:oc.version,rendererPackageName:oc.rendererPackageName,rendererConfig:oc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(s){return s=Fu(s),s===null?null:s.stateNode},findFiberByHostInstance:oc.findFiberByHostInstance||X3,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Vd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vd.isDisabled&&Vd.supportsFiber)try{Ve=Vd.inject(Z3),Ze=Vd}catch{}}return Vr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=J3,Vr.createPortal=function(s,c){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!hg(c))throw Error(r(200));return V3(s,c,null,h)},Vr.createRoot=function(s,c){if(!hg(s))throw Error(r(299));var h=!1,m="",w=hk;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(m=c.identifierPrefix),c.onRecoverableError!==void 0&&(w=c.onRecoverableError)),c=ug(s,1,!1,null,null,h,!1,m,w),s[Ti]=c.current,Fl(s.nodeType===8?s.parentNode:s),new fg(c)},Vr.findDOMNode=function(s){if(s==null)return null;if(s.nodeType===1)return s;var c=s._reactInternals;if(c===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=Fu(c),s=s===null?null:s.stateNode,s},Vr.flushSync=function(s){return co(s)},Vr.hydrate=function(s,c,h){if(!Gd(c))throw Error(r(200));return Kd(null,s,c,!0,h)},Vr.hydrateRoot=function(s,c,h){if(!hg(s))throw Error(r(405));var m=h!=null&&h.hydratedSources||null,w=!1,S="",j=hk;if(h!=null&&(h.unstable_strictMode===!0&&(w=!0),h.identifierPrefix!==void 0&&(S=h.identifierPrefix),h.onRecoverableError!==void 0&&(j=h.onRecoverableError)),c=dk(c,null,s,1,h??null,w,!1,S,j),s[Ti]=c.current,Fl(s),m)for(s=0;s<m.length;s++)h=m[s],w=h._getVersion,w=w(h._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[h,w]:c.mutableSourceEagerHydrationData.push(h,w);return new Wd(c)},Vr.render=function(s,c,h){if(!Gd(c))throw Error(r(200));return Kd(null,s,c,!1,h)},Vr.unmountComponentAtNode=function(s){if(!Gd(s))throw Error(r(40));return s._reactRootContainer?(co(function(){Kd(null,null,s,!1,function(){s._reactRootContainer=null,s[Ti]=null})}),!0):!1},Vr.unstable_batchedUpdates=ig,Vr.unstable_renderSubtreeIntoContainer=function(s,c,h,m){if(!Gd(h))throw Error(r(200));if(s==null||s._reactInternals===void 0)throw Error(r(38));return Kd(s,c,h,!1,m)},Vr.version="18.3.1-next-f1338f8080-20240426",Vr}var _k;function vP(){if(_k)return gg.exports;_k=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),gg.exports=sL(),gg.exports}var Sk;function lL(){if(Sk)return Yd;Sk=1;var t=vP();return Yd.createRoot=t.createRoot,Yd.hydrateRoot=t.hydrateRoot,Yd}var cL=lL();/**
41
+ * react-router v7.16.0
42
+ *
43
+ * Copyright (c) Remix Software Inc.
44
+ *
45
+ * This source code is licensed under the MIT license found in the
46
+ * LICENSE.md file in the root directory of this source tree.
47
+ *
48
+ * @license MIT
49
+ */var kk="popstate";function Ek(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function uL(t={}){function e(n,i){var d;let a=(d=i.state)==null?void 0:d.masked,{pathname:o,search:l,hash:u}=a||n.location;return Pb("",{pathname:o,search:l,hash:u},i.state&&i.state.usr||null,i.state&&i.state.key||"default",a?{pathname:n.location.pathname,search:n.location.search,hash:n.location.hash}:void 0)}function r(n,i){return typeof i=="string"?i:Lc(i)}return fL(e,r,null,t)}function $t(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function ei(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function dL(){return Math.random().toString(36).substring(2,10)}function Ok(t,e){return{usr:t.state,key:t.key,idx:e,masked:t.mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function Pb(t,e,r=null,n,i){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?fl(e):e,state:r,key:e&&e.key||n||dL(),mask:i}}function Lc({pathname:t="/",search:e="",hash:r=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function fl(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substring(r),t=t.substring(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substring(n),t=t.substring(0,n)),t&&(e.pathname=t)}return e}function fL(t,e,r,n={}){let{window:i=document.defaultView,v5Compat:a=!1}=n,o=i.history,l="POP",u=null,d=p();d==null&&(d=0,o.replaceState({...o.state,idx:d},""));function p(){return(o.state||{idx:null}).idx}function f(){l="POP";let b=p(),k=b==null?null:b-d;d=b,u&&u({action:l,location:_.location,delta:k})}function g(b,k){l="PUSH";let A=Ek(b)?b:Pb(_.location,b,k);d=p()+1;let O=Ok(A,d),C=_.createHref(A.mask||A);try{o.pushState(O,"",C)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;i.location.assign(C)}a&&u&&u({action:l,location:_.location,delta:1})}function v(b,k){l="REPLACE";let A=Ek(b)?b:Pb(_.location,b,k);d=p();let O=Ok(A,d),C=_.createHref(A.mask||A);o.replaceState(O,"",C),a&&u&&u({action:l,location:_.location,delta:0})}function x(b){return hL(i,b)}let _={get action(){return l},get location(){return t(i,o)},listen(b){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(kk,f),u=b,()=>{i.removeEventListener(kk,f),u=null}},createHref(b){return e(i,b)},createURL:x,encodeLocation(b){let k=x(b);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:g,replace:v,go(b){return o.go(b)}};return _}function hL(t,e,r=!1){let n="http://localhost";t&&(n=t.location.origin!=="null"?t.location.origin:t.location.href),$t(n,"No window.location.(origin|href) available to create URL");let i=typeof e=="string"?e:Lc(e);return i=i.replace(/ $/,"%20"),!r&&i.startsWith("//")&&(i=n+i),new URL(i,n)}function bP(t,e,r="/"){return pL(t,e,r,!1)}function pL(t,e,r,n,i){let a=typeof e=="string"?fl(e):e,o=Xi(a.pathname||"/",r);if(o==null)return null;let l=mL(t),u=null,d=AL(o);for(let p=0;u==null&&p<l.length;++p)u=EL(l[p],d,n);return u}function mL(t){let e=xP(t);return gL(e),e}function xP(t,e=[],r=[],n="",i=!1){let a=(o,l,u=i,d)=>{let p={relativePath:d===void 0?o.path||"":d,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(n)&&u)return;$t(p.relativePath.startsWith(n),`Absolute route path "${p.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(n.length)}let f=Qn([n,p.relativePath]),g=r.concat(p);o.children&&o.children.length>0&&($t(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),xP(o.children,e,g,f,u)),!(o.path==null&&!o.index)&&e.push({path:f,score:SL(f,o.index),routesMeta:g})};return t.forEach((o,l)=>{var u;if(o.path===""||!((u=o.path)!=null&&u.includes("?")))a(o,l);else for(let d of wP(o.path))a(o,l,!0,d)}),e}function wP(t){let e=t.split("/");if(e.length===0)return[];let[r,...n]=e,i=r.endsWith("?"),a=r.replace(/\?$/,"");if(n.length===0)return i?[a,""]:[a];let o=wP(n.join("/")),l=[];return l.push(...o.map(u=>u===""?a:[a,u].join("/"))),i&&l.push(...o),l.map(u=>t.startsWith("/")&&u===""?"/":u)}function gL(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:kL(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var yL=/^:[\w-]+$/,vL=3,bL=2,xL=1,wL=10,_L=-2,Ak=t=>t==="*";function SL(t,e){let r=t.split("/"),n=r.length;return r.some(Ak)&&(n+=_L),e&&(n+=bL),r.filter(i=>!Ak(i)).reduce((i,a)=>i+(yL.test(a)?vL:a===""?xL:wL),n)}function kL(t,e){return t.length===e.length&&t.slice(0,-1).every((n,i)=>n===e[i])?t[t.length-1]-e[e.length-1]:0}function EL(t,e,r=!1){let{routesMeta:n}=t,i={},a="/",o=[];for(let l=0;l<n.length;++l){let u=n[l],d=l===n.length-1,p=a==="/"?e:e.slice(a.length)||"/",f=Tf({path:u.relativePath,caseSensitive:u.caseSensitive,end:d},p),g=u.route;if(!f&&d&&r&&!n[n.length-1].route.index&&(f=Tf({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},p)),!f)return null;Object.assign(i,f.params),o.push({params:i,pathname:Qn([a,f.pathname]),pathnameBase:PL(Qn([a,f.pathnameBase])),route:g}),f.pathnameBase!=="/"&&(a=Qn([a,f.pathnameBase]))}return o}function Tf(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[r,n]=OL(t.path,t.caseSensitive,t.end),i=e.match(r);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:n.reduce((d,{paramName:p,isOptional:f},g)=>{if(p==="*"){let x=l[g]||"";o=a.slice(0,a.length-x.length).replace(/(.)\/+$/,"$1")}const v=l[g];return f&&!v?d[p]=void 0:d[p]=(v||"").replace(/%2F/g,"/"),d},{}),pathname:a,pathnameBase:o,pattern:t}}function OL(t,e=!1,r=!0){ei(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let n=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,u,d,p)=>{if(n.push({paramName:l,isOptional:u!=null}),u){let f=p.charAt(d+o.length);return f&&f!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(n.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),n]}function AL(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return ei(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function Xi(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}var TL=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function CL(t,e="/"){let{pathname:r,search:n="",hash:i=""}=typeof t=="string"?fl(t):t,a;return r?(r=_P(r),r.startsWith("/")?a=Tk(r.substring(1),"/"):a=Tk(r,e)):a=e,{pathname:a,search:NL(n),hash:RL(i)}}function Tk(t,e){let r=Cf(e).split("/");return t.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function bg(t,e,r,n){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function jL(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function Sw(t){let e=jL(t);return e.map((r,n)=>n===e.length-1?r.pathname:r.pathnameBase)}function Hh(t,e,r,n=!1){let i;typeof t=="string"?i=fl(t):(i={...t},$t(!i.pathname||!i.pathname.includes("?"),bg("?","pathname","search",i)),$t(!i.pathname||!i.pathname.includes("#"),bg("#","pathname","hash",i)),$t(!i.search||!i.search.includes("#"),bg("#","search","hash",i)));let a=t===""||i.pathname==="",o=a?"/":i.pathname,l;if(o==null)l=r;else{let f=e.length-1;if(!n&&o.startsWith("..")){let g=o.split("/");for(;g[0]==="..";)g.shift(),f-=1;i.pathname=g.join("/")}l=f>=0?e[f]:"/"}let u=CL(i,l),d=o&&o!=="/"&&o.endsWith("/"),p=(a||o===".")&&r.endsWith("/");return!u.pathname.endsWith("/")&&(d||p)&&(u.pathname+="/"),u}var _P=t=>t.replace(/\/\/+/g,"/"),Qn=t=>_P(t.join("/")),Cf=t=>t.replace(/\/+$/,""),PL=t=>Cf(t).replace(/^\/*/,"/"),NL=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,RL=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,IL=class{constructor(t,e,r,n=!1){this.status=t,this.statusText=e||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function $L(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function ML(t){let e=t.map(r=>r.route.path).filter(Boolean);return Qn(e)||"/"}var SP=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function kP(t,e){let r=t;if(typeof r!="string"||!TL.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,i=!1;if(SP)try{let a=new URL(window.location.href),o=r.startsWith("//")?new URL(a.protocol+r):new URL(r),l=Xi(o.pathname,e);o.origin===a.origin&&l!=null?r=l+o.search+o.hash:i=!0}catch{ei(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:i,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var EP=["POST","PUT","PATCH","DELETE"];new Set(EP);var LL=["GET",...EP];new Set(LL);var hl=N.createContext(null);hl.displayName="DataRouter";var Wh=N.createContext(null);Wh.displayName="DataRouterState";var OP=N.createContext(!1);function DL(){return N.useContext(OP)}var AP=N.createContext({isTransitioning:!1});AP.displayName="ViewTransition";var zL=N.createContext(new Map);zL.displayName="Fetchers";var BL=N.createContext(null);BL.displayName="Await";var fn=N.createContext(null);fn.displayName="Navigation";var Ou=N.createContext(null);Ou.displayName="Location";var Pn=N.createContext({outlet:null,matches:[],isDataRoute:!1});Pn.displayName="Route";var kw=N.createContext(null);kw.displayName="RouteError";var TP="REACT_ROUTER_ERROR",UL="REDIRECT",qL="ROUTE_ERROR_RESPONSE";function FL(t){if(t.startsWith(`${TP}:${UL}:{`))try{let e=JSON.parse(t.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function HL(t){if(t.startsWith(`${TP}:${qL}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new IL(e.status,e.statusText,e.data)}catch{}}function WL(t,{relative:e}={}){$t(pl(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=N.useContext(fn),{hash:i,pathname:a,search:o}=Tu(t,{relative:e}),l=a;return r!=="/"&&(l=a==="/"?r:Qn([r,a])),n.createHref({pathname:l,search:o,hash:i})}function pl(){return N.useContext(Ou)!=null}function ti(){return $t(pl(),"useLocation() may be used only in the context of a <Router> component."),N.useContext(Ou).location}var CP="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function jP(t){N.useContext(fn).static||N.useLayoutEffect(t)}function Au(){let{isDataRoute:t}=N.useContext(Pn);return t?sD():GL()}function GL(){$t(pl(),"useNavigate() may be used only in the context of a <Router> component.");let t=N.useContext(hl),{basename:e,navigator:r}=N.useContext(fn),{matches:n}=N.useContext(Pn),{pathname:i}=ti(),a=JSON.stringify(Sw(n)),o=N.useRef(!1);return jP(()=>{o.current=!0}),N.useCallback((u,d={})=>{if(ei(o.current,CP),!o.current)return;if(typeof u=="number"){r.go(u);return}let p=Hh(u,JSON.parse(a),i,d.relative==="path");t==null&&e!=="/"&&(p.pathname=p.pathname==="/"?e:Qn([e,p.pathname])),(d.replace?r.replace:r.push)(p,d.state,d)},[e,r,a,i,t])}var KL=N.createContext(null);function VL(t){let e=N.useContext(Pn).outlet;return N.useMemo(()=>e&&N.createElement(KL.Provider,{value:t},e),[e,t])}function XL(){let{matches:t}=N.useContext(Pn),e=t[t.length-1];return(e==null?void 0:e.params)??{}}function Tu(t,{relative:e}={}){let{matches:r}=N.useContext(Pn),{pathname:n}=ti(),i=JSON.stringify(Sw(r));return N.useMemo(()=>Hh(t,JSON.parse(i),n,e==="path"),[t,i,n,e])}function YL(t,e){return PP(t,e)}function PP(t,e,r){var b;$t(pl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=N.useContext(fn),{matches:i}=N.useContext(Pn),a=i[i.length-1],o=a?a.params:{},l=a?a.pathname:"/",u=a?a.pathnameBase:"/",d=a&&a.route;{let k=d&&d.path||"";RP(l,!d||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${k}">) 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.
50
+
51
+ Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let p=ti(),f;if(e){let k=typeof e=="string"?fl(e):e;$t(u==="/"||((b=k.pathname)==null?void 0:b.startsWith(u)),`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 "${u}" but pathname "${k.pathname}" was given in the \`location\` prop.`),f=k}else f=p;let g=f.pathname||"/",v=g;if(u!=="/"){let k=u.replace(/^\//,"").split("/");v="/"+g.replace(/^\//,"").split("/").slice(k.length).join("/")}let x=r&&r.state.matches.length?r.state.matches.map(k=>Object.assign(k,{route:r.manifest[k.route.id]||k.route})):bP(t,{pathname:v});ei(d||x!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),ei(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.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 _=tD(x&&x.map(k=>Object.assign({},k,{params:Object.assign({},o,k.params),pathname:Qn([u,n.encodeLocation?n.encodeLocation(k.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?u:Qn([u,n.encodeLocation?n.encodeLocation(k.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),i,r);return e&&_?N.createElement(Ou.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...f},navigationType:"POP"}},_):_}function JL(){let t=oD(),e=$L(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,n="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:n},a={padding:"2px 4px",backgroundColor:n},o=null;return console.error("Error handled by React Router default ErrorBoundary:",t),o=N.createElement(N.Fragment,null,N.createElement("p",null,"💿 Hey developer 👋"),N.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",N.createElement("code",{style:a},"ErrorBoundary")," or"," ",N.createElement("code",{style:a},"errorElement")," prop on your route.")),N.createElement(N.Fragment,null,N.createElement("h2",null,"Unexpected Application Error!"),N.createElement("h3",{style:{fontStyle:"italic"}},e),r?N.createElement("pre",{style:i},r):null,o)}var ZL=N.createElement(JL,null),NP=class extends N.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.onError?this.props.onError(t,e):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const r=HL(t.digest);r&&(t=r)}let e=t!==void 0?N.createElement(Pn.Provider,{value:this.props.routeContext},N.createElement(kw.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?N.createElement(QL,{error:t},e):e}};NP.contextType=OP;var xg=new WeakMap;function QL({children:t,error:e}){let{basename:r}=N.useContext(fn);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let n=FL(e.digest);if(n){let i=xg.get(e);if(i)throw i;let a=kP(n.location,r);if(SP&&!xg.get(e))if(a.isExternal||n.reloadDocument)window.location.href=a.absoluteURL||a.to;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:n.replace}));throw xg.set(e,o),o}return N.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return t}function eD({routeContext:t,match:e,children:r}){let n=N.useContext(hl);return n&&n.static&&n.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=e.route.id),N.createElement(Pn.Provider,{value:t},r)}function tD(t,e=[],r){let n=r==null?void 0:r.state;if(t==null){if(!n)return null;if(n.errors)t=n.matches;else if(e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let i=t,a=n==null?void 0:n.errors;if(a!=null){let p=i.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);$t(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),i=i.slice(0,Math.min(i.length,p+1))}let o=!1,l=-1;if(r&&n){o=n.renderFallback;for(let p=0;p<i.length;p++){let f=i[p];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(l=p),f.route.id){let{loaderData:g,errors:v}=n,x=f.route.loader&&!g.hasOwnProperty(f.route.id)&&(!v||v[f.route.id]===void 0);if(f.route.lazy||x){r.isStatic&&(o=!0),l>=0?i=i.slice(0,l+1):i=[i[0]];break}}}}let u=r==null?void 0:r.onError,d=n&&u?(p,f)=>{var g,v;u(p,{location:n.location,params:((v=(g=n.matches)==null?void 0:g[0])==null?void 0:v.params)??{},pattern:ML(n.matches),errorInfo:f})}:void 0;return i.reduceRight((p,f,g)=>{let v,x=!1,_=null,b=null;n&&(v=a&&f.route.id?a[f.route.id]:void 0,_=f.route.errorElement||ZL,o&&(l<0&&g===0?(RP("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,b=null):l===g&&(x=!0,b=f.route.hydrateFallbackElement||null)));let k=e.concat(i.slice(0,g+1)),A=()=>{let O;return v?O=_:x?O=b:f.route.Component?O=N.createElement(f.route.Component,null):f.route.element?O=f.route.element:O=p,N.createElement(eD,{match:f,routeContext:{outlet:p,matches:k,isDataRoute:n!=null},children:O})};return n&&(f.route.ErrorBoundary||f.route.errorElement||g===0)?N.createElement(NP,{location:n.location,revalidation:n.revalidation,component:_,error:v,children:A(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:d}):A()},null)}function Ew(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function rD(t){let e=N.useContext(hl);return $t(e,Ew(t)),e}function nD(t){let e=N.useContext(Wh);return $t(e,Ew(t)),e}function iD(t){let e=N.useContext(Pn);return $t(e,Ew(t)),e}function Ow(t){let e=iD(t),r=e.matches[e.matches.length-1];return $t(r.route.id,`${t} can only be used on routes that contain a unique "id"`),r.route.id}function aD(){return Ow("useRouteId")}function oD(){var n;let t=N.useContext(kw),e=nD("useRouteError"),r=Ow("useRouteError");return t!==void 0?t:(n=e.errors)==null?void 0:n[r]}function sD(){let{router:t}=rD("useNavigate"),e=Ow("useNavigate"),r=N.useRef(!1);return jP(()=>{r.current=!0}),N.useCallback(async(i,a={})=>{ei(r.current,CP),r.current&&(typeof i=="number"?await t.navigate(i):await t.navigate(i,{fromRouteId:e,...a}))},[t,e])}var Ck={};function RP(t,e,r){!e&&!Ck[t]&&(Ck[t]=!0,ei(!1,r))}N.memo(lD);function lD({routes:t,manifest:e,future:r,state:n,isStatic:i,onError:a}){return PP(t,void 0,{manifest:e,state:n,isStatic:i,onError:a})}function cD({to:t,replace:e,state:r,relative:n}){$t(pl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=N.useContext(fn);ei(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:a}=N.useContext(Pn),{pathname:o}=ti(),l=Au(),u=Hh(t,Sw(a),o,n==="path"),d=JSON.stringify(u);return N.useEffect(()=>{l(JSON.parse(d),{replace:e,state:r,relative:n})},[l,d,n,e,r]),null}function uD(t){return VL(t.context)}function nn(t){$t(!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 dD({basename:t="/",children:e=null,location:r,navigationType:n="POP",navigator:i,static:a=!1,useTransitions:o}){$t(!pl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=t.replace(/^\/*/,"/"),u=N.useMemo(()=>({basename:l,navigator:i,static:a,useTransitions:o,future:{}}),[l,i,a,o]);typeof r=="string"&&(r=fl(r));let{pathname:d="/",search:p="",hash:f="",state:g=null,key:v="default",mask:x}=r,_=N.useMemo(()=>{let b=Xi(d,l);return b==null?null:{location:{pathname:b,search:p,hash:f,state:g,key:v,mask:x},navigationType:n}},[l,d,p,f,g,v,n,x]);return ei(_!=null,`<Router basename="${l}"> is not able to match the URL "${d}${p}${f}" because it does not start with the basename, so the <Router> won't render anything.`),_==null?null:N.createElement(fn.Provider,{value:u},N.createElement(Ou.Provider,{children:e,value:_}))}function fD({children:t,location:e}){return YL(Nb(t),e)}function Nb(t,e=[]){let r=[];return N.Children.forEach(t,(n,i)=>{if(!N.isValidElement(n))return;let a=[...e,i];if(n.type===N.Fragment){r.push.apply(r,Nb(n.props.children,a));return}$t(n.type===nn,`[${typeof n.type=="string"?n.type:n.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),$t(!n.props.index||!n.props.children,"An index route cannot have child routes.");let o={id:n.props.id||a.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,middleware:n.props.middleware,loader:n.props.loader,action:n.props.action,hydrateFallbackElement:n.props.hydrateFallbackElement,HydrateFallback:n.props.HydrateFallback,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.hasErrorBoundary===!0||n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=Nb(n.props.children,a)),r.push(o)}),r}var Ef="get",Of="application/x-www-form-urlencoded";function Gh(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function hD(t){return Gh(t)&&t.tagName.toLowerCase()==="button"}function pD(t){return Gh(t)&&t.tagName.toLowerCase()==="form"}function mD(t){return Gh(t)&&t.tagName.toLowerCase()==="input"}function gD(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function yD(t,e){return t.button===0&&(!e||e==="_self")&&!gD(t)}var Jd=null;function vD(){if(Jd===null)try{new FormData(document.createElement("form"),0),Jd=!1}catch{Jd=!0}return Jd}var bD=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function wg(t){return t!=null&&!bD.has(t)?(ei(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Of}"`),null):t}function xD(t,e){let r,n,i,a,o;if(pD(t)){let l=t.getAttribute("action");n=l?Xi(l,e):null,r=t.getAttribute("method")||Ef,i=wg(t.getAttribute("enctype"))||Of,a=new FormData(t)}else if(hD(t)||mD(t)&&(t.type==="submit"||t.type==="image")){let l=t.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=t.getAttribute("formaction")||l.getAttribute("action");if(n=u?Xi(u,e):null,r=t.getAttribute("formmethod")||l.getAttribute("method")||Ef,i=wg(t.getAttribute("formenctype"))||wg(l.getAttribute("enctype"))||Of,a=new FormData(l,t),!vD()){let{name:d,type:p,value:f}=t;if(p==="image"){let g=d?`${d}.`:"";a.append(`${g}x`,"0"),a.append(`${g}y`,"0")}else d&&a.append(d,f)}}else{if(Gh(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Ef,n=null,i=Of,o=t}return a&&i==="text/plain"&&(o=a,a=void 0),{action:n,method:r.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Aw(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function IP(t,e,r,n){let i=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return r?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${n}`:i.pathname=`${i.pathname}.${n}`:i.pathname==="/"?i.pathname=`_root.${n}`:e&&Xi(i.pathname,e)==="/"?i.pathname=`${Cf(e)}/_root.${n}`:i.pathname=`${Cf(i.pathname)}.${n}`,i}async function wD(t,e){if(t.id in e)return e[t.id];try{let r=await import(t.module);return e[t.id]=r,r}catch(r){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function _D(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function SD(t,e,r){let n=await Promise.all(t.map(async i=>{let a=e.routes[i.route.id];if(a){let o=await wD(a,r);return o.links?o.links():[]}return[]}));return AD(n.flat(1).filter(_D).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function jk(t,e,r,n,i,a){let o=(u,d)=>r[d]?u.route.id!==r[d].route.id:!0,l=(u,d)=>{var p;return r[d].pathname!==u.pathname||((p=r[d].route.path)==null?void 0:p.endsWith("*"))&&r[d].params["*"]!==u.params["*"]};return a==="assets"?e.filter((u,d)=>o(u,d)||l(u,d)):a==="data"?e.filter((u,d)=>{var f;let p=n.routes[u.route.id];if(!p||!p.hasLoader)return!1;if(o(u,d)||l(u,d))return!0;if(u.route.shouldRevalidate){let g=u.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((f=r[0])==null?void 0:f.params)||{},nextUrl:new URL(t,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function kD(t,e,{includeHydrateFallback:r}={}){return ED(t.map(n=>{let i=e.routes[n.route.id];if(!i)return[];let a=[i.module];return i.clientActionModule&&(a=a.concat(i.clientActionModule)),i.clientLoaderModule&&(a=a.concat(i.clientLoaderModule)),r&&i.hydrateFallbackModule&&(a=a.concat(i.hydrateFallbackModule)),i.imports&&(a=a.concat(i.imports)),a}).flat(1))}function ED(t){return[...new Set(t)]}function OD(t){let e={},r=Object.keys(t).sort();for(let n of r)e[n]=t[n];return e}function AD(t,e){let r=new Set;return new Set(e),t.reduce((n,i)=>{let a=JSON.stringify(OD(i));return r.has(a)||(r.add(a),n.push({key:a,link:i})),n},[])}function Tw(){let t=N.useContext(hl);return Aw(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function TD(){let t=N.useContext(Wh);return Aw(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var Cw=N.createContext(void 0);Cw.displayName="FrameworkContext";function jw(){let t=N.useContext(Cw);return Aw(t,"You must render this element inside a <HydratedRouter> element"),t}function CD(t,e){let r=N.useContext(Cw),[n,i]=N.useState(!1),[a,o]=N.useState(!1),{onFocus:l,onBlur:u,onMouseEnter:d,onMouseLeave:p,onTouchStart:f}=e,g=N.useRef(null);N.useEffect(()=>{if(t==="render"&&o(!0),t==="viewport"){let _=k=>{k.forEach(A=>{o(A.isIntersecting)})},b=new IntersectionObserver(_,{threshold:.5});return g.current&&b.observe(g.current),()=>{b.disconnect()}}},[t]),N.useEffect(()=>{if(n){let _=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(_)}}},[n]);let v=()=>{i(!0)},x=()=>{i(!1),o(!1)};return r?t!=="intent"?[a,g,{}]:[a,g,{onFocus:lc(l,v),onBlur:lc(u,x),onMouseEnter:lc(d,v),onMouseLeave:lc(p,x),onTouchStart:lc(f,v)}]:[!1,g,{}]}function lc(t,e){return r=>{t&&t(r),r.defaultPrevented||e(r)}}function jD({page:t,...e}){let r=DL(),{router:n}=Tw(),i=N.useMemo(()=>bP(n.routes,t,n.basename),[n.routes,t,n.basename]);return i?r?N.createElement(ND,{page:t,matches:i,...e}):N.createElement(RD,{page:t,matches:i,...e}):null}function PD(t){let{manifest:e,routeModules:r}=jw(),[n,i]=N.useState([]);return N.useEffect(()=>{let a=!1;return SD(t,e,r).then(o=>{a||i(o)}),()=>{a=!0}},[t,e,r]),n}function ND({page:t,matches:e,...r}){let n=ti(),{future:i}=jw(),{basename:a}=Tw(),o=N.useMemo(()=>{if(t===n.pathname+n.search+n.hash)return[];let l=IP(t,a,i.v8_trailingSlashAwareDataRequests,"rsc"),u=!1,d=[];for(let p of e)typeof p.route.shouldRevalidate=="function"?u=!0:d.push(p.route.id);return u&&d.length>0&&l.searchParams.set("_routes",d.join(",")),[l.pathname+l.search]},[a,i.v8_trailingSlashAwareDataRequests,t,n,e]);return N.createElement(N.Fragment,null,o.map(l=>N.createElement("link",{key:l,rel:"prefetch",as:"fetch",href:l,...r})))}function RD({page:t,matches:e,...r}){let n=ti(),{future:i,manifest:a,routeModules:o}=jw(),{basename:l}=Tw(),{loaderData:u,matches:d}=TD(),p=N.useMemo(()=>jk(t,e,d,a,n,"data"),[t,e,d,a,n]),f=N.useMemo(()=>jk(t,e,d,a,n,"assets"),[t,e,d,a,n]),g=N.useMemo(()=>{if(t===n.pathname+n.search+n.hash)return[];let _=new Set,b=!1;if(e.forEach(A=>{var C;let O=a.routes[A.route.id];!O||!O.hasLoader||(!p.some(E=>E.route.id===A.route.id)&&A.route.id in u&&((C=o[A.route.id])!=null&&C.shouldRevalidate)||O.hasClientLoader?b=!0:_.add(A.route.id))}),_.size===0)return[];let k=IP(t,l,i.v8_trailingSlashAwareDataRequests,"data");return b&&_.size>0&&k.searchParams.set("_routes",e.filter(A=>_.has(A.route.id)).map(A=>A.route.id).join(",")),[k.pathname+k.search]},[l,i.v8_trailingSlashAwareDataRequests,u,n,a,p,e,t,o]),v=N.useMemo(()=>kD(f,a),[f,a]),x=PD(f);return N.createElement(N.Fragment,null,g.map(_=>N.createElement("link",{key:_,rel:"prefetch",as:"fetch",href:_,...r})),v.map(_=>N.createElement("link",{key:_,rel:"modulepreload",href:_,...r})),x.map(({key:_,link:b})=>N.createElement("link",{key:_,nonce:r.nonce,...b,crossOrigin:b.crossOrigin??r.crossOrigin})))}function ID(...t){return e=>{t.forEach(r=>{typeof r=="function"?r(e):r!=null&&(r.current=e)})}}var $D=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{$D&&(window.__reactRouterVersion="7.16.0")}catch{}function MD({basename:t,children:e,useTransitions:r,window:n}){let i=N.useRef();i.current==null&&(i.current=uL({window:n,v5Compat:!0}));let a=i.current,[o,l]=N.useState({action:a.action,location:a.location}),u=N.useCallback(d=>{r===!1?l(d):N.startTransition(()=>l(d))},[r]);return N.useLayoutEffect(()=>a.listen(u),[a,u]),N.createElement(dD,{basename:t,children:e,location:o.location,navigationType:o.action,navigator:a,useTransitions:r})}var $P=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,MP=N.forwardRef(function({onClick:e,discover:r="render",prefetch:n="none",relative:i,reloadDocument:a,replace:o,mask:l,state:u,target:d,to:p,preventScrollReset:f,viewTransition:g,defaultShouldRevalidate:v,...x},_){let{basename:b,navigator:k,useTransitions:A}=N.useContext(fn),O=typeof p=="string"&&$P.test(p),C=kP(p,b);p=C.to;let E=WL(p,{relative:i}),T=ti(),P=null;if(l){let U=Hh(l,[],T.mask?T.mask.pathname:"/",!0);b!=="/"&&(U.pathname=U.pathname==="/"?b:Qn([b,U.pathname])),P=k.createHref(U)}let[R,I,Y]=CD(n,x),W=zD(p,{replace:o,mask:l,state:u,target:d,preventScrollReset:f,relative:i,viewTransition:g,defaultShouldRevalidate:v,useTransitions:A});function B(U){e&&e(U),U.defaultPrevented||W(U)}let X=!(C.isExternal||a),K=N.createElement("a",{...x,...Y,href:(X?P:void 0)||C.absoluteURL||E,onClick:X?B:e,ref:ID(_,I),target:d,"data-discover":!O&&r==="render"?"true":void 0});return R&&!O?N.createElement(N.Fragment,null,K,N.createElement(jD,{page:E})):K});MP.displayName="Link";var LP=N.forwardRef(function({"aria-current":e="page",caseSensitive:r=!1,className:n="",end:i=!1,style:a,to:o,viewTransition:l,children:u,...d},p){let f=Tu(o,{relative:d.relative}),g=ti(),v=N.useContext(Wh),{navigator:x,basename:_}=N.useContext(fn),b=v!=null&&HD(f)&&l===!0,k=x.encodeLocation?x.encodeLocation(f).pathname:f.pathname,A=g.pathname,O=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;r||(A=A.toLowerCase(),O=O?O.toLowerCase():null,k=k.toLowerCase()),O&&_&&(O=Xi(O,_)||O);const C=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let E=A===k||!i&&A.startsWith(k)&&A.charAt(C)==="/",T=O!=null&&(O===k||!i&&O.startsWith(k)&&O.charAt(k.length)==="/"),P={isActive:E,isPending:T,isTransitioning:b},R=E?e:void 0,I;typeof n=="function"?I=n(P):I=[n,E?"active":null,T?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let Y=typeof a=="function"?a(P):a;return N.createElement(MP,{...d,"aria-current":R,className:I,ref:p,style:Y,to:o,viewTransition:l},typeof u=="function"?u(P):u)});LP.displayName="NavLink";var LD=N.forwardRef(({discover:t="render",fetcherKey:e,navigate:r,reloadDocument:n,replace:i,state:a,method:o=Ef,action:l,onSubmit:u,relative:d,preventScrollReset:p,viewTransition:f,defaultShouldRevalidate:g,...v},x)=>{let{useTransitions:_}=N.useContext(fn),b=qD(),k=FD(l,{relative:d}),A=o.toLowerCase()==="get"?"get":"post",O=typeof l=="string"&&$P.test(l),C=E=>{if(u&&u(E),E.defaultPrevented)return;E.preventDefault();let T=E.nativeEvent.submitter,P=(T==null?void 0:T.getAttribute("formmethod"))||o,R=()=>b(T||E.currentTarget,{fetcherKey:e,method:P,navigate:r,replace:i,state:a,relative:d,preventScrollReset:p,viewTransition:f,defaultShouldRevalidate:g});_&&r!==!1?N.startTransition(()=>R()):R()};return N.createElement("form",{ref:x,method:A,action:k,onSubmit:n?u:C,...v,"data-discover":!O&&t==="render"?"true":void 0})});LD.displayName="Form";function DD(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function DP(t){let e=N.useContext(hl);return $t(e,DD(t)),e}function zD(t,{target:e,replace:r,mask:n,state:i,preventScrollReset:a,relative:o,viewTransition:l,defaultShouldRevalidate:u,useTransitions:d}={}){let p=Au(),f=ti(),g=Tu(t,{relative:o});return N.useCallback(v=>{if(yD(v,e)){v.preventDefault();let x=r!==void 0?r:Lc(f)===Lc(g),_=()=>p(t,{replace:x,mask:n,state:i,preventScrollReset:a,relative:o,viewTransition:l,defaultShouldRevalidate:u});d?N.startTransition(()=>_()):_()}},[f,p,g,r,n,i,e,t,a,o,l,u,d])}var BD=0,UD=()=>`__${String(++BD)}__`;function qD(){let{router:t}=DP("useSubmit"),{basename:e}=N.useContext(fn),r=aD(),n=t.fetch,i=t.navigate;return N.useCallback(async(a,o={})=>{let{action:l,method:u,encType:d,formData:p,body:f}=xD(a,e);if(o.navigate===!1){let g=o.fetcherKey||UD();await n(g,r,o.action||l,{defaultShouldRevalidate:o.defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:p,body:f,formMethod:o.method||u,formEncType:o.encType||d,flushSync:o.flushSync})}else await i(o.action||l,{defaultShouldRevalidate:o.defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:p,body:f,formMethod:o.method||u,formEncType:o.encType||d,replace:o.replace,state:o.state,fromRouteId:r,flushSync:o.flushSync,viewTransition:o.viewTransition})},[n,i,e,r])}function FD(t,{relative:e}={}){let{basename:r}=N.useContext(fn),n=N.useContext(Pn);$t(n,"useFormAction must be used inside a RouteContext");let[i]=n.matches.slice(-1),a={...Tu(t||".",{relative:e})},o=ti();if(t==null){a.search=o.search;let l=new URLSearchParams(a.search),u=l.getAll("index");if(u.some(p=>p==="")){l.delete("index"),u.filter(f=>f).forEach(f=>l.append("index",f));let p=l.toString();a.search=p?`?${p}`:""}}return(!t||t===".")&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(a.pathname=a.pathname==="/"?r:Qn([r,a.pathname])),Lc(a)}function HD(t,{relative:e}={}){let r=N.useContext(AP);$t(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=DP("useViewTransitionState"),i=Tu(t,{relative:e});if(!r.isTransitioning)return!1;let a=Xi(r.currentLocation.pathname,n)||r.currentLocation.pathname,o=Xi(r.nextLocation.pathname,n)||r.nextLocation.pathname;return Tf(i.pathname,o)!=null||Tf(i.pathname,a)!=null}var WD=vP();const GD=vt(WD);function KD(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}const VD=t=>{switch(t){case"success":return JD;case"info":return QD;case"warning":return ZD;case"error":return e5;default:return null}},XD=Array(12).fill(0),YD=({visible:t,className:e})=>$.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},$.createElement("div",{className:"sonner-spinner"},XD.map((r,n)=>$.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),JD=$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},$.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),ZD=$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},$.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),QD=$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},$.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),e5=$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},$.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),t5=$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},$.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),$.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),r5=()=>{const[t,e]=$.useState(document.hidden);return $.useEffect(()=>{const r=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),t};let Rb=1;class n5{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const r=this.subscribers.indexOf(e);this.subscribers.splice(r,1)}),this.publish=e=>{this.subscribers.forEach(r=>r(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var r;const{message:n,...i}=e,a=typeof(e==null?void 0:e.id)=="number"||((r=e.id)==null?void 0:r.length)>0?e.id:Rb++,o=this.toasts.find(u=>u.id===a),l=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),o?this.toasts=this.toasts.map(u=>u.id===a?(this.publish({...u,...e,id:a,title:n}),{...u,...e,id:a,dismissible:l,title:n}):u):this.addToast({title:n,...i,dismissible:l,id:a}),a},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:e,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),e),this.message=(e,r)=>this.create({...r,message:e}),this.error=(e,r)=>this.create({...r,message:e,type:"error"}),this.success=(e,r)=>this.create({...r,type:"success",message:e}),this.info=(e,r)=>this.create({...r,type:"info",message:e}),this.warning=(e,r)=>this.create({...r,type:"warning",message:e}),this.loading=(e,r)=>this.create({...r,type:"loading",message:e}),this.promise=(e,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:e,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const i=Promise.resolve(e instanceof Function?e():e);let a=n!==void 0,o;const l=i.then(async d=>{if(o=["resolve",d],$.isValidElement(d))a=!1,this.create({id:n,type:"default",message:d});else if(a5(d)&&!d.ok){a=!1;const f=typeof r.error=="function"?await r.error(`HTTP error! status: ${d.status}`):r.error,g=typeof r.description=="function"?await r.description(`HTTP error! status: ${d.status}`):r.description,x=typeof f=="object"&&!$.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:g,...x})}else if(d instanceof Error){a=!1;const f=typeof r.error=="function"?await r.error(d):r.error,g=typeof r.description=="function"?await r.description(d):r.description,x=typeof f=="object"&&!$.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:g,...x})}else if(r.success!==void 0){a=!1;const f=typeof r.success=="function"?await r.success(d):r.success,g=typeof r.description=="function"?await r.description(d):r.description,x=typeof f=="object"&&!$.isValidElement(f)?f:{message:f};this.create({id:n,type:"success",description:g,...x})}}).catch(async d=>{if(o=["reject",d],r.error!==void 0){a=!1;const p=typeof r.error=="function"?await r.error(d):r.error,f=typeof r.description=="function"?await r.description(d):r.description,v=typeof p=="object"&&!$.isValidElement(p)?p:{message:p};this.create({id:n,type:"error",description:f,...v})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),u=()=>new Promise((d,p)=>l.then(()=>o[0]==="reject"?p(o[1]):d(o[1])).catch(p));return typeof n!="string"&&typeof n!="number"?{unwrap:u}:Object.assign(n,{unwrap:u})},this.custom=(e,r)=>{const n=(r==null?void 0:r.id)||Rb++;return this.create({jsx:e(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Yr=new n5,i5=(t,e)=>{const r=(e==null?void 0:e.id)||Rb++;return Yr.addToast({title:t,...e,id:r}),r},a5=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",o5=i5,s5=()=>Yr.toasts,l5=()=>Yr.getActiveToasts(),ft=Object.assign(o5,{success:Yr.success,info:Yr.info,warning:Yr.warning,error:Yr.error,custom:Yr.custom,message:Yr.message,promise:Yr.promise,dismiss:Yr.dismiss,loading:Yr.loading},{getHistory:s5,getToasts:l5});KD("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Zd(t){return t.label!==void 0}const c5=3,u5="24px",d5="16px",Pk=4e3,f5=356,h5=14,p5=45,m5=200;function mi(...t){return t.filter(Boolean).join(" ")}function g5(t){const[e,r]=t.split("-"),n=[];return e&&n.push(e),r&&n.push(r),n}const y5=t=>{var e,r,n,i,a,o,l,u,d;const{invert:p,toast:f,unstyled:g,interacting:v,setHeights:x,visibleToasts:_,heights:b,index:k,toasts:A,expanded:O,removeToast:C,defaultRichColors:E,closeButton:T,style:P,cancelButtonStyle:R,actionButtonStyle:I,className:Y="",descriptionClassName:W="",duration:B,position:X,gap:K,expandByDefault:U,classNames:G,icons:J,closeButtonAriaLabel:F="Close toast"}=t,[te,q]=$.useState(null),[z,L]=$.useState(null),[Z,se]=$.useState(!1),[le,ve]=$.useState(!1),[qe,xe]=$.useState(!1),[ae,Se]=$.useState(!1),[Me,oe]=$.useState(!1),[tt,Fe]=$.useState(0),[kt,wt]=$.useState(0),Et=$.useRef(f.duration||B||Pk),Sr=$.useRef(null),Bt=$.useRef(null),Rr=k===0,lr=k+1<=_,_t=f.type,kr=f.dismissible!==!1,Ir=f.className||"",ni=f.descriptionClassName||"",Ur=$.useMemo(()=>b.findIndex(M=>M.toastId===f.id)||0,[b,f.id]),ii=$.useMemo(()=>{var M;return(M=f.closeButton)!=null?M:T},[f.closeButton,T]),ai=$.useMemo(()=>f.duration||B||Pk,[f.duration,B]),aa=$.useRef(0),qr=$.useRef(0),oi=$.useRef(0),si=$.useRef(null),[Ho,Ka]=X.split("-"),Wo=$.useMemo(()=>b.reduce((M,ne,de)=>de>=Ur?M:M+ne.height,0),[b,Ur]),oa=r5(),Va=f.invert||p,Rn=_t==="loading";qr.current=$.useMemo(()=>Ur*K+Wo,[Ur,Wo]),$.useEffect(()=>{Et.current=ai},[ai]),$.useEffect(()=>{se(!0)},[]),$.useEffect(()=>{const M=Bt.current;if(M){const ne=M.getBoundingClientRect().height;return wt(ne),x(de=>[{toastId:f.id,height:ne,position:f.position},...de]),()=>x(de=>de.filter(Re=>Re.toastId!==f.id))}},[x,f.id]),$.useLayoutEffect(()=>{if(!Z)return;const M=Bt.current,ne=M.style.height;M.style.height="auto";const de=M.getBoundingClientRect().height;M.style.height=ne,wt(de),x(Re=>Re.find(Ke=>Ke.toastId===f.id)?Re.map(Ke=>Ke.toastId===f.id?{...Ke,height:de}:Ke):[{toastId:f.id,height:de,position:f.position},...Re])},[Z,f.title,f.description,x,f.id,f.jsx,f.action,f.cancel]);const $r=$.useCallback(()=>{ve(!0),Fe(qr.current),x(M=>M.filter(ne=>ne.toastId!==f.id)),setTimeout(()=>{C(f)},m5)},[f,C,x,qr]);$.useEffect(()=>{if(f.promise&&_t==="loading"||f.duration===1/0||f.type==="loading")return;let M;return O||v||oa?(()=>{if(oi.current<aa.current){const Re=new Date().getTime()-aa.current;Et.current=Et.current-Re}oi.current=new Date().getTime()})():(()=>{Et.current!==1/0&&(aa.current=new Date().getTime(),M=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),$r()},Et.current))})(),()=>clearTimeout(M)},[O,v,f,_t,oa,$r]),$.useEffect(()=>{f.delete&&($r(),f.onDismiss==null||f.onDismiss.call(f,f))},[$r,f.delete]);function sa(){var M;if(J!=null&&J.loading){var ne;return $.createElement("div",{className:mi(G==null?void 0:G.loader,f==null||(ne=f.classNames)==null?void 0:ne.loader,"sonner-loader"),"data-visible":_t==="loading"},J.loading)}return $.createElement(YD,{className:mi(G==null?void 0:G.loader,f==null||(M=f.classNames)==null?void 0:M.loader),visible:_t==="loading"})}const li=f.icon||(J==null?void 0:J[_t])||VD(_t);var hn,pn;return $.createElement("li",{tabIndex:0,ref:Bt,className:mi(Y,Ir,G==null?void 0:G.toast,f==null||(e=f.classNames)==null?void 0:e.toast,G==null?void 0:G.default,G==null?void 0:G[_t],f==null||(r=f.classNames)==null?void 0:r[_t]),"data-sonner-toast":"","data-rich-colors":(hn=f.richColors)!=null?hn:E,"data-styled":!(f.jsx||f.unstyled||g),"data-mounted":Z,"data-promise":!!f.promise,"data-swiped":Me,"data-removed":le,"data-visible":lr,"data-y-position":Ho,"data-x-position":Ka,"data-index":k,"data-front":Rr,"data-swiping":qe,"data-dismissible":kr,"data-type":_t,"data-invert":Va,"data-swipe-out":ae,"data-swipe-direction":z,"data-expanded":!!(O||U&&Z),"data-testid":f.testId,style:{"--index":k,"--toasts-before":k,"--z-index":A.length-k,"--offset":`${le?tt:qr.current}px`,"--initial-height":U?"auto":`${kt}px`,...P,...f.style},onDragEnd:()=>{xe(!1),q(null),si.current=null},onPointerDown:M=>{M.button!==2&&(Rn||!kr||(Sr.current=new Date,Fe(qr.current),M.target.setPointerCapture(M.pointerId),M.target.tagName!=="BUTTON"&&(xe(!0),si.current={x:M.clientX,y:M.clientY})))},onPointerUp:()=>{var M,ne,de;if(ae||!kr)return;si.current=null;const Re=Number(((M=Bt.current)==null?void 0:M.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ht=Number(((ne=Bt.current)==null?void 0:ne.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ke=new Date().getTime()-((de=Sr.current)==null?void 0:de.getTime()),ye=te==="x"?Re:ht,we=Math.abs(ye)/Ke;if(Math.abs(ye)>=p5||we>.11){Fe(qr.current),f.onDismiss==null||f.onDismiss.call(f,f),L(te==="x"?Re>0?"right":"left":ht>0?"down":"up"),$r(),Se(!0);return}else{var Ce,ct;(Ce=Bt.current)==null||Ce.style.setProperty("--swipe-amount-x","0px"),(ct=Bt.current)==null||ct.style.setProperty("--swipe-amount-y","0px")}oe(!1),xe(!1),q(null)},onPointerMove:M=>{var ne,de,Re;if(!si.current||!kr||((ne=window.getSelection())==null?void 0:ne.toString().length)>0)return;const Ke=M.clientY-si.current.y,ye=M.clientX-si.current.x;var we;const Ce=(we=t.swipeDirections)!=null?we:g5(X);!te&&(Math.abs(ye)>1||Math.abs(Ke)>1)&&q(Math.abs(ye)>Math.abs(Ke)?"x":"y");let ct={x:0,y:0};const gt=cr=>1/(1.5+Math.abs(cr)/20);if(te==="y"){if(Ce.includes("top")||Ce.includes("bottom"))if(Ce.includes("top")&&Ke<0||Ce.includes("bottom")&&Ke>0)ct.y=Ke;else{const cr=Ke*gt(Ke);ct.y=Math.abs(cr)<Math.abs(Ke)?cr:Ke}}else if(te==="x"&&(Ce.includes("left")||Ce.includes("right")))if(Ce.includes("left")&&ye<0||Ce.includes("right")&&ye>0)ct.x=ye;else{const cr=ye*gt(ye);ct.x=Math.abs(cr)<Math.abs(ye)?cr:ye}(Math.abs(ct.x)>0||Math.abs(ct.y)>0)&&oe(!0),(de=Bt.current)==null||de.style.setProperty("--swipe-amount-x",`${ct.x}px`),(Re=Bt.current)==null||Re.style.setProperty("--swipe-amount-y",`${ct.y}px`)}},ii&&!f.jsx&&_t!=="loading"?$.createElement("button",{"aria-label":F,"data-disabled":Rn,"data-close-button":!0,onClick:Rn||!kr?()=>{}:()=>{$r(),f.onDismiss==null||f.onDismiss.call(f,f)},className:mi(G==null?void 0:G.closeButton,f==null||(n=f.classNames)==null?void 0:n.closeButton)},(pn=J==null?void 0:J.close)!=null?pn:t5):null,(_t||f.icon||f.promise)&&f.icon!==null&&((J==null?void 0:J[_t])!==null||f.icon)?$.createElement("div",{"data-icon":"",className:mi(G==null?void 0:G.icon,f==null||(i=f.classNames)==null?void 0:i.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||sa():null,f.type!=="loading"?li:null):null,$.createElement("div",{"data-content":"",className:mi(G==null?void 0:G.content,f==null||(a=f.classNames)==null?void 0:a.content)},$.createElement("div",{"data-title":"",className:mi(G==null?void 0:G.title,f==null||(o=f.classNames)==null?void 0:o.title)},f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title),f.description?$.createElement("div",{"data-description":"",className:mi(W,ni,G==null?void 0:G.description,f==null||(l=f.classNames)==null?void 0:l.description)},typeof f.description=="function"?f.description():f.description):null),$.isValidElement(f.cancel)?f.cancel:f.cancel&&Zd(f.cancel)?$.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||R,onClick:M=>{Zd(f.cancel)&&kr&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,M),$r())},className:mi(G==null?void 0:G.cancelButton,f==null||(u=f.classNames)==null?void 0:u.cancelButton)},f.cancel.label):null,$.isValidElement(f.action)?f.action:f.action&&Zd(f.action)?$.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||I,onClick:M=>{Zd(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,M),!M.defaultPrevented&&$r())},className:mi(G==null?void 0:G.actionButton,f==null||(d=f.classNames)==null?void 0:d.actionButton)},f.action.label):null)};function Nk(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function v5(t,e){const r={};return[t,e].forEach((n,i)=>{const a=i===1,o=a?"--mobile-offset":"--offset",l=a?d5:u5;function u(d){["top","right","bottom","left"].forEach(p=>{r[`${o}-${p}`]=typeof d=="number"?`${d}px`:d})}typeof n=="number"||typeof n=="string"?u(n):typeof n=="object"?["top","right","bottom","left"].forEach(d=>{n[d]===void 0?r[`${o}-${d}`]=l:r[`${o}-${d}`]=typeof n[d]=="number"?`${n[d]}px`:n[d]}):u(l)}),r}const b5=$.forwardRef(function(e,r){const{id:n,invert:i,position:a="bottom-right",hotkey:o=["altKey","KeyT"],expand:l,closeButton:u,className:d,offset:p,mobileOffset:f,theme:g="light",richColors:v,duration:x,style:_,visibleToasts:b=c5,toastOptions:k,dir:A=Nk(),gap:O=h5,icons:C,containerAriaLabel:E="Notifications"}=e,[T,P]=$.useState([]),R=$.useMemo(()=>n?T.filter(Z=>Z.toasterId===n):T.filter(Z=>!Z.toasterId),[T,n]),I=$.useMemo(()=>Array.from(new Set([a].concat(R.filter(Z=>Z.position).map(Z=>Z.position)))),[R,a]),[Y,W]=$.useState([]),[B,X]=$.useState(!1),[K,U]=$.useState(!1),[G,J]=$.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),F=$.useRef(null),te=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),q=$.useRef(null),z=$.useRef(!1),L=$.useCallback(Z=>{P(se=>{var le;return(le=se.find(ve=>ve.id===Z.id))!=null&&le.delete||Yr.dismiss(Z.id),se.filter(({id:ve})=>ve!==Z.id)})},[]);return $.useEffect(()=>Yr.subscribe(Z=>{if(Z.dismiss){requestAnimationFrame(()=>{P(se=>se.map(le=>le.id===Z.id?{...le,delete:!0}:le))});return}setTimeout(()=>{GD.flushSync(()=>{P(se=>{const le=se.findIndex(ve=>ve.id===Z.id);return le!==-1?[...se.slice(0,le),{...se[le],...Z},...se.slice(le+1)]:[Z,...se]})})})}),[T]),$.useEffect(()=>{if(g!=="system"){J(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?J("dark"):J("light")),typeof window>"u")return;const Z=window.matchMedia("(prefers-color-scheme: dark)");try{Z.addEventListener("change",({matches:se})=>{J(se?"dark":"light")})}catch{Z.addListener(({matches:le})=>{try{J(le?"dark":"light")}catch(ve){console.error(ve)}})}},[g]),$.useEffect(()=>{T.length<=1&&X(!1)},[T]),$.useEffect(()=>{const Z=se=>{var le;if(o.every(xe=>se[xe]||se.code===xe)){var qe;X(!0),(qe=F.current)==null||qe.focus()}se.code==="Escape"&&(document.activeElement===F.current||(le=F.current)!=null&&le.contains(document.activeElement))&&X(!1)};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[o]),$.useEffect(()=>{if(F.current)return()=>{q.current&&(q.current.focus({preventScroll:!0}),q.current=null,z.current=!1)}},[F.current]),$.createElement("section",{ref:r,"aria-label":`${E} ${te}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},I.map((Z,se)=>{var le;const[ve,qe]=Z.split("-");return R.length?$.createElement("ol",{key:Z,dir:A==="auto"?Nk():A,tabIndex:-1,ref:F,className:d,"data-sonner-toaster":!0,"data-sonner-theme":G,"data-y-position":ve,"data-x-position":qe,style:{"--front-toast-height":`${((le=Y[0])==null?void 0:le.height)||0}px`,"--width":`${f5}px`,"--gap":`${O}px`,..._,...v5(p,f)},onBlur:xe=>{z.current&&!xe.currentTarget.contains(xe.relatedTarget)&&(z.current=!1,q.current&&(q.current.focus({preventScroll:!0}),q.current=null))},onFocus:xe=>{xe.target instanceof HTMLElement&&xe.target.dataset.dismissible==="false"||z.current||(z.current=!0,q.current=xe.relatedTarget)},onMouseEnter:()=>X(!0),onMouseMove:()=>X(!0),onMouseLeave:()=>{K||X(!1)},onDragEnd:()=>X(!1),onPointerDown:xe=>{xe.target instanceof HTMLElement&&xe.target.dataset.dismissible==="false"||U(!0)},onPointerUp:()=>U(!1)},R.filter(xe=>!xe.position&&se===0||xe.position===Z).map((xe,ae)=>{var Se,Me;return $.createElement(y5,{key:xe.id,icons:C,index:ae,toast:xe,defaultRichColors:v,duration:(Se=k==null?void 0:k.duration)!=null?Se:x,className:k==null?void 0:k.className,descriptionClassName:k==null?void 0:k.descriptionClassName,invert:i,visibleToasts:b,closeButton:(Me=k==null?void 0:k.closeButton)!=null?Me:u,interacting:K,position:Z,style:k==null?void 0:k.style,unstyled:k==null?void 0:k.unstyled,classNames:k==null?void 0:k.classNames,cancelButtonStyle:k==null?void 0:k.cancelButtonStyle,actionButtonStyle:k==null?void 0:k.actionButtonStyle,closeButtonAriaLabel:k==null?void 0:k.closeButtonAriaLabel,removeToast:L,toasts:R.filter(oe=>oe.position==xe.position),heights:Y.filter(oe=>oe.position==xe.position),setHeights:W,expandByDefault:l,gap:O,expanded:B,swipeDirections:e.swipeDirections})})):null}))}),x5="M147.692 55C178.28 55.0001 203.077 79.7968 203.077 110.385C203.077 140.089 179.692 164.331 150.327 165.706C126.508 171.901 108.924 193.549 108.924 219.308C108.924 222.879 109.261 226.372 109.907 229.755C109.903 229.756 109.898 229.755 109.894 229.756C110.468 232.955 110.77 236.25 110.77 239.615C110.77 242.98 110.468 246.274 109.894 249.474C109.898 249.474 109.903 249.475 109.907 249.476C109.261 252.859 108.924 256.351 108.924 259.923C108.924 285.68 126.507 307.329 150.325 313.524C179.691 314.899 203.077 339.14 203.077 368.846C203.077 399.434 178.28 424.23 147.692 424.23C117.104 424.23 92.3076 399.434 92.3076 368.846C92.3076 364.539 92.7986 360.348 93.7285 356.324C94.007 354.075 94.1543 351.785 94.1543 349.461C94.1541 321.662 73.6718 298.647 46.9756 294.682C46.9934 294.579 47.0138 294.477 47.0322 294.374C20.4072 290.347 2.80541e-05 267.364 0 239.615C0 211.866 20.4071 188.883 47.0322 184.855C47.0139 184.753 46.9934 184.651 46.9756 184.549C73.6719 180.584 94.1542 157.569 94.1543 129.77C94.1543 127.445 94.0063 125.154 93.7275 122.904C92.7979 118.881 92.3076 114.69 92.3076 110.385C92.3076 79.7967 117.104 55 147.692 55ZM332.308 55C362.896 55 387.692 79.7967 387.692 110.385C387.692 115.136 387.093 119.747 385.968 124.147C385.781 125.996 385.683 127.872 385.683 129.77C385.683 157.569 406.165 180.584 432.861 184.549C432.845 184.643 432.826 184.738 432.809 184.832C459.511 188.792 480 211.811 480 239.615C480 267.419 459.511 290.438 432.809 294.397C432.826 294.492 432.845 294.587 432.861 294.682C406.165 298.647 385.683 321.661 385.683 349.461C385.683 351.358 385.781 353.233 385.968 355.081C387.093 359.482 387.692 364.094 387.692 368.846C387.692 399.434 362.896 424.23 332.308 424.23C301.72 424.23 276.923 399.434 276.923 368.846C276.923 364.537 277.414 360.344 278.345 356.318C278.622 354.071 278.77 351.783 278.77 349.461C278.769 321.661 258.287 298.647 231.591 294.682C231.609 294.579 231.629 294.477 231.647 294.374C205.022 290.347 184.615 267.364 184.615 239.615C184.615 209.027 209.412 184.23 240 184.23C270.588 184.231 295.385 209.027 295.385 239.615C295.385 242.98 295.084 246.274 294.509 249.474C294.513 249.474 294.518 249.475 294.522 249.476C293.877 252.859 293.539 256.351 293.539 259.923C293.539 284.692 309.798 305.661 332.226 312.744C354.653 305.661 370.913 284.692 370.913 259.923C370.913 256.351 370.576 252.859 369.93 249.476C369.987 249.467 370.044 249.46 370.102 249.451C369.529 246.259 369.23 242.972 369.23 239.615C369.23 236.259 369.528 232.971 370.101 229.779C370.044 229.771 369.986 229.764 369.93 229.756C370.576 226.372 370.913 222.879 370.913 219.308C370.913 193.537 353.312 171.881 329.476 165.697C300.204 164.223 276.923 140.023 276.923 110.385C276.923 79.7967 301.72 55 332.308 55Z";function Ra({height:t=32}){const e=Math.round(t*1);return y.jsxs("svg",{width:e,height:t,viewBox:"0 0 480 480",fill:"none","aria-hidden":!0,children:[y.jsx("path",{d:x5,fill:"url(#io-grad)"}),y.jsx("defs",{children:y.jsxs("linearGradient",{id:"io-grad",x1:"0",x2:"450.529",y1:"402",y2:"69.3087",gradientUnits:"userSpaceOnUse",children:[y.jsx("stop",{stopColor:"#D83333"}),y.jsx("stop",{offset:"0.515",stopColor:"#E43A9C"}),y.jsx("stop",{offset:"1",stopColor:"#F041FF"})]})})]})}/**
52
+ * @license lucide-react v0.487.0 - ISC
53
+ *
54
+ * This source code is licensed under the ISC license.
55
+ * See the LICENSE file in the root directory of this source tree.
56
+ */const w5=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_5=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,n)=>n?n.toUpperCase():r.toLowerCase()),Rk=t=>{const e=_5(t);return e.charAt(0).toUpperCase()+e.slice(1)},zP=(...t)=>t.filter((e,r,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===r).join(" ").trim();/**
57
+ * @license lucide-react v0.487.0 - ISC
58
+ *
59
+ * This source code is licensed under the ISC license.
60
+ * See the LICENSE file in the root directory of this source tree.
61
+ */var S5={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
62
+ * @license lucide-react v0.487.0 - ISC
63
+ *
64
+ * This source code is licensed under the ISC license.
65
+ * See the LICENSE file in the root directory of this source tree.
66
+ */const k5=N.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:a,iconNode:o,...l},u)=>N.createElement("svg",{ref:u,...S5,width:e,height:e,stroke:t,strokeWidth:n?Number(r)*24/Number(e):r,className:zP("lucide",i),...l},[...o.map(([d,p])=>N.createElement(d,p)),...Array.isArray(a)?a:[a]]));/**
67
+ * @license lucide-react v0.487.0 - ISC
68
+ *
69
+ * This source code is licensed under the ISC license.
70
+ * See the LICENSE file in the root directory of this source tree.
71
+ */const Ue=(t,e)=>{const r=N.forwardRef(({className:n,...i},a)=>N.createElement(k5,{ref:a,iconNode:e,className:zP(`lucide-${w5(Rk(t))}`,`lucide-${t}`,n),...i}));return r.displayName=Rk(t),r};/**
72
+ * @license lucide-react v0.487.0 - ISC
73
+ *
74
+ * This source code is licensed under the ISC license.
75
+ * See the LICENSE file in the root directory of this source tree.
76
+ */const E5=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Kh=Ue("activity",E5);/**
77
+ * @license lucide-react v0.487.0 - ISC
78
+ *
79
+ * This source code is licensed under the ISC license.
80
+ * See the LICENSE file in the root directory of this source tree.
81
+ */const O5=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],A5=Ue("bell",O5);/**
82
+ * @license lucide-react v0.487.0 - ISC
83
+ *
84
+ * This source code is licensed under the ISC license.
85
+ * See the LICENSE file in the root directory of this source tree.
86
+ */const T5=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],BP=Ue("book-open",T5);/**
87
+ * @license lucide-react v0.487.0 - ISC
88
+ *
89
+ * This source code is licensed under the ISC license.
90
+ * See the LICENSE file in the root directory of this source tree.
91
+ */const C5=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],UP=Ue("bot",C5);/**
92
+ * @license lucide-react v0.487.0 - ISC
93
+ *
94
+ * This source code is licensed under the ISC license.
95
+ * See the LICENSE file in the root directory of this source tree.
96
+ */const j5=[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]],P5=Ue("bug",j5);/**
97
+ * @license lucide-react v0.487.0 - ISC
98
+ *
99
+ * This source code is licensed under the ISC license.
100
+ * See the LICENSE file in the root directory of this source tree.
101
+ */const N5=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],R5=Ue("calendar",N5);/**
102
+ * @license lucide-react v0.487.0 - ISC
103
+ *
104
+ * This source code is licensed under the ISC license.
105
+ * See the LICENSE file in the root directory of this source tree.
106
+ */const I5=[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]],$5=Ue("chart-no-axes-column",I5);/**
107
+ * @license lucide-react v0.487.0 - ISC
108
+ *
109
+ * This source code is licensed under the ISC license.
110
+ * See the LICENSE file in the root directory of this source tree.
111
+ */const M5=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],L5=Ue("chevron-down",M5);/**
112
+ * @license lucide-react v0.487.0 - ISC
113
+ *
114
+ * This source code is licensed under the ISC license.
115
+ * See the LICENSE file in the root directory of this source tree.
116
+ */const D5=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Cu=Ue("chevron-left",D5);/**
117
+ * @license lucide-react v0.487.0 - ISC
118
+ *
119
+ * This source code is licensed under the ISC license.
120
+ * See the LICENSE file in the root directory of this source tree.
121
+ */const z5=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Pw=Ue("chevron-right",z5);/**
122
+ * @license lucide-react v0.487.0 - ISC
123
+ *
124
+ * This source code is licensed under the ISC license.
125
+ * See the LICENSE file in the root directory of this source tree.
126
+ */const B5=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],U5=Ue("circle-check-big",B5);/**
127
+ * @license lucide-react v0.487.0 - ISC
128
+ *
129
+ * This source code is licensed under the ISC license.
130
+ * See the LICENSE file in the root directory of this source tree.
131
+ */const q5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],F5=Ue("circle-x",q5);/**
132
+ * @license lucide-react v0.487.0 - ISC
133
+ *
134
+ * This source code is licensed under the ISC license.
135
+ * See the LICENSE file in the root directory of this source tree.
136
+ */const H5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],W5=Ue("clock",H5);/**
137
+ * @license lucide-react v0.487.0 - ISC
138
+ *
139
+ * This source code is licensed under the ISC license.
140
+ * See the LICENSE file in the root directory of this source tree.
141
+ */const G5=[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]],K5=Ue("cpu",G5);/**
142
+ * @license lucide-react v0.487.0 - ISC
143
+ *
144
+ * This source code is licensed under the ISC license.
145
+ * See the LICENSE file in the root directory of this source tree.
146
+ */const V5=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],qP=Ue("crown",V5);/**
147
+ * @license lucide-react v0.487.0 - ISC
148
+ *
149
+ * This source code is licensed under the ISC license.
150
+ * See the LICENSE file in the root directory of this source tree.
151
+ */const X5=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],Y5=Ue("download",X5);/**
152
+ * @license lucide-react v0.487.0 - ISC
153
+ *
154
+ * This source code is licensed under the ISC license.
155
+ * See the LICENSE file in the root directory of this source tree.
156
+ */const J5=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],FP=Ue("external-link",J5);/**
157
+ * @license lucide-react v0.487.0 - ISC
158
+ *
159
+ * This source code is licensed under the ISC license.
160
+ * See the LICENSE file in the root directory of this source tree.
161
+ */const Z5=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Q5=Ue("eye-off",Z5);/**
162
+ * @license lucide-react v0.487.0 - ISC
163
+ *
164
+ * This source code is licensed under the ISC license.
165
+ * See the LICENSE file in the root directory of this source tree.
166
+ */const e4=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Ib=Ue("eye",e4);/**
167
+ * @license lucide-react v0.487.0 - ISC
168
+ *
169
+ * This source code is licensed under the ISC license.
170
+ * See the LICENSE file in the root directory of this source tree.
171
+ */const t4=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],r4=Ue("file-text",t4);/**
172
+ * @license lucide-react v0.487.0 - ISC
173
+ *
174
+ * This source code is licensed under the ISC license.
175
+ * See the LICENSE file in the root directory of this source tree.
176
+ */const n4=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],i4=Ue("folder-open",n4);/**
177
+ * @license lucide-react v0.487.0 - ISC
178
+ *
179
+ * This source code is licensed under the ISC license.
180
+ * See the LICENSE file in the root directory of this source tree.
181
+ */const a4=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],o4=Ue("folder",a4);/**
182
+ * @license lucide-react v0.487.0 - ISC
183
+ *
184
+ * This source code is licensed under the ISC license.
185
+ * See the LICENSE file in the root directory of this source tree.
186
+ */const s4=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],l4=Ue("github",s4);/**
187
+ * @license lucide-react v0.487.0 - ISC
188
+ *
189
+ * This source code is licensed under the ISC license.
190
+ * See the LICENSE file in the root directory of this source tree.
191
+ */const c4=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],u4=Ue("hash",c4);/**
192
+ * @license lucide-react v0.487.0 - ISC
193
+ *
194
+ * This source code is licensed under the ISC license.
195
+ * See the LICENSE file in the root directory of this source tree.
196
+ */const d4=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],$b=Ue("inbox",d4);/**
197
+ * @license lucide-react v0.487.0 - ISC
198
+ *
199
+ * This source code is licensed under the ISC license.
200
+ * See the LICENSE file in the root directory of this source tree.
201
+ */const f4=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],h4=Ue("info",f4);/**
202
+ * @license lucide-react v0.487.0 - ISC
203
+ *
204
+ * This source code is licensed under the ISC license.
205
+ * See the LICENSE file in the root directory of this source tree.
206
+ */const p4=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],As=Ue("loader-circle",p4);/**
207
+ * @license lucide-react v0.487.0 - ISC
208
+ *
209
+ * This source code is licensed under the ISC license.
210
+ * See the LICENSE file in the root directory of this source tree.
211
+ */const m4=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],HP=Ue("loader",m4);/**
212
+ * @license lucide-react v0.487.0 - ISC
213
+ *
214
+ * This source code is licensed under the ISC license.
215
+ * See the LICENSE file in the root directory of this source tree.
216
+ */const g4=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],y4=Ue("log-out",g4);/**
217
+ * @license lucide-react v0.487.0 - ISC
218
+ *
219
+ * This source code is licensed under the ISC license.
220
+ * See the LICENSE file in the root directory of this source tree.
221
+ */const v4=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],b4=Ue("message-circle",v4);/**
222
+ * @license lucide-react v0.487.0 - ISC
223
+ *
224
+ * This source code is licensed under the ISC license.
225
+ * See the LICENSE file in the root directory of this source tree.
226
+ */const x4=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],WP=Ue("message-square",x4);/**
227
+ * @license lucide-react v0.487.0 - ISC
228
+ *
229
+ * This source code is licensed under the ISC license.
230
+ * See the LICENSE file in the root directory of this source tree.
231
+ */const w4=[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]],GP=Ue("paperclip",w4);/**
232
+ * @license lucide-react v0.487.0 - ISC
233
+ *
234
+ * This source code is licensed under the ISC license.
235
+ * See the LICENSE file in the root directory of this source tree.
236
+ */const _4=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],S4=Ue("pause",_4);/**
237
+ * @license lucide-react v0.487.0 - ISC
238
+ *
239
+ * This source code is licensed under the ISC license.
240
+ * See the LICENSE file in the root directory of this source tree.
241
+ */const k4=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],E4=Ue("pen",k4);/**
242
+ * @license lucide-react v0.487.0 - ISC
243
+ *
244
+ * This source code is licensed under the ISC license.
245
+ * See the LICENSE file in the root directory of this source tree.
246
+ */const O4=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Mb=Ue("pencil",O4);/**
247
+ * @license lucide-react v0.487.0 - ISC
248
+ *
249
+ * This source code is licensed under the ISC license.
250
+ * See the LICENSE file in the root directory of this source tree.
251
+ */const A4=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],T4=Ue("play",A4);/**
252
+ * @license lucide-react v0.487.0 - ISC
253
+ *
254
+ * This source code is licensed under the ISC license.
255
+ * See the LICENSE file in the root directory of this source tree.
256
+ */const C4=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],KP=Ue("plus",C4);/**
257
+ * @license lucide-react v0.487.0 - ISC
258
+ *
259
+ * This source code is licensed under the ISC license.
260
+ * See the LICENSE file in the root directory of this source tree.
261
+ */const j4=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Nw=Ue("save",j4);/**
262
+ * @license lucide-react v0.487.0 - ISC
263
+ *
264
+ * This source code is licensed under the ISC license.
265
+ * See the LICENSE file in the root directory of this source tree.
266
+ */const P4=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],N4=Ue("scroll-text",P4);/**
267
+ * @license lucide-react v0.487.0 - ISC
268
+ *
269
+ * This source code is licensed under the ISC license.
270
+ * See the LICENSE file in the root directory of this source tree.
271
+ */const R4=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],VP=Ue("search",R4);/**
272
+ * @license lucide-react v0.487.0 - ISC
273
+ *
274
+ * This source code is licensed under the ISC license.
275
+ * See the LICENSE file in the root directory of this source tree.
276
+ */const I4=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],XP=Ue("send",I4);/**
277
+ * @license lucide-react v0.487.0 - ISC
278
+ *
279
+ * This source code is licensed under the ISC license.
280
+ * See the LICENSE file in the root directory of this source tree.
281
+ */const $4=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],M4=Ue("settings",$4);/**
282
+ * @license lucide-react v0.487.0 - ISC
283
+ *
284
+ * This source code is licensed under the ISC license.
285
+ * See the LICENSE file in the root directory of this source tree.
286
+ */const L4=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]],D4=Ue("sparkles",L4);/**
287
+ * @license lucide-react v0.487.0 - ISC
288
+ *
289
+ * This source code is licensed under the ISC license.
290
+ * See the LICENSE file in the root directory of this source tree.
291
+ */const z4=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Vh=Ue("square",z4);/**
292
+ * @license lucide-react v0.487.0 - ISC
293
+ *
294
+ * This source code is licensed under the ISC license.
295
+ * See the LICENSE file in the root directory of this source tree.
296
+ */const B4=[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]],U4=Ue("terminal",B4);/**
297
+ * @license lucide-react v0.487.0 - ISC
298
+ *
299
+ * This source code is licensed under the ISC license.
300
+ * See the LICENSE file in the root directory of this source tree.
301
+ */const q4=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],Ms=Ue("trash-2",q4);/**
302
+ * @license lucide-react v0.487.0 - ISC
303
+ *
304
+ * This source code is licensed under the ISC license.
305
+ * See the LICENSE file in the root directory of this source tree.
306
+ */const F4=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],H4=Ue("triangle-alert",F4);/**
307
+ * @license lucide-react v0.487.0 - ISC
308
+ *
309
+ * This source code is licensed under the ISC license.
310
+ * See the LICENSE file in the root directory of this source tree.
311
+ */const W4=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]],Xh=Ue("users",W4);/**
312
+ * @license lucide-react v0.487.0 - ISC
313
+ *
314
+ * This source code is licensed under the ISC license.
315
+ * See the LICENSE file in the root directory of this source tree.
316
+ */const G4=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],YP=Ue("x",G4);/**
317
+ * @license lucide-react v0.487.0 - ISC
318
+ *
319
+ * This source code is licensed under the ISC license.
320
+ * See the LICENSE file in the root directory of this source tree.
321
+ */const K4=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Lb=Ue("zap",K4),V4="/api";let Ao=null;function X4(t){Ao=t}function JP(){return(Ao==null?void 0:Ao())??null}async function cc(t,e){const r=Ao==null?void 0:Ao(),n={"Content-Type":"application/json",...e==null?void 0:e.headers};r&&(n.Authorization=`Bearer ${r}`);const i=await fetch(`${V4}${t}`,{...e,headers:n});if(!i.ok){const a=await i.json().catch(()=>({error:i.statusText}));throw new Error(a.error??`Request failed: ${i.status}`)}return i.json()}const et={get:t=>cc(t),post:(t,e)=>cc(t,{method:"POST",body:e?JSON.stringify(e):void 0}),patch:(t,e)=>cc(t,{method:"PATCH",body:JSON.stringify(e)}),put:(t,e)=>cc(t,{method:"PUT",body:JSON.stringify(e)}),delete:t=>cc(t,{method:"DELETE"})},ZP=N.createContext({timezone:"UTC"});function Y4({children:t}){const[e,r]=N.useState("UTC");return N.useEffect(()=>{et.get("/config").then(n=>{n.config.timezone&&r(n.config.timezone)}).catch(()=>{})},[]),y.jsx(ZP.Provider,{value:{timezone:e},children:t})}function ml(){return N.useContext(ZP).timezone}const J4=[{label:"UTC",value:"UTC"},{label:"Eastern Time (US)",value:"America/New_York"},{label:"Central Time (US)",value:"America/Chicago"},{label:"Mountain Time (US)",value:"America/Denver"},{label:"Pacific Time (US)",value:"America/Los_Angeles"},{label:"Alaska Time",value:"America/Anchorage"},{label:"Hawaii Time",value:"Pacific/Honolulu"},{label:"London (GMT/BST)",value:"Europe/London"},{label:"Central European",value:"Europe/Berlin"},{label:"Eastern European",value:"Europe/Bucharest"},{label:"India (IST)",value:"Asia/Kolkata"},{label:"China (CST)",value:"Asia/Shanghai"},{label:"Japan (JST)",value:"Asia/Tokyo"},{label:"Australia Eastern",value:"Australia/Sydney"},{label:"New Zealand",value:"Pacific/Auckland"},{label:"São Paulo",value:"America/Sao_Paulo"}];function Db(t,e,r){if(!t)return"";try{return new Date(t).toLocaleString("en-US",{timeZone:e,month:"short",day:"numeric",hour:"numeric",minute:"2-digit",...r})}catch{return new Date(t).toLocaleString()}}function Rw(t,e,r){if(!t)return"";try{return new Date(t).toLocaleTimeString("en-US",{timeZone:e,hour:"numeric",minute:"2-digit",...r})}catch{return new Date(t).toLocaleTimeString()}}function Z4(t,e,r){if(!t)return"";try{return new Date(t).toLocaleDateString("en-US",{timeZone:e,month:"short",day:"numeric",...r})}catch{return new Date(t).toLocaleDateString()}}let jf=[];const Pf=new Set;function Q4(t){jf=[t,...jf].slice(0,50);for(const e of Pf)e()}function ez(){jf=[];for(const t of Pf)t()}function tz(){const[,t]=N.useState(0);return N.useEffect(()=>{const e=()=>t(r=>r+1);return Pf.add(e),()=>{Pf.delete(e)}},[]),jf}function rz(){const[t,e]=N.useState(!1),r=tz(),n=N.useRef(null),[i,a]=N.useState(0),o=ml(),l=r.length-i;N.useEffect(()=>{function d(p){n.current&&!n.current.contains(p.target)&&e(!1)}if(t)return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[t]);function u(){e(!t),t||a(r.length)}return y.jsxs("div",{className:"relative",ref:n,children:[y.jsxs("button",{type:"button",onClick:u,className:"relative p-2 rounded-xl hover:bg-white/[0.05] text-zinc-600 hover:text-zinc-300 transition-colors cursor-pointer",title:"Notifications",children:[y.jsx(A5,{className:"w-3.5 h-3.5"}),l>0&&y.jsx("span",{className:"absolute top-1 right-1 w-2 h-2 rounded-full bg-[#E43A9C]"})]}),t&&y.jsxs("div",{className:"absolute right-0 top-full mt-2 w-80 max-h-96 overflow-y-auto rounded-xl border border-white/[0.07] bg-[#1a1a1a] shadow-2xl z-50",children:[y.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-white/[0.07]",children:[y.jsx("span",{className:"text-xs font-mono text-zinc-300",children:"Notifications"}),r.length>0&&y.jsx("button",{type:"button",onClick:ez,className:"text-[10px] font-mono text-zinc-500 hover:text-zinc-300 cursor-pointer",children:"Clear all"})]}),r.length===0?y.jsx("div",{className:"px-4 py-8 text-center text-zinc-600 text-xs font-mono",children:"No notifications yet"}):y.jsx("div",{className:"divide-y divide-white/[0.04]",children:r.map(d=>y.jsxs("div",{className:"px-4 py-3 hover:bg-white/[0.03]",children:[y.jsx("p",{className:"text-xs text-zinc-300 leading-relaxed",children:d.message}),y.jsx("p",{className:"text-[10px] text-zinc-600 font-mono mt-1",children:Rw(d.timestamp,o)})]},d.id))})]})]})}const nz=10,iz=1e3,az=3e4;function oz(t={}){const[e,r]=N.useState(!1),[n,i]=N.useState(null),[a,o]=N.useState("connecting"),l=N.useRef(null),u=N.useRef(t),d=N.useRef(0),p=N.useRef(null),f=N.useRef(!0),g=N.useRef(!1);u.current=t,N.useEffect(()=>{let _=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`;const b=JP();b&&(_+=`?token=${encodeURIComponent(b)}`);const k=()=>{if(!f.current)return;o(d.current>0?"reconnecting":"connecting");const A=new WebSocket(_);l.current=A,A.onopen=()=>{const O=d.current>0||g.current;d.current=0,g.current=!1,r(!0),o("connected"),O&&console.info("WebSocket reconnected")},A.onmessage=O=>{var C,E,T,P,R,I,Y,W;try{const B=JSON.parse(O.data);switch(B.type){case"connected":i(B.connectionId??null);break;case"delta":(E=(C=u.current).onDelta)==null||E.call(C,B.content??"");break;case"message":(P=(T=u.current).onMessage)==null||P.call(T,B.content??"");break;case"event":(I=(R=u.current).onEvent)==null||I.call(R,B);break;case"error":(W=(Y=u.current).onError)==null||W.call(Y,B.content??"Unknown error");break}}catch{}},A.onclose=()=>{if(l.current=null,r(!1),i(null),!f.current)return;if(g.current||(g.current=!0,console.warn("WebSocket disconnected; attempting to reconnect")),d.current>=nz){o("disconnected");return}const O=Math.min(iz*2**d.current,az);d.current+=1,o("reconnecting"),p.current=setTimeout(k,O)},A.onerror=()=>{A.close()}};return k(),()=>{var A;f.current=!1,p.current&&clearTimeout(p.current),(A=l.current)==null||A.close()}},[]);const v=N.useCallback((x,_="web")=>{var b;((b=l.current)==null?void 0:b.readyState)===WebSocket.OPEN&&l.current.send(JSON.stringify({type:"message",content:x,source:_}))},[]);return{connected:e,connectionId:n,connectionState:a,sendMessage:v}}const QP=N.createContext(null);function sz({children:t}){const[e,r]=N.useState([]),[n,i]=N.useState(""),[a,o]=N.useState(!1),[l,u]=N.useState(!1),d=N.useRef(!1);N.useEffect(()=>{d.current||(d.current=!0,et.get("/conversations?limit=50").then(O=>{r(O.messages.map(C=>({...C,timestamp:C.timestamp})))}).catch(()=>{}))},[]);const p=N.useCallback(O=>{u(!1),o(!0),i(O)},[]),f=N.useCallback(O=>{u(!1),o(!1),i(""),r(C=>[...C,{id:crypto.randomUUID(),role:"assistant",content:O,timestamp:new Date().toISOString()}])},[]),g=N.useCallback(O=>{var C,E,T;O.notification&&Q4({id:((C=O.event)==null?void 0:C.id)??crypto.randomUUID(),message:O.notification,timestamp:((E=O.event)==null?void 0:E.timestamp)??new Date().toISOString(),eventType:((T=O.event)==null?void 0:T.type)??"unknown"})},[]),v=N.useCallback(()=>{u(!1),o(!1),i("")},[]),{connected:x,sendMessage:_}=oz({onDelta:p,onMessage:f,onEvent:g,onError:v}),b=N.useCallback(O=>{u(!0),_(O)},[_]),k=N.useCallback(O=>{r(C=>[...C,O])},[]),A=N.useCallback(async(O,C)=>{const E=new FormData;E.append("file",O),E.append("messageId",C);const T=JP();if(!(await fetch("/api/attachments",{method:"POST",body:E,headers:T?{Authorization:`Bearer ${T}`}:void 0})).ok)throw new Error("Failed to upload attachment")},[]);return y.jsx(QP.Provider,{value:{messages:e,streaming:n,isStreaming:a,isThinking:l,connected:x,sendChatMessage:b,addUserMessage:k,uploadAttachment:A},children:t})}function eN(){const t=N.useContext(QP);if(!t)throw new Error("useChat must be used within a ChatProvider");return t}function Iw(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Lo=Iw();function tN(t){Lo=t}var wo={exec:()=>null};function ys(t){let e=[];return r=>{let n=Math.max(0,Math.min(3,r-1)),i=e[n];return i||(i=t(n),e[n]=i),i}}function ot(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(i,a)=>{let o=typeof a=="string"?a:a.source;return o=o.replace(Nr.caret,"$1"),r=r.replace(i,o),n},getRegex:()=>new RegExp(r,e)};return n}var lz=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),Nr={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:ys(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:ys(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:ys(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:ys(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:ys(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:ys(t=>new RegExp(`^ {0,${t}}>`))},cz=/^(?:[ \t]*(?:\n|$))+/,uz=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,dz=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ju=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,fz=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,$w=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,rN=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,nN=ot(rN).replace(/bull/g,$w).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),hz=ot(rN).replace(/bull/g,$w).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Mw=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,pz=/^[^\n]+/,Lw=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,mz=ot(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Lw).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),gz=ot(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,$w).getRegex(),Yh="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Dw=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,yz=ot("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Dw).replace("tag",Yh).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),iN=ot(Mw).replace("hr",ju).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Yh).getRegex(),vz=ot(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",iN).getRegex(),zw={blockquote:vz,code:uz,def:mz,fences:dz,heading:fz,hr:ju,html:yz,lheading:nN,list:gz,newline:cz,paragraph:iN,table:wo,text:pz},Ik=ot("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ju).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Yh).getRegex(),bz={...zw,lheading:hz,table:Ik,paragraph:ot(Mw).replace("hr",ju).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ik).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Yh).getRegex()},xz={...zw,html:ot(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Dw).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:wo,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ot(Mw).replace("hr",ju).replace("heading",` *#{1,6} *[^
322
+ ]`).replace("lheading",nN).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},wz=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,_z=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,aN=/^( {2,}|\\)\n(?!\s*$)/,Sz=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,gl=/[\p{P}\p{S}]/u,Jh=/[\s\p{P}\p{S}]/u,Bw=/[^\s\p{P}\p{S}]/u,kz=ot(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Jh).getRegex(),oN=/(?!~)[\p{P}\p{S}]/u,Ez=/(?!~)[\s\p{P}\p{S}]/u,Oz=/(?:[^\s\p{P}\p{S}]|~)/u,Az=ot(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",lz?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),sN=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Tz=ot(sN,"u").replace(/punct/g,gl).getRegex(),Cz=ot(sN,"u").replace(/punct/g,oN).getRegex(),lN="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",jz=ot(lN,"gu").replace(/notPunctSpace/g,Bw).replace(/punctSpace/g,Jh).replace(/punct/g,gl).getRegex(),Pz=ot(lN,"gu").replace(/notPunctSpace/g,Oz).replace(/punctSpace/g,Ez).replace(/punct/g,oN).getRegex(),Nz=ot("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Bw).replace(/punctSpace/g,Jh).replace(/punct/g,gl).getRegex(),Rz=ot(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,gl).getRegex(),Iz="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",$z=ot(Iz,"gu").replace(/notPunctSpace/g,Bw).replace(/punctSpace/g,Jh).replace(/punct/g,gl).getRegex(),Mz=ot(/\\(punct)/,"gu").replace(/punct/g,gl).getRegex(),Lz=ot(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Dz=ot(Dw).replace("(?:-->|$)","-->").getRegex(),zz=ot("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Dz).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Nf=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Bz=ot(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Nf).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),cN=ot(/^!?\[(label)\]\[(ref)\]/).replace("label",Nf).replace("ref",Lw).getRegex(),uN=ot(/^!?\[(ref)\](?:\[\])?/).replace("ref",Lw).getRegex(),Uz=ot("reflink|nolink(?!\\()","g").replace("reflink",cN).replace("nolink",uN).getRegex(),$k=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Uw={_backpedal:wo,anyPunctuation:Mz,autolink:Lz,blockSkip:Az,br:aN,code:_z,del:wo,delLDelim:wo,delRDelim:wo,emStrongLDelim:Tz,emStrongRDelimAst:jz,emStrongRDelimUnd:Nz,escape:wz,link:Bz,nolink:uN,punctuation:kz,reflink:cN,reflinkSearch:Uz,tag:zz,text:Sz,url:wo},qz={...Uw,link:ot(/^!?\[(label)\]\((.*?)\)/).replace("label",Nf).getRegex(),reflink:ot(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Nf).getRegex()},zb={...Uw,emStrongRDelimAst:Pz,emStrongLDelim:Cz,delLDelim:Rz,delRDelim:$z,url:ot(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",$k).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ot(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",$k).getRegex()},Fz={...zb,br:ot(aN).replace("{2,}","*").getRegex(),text:ot(zb.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Qd={normal:zw,gfm:bz,pedantic:xz},uc={normal:Uw,gfm:zb,breaks:Fz,pedantic:qz},Hz={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Mk=t=>Hz[t];function vi(t,e){if(e){if(Nr.escapeTest.test(t))return t.replace(Nr.escapeReplace,Mk)}else if(Nr.escapeTestNoEncode.test(t))return t.replace(Nr.escapeReplaceNoEncode,Mk);return t}function Lk(t){try{t=encodeURI(t).replace(Nr.percentDecode,"%")}catch{return null}return t}function Dk(t,e){var a;let r=t.replace(Nr.findPipe,(o,l,u)=>{let d=!1,p=l;for(;--p>=0&&u[p]==="\\";)d=!d;return d?"|":" |"}),n=r.split(Nr.splitPipe),i=0;if(n[0].trim()||n.shift(),n.length>0&&!((a=n.at(-1))!=null&&a.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(Nr.slashPipe,"|");return n}function Aa(t,e,r){let n=t.length;if(n===0)return"";let i=0;for(;i<n&&t.charAt(n-i-1)===e;)i++;return t.slice(0,n-i)}function zk(t){let e=t.split(`
323
+ `),r=e.length-1;for(;r>=0&&Nr.blankLine.test(e[r]);)r--;return e.length-r<=2?t:e.slice(0,r+1).join(`
324
+ `)}function Wz(t,e){if(t.indexOf(e[1])===-1)return-1;let r=0;for(let n=0;n<t.length;n++)if(t[n]==="\\")n++;else if(t[n]===e[0])r++;else if(t[n]===e[1]&&(r--,r<0))return n;return r>0?-2:-1}function Gz(t,e=0){let r=e,n="";for(let i of t)if(i===" "){let a=4-r%4;n+=" ".repeat(a),r+=a}else n+=i,r++;return n}function Bk(t,e,r,n,i){let a=e.href,o=e.title||null,l=t[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;let u={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:o,text:l,tokens:n.inlineTokens(l)};return n.state.inLink=!1,u}function Kz(t,e,r){let n=t.match(r.other.indentCodeCompensation);if(n===null)return e;let i=n[1];return e.split(`
325
+ `).map(a=>{let o=a.match(r.other.beginningSpace);if(o===null)return a;let[l]=o;return l.length>=i.length?a.slice(i.length):a}).join(`
326
+ `)}var Rf=class{constructor(t){bt(this,"options");bt(this,"rules");bt(this,"lexer");this.options=t||Lo}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let r=this.options.pedantic?e[0]:zk(e[0]),n=r.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r,codeBlockStyle:"indented",text:n}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let r=e[0],n=Kz(r,e[3]||"",this.rules);return{type:"code",raw:r,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:n}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let r=e[2].trim();if(this.rules.other.endingHash.test(r)){let n=Aa(r,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(r=n.trim())}return{type:"heading",raw:Aa(e[0],`
327
+ `),depth:e[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:Aa(e[0],`
328
+ `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let r=Aa(e[0],`
329
+ `).split(`
330
+ `),n="",i="",a=[];for(;r.length>0;){let o=!1,l=[],u;for(u=0;u<r.length;u++)if(this.rules.other.blockquoteStart.test(r[u]))l.push(r[u]),o=!0;else if(!o)l.push(r[u]);else break;r=r.slice(u);let d=l.join(`
331
+ `),p=d.replace(this.rules.other.blockquoteSetextReplace,`
332
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
333
+ ${d}`:d,i=i?`${i}
334
+ ${p}`:p;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,a,!0),this.lexer.state.top=f,r.length===0)break;let g=a.at(-1);if((g==null?void 0:g.type)==="code")break;if((g==null?void 0:g.type)==="blockquote"){let v=g,x=v.raw+`
335
+ `+r.join(`
336
+ `),_=this.blockquote(x);a[a.length-1]=_,n=n.substring(0,n.length-v.raw.length)+_.raw,i=i.substring(0,i.length-v.text.length)+_.text;break}else if((g==null?void 0:g.type)==="list"){let v=g,x=v.raw+`
337
+ `+r.join(`
338
+ `),_=this.list(x);a[a.length-1]=_,n=n.substring(0,n.length-g.raw.length)+_.raw,i=i.substring(0,i.length-v.raw.length)+_.raw,r=x.substring(a.at(-1).raw.length).split(`
339
+ `);continue}}return{type:"blockquote",raw:n,tokens:a,text:i}}}list(t){let e=this.rules.block.list.exec(t);if(e){let r=e[1].trim(),n=r.length>1,i={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");let a=this.rules.other.listItemRegex(r),o=!1;for(;t;){let u=!1,d="",p="";if(!(e=a.exec(t))||this.rules.block.hr.test(t))break;d=e[0],t=t.substring(d.length);let f=Gz(e[2].split(`
340
+ `,1)[0],e[1].length),g=t.split(`
341
+ `,1)[0],v=!f.trim(),x=0;if(this.options.pedantic?(x=2,p=f.trimStart()):v?x=e[1].length+1:(x=f.search(this.rules.other.nonSpaceChar),x=x>4?1:x,p=f.slice(x),x+=e[1].length),v&&this.rules.other.blankLine.test(g)&&(d+=g+`
342
+ `,t=t.substring(g.length+1),u=!0),!u){let _=this.rules.other.nextBulletRegex(x),b=this.rules.other.hrRegex(x),k=this.rules.other.fencesBeginRegex(x),A=this.rules.other.headingBeginRegex(x),O=this.rules.other.htmlBeginRegex(x),C=this.rules.other.blockquoteBeginRegex(x);for(;t;){let E=t.split(`
343
+ `,1)[0],T;if(g=E,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting," "),T=g):T=g.replace(this.rules.other.tabCharGlobal," "),k.test(g)||A.test(g)||O.test(g)||C.test(g)||_.test(g)||b.test(g))break;if(T.search(this.rules.other.nonSpaceChar)>=x||!g.trim())p+=`
344
+ `+T.slice(x);else{if(v||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||k.test(f)||A.test(f)||b.test(f))break;p+=`
345
+ `+g}v=!g.trim(),d+=E+`
346
+ `,t=t.substring(E.length+1),f=T.slice(x)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(o=!0)),i.items.push({type:"list_item",raw:d,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),i.raw+=d}let l=i.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let u of i.items){this.lexer.state.top=!1,u.tokens=this.lexer.blockTokens(u.text,[]);let d=u.tokens[0];if(u.task&&((d==null?void 0:d.type)==="text"||(d==null?void 0:d.type)==="paragraph")){u.text=u.text.replace(this.rules.other.listReplaceTask,""),d.raw=d.raw.replace(this.rules.other.listReplaceTask,""),d.text=d.text.replace(this.rules.other.listReplaceTask,"");for(let f=this.lexer.inlineQueue.length-1;f>=0;f--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[f].src)){this.lexer.inlineQueue[f].src=this.lexer.inlineQueue[f].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(u.raw);if(p){let f={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};u.checked=f.checked,i.loose?u.tokens[0]&&["paragraph","text"].includes(u.tokens[0].type)&&"tokens"in u.tokens[0]&&u.tokens[0].tokens?(u.tokens[0].raw=f.raw+u.tokens[0].raw,u.tokens[0].text=f.raw+u.tokens[0].text,u.tokens[0].tokens.unshift(f)):u.tokens.unshift({type:"paragraph",raw:f.raw,text:f.raw,tokens:[f]}):u.tokens.unshift(f)}}else u.task&&(u.task=!1);if(!i.loose){let p=u.tokens.filter(g=>g.type==="space"),f=p.length>0&&p.some(g=>this.rules.other.anyLine.test(g.raw));i.loose=f}}if(i.loose)for(let u of i.items){u.loose=!0;for(let d of u.tokens)d.type==="text"&&(d.type="paragraph")}return i}}html(t){let e=this.rules.block.html.exec(t);if(e){let r=zk(e[0]);return{type:"html",block:!0,raw:r,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:r}}}def(t){let e=this.rules.block.def.exec(t);if(e){let r=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:r,raw:Aa(e[0],`
347
+ `),href:n,title:i}}}table(t){var o;let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let r=Dk(e[1]),n=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(o=e[3])!=null&&o.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
348
+ `):[],a={type:"table",raw:Aa(e[0],`
349
+ `),header:[],align:[],rows:[]};if(r.length===n.length){for(let l of n)this.rules.other.tableAlignRight.test(l)?a.align.push("right"):this.rules.other.tableAlignCenter.test(l)?a.align.push("center"):this.rules.other.tableAlignLeft.test(l)?a.align.push("left"):a.align.push(null);for(let l=0;l<r.length;l++)a.header.push({text:r[l],tokens:this.lexer.inline(r[l]),header:!0,align:a.align[l]});for(let l of i)a.rows.push(Dk(l,a.header.length).map((u,d)=>({text:u,tokens:this.lexer.inline(u),header:!1,align:a.align[d]})));return a}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let r=e[1].trim();return{type:"heading",raw:Aa(e[0],`
350
+ `),depth:e[2].charAt(0)==="="?1:2,text:r,tokens:this.lexer.inline(r)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let r=e[1].charAt(e[1].length-1)===`
351
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let a=Aa(r.slice(0,-1),"\\");if((r.length-a.length)%2===0)return}else{let a=Wz(e[2],"()");if(a===-2)return;if(a>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+a;e[2]=e[2].substring(0,a),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let n=e[2],i="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(n);a&&(n=a[1],i=a[3])}else i=e[3]?e[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?n=n.slice(1):n=n.slice(1,-1)),Bk(e,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){let n=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[n.toLowerCase()];if(!i){let a=r[0].charAt(0);return{type:"text",raw:a,text:a}}return Bk(r,i,r[0],this.lexer,this.rules)}}emStrong(t,e,r=""){let n=this.rules.inline.emStrongLDelim.exec(t);if(!(!n||!n[1]&&!n[2]&&!n[3]&&!n[4]||n[4]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[3])||!r||this.rules.inline.punctuation.exec(r))){let i=[...n[0]].length-1,a,o,l=i,u=0,d=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*t.length+i);(n=d.exec(e))!==null;){if(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!a)continue;if(o=[...a].length,n[3]||n[4]){l+=o;continue}else if((n[5]||n[6])&&i%3&&!((i+o)%3)){u+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+u);let p=[...n[0]][0].length,f=t.slice(0,i+n.index+p+o);if(Math.min(i,o)%2){let v=f.slice(1,-1);return{type:"em",raw:f,text:v,tokens:this.lexer.inlineTokens(v)}}let g=f.slice(2,-2);return{type:"strong",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let r=e[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(r),i=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return n&&i&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:e[0],text:r}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,r=""){let n=this.rules.inline.delLDelim.exec(t);if(n&&(!n[1]||!r||this.rules.inline.punctuation.exec(r))){let i=[...n[0]].length-1,a,o,l=i,u=this.rules.inline.delRDelim;for(u.lastIndex=0,e=e.slice(-1*t.length+i);(n=u.exec(e))!==null;){if(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!a||(o=[...a].length,o!==i))continue;if(n[3]||n[4]){l+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l);let d=[...n[0]][0].length,p=t.slice(0,i+n.index+d+o),f=p.slice(i,-i);return{type:"del",raw:p,text:f,tokens:this.lexer.inlineTokens(f)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let r,n;return e[2]==="@"?(r=e[1],n="mailto:"+r):(r=e[1],n=r),{type:"link",raw:e[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}url(t){var r;let e;if(e=this.rules.inline.url.exec(t)){let n,i;if(e[2]==="@")n=e[0],i="mailto:"+n;else{let a;do a=e[0],e[0]=((r=this.rules.inline._backpedal.exec(e[0]))==null?void 0:r[0])??"";while(a!==e[0]);n=e[0],e[1]==="www."?i="http://"+e[0]:i=e[0]}return{type:"link",raw:e[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let r=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:r}}}},Gn=class Bb{constructor(e){bt(this,"tokens");bt(this,"options");bt(this,"state");bt(this,"inlineQueue");bt(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Lo,this.options.tokenizer=this.options.tokenizer||new Rf,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:Nr,block:Qd.normal,inline:uc.normal};this.options.pedantic?(r.block=Qd.pedantic,r.inline=uc.pedantic):this.options.gfm&&(r.block=Qd.gfm,this.options.breaks?r.inline=uc.breaks:r.inline=uc.gfm),this.tokenizer.rules=r}static get rules(){return{block:Qd,inline:uc}}static lex(e,r){return new Bb(r).lex(e)}static lexInline(e,r){return new Bb(r).inlineTokens(e)}lex(e){e=e.replace(Nr.carriageReturn,`
352
+ `),this.blockTokens(e,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let n=this.inlineQueue[r];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],n=!1){var a,o,l;this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(Nr.tabCharGlobal," ").replace(Nr.spaceLine,""));let i=1/0;for(;e;){if(e.length<i)i=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let u;if((o=(a=this.options.extensions)==null?void 0:a.block)!=null&&o.some(p=>(u=p.call({lexer:this},e,r))?(e=e.substring(u.raw.length),r.push(u),!0):!1))continue;if(u=this.tokenizer.space(e)){e=e.substring(u.raw.length);let p=r.at(-1);u.raw.length===1&&p!==void 0?p.raw+=`
353
+ `:r.push(u);continue}if(u=this.tokenizer.code(e)){e=e.substring(u.raw.length);let p=r.at(-1);(p==null?void 0:p.type)==="paragraph"||(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
354
+ `)?"":`
355
+ `)+u.raw,p.text+=`
356
+ `+u.text,this.inlineQueue.at(-1).src=p.text):r.push(u);continue}if(u=this.tokenizer.fences(e)){e=e.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.heading(e)){e=e.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.hr(e)){e=e.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.blockquote(e)){e=e.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.list(e)){e=e.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.html(e)){e=e.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.def(e)){e=e.substring(u.raw.length);let p=r.at(-1);(p==null?void 0:p.type)==="paragraph"||(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
357
+ `)?"":`
358
+ `)+u.raw,p.text+=`
359
+ `+u.raw,this.inlineQueue.at(-1).src=p.text):this.tokens.links[u.tag]||(this.tokens.links[u.tag]={href:u.href,title:u.title},r.push(u));continue}if(u=this.tokenizer.table(e)){e=e.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.lheading(e)){e=e.substring(u.raw.length),r.push(u);continue}let d=e;if((l=this.options.extensions)!=null&&l.startBlock){let p=1/0,f=e.slice(1),g;this.options.extensions.startBlock.forEach(v=>{g=v.call({lexer:this},f),typeof g=="number"&&g>=0&&(p=Math.min(p,g))}),p<1/0&&p>=0&&(d=e.substring(0,p+1))}if(this.state.top&&(u=this.tokenizer.paragraph(d))){let p=r.at(-1);n&&(p==null?void 0:p.type)==="paragraph"?(p.raw+=(p.raw.endsWith(`
360
+ `)?"":`
361
+ `)+u.raw,p.text+=`
362
+ `+u.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):r.push(u),n=d.length!==e.length,e=e.substring(u.raw.length);continue}if(u=this.tokenizer.text(e)){e=e.substring(u.raw.length);let p=r.at(-1);(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
363
+ `)?"":`
364
+ `)+u.raw,p.text+=`
365
+ `+u.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):r.push(u);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var d,p,f,g,v;this.tokenizer.lexer=this;let n=e,i=null;if(this.tokens.links){let x=Object.keys(this.tokens.links);if(x.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)x.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)a=i[2]?i[2].length:0,n=n.slice(0,i.index+a)+"["+"a".repeat(i[0].length-a-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=((p=(d=this.options.hooks)==null?void 0:d.emStrongMask)==null?void 0:p.call({lexer:this},n))??n;let o=!1,l="",u=1/0;for(;e;){if(e.length<u)u=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}o||(l=""),o=!1;let x;if((g=(f=this.options.extensions)==null?void 0:f.inline)!=null&&g.some(b=>(x=b.call({lexer:this},e,r))?(e=e.substring(x.raw.length),r.push(x),!0):!1))continue;if(x=this.tokenizer.escape(e)){e=e.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.tag(e)){e=e.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.link(e)){e=e.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(x.raw.length);let b=r.at(-1);x.type==="text"&&(b==null?void 0:b.type)==="text"?(b.raw+=x.raw,b.text+=x.text):r.push(x);continue}if(x=this.tokenizer.emStrong(e,n,l)){e=e.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.codespan(e)){e=e.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.br(e)){e=e.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.del(e,n,l)){e=e.substring(x.raw.length),r.push(x);continue}if(x=this.tokenizer.autolink(e)){e=e.substring(x.raw.length),r.push(x);continue}if(!this.state.inLink&&(x=this.tokenizer.url(e))){e=e.substring(x.raw.length),r.push(x);continue}let _=e;if((v=this.options.extensions)!=null&&v.startInline){let b=1/0,k=e.slice(1),A;this.options.extensions.startInline.forEach(O=>{A=O.call({lexer:this},k),typeof A=="number"&&A>=0&&(b=Math.min(b,A))}),b<1/0&&b>=0&&(_=e.substring(0,b+1))}if(x=this.tokenizer.inlineText(_)){e=e.substring(x.raw.length),x.raw.slice(-1)!=="_"&&(l=x.raw.slice(-1)),o=!0;let b=r.at(-1);(b==null?void 0:b.type)==="text"?(b.raw+=x.raw,b.text+=x.text):r.push(x);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return r}infiniteLoopError(e){let r="Infinite loop on byte: "+e;if(this.options.silent)console.error(r);else throw new Error(r)}},If=class{constructor(e){bt(this,"options");bt(this,"parser");this.options=e||Lo}space(e){return""}code({text:e,lang:r,escaped:n}){var o;let i=(o=(r||"").match(Nr.notSpaceStart))==null?void 0:o[0],a=e.replace(Nr.endingNewline,"")+`
366
+ `;return i?'<pre><code class="language-'+vi(i)+'">'+(n?a:vi(a,!0))+`</code></pre>
367
+ `:"<pre><code>"+(n?a:vi(a,!0))+`</code></pre>
368
+ `}blockquote({tokens:e}){return`<blockquote>
369
+ ${this.parser.parse(e)}</blockquote>
370
+ `}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:r}){return`<h${r}>${this.parser.parseInline(e)}</h${r}>
371
+ `}hr(e){return`<hr>
372
+ `}list(e){let r=e.ordered,n=e.start,i="";for(let l=0;l<e.items.length;l++){let u=e.items[l];i+=this.listitem(u)}let a=r?"ol":"ul",o=r&&n!==1?' start="'+n+'"':"";return"<"+a+o+`>
373
+ `+i+"</"+a+`>
374
+ `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
375
+ `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
376
+ `}table(e){let r="",n="";for(let a=0;a<e.header.length;a++)n+=this.tablecell(e.header[a]);r+=this.tablerow({text:n});let i="";for(let a=0;a<e.rows.length;a++){let o=e.rows[a];n="";for(let l=0;l<o.length;l++)n+=this.tablecell(o[l]);i+=this.tablerow({text:n})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
377
+ <thead>
378
+ `+r+`</thead>
379
+ `+i+`</table>
380
+ `}tablerow({text:e}){return`<tr>
381
+ ${e}</tr>
382
+ `}tablecell(e){let r=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+r+`</${n}>
383
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${vi(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:r,tokens:n}){let i=this.parser.parseInline(n),a=Lk(e);if(a===null)return i;e=a;let o='<a href="'+e+'"';return r&&(o+=' title="'+vi(r)+'"'),o+=">"+i+"</a>",o}image({href:e,title:r,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let a=Lk(e);if(a===null)return vi(n);e=a;let o=`<img src="${e}" alt="${vi(n)}"`;return r&&(o+=` title="${vi(r)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:vi(e.text)}},qw=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},Kn=class Ub{constructor(e){bt(this,"options");bt(this,"renderer");bt(this,"textRenderer");this.options=e||Lo,this.options.renderer=this.options.renderer||new If,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new qw}static parse(e,r){return new Ub(r).parse(e)}static parseInline(e,r){return new Ub(r).parseInline(e)}parse(e){var n,i;this.renderer.parser=this;let r="";for(let a=0;a<e.length;a++){let o=e[a];if((i=(n=this.options.extensions)==null?void 0:n.renderers)!=null&&i[o.type]){let u=o,d=this.options.extensions.renderers[u.type].call({parser:this},u);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(u.type)){r+=d||"";continue}}let l=o;switch(l.type){case"space":{r+=this.renderer.space(l);break}case"hr":{r+=this.renderer.hr(l);break}case"heading":{r+=this.renderer.heading(l);break}case"code":{r+=this.renderer.code(l);break}case"table":{r+=this.renderer.table(l);break}case"blockquote":{r+=this.renderer.blockquote(l);break}case"list":{r+=this.renderer.list(l);break}case"checkbox":{r+=this.renderer.checkbox(l);break}case"html":{r+=this.renderer.html(l);break}case"def":{r+=this.renderer.def(l);break}case"paragraph":{r+=this.renderer.paragraph(l);break}case"text":{r+=this.renderer.text(l);break}default:{let u='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}parseInline(e,r=this.renderer){var i,a;this.renderer.parser=this;let n="";for(let o=0;o<e.length;o++){let l=e[o];if((a=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&a[l.type]){let d=this.options.extensions.renderers[l.type].call({parser:this},l);if(d!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){n+=d||"";continue}}let u=l;switch(u.type){case"escape":{n+=r.text(u);break}case"html":{n+=r.html(u);break}case"link":{n+=r.link(u);break}case"image":{n+=r.image(u);break}case"checkbox":{n+=r.checkbox(u);break}case"strong":{n+=r.strong(u);break}case"em":{n+=r.em(u);break}case"codespan":{n+=r.codespan(u);break}case"br":{n+=r.br(u);break}case"del":{n+=r.del(u);break}case"text":{n+=r.text(u);break}default:{let d='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return n}},kf,_c=(kf=class{constructor(e){bt(this,"options");bt(this,"block");this.options=e||Lo}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?Gn.lex:Gn.lexInline}provideParser(e=this.block){return e?Kn.parse:Kn.parseInline}},bt(kf,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),bt(kf,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),kf),Vz=class{constructor(...t){bt(this,"defaults",Iw());bt(this,"options",this.setOptions);bt(this,"parse",this.parseMarkdown(!0));bt(this,"parseInline",this.parseMarkdown(!1));bt(this,"Parser",Kn);bt(this,"Renderer",If);bt(this,"TextRenderer",qw);bt(this,"Lexer",Gn);bt(this,"Tokenizer",Rf);bt(this,"Hooks",_c);this.use(...t)}walkTokens(t,e){var n,i;let r=[];for(let a of t)switch(r=r.concat(e.call(this,a)),a.type){case"table":{let o=a;for(let l of o.header)r=r.concat(this.walkTokens(l.tokens,e));for(let l of o.rows)for(let u of l)r=r.concat(this.walkTokens(u.tokens,e));break}case"list":{let o=a;r=r.concat(this.walkTokens(o.items,e));break}default:{let o=a;(i=(n=this.defaults.extensions)==null?void 0:n.childTokens)!=null&&i[o.type]?this.defaults.extensions.childTokens[o.type].forEach(l=>{let u=o[l].flat(1/0);r=r.concat(this.walkTokens(u,e))}):o.tokens&&(r=r.concat(this.walkTokens(o.tokens,e)))}}return r}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let n={...r};if(n.async=this.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let a=e.renderers[i.name];a?e.renderers[i.name]=function(...o){let l=i.renderer.apply(this,o);return l===!1&&(l=a.apply(this,o)),l}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=e[i.level];a?a.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),n.extensions=e),r.renderer){let i=this.defaults.renderer||new If(this.defaults);for(let a in r.renderer){if(!(a in i))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let o=a,l=r.renderer[o],u=i[o];i[o]=(...d)=>{let p=l.apply(i,d);return p===!1&&(p=u.apply(i,d)),p||""}}n.renderer=i}if(r.tokenizer){let i=this.defaults.tokenizer||new Rf(this.defaults);for(let a in r.tokenizer){if(!(a in i))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let o=a,l=r.tokenizer[o],u=i[o];i[o]=(...d)=>{let p=l.apply(i,d);return p===!1&&(p=u.apply(i,d)),p}}n.tokenizer=i}if(r.hooks){let i=this.defaults.hooks||new _c;for(let a in r.hooks){if(!(a in i))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let o=a,l=r.hooks[o],u=i[o];_c.passThroughHooks.has(a)?i[o]=d=>{if(this.defaults.async&&_c.passThroughHooksRespectAsync.has(a))return(async()=>{let f=await l.call(i,d);return u.call(i,f)})();let p=l.call(i,d);return u.call(i,p)}:i[o]=(...d)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(i,d);return f===!1&&(f=await u.apply(i,d)),f})();let p=l.apply(i,d);return p===!1&&(p=u.apply(i,d)),p}}n.hooks=i}if(r.walkTokens){let i=this.defaults.walkTokens,a=r.walkTokens;n.walkTokens=function(o){let l=[];return l.push(a.call(this,o)),i&&(l=l.concat(i.call(this,o))),l}}this.defaults={...this.defaults,...n}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return Gn.lex(t,e??this.defaults)}parser(t,e){return Kn.parse(t,e??this.defaults)}parseMarkdown(t){return(e,r)=>{let n={...r},i={...this.defaults,...n},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&n.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=t),i.async)return(async()=>{let o=i.hooks?await i.hooks.preprocess(e):e,l=await(i.hooks?await i.hooks.provideLexer(t):t?Gn.lex:Gn.lexInline)(o,i),u=i.hooks?await i.hooks.processAllTokens(l):l;i.walkTokens&&await Promise.all(this.walkTokens(u,i.walkTokens));let d=await(i.hooks?await i.hooks.provideParser(t):t?Kn.parse:Kn.parseInline)(u,i);return i.hooks?await i.hooks.postprocess(d):d})().catch(a);try{i.hooks&&(e=i.hooks.preprocess(e));let o=(i.hooks?i.hooks.provideLexer(t):t?Gn.lex:Gn.lexInline)(e,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let l=(i.hooks?i.hooks.provideParser(t):t?Kn.parse:Kn.parseInline)(o,i);return i.hooks&&(l=i.hooks.postprocess(l)),l}catch(o){return a(o)}}}onError(t,e){return r=>{if(r.message+=`
384
+ Please report this to https://github.com/markedjs/marked.`,t){let n="<p>An error occurred:</p><pre>"+vi(r.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(r);throw r}}},Po=new Vz;function nt(t,e){return Po.parse(t,e)}nt.options=nt.setOptions=function(t){return Po.setOptions(t),nt.defaults=Po.defaults,tN(nt.defaults),nt};nt.getDefaults=Iw;nt.defaults=Lo;nt.use=function(...t){return Po.use(...t),nt.defaults=Po.defaults,tN(nt.defaults),nt};nt.walkTokens=function(t,e){return Po.walkTokens(t,e)};nt.parseInline=Po.parseInline;nt.Parser=Kn;nt.parser=Kn.parse;nt.Renderer=If;nt.TextRenderer=qw;nt.Lexer=Gn;nt.lexer=Gn.lex;nt.Tokenizer=Rf;nt.Hooks=_c;nt.parse=nt;nt.options;nt.setOptions;nt.use;nt.walkTokens;nt.parseInline;Kn.parse;Gn.lex;function Xz(){const[t,e]=N.useState(!1),[r,n]=N.useState(""),[i,a]=N.useState(null),o=N.useRef(null),l=N.useRef(null),u=N.useRef(null),{messages:d,streaming:p,isStreaming:f,connected:g,sendChatMessage:v,addUserMessage:x,uploadAttachment:_}=eN(),b=N.useMemo(()=>d.slice(-10),[d]);N.useLayoutEffect(()=>{const C=o.current;C&&(C.scrollTop=C.scrollHeight)},[b,p,f,t]);async function k(){const C=r.trim();if(!C&&!i||f)return;const E=crypto.randomUUID(),T=i==null?void 0:i.name,P=[C,T?`Attachment: ${T}`:""].filter(Boolean).join(`
385
+
386
+ `);x({id:E,role:"user",content:C,timestamp:new Date().toISOString(),attachmentName:T}),n(""),a(null),u.current&&(u.current.value=""),l.current&&(l.current.style.height="auto");try{i&&await _(i,E),v(P),e(!0)}catch{}}function A(C){n(C.target.value),l.current&&(l.current.style.height="auto",l.current.style.height=`${Math.min(l.current.scrollHeight,96)}px`)}function O(C){C.key==="Enter"&&!C.shiftKey&&(C.preventDefault(),k())}return y.jsxs("div",{className:"fixed bottom-5 right-5 z-50 flex flex-col items-end gap-3",children:[t&&y.jsxs("div",{className:"w-[340px] h-[460px] rounded-2xl border border-white/[0.09] shadow-2xl overflow-hidden flex flex-col",style:{background:"#1c1c1c"},children:[y.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-white/[0.07] flex-shrink-0",style:{background:"linear-gradient(135deg, rgba(216,51,51,0.18) 0%, rgba(240,65,255,0.10) 100%)"},children:[y.jsxs("div",{className:"flex items-center gap-2.5",children:[y.jsx(Ra,{height:20}),y.jsx("span",{className:"text-xl text-white tracking-wider leading-none",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"IO"}),y.jsx("span",{className:"text-[10px] font-mono text-zinc-600 mt-0.5",children:"quick chat"})]}),y.jsx("button",{type:"button",onClick:()=>e(!1),className:"p-1 rounded-lg hover:bg-white/[0.07] text-zinc-600 hover:text-zinc-300 transition-colors cursor-pointer",children:y.jsx(YP,{className:"w-3.5 h-3.5"})})]}),y.jsxs("div",{ref:o,className:"flex-1 overflow-y-auto p-3 space-y-2",children:[b.length===0&&!f?y.jsx("div",{className:"h-full flex items-center justify-center text-center px-6",children:y.jsx("p",{className:"text-xs text-zinc-500",children:"Ask IO anything without leaving this page."})}):b.map(C=>y.jsx("div",{className:`flex ${C.role==="user"?"justify-end":"justify-start"}`,title:C.timestamp,children:y.jsxs("div",{className:`max-w-[85%] ${C.role==="user"?"ml-8":"mr-8"}`,children:[C.attachmentName&&y.jsx("div",{className:"mb-1 rounded-xl border border-white/[0.08] bg-[#1e1e1e] px-3 py-2 text-[11px] font-mono text-zinc-400",children:C.attachmentName}),C.content&&y.jsx("div",{className:C.role==="user"?"bg-gradient-to-br from-[#E43A9C] to-[#D83333] rounded-xl px-3 py-2 text-xs text-white whitespace-pre-wrap":"bg-[#2a2a2a] rounded-xl px-3 py-2 text-xs text-zinc-200",children:C.role==="user"?C.content:y.jsx("div",{className:"prose-io [&_*]:text-xs",dangerouslySetInnerHTML:{__html:nt.parse(C.content)}})})]})},C.id)),f&&y.jsx("div",{className:"flex justify-start",children:y.jsx("div",{className:"max-w-[85%] mr-8 bg-[#2a2a2a] rounded-xl px-3 py-2 text-xs text-zinc-200",children:p?y.jsx("div",{className:"prose-io [&_*]:text-xs",dangerouslySetInnerHTML:{__html:nt.parse(p)}}):y.jsx("div",{className:"flex items-center gap-1.5 py-1",children:[0,120,240].map(C=>y.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#E43A9C] animate-bounce",style:{animationDelay:`${C}ms`}},C))})})})]}),y.jsx("div",{className:"p-2.5 border-t border-white/[0.06]",children:y.jsxs("div",{className:"bg-[#252525] border border-white/[0.08] rounded-xl overflow-hidden transition-colors focus-within:border-[#E43A9C]/30",children:[y.jsx("input",{ref:u,type:"file",className:"hidden",onChange:C=>{var E;return a(((E=C.target.files)==null?void 0:E[0])??null)}}),i&&y.jsxs("div",{className:"px-3 pt-2 text-[10px] font-mono text-zinc-400",children:["Attached: ",i.name]}),y.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-2",children:[y.jsx("button",{type:"button",onClick:()=>{var C;return(C=u.current)==null?void 0:C.click()},className:"p-1 rounded-lg text-zinc-600 hover:text-zinc-300 hover:bg-white/[0.06] transition-colors flex-shrink-0 cursor-pointer",children:y.jsx(GP,{className:"w-3.5 h-3.5"})}),y.jsx("textarea",{ref:l,value:r,onChange:A,onKeyDown:O,placeholder:"Message IO…",rows:1,className:"flex-1 bg-transparent text-xs text-zinc-200 placeholder:text-zinc-700 resize-none focus:outline-none leading-relaxed",style:{minHeight:"18px",maxHeight:"96px",fontFamily:"Inter, sans-serif"}}),y.jsx("button",{type:"button",onClick:()=>void k(),disabled:!r.trim()&&!i||!g&&!f,className:"p-1.5 rounded-lg text-white disabled:opacity-25 disabled:cursor-not-allowed transition-opacity hover:opacity-90 flex-shrink-0 cursor-pointer",style:{background:"linear-gradient(135deg, #D83333, #E43A9C)"},children:f?y.jsx(Vh,{className:"w-3 h-3"}):y.jsx(XP,{className:"w-3 h-3"})})]})]})})]}),y.jsx("button",{type:"button",onClick:()=>e(C=>!C),className:"w-12 h-12 rounded-full primary-btn shadow-lg text-white flex items-center justify-center hover:opacity-95 transition-opacity","aria-label":t?"Close quick chat":"Open quick chat",children:y.jsx(b4,{className:"w-5 h-5"})})]})}function dN(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(r=dN(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function at(){for(var t,e,r=0,n="",i=arguments.length;r<i;r++)(t=arguments[r])&&(e=dN(t))&&(n&&(n+=" "),n+=e);return n}const Yz=(t,e)=>{const r=new Array(t.length+e.length);for(let n=0;n<t.length;n++)r[n]=t[n];for(let n=0;n<e.length;n++)r[t.length+n]=e[n];return r},Jz=(t,e)=>({classGroupId:t,validator:e}),fN=(t=new Map,e=null,r)=>({nextPart:t,validators:e,classGroupId:r}),$f="-",Uk=[],Zz="arbitrary..",Qz=t=>{const e=tB(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return eB(o);const l=o.split($f),u=l[0]===""&&l.length>1?1:0;return hN(l,u,e)},getConflictingClassGroupIds:(o,l)=>{if(l){const u=n[o],d=r[o];return u?d?Yz(d,u):u:d||Uk}return r[o]||Uk}}},hN=(t,e,r)=>{if(t.length-e===0)return r.classGroupId;const i=t[e],a=r.nextPart.get(i);if(a){const d=hN(t,e+1,a);if(d)return d}const o=r.validators;if(o===null)return;const l=e===0?t.join($f):t.slice(e).join($f),u=o.length;for(let d=0;d<u;d++){const p=o[d];if(p.validator(l))return p.classGroupId}},eB=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),r=e.indexOf(":"),n=e.slice(0,r);return n?Zz+n:void 0})(),tB=t=>{const{theme:e,classGroups:r}=t;return rB(r,e)},rB=(t,e)=>{const r=fN();for(const n in t){const i=t[n];Fw(i,r,n,e)}return r},Fw=(t,e,r,n)=>{const i=t.length;for(let a=0;a<i;a++){const o=t[a];nB(o,e,r,n)}},nB=(t,e,r,n)=>{if(typeof t=="string"){iB(t,e,r);return}if(typeof t=="function"){aB(t,e,r,n);return}oB(t,e,r,n)},iB=(t,e,r)=>{const n=t===""?e:pN(e,t);n.classGroupId=r},aB=(t,e,r,n)=>{if(sB(t)){Fw(t(n),e,r,n);return}e.validators===null&&(e.validators=[]),e.validators.push(Jz(r,t))},oB=(t,e,r,n)=>{const i=Object.entries(t),a=i.length;for(let o=0;o<a;o++){const[l,u]=i[o];Fw(u,pN(e,l),r,n)}},pN=(t,e)=>{let r=t;const n=e.split($f),i=n.length;for(let a=0;a<i;a++){const o=n[a];let l=r.nextPart.get(o);l||(l=fN(),r.nextPart.set(o,l)),r=l}return r},sB=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,lB=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=Object.create(null),n=Object.create(null);const i=(a,o)=>{r[a]=o,e++,e>t&&(e=0,n=r,r=Object.create(null))};return{get(a){let o=r[a];if(o!==void 0)return o;if((o=n[a])!==void 0)return i(a,o),o},set(a,o){a in r?r[a]=o:i(a,o)}}},qb="!",qk=":",cB=[],Fk=(t,e,r,n,i)=>({modifiers:t,hasImportantModifier:e,baseClassName:r,maybePostfixModifierPosition:n,isExternal:i}),uB=t=>{const{prefix:e,experimentalParseClassName:r}=t;let n=i=>{const a=[];let o=0,l=0,u=0,d;const p=i.length;for(let _=0;_<p;_++){const b=i[_];if(o===0&&l===0){if(b===qk){a.push(i.slice(u,_)),u=_+1;continue}if(b==="/"){d=_;continue}}b==="["?o++:b==="]"?o--:b==="("?l++:b===")"&&l--}const f=a.length===0?i:i.slice(u);let g=f,v=!1;f.endsWith(qb)?(g=f.slice(0,-1),v=!0):f.startsWith(qb)&&(g=f.slice(1),v=!0);const x=d&&d>u?d-u:void 0;return Fk(a,v,g,x)};if(e){const i=e+qk,a=n;n=o=>o.startsWith(i)?a(o.slice(i.length)):Fk(cB,!1,o,void 0,!0)}if(r){const i=n;n=a=>r({className:a,parseClassName:i})}return n},dB=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((r,n)=>{e.set(r,1e6+n)}),r=>{const n=[];let i=[];for(let a=0;a<r.length;a++){const o=r[a],l=o[0]==="[",u=e.has(o);l||u?(i.length>0&&(i.sort(),n.push(...i),i=[]),n.push(o)):i.push(o)}return i.length>0&&(i.sort(),n.push(...i)),n}},fB=t=>({cache:lB(t.cacheSize),parseClassName:uB(t),sortModifiers:dB(t),postfixLookupClassGroupIds:hB(t),...Qz(t)}),hB=t=>{const e=Object.create(null),r=t.postfixLookupClassGroups;if(r)for(let n=0;n<r.length;n++)e[r[n]]=!0;return e},pB=/\s+/,mB=(t,e)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=e,l=[],u=t.trim().split(pB);let d="";for(let p=u.length-1;p>=0;p-=1){const f=u[p],{isExternal:g,modifiers:v,hasImportantModifier:x,baseClassName:_,maybePostfixModifierPosition:b}=r(f);if(g){d=f+(d.length>0?" "+d:d);continue}let k=!!b,A;if(k){const P=_.substring(0,b);A=n(P);const R=A&&o[A]?n(_):void 0;R&&R!==A&&(A=R,k=!1)}else A=n(_);if(!A){if(!k){d=f+(d.length>0?" "+d:d);continue}if(A=n(_),!A){d=f+(d.length>0?" "+d:d);continue}k=!1}const O=v.length===0?"":v.length===1?v[0]:a(v).join(":"),C=x?O+qb:O,E=C+A;if(l.indexOf(E)>-1)continue;l.push(E);const T=i(A,k);for(let P=0;P<T.length;++P){const R=T[P];l.push(C+R)}d=f+(d.length>0?" "+d:d)}return d},gB=(...t)=>{let e=0,r,n,i="";for(;e<t.length;)(r=t[e++])&&(n=mN(r))&&(i&&(i+=" "),i+=n);return i},mN=t=>{if(typeof t=="string")return t;let e,r="";for(let n=0;n<t.length;n++)t[n]&&(e=mN(t[n]))&&(r&&(r+=" "),r+=e);return r},yB=(t,...e)=>{let r,n,i,a;const o=u=>{const d=e.reduce((p,f)=>f(p),t());return r=fB(d),n=r.cache.get,i=r.cache.set,a=l,l(u)},l=u=>{const d=n(u);if(d)return d;const p=mB(u,r);return i(u,p),p};return a=o,(...u)=>a(gB(...u))},vB=[],nr=t=>{const e=r=>r[t]||vB;return e.isThemeGetter=!0,e},gN=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,yN=/^\((?:(\w[\w-]*):)?(.+)\)$/i,bB=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,xB=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wB=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,_B=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,SB=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,kB=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ta=t=>bB.test(t),Xe=t=>!!t&&!Number.isNaN(Number(t)),gi=t=>!!t&&Number.isInteger(Number(t)),_g=t=>t.endsWith("%")&&Xe(t.slice(0,-1)),Mi=t=>xB.test(t),vN=()=>!0,EB=t=>wB.test(t)&&!_B.test(t),Hw=()=>!1,OB=t=>SB.test(t),AB=t=>kB.test(t),TB=t=>!ke(t)&&!Ae(t),CB=t=>t.startsWith("@container")&&(t[10]==="/"&&t[11]!==void 0||t[11]==="s"&&t[16]!==void 0&&t.startsWith("-size/",10)||t[11]==="n"&&t[18]!==void 0&&t.startsWith("-normal/",10)),jB=t=>Ua(t,wN,Hw),ke=t=>gN.test(t),po=t=>Ua(t,_N,EB),Hk=t=>Ua(t,DB,Xe),PB=t=>Ua(t,kN,vN),NB=t=>Ua(t,SN,Hw),Wk=t=>Ua(t,bN,Hw),RB=t=>Ua(t,xN,AB),ef=t=>Ua(t,EN,OB),Ae=t=>yN.test(t),dc=t=>Do(t,_N),IB=t=>Do(t,SN),Gk=t=>Do(t,bN),$B=t=>Do(t,wN),MB=t=>Do(t,xN),tf=t=>Do(t,EN,!0),LB=t=>Do(t,kN,!0),Ua=(t,e,r)=>{const n=gN.exec(t);return n?n[1]?e(n[1]):r(n[2]):!1},Do=(t,e,r=!1)=>{const n=yN.exec(t);return n?n[1]?e(n[1]):r:!1},bN=t=>t==="position"||t==="percentage",xN=t=>t==="image"||t==="url",wN=t=>t==="length"||t==="size"||t==="bg-size",_N=t=>t==="length",DB=t=>t==="number",SN=t=>t==="family-name",kN=t=>t==="number"||t==="weight",EN=t=>t==="shadow",zB=()=>{const t=nr("color"),e=nr("font"),r=nr("text"),n=nr("font-weight"),i=nr("tracking"),a=nr("leading"),o=nr("breakpoint"),l=nr("container"),u=nr("spacing"),d=nr("radius"),p=nr("shadow"),f=nr("inset-shadow"),g=nr("text-shadow"),v=nr("drop-shadow"),x=nr("blur"),_=nr("perspective"),b=nr("aspect"),k=nr("ease"),A=nr("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...C(),Ae,ke],T=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto","contain","none"],R=()=>[Ae,ke,u],I=()=>[Ta,"full","auto",...R()],Y=()=>[gi,"none","subgrid",Ae,ke],W=()=>["auto",{span:["full",gi,Ae,ke]},gi,Ae,ke],B=()=>[gi,"auto",Ae,ke],X=()=>["auto","min","max","fr",Ae,ke],K=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],U=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...R()],J=()=>[Ta,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],F=()=>[Ta,"screen","full","dvw","lvw","svw","min","max","fit",...R()],te=()=>[Ta,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],q=()=>[t,Ae,ke],z=()=>[...C(),Gk,Wk,{position:[Ae,ke]}],L=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Z=()=>["auto","cover","contain",$B,jB,{size:[Ae,ke]}],se=()=>[_g,dc,po],le=()=>["","none","full",d,Ae,ke],ve=()=>["",Xe,dc,po],qe=()=>["solid","dashed","dotted","double"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>[Xe,_g,Gk,Wk],Se=()=>["","none",x,Ae,ke],Me=()=>["none",Xe,Ae,ke],oe=()=>["none",Xe,Ae,ke],tt=()=>[Xe,Ae,ke],Fe=()=>[Ta,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Mi],breakpoint:[Mi],color:[vN],container:[Mi],"drop-shadow":[Mi],ease:["in","out","in-out"],font:[TB],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Mi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Mi],shadow:[Mi],spacing:["px",Xe],text:[Mi],"text-shadow":[Mi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ta,ke,Ae,b]}],container:["container"],"container-type":[{"@container":["","normal","size",Ae,ke]}],"container-named":[CB],columns:[{columns:[Xe,ke,Ae,l]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:E()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{"inset-s":I(),start:I()}],end:[{"inset-e":I(),end:I()}],"inset-bs":[{"inset-bs":I()}],"inset-be":[{"inset-be":I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[gi,"auto",Ae,ke]}],basis:[{basis:[Ta,"full","auto",l,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Xe,Ta,"auto","initial","none",ke]}],grow:[{grow:["",Xe,Ae,ke]}],shrink:[{shrink:["",Xe,Ae,ke]}],order:[{order:[gi,"first","last","none",Ae,ke]}],"grid-cols":[{"grid-cols":Y()}],"col-start-end":[{col:W()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":Y()}],"row-start-end":[{row:W()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":X()}],"auto-rows":[{"auto-rows":X()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...K(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...K()]}],"align-items":[{items:[...U(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...U(),{baseline:["","last"]}]}],"place-content":[{"place-content":K()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pbs:[{pbs:R()}],pbe:[{pbe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mbs:[{mbs:G()}],mbe:[{mbe:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:J()}],"inline-size":[{inline:["auto",...F()]}],"min-inline-size":[{"min-inline":["auto",...F()]}],"max-inline-size":[{"max-inline":["none",...F()]}],"block-size":[{block:["auto",...te()]}],"min-block-size":[{"min-block":["auto",...te()]}],"max-block-size":[{"max-block":["none",...te()]}],w:[{w:[l,"screen",...J()]}],"min-w":[{"min-w":[l,"screen","none",...J()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...J()]}],h:[{h:["screen","lh",...J()]}],"min-h":[{"min-h":["screen","lh","none",...J()]}],"max-h":[{"max-h":["screen","lh",...J()]}],"font-size":[{text:["base",r,dc,po]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,LB,PB]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",_g,ke]}],"font-family":[{font:[IB,NB,e]}],"font-features":[{"font-features":[ke]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,Ae,ke]}],"line-clamp":[{"line-clamp":[Xe,"none",Ae,Hk]}],leading:[{leading:[a,...R()]}],"list-image":[{"list-image":["none",Ae,ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ae,ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:q()}],"text-color":[{text:q()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...qe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Xe,"from-font","auto",Ae,po]}],"text-decoration-color":[{decoration:q()}],"underline-offset":[{"underline-offset":[Xe,"auto",Ae,ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"tab-size":[{tab:[gi,Ae,ke]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ae,ke]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ae,ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:z()}],"bg-repeat":[{bg:L()}],"bg-size":[{bg:Z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},gi,Ae,ke],radial:["",Ae,ke],conic:[gi,Ae,ke]},MB,RB]}],"bg-color":[{bg:q()}],"gradient-from-pos":[{from:se()}],"gradient-via-pos":[{via:se()}],"gradient-to-pos":[{to:se()}],"gradient-from":[{from:q()}],"gradient-via":[{via:q()}],"gradient-to":[{to:q()}],rounded:[{rounded:le()}],"rounded-s":[{"rounded-s":le()}],"rounded-e":[{"rounded-e":le()}],"rounded-t":[{"rounded-t":le()}],"rounded-r":[{"rounded-r":le()}],"rounded-b":[{"rounded-b":le()}],"rounded-l":[{"rounded-l":le()}],"rounded-ss":[{"rounded-ss":le()}],"rounded-se":[{"rounded-se":le()}],"rounded-ee":[{"rounded-ee":le()}],"rounded-es":[{"rounded-es":le()}],"rounded-tl":[{"rounded-tl":le()}],"rounded-tr":[{"rounded-tr":le()}],"rounded-br":[{"rounded-br":le()}],"rounded-bl":[{"rounded-bl":le()}],"border-w":[{border:ve()}],"border-w-x":[{"border-x":ve()}],"border-w-y":[{"border-y":ve()}],"border-w-s":[{"border-s":ve()}],"border-w-e":[{"border-e":ve()}],"border-w-bs":[{"border-bs":ve()}],"border-w-be":[{"border-be":ve()}],"border-w-t":[{"border-t":ve()}],"border-w-r":[{"border-r":ve()}],"border-w-b":[{"border-b":ve()}],"border-w-l":[{"border-l":ve()}],"divide-x":[{"divide-x":ve()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ve()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...qe(),"hidden","none"]}],"divide-style":[{divide:[...qe(),"hidden","none"]}],"border-color":[{border:q()}],"border-color-x":[{"border-x":q()}],"border-color-y":[{"border-y":q()}],"border-color-s":[{"border-s":q()}],"border-color-e":[{"border-e":q()}],"border-color-bs":[{"border-bs":q()}],"border-color-be":[{"border-be":q()}],"border-color-t":[{"border-t":q()}],"border-color-r":[{"border-r":q()}],"border-color-b":[{"border-b":q()}],"border-color-l":[{"border-l":q()}],"divide-color":[{divide:q()}],"outline-style":[{outline:[...qe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Xe,Ae,ke]}],"outline-w":[{outline:["",Xe,dc,po]}],"outline-color":[{outline:q()}],shadow:[{shadow:["","none",p,tf,ef]}],"shadow-color":[{shadow:q()}],"inset-shadow":[{"inset-shadow":["none",f,tf,ef]}],"inset-shadow-color":[{"inset-shadow":q()}],"ring-w":[{ring:ve()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:q()}],"ring-offset-w":[{"ring-offset":[Xe,po]}],"ring-offset-color":[{"ring-offset":q()}],"inset-ring-w":[{"inset-ring":ve()}],"inset-ring-color":[{"inset-ring":q()}],"text-shadow":[{"text-shadow":["none",g,tf,ef]}],"text-shadow-color":[{"text-shadow":q()}],opacity:[{opacity:[Xe,Ae,ke]}],"mix-blend":[{"mix-blend":[...xe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":xe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Xe]}],"mask-image-linear-from-pos":[{"mask-linear-from":ae()}],"mask-image-linear-to-pos":[{"mask-linear-to":ae()}],"mask-image-linear-from-color":[{"mask-linear-from":q()}],"mask-image-linear-to-color":[{"mask-linear-to":q()}],"mask-image-t-from-pos":[{"mask-t-from":ae()}],"mask-image-t-to-pos":[{"mask-t-to":ae()}],"mask-image-t-from-color":[{"mask-t-from":q()}],"mask-image-t-to-color":[{"mask-t-to":q()}],"mask-image-r-from-pos":[{"mask-r-from":ae()}],"mask-image-r-to-pos":[{"mask-r-to":ae()}],"mask-image-r-from-color":[{"mask-r-from":q()}],"mask-image-r-to-color":[{"mask-r-to":q()}],"mask-image-b-from-pos":[{"mask-b-from":ae()}],"mask-image-b-to-pos":[{"mask-b-to":ae()}],"mask-image-b-from-color":[{"mask-b-from":q()}],"mask-image-b-to-color":[{"mask-b-to":q()}],"mask-image-l-from-pos":[{"mask-l-from":ae()}],"mask-image-l-to-pos":[{"mask-l-to":ae()}],"mask-image-l-from-color":[{"mask-l-from":q()}],"mask-image-l-to-color":[{"mask-l-to":q()}],"mask-image-x-from-pos":[{"mask-x-from":ae()}],"mask-image-x-to-pos":[{"mask-x-to":ae()}],"mask-image-x-from-color":[{"mask-x-from":q()}],"mask-image-x-to-color":[{"mask-x-to":q()}],"mask-image-y-from-pos":[{"mask-y-from":ae()}],"mask-image-y-to-pos":[{"mask-y-to":ae()}],"mask-image-y-from-color":[{"mask-y-from":q()}],"mask-image-y-to-color":[{"mask-y-to":q()}],"mask-image-radial":[{"mask-radial":[Ae,ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":ae()}],"mask-image-radial-to-pos":[{"mask-radial-to":ae()}],"mask-image-radial-from-color":[{"mask-radial-from":q()}],"mask-image-radial-to-color":[{"mask-radial-to":q()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[Xe]}],"mask-image-conic-from-pos":[{"mask-conic-from":ae()}],"mask-image-conic-to-pos":[{"mask-conic-to":ae()}],"mask-image-conic-from-color":[{"mask-conic-from":q()}],"mask-image-conic-to-color":[{"mask-conic-to":q()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:z()}],"mask-repeat":[{mask:L()}],"mask-size":[{mask:Z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ae,ke]}],filter:[{filter:["","none",Ae,ke]}],blur:[{blur:Se()}],brightness:[{brightness:[Xe,Ae,ke]}],contrast:[{contrast:[Xe,Ae,ke]}],"drop-shadow":[{"drop-shadow":["","none",v,tf,ef]}],"drop-shadow-color":[{"drop-shadow":q()}],grayscale:[{grayscale:["",Xe,Ae,ke]}],"hue-rotate":[{"hue-rotate":[Xe,Ae,ke]}],invert:[{invert:["",Xe,Ae,ke]}],saturate:[{saturate:[Xe,Ae,ke]}],sepia:[{sepia:["",Xe,Ae,ke]}],"backdrop-filter":[{"backdrop-filter":["","none",Ae,ke]}],"backdrop-blur":[{"backdrop-blur":Se()}],"backdrop-brightness":[{"backdrop-brightness":[Xe,Ae,ke]}],"backdrop-contrast":[{"backdrop-contrast":[Xe,Ae,ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Xe,Ae,ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Xe,Ae,ke]}],"backdrop-invert":[{"backdrop-invert":["",Xe,Ae,ke]}],"backdrop-opacity":[{"backdrop-opacity":[Xe,Ae,ke]}],"backdrop-saturate":[{"backdrop-saturate":[Xe,Ae,ke]}],"backdrop-sepia":[{"backdrop-sepia":["",Xe,Ae,ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ae,ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Xe,"initial",Ae,ke]}],ease:[{ease:["linear","initial",k,Ae,ke]}],delay:[{delay:[Xe,Ae,ke]}],animate:[{animate:["none",A,Ae,ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,Ae,ke]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:Me()}],"rotate-x":[{"rotate-x":Me()}],"rotate-y":[{"rotate-y":Me()}],"rotate-z":[{"rotate-z":Me()}],scale:[{scale:oe()}],"scale-x":[{"scale-x":oe()}],"scale-y":[{"scale-y":oe()}],"scale-z":[{"scale-z":oe()}],"scale-3d":["scale-3d"],skew:[{skew:tt()}],"skew-x":[{"skew-x":tt()}],"skew-y":[{"skew-y":tt()}],transform:[{transform:[Ae,ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Fe()}],"translate-x":[{"translate-x":Fe()}],"translate-y":[{"translate-y":Fe()}],"translate-z":[{"translate-z":Fe()}],"translate-none":["translate-none"],zoom:[{zoom:[gi,Ae,ke]}],accent:[{accent:q()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:q()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ae,ke]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":q()}],"scrollbar-track-color":[{"scrollbar-track":q()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mbs":[{"scroll-mbs":R()}],"scroll-mbe":[{"scroll-mbe":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pbs":[{"scroll-pbs":R()}],"scroll-pbe":[{"scroll-pbe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ae,ke]}],fill:[{fill:["none",...q()]}],"stroke-w":[{stroke:[Xe,dc,po,Hk]}],stroke:[{stroke:["none",...q()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},BB=yB(zB);function Sc(...t){return BB(at(t))}function UB({status:t}){const e={connected:"bg-green-500",idle:"bg-green-500",disconnected:"bg-zinc-600",error:"bg-red-500",working:"bg-amber-400",reviewing:"bg-blue-400"}[t],r=t==="connected"||t==="working";return y.jsxs("span",{className:"relative inline-flex items-center justify-center w-2 h-2",children:[r&&y.jsx("span",{className:`absolute inline-flex h-full w-full rounded-full ${e} opacity-40 animate-ping`}),y.jsx("span",{className:`relative inline-flex rounded-full h-2 w-2 ${e}`})]})}function Vt({children:t,variant:e="muted",className:r=""}){const n={default:"bg-[#E43A9C]/15 text-[#F041FF] border-[#E43A9C]/20",success:"bg-green-500/15 text-green-400 border-green-500/20",warning:"bg-amber-500/15 text-amber-400 border-amber-500/20",error:"bg-red-500/15 text-red-400 border-red-500/20",info:"bg-blue-500/15 text-blue-400 border-blue-500/20",muted:"bg-white/5 text-zinc-400 border-white/10"}[e];return y.jsx("span",{className:`inline-flex items-center px-2 py-px rounded-full text-[10px] font-mono border ${n} ${r}`,children:t})}function qB({name:t,color:e}){return e?y.jsx("span",{className:"inline-flex items-center px-1.5 py-px rounded text-[10px] font-mono border",style:{background:`${e}15`,color:e,borderColor:`${e}30`},children:t}):y.jsx(Vt,{variant:"muted",children:t})}function Da({children:t,onClick:e,className:r="",type:n="button",disabled:i=!1}){return y.jsx("button",{type:n,onClick:e,disabled:i,className:`flex items-center gap-1.5 font-mono text-[11px] text-white rounded-lg active:opacity-80 primary-btn cursor-pointer disabled:opacity-50 ${r}`,children:t})}function Wi({children:t,onClick:e,className:r=""}){return y.jsx("button",{type:"button",onClick:e,className:`flex items-center gap-1.5 px-2.5 py-1 rounded-lg font-mono text-[11px] text-zinc-400 bg-[#252525] hover:bg-[#2e2e2e] hover:text-zinc-100 transition-colors cursor-pointer ${r}`,children:t})}function Ww({children:t,onClick:e,className:r=""}){return y.jsx("button",{type:"button",onClick:e,className:`flex items-center gap-1.5 px-2.5 py-1 rounded-lg font-mono text-[11px] text-zinc-400 bg-[#252525] hover:bg-red-500/10 hover:text-red-400 transition-colors cursor-pointer ${r}`,children:t})}function FB({children:t,onClick:e,className:r=""}){return y.jsx("button",{type:"button",onClick:e,className:`flex items-center gap-1.5 px-2.5 py-1 rounded-lg font-mono text-[11px] text-zinc-400 bg-[#252525] hover:bg-amber-500/10 hover:text-amber-400 transition-colors cursor-pointer ${r}`,children:t})}function To(t){return t==="connected"||t==="idle"?"success":t==="active"||t==="working"?"warning":t==="reviewing"||t==="in meeting"||t==="planning"||t==="meeting"?"info":t==="error"||t==="failed"?"error":"muted"}function Zh(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function HB(t,e,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function l(p){try{d(n.next(p))}catch(f){o(f)}}function u(p){try{d(n.throw(p))}catch(f){o(f)}}function d(p){p.done?a(p.value):i(p.value).then(l,u)}d((n=n.apply(t,e||[])).next())})}const WB=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);class Gw extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class GB extends Gw{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class Kk extends Gw{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class Vk extends Gw{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var Fb;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(Fb||(Fb={}));class KB{constructor(e,{headers:r={},customFetch:n,region:i=Fb.Any}={}){this.url=e,this.headers=r,this.region=i,this.fetch=WB(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return HB(this,arguments,void 0,function*(r,n={}){var i;let a,o;try{const{headers:l,method:u,body:d,signal:p,timeout:f}=n;let g={},{region:v}=n;v||(v=this.region);const x=new URL(`${this.url}/${r}`);v&&v!=="any"&&(g["x-region"]=v,x.searchParams.set("forceFunctionRegion",v));let _;d&&(l&&!Object.prototype.hasOwnProperty.call(l,"Content-Type")||!l)?typeof Blob<"u"&&d instanceof Blob||d instanceof ArrayBuffer?(g["Content-Type"]="application/octet-stream",_=d):typeof d=="string"?(g["Content-Type"]="text/plain",_=d):typeof FormData<"u"&&d instanceof FormData?_=d:(g["Content-Type"]="application/json",_=JSON.stringify(d)):d&&typeof d!="string"&&!(typeof Blob<"u"&&d instanceof Blob)&&!(d instanceof ArrayBuffer)&&!(typeof FormData<"u"&&d instanceof FormData)?_=JSON.stringify(d):_=d;let b=p;f&&(o=new AbortController,a=setTimeout(()=>o.abort(),f),p?(b=o.signal,p.addEventListener("abort",()=>o.abort())):b=o.signal);const k=yield this.fetch(x.toString(),{method:u||"POST",headers:Object.assign(Object.assign(Object.assign({},g),this.headers),l),body:_,signal:b}).catch(E=>{throw new GB(E)}),A=k.headers.get("x-relay-error");if(A&&A==="true")throw new Kk(k);if(!k.ok)throw new Vk(k);let O=((i=k.headers.get("Content-Type"))!==null&&i!==void 0?i:"text/plain").split(";")[0].trim(),C;return O==="application/json"?C=yield k.json():O==="application/octet-stream"||O==="application/pdf"?C=yield k.blob():O==="text/event-stream"?C=k:O==="multipart/form-data"?C=yield k.formData():C=yield k.text(),{data:C,error:null,response:k}}catch(l){return{data:null,error:l,response:l instanceof Vk||l instanceof Kk?l.context:void 0}}finally{a&&clearTimeout(a)}})}}const ON=3,Xk=t=>Math.min(1e3*2**t,3e4),VB=[520,503],AN=["GET","HEAD","OPTIONS"];var XB=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.code=t.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function Yk(t,e){return new Promise(r=>{if(e!=null&&e.aborted){r();return}const n=setTimeout(()=>{e==null||e.removeEventListener("abort",i),r()},t);function i(){clearTimeout(n),r()}e==null||e.addEventListener("abort",i)})}function YB(t,e,r,n){return!(!n||r>=ON||!AN.includes(t)||!VB.includes(e))}var JB=class{constructor(t){var e,r,n,i,a;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=t.method,this.url=t.url,this.headers=new Headers(t.headers),this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=(e=t.shouldThrowOnError)!==null&&e!==void 0?e:!1,this.signal=t.signal,this.isMaybeSingle=(r=t.isMaybeSingle)!==null&&r!==void 0?r:!1,this.shouldStripNulls=(n=t.shouldStripNulls)!==null&&n!==void 0?n:!1,this.urlLengthLimit=(i=t.urlLengthLimit)!==null&&i!==void 0?i:8e3,this.retryEnabled=(a=t.retry)!==null&&a!==void 0?a:!0,t.fetch?this.fetch=t.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(t,e){return this.headers=new Headers(this.headers),this.headers.set(t,e),this}retry(t){return this.retryEnabled=t,this}then(t,e){var r=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const o=this.headers.get("Accept");o==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!o||o==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const n=this.fetch;let a=(async()=>{let o=0;for(;;){const d=new Headers(r.headers);o>0&&d.set("X-Retry-Count",String(o));let p;try{p=await n(r.url.toString(),{method:r.method,headers:d,body:JSON.stringify(r.body,(f,g)=>typeof g=="bigint"?g.toString():g),signal:r.signal})}catch(f){if((f==null?void 0:f.name)==="AbortError"||(f==null?void 0:f.code)==="ABORT_ERR"||!AN.includes(r.method))throw f;if(r.retryEnabled&&o<ON){const g=Xk(o);o++,await Yk(g,r.signal);continue}throw f}if(YB(r.method,p.status,o,r.retryEnabled)){var l,u;const f=(l=(u=p.headers)===null||u===void 0?void 0:u.get("Retry-After"))!==null&&l!==void 0?l:null,g=f!==null?Math.max(0,parseInt(f,10)||0)*1e3:Xk(o);await p.text(),o++,await Yk(g,r.signal);continue}return await r.processResponse(p)}})();return this.shouldThrowOnError||(a=a.catch(o=>{var l;let u="",d="",p="";const f=o==null?void 0:o.cause;if(f){var g,v,x,_;const A=(g=f==null?void 0:f.message)!==null&&g!==void 0?g:"",O=(v=f==null?void 0:f.code)!==null&&v!==void 0?v:"";u=`${(x=o==null?void 0:o.name)!==null&&x!==void 0?x:"FetchError"}: ${o==null?void 0:o.message}`,u+=`
387
+
388
+ Caused by: ${(_=f==null?void 0:f.name)!==null&&_!==void 0?_:"Error"}: ${A}`,O&&(u+=` (${O})`),f!=null&&f.stack&&(u+=`
389
+ ${f.stack}`)}else{var b;u=(b=o==null?void 0:o.stack)!==null&&b!==void 0?b:""}const k=this.url.toString().length;return(o==null?void 0:o.name)==="AbortError"||(o==null?void 0:o.code)==="ABORT_ERR"?(p="",d="Request was aborted (timeout or manual cancellation)",k>this.urlLengthLimit&&(d+=`. Note: Your request URL is ${k} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((f==null?void 0:f.name)==="HeadersOverflowError"||(f==null?void 0:f.code)==="UND_ERR_HEADERS_OVERFLOW")&&(p="",d="HTTP headers exceeded server limits (typically 16KB)",k>this.urlLengthLimit&&(d+=`. Your request URL is ${k} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(l=o==null?void 0:o.name)!==null&&l!==void 0?l:"FetchError"}: ${o==null?void 0:o.message}`,details:u,hint:d,code:p},data:null,count:null,status:0,statusText:""}})),a.then(t,e)}async processResponse(t){var e=this;let r=null,n=null,i=null,a=t.status,o=t.statusText;if(t.ok){var l,u;if(e.method!=="HEAD"){var d;const g=await t.text();g===""||(e.headers.get("Accept")==="text/csv"||e.headers.get("Accept")&&(!((d=e.headers.get("Accept"))===null||d===void 0)&&d.includes("application/vnd.pgrst.plan+text"))?n=g:n=JSON.parse(g))}const p=(l=e.headers.get("Prefer"))===null||l===void 0?void 0:l.match(/count=(exact|planned|estimated)/),f=(u=t.headers.get("content-range"))===null||u===void 0?void 0:u.split("/");p&&f&&f.length>1&&(i=parseInt(f[1])),e.isMaybeSingle&&Array.isArray(n)&&(n.length>1?(r={code:"PGRST116",details:`Results contain ${n.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},n=null,i=null,a=406,o="Not Acceptable"):n.length===1?n=n[0]:n=null)}else{const p=await t.text();try{r=JSON.parse(p),Array.isArray(r)&&t.status===404&&(n=[],r=null,a=200,o="OK")}catch{t.status===404&&p===""?(a=204,o="No Content"):r={message:p}}if(r&&e.shouldThrowOnError)throw new XB(r)}return{success:r===null,error:r,data:n,count:i,status:a,statusText:o}}returns(){return this}overrideTypes(){return this}},ZB=class extends JB{select(t){let e=!1;const r=(t??"*").split("").map(n=>/\s/.test(n)&&!e?"":(n==='"'&&(e=!e),n)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(t,{ascending:e=!0,nullsFirst:r,foreignTable:n,referencedTable:i=n}={}){const a=i?`${i}.order`:"order",o=this.url.searchParams.get(a);return this.url.searchParams.set(a,`${o?`${o},`:""}${t}.${e?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:e,referencedTable:r=e}={}){const n=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${t}`),this}range(t,e,{foreignTable:r,referencedTable:n=r}={}){const i=typeof n>"u"?"offset":`${n}.offset`,a=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(i,`${t}`),this.url.searchParams.set(a,`${e-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:t=!1,verbose:e=!1,settings:r=!1,buffers:n=!1,wal:i=!1,format:a="text"}={}){var o;const l=[t?"analyze":null,e?"verbose":null,r?"settings":null,n?"buffers":null,i?"wal":null].filter(Boolean).join("|"),u=(o=this.headers.get("Accept"))!==null&&o!==void 0?o:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${a}; for="${u}"; options=${l};`),a==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(t){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${t}`),this}};const Jk=new RegExp("[,()]");var Ts=class extends ZB{eq(t,e){return this.url.searchParams.append(t,`eq.${e}`),this}neq(t,e){return this.url.searchParams.append(t,`neq.${e}`),this}gt(t,e){return this.url.searchParams.append(t,`gt.${e}`),this}gte(t,e){return this.url.searchParams.append(t,`gte.${e}`),this}lt(t,e){return this.url.searchParams.append(t,`lt.${e}`),this}lte(t,e){return this.url.searchParams.append(t,`lte.${e}`),this}like(t,e){return this.url.searchParams.append(t,`like.${e}`),this}likeAllOf(t,e){return this.url.searchParams.append(t,`like(all).{${e.join(",")}}`),this}likeAnyOf(t,e){return this.url.searchParams.append(t,`like(any).{${e.join(",")}}`),this}ilike(t,e){return this.url.searchParams.append(t,`ilike.${e}`),this}ilikeAllOf(t,e){return this.url.searchParams.append(t,`ilike(all).{${e.join(",")}}`),this}ilikeAnyOf(t,e){return this.url.searchParams.append(t,`ilike(any).{${e.join(",")}}`),this}regexMatch(t,e){return this.url.searchParams.append(t,`match.${e}`),this}regexIMatch(t,e){return this.url.searchParams.append(t,`imatch.${e}`),this}is(t,e){return this.url.searchParams.append(t,`is.${e}`),this}isDistinct(t,e){return this.url.searchParams.append(t,`isdistinct.${e}`),this}in(t,e){const r=Array.from(new Set(e)).map(n=>typeof n=="string"&&Jk.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(t,`in.(${r})`),this}notIn(t,e){const r=Array.from(new Set(e)).map(n=>typeof n=="string"&&Jk.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(t,`not.in.(${r})`),this}contains(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cs.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cs.{${e.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(e)}`),this}containedBy(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cd.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cd.{${e.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(e)}`),this}rangeGt(t,e){return this.url.searchParams.append(t,`sr.${e}`),this}rangeGte(t,e){return this.url.searchParams.append(t,`nxl.${e}`),this}rangeLt(t,e){return this.url.searchParams.append(t,`sl.${e}`),this}rangeLte(t,e){return this.url.searchParams.append(t,`nxr.${e}`),this}rangeAdjacent(t,e){return this.url.searchParams.append(t,`adj.${e}`),this}overlaps(t,e){return typeof e=="string"?this.url.searchParams.append(t,`ov.${e}`):this.url.searchParams.append(t,`ov.{${e.join(",")}}`),this}textSearch(t,e,{config:r,type:n}={}){let i="";n==="plain"?i="pl":n==="phrase"?i="ph":n==="websearch"&&(i="w");const a=r===void 0?"":`(${r})`;return this.url.searchParams.append(t,`${i}fts${a}.${e}`),this}match(t){return Object.entries(t).filter(([e,r])=>r!==void 0).forEach(([e,r])=>{this.url.searchParams.append(e,`eq.${r}`)}),this}not(t,e,r){return this.url.searchParams.append(t,`not.${e}.${r}`),this}or(t,{foreignTable:e,referencedTable:r=e}={}){const n=r?`${r}.or`:"or";return this.url.searchParams.append(n,`(${t})`),this}filter(t,e,r){return this.url.searchParams.append(t,`${e}.${r}`),this}},QB=class{constructor(t,{headers:e={},schema:r,fetch:n,urlLengthLimit:i=8e3,retry:a}){this.url=t,this.headers=new Headers(e),this.schema=r,this.fetch=n,this.urlLengthLimit=i,this.retry=a}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(t,e){const{head:r=!1,count:n}=e??{},i=r?"HEAD":"GET";let a=!1;const o=(t??"*").split("").map(d=>/\s/.test(d)&&!a?"":(d==='"'&&(a=!a),d)).join(""),{url:l,headers:u}=this.cloneRequestState();return l.searchParams.set("select",o),n&&u.append("Prefer",`count=${n}`),new Ts({method:i,url:l,headers:u,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(t,{count:e,defaultToNull:r=!0}={}){var n;const i="POST",{url:a,headers:o}=this.cloneRequestState();if(e&&o.append("Prefer",`count=${e}`),r||o.append("Prefer","missing=default"),Array.isArray(t)){const l=t.reduce((u,d)=>u.concat(Object.keys(d)),[]);if(l.length>0){const u=[...new Set(l)].map(d=>`"${d}"`);a.searchParams.set("columns",u.join(","))}}return new Ts({method:i,url:a,headers:o,schema:this.schema,body:t,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(t,{onConflict:e,ignoreDuplicates:r=!1,count:n,defaultToNull:i=!0}={}){var a;const o="POST",{url:l,headers:u}=this.cloneRequestState();if(u.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),e!==void 0&&l.searchParams.set("on_conflict",e),n&&u.append("Prefer",`count=${n}`),i||u.append("Prefer","missing=default"),Array.isArray(t)){const d=t.reduce((p,f)=>p.concat(Object.keys(f)),[]);if(d.length>0){const p=[...new Set(d)].map(f=>`"${f}"`);l.searchParams.set("columns",p.join(","))}}return new Ts({method:o,url:l,headers:u,schema:this.schema,body:t,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(t,{count:e}={}){var r;const n="PATCH",{url:i,headers:a}=this.cloneRequestState();return e&&a.append("Prefer",`count=${e}`),new Ts({method:n,url:i,headers:a,schema:this.schema,body:t,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:t}={}){var e;const r="DELETE",{url:n,headers:i}=this.cloneRequestState();return t&&i.append("Prefer",`count=${t}`),new Ts({method:r,url:n,headers:i,schema:this.schema,fetch:(e=this.fetch)!==null&&e!==void 0?e:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function Dc(t){"@babel/helpers - typeof";return Dc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dc(t)}function e8(t,e){if(Dc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Dc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function t8(t){var e=e8(t,"string");return Dc(e)=="symbol"?e:e+""}function r8(t,e,r){return(e=t8(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Zk(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function rf(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Zk(Object(r),!0).forEach(function(n){r8(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Zk(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var n8=class TN{constructor(e,{headers:r={},schema:n,fetch:i,timeout:a,urlLengthLimit:o=8e3,retry:l}={}){this.url=e,this.headers=new Headers(r),this.schemaName=n,this.urlLengthLimit=o;const u=i??globalThis.fetch;a!==void 0&&a>0?this.fetch=(d,p)=>{const f=new AbortController,g=setTimeout(()=>f.abort(),a),v=p==null?void 0:p.signal;if(v){if(v.aborted)return clearTimeout(g),u(d,p);const x=()=>{clearTimeout(g),f.abort()};return v.addEventListener("abort",x,{once:!0}),u(d,rf(rf({},p),{},{signal:f.signal})).finally(()=>{clearTimeout(g),v.removeEventListener("abort",x)})}return u(d,rf(rf({},p),{},{signal:f.signal})).finally(()=>clearTimeout(g))}:this.fetch=u,this.retry=l}from(e){if(!e||typeof e!="string"||e.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new QB(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(e){return new TN(this.url,{headers:this.headers,schema:e,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(e,r={},{head:n=!1,get:i=!1,count:a}={}){var o;let l;const u=new URL(`${this.url}/rpc/${e}`);let d;const p=v=>v!==null&&typeof v=="object"&&(!Array.isArray(v)||v.some(p)),f=n&&Object.values(r).some(p);f?(l="POST",d=r):n||i?(l=n?"HEAD":"GET",Object.entries(r).filter(([v,x])=>x!==void 0).map(([v,x])=>[v,Array.isArray(x)?`{${x.join(",")}}`:`${x}`]).forEach(([v,x])=>{u.searchParams.append(v,x)})):(l="POST",d=r);const g=new Headers(this.headers);return f?g.set("Prefer",a?`count=${a},return=minimal`:"return=minimal"):a&&g.set("Prefer",`count=${a}`),new Ts({method:l,url:u,headers:g,schema:this.schemaName,body:d,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class i8{constructor(){}static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",wsConstructor:WebSocket};const r=globalThis;if(typeof globalThis<"u"&&typeof r.WebSocket<"u")return{type:"native",wsConstructor:r.WebSocket};const n=typeof global<"u"?global:void 0;if(n&&typeof n.WebSocket<"u")return{type:"native",wsConstructor:n.WebSocket};if(typeof globalThis<"u"&&typeof r.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&r.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const i=globalThis.process;if(i){const a=i.versions;if(a&&a.node){const o=a.node,l=parseInt(o.replace(/^v/,"").split(".")[0]);return l>=22?typeof globalThis.WebSocket<"u"?{type:"native",wsConstructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${l} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${l} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
390
+ import ws from "ws"
391
+ new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const e=this.detectEnvironment();if(e.wsConstructor)return e.wsConstructor;let r=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(r+=`
392
+
393
+ Suggested solution: ${e.workaround}`),new Error(r)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const a8="2.106.2",o8=`realtime-js/${a8}`,s8="1.0.0",CN="2.0.0",l8=CN,c8=1e4,u8=100,ja={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},jN={close:"phx_close",error:"phx_error",join:"phx_join",leave:"phx_leave",access_token:"access_token"},Hb={connecting:"connecting",closing:"closing",closed:"closed"};class d8{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=e??[]}encode(e,r){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(e));let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return r(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(e){var r;return this._isArrayBuffer((r=e.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var r,n;const i=(n=(r=e.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,i)}_encodeJsonUserBroadcastPush(e){var r,n;const i=(n=(r=e.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:{},o=new TextEncoder().encode(JSON.stringify(i)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,o)}_encodeUserBroadcastPush(e,r,n){var i,a;const o=e.topic,l=(i=e.ref)!==null&&i!==void 0?i:"",u=(a=e.join_ref)!==null&&a!==void 0?a:"",d=e.payload.event,p=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},f=Object.keys(p).length===0?"":JSON.stringify(p);if(u.length>255)throw new Error(`joinRef length ${u.length} exceeds maximum of 255`);if(l.length>255)throw new Error(`ref length ${l.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`topic length ${o.length} exceeds maximum of 255`);if(d.length>255)throw new Error(`userEvent length ${d.length} exceeds maximum of 255`);if(f.length>255)throw new Error(`metadata length ${f.length} exceeds maximum of 255`);const g=this.USER_BROADCAST_PUSH_META_LENGTH+u.length+l.length+o.length+d.length+f.length,v=new ArrayBuffer(this.HEADER_LENGTH+g);let x=new DataView(v),_=0;x.setUint8(_++,this.KINDS.userBroadcastPush),x.setUint8(_++,u.length),x.setUint8(_++,l.length),x.setUint8(_++,o.length),x.setUint8(_++,d.length),x.setUint8(_++,f.length),x.setUint8(_++,r),Array.from(u,k=>x.setUint8(_++,k.charCodeAt(0))),Array.from(l,k=>x.setUint8(_++,k.charCodeAt(0))),Array.from(o,k=>x.setUint8(_++,k.charCodeAt(0))),Array.from(d,k=>x.setUint8(_++,k.charCodeAt(0))),Array.from(f,k=>x.setUint8(_++,k.charCodeAt(0)));var b=new Uint8Array(v.byteLength+n.byteLength);return b.set(new Uint8Array(v),0),b.set(new Uint8Array(n),v.byteLength),b.buffer}decode(e,r){if(this._isArrayBuffer(e)){let n=this._binaryDecode(e);return r(n)}if(typeof e=="string"){const n=JSON.parse(e),[i,a,o,l,u]=n;return r({join_ref:i,ref:a,topic:o,event:l,payload:u})}return r({})}_binaryDecode(e){const r=new DataView(e),n=r.getUint8(0),i=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,r,i)}}_decodeUserBroadcast(e,r,n){const i=r.getUint8(1),a=r.getUint8(2),o=r.getUint8(3),l=r.getUint8(4);let u=this.HEADER_LENGTH+4;const d=n.decode(e.slice(u,u+i));u=u+i;const p=n.decode(e.slice(u,u+a));u=u+a;const f=n.decode(e.slice(u,u+o));u=u+o;const g=e.slice(u,e.byteLength),v=l===this.JSON_ENCODING?JSON.parse(n.decode(g)):g,x={type:this.BROADCAST_EVENT,event:p,payload:v};return o>0&&(x.meta=JSON.parse(f)),{join_ref:null,ref:null,topic:d,event:this.BROADCAST_EVENT,payload:x}}_isArrayBuffer(e){var r;return e instanceof ArrayBuffer||((r=e==null?void 0:e.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}_pick(e,r){return!e||typeof e!="object"?{}:Object.fromEntries(Object.entries(e).filter(([n])=>r.includes(n)))}}var At;(function(t){t.abstime="abstime",t.bool="bool",t.date="date",t.daterange="daterange",t.float4="float4",t.float8="float8",t.int2="int2",t.int4="int4",t.int4range="int4range",t.int8="int8",t.int8range="int8range",t.json="json",t.jsonb="jsonb",t.money="money",t.numeric="numeric",t.oid="oid",t.reltime="reltime",t.text="text",t.time="time",t.timestamp="timestamp",t.timestamptz="timestamptz",t.timetz="timetz",t.tsrange="tsrange",t.tstzrange="tstzrange"})(At||(At={}));const Qk=(t,e,r={})=>{var n;const i=(n=r.skipTypes)!==null&&n!==void 0?n:[];return e?Object.keys(e).reduce((a,o)=>(a[o]=f8(o,t,e,i),a),{}):{}},f8=(t,e,r,n)=>{const i=e.find(l=>l.name===t),a=i==null?void 0:i.type,o=r[t];return a&&!n.includes(a)?PN(a,o):Wb(o)},PN=(t,e)=>{if(t.charAt(0)==="_"){const r=t.slice(1,t.length);return g8(e,r)}switch(t){case At.bool:return h8(e);case At.float4:case At.float8:case At.int2:case At.int4:case At.int8:case At.numeric:case At.oid:return p8(e);case At.json:case At.jsonb:return m8(e);case At.timestamp:return y8(e);case At.abstime:case At.date:case At.daterange:case At.int4range:case At.int8range:case At.money:case At.reltime:case At.text:case At.time:case At.timestamptz:case At.timetz:case At.tsrange:case At.tstzrange:return Wb(e);default:return Wb(e)}},Wb=t=>t,h8=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},p8=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},m8=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t},g8=(t,e)=>{if(typeof t!="string")return t;const r=t.length-1,n=t[r];if(t[0]==="{"&&n==="}"){let a;const o=t.slice(1,r);try{a=JSON.parse("["+o+"]")}catch{a=o?o.split(","):[]}return a.map(l=>PN(e,l))}return t},y8=t=>typeof t=="string"?t.replace(" ","T"):t,NN=t=>{const e=new URL(t);return e.protocol=e.protocol.replace(/^ws/i,"http"),e.pathname=e.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),e.pathname===""||e.pathname==="/"?e.pathname="/api/broadcast":e.pathname=e.pathname+"/api/broadcast",e.href};var Cc=t=>typeof t=="function"?t:function(){return t},v8=typeof self<"u"?self:null,Cs=typeof window<"u"?window:null,bi=v8||Cs||globalThis,b8="2.0.0",x8=1e4,w8=1e3,xi={connecting:0,open:1,closing:2,closed:3},Xr={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},zi={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},Gb={longpoll:"longpoll",websocket:"websocket"},_8={complete:4},Kb="base64url.bearer.phx.",nf=class{constructor(t,e,r,n){this.channel=t,this.event=e,this.payload=r||function(){return{}},this.receivedResp=null,this.timeout=n,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(t){this.timeout=t,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(t,e){return this.hasReceived(t)&&e(this.receivedResp.response),this.recHooks.push({status:t,callback:e}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:t,response:e,_ref:r}){this.recHooks.filter(n=>n.status===t).forEach(n=>n.callback(e))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,t=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=t,this.matchReceive(t)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}trigger(t,e){this.channel.trigger(this.refEvent,{status:t,response:e})}},RN=class{constructor(t,e){this.callback=t,this.timerCalc=e,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},S8=class{constructor(t,e,r){this.state=Xr.closed,this.topic=t,this.params=Cc(e||{}),this.socket=r,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new nf(this,zi.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new RN(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=Xr.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(n=>n.send()),this.pushBuffer=[]}),this.joinPush.receive("error",n=>{this.state=Xr.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=Xr.closed,this.socket.remove(this)}),this.onError(n=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.isJoining()&&this.joinPush.reset(),this.state=Xr.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new nf(this,zi.leave,Cc({}),this.timeout).send(),this.state=Xr.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(zi.reply,(n,i)=>{this.trigger(this.replyEventName(i),n)})}join(t=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=t,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Xr.closed,this.bindings=[]}onClose(t){this.on(zi.close,t)}onError(t){return this.on(zi.error,e=>t(e))}on(t,e){let r=this.bindingRef++;return this.bindings.push({event:t,ref:r,callback:e}),r}off(t,e){this.bindings=this.bindings.filter(r=>!(r.event===t&&(typeof e>"u"||e===r.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(t,e,r=this.timeout){if(e=e||{},!this.joinedOnce)throw new Error(`tried to push '${t}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let n=new nf(this,t,function(){return e},r);return this.canPush()?n.send():(n.startTimeout(),this.pushBuffer.push(n)),n}leave(t=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=Xr.leaving;let e=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(zi.close,"leave")},r=new nf(this,zi.leave,Cc({}),t);return r.receive("ok",()=>e()).receive("timeout",()=>e()),r.send(),this.canPush()||r.trigger("ok",{}),r}onMessage(t,e,r){return e}filterBindings(t,e,r){return!0}isMember(t,e,r,n){return this.topic!==t?!1:n&&n!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:t,event:e,payload:r,joinRef:n}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(t=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=Xr.joining,this.joinPush.resend(t))}trigger(t,e,r,n){let i=this.onMessage(t,e,r,n);if(e&&!i)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let a=this.bindings.filter(o=>o.event===t&&this.filterBindings(o,e,r));for(let o=0;o<a.length;o++)a[o].callback(i,r,n||this.joinRef())}replyEventName(t){return`chan_reply_${t}`}isClosed(){return this.state===Xr.closed}isErrored(){return this.state===Xr.errored}isJoined(){return this.state===Xr.joined}isJoining(){return this.state===Xr.joining}isLeaving(){return this.state===Xr.leaving}},Mf=class{static request(t,e,r,n,i,a,o){if(bi.XDomainRequest){let l=new bi.XDomainRequest;return this.xdomainRequest(l,t,e,n,i,a,o)}else if(bi.XMLHttpRequest){let l=new bi.XMLHttpRequest;return this.xhrRequest(l,t,e,r,n,i,a,o)}else{if(bi.fetch&&bi.AbortController)return this.fetchRequest(t,e,r,n,i,a,o);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(t,e,r,n,i,a,o){let l={method:t,headers:r,body:n},u=null;return i&&(u=new AbortController,setTimeout(()=>u.abort(),i),l.signal=u.signal),bi.fetch(e,l).then(d=>d.text()).then(d=>this.parseJSON(d)).then(d=>o&&o(d)).catch(d=>{d.name==="AbortError"&&a?a():o&&o(null)}),u}static xdomainRequest(t,e,r,n,i,a,o){return t.timeout=i,t.open(e,r),t.onload=()=>{let l=this.parseJSON(t.responseText);o&&o(l)},a&&(t.ontimeout=a),t.onprogress=()=>{},t.send(n),t}static xhrRequest(t,e,r,n,i,a,o,l){t.open(e,r,!0),t.timeout=a;for(let[u,d]of Object.entries(n))t.setRequestHeader(u,d);return t.onerror=()=>l&&l(null),t.onreadystatechange=()=>{if(t.readyState===_8.complete&&l){let u=this.parseJSON(t.responseText);l(u)}},o&&(t.ontimeout=o),t.send(i),t}static parseJSON(t){if(!t||t==="")return null;try{return JSON.parse(t)}catch{return console&&console.log("failed to parse JSON response",t),null}}static serialize(t,e){let r=[];for(var n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;let i=e?`${e}[${n}]`:n,a=t[n];typeof a=="object"?r.push(this.serialize(a,i)):r.push(encodeURIComponent(i)+"="+encodeURIComponent(a))}return r.join("&")}static appendParams(t,e){if(Object.keys(e).length===0)return t;let r=t.match(/\?/)?"&":"?";return`${t}${r}${this.serialize(e)}`}},k8=t=>{let e="",r=new Uint8Array(t),n=r.byteLength;for(let i=0;i<n;i++)e+=String.fromCharCode(r[i]);return btoa(e)},vs=class{constructor(t,e){e&&e.length===2&&e[1].startsWith(Kb)&&(this.authToken=atob(e[1].slice(Kb.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(t),this.readyState=xi.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(t){return t.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+Gb.websocket),"$1/"+Gb.longpoll)}endpointURL(){return Mf.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(t,e,r){this.close(t,e,r),this.readyState=xi.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===xi.open||this.readyState===xi.connecting}poll(){const t={Accept:"application/json"};this.authToken&&(t["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",t,null,()=>this.ontimeout(),e=>{if(e){var{status:r,token:n,messages:i}=e;if(r===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=n}else r=0;switch(r){case 200:i.forEach(a=>{setTimeout(()=>this.onmessage({data:a}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=xi.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${r}`)}})}send(t){typeof t!="string"&&(t=k8(t)),this.currentBatch?this.currentBatch.push(t):this.awaitingBatchAck?this.batchBuffer.push(t):(this.currentBatch=[t],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(t){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},t.join(`
394
+ `),()=>this.onerror("timeout"),e=>{this.awaitingBatchAck=!1,!e||e.status!==200?(this.onerror(e&&e.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(t,e,r){for(let i of this.reqs)i.abort();this.readyState=xi.closed;let n=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:t,reason:e,wasClean:r});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",n)):this.onclose(n)}ajax(t,e,r,n,i){let a,o=()=>{this.reqs.delete(a),n()};a=Mf.request(t,this.endpointURL(),e,r,this.timeout,o,l=>{this.reqs.delete(a),this.isActive()&&i(l)}),this.reqs.add(a)}},E8=class kc{constructor(e,r={}){let n=r.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=e,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(n.state,i=>{let{onJoin:a,onLeave:o,onSync:l}=this.caller;this.joinRef=this.channel.joinRef(),this.state=kc.syncState(this.state,i,a,o),this.pendingDiffs.forEach(u=>{this.state=kc.syncDiff(this.state,u,a,o)}),this.pendingDiffs=[],l()}),this.channel.on(n.diff,i=>{let{onJoin:a,onLeave:o,onSync:l}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(i):(this.state=kc.syncDiff(this.state,i,a,o),l())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(e){return kc.list(this.state,e)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,r,n,i){let a=this.clone(e),o={},l={};return this.map(a,(u,d)=>{r[u]||(l[u]=d)}),this.map(r,(u,d)=>{let p=a[u];if(p){let f=d.metas.map(_=>_.phx_ref),g=p.metas.map(_=>_.phx_ref),v=d.metas.filter(_=>g.indexOf(_.phx_ref)<0),x=p.metas.filter(_=>f.indexOf(_.phx_ref)<0);v.length>0&&(o[u]=d,o[u].metas=v),x.length>0&&(l[u]=this.clone(p),l[u].metas=x)}else o[u]=d}),this.syncDiff(a,{joins:o,leaves:l},n,i)}static syncDiff(e,r,n,i){let{joins:a,leaves:o}=this.clone(r);return n||(n=function(){}),i||(i=function(){}),this.map(a,(l,u)=>{let d=e[l];if(e[l]=this.clone(u),d){let p=e[l].metas.map(g=>g.phx_ref),f=d.metas.filter(g=>p.indexOf(g.phx_ref)<0);e[l].metas.unshift(...f)}n(l,d,u)}),this.map(o,(l,u)=>{let d=e[l];if(!d)return;let p=u.metas.map(f=>f.phx_ref);d.metas=d.metas.filter(f=>p.indexOf(f.phx_ref)<0),i(l,d,u),d.metas.length===0&&delete e[l]}),e}static list(e,r){return r||(r=function(n,i){return i}),this.map(e,(n,i)=>r(n,i))}static map(e,r){return Object.getOwnPropertyNames(e).map(n=>r(n,e[n]))}static clone(e){return JSON.parse(JSON.stringify(e))}},af={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(t,e){if(t.payload.constructor===ArrayBuffer)return e(this.binaryEncode(t));{let r=[t.join_ref,t.ref,t.topic,t.event,t.payload];return e(JSON.stringify(r))}},decode(t,e){if(t.constructor===ArrayBuffer)return e(this.binaryDecode(t));{let[r,n,i,a,o]=JSON.parse(t);return e({join_ref:r,ref:n,topic:i,event:a,payload:o})}},binaryEncode(t){let{join_ref:e,ref:r,event:n,topic:i,payload:a}=t,o=this.META_LENGTH+e.length+r.length+i.length+n.length,l=new ArrayBuffer(this.HEADER_LENGTH+o),u=new DataView(l),d=0;u.setUint8(d++,this.KINDS.push),u.setUint8(d++,e.length),u.setUint8(d++,r.length),u.setUint8(d++,i.length),u.setUint8(d++,n.length),Array.from(e,f=>u.setUint8(d++,f.charCodeAt(0))),Array.from(r,f=>u.setUint8(d++,f.charCodeAt(0))),Array.from(i,f=>u.setUint8(d++,f.charCodeAt(0))),Array.from(n,f=>u.setUint8(d++,f.charCodeAt(0)));var p=new Uint8Array(l.byteLength+a.byteLength);return p.set(new Uint8Array(l),0),p.set(new Uint8Array(a),l.byteLength),p.buffer},binaryDecode(t){let e=new DataView(t),r=e.getUint8(0),n=new TextDecoder;switch(r){case this.KINDS.push:return this.decodePush(t,e,n);case this.KINDS.reply:return this.decodeReply(t,e,n);case this.KINDS.broadcast:return this.decodeBroadcast(t,e,n)}},decodePush(t,e,r){let n=e.getUint8(1),i=e.getUint8(2),a=e.getUint8(3),o=this.HEADER_LENGTH+this.META_LENGTH-1,l=r.decode(t.slice(o,o+n));o=o+n;let u=r.decode(t.slice(o,o+i));o=o+i;let d=r.decode(t.slice(o,o+a));o=o+a;let p=t.slice(o,t.byteLength);return{join_ref:l,ref:null,topic:u,event:d,payload:p}},decodeReply(t,e,r){let n=e.getUint8(1),i=e.getUint8(2),a=e.getUint8(3),o=e.getUint8(4),l=this.HEADER_LENGTH+this.META_LENGTH,u=r.decode(t.slice(l,l+n));l=l+n;let d=r.decode(t.slice(l,l+i));l=l+i;let p=r.decode(t.slice(l,l+a));l=l+a;let f=r.decode(t.slice(l,l+o));l=l+o;let g=t.slice(l,t.byteLength),v={status:f,response:g};return{join_ref:u,ref:d,topic:p,event:zi.reply,payload:v}},decodeBroadcast(t,e,r){let n=e.getUint8(1),i=e.getUint8(2),a=this.HEADER_LENGTH+2,o=r.decode(t.slice(a,a+n));a=a+n;let l=r.decode(t.slice(a,a+i));a=a+i;let u=t.slice(a,t.byteLength);return{join_ref:null,ref:null,topic:o,event:l,payload:u}}},O8=class{constructor(t,e={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=e.timeout||x8,this.transport=e.transport||bi.WebSocket||vs,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=e.longPollFallbackMs,this.fallbackTimer=null;let r=null;try{r=bi&&bi.sessionStorage}catch{}this.sessionStore=e.sessionStorage||r,this.establishedConnections=0,this.defaultEncoder=af.encode.bind(af),this.defaultDecoder=af.decode.bind(af),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=e.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==vs?(this.encode=e.encode||this.defaultEncoder,this.decode=e.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;Cs&&Cs.addEventListener&&(Cs.addEventListener("pagehide",i=>{this.conn&&(this.disconnect(),n=this.connectClock)}),Cs.addEventListener("pageshow",i=>{n===this.connectClock&&(n=null,this.connect())}),Cs.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=e.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=e.autoSendHeartbeat??!0,this.heartbeatCallback=e.heartbeatCallback??(()=>{}),this.rejoinAfterMs=i=>e.rejoinAfterMs?e.rejoinAfterMs(i):[1e3,2e3,5e3][i-1]||1e4,this.reconnectAfterMs=i=>e.reconnectAfterMs?e.reconnectAfterMs(i):[10,50,100,150,200,250,500,1e3,2e3][i-1]||5e3,this.logger=e.logger||null,!this.logger&&e.debug&&(this.logger=(i,a,o)=>{console.log(`${i}: ${a}`,o)}),this.longpollerTimeout=e.longpollerTimeout||2e4,this.params=Cc(e.params||{}),this.endPoint=`${t}/${Gb.websocket}`,this.vsn=e.vsn||b8,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new RN(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{e.beforeReconnect&&await e.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=e.authToken}getLongPollTransport(){return vs}replaceTransport(t){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=t}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let t=Mf.appendParams(Mf.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return t.charAt(0)!=="/"?t:t.charAt(1)==="/"?`${this.protocol()}:${t}`:`${this.protocol()}://${location.host}${t}`}disconnect(t,e,r){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,t&&t()},e,r)}connect(t){t&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=Cc(t)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==vs?this.connectWithFallback(vs,this.longPollFallbackMs):this.transportConnect())}log(t,e,r){this.logger&&this.logger(t,e,r)}hasLogger(){return this.logger!==null}onOpen(t){let e=this.makeRef();return this.stateChangeCallbacks.open.push([e,t]),e}onClose(t){let e=this.makeRef();return this.stateChangeCallbacks.close.push([e,t]),e}onError(t){let e=this.makeRef();return this.stateChangeCallbacks.error.push([e,t]),e}onMessage(t){let e=this.makeRef();return this.stateChangeCallbacks.message.push([e,t]),e}onHeartbeat(t){this.heartbeatCallback=t}ping(t){if(!this.isConnected())return!1;let e=this.makeRef(),r=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:e});let n=this.onMessage(i=>{i.ref===e&&(this.off([n]),t(Date.now()-r))});return!0}transportName(t){switch(t){case vs:return"LongPoll";default:return t.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let t;this.authToken&&(t=["phoenix",`${Kb}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),t),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(t){return this.sessionStore&&this.sessionStore.getItem(t)}storeSession(t,e){this.sessionStore&&this.sessionStore.setItem(t,e)}connectWithFallback(t,e=2500){clearTimeout(this.fallbackTimer);let r=!1,n=!0,i,a,o=this.transportName(t),l=u=>{this.log("transport",`falling back to ${o}...`,u),this.off([i,a]),n=!1,this.replaceTransport(t),this.transportConnect()};if(this.getSession(`phx:fallback:${o}`))return l("memorized");this.fallbackTimer=setTimeout(l,e),a=this.onError(u=>{this.log("transport","error",u),n&&!r&&(clearTimeout(this.fallbackTimer),l(u))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(r=!0,!n){let u=this.transportName(t);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${u}`,"true"),this.log("transport",`established ${u} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(l,e),this.ping(u=>{this.log("transport","connected to primary after",u),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(t){this.log("error","error in heartbeat callback",t)}this.triggerChanError(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),w8,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(t,e,r){if(!this.conn)return t&&t();const n=this.conn;this.waitForBufferDone(n,()=>{e?n.close(e,r||""):n.close(),this.waitForSocketClosed(n,()=>{this.conn===n&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),t&&t()})})}waitForBufferDone(t,e,r=1){if(r===5||!t.bufferedAmount){e();return}setTimeout(()=>{this.waitForBufferDone(t,e,r+1)},150*r)}waitForSocketClosed(t,e,r=1){if(r===5||t.readyState===xi.closed){e();return}setTimeout(()=>{this.waitForSocketClosed(t,e,r+1)},150*r)}onConnClose(t){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",t),this.triggerChanError(t),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",t)}onConnError(t){this.hasLogger()&&this.log("transport","error",t);let e=this.transport,r=this.establishedConnections;this.triggerStateCallbacks("error",t,e,r),(e===this.transport||r>0)&&this.triggerChanError(t)}triggerChanError(t){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(zi.error,t)})}connectionState(){switch(this.conn&&this.conn.readyState){case xi.connecting:return"connecting";case xi.open:return"open";case xi.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(t){this.off(t.stateChangeRefs),this.channels=this.channels.filter(e=>e!==t)}off(t){for(let e in this.stateChangeCallbacks)this.stateChangeCallbacks[e]=this.stateChangeCallbacks[e].filter(([r])=>t.indexOf(r)===-1)}channel(t,e={}){let r=new S8(t,e,this);return this.channels.push(r),r}push(t){if(this.hasLogger()){let{topic:e,event:r,payload:n,ref:i,join_ref:a}=t;this.log("push",`${e} ${r} (${a}, ${i})`,n)}this.isConnected()?this.encode(t,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(t,e=>this.conn.send(e)))}makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(t){this.log("error","error in heartbeat callback",t)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(t){this.log("error","error in heartbeat callback",t)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}onConnMessage(t){this.decode(t.data,e=>{let{topic:r,event:n,payload:i,ref:a,join_ref:o}=e;if(a&&a===this.pendingHeartbeatRef){const l=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(i.status==="ok"?"ok":"error",l)}catch(u){this.log("error","error in heartbeat callback",u)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${i.status||""} ${r} ${n} ${a&&"("+a+")"||""}`.trim(),i);for(let l=0;l<this.channels.length;l++){const u=this.channels[l];u.isMember(r,n,i,o)&&u.trigger(n,i,a,o)}this.triggerStateCallbacks("message",e)})}triggerStateCallbacks(t,...e){try{this.stateChangeCallbacks[t].forEach(([r,n])=>{try{n(...e)}catch(i){this.log("error",`error in ${t} callback`,i)}})}catch(r){this.log("error",`error triggering ${t} callbacks`,r)}}leaveOpenTopic(t){let e=this.channels.find(r=>r.topic===t&&(r.isJoined()||r.isJoining()));e&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${t}"`),e.leave())}};class jc{constructor(e,r){const n=T8(r);this.presence=new E8(e.getChannel(),n),this.presence.onJoin((i,a,o)=>{const l=jc.onJoinPayload(i,a,o);e.getChannel().trigger("presence",l)}),this.presence.onLeave((i,a,o)=>{const l=jc.onLeavePayload(i,a,o);e.getChannel().trigger("presence",l)}),this.presence.onSync(()=>{e.getChannel().trigger("presence",{event:"sync"})})}get state(){return jc.transformState(this.presence.state)}static transformState(e){return e=A8(e),Object.getOwnPropertyNames(e).reduce((r,n)=>{const i=e[n];return r[n]=Af(i),r},{})}static onJoinPayload(e,r,n){const i=eE(r),a=Af(n);return{event:"join",key:e,currentPresences:i,newPresences:a}}static onLeavePayload(e,r,n){const i=eE(r),a=Af(n);return{event:"leave",key:e,currentPresences:i,leftPresences:a}}}function Af(t){return t.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))}function A8(t){return JSON.parse(JSON.stringify(t))}function T8(t){return(t==null?void 0:t.events)&&{events:t.events}}function eE(t){return t!=null&&t.metas?Af(t):[]}var tE;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(tE||(tE={}));class C8{get state(){return this.presenceAdapter.state}constructor(e,r){this.channel=e,this.presenceAdapter=new jc(this.channel.channelAdapter,r)}}function j8(t){if(t instanceof Error)return t;if(typeof t=="string")return new Error(t);if(t&&typeof t=="object"){const e=t;if(typeof e.code=="number"){const r=typeof e.reason=="string"&&e.reason?` (${e.reason})`:"";return new Error(`socket closed: ${e.code}${r}`,{cause:t})}return new Error("channel error: transport failure",{cause:t})}return new Error("channel error: connection lost")}class P8{constructor(e,r,n){const i=N8(n);this.channel=e.getSocket().channel(r,i),this.socket=e}get state(){return this.channel.state}set state(e){this.channel.state=e}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(e,r){return this.channel.on(e,r)}off(e,r){this.channel.off(e,r)}subscribe(e){return this.channel.join(e)}unsubscribe(e){return this.channel.leave(e)}teardown(){this.channel.teardown()}onClose(e){this.channel.onClose(e)}onError(e){return this.channel.onError(e)}push(e,r,n){let i;try{i=this.channel.push(e,r,n)}catch{throw new Error(`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>u8){const a=this.channel.pushBuffer.shift();a.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${a.event}`,a.payload())}return i}updateJoinPayload(e){const r=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},r),e)}canPush(){return this.socket.isConnected()&&this.state===ja.joined}isJoined(){return this.state===ja.joined}isJoining(){return this.state===ja.joining}isClosed(){return this.state===ja.closed}isLeaving(){return this.state===ja.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}}function N8(t){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config)}}var rE;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(rE||(rE={}));var Ns;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(Ns||(Ns={}));var Bi;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(Bi||(Bi={}));class Pc{get state(){return this.channelAdapter.state}set state(e){this.channelAdapter.state=e}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(e,r={config:{}},n){var i,a;if(this.topic=e,this.params=r,this.socket=n,this.bindings={},this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.channelAdapter=new P8(this.socket.socketAdapter,e,this.params),this.presence=new C8(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=NN(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((a=(i=this.params.config)===null||i===void 0?void 0:i.broadcast)===null||a===void 0)&&a.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(e,r=this.timeout){var n,i,a;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:o,presence:l,private:u}}=this.params,d=(i=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(v=>v.filter))!==null&&i!==void 0?i:[],p=!!this.bindings[Ns.PRESENCE]&&this.bindings[Ns.PRESENCE].length>0||((a=this.params.config.presence)===null||a===void 0?void 0:a.enabled)===!0,f={},g={broadcast:o,presence:Object.assign(Object.assign({},l),{enabled:p}),postgres_changes:d,private:u};this.socket.accessTokenValue&&(f.access_token=this.socket.accessTokenValue),this._onError(v=>{e==null||e(Bi.CHANNEL_ERROR,j8(v))}),this._onClose(()=>e==null?void 0:e(Bi.CLOSED)),this.updateJoinPayload(Object.assign({config:g},f)),this._updateFilterMessage(),this.channelAdapter.subscribe(r).receive("ok",async({postgres_changes:v})=>{if(this.socket._isManualToken()||this.socket.setAuth(),v===void 0){e==null||e(Bi.SUBSCRIBED);return}this._updatePostgresBindings(v,e)}).receive("error",v=>{this.state=ja.errored;const x=Object.values(v).join(", ")||"error";e==null||e(Bi.CHANNEL_ERROR,new Error(x,{cause:v}))}).receive("timeout",()=>{e==null||e(Bi.TIMED_OUT)})}return this}_updatePostgresBindings(e,r){var n;const i=this.bindings.postgres_changes,a=(n=i==null?void 0:i.length)!==null&&n!==void 0?n:0,o=[];for(let l=0;l<a;l++){const u=i[l],{filter:{event:d,schema:p,table:f,filter:g}}=u,v=e&&e[l];if(v&&v.event===d&&Pc.isFilterValueEqual(v.schema,p)&&Pc.isFilterValueEqual(v.table,f)&&Pc.isFilterValueEqual(v.filter,g))o.push(Object.assign(Object.assign({},u),{id:v.id}));else{this.unsubscribe(),this.state=ja.errored,r==null||r(Bi.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=o,this.state!=ja.errored&&r&&r(Bi.SUBSCRIBED)}presenceState(){return this.presence.state}async track(e,r={}){return await this.send({type:"presence",event:"track",payload:e},r.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,r,n){const i=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),a=e===Ns.PRESENCE||e===Ns.POSTGRES_CHANGES;if(i&&a)throw this.socket.log("channel",`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(e,r,n)}async httpSend(e,r,n={}){var i;if(r==null)return Promise.reject(new Error("Payload is required for httpSend()"));const a={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);const o={method:"POST",headers:a,body:JSON.stringify({messages:[{topic:this.subTopic,event:e,payload:r,private:this.private}]})},l=await this._fetchWithTimeout(this.broadcastEndpointURL,o,(i=n.timeout)!==null&&i!==void 0?i:this.timeout);if(l.status===202)return{success:!0};let u=l.statusText;try{const d=await l.json();u=d.error||d.message||u}catch{}return Promise.reject(new Error(u))}async send(e,r={}){var n,i;if(!this.channelAdapter.canPush()&&e.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:a,payload:o}=e,l={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(l.Authorization=`Bearer ${this.socket.accessTokenValue}`);const u={method:"POST",headers:l,body:JSON.stringify({messages:[{topic:this.subTopic,event:a,payload:o,private:this.private}]})};try{const d=await this._fetchWithTimeout(this.broadcastEndpointURL,u,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((i=d.body)===null||i===void 0?void 0:i.cancel()),d.ok?"ok":"error"}catch(d){return d instanceof Error&&d.name==="AbortError"?"timed out":"error"}}else return new Promise(a=>{var o,l,u;const d=this.channelAdapter.push(e.type,e,r.timeout||this.timeout);e.type==="broadcast"&&!(!((u=(l=(o=this.params)===null||o===void 0?void 0:o.config)===null||l===void 0?void 0:l.broadcast)===null||u===void 0)&&u.ack)&&a("ok"),d.receive("ok",()=>a("ok")),d.receive("error",()=>a("error")),d.receive("timeout",()=>a("timed out"))})}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(r=>{this.channelAdapter.unsubscribe(e).receive("ok",()=>r("ok")).receive("timeout",()=>r("timed out")).receive("error",()=>r("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,r,n){const i=new AbortController,a=setTimeout(()=>i.abort(),n),o=await this.socket.fetch(e,Object.assign(Object.assign({},r),{signal:i.signal}));return clearTimeout(a),o}_on(e,r,n){const i=e.toLocaleLowerCase(),a=this.channelAdapter.on(e,n),o={type:i,filter:r,callback:n,ref:a};return this.bindings[i]?this.bindings[i].push(o):this.bindings[i]=[o],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,r,n)=>{var i,a,o,l,u,d,p;const f=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(f,n))return!1;const g=(i=this.bindings[f])===null||i===void 0?void 0:i.find(v=>v.ref===e.ref);if(!g)return!0;if(["broadcast","presence","postgres_changes"].includes(f))if("id"in g){const v=g.id,x=(a=g.filter)===null||a===void 0?void 0:a.event;return v&&((o=r.ids)===null||o===void 0?void 0:o.includes(v))&&(x==="*"||(x==null?void 0:x.toLocaleLowerCase())===((l=r.data)===null||l===void 0?void 0:l.type.toLocaleLowerCase()))}else{const v=(d=(u=g==null?void 0:g.filter)===null||u===void 0?void 0:u.event)===null||d===void 0?void 0:d.toLocaleLowerCase();return v==="*"||v===((p=r==null?void 0:r.event)===null||p===void 0?void 0:p.toLocaleLowerCase())}else return g.type.toLocaleLowerCase()===f})}_notThisChannelEvent(e,r){const{close:n,error:i,leave:a,join:o}=jN;return r&&[n,i,a,o].includes(e)&&r!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,r,n)=>{if(typeof r=="object"&&"ids"in r){const i=r.data,{schema:a,table:o,commit_timestamp:l,type:u,errors:d}=i;return Object.assign(Object.assign({},{schema:a,table:o,commit_timestamp:l,eventType:u,new:{},old:{},errors:d}),this._getPayloadRecords(i))}return r})}copyBindings(e){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const r in e.bindings)for(const n of e.bindings[r])this._on(n.type,n.filter,n.callback)}static isFilterValueEqual(e,r){return(e??void 0)===(r??void 0)}_getPayloadRecords(e){const r={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(r.new=Qk(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(r.old=Qk(e.columns,e.old_record)),r}}class R8{constructor(e,r){this.socket=new O8(e,r)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(e){this.socket.heartbeatCallback=e}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(e,r,n,i=1e4){return new Promise(a=>{setTimeout(()=>a("timeout"),i),this.socket.disconnect(()=>{e(),a("ok")},r,n)})}push(e){this.socket.push(e)}log(e,r,n){this.socket.log(e,r,n)}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==Hb.connecting}isDisconnecting(){return this.socket.connectionState()==Hb.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const nE={HEARTBEAT_INTERVAL:25e3},I8=[1e3,2e3,5e3,1e4],$8=1e4;function M8(){const t=new Map;return{get length(){return t.size},clear(){t.clear()},getItem(e){return t.has(e)?t.get(e):null},key(e){var r;return(r=Array.from(t.keys())[e])!==null&&r!==void 0?r:null},removeItem(e){t.delete(e)},setItem(e,r){t.set(e,String(r))}}}function L8(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return M8()}const D8=`
395
+ addEventListener("message", (e) => {
396
+ if (e.data.event === "start") {
397
+ setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
398
+ }
399
+ });`;class z8{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(e,r){var n;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={},this.ref=0,this.serializer=new d8,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=a=>a?(...o)=>a(...o):(...o)=>fetch(...o),!(!((n=r==null?void 0:r.params)===null||n===void 0)&&n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey;const i=this._initializeOptions(r);this.socketAdapter=new R8(e,i),this.httpEndpoint=NN(e),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(e){const r=e.message;throw r.includes("Node.js")?new Error(`${r}
400
+
401
+ To use Realtime in Node.js, you need to provide a WebSocket implementation:
402
+
403
+ Option 1: Use Node.js 22+ which has native WebSocket support
404
+ Option 2: Install and provide the "ws" package:
405
+
406
+ npm install ws
407
+
408
+ import ws from "ws"
409
+ const client = new RealtimeClient(url, {
410
+ ...options,
411
+ transport: ws
412
+ })`):new Error(`WebSocket not available: ${r}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,r){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,r)}getChannels(){return this.channels}async removeChannel(e){const r=await e.unsubscribe();return r==="ok"&&e.teardown(),r}async removeAllChannels(){const e=this.channels.map(async n=>{const i=await n.unsubscribe();return n.teardown(),i}),r=await Promise.all(e);return await this.disconnect(),r}log(e,r,n){this.socketAdapter.log(e,r,n)}connectionState(){return this.socketAdapter.connectionState()||Hb.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,r={config:{}}){const n=`realtime:${e}`,i=this.getChannels().find(a=>a.topic===n);if(i)return i;{const a=new Pc(`realtime:${e}`,r,this);return this._cancelPendingDisconnect(),this.channels.push(a),a}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(r=>r.topic!==e.topic),this.channels.length===0&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log("transport","disconnecting immediately - no channels"),this.disconnect();return}this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(e=null){let r,n=!1;if(e)r=e,n=!0;else if(this.accessToken)try{r=await this.accessToken()}catch(i){this.log("error","Error fetching access token from callback",i),r=this.accessTokenValue}else r=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(i=>{const a={access_token:r,version:o8};r&&i.updateJoinPayload(a),i.joinedOnce&&i.channelAdapter.isJoined()&&i.channelAdapter.push(jN.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(r=>{this.log("error",`Error setting auth in ${e}`,r)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(r=>{this.log("error","error waiting for auth on connect",r)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(r,n)=>{r=="sent"&&this._setAuthSafely(),e&&e(r,n)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(e){let r;if(e)r=e;else{const n=new Blob([D8],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_initializeOptions(e){var r,n,i,a,o,l,u,d,p,f,g,v;this.worker=(r=e==null?void 0:e.worker)!==null&&r!==void 0?r:!1,this.accessToken=(n=e==null?void 0:e.accessToken)!==null&&n!==void 0?n:null;const x={};x.timeout=(i=e==null?void 0:e.timeout)!==null&&i!==void 0?i:c8,x.heartbeatIntervalMs=(a=e==null?void 0:e.heartbeatIntervalMs)!==null&&a!==void 0?a:nE.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(o=e==null?void 0:e.disconnectOnEmptyChannelsAfterMs)!==null&&o!==void 0?o:2*((l=e==null?void 0:e.heartbeatIntervalMs)!==null&&l!==void 0?l:nE.HEARTBEAT_INTERVAL),x.transport=(u=e==null?void 0:e.transport)!==null&&u!==void 0?u:i8.getWebSocketConstructor(),x.params=e==null?void 0:e.params,x.logger=e==null?void 0:e.logger,x.heartbeatCallback=this._wrapHeartbeatCallback(e==null?void 0:e.heartbeatCallback),x.sessionStorage=(d=e==null?void 0:e.sessionStorage)!==null&&d!==void 0?d:L8(),x.reconnectAfterMs=(p=e==null?void 0:e.reconnectAfterMs)!==null&&p!==void 0?p:(A=>I8[A-1]||$8);let _,b;const k=(f=e==null?void 0:e.vsn)!==null&&f!==void 0?f:l8;switch(k){case s8:_=(A,O)=>O(JSON.stringify(A)),b=(A,O)=>O(JSON.parse(A));break;case CN:_=this.serializer.encode.bind(this.serializer),b=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${x.vsn}`)}if(x.vsn=k,x.encode=(g=e==null?void 0:e.encode)!==null&&g!==void 0?g:_,x.decode=(v=e==null?void 0:e.decode)!==null&&v!==void 0?v:b,x.beforeReconnect=this._reconnectAuth.bind(this),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,x.params=Object.assign(Object.assign({},x.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e==null?void 0:e.workerUrl,x.autoSendHeartbeat=!this.worker}return x}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var zc=class extends Error{constructor(t,e){var r;super(t),this.name="IcebergError",this.status=e.status,this.icebergType=e.icebergType,this.icebergCode=e.icebergCode,this.details=e.details,this.isCommitStateUnknown=e.icebergType==="CommitStateUnknownException"||[500,502,504].includes(e.status)&&((r=e.icebergType)==null?void 0:r.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function B8(t,e,r){const n=new URL(e,t);if(r)for(const[i,a]of Object.entries(r))a!==void 0&&n.searchParams.set(i,a);return n.toString()}async function U8(t){return!t||t.type==="none"?{}:t.type==="bearer"?{Authorization:`Bearer ${t.token}`}:t.type==="header"?{[t.name]:t.value}:t.type==="custom"?await t.getHeaders():{}}function q8(t){const e=t.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:i,body:a,headers:o}){const l=B8(t.baseUrl,n,i),u=await U8(t.auth),d=await e(l,{method:r,headers:{...a?{"Content-Type":"application/json"}:{},...u,...o},body:a?JSON.stringify(a):void 0}),p=await d.text(),f=(d.headers.get("content-type")||"").includes("application/json"),g=f&&p?JSON.parse(p):p;if(!d.ok){const v=f?g:void 0,x=v==null?void 0:v.error;throw new zc((x==null?void 0:x.message)??`Request failed with status ${d.status}`,{status:d.status,icebergType:x==null?void 0:x.type,icebergCode:x==null?void 0:x.code,details:v})}return{status:d.status,headers:d.headers,data:g}}}}function of(t){return t.join("")}var F8=class{constructor(t,e=""){this.client=t,this.prefix=e}async listNamespaces(t){const e=t?{parent:of(t.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:e})).data.namespaces.map(n=>({namespace:n}))}async createNamespace(t,e){const r={namespace:t.namespace,properties:e==null?void 0:e.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${of(t.namespace)}`})}async loadNamespaceMetadata(t){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${of(t.namespace)}`})).data.properties}}async namespaceExists(t){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${of(t.namespace)}`}),!0}catch(e){if(e instanceof zc&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(t,e){try{return await this.createNamespace(t,e)}catch(r){if(r instanceof zc&&r.status===409)return;throw r}}};function bs(t){return t.join("")}var H8=class{constructor(t,e="",r){this.client=t,this.prefix=e,this.accessDelegation=r}async listTables(t){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${bs(t.namespace)}/tables`})).data.identifiers}async createTable(t,e){const r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${bs(t.namespace)}/tables`,body:e,headers:r})).data.metadata}async updateTable(t,e){const r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${bs(t.namespace)}/tables/${t.name}`,body:e});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(t,e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${bs(t.namespace)}/tables/${t.name}`,query:{purgeRequested:String((e==null?void 0:e.purge)??!1)}})}async loadTable(t){const e={};return this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${bs(t.namespace)}/tables/${t.name}`,headers:e})).data.metadata}async tableExists(t){const e={};this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${bs(t.namespace)}/tables/${t.name}`,headers:e}),!0}catch(r){if(r instanceof zc&&r.status===404)return!1;throw r}}async createTableIfNotExists(t,e){try{return await this.createTable(t,e)}catch(r){if(r instanceof zc&&r.status===409)return await this.loadTable({namespace:t.namespace,name:e.name});throw r}}},W8=class{constructor(t){var n;let e="v1";t.catalogName&&(e+=`/${t.catalogName}`);const r=t.baseUrl.endsWith("/")?t.baseUrl:`${t.baseUrl}/`;this.client=q8({baseUrl:r,auth:t.auth,fetchImpl:t.fetch}),this.accessDelegation=(n=t.accessDelegation)==null?void 0:n.join(","),this.namespaceOps=new F8(this.client,e),this.tableOps=new H8(this.client,e,this.accessDelegation)}async listNamespaces(t){return this.namespaceOps.listNamespaces(t)}async createNamespace(t,e){return this.namespaceOps.createNamespace(t,e)}async dropNamespace(t){await this.namespaceOps.dropNamespace(t)}async loadNamespaceMetadata(t){return this.namespaceOps.loadNamespaceMetadata(t)}async listTables(t){return this.tableOps.listTables(t)}async createTable(t,e){return this.tableOps.createTable(t,e)}async updateTable(t,e){return this.tableOps.updateTable(t,e)}async dropTable(t,e){await this.tableOps.dropTable(t,e)}async loadTable(t){return this.tableOps.loadTable(t)}async namespaceExists(t){return this.namespaceOps.namespaceExists(t)}async tableExists(t){return this.tableOps.tableExists(t)}async createNamespaceIfNotExists(t,e){return this.namespaceOps.createNamespaceIfNotExists(t,e)}async createTableIfNotExists(t,e){return this.tableOps.createTableIfNotExists(t,e)}};function Bc(t){"@babel/helpers - typeof";return Bc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bc(t)}function G8(t,e){if(Bc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Bc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function K8(t){var e=G8(t,"string");return Bc(e)=="symbol"?e:e+""}function V8(t,e,r){return(e=K8(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function iE(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Be(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?iE(Object(r),!0).forEach(function(n){V8(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):iE(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var Qh=class extends Error{constructor(t,e="storage",r,n){super(t),this.__isStorageError=!0,this.namespace=e,this.name=e==="vectors"?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function ep(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}var Vb=class extends Qh{constructor(t,e,r,n="storage"){super(t,n,e,r),this.name=n==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=e,this.statusCode=r}toJSON(){return Be({},super.toJSON())}},IN=class extends Qh{constructor(t,e,r="storage"){super(t,r),this.name=r==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=e}};function Lf(t,e,r){const n=Be({},t),i=e.toLowerCase();for(const a of Object.keys(n))a.toLowerCase()===i&&delete n[a];return n[i]=r,n}function X8(t){const e={};for(const[r,n]of Object.entries(t))e[r.toLowerCase()]=n;return e}const Y8=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),J8=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Xb=t=>{if(Array.isArray(t))return t.map(r=>Xb(r));if(typeof t=="function"||t!==Object(t))return t;const e={};return Object.entries(t).forEach(([r,n])=>{const i=r.replace(/([-_][a-z])/gi,a=>a.toUpperCase().replace(/[-_]/g,""));e[i]=Xb(n)}),e},Z8=t=>!t||typeof t!="string"||t.length===0||t.length>100||t.trim()!==t||t.includes("/")||t.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(t),aE=t=>{if(typeof t=="object"&&t!==null){const e=t;if(typeof e.msg=="string")return e.msg;if(typeof e.message=="string")return e.message;if(typeof e.error_description=="string")return e.error_description;if(typeof e.error=="string")return e.error;if(typeof e.error=="object"&&e.error!==null){const r=e.error;if(typeof r.message=="string")return r.message}}return JSON.stringify(t)},Q8=async(t,e,r,n)=>{if(t!==null&&typeof t=="object"&&"json"in t&&typeof t.json=="function"){const i=t;let a=parseInt(String(i.status),10);Number.isFinite(a)||(a=500),i.json().then(o=>{const l=(o==null?void 0:o.statusCode)||(o==null?void 0:o.code)||a+"";e(new Vb(aE(o),a,l,n))}).catch(()=>{const o=a+"";e(new Vb(i.statusText||`HTTP ${a} error`,a,o,n))})}else e(new IN(aE(t),t,n))},e6=(t,e,r,n)=>{const i={method:t,headers:(e==null?void 0:e.headers)||{}};if(t==="GET"||t==="HEAD"||!n)return Be(Be({},i),r);if(J8(n)){var a;const o=(e==null?void 0:e.headers)||{};let l;for(const[u,d]of Object.entries(o))u.toLowerCase()==="content-type"&&(l=d);i.headers=Lf(o,"Content-Type",(a=l)!==null&&a!==void 0?a:"application/json"),i.body=JSON.stringify(n)}else i.body=n;return e!=null&&e.duplex&&(i.duplex=e.duplex),Be(Be({},i),r)};async function fc(t,e,r,n,i,a,o){return new Promise((l,u)=>{t(r,e6(e,n,i,a)).then(d=>{if(!d.ok)throw d;if(n!=null&&n.noResolveJson)return d;if(o==="vectors"){const p=d.headers.get("content-type");if(d.headers.get("content-length")==="0"||d.status===204)return{};if(!p||!p.includes("application/json"))return{}}return d.json()}).then(d=>l(d)).catch(d=>Q8(d,u,n,o))})}function $N(t="storage"){return{get:async(e,r,n,i)=>fc(e,"GET",r,n,i,void 0,t),post:async(e,r,n,i,a)=>fc(e,"POST",r,i,a,n,t),put:async(e,r,n,i,a)=>fc(e,"PUT",r,i,a,n,t),head:async(e,r,n,i)=>fc(e,"HEAD",r,Be(Be({},n),{},{noResolveJson:!0}),i,void 0,t),remove:async(e,r,n,i,a)=>fc(e,"DELETE",r,i,a,n,t)}}const t6=$N("storage"),{get:Uc,post:Fn,put:Yb,head:r6,remove:Kw}=t6,cn=$N("vectors");var yl=class{constructor(t,e={},r,n="storage"){this.shouldThrowOnError=!1,this.url=t,this.headers=X8(e),this.fetch=Y8(r),this.namespace=n}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,e){return this.headers=Lf(this.headers,t,e),this}async handleOperation(t){var e=this;try{return{data:await t(),error:null}}catch(r){if(e.shouldThrowOnError)throw r;if(ep(r))return{data:null,error:r};throw r}}};let MN;MN=Symbol.toStringTag;var n6=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[MN]="StreamDownloadBuilder",this.promise=null}then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:(await t.downloadFn()).body,error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(ep(e))return{data:null,error:e};throw e}}};let LN;LN=Symbol.toStringTag;var i6=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[LN]="BlobDownloadBuilder",this.promise=null}asStream(){return new n6(this.downloadFn,this.shouldThrowOnError)}then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:await(await t.downloadFn()).blob(),error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(ep(e))return{data:null,error:e};throw e}}};const a6={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},oE={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var o6=class extends yl{constructor(t,e={},r,n){super(t,e,n,"storage"),this.bucketId=r}async uploadOrUpdate(t,e,r,n){var i=this;return i.handleOperation(async()=>{let a;const o=Be(Be({},oE),n);let l=Be(Be({},i.headers),t==="POST"&&{"x-upsert":String(o.upsert)});const u=o.metadata;if(typeof Blob<"u"&&r instanceof Blob?(a=new FormData,a.append("cacheControl",o.cacheControl),u&&a.append("metadata",i.encodeMetadata(u)),a.append("",r)):typeof FormData<"u"&&r instanceof FormData?(a=r,a.has("cacheControl")||a.append("cacheControl",o.cacheControl),u&&!a.has("metadata")&&a.append("metadata",i.encodeMetadata(u))):(a=r,l["cache-control"]=`max-age=${o.cacheControl}`,l["content-type"]=o.contentType,u&&(l["x-metadata"]=i.toBase64(i.encodeMetadata(u))),(typeof ReadableStream<"u"&&a instanceof ReadableStream||a&&typeof a=="object"&&"pipe"in a&&typeof a.pipe=="function")&&!o.duplex&&(o.duplex="half")),n!=null&&n.headers)for(const[g,v]of Object.entries(n.headers))l=Lf(l,g,v);const d=i._removeEmptyFolders(e),p=i._getFinalPath(d),f=await(t=="PUT"?Yb:Fn)(i.fetch,`${i.url}/object/${p}`,a,Be({headers:l},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{path:d,id:f.Id,fullPath:f.Key}})}async upload(t,e,r){return this.uploadOrUpdate("POST",t,e,r)}async uploadToSignedUrl(t,e,r,n){var i=this;const a=i._removeEmptyFolders(t),o=i._getFinalPath(a),l=new URL(i.url+`/object/upload/sign/${o}`);return l.searchParams.set("token",e),i.handleOperation(async()=>{let u;const d=Be(Be({},oE),n);let p=Be(Be({},i.headers),{"x-upsert":String(d.upsert)});const f=d.metadata;if(typeof Blob<"u"&&r instanceof Blob?(u=new FormData,u.append("cacheControl",d.cacheControl),f&&u.append("metadata",i.encodeMetadata(f)),u.append("",r)):typeof FormData<"u"&&r instanceof FormData?(u=r,u.has("cacheControl")||u.append("cacheControl",d.cacheControl),f&&!u.has("metadata")&&u.append("metadata",i.encodeMetadata(f))):(u=r,p["cache-control"]=`max-age=${d.cacheControl}`,p["content-type"]=d.contentType,f&&(p["x-metadata"]=i.toBase64(i.encodeMetadata(f))),(typeof ReadableStream<"u"&&u instanceof ReadableStream||u&&typeof u=="object"&&"pipe"in u&&typeof u.pipe=="function")&&!d.duplex&&(d.duplex="half")),n!=null&&n.headers)for(const[g,v]of Object.entries(n.headers))p=Lf(p,g,v);return{path:a,fullPath:(await Yb(i.fetch,l.toString(),u,Be({headers:p},d!=null&&d.duplex?{duplex:d.duplex}:{}))).Key}})}async createSignedUploadUrl(t,e){var r=this;return r.handleOperation(async()=>{let n=r._getFinalPath(t);const i=Be({},r.headers);e!=null&&e.upsert&&(i["x-upsert"]="true");const a=await Fn(r.fetch,`${r.url}/object/upload/sign/${n}`,{},{headers:i}),o=new URL(r.url+a.url),l=o.searchParams.get("token");if(!l)throw new Qh("No token returned by API");return{signedUrl:o.toString(),path:t,token:l}})}async update(t,e,r){return this.uploadOrUpdate("PUT",t,e,r)}async move(t,e,r){var n=this;return n.handleOperation(async()=>await Fn(n.fetch,`${n.url}/object/move`,{bucketId:n.bucketId,sourceKey:t,destinationKey:e,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers}))}async copy(t,e,r){var n=this;return n.handleOperation(async()=>({path:(await Fn(n.fetch,`${n.url}/object/copy`,{bucketId:n.bucketId,sourceKey:t,destinationKey:e,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers})).Key}))}async createSignedUrl(t,e,r){var n=this;return n.handleOperation(async()=>{let i=n._getFinalPath(t);const a=typeof(r==null?void 0:r.transform)=="object"&&r.transform!==null&&Object.keys(r.transform).length>0;let o=await Fn(n.fetch,`${n.url}/object/sign/${i}`,Be({expiresIn:e},a?{transform:r.transform}:{}),{headers:n.headers});const l=new URLSearchParams;r!=null&&r.download&&l.set("download",r.download===!0?"":r.download),(r==null?void 0:r.cacheNonce)!=null&&l.set("cacheNonce",String(r.cacheNonce));const u=l.toString();return{signedUrl:encodeURI(`${n.url}${o.signedURL}${u?`&${u}`:""}`)}})}async createSignedUrls(t,e,r){var n=this;return n.handleOperation(async()=>{const i=await Fn(n.fetch,`${n.url}/object/sign/${n.bucketId}`,{expiresIn:e,paths:t},{headers:n.headers}),a=new URLSearchParams;r!=null&&r.download&&a.set("download",r.download===!0?"":r.download),(r==null?void 0:r.cacheNonce)!=null&&a.set("cacheNonce",String(r.cacheNonce));const o=a.toString();return i.map(l=>Be(Be({},l),{},{signedUrl:l.signedURL?encodeURI(`${n.url}${l.signedURL}${o?`&${o}`:""}`):null}))})}download(t,e,r){const n=typeof(e==null?void 0:e.transform)=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image/authenticated":"object",i=new URLSearchParams;e!=null&&e.transform&&this.applyTransformOptsToQuery(i,e.transform),(e==null?void 0:e.cacheNonce)!=null&&i.set("cacheNonce",String(e.cacheNonce));const a=i.toString(),o=this._getFinalPath(t),l=()=>Uc(this.fetch,`${this.url}/${n}/${o}${a?`?${a}`:""}`,{headers:this.headers,noResolveJson:!0},r);return new i6(l,this.shouldThrowOnError)}async info(t){var e=this;const r=e._getFinalPath(t);return e.handleOperation(async()=>Xb(await Uc(e.fetch,`${e.url}/object/info/${r}`,{headers:e.headers})))}async exists(t){var e=this;const r=e._getFinalPath(t);try{return await r6(e.fetch,`${e.url}/object/${r}`,{headers:e.headers}),{data:!0,error:null}}catch(i){if(e.shouldThrowOnError)throw i;if(ep(i)){var n;const a=i instanceof Vb?i.status:i instanceof IN?(n=i.originalError)===null||n===void 0?void 0:n.status:void 0;if(a!==void 0&&[400,404].includes(a))return{data:!1,error:i}}throw i}}getPublicUrl(t,e){const r=this._getFinalPath(t),n=new URLSearchParams;e!=null&&e.download&&n.set("download",e.download===!0?"":e.download),e!=null&&e.transform&&this.applyTransformOptsToQuery(n,e.transform),(e==null?void 0:e.cacheNonce)!=null&&n.set("cacheNonce",String(e.cacheNonce));const i=n.toString(),a=typeof(e==null?void 0:e.transform)=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${r}`)+(i?`?${i}`:"")}}}async remove(t){var e=this;return e.handleOperation(async()=>await Kw(e.fetch,`${e.url}/object/${e.bucketId}`,{prefixes:t},{headers:e.headers}))}async list(t,e,r){var n=this;return n.handleOperation(async()=>{const i=Be(Be(Be({},a6),e),{},{prefix:t||""});return await Fn(n.fetch,`${n.url}/object/list/${n.bucketId}`,i,{headers:n.headers},r)})}async listV2(t,e){var r=this;return r.handleOperation(async()=>{const n=Be({},t);return await Fn(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,n,{headers:r.headers},e)})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(t,e){return e.width&&t.set("width",e.width.toString()),e.height&&t.set("height",e.height.toString()),e.resize&&t.set("resize",e.resize),e.format&&t.set("format",e.format),e.quality&&t.set("quality",e.quality.toString()),t}};const s6="2.106.2",Pu={"X-Client-Info":`storage-js/${s6}`};var l6=class extends yl{constructor(t,e={},r,n){const i=new URL(t);n!=null&&n.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase."));const a=i.href.replace(/\/$/,""),o=Be(Be({},Pu),e);super(a,o,r,"storage")}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const r=e.listBucketOptionsToQueryString(t);return await Uc(e.fetch,`${e.url}/bucket${r}`,{headers:e.headers})})}async getBucket(t){var e=this;return e.handleOperation(async()=>await Uc(e.fetch,`${e.url}/bucket/${t}`,{headers:e.headers}))}async createBucket(t,e={public:!1}){var r=this;return r.handleOperation(async()=>await Fn(r.fetch,`${r.url}/bucket`,{id:t,name:t,type:e.type,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:r.headers}))}async updateBucket(t,e){var r=this;return r.handleOperation(async()=>await Yb(r.fetch,`${r.url}/bucket/${t}`,{id:t,name:t,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:r.headers}))}async emptyBucket(t){var e=this;return e.handleOperation(async()=>await Fn(e.fetch,`${e.url}/bucket/${t}/empty`,{},{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await Kw(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}listBucketOptionsToQueryString(t){const e={};return t&&("limit"in t&&(e.limit=String(t.limit)),"offset"in t&&(e.offset=String(t.offset)),t.search&&(e.search=t.search),t.sortColumn&&(e.sortColumn=t.sortColumn),t.sortOrder&&(e.sortOrder=t.sortOrder)),Object.keys(e).length>0?"?"+new URLSearchParams(e).toString():""}},c6=class extends yl{constructor(t,e={},r){const n=t.replace(/\/$/,""),i=Be(Be({},Pu),e);super(n,i,r,"storage")}async createBucket(t){var e=this;return e.handleOperation(async()=>await Fn(e.fetch,`${e.url}/bucket`,{name:t},{headers:e.headers}))}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const r=new URLSearchParams;(t==null?void 0:t.limit)!==void 0&&r.set("limit",t.limit.toString()),(t==null?void 0:t.offset)!==void 0&&r.set("offset",t.offset.toString()),t!=null&&t.sortColumn&&r.set("sortColumn",t.sortColumn),t!=null&&t.sortOrder&&r.set("sortOrder",t.sortOrder),t!=null&&t.search&&r.set("search",t.search);const n=r.toString(),i=n?`${e.url}/bucket?${n}`:`${e.url}/bucket`;return await Uc(e.fetch,i,{headers:e.headers})})}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await Kw(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}from(t){var e=this;if(!Z8(t))throw new Qh("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const r=new W8({baseUrl:this.url,catalogName:t,auth:{type:"custom",getHeaders:async()=>e.headers},fetch:this.fetch}),n=this.shouldThrowOnError;return new Proxy(r,{get(i,a){const o=i[a];return typeof o!="function"?o:async(...l)=>{try{return{data:await o.apply(i,l),error:null}}catch(u){if(n)throw u;return{data:null,error:u}}}}})}},u6=class extends yl{constructor(t,e={},r){const n=t.replace(/\/$/,""),i=Be(Be({},Pu),{},{"Content-Type":"application/json"},e);super(n,i,r,"vectors")}async createIndex(t){var e=this;return e.handleOperation(async()=>await cn.post(e.fetch,`${e.url}/CreateIndex`,t,{headers:e.headers})||{})}async getIndex(t,e){var r=this;return r.handleOperation(async()=>await cn.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:t,indexName:e},{headers:r.headers}))}async listIndexes(t){var e=this;return e.handleOperation(async()=>await cn.post(e.fetch,`${e.url}/ListIndexes`,t,{headers:e.headers}))}async deleteIndex(t,e){var r=this;return r.handleOperation(async()=>await cn.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:t,indexName:e},{headers:r.headers})||{})}},d6=class extends yl{constructor(t,e={},r){const n=t.replace(/\/$/,""),i=Be(Be({},Pu),{},{"Content-Type":"application/json"},e);super(n,i,r,"vectors")}async putVectors(t){var e=this;if(t.vectors.length<1||t.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return e.handleOperation(async()=>await cn.post(e.fetch,`${e.url}/PutVectors`,t,{headers:e.headers})||{})}async getVectors(t){var e=this;return e.handleOperation(async()=>await cn.post(e.fetch,`${e.url}/GetVectors`,t,{headers:e.headers}))}async listVectors(t){var e=this;if(t.segmentCount!==void 0){if(t.segmentCount<1||t.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(t.segmentIndex!==void 0&&(t.segmentIndex<0||t.segmentIndex>=t.segmentCount))throw new Error(`segmentIndex must be between 0 and ${t.segmentCount-1}`)}return e.handleOperation(async()=>await cn.post(e.fetch,`${e.url}/ListVectors`,t,{headers:e.headers}))}async queryVectors(t){var e=this;return e.handleOperation(async()=>await cn.post(e.fetch,`${e.url}/QueryVectors`,t,{headers:e.headers}))}async deleteVectors(t){var e=this;if(t.keys.length<1||t.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return e.handleOperation(async()=>await cn.post(e.fetch,`${e.url}/DeleteVectors`,t,{headers:e.headers})||{})}},f6=class extends yl{constructor(t,e={},r){const n=t.replace(/\/$/,""),i=Be(Be({},Pu),{},{"Content-Type":"application/json"},e);super(n,i,r,"vectors")}async createBucket(t){var e=this;return e.handleOperation(async()=>await cn.post(e.fetch,`${e.url}/CreateVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}async getBucket(t){var e=this;return e.handleOperation(async()=>await cn.post(e.fetch,`${e.url}/GetVectorBucket`,{vectorBucketName:t},{headers:e.headers}))}async listBuckets(t={}){var e=this;return e.handleOperation(async()=>await cn.post(e.fetch,`${e.url}/ListVectorBuckets`,t,{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await cn.post(e.fetch,`${e.url}/DeleteVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}},h6=class extends f6{constructor(t,e={}){super(t,e.headers||{},e.fetch)}from(t){return new p6(this.url,this.headers,t,this.fetch)}async createBucket(t){var e=()=>super.createBucket,r=this;return e().call(r,t)}async getBucket(t){var e=()=>super.getBucket,r=this;return e().call(r,t)}async listBuckets(t={}){var e=()=>super.listBuckets,r=this;return e().call(r,t)}async deleteBucket(t){var e=()=>super.deleteBucket,r=this;return e().call(r,t)}},p6=class extends u6{constructor(t,e,r,n){super(t,e,n),this.vectorBucketName=r}async createIndex(t){var e=()=>super.createIndex,r=this;return e().call(r,Be(Be({},t),{},{vectorBucketName:r.vectorBucketName}))}async listIndexes(t={}){var e=()=>super.listIndexes,r=this;return e().call(r,Be(Be({},t),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(t){var e=()=>super.getIndex,r=this;return e().call(r,r.vectorBucketName,t)}async deleteIndex(t){var e=()=>super.deleteIndex,r=this;return e().call(r,r.vectorBucketName,t)}index(t){return new m6(this.url,this.headers,this.vectorBucketName,t,this.fetch)}},m6=class extends d6{constructor(t,e,r,n,i){super(t,e,i),this.vectorBucketName=r,this.indexName=n}async putVectors(t){var e=()=>super.putVectors,r=this;return e().call(r,Be(Be({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(t){var e=()=>super.getVectors,r=this;return e().call(r,Be(Be({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(t={}){var e=()=>super.listVectors,r=this;return e().call(r,Be(Be({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(t){var e=()=>super.queryVectors,r=this;return e().call(r,Be(Be({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(t){var e=()=>super.deleteVectors,r=this;return e().call(r,Be(Be({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},g6=class extends l6{constructor(t,e={},r,n){super(t,e,r,n)}from(t){return new o6(this.url,this.headers,t,this.fetch)}get vectors(){return new h6(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new c6(this.url+"/iceberg",this.headers,this.fetch)}};const DN="2.106.2",js=30*1e3,Jb=3,Sg=Jb*js,y6="http://localhost:9999",v6="supabase.auth.token",b6={"X-Client-Info":`gotrue-js/${DN}`},Zb="X-Supabase-Api-Version",zN={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},x6=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,w6=600*1e3;class Fs extends Error{constructor(e,r,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function be(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class _6 extends Fs{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.code=n}}function S6(t){return be(t)&&t.name==="AuthApiError"}class Xn extends Fs{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}}class ta extends Fs{constructor(e,r,n,i){super(e,n,i),this.name=r,this.status=n}}class pr extends ta{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function sf(t){return be(t)&&t.name==="AuthSessionMissingError"}class xs extends ta{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class lf extends ta{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class cf extends ta{constructor(e,r=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function k6(t){return be(t)&&t.name==="AuthImplicitGrantRedirectError"}class sE extends ta{constructor(e,r=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class E6 extends ta{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class Qb extends ta{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}}function kg(t){return be(t)&&t.name==="AuthRetryableFetchError"}class lE extends ta{constructor(e,r,n){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class ex extends ta{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const Df="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),cE=`
413
+ \r=`.split(""),O6=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<cE.length;e+=1)t[cE[e].charCodeAt(0)]=-2;for(let e=0;e<Df.length;e+=1)t[Df[e].charCodeAt(0)]=e;return t})();function uE(t,e,r){if(t!==null)for(e.queue=e.queue<<8|t,e.queuedBits+=8;e.queuedBits>=6;){const n=e.queue>>e.queuedBits-6&63;r(Df[n]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){const n=e.queue>>e.queuedBits-6&63;r(Df[n]),e.queuedBits-=6}}function BN(t,e,r){const n=O6[t];if(n>-1)for(e.queue=e.queue<<6|n,e.queuedBits+=6;e.queuedBits>=8;)r(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(n===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(t)}"`)}}function dE(t){const e=[],r=o=>{e.push(String.fromCodePoint(o))},n={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},a=o=>{C6(o,n,r)};for(let o=0;o<t.length;o+=1)BN(t.charCodeAt(o),i,a);return e.join("")}function A6(t,e){if(t<=127){e(t);return}else if(t<=2047){e(192|t>>6),e(128|t&63);return}else if(t<=65535){e(224|t>>12),e(128|t>>6&63),e(128|t&63);return}else if(t<=1114111){e(240|t>>18),e(128|t>>12&63),e(128|t>>6&63),e(128|t&63);return}throw new Error(`Unrecognized Unicode codepoint: ${t.toString(16)}`)}function T6(t,e){for(let r=0;r<t.length;r+=1){let n=t.charCodeAt(r);if(n>55295&&n<=56319){const i=(n-55296)*1024&65535;n=(t.charCodeAt(r+1)-56320&65535|i)+65536,r+=1}A6(n,e)}}function C6(t,e,r){if(e.utf8seq===0){if(t<=127){r(t);return}for(let n=1;n<6;n+=1)if((t>>7-n&1)===0){e.utf8seq=n;break}if(e.utf8seq===2)e.codepoint=t&31;else if(e.utf8seq===3)e.codepoint=t&15;else if(e.utf8seq===4)e.codepoint=t&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(t<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|t&63,e.utf8seq-=1,e.utf8seq===0&&r(e.codepoint)}}function Ls(t){const e=[],r={queue:0,queuedBits:0},n=i=>{e.push(i)};for(let i=0;i<t.length;i+=1)BN(t.charCodeAt(i),r,n);return new Uint8Array(e)}function j6(t){const e=[];return T6(t,r=>e.push(r)),new Uint8Array(e)}function _o(t){const e=[],r={queue:0,queuedBits:0},n=i=>{e.push(i)};return t.forEach(i=>uE(i,r,n)),uE(null,r,n),e.join("")}function P6(t){return Math.round(Date.now()/1e3)+t}function N6(){return Symbol("auth-callback")}const xr=()=>typeof window<"u"&&typeof document<"u",mo={tested:!1,writable:!1},UN=()=>{if(!xr())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(mo.tested)return mo.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),mo.tested=!0,mo.writable=!0}catch{mo.tested=!0,mo.writable=!1}return mo.writable};function R6(t){const e={},r=new URL(t);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((i,a)=>{e[a]=i})}catch{}return r.searchParams.forEach((n,i)=>{e[i]=n}),e}const qN=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),I6=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",Ps=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))},go=async(t,e)=>{const r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return null}},br=async(t,e)=>{await t.removeItem(e)};class tp{constructor(){this.promise=new tp.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}}tp.promiseConstructor=Promise;function uf(t){const e=t.split(".");if(e.length!==3)throw new ex("Invalid JWT structure");for(let n=0;n<e.length;n++)if(!x6.test(e[n]))throw new ex("JWT not in base64url format");return{header:JSON.parse(dE(e[0])),payload:JSON.parse(dE(e[1])),signature:Ls(e[2]),raw:{header:e[0],payload:e[1]}}}async function $6(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function M6(t,e){return new Promise((n,i)=>{(async()=>{for(let a=0;a<1/0;a++)try{const o=await t(a);if(!e(a,null,o)){n(o);return}}catch(o){if(!e(a,o)){i(o);return}}})()})}function L6(t){return("0"+t.toString(16)).substr(-2)}function D6(){const e=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length;let i="";for(let a=0;a<56;a++)i+=r.charAt(Math.floor(Math.random()*n));return i}return crypto.getRandomValues(e),Array.from(e,L6).join("")}async function z6(t){const r=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",r),i=new Uint8Array(n);return Array.from(i).map(a=>String.fromCharCode(a)).join("")}async function B6(t){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),t;const r=await z6(t);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function ws(t,e,r=!1){const n=D6();let i=n;r&&(i+="/recovery"),await Ps(t,`${e}-code-verifier`,i);const a=await B6(n);return[a,n===a?"plain":"s256"]}const U6=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function q6(t){const e=t.headers.get(Zb);if(!e||!e.match(U6))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function F6(t){if(!t)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(t<=e)throw new Error("JWT has expired")}function H6(t){switch(t){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const W6=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Li(t){if(!W6.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function qn(t){if(!t.passkey)throw new Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function Eg(){const t={};return new Proxy(t,{get:(e,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const n=r.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function G6(t,e){return new Proxy(t,{get:(r,n,i)=>{if(n==="__isInsecureUserWarningProxy")return!0;if(typeof n=="symbol"){const a=n.toString();if(a==="Symbol(Symbol.toPrimitive)"||a==="Symbol(Symbol.toStringTag)"||a==="Symbol(util.inspect.custom)"||a==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,n,i)}return!e.value&&typeof n=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),e.value=!0),Reflect.get(r,n,i)}})}function fE(t){return JSON.parse(JSON.stringify(t))}const vo=t=>{if(typeof t=="object"&&t!==null){const e=t;if(typeof e.msg=="string")return e.msg;if(typeof e.message=="string")return e.message;if(typeof e.error_description=="string")return e.error_description;if(typeof e.error=="string")return e.error}return JSON.stringify(t)},K6=[502,503,504,520,521,522,523,524,530];async function hE(t){var e;if(!I6(t))throw new Qb(vo(t),0);if(K6.includes(t.status))throw new Qb(vo(t),t.status);let r;try{r=await t.json()}catch(a){throw new Xn(vo(a),a)}let n;const i=q6(t);if(i&&i.getTime()>=zN["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new lE(vo(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(n==="session_not_found")throw new pr}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((a,o)=>a&&typeof o=="string",!0))throw new lE(vo(r),t.status,r.weak_password.reasons);throw new _6(vo(r),t.status||500,n)}const V6=(t,e,r,n)=>{const i={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),i.body=JSON.stringify(n),Object.assign(Object.assign({},i),r))};async function Pe(t,e,r,n){var i;const a=Object.assign({},n==null?void 0:n.headers);a[Zb]||(a[Zb]=zN["2024-01-01"].name),n!=null&&n.jwt&&(a.Authorization=`Bearer ${n.jwt}`);const o=(i=n==null?void 0:n.query)!==null&&i!==void 0?i:{};n!=null&&n.redirectTo&&(o.redirect_to=n.redirectTo);const l=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",u=await X6(t,e,r+l,{headers:a,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(u):{data:Object.assign({},u),error:null}}async function X6(t,e,r,n,i,a){const o=V6(e,n,i,a);let l;try{l=await t(r,Object.assign({},o))}catch(u){throw console.error(u),new Qb(vo(u),0)}if(l.ok||await hE(l),n!=null&&n.noResolveJson)return l;try{return await l.json()}catch(u){await hE(u)}}function On(t){var e;let r=null;Z6(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=P6(t.expires_in)));const n=(e=t.user)!==null&&e!==void 0?e:typeof(t==null?void 0:t.id)=="string"?t:null;return{data:{session:r,user:n},error:null}}function pE(t){const e=On(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((r,n)=>r&&typeof n=="string",!0)&&(e.data.weak_password=t.weak_password),e}function Pa(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function Y6(t){return{data:t,error:null}}function J6(t){const{action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:a}=t,o=Zh(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),l={action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:a},u=Object.assign({},o);return{data:{properties:l,user:u},error:null}}function mE(t){return t}function Z6(t){return!!t.access_token&&!!t.refresh_token&&!!t.expires_in}const Og=["global","local","others"];class Q6{_encodePathSegment(e){if(e==="."||e==="..")throw new Fs("Invalid path segment");return encodeURIComponent(e)}constructor({url:e="",headers:r={},fetch:n,experimental:i}){this.url=e,this.headers=r,this.fetch=qN(n),this.experimental=i??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(e,r=Og[0]){if(Og.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Og.join(", ")}`);try{return await Pe(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if(be(n))return{data:null,error:n};throw n}}async inviteUserByEmail(e,r={}){try{return await Pe(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:Pa})}catch(n){if(be(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{const{options:r}=e,n=Zh(e,["options"]),i=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(i.new_email=n==null?void 0:n.newEmail,delete i.newEmail),await Pe(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:J6,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(be(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(e){try{return await Pe(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:Pa})}catch(r){if(be(r))return{data:{user:null},error:r};throw r}}async listUsers(e){var r,n,i,a,o,l,u;try{const d={nextPage:null,lastPage:0,total:0},p=await Pe(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e==null?void 0:e.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(a=(i=e==null?void 0:e.perPage)===null||i===void 0?void 0:i.toString())!==null&&a!==void 0?a:""},xform:mE});if(p.error)throw p.error;const f=await p.json(),g=(o=p.headers.get("x-total-count"))!==null&&o!==void 0?o:0,v=(u=(l=p.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&u!==void 0?u:[];return v.length>0&&(v.forEach(x=>{const _=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(x.split(";")[1].split("=")[1]);d[`${b}Page`]=_}),d.total=parseInt(g)),{data:Object.assign(Object.assign({},f),d),error:null}}catch(d){if(be(d))return{data:{users:[]},error:d};throw d}}async getUserById(e){Li(e);try{return await Pe(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:Pa})}catch(r){if(be(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){Li(e);try{return await Pe(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:Pa})}catch(n){if(be(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,r=!1){Li(e);try{return await Pe(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:Pa})}catch(n){if(be(n))return{data:{user:null},error:n};throw n}}async _listFactors(e){Li(e.userId);try{const{data:r,error:n}=await Pe(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:r,error:n}}catch(r){if(be(r))return{data:null,error:r};throw r}}async _deleteFactor(e){Li(e.userId),Li(e.id);try{return{data:await Pe(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(r){if(be(r))return{data:null,error:r};throw r}}async _listOAuthClients(e){var r,n,i,a,o,l,u;try{const d={nextPage:null,lastPage:0,total:0},p=await Pe(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e==null?void 0:e.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(a=(i=e==null?void 0:e.perPage)===null||i===void 0?void 0:i.toString())!==null&&a!==void 0?a:""},xform:mE});if(p.error)throw p.error;const f=await p.json(),g=(o=p.headers.get("x-total-count"))!==null&&o!==void 0?o:0,v=(u=(l=p.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&u!==void 0?u:[];return v.length>0&&(v.forEach(x=>{const _=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(x.split(";")[1].split("=")[1]);d[`${b}Page`]=_}),d.total=parseInt(g)),{data:Object.assign(Object.assign({},f),d),error:null}}catch(d){if(be(d))return{data:{clients:[]},error:d};throw d}}async _createOAuthClient(e){try{return await Pe(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(be(r))return{data:null,error:r};throw r}}async _getOAuthClient(e){try{const r=this._encodePathSegment(e);return await Pe(this.fetch,"GET",`${this.url}/admin/oauth/clients/${r}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(r){if(be(r))return{data:null,error:r};throw r}}async _updateOAuthClient(e,r){try{const n=this._encodePathSegment(e);return await Pe(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${n}`,{body:r,headers:this.headers,xform:i=>({data:i,error:null})})}catch(n){if(be(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(e){try{const r=this._encodePathSegment(e);return await Pe(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${r}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(be(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(e){try{const r=this._encodePathSegment(e);return await Pe(this.fetch,"POST",`${this.url}/admin/oauth/clients/${r}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(r){if(be(r))return{data:null,error:r};throw r}}async _listCustomProviders(e){try{const r={};return e!=null&&e.type&&(r.type=e.type),await Pe(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:r,xform:n=>{var i;return{data:{providers:(i=n==null?void 0:n.providers)!==null&&i!==void 0?i:[]},error:null}}})}catch(r){if(be(r))return{data:{providers:[]},error:r};throw r}}async _createCustomProvider(e){try{return await Pe(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(be(r))return{data:null,error:r};throw r}}async _getCustomProvider(e){try{const r=this._encodePathSegment(e);return await Pe(this.fetch,"GET",`${this.url}/admin/custom-providers/${r}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(r){if(be(r))return{data:null,error:r};throw r}}async _updateCustomProvider(e,r){try{const n=this._encodePathSegment(e);return await Pe(this.fetch,"PUT",`${this.url}/admin/custom-providers/${n}`,{body:r,headers:this.headers,xform:i=>({data:i,error:null})})}catch(n){if(be(n))return{data:null,error:n};throw n}}async _deleteCustomProvider(e){try{const r=this._encodePathSegment(e);return await Pe(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${r}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(be(r))return{data:null,error:r};throw r}}async _adminListPasskeys(e){qn(this.experimental),Li(e.userId);try{return await Pe(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/passkeys`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(be(r))return{data:null,error:r};throw r}}async _adminDeletePasskey(e){qn(this.experimental),Li(e.userId),Li(e.passkeyId);try{return await Pe(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/passkeys/${e.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(be(r))return{data:null,error:r};throw r}}}function gE(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}const yi={debug:!!(globalThis&&UN()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class FN extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class yE extends FN{}async function eU(t,e,r){yi.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);const n=new globalThis.AbortController;let i;e>0&&(i=setTimeout(()=>{n.abort(),yi.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e)),await Promise.resolve();try{return await globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async a=>{if(a){clearTimeout(i),yi.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,a.name);try{return await r()}finally{yi.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,a.name)}}else{if(e===0)throw yi.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new yE(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(yi.debug)try{const o=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(o,null," "))}catch(o){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",o)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),clearTimeout(i),await r()}})}catch(a){if(e>0&&clearTimeout(i),a!==null&&typeof a=="object"&&"name"in a&&a.name==="AbortError"&&e>0){if(n.signal.aborted)return yi.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",t),console.warn(`@supabase/gotrue-js: Lock "${t}" was not released within ${e}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,{mode:"exclusive",steal:!0},async o=>{if(o){yi.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",t,o.name);try{return await r()}finally{yi.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",t,o.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await r()}));throw yi.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",t),new yE(`Lock "${t}" was released because another request stole it`)}throw a}}function tU(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function HN(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}" is invalid.`);return t.toLowerCase()}function rU(t){return parseInt(t,16)}function nU(t){const e=new TextEncoder().encode(t);return"0x"+Array.from(e,n=>n.toString(16).padStart(2,"0")).join("")}function iU(t){var e;const{chainId:r,domain:n,expirationTime:i,issuedAt:a=new Date,nonce:o,notBefore:l,requestId:u,resources:d,scheme:p,uri:f,version:g}=t;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!n)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(o&&o.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${o}`);if(!f)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(g!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${g}`);if(!((e=t.statement)===null||e===void 0)&&e.includes(`
414
+ `))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${t.statement}`)}const v=HN(t.address),x=p?`${p}://${n}`:n,_=t.statement?`${t.statement}
415
+ `:"",b=`${x} wants you to sign in with your Ethereum account:
416
+ ${v}
417
+
418
+ ${_}`;let k=`URI: ${f}
419
+ Version: ${g}
420
+ Chain ID: ${r}${o?`
421
+ Nonce: ${o}`:""}
422
+ Issued At: ${a.toISOString()}`;if(i&&(k+=`
423
+ Expiration Time: ${i.toISOString()}`),l&&(k+=`
424
+ Not Before: ${l.toISOString()}`),u&&(k+=`
425
+ Request ID: ${u}`),d){let A=`
426
+ Resources:`;for(const O of d){if(!O||typeof O!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${O}`);A+=`
427
+ - ${O}`}k+=A}return`${b}
428
+ ${k}`}class Zt extends Error{constructor({message:e,code:r,cause:n,name:i}){var a;super(e,{cause:n}),this.__isWebAuthnError=!0,this.name=(a=i??(n instanceof Error?n.name:void 0))!==null&&a!==void 0?a:"Unknown Error",this.code=r}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class zf extends Zt{constructor(e,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:e}),this.name="WebAuthnUnknownError",this.originalError=r}}function aU({error:t,options:e}){var r,n,i;const{publicKey:a}=e;if(!a)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new Zt({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(((r=a.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new Zt({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:t});if(e.mediation==="conditional"&&((n=a.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new Zt({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:t});if(((i=a.authenticatorSelection)===null||i===void 0?void 0:i.userVerification)==="required")return new Zt({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:t})}else{if(t.name==="InvalidStateError")return new Zt({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new Zt({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return a.pubKeyCredParams.filter(l=>l.type==="public-key").length===0?new Zt({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new Zt({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:t});if(t.name==="SecurityError"){const o=window.location.hostname;if(WN(o)){if(a.rp.id!==o)return new Zt({message:`The RP ID "${a.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Zt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(a.user.id.byteLength<1||a.user.id.byteLength>64)return new Zt({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:t})}else if(t.name==="UnknownError")return new Zt({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new Zt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function oU({error:t,options:e}){const{publicKey:r}=e;if(!r)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new Zt({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new Zt({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const n=window.location.hostname;if(WN(n)){if(r.rpId!==n)return new Zt({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Zt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new Zt({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new Zt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}class sU{createNewAbortSignal(){if(this.controller){const r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}const e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){const e=new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}}const tx=new sU;function vE(t){if(!t)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(t);const{challenge:e,user:r,excludeCredentials:n}=t,i=Zh(t,["challenge","user","excludeCredentials"]),a=Ls(e).buffer,o=Object.assign(Object.assign({},r),{id:Ls(r.id).buffer}),l=Object.assign(Object.assign({},i),{challenge:a,user:o});if(n&&n.length>0){l.excludeCredentials=new Array(n.length);for(let u=0;u<n.length;u++){const d=n[u];l.excludeCredentials[u]=Object.assign(Object.assign({},d),{id:Ls(d.id).buffer,type:d.type||"public-key",transports:d.transports})}}return l}function bE(t){if(!t)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(t);const{challenge:e,allowCredentials:r}=t,n=Zh(t,["challenge","allowCredentials"]),i=Ls(e).buffer,a=Object.assign(Object.assign({},n),{challenge:i});if(r&&r.length>0){a.allowCredentials=new Array(r.length);for(let o=0;o<r.length;o++){const l=r[o];a.allowCredentials[o]=Object.assign(Object.assign({},l),{id:Ls(l.id).buffer,type:l.type||"public-key",transports:l.transports})}}return a}function xE(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const r=t;return{id:t.id,rawId:t.id,response:{attestationObject:_o(new Uint8Array(t.response.attestationObject)),clientDataJSON:_o(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function wE(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const r=t,n=t.getClientExtensionResults(),i=t.response;return{id:t.id,rawId:t.id,response:{authenticatorData:_o(new Uint8Array(i.authenticatorData)),clientDataJSON:_o(new Uint8Array(i.clientDataJSON)),signature:_o(new Uint8Array(i.signature)),userHandle:i.userHandle?_o(new Uint8Array(i.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function WN(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function Bf(){var t,e;return!!(xr()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.create)=="function"&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.get)=="function")}async function GN(t){try{const e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new zf("Browser returned unexpected credential type",e)}:{data:null,error:new zf("Empty credential response",e)}}catch(e){return{data:null,error:aU({error:e,options:t})}}}async function KN(t){try{const e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new zf("Browser returned unexpected credential type",e)}:{data:null,error:new zf("Empty credential response",e)}}catch(e){return{data:null,error:oU({error:e,options:t})}}}const lU={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},cU={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Uf(...t){const e=i=>i!==null&&typeof i=="object"&&!Array.isArray(i),r=i=>i instanceof ArrayBuffer||ArrayBuffer.isView(i),n={};for(const i of t)if(i)for(const a in i){const o=i[a];if(o!==void 0)if(Array.isArray(o))n[a]=o;else if(r(o))n[a]=o;else if(e(o)){const l=n[a];e(l)?n[a]=Uf(l,o):n[a]=Uf(o)}else n[a]=o}return n}function uU(t,e){return Uf(lU,t,e||{})}function dU(t,e){return Uf(cU,t,e||{})}class fU{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:r,friendlyName:n,signal:i},a){var o;try{const{data:l,error:u}=await this.client.mfa.challenge({factorId:e,webauthn:r});if(!l)return{data:null,error:u};const d=i??tx.createNewAbortSignal();if(l.webauthn.type==="create"){const{user:p}=l.webauthn.credential_options.publicKey;if(!p.name){const f=n;if(f)p.name=`${p.id}:${f}`;else{const v=(await this.client.getUser()).data.user,x=((o=v==null?void 0:v.user_metadata)===null||o===void 0?void 0:o.name)||(v==null?void 0:v.email)||(v==null?void 0:v.id)||"User";p.name=`${p.id}:${x}`}}p.displayName||(p.displayName=p.name)}switch(l.webauthn.type){case"create":{const p=uU(l.webauthn.credential_options.publicKey,a==null?void 0:a.create),{data:f,error:g}=await GN({publicKey:p,signal:d});return f?{data:{factorId:e,challengeId:l.id,webauthn:{type:l.webauthn.type,credential_response:f}},error:null}:{data:null,error:g}}case"request":{const p=dU(l.webauthn.credential_options.publicKey,a==null?void 0:a.request),{data:f,error:g}=await KN(Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:p,signal:d}));return f?{data:{factorId:e,challengeId:l.id,webauthn:{type:l.webauthn.type,credential_response:f}},error:null}:{data:null,error:g}}}}catch(l){return be(l)?{data:null,error:l}:{data:null,error:new Xn("Unexpected error in challenge",l)}}}async _verify({challengeId:e,factorId:r,webauthn:n}){return this.client.mfa.verify({factorId:r,challengeId:e,webauthn:n})}async _authenticate({factorId:e,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:i}={}},a){if(!r)return{data:null,error:new Fs("rpId is required for WebAuthn authentication")};try{if(!Bf())return{data:null,error:new Xn("Browser does not support WebAuthn",null)};const{data:o,error:l}=await this.challenge({factorId:e,webauthn:{rpId:r,rpOrigins:n},signal:i},{request:a});if(!o)return{data:null,error:l};const{webauthn:u}=o;return this._verify({factorId:e,challengeId:o.challengeId,webauthn:{type:u.type,rpId:r,rpOrigins:n,credential_response:u.credential_response}})}catch(o){return be(o)?{data:null,error:o}:{data:null,error:new Xn("Unexpected error in authenticate",o)}}}async _register({friendlyName:e,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:i}={}},a){if(!r)return{data:null,error:new Fs("rpId is required for WebAuthn registration")};try{if(!Bf())return{data:null,error:new Xn("Browser does not support WebAuthn",null)};const{data:o,error:l}=await this._enroll({friendlyName:e});if(!o)return await this.client.mfa.listFactors().then(p=>{var f;return(f=p.data)===null||f===void 0?void 0:f.all.find(g=>g.factor_type==="webauthn"&&g.friendly_name===e&&g.status!=="unverified")}).then(p=>p?this.client.mfa.unenroll({factorId:p==null?void 0:p.id}):void 0),{data:null,error:l};const{data:u,error:d}=await this._challenge({factorId:o.id,friendlyName:o.friendly_name,webauthn:{rpId:r,rpOrigins:n},signal:i},{create:a});return u?this._verify({factorId:o.id,challengeId:u.challengeId,webauthn:{rpId:r,rpOrigins:n,type:u.webauthn.type,credential_response:u.webauthn.credential_response}}):{data:null,error:d}}catch(o){return be(o)?{data:null,error:o}:{data:null,error:new Xn("Unexpected error in register",o)}}}}tU();const hU={url:y6,storageKey:v6,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:b6,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}};async function _E(t,e,r){return await r()}const _s={};class qc{get jwks(){var e,r;return(r=(e=_s[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(e){_s[this.storageKey]=Object.assign(Object.assign({},_s[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,r;return(r=(e=_s[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){_s[this.storageKey]=Object.assign(Object.assign({},_s[this.storageKey]),{cachedAt:e})}constructor(e){var r,n,i,a;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const o=Object.assign(Object.assign({},hU),e);if(this.storageKey=o.storageKey,this.instanceID=(r=qc.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,qc.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!o.debug,typeof o.debug=="function"&&(this.logger=o.debug),this.instanceID>0&&xr()){const l=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(l),this.logDebugMessages&&console.trace(l)}if(this.persistSession=o.persistSession,this.autoRefreshToken=o.autoRefreshToken,this.experimental=(n=o.experimental)!==null&&n!==void 0?n:{},this.admin=new Q6({url:o.url,headers:o.headers,fetch:o.fetch,experimental:this.experimental}),this.url=o.url,this.headers=o.headers,this.fetch=qN(o.fetch),this.lock=o.lock||_E,this.detectSessionInUrl=o.detectSessionInUrl,this.flowType=o.flowType,this.hasCustomAuthorizationHeader=o.hasCustomAuthorizationHeader,this.throwOnError=o.throwOnError,this.lockAcquireTimeout=o.lockAcquireTimeout,o.lock?this.lock=o.lock:this.persistSession&&xr()&&(!((i=globalThis==null?void 0:globalThis.navigator)===null||i===void 0)&&i.locks)?this.lock=eU:this.lock=_E,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new fU(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(o.storage?this.storage=o.storage:UN()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=gE(this.memoryStorage)),o.userStorage&&(this.userStorage=o.userStorage)):(this.memoryStorage={},this.storage=gE(this.memoryStorage)),xr()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(l){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",l)}(a=this.broadcastChannel)===null||a===void 0||a.addEventListener("message",async l=>{this._debug("received broadcast notification from other tab or client",l);try{await this._notifyAllSubscribers(l.data.event,l.data.session,!1)}catch(u){this._debug("#broadcastChannel","error",u)}})}o.skipAutoInitialize||this.initialize().catch(l=>{this._debug("#initialize()","error",l)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${DN}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{let r={},n="none";if(xr()&&(r=R6(window.location.href),this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce")),xr()&&this.detectSessionInUrl&&n!=="none"){const{data:i,error:a}=await this._getSessionFromURL(r,n);if(a){if(this._debug("#_initialize()","error detecting session from URL",a),k6(a)){const u=(e=a.details)===null||e===void 0?void 0:e.code;if(u==="identity_already_exists"||u==="identity_not_found"||u==="single_identity_not_deletable")return{error:a}}return{error:a}}const{session:o,redirectType:l}=i;return this._debug("#_initialize()","detected session in URL",o,"redirect type",l),await this._saveSession(o),setTimeout(async()=>{l==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return be(r)?this._returnResult({error:r}):this._returnResult({error:new Xn("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,n,i;try{const a=await Pe(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(i=e==null?void 0:e.options)===null||i===void 0?void 0:i.captchaToken}},xform:On}),{data:o,error:l}=a;if(l||!o)return this._returnResult({data:{user:null,session:null},error:l});const u=o.session,d=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",u)),this._returnResult({data:{user:d,session:u},error:null})}catch(a){if(be(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signUp(e){var r,n,i;try{let a;if("email"in e){const{email:p,password:f,options:g}=e;let v=null,x=null;this.flowType==="pkce"&&([v,x]=await ws(this.storage,this.storageKey)),a=await Pe(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:g==null?void 0:g.emailRedirectTo,body:{email:p,password:f,data:(r=g==null?void 0:g.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:g==null?void 0:g.captchaToken},code_challenge:v,code_challenge_method:x},xform:On})}else if("phone"in e){const{phone:p,password:f,options:g}=e;a=await Pe(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:p,password:f,data:(n=g==null?void 0:g.data)!==null&&n!==void 0?n:{},channel:(i=g==null?void 0:g.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:g==null?void 0:g.captchaToken}},xform:On})}else throw new lf("You must provide either an email or phone number and a password");const{data:o,error:l}=a;if(l||!o)return await br(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:l});const u=o.session,d=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",u)),this._returnResult({data:{user:d,session:u},error:null})}catch(a){if(await br(this.storage,`${this.storageKey}-code-verifier`),be(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signInWithPassword(e){try{let r;if("email"in e){const{email:a,password:o,options:l}=e;r=await Pe(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:a,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:pE})}else if("phone"in e){const{phone:a,password:o,options:l}=e;r=await Pe(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:a,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:pE})}else throw new lf("You must provide either an email or phone number and a password");const{data:n,error:i}=r;if(i)return this._returnResult({data:{user:null,session:null},error:i});if(!n||!n.session||!n.user){const a=new xs;return this._returnResult({data:{user:null,session:null},error:a})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:i})}catch(r){if(be(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(e){var r,n,i,a;return await this._handleProviderSignIn(e.provider,{redirectTo:(r=e.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=e.options)===null||n===void 0?void 0:n.scopes,queryParams:(i=e.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(a=e.options)===null||a===void 0?void 0:a.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){const{chain:r}=e;switch(r){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(e){var r,n,i,a,o,l,u,d,p,f,g;let v,x;if("message"in e)v=e.message,x=e.signature;else{const{chain:_,wallet:b,statement:k,options:A}=e;let O;if(xr())if(typeof b=="object")O=b;else{const I=window;if("ethereum"in I&&typeof I.ethereum=="object"&&"request"in I.ethereum&&typeof I.ethereum.request=="function")O=I.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof b!="object"||!(A!=null&&A.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");O=b}const C=new URL((r=A==null?void 0:A.url)!==null&&r!==void 0?r:window.location.href),E=await O.request({method:"eth_requestAccounts"}).then(I=>I).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!E||E.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const T=HN(E[0]);let P=(n=A==null?void 0:A.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!P){const I=await O.request({method:"eth_chainId"});P=rU(I)}const R={domain:C.host,address:T,statement:k,uri:C.href,version:"1",chainId:P,nonce:(i=A==null?void 0:A.signInWithEthereum)===null||i===void 0?void 0:i.nonce,issuedAt:(o=(a=A==null?void 0:A.signInWithEthereum)===null||a===void 0?void 0:a.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(l=A==null?void 0:A.signInWithEthereum)===null||l===void 0?void 0:l.expirationTime,notBefore:(u=A==null?void 0:A.signInWithEthereum)===null||u===void 0?void 0:u.notBefore,requestId:(d=A==null?void 0:A.signInWithEthereum)===null||d===void 0?void 0:d.requestId,resources:(p=A==null?void 0:A.signInWithEthereum)===null||p===void 0?void 0:p.resources};v=iU(R),x=await O.request({method:"personal_sign",params:[nU(v),T]})}try{const{data:_,error:b}=await Pe(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:v,signature:x},!((f=e.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(g=e.options)===null||g===void 0?void 0:g.captchaToken}}:null),xform:On});if(b)throw b;if(!_||!_.session||!_.user){const k=new xs;return this._returnResult({data:{user:null,session:null},error:k})}return _.session&&(await this._saveSession(_.session),await this._notifyAllSubscribers("SIGNED_IN",_.session)),this._returnResult({data:Object.assign({},_),error:b})}catch(_){if(be(_))return this._returnResult({data:{user:null,session:null},error:_});throw _}}async signInWithSolana(e){var r,n,i,a,o,l,u,d,p,f,g,v;let x,_;if("message"in e)x=e.message,_=e.signature;else{const{chain:b,wallet:k,statement:A,options:O}=e;let C;if(xr())if(typeof k=="object")C=k;else{const T=window;if("solana"in T&&typeof T.solana=="object"&&("signIn"in T.solana&&typeof T.solana.signIn=="function"||"signMessage"in T.solana&&typeof T.solana.signMessage=="function"))C=T.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof k!="object"||!(O!=null&&O.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");C=k}const E=new URL((r=O==null?void 0:O.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in C&&C.signIn){const T=await C.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},O==null?void 0:O.signInWithSolana),{version:"1",domain:E.host,uri:E.href}),A?{statement:A}:null));let P;if(Array.isArray(T)&&T[0]&&typeof T[0]=="object")P=T[0];else if(T&&typeof T=="object"&&"signedMessage"in T&&"signature"in T)P=T;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in P&&"signature"in P&&(typeof P.signedMessage=="string"||P.signedMessage instanceof Uint8Array)&&P.signature instanceof Uint8Array)x=typeof P.signedMessage=="string"?P.signedMessage:new TextDecoder().decode(P.signedMessage),_=P.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in C)||typeof C.signMessage!="function"||!("publicKey"in C)||typeof C!="object"||!C.publicKey||!("toBase58"in C.publicKey)||typeof C.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");x=[`${E.host} wants you to sign in with your Solana account:`,C.publicKey.toBase58(),...A?["",A,""]:[""],"Version: 1",`URI: ${E.href}`,`Issued At: ${(i=(n=O==null?void 0:O.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&i!==void 0?i:new Date().toISOString()}`,...!((a=O==null?void 0:O.signInWithSolana)===null||a===void 0)&&a.notBefore?[`Not Before: ${O.signInWithSolana.notBefore}`]:[],...!((o=O==null?void 0:O.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${O.signInWithSolana.expirationTime}`]:[],...!((l=O==null?void 0:O.signInWithSolana)===null||l===void 0)&&l.chainId?[`Chain ID: ${O.signInWithSolana.chainId}`]:[],...!((u=O==null?void 0:O.signInWithSolana)===null||u===void 0)&&u.nonce?[`Nonce: ${O.signInWithSolana.nonce}`]:[],...!((d=O==null?void 0:O.signInWithSolana)===null||d===void 0)&&d.requestId?[`Request ID: ${O.signInWithSolana.requestId}`]:[],...!((f=(p=O==null?void 0:O.signInWithSolana)===null||p===void 0?void 0:p.resources)===null||f===void 0)&&f.length?["Resources",...O.signInWithSolana.resources.map(P=>`- ${P}`)]:[]].join(`
429
+ `);const T=await C.signMessage(new TextEncoder().encode(x),"utf8");if(!T||!(T instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");_=T}}try{const{data:b,error:k}=await Pe(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:x,signature:_o(_)},!((g=e.options)===null||g===void 0)&&g.captchaToken?{gotrue_meta_security:{captcha_token:(v=e.options)===null||v===void 0?void 0:v.captchaToken}}:null),xform:On});if(k)throw k;if(!b||!b.session||!b.user){const A=new xs;return this._returnResult({data:{user:null,session:null},error:A})}return b.session&&(await this._saveSession(b.session),await this._notifyAllSubscribers("SIGNED_IN",b.session)),this._returnResult({data:Object.assign({},b),error:k})}catch(b){if(be(b))return this._returnResult({data:{user:null,session:null},error:b});throw b}}async _exchangeCodeForSession(e){const r=await go(this.storage,`${this.storageKey}-code-verifier`),[n,i]=(r??"").split("/");try{if(!n&&this.flowType==="pkce")throw new E6;const{data:a,error:o}=await Pe(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:On});if(await br(this.storage,`${this.storageKey}-code-verifier`),o)throw o;if(!a||!a.session||!a.user){const l=new xs;return this._returnResult({data:{user:null,session:null,redirectType:null},error:l})}return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers(i==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",a.session)),this._returnResult({data:Object.assign(Object.assign({},a),{redirectType:i??null}),error:o})}catch(a){if(await br(this.storage,`${this.storageKey}-code-verifier`),be(a))return this._returnResult({data:{user:null,session:null,redirectType:null},error:a});throw a}}async signInWithIdToken(e){try{const{options:r,provider:n,token:i,access_token:a,nonce:o}=e,l=await Pe(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:i,access_token:a,nonce:o,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:On}),{data:u,error:d}=l;if(d)return this._returnResult({data:{user:null,session:null},error:d});if(!u||!u.session||!u.user){const p=new xs;return this._returnResult({data:{user:null,session:null},error:p})}return u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",u.session)),this._returnResult({data:u,error:d})}catch(r){if(be(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(e){var r,n,i,a,o;try{if("email"in e){const{email:l,options:u}=e;let d=null,p=null;this.flowType==="pkce"&&([d,p]=await ws(this.storage,this.storageKey));const{error:f}=await Pe(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:l,data:(r=u==null?void 0:u.data)!==null&&r!==void 0?r:{},create_user:(n=u==null?void 0:u.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:u==null?void 0:u.captchaToken},code_challenge:d,code_challenge_method:p},redirectTo:u==null?void 0:u.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:f})}if("phone"in e){const{phone:l,options:u}=e,{data:d,error:p}=await Pe(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:l,data:(i=u==null?void 0:u.data)!==null&&i!==void 0?i:{},create_user:(a=u==null?void 0:u.shouldCreateUser)!==null&&a!==void 0?a:!0,gotrue_meta_security:{captcha_token:u==null?void 0:u.captchaToken},channel:(o=u==null?void 0:u.channel)!==null&&o!==void 0?o:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:d==null?void 0:d.message_id},error:p})}throw new lf("You must provide either an email or phone number.")}catch(l){if(await br(this.storage,`${this.storageKey}-code-verifier`),be(l))return this._returnResult({data:{user:null,session:null},error:l});throw l}}async verifyOtp(e){var r,n;try{let i,a;"options"in e&&(i=(r=e.options)===null||r===void 0?void 0:r.redirectTo,a=(n=e.options)===null||n===void 0?void 0:n.captchaToken);const{data:o,error:l}=await Pe(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:a}}),redirectTo:i,xform:On});if(l)throw l;if(!o)throw new Error("An error occurred on token verification.");const u=o.session,d=o.user;return u!=null&&u.access_token&&(await this._saveSession(u),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",u)),this._returnResult({data:{user:d,session:u},error:null})}catch(i){if(be(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithSSO(e){var r,n,i,a,o;try{let l=null,u=null;this.flowType==="pkce"&&([l,u]=await ws(this.storage,this.storageKey));const d=await Pe(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(n=(r=e.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((i=e==null?void 0:e.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:l,code_challenge_method:u}),headers:this.headers,xform:Y6});return!((a=d.data)===null||a===void 0)&&a.url&&xr()&&!(!((o=e.options)===null||o===void 0)&&o.skipBrowserRedirect)&&window.location.assign(d.data.url),this._returnResult(d)}catch(l){if(await br(this.storage,`${this.storageKey}-code-verifier`),be(l))return this._returnResult({data:null,error:l});throw l}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;if(n)throw n;if(!r)throw new pr;const{error:i}=await Pe(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:i})})}catch(e){if(be(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{const r=`${this.url}/resend`;if("email"in e){const{email:n,type:i,options:a}=e,{error:o}=await Pe(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:i,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},redirectTo:a==null?void 0:a.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:o})}else if("phone"in e){const{phone:n,type:i,options:a}=e,{data:o,error:l}=await Pe(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:i,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:l})}throw new lf("You must provide either an email or phone number and a type")}catch(r){if(be(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async r=>r))}async _acquireLock(e,r){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const r=await this.__loadSession();return await e(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const r=await go(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?e=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const n=e.expires_at?e.expires_at*1e3-Date.now()<Sg:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",e.expires_at),!n){if(this.userStorage){const o=await go(this.userStorage,this.storageKey+"-user");o!=null&&o.user?e.user=o.user:e.user=Eg()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const o={value:this.suppressGetSessionWarning};e.user=G6(e.user,o),o.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}const{data:i,error:a}=await this._callRefreshToken(e.refresh_token);return a?this._returnResult({data:{session:null},error:a}):this._returnResult({data:{session:i},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;const r=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(e){try{return e?await Pe(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:Pa}):await this._useSession(async r=>{var n,i,a;const{data:o,error:l}=r;if(l)throw l;return!(!((n=o.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new pr}:await Pe(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(a=(i=o.session)===null||i===void 0?void 0:i.access_token)!==null&&a!==void 0?a:void 0,xform:Pa})})}catch(r){if(be(r))return sf(r)&&(await this._removeSession(),await br(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(e,r={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,r))}async _updateUser(e,r={}){try{return await this._useSession(async n=>{const{data:i,error:a}=n;if(a)throw a;if(!i.session)throw new pr;const o=i.session;let l=null,u=null;this.flowType==="pkce"&&e.email!=null&&([l,u]=await ws(this.storage,this.storageKey));const{data:d,error:p}=await Pe(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:l,code_challenge_method:u}),jwt:o.access_token,xform:Pa});if(p)throw p;return o.user=d.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),this._returnResult({data:{user:o.user},error:null})})}catch(n){if(await br(this.storage,`${this.storageKey}-code-verifier`),be(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new pr;const r=Date.now()/1e3;let n=r,i=!0,a=null;const{payload:o}=uf(e.access_token);if(o.exp&&(n=o.exp,i=n<=r),i){const{data:l,error:u}=await this._callRefreshToken(e.refresh_token);if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!l)return{data:{user:null,session:null},error:null};a=l}else{const{data:l,error:u}=await this._getUser(e.access_token);if(u)return this._returnResult({data:{user:null,session:null},error:u});a={access_token:e.access_token,refresh_token:e.refresh_token,user:l.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)}return this._returnResult({data:{user:a.user,session:a},error:null})}catch(r){if(be(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async r=>{var n;if(!e){const{data:o,error:l}=r;if(l)throw l;e=(n=o.session)!==null&&n!==void 0?n:void 0}if(!(e!=null&&e.refresh_token))throw new pr;const{data:i,error:a}=await this._callRefreshToken(e.refresh_token);return a?this._returnResult({data:{user:null,session:null},error:a}):i?this._returnResult({data:{user:i.user,session:i},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if(be(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(e,r){var n;try{if(!xr())throw new cf("No browser detected.");if(e.error||e.error_description||e.error_code)throw new cf(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new sE("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new cf("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new sE("No code detected.");const{data:O,error:C}=await this._exchangeCodeForSession(e.code);if(C)throw C;const E=new URL(window.location.href);return E.searchParams.delete("code"),window.history.replaceState(window.history.state,"",E.toString()),{data:{session:O.session,redirectType:(n=O.redirectType)!==null&&n!==void 0?n:null},error:null}}const{provider_token:i,provider_refresh_token:a,access_token:o,refresh_token:l,expires_in:u,expires_at:d,token_type:p}=e;if(!o||!u||!l||!p)throw new cf("No session defined in URL");const f=Math.round(Date.now()/1e3),g=parseInt(u);let v=f+g;d&&(v=parseInt(d));const x=v-f;x*1e3<=js&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${x}s, should have been closer to ${g}s`);const _=v-g;f-_>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",_,v,f):f-_<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",_,v,f);const{data:b,error:k}=await this._getUser(o);if(k)throw k;const A={provider_token:i,provider_refresh_token:a,access_token:o,expires_in:g,expires_at:v,refresh_token:l,token_type:p,user:b.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:A,redirectType:e.type},error:null})}catch(i){if(be(i))return this._returnResult({data:{session:null,redirectType:null},error:i});throw i}}_isImplicitGrantCallback(e){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error_description)}async _isPKCECallback(e){const r=await go(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&r)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async r=>{var n;const{data:i,error:a}=r;if(a&&!sf(a))return this._returnResult({error:a});const o=(n=i.session)===null||n===void 0?void 0:n.access_token;if(o){const{error:l}=await this.admin.signOut(o,e);if(l&&!(S6(l)&&(l.status===404||l.status===401||l.status===403)||sf(l)))return this._returnResult({error:l})}return e!=="others"&&(await this._removeSession(),await br(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const r=N6(),n={id:r,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async r=>{var n,i;try{const{data:{session:a},error:o}=r;if(o)throw o;await((n=this.stateChangeEmitters.get(e))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",a)),this._debug("INITIAL_SESSION","callback id",e,"session",a)}catch(a){await((i=this.stateChangeEmitters.get(e))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",a),sf(a)?console.warn(a):console.error(a)}})}async resetPasswordForEmail(e,r={}){let n=null,i=null;this.flowType==="pkce"&&([n,i]=await ws(this.storage,this.storageKey,!0));try{return await Pe(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:i,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(a){if(await br(this.storage,`${this.storageKey}-code-verifier`),be(a))return this._returnResult({data:null,error:a});throw a}}async getUserIdentities(){var e;try{const{data:r,error:n}=await this.getUser();if(n)throw n;return this._returnResult({data:{identities:(e=r.user.identities)!==null&&e!==void 0?e:[]},error:null})}catch(r){if(be(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var r;try{const{data:n,error:i}=await this._useSession(async a=>{var o,l,u,d,p;const{data:f,error:g}=a;if(g)throw g;const v=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(o=e.options)===null||o===void 0?void 0:o.redirectTo,scopes:(l=e.options)===null||l===void 0?void 0:l.scopes,queryParams:(u=e.options)===null||u===void 0?void 0:u.queryParams,skipBrowserRedirect:!0});return await Pe(this.fetch,"GET",v,{headers:this.headers,jwt:(p=(d=f.session)===null||d===void 0?void 0:d.access_token)!==null&&p!==void 0?p:void 0})});if(i)throw i;return xr()&&!(!((r=e.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n==null?void 0:n.url),this._returnResult({data:{provider:e.provider,url:n==null?void 0:n.url},error:null})}catch(n){if(be(n))return this._returnResult({data:{provider:e.provider,url:null},error:n});throw n}}async linkIdentityIdToken(e){return await this._useSession(async r=>{var n;try{const{error:i,data:{session:a}}=r;if(i)throw i;const{options:o,provider:l,token:u,access_token:d,nonce:p}=e,f=await Pe(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(n=a==null?void 0:a.access_token)!==null&&n!==void 0?n:void 0,body:{provider:l,id_token:u,access_token:d,nonce:p,link_identity:!0,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:On}),{data:g,error:v}=f;return v?this._returnResult({data:{user:null,session:null},error:v}):!g||!g.session||!g.user?this._returnResult({data:{user:null,session:null},error:new xs}):(g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("USER_UPDATED",g.session)),this._returnResult({data:g,error:v}))}catch(i){if(await br(this.storage,`${this.storageKey}-code-verifier`),be(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}})}async unlinkIdentity(e){try{return await this._useSession(async r=>{var n,i;const{data:a,error:o}=r;if(o)throw o;return await Pe(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(i=(n=a.session)===null||n===void 0?void 0:n.access_token)!==null&&i!==void 0?i:void 0})})}catch(r){if(be(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(e){const r=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(r,"begin");try{const n=Date.now();return await M6(async i=>(i>0&&await $6(200*Math.pow(2,i-1)),this._debug(r,"refreshing attempt",i),await Pe(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:On})),(i,a)=>{const o=200*Math.pow(2,i);return a&&kg(a)&&Date.now()+o-n<js})}catch(n){if(this._debug(r,"error",n),be(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}finally{this._debug(r,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,r){const n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",r,"url",n),xr()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){var e,r;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const i=await go(this.storage,this.storageKey);if(i&&this.userStorage){let o=await go(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:i.user},await Ps(this.userStorage,this.storageKey+"-user",o)),i.user=(e=o==null?void 0:o.user)!==null&&e!==void 0?e:Eg()}else if(i&&!i.user&&!i.user){const o=await go(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(i.user=o.user,await br(this.storage,this.storageKey+"-user"),await Ps(this.storage,this.storageKey,i)):i.user=Eg()}if(this._debug(n,"session from storage",i),!this._isValidSession(i)){this._debug(n,"session is not valid"),i!==null&&await this._removeSession();return}const a=((r=i.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<Sg;if(this._debug(n,`session has${a?"":" not"} expired with margin of ${Sg}s`),a){if(this.autoRefreshToken&&i.refresh_token){const{error:o}=await this._callRefreshToken(i.refresh_token);o&&(console.error(o),kg(o)||(this._debug(n,"refresh failed with a non-retryable error, removing the session",o),await this._removeSession()))}}else if(i.user&&i.user.__isUserNotAvailableProxy===!0)try{const{data:o,error:l}=await this._getUser(i.access_token);!l&&(o!=null&&o.user)?(i.user=o.user,await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)):this._debug(n,"could not get user data, skipping SIGNED_IN notification")}catch(o){console.error("Error getting user data:",o),this._debug(n,"error getting user data, skipping SIGNED_IN notification",o)}else await this._notifyAllSubscribers("SIGNED_IN",i)}catch(i){this._debug(n,"error",i),console.error(i);return}finally{this._debug(n,"end")}}async _callRefreshToken(e){var r,n;if(!e)throw new pr;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const i=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new tp;const{data:a,error:o}=await this._refreshAccessToken(e);if(o)throw o;if(!a.session)throw new pr;await this._saveSession(a.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",a.session);const l={data:a.session,error:null};return this.refreshingDeferred.resolve(l),l}catch(a){if(this._debug(i,"error",a),be(a)){const o={data:null,error:a};return kg(a)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(o),o}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(a),a}finally{this.refreshingDeferred=null,this._debug(i,"end")}}async _notifyAllSubscribers(e,r,n=!0){const i=`#_notifyAllSubscribers(${e})`;this._debug(i,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:r});const a=[],o=Array.from(this.stateChangeEmitters.values()).map(async l=>{try{await l.callback(e,r)}catch(u){a.push(u)}});if(await Promise.all(o),a.length>0){for(let l=0;l<a.length;l+=1)console.error(a[l]);throw a[0]}}finally{this._debug(i,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await br(this.storage,`${this.storageKey}-code-verifier`);const r=Object.assign({},e),n=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&r.user&&await Ps(this.userStorage,this.storageKey+"-user",{user:r.user});const i=Object.assign({},r);delete i.user;const a=fE(i);await Ps(this.storage,this.storageKey,a)}else{const i=fE(r);await Ps(this.storage,this.storageKey,i)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await br(this.storage,this.storageKey),await br(this.storage,this.storageKey+"-code-verifier"),await br(this.storage,this.storageKey+"-user"),this.userStorage&&await br(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&xr()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),js);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e);const r=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);const r=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,r&&clearTimeout(r)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const e=Date.now();try{return await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const i=Math.floor((n.expires_at*1e3-e)/js);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${js}ms, refresh threshold is ${Jb} ticks`),i<=Jb&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e instanceof FN)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!xr()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug("#visibilityChangedCallback","error",e)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const r=`#_onVisibilityChanged(${e})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,r,n){const i=[`provider=${encodeURIComponent(r)}`];if(n!=null&&n.redirectTo&&i.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n!=null&&n.scopes&&i.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){const[a,o]=await ws(this.storage,this.storageKey),l=new URLSearchParams({code_challenge:`${encodeURIComponent(a)}`,code_challenge_method:`${encodeURIComponent(o)}`});i.push(l.toString())}if(n!=null&&n.queryParams){const a=new URLSearchParams(n.queryParams);i.push(a.toString())}return n!=null&&n.skipBrowserRedirect&&i.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${i.join("&")}`}async _unenroll(e){try{return await this._useSession(async r=>{var n;const{data:i,error:a}=r;return a?this._returnResult({data:null,error:a}):await Pe(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(be(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(e){try{return await this._useSession(async r=>{var n,i;const{data:a,error:o}=r;if(o)return this._returnResult({data:null,error:o});const l=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:e.factorType==="totp"?{issuer:e.issuer}:{}),{data:u,error:d}=await Pe(this.fetch,"POST",`${this.url}/factors`,{body:l,headers:this.headers,jwt:(n=a==null?void 0:a.session)===null||n===void 0?void 0:n.access_token});return d?this._returnResult({data:null,error:d}):(e.factorType==="totp"&&u.type==="totp"&&(!((i=u==null?void 0:u.totp)===null||i===void 0)&&i.qr_code)&&(u.totp.qr_code=`data:image/svg+xml;utf-8,${u.totp.qr_code}`),this._returnResult({data:u,error:null}))})}catch(r){if(be(r))return this._returnResult({data:null,error:r});throw r}}async _verify(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var n;const{data:i,error:a}=r;if(a)return this._returnResult({data:null,error:a});const o=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type==="create"?xE(e.webauthn.credential_response):wE(e.webauthn.credential_response)})}:{code:e.code}),{data:l,error:u}=await Pe(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:o,headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token});return u?this._returnResult({data:null,error:u}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+l.expires_in},l)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",l),this._returnResult({data:l,error:u}))})}catch(r){if(be(r))return this._returnResult({data:null,error:r});throw r}})}async _challenge(e){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var n;const{data:i,error:a}=r;if(a)return this._returnResult({data:null,error:a});const o=await Pe(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token});if(o.error)return o;const{data:l}=o;if(l.type!=="webauthn")return{data:l,error:null};switch(l.webauthn.type){case"create":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:vE(l.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:bE(l.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(be(r))return this._returnResult({data:null,error:r});throw r}})}async _challengeAndVerify(e){const{data:r,error:n}=await this._challenge({factorId:e.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:e.factorId,challengeId:r.id,code:e.code})}async _listFactors(){var e;const{data:{user:r},error:n}=await this.getUser();if(n)return{data:null,error:n};const i={all:[],phone:[],totp:[],webauthn:[]};for(const a of(e=r==null?void 0:r.factors)!==null&&e!==void 0?e:[])i.all.push(a),a.status==="verified"&&i[a.factor_type].push(a);return{data:i,error:null}}async _getAuthenticatorAssuranceLevel(e){var r,n,i,a;if(e)try{const{payload:v}=uf(e);let x=null;v.aal&&(x=v.aal);let _=x;const{data:{user:b},error:k}=await this.getUser(e);if(k)return this._returnResult({data:null,error:k});((n=(r=b==null?void 0:b.factors)===null||r===void 0?void 0:r.filter(C=>C.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(_="aal2");const O=v.amr||[];return{data:{currentLevel:x,nextLevel:_,currentAuthenticationMethods:O},error:null}}catch(v){if(be(v))return this._returnResult({data:null,error:v});throw v}const{data:{session:o},error:l}=await this.getSession();if(l)return this._returnResult({data:null,error:l});if(!o)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:u}=uf(o.access_token);let d=null;u.aal&&(d=u.aal);let p=d;((a=(i=o.user.factors)===null||i===void 0?void 0:i.filter(v=>v.status==="verified"))!==null&&a!==void 0?a:[]).length>0&&(p="aal2");const g=u.amr||[];return{data:{currentLevel:d,nextLevel:p,currentAuthenticationMethods:g},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async r=>{const{data:{session:n},error:i}=r;return i?this._returnResult({data:null,error:i}):n?await Pe(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:n.access_token,xform:a=>({data:a,error:null})}):this._returnResult({data:null,error:new pr})})}catch(r){if(be(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(e,r){try{return await this._useSession(async n=>{const{data:{session:i},error:a}=n;if(a)return this._returnResult({data:null,error:a});if(!i)return this._returnResult({data:null,error:new pr});const o=await Pe(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"approve"},xform:l=>({data:l,error:null})});return o.data&&o.data.redirect_url&&xr()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(be(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(e,r){try{return await this._useSession(async n=>{const{data:{session:i},error:a}=n;if(a)return this._returnResult({data:null,error:a});if(!i)return this._returnResult({data:null,error:new pr});const o=await Pe(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"deny"},xform:l=>({data:l,error:null})});return o.data&&o.data.redirect_url&&xr()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(be(n))return this._returnResult({data:null,error:n});throw n}}async _listOAuthGrants(){try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;return n?this._returnResult({data:null,error:n}):r?await Pe(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new pr})})}catch(e){if(be(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async r=>{const{data:{session:n},error:i}=r;return i?this._returnResult({data:null,error:i}):n?(await Pe(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new pr})})}catch(r){if(be(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(e,r={keys:[]}){let n=r.keys.find(l=>l.kid===e);if(n)return n;const i=Date.now();if(n=this.jwks.keys.find(l=>l.kid===e),n&&this.jwks_cached_at+w6>i)return n;const{data:a,error:o}=await Pe(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!a.keys||a.keys.length===0||(this.jwks=a,this.jwks_cached_at=i,n=a.keys.find(l=>l.kid===e),!n)?null:n}async getClaims(e,r={}){try{let n=e;if(!n){const{data:v,error:x}=await this.getSession();if(x||!v.session)return this._returnResult({data:null,error:x});n=v.session.access_token}const{header:i,payload:a,signature:o,raw:{header:l,payload:u}}=uf(n);r!=null&&r.allowExpired||F6(a.exp);const d=!i.alg||i.alg.startsWith("HS")||!i.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(i.kid,r!=null&&r.keys?{keys:r.keys}:r==null?void 0:r.jwks);if(!d){const{error:v}=await this.getUser(n);if(v)throw v;return{data:{claims:a,header:i,signature:o},error:null}}const p=H6(i.alg),f=await crypto.subtle.importKey("jwk",d,p,!0,["verify"]);if(!await crypto.subtle.verify(p,f,o,j6(`${l}.${u}`)))throw new ex("Invalid JWT signature");return{data:{claims:a,header:i,signature:o},error:null}}catch(n){if(be(n))return this._returnResult({data:null,error:n});throw n}}async signInWithPasskey(e){var r,n,i;qn(this.experimental);try{if(!Bf())return this._returnResult({data:null,error:new Xn("Browser does not support WebAuthn",null)});const{data:a,error:o}=await this._startPasskeyAuthentication({options:{captchaToken:(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.captchaToken}});if(o||!a)return this._returnResult({data:null,error:o});const l=bE(a.options),u=(i=(n=e==null?void 0:e.options)===null||n===void 0?void 0:n.signal)!==null&&i!==void 0?i:tx.createNewAbortSignal(),{data:d,error:p}=await KN({publicKey:l,signal:u});if(p||!d)return this._returnResult({data:null,error:p??new Xn("WebAuthn ceremony failed",null)});const f=wE(d);return this._verifyPasskeyAuthentication({challengeId:a.challenge_id,credential:f})}catch(a){if(be(a))return this._returnResult({data:null,error:a});throw a}}async registerPasskey(e){var r,n;qn(this.experimental);try{if(!Bf())return this._returnResult({data:null,error:new Xn("Browser does not support WebAuthn",null)});const{data:i,error:a}=await this._startPasskeyRegistration();if(a||!i)return this._returnResult({data:null,error:a});const o=vE(i.options),l=(n=(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.signal)!==null&&n!==void 0?n:tx.createNewAbortSignal(),{data:u,error:d}=await GN({publicKey:o,signal:l});if(d||!u)return this._returnResult({data:null,error:d??new Xn("WebAuthn ceremony failed",null)});const p=xE(u);return this._verifyPasskeyRegistration({challengeId:i.challenge_id,credential:p})}catch(i){if(be(i))return this._returnResult({data:null,error:i});throw i}}async _startPasskeyRegistration(){qn(this.experimental);try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new pr});const{data:i,error:a}=await Pe(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:r.access_token,body:{}});return a?this._returnResult({data:null,error:a}):this._returnResult({data:i,error:null})})}catch(e){if(be(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyRegistration(e){qn(this.experimental);try{return await this._useSession(async r=>{const{data:{session:n},error:i}=r;if(i)return this._returnResult({data:null,error:i});if(!n)return this._returnResult({data:null,error:new pr});const{data:a,error:o}=await Pe(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:n.access_token,body:{challenge_id:e.challengeId,credential:e.credential}});return o?this._returnResult({data:null,error:o}):this._returnResult({data:a,error:null})})}catch(r){if(be(r))return this._returnResult({data:null,error:r});throw r}}async _startPasskeyAuthentication(e){var r;qn(this.experimental);try{const{data:n,error:i}=await Pe(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.captchaToken}}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:n,error:null})}catch(n){if(be(n))return this._returnResult({data:null,error:n});throw n}}async _verifyPasskeyAuthentication(e){qn(this.experimental);try{const{data:r,error:n}=await Pe(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:e.challengeId,credential:e.credential},xform:On});return n?this._returnResult({data:null,error:n}):(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:r,error:null}))}catch(r){if(be(r))return this._returnResult({data:null,error:r});throw r}}async _listPasskeys(){qn(this.experimental);try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new pr});const{data:i,error:a}=await Pe(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:r.access_token,xform:o=>({data:o,error:null})});return a?this._returnResult({data:null,error:a}):this._returnResult({data:i,error:null})})}catch(e){if(be(e))return this._returnResult({data:null,error:e});throw e}}async _updatePasskey(e){qn(this.experimental);try{return await this._useSession(async r=>{const{data:{session:n},error:i}=r;if(i)return this._returnResult({data:null,error:i});if(!n)return this._returnResult({data:null,error:new pr});const{data:a,error:o}=await Pe(this.fetch,"PATCH",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:n.access_token,body:{friendly_name:e.friendlyName}});return o?this._returnResult({data:null,error:o}):this._returnResult({data:a,error:null})})}catch(r){if(be(r))return this._returnResult({data:null,error:r});throw r}}async _deletePasskey(e){qn(this.experimental);try{return await this._useSession(async r=>{const{data:{session:n},error:i}=r;if(i)return this._returnResult({data:null,error:i});if(!n)return this._returnResult({data:null,error:new pr});const{error:a}=await Pe(this.fetch,"DELETE",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:n.access_token,noResolveJson:!0});return a?this._returnResult({data:null,error:a}):this._returnResult({data:null,error:null})})}catch(r){if(be(r))return this._returnResult({data:null,error:r});throw r}}}qc.nextInstanceID={};const pU=qc,mU="2.106.2";let Ec="";typeof Deno<"u"?Ec="deno":typeof document<"u"?Ec="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Ec="react-native":Ec="node";const gU={"X-Client-Info":`supabase-js-${Ec}/${mU}`},yU={headers:gU},vU={schema:"public"},bU={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},xU={},wU={enabled:!1,respectSamplingDecision:!0};function _U(t,e,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function l(p){try{d(n.next(p))}catch(f){o(f)}}function u(p){try{d(n.throw(p))}catch(f){o(f)}}function d(p){p.done?a(p.value):i(p.value).then(l,u)}d((n=n.apply(t,[])).next())})}let Ag=null;const SU="@opentelemetry/api";function kU(){return Ag===null&&(Ag=import(SU).catch(()=>null)),Ag}function EU(){return _U(this,void 0,void 0,function*(){try{const t=yield kU();if(!t||!t.propagation||!t.context)return null;const e={};t.propagation.inject(t.context.active(),e);const r=e.traceparent;return r?{traceparent:r,tracestate:e.tracestate,baggage:e.baggage}:null}catch{return null}})}function OU(t){if(!t||typeof t!="string")return null;const e=t.split("-");if(e.length!==4)return null;const[r,n,i,a]=e;if(r.length!==2||n.length!==32||i.length!==16||a.length!==2)return null;const o=/^[0-9a-f]+$/i;return!o.test(r)||!o.test(n)||!o.test(i)||!o.test(a)||n==="00000000000000000000000000000000"||i==="0000000000000000"?null:{version:r,traceId:n,parentId:i,traceFlags:a,isSampled:(parseInt(a,16)&1)===1}}function AU(t,e){if(!t||!e||e.length===0)return!1;let r;if(t instanceof URL)r=t;else try{r=new URL(t)}catch{return!1}for(const n of e)try{if(typeof n=="string"){if(TU(r.hostname,n))return!0}else if(n instanceof RegExp){if(n.test(r.hostname))return!0}else if(typeof n=="function"&&n(r))return!0}catch{continue}return!1}function TU(t,e){if(e===t)return!0;if(e.startsWith("*.")){const r=e.slice(2);if(t.endsWith(r)&&(t===r||t.endsWith("."+r)))return!0}return!1}function CU(t){const e=[];try{const r=new URL(t);e.push(r.hostname)}catch{}return e.push("*.supabase.co","*.supabase.in"),e.push("localhost","127.0.0.1","[::1]"),e}function Fc(t){"@babel/helpers - typeof";return Fc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fc(t)}function jU(t,e){if(Fc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Fc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function PU(t){var e=jU(t,"string");return Fc(e)=="symbol"?e:e+""}function NU(t,e,r){return(e=PU(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function SE(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ft(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?SE(Object(r),!0).forEach(function(n){NU(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):SE(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}const RU=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),IU=()=>Headers,$U=(t,e,r,n,i)=>{const a=RU(n),o=IU(),l=(i==null?void 0:i.enabled)===!0,u=(i==null?void 0:i.respectSamplingDecision)!==!1,d=l?CU(e):null;return async(p,f)=>{var g;const v=(g=await r())!==null&&g!==void 0?g:t;let x=new o(f==null?void 0:f.headers);if(x.has("apikey")||x.set("apikey",t),x.has("Authorization")||x.set("Authorization",`Bearer ${v}`),d){const _=await MU(p,d,u);_&&(_.traceparent&&!x.has("traceparent")&&x.set("traceparent",_.traceparent),_.tracestate&&!x.has("tracestate")&&x.set("tracestate",_.tracestate),_.baggage&&!x.has("baggage")&&x.set("baggage",_.baggage))}return a(p,Ft(Ft({},f),{},{headers:x}))}};async function MU(t,e,r){if(!AU(typeof t=="string"||t instanceof URL?t:t.url,e))return null;const n=await EU();if(!n||!n.traceparent)return null;if(r){const i=OU(n.traceparent);if(i&&!i.isSampled)return null}return n}function kE(t){return typeof t=="boolean"?{enabled:t}:t}function LU(t){return t.endsWith("/")?t:t+"/"}function DU(t,e){var r,n,i,a,o,l;const{db:u,auth:d,realtime:p,global:f}=t,{db:g,auth:v,realtime:x,global:_}=e,b=kE(t.tracePropagation),k=kE(e.tracePropagation),A={db:Ft(Ft({},g),u),auth:Ft(Ft({},v),d),realtime:Ft(Ft({},x),p),storage:{},global:Ft(Ft(Ft({},_),f),{},{headers:Ft(Ft({},(r=_==null?void 0:_.headers)!==null&&r!==void 0?r:{}),(n=f==null?void 0:f.headers)!==null&&n!==void 0?n:{})}),tracePropagation:{enabled:(i=(a=b==null?void 0:b.enabled)!==null&&a!==void 0?a:k==null?void 0:k.enabled)!==null&&i!==void 0?i:!1,respectSamplingDecision:(o=(l=b==null?void 0:b.respectSamplingDecision)!==null&&l!==void 0?l:k==null?void 0:k.respectSamplingDecision)!==null&&o!==void 0?o:!0},accessToken:async()=>""};return t.accessToken?A.accessToken=t.accessToken:delete A.accessToken,A}function zU(t){const e=t==null?void 0:t.trim();if(!e)throw new Error("supabaseUrl is required.");if(!e.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(LU(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var BU=class extends pU{constructor(t){super(t)}},UU=class{constructor(t,e,r){var n,i;this.supabaseUrl=t,this.supabaseKey=e;const a=zU(t);if(!e)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",a),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",a),this.storageUrl=new URL("storage/v1",a),this.functionsUrl=new URL("functions/v1",a);const o=`sb-${a.hostname.split(".")[0]}-auth-token`,l={db:vU,realtime:xU,auth:Ft(Ft({},bU),{},{storageKey:o}),global:yU,tracePropagation:wU},u=DU(r??{},l);if(this.settings=u,this.storageKey=(n=u.auth.storageKey)!==null&&n!==void 0?n:"",this.headers=(i=u.global.headers)!==null&&i!==void 0?i:{},u.accessToken)this.accessToken=u.accessToken,this.auth=new Proxy({},{get:(p,f)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(f)} is not possible`)}});else{var d;this.auth=this._initSupabaseAuthClient((d=u.auth)!==null&&d!==void 0?d:{},this.headers,u.global.fetch)}this.fetch=$U(e,t,this._getAccessToken.bind(this),u.global.fetch,u.tracePropagation),this.realtime=this._initRealtimeClient(Ft({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},u.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(p=>this.realtime.setAuth(p)).catch(p=>console.warn("Failed to set initial Realtime auth token:",p)),this.rest=new n8(new URL("rest/v1",a).href,{headers:this.headers,schema:u.db.schema,fetch:this.fetch,timeout:u.db.timeout,urlLengthLimit:u.db.urlLengthLimit}),this.storage=new g6(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),u.accessToken||this._listenForAuthEvents()}get functions(){return new KB(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,e={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(t,e,r)}channel(t,e={config:{}}){return this.realtime.channel(t,e)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var t=this,e,r;if(t.accessToken)return await t.accessToken();const{data:n}=await t.auth.getSession();return(e=(r=n.session)===null||r===void 0?void 0:r.access_token)!==null&&e!==void 0?e:t.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:e,detectSessionInUrl:r,storage:n,userStorage:i,storageKey:a,flowType:o,lock:l,debug:u,throwOnError:d,experimental:p,lockAcquireTimeout:f,skipAutoInitialize:g},v,x){const _={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new BU({url:this.authUrl.href,headers:Ft(Ft({},_),v),storageKey:a,autoRefreshToken:t,persistSession:e,detectSessionInUrl:r,storage:n,userStorage:i,flowType:o,lock:l,debug:u,throwOnError:d,experimental:p,fetch:x,lockAcquireTimeout:f,skipAutoInitialize:g,hasCustomAuthorizationHeader:Object.keys(this.headers).some(b=>b.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new z8(this.realtimeUrl.href,Ft(Ft({},t),{},{params:Ft(Ft({},{apikey:this.supabaseKey}),t==null?void 0:t.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((t,e)=>{this._handleTokenChanged(t,"CLIENT",e==null?void 0:e.access_token)})}_handleTokenChanged(t,e,r){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):t==="SIGNED_OUT"&&(this.realtime.setAuth(),e=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const qU=(t,e,r)=>new UU(t,e,r);function FU(){if(typeof window<"u")return!1;const t=globalThis.process;if(!t)return!1;const e=t.version;if(e==null)return!1;const r=e.match(/^v(\d+)\./);return r?parseInt(r[1],10)<=18:!1}FU()&&console.warn("⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const VN=N.createContext({session:null,supabase:null,loading:!0,signIn:async()=>({error:"Not initialized"}),signOut:async()=>{}});function rp(){return N.useContext(VN)}function HU({children:t}){const[e,r]=N.useState(null),[n,i]=N.useState(null),[a,o]=N.useState(!0),l=N.useRef(null);N.useEffect(()=>{X4(()=>{var p;return((p=l.current)==null?void 0:p.access_token)??null})},[]),N.useEffect(()=>{et.get("/config").then(({config:p})=>{if(p.supabase.projectUrl&&p.supabase.anonKey){const f=qU(p.supabase.projectUrl,p.supabase.anonKey);r(f),f.auth.getSession().then(({data:v})=>{l.current=v.session,i(v.session),o(!1)});const{data:{subscription:g}}=f.auth.onAuthStateChange((v,x)=>{l.current=x,i(x)});return()=>g.unsubscribe()}o(!1)}).catch(()=>{o(!1)})},[]);async function u(p,f){if(!e)return{error:"Supabase not configured"};const{error:g}=await e.auth.signInWithPassword({email:p,password:f});return{error:(g==null?void 0:g.message)??null}}async function d(){e&&(await e.auth.signOut(),l.current=null,i(null))}return y.jsx(VN.Provider,{value:{session:n,supabase:e,loading:a,signIn:u,signOut:d},children:t})}const WU=[{to:"/squads",icon:Xh,label:"Squads"},{to:"/skills",icon:Lb,label:"Skills"},{to:"/schedules",icon:R5,label:"Schedules"},{to:"/wiki",icon:BP,label:"Wiki"},{to:"/usage",icon:$5,label:"Usage"}],GU=[{to:"/",icon:WP,label:"Chat"},{to:"/feed",icon:$b,label:"Inbox"},{to:"/settings",icon:M4,label:"Settings"}];function EE({to:t,icon:e,label:r,collapsed:n,badge:i}){return y.jsxs(LP,{to:t,end:t==="/",title:n?r:void 0,className:({isActive:a})=>Sc("w-full flex items-center gap-2.5 px-2 py-2 rounded-xl text-[11px] font-mono transition-colors cursor-pointer relative",n?"justify-center":"",a?"text-[#E43A9C]":"text-zinc-600 hover:text-zinc-300 hover:bg-white/[0.04]"),style:({isActive:a})=>a?{background:"rgba(228,58,156,0.1)"}:void 0,children:[y.jsx(e,{className:"w-3.5 h-3.5 flex-shrink-0"}),!n&&r,i!=null&&i>0&&y.jsx("span",{className:"absolute top-1 right-1 min-w-[14px] h-[14px] flex items-center justify-center rounded-full bg-[#E43A9C] text-[9px] text-white font-mono px-1",children:i>99?"99+":i})]})}function KU(){const[t,e]=N.useState(!1),[r,n]=N.useState("..."),[i,a]=N.useState(0),{supabase:o}=rp();return N.useEffect(()=>{let l=!0;et.get("/version").then(({version:d})=>{l&&n(d)}).catch(()=>{l&&n("unknown")}),et.get("/inbox/unread-count").then(({count:d})=>{l&&a(d)}).catch(()=>{});const u=setInterval(()=>{et.get("/inbox/unread-count").then(({count:d})=>{l&&a(d)}).catch(()=>{})},3e4);return()=>{l=!1,clearInterval(u)}},[]),y.jsxs("div",{className:"flex h-screen overflow-hidden bg-background relative",children:[y.jsxs("div",{className:Sc("flex-shrink-0 flex flex-col border-r border-white/[0.06] bg-[#181818] transition-all duration-200",t?"w-[52px]":"w-[210px]"),children:[y.jsx("div",{className:Sc("h-[52px] flex items-center border-b border-white/[0.06] flex-shrink-0",t?"justify-center px-3":"justify-between pl-4 pr-3"),children:t?y.jsx(Ra,{height:26}):y.jsxs("div",{className:"flex items-center gap-2.5",children:[y.jsx(Ra,{height:26}),y.jsx("span",{className:"text-2xl text-white tracking-wider leading-none",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"IO"})]})}),y.jsx("nav",{className:"flex-1 py-2 px-1.5 space-y-0.5 overflow-y-auto",children:WU.map(l=>y.jsx(EE,{collapsed:t,...l},l.to))}),y.jsxs("div",{className:"flex-shrink-0 border-t border-white/[0.06]",children:[y.jsx("div",{className:"py-1.5 px-1.5 space-y-0.5",children:GU.map(l=>y.jsx(EE,{collapsed:t,badge:l.to==="/feed"?i:void 0,...l},l.to))}),y.jsxs("div",{className:"border-t border-white/[0.05] py-1.5 px-1.5 space-y-0.5",children:[y.jsxs("a",{href:"https://github.com/michaeljolley/io",target:"_blank",rel:"noreferrer",title:"GitHub",className:Sc("flex items-center gap-2.5 px-2 py-2 rounded-xl text-[11px] font-mono text-zinc-600 hover:text-zinc-300 hover:bg-white/[0.04] transition-colors cursor-pointer",t&&"justify-center"),children:[y.jsx(l4,{className:"w-3.5 h-3.5 flex-shrink-0"}),!t&&y.jsxs("span",{className:"text-zinc-700",children:["v",r]})]}),y.jsx("button",{type:"button",onClick:()=>e(!t),title:t?"Expand sidebar":"Collapse sidebar",className:Sc("w-full flex items-center gap-2.5 px-2 py-2 rounded-xl text-[11px] font-mono text-zinc-600 hover:text-zinc-300 hover:bg-white/[0.04] transition-colors cursor-pointer",t&&"justify-center"),children:t?y.jsx(Pw,{className:"w-3.5 h-3.5 flex-shrink-0"}):y.jsx(Cu,{className:"w-3.5 h-3.5 flex-shrink-0"})})]})]})]}),y.jsxs("div",{className:"flex flex-col flex-1 min-w-0 overflow-hidden",children:[y.jsxs("div",{className:"h-[52px] flex-shrink-0 flex items-center justify-between px-4 border-b border-white/[0.06] bg-[#181818]",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx(UB,{status:"connected"}),y.jsx("span",{className:"text-[11px] font-mono text-green-400",children:"connected"})]}),y.jsxs("div",{className:"flex items-center gap-1.5",children:[y.jsx(rz,{}),o&&y.jsx("button",{type:"button",onClick:()=>o.auth.signOut(),className:"p-2 rounded-xl hover:bg-white/[0.05] text-zinc-600 hover:text-zinc-300 transition-colors cursor-pointer",title:"Sign out",children:y.jsx(y4,{className:"w-3.5 h-3.5"})})]})]}),y.jsxs("main",{className:"flex-1 overflow-hidden flex flex-col min-h-0 relative",children:[y.jsxs("div",{className:"absolute inset-0 overflow-hidden pointer-events-none",style:{zIndex:0},children:[y.jsx("div",{className:"orb orb-pink"}),y.jsx("div",{className:"orb orb-gray"})]}),y.jsx(uD,{})]})]})]})}function VU(){const{session:t}=rp(),e=ml(),{messages:r,streaming:n,isStreaming:i,isThinking:a,sendChatMessage:o,addUserMessage:l,uploadAttachment:u}=eN(),[d,p]=N.useState(""),[f,g]=N.useState(null),[v,x]=N.useState(null),_=N.useRef(null),b=N.useRef(null),k=N.useRef(null);N.useLayoutEffect(()=>{const E=_.current;E&&(E.scrollTop=E.scrollHeight)},[r,n,a]);async function A(){const E=d.trim();if(!E&&!f||i||a)return;const T=crypto.randomUUID(),P=f==null?void 0:f.name,R=[E,P?`Attachment: ${P}`:""].filter(Boolean).join(`
430
+
431
+ `);l({id:T,role:"user",content:E,timestamp:new Date().toISOString(),attachmentName:P}),p(""),g(null),k.current&&(k.current.value=""),b.current&&(b.current.style.height="auto");try{f&&await u(f,T),o(R)}catch{}}function O(E){E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),A())}function C(E){p(E.target.value),b.current&&(b.current.style.height="auto",b.current.style.height=`${Math.min(b.current.scrollHeight,160)}px`)}return y.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[y.jsxs("div",{ref:_,className:"flex-1 overflow-y-auto px-5 py-5 space-y-5",children:[r.map(E=>{var T,P;return y.jsxs("div",{className:`flex gap-3 ${E.role==="user"?"flex-row-reverse":""}`,children:[y.jsx("div",{className:`flex-shrink-0 w-6 h-6 rounded-lg flex items-center justify-center text-[10px] font-mono mt-0.5 ${E.role==="user"?"border border-[#E43A9C]/30 text-[#E43A9C]":"bg-[#282828] border border-white/[0.07] text-zinc-500"}`,style:E.role==="user"?{background:"rgba(228,58,156,0.12)"}:void 0,children:E.role==="user"?((P=(T=t==null?void 0:t.user)==null?void 0:T.email)==null?void 0:P.charAt(0).toUpperCase())??"U":y.jsx(Ra,{height:12})}),y.jsxs("div",{className:`flex flex-col gap-1.5 max-w-[72%] ${E.role==="user"?"items-end":"items-start"}`,children:[E.toolCall&&y.jsxs("button",{type:"button",onClick:()=>x(v===E.id?null:E.id),className:"w-full text-left border border-white/[0.07] bg-[#1e1e1e] rounded-xl px-3 py-2 flex items-center gap-2 hover:border-[#E43A9C]/25 transition-colors",children:[y.jsx(Kh,{className:"w-3 h-3 text-[#E43A9C] flex-shrink-0"}),y.jsx("span",{className:"text-[11px] font-mono text-zinc-400 flex-1",children:E.toolCall.name}),y.jsx(Vt,{variant:E.toolCall.status==="done"?"success":E.toolCall.status==="error"?"error":"warning",children:E.toolCall.status}),y.jsx(L5,{className:`w-3 h-3 text-zinc-600 transition-transform flex-shrink-0 ${v===E.id?"rotate-180":""}`})]}),E.toolCall&&v===E.id&&y.jsx("div",{className:"w-full bg-[#181818] border border-white/[0.06] rounded-xl px-3 py-2",children:y.jsx("p",{className:"text-[11px] font-mono text-zinc-500",children:E.toolCall.result})}),E.attachmentName&&y.jsx("div",{className:"rounded-xl border border-white/[0.08] bg-[#1e1e1e] px-3 py-2 text-[11px] font-mono text-zinc-400",children:E.attachmentName}),E.content&&y.jsx("div",{className:`rounded-2xl px-4 py-2.5 text-sm leading-relaxed ${E.role==="user"?"text-white rounded-tr-sm":"bg-[#222222] border border-white/[0.07] text-zinc-200 rounded-tl-sm"}`,style:E.role==="user"?{background:"linear-gradient(135deg, #D83333 0%, #C0285E 100%)"}:void 0,children:E.role==="user"?y.jsx("p",{className:"whitespace-pre-wrap",children:E.content}):y.jsx("div",{className:"prose-io",dangerouslySetInnerHTML:{__html:nt.parse(E.content)}})}),y.jsx("span",{className:"text-[11px] text-zinc-700 font-mono px-0.5",children:Rw(E.timestamp,e)})]})]},E.id)}),a&&y.jsxs("div",{className:"flex gap-3",children:[y.jsx("div",{className:"flex-shrink-0 w-6 h-6 rounded-lg flex items-center justify-center bg-[#282828] border border-white/[0.07] mt-0.5",children:y.jsx(Ra,{height:12})}),y.jsx("div",{className:"bg-[#222222] border border-white/[0.07] rounded-2xl rounded-tl-sm px-4 py-3 flex items-center gap-1.5",children:[0,120,240].map(E=>y.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#E43A9C] animate-bounce",style:{animationDelay:`${E}ms`}},E))})]}),i&&n&&y.jsxs("div",{className:"flex gap-3",children:[y.jsx("div",{className:"flex-shrink-0 w-6 h-6 rounded-lg flex items-center justify-center bg-[#282828] border border-white/[0.07] mt-0.5",children:y.jsx(Ra,{height:12})}),y.jsx("div",{className:"bg-[#222222] border border-white/[0.07] rounded-2xl rounded-tl-sm px-4 py-2.5 max-w-[72%]",children:y.jsx("div",{className:"prose-io text-sm",dangerouslySetInnerHTML:{__html:nt.parse(n)}})})]}),i&&!n&&y.jsxs("div",{className:"flex gap-3",children:[y.jsx("div",{className:"flex-shrink-0 w-6 h-6 rounded-lg flex items-center justify-center bg-[#282828] border border-white/[0.07] mt-0.5",children:y.jsx(Ra,{height:12})}),y.jsx("div",{className:"bg-[#222222] border border-white/[0.07] rounded-2xl rounded-tl-sm px-4 py-3 flex items-center gap-1.5",children:[0,120,240].map(E=>y.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#E43A9C] animate-bounce",style:{animationDelay:`${E}ms`}},E))})]})]}),y.jsxs("div",{className:"border-t border-white/[0.06] p-4 flex-shrink-0",children:[y.jsxs("div",{className:"bg-[#1e1e1e] border border-white/[0.08] rounded-2xl overflow-hidden transition-colors focus-within:border-[#E43A9C]/30",children:[y.jsx("input",{ref:k,type:"file",className:"hidden",onChange:E=>{var T;return g(((T=E.target.files)==null?void 0:T[0])??null)}}),f&&y.jsxs("div",{className:"px-4 pt-3 text-[11px] font-mono text-zinc-400",children:["Attached: ",f.name]}),y.jsx("textarea",{ref:b,value:d,onChange:C,onKeyDown:O,placeholder:"Message IO…",rows:1,className:"w-full bg-transparent px-4 pt-3 pb-1 text-sm text-zinc-200 placeholder:text-zinc-700 resize-none focus:outline-none",style:{minHeight:"42px",maxHeight:"160px",fontFamily:"Inter, sans-serif"}}),y.jsxs("div",{className:"flex items-center justify-between px-3 pb-2.5",children:[y.jsx("button",{type:"button",onClick:()=>{var E;return(E=k.current)==null?void 0:E.click()},className:"p-1.5 rounded-lg hover:bg-white/[0.05] text-zinc-700 hover:text-zinc-400 transition-colors",children:y.jsx(GP,{className:"w-4 h-4"})}),y.jsx("div",{className:"flex items-center gap-2",children:i?y.jsxs("button",{type:"button",onClick:()=>{},className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-zinc-800 hover:bg-zinc-700 text-[11px] font-mono text-zinc-300 transition-colors",children:[y.jsx(Vh,{className:"w-3 h-3"})," Stop"]}):y.jsx("button",{type:"button",onClick:A,disabled:!d.trim()&&!f||a,className:"p-2 rounded-xl text-white disabled:opacity-30 disabled:cursor-not-allowed transition-opacity hover:opacity-90",style:{background:"linear-gradient(135deg, #D83333, #E43A9C)"},children:y.jsx(XP,{className:"w-3.5 h-3.5"})})})]})]}),y.jsx("p",{className:"text-center text-[11px] text-zinc-800 font-mono mt-2",children:"IO may make mistakes. Verify important outputs."})]})]})}var Tg,OE;function XU(){if(OE)return Tg;OE=1;function t(M){return M instanceof Map?M.clear=M.delete=M.set=function(){throw new Error("map is read-only")}:M instanceof Set&&(M.add=M.clear=M.delete=function(){throw new Error("set is read-only")}),Object.freeze(M),Object.getOwnPropertyNames(M).forEach(ne=>{const de=M[ne],Re=typeof de;(Re==="object"||Re==="function")&&!Object.isFrozen(de)&&t(de)}),M}class e{constructor(ne){ne.data===void 0&&(ne.data={}),this.data=ne.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r(M){return M.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function n(M,...ne){const de=Object.create(null);for(const Re in M)de[Re]=M[Re];return ne.forEach(function(Re){for(const ht in Re)de[ht]=Re[ht]}),de}const i="</span>",a=M=>!!M.scope,o=(M,{prefix:ne})=>{if(M.startsWith("language:"))return M.replace("language:","language-");if(M.includes(".")){const de=M.split(".");return[`${ne}${de.shift()}`,...de.map((Re,ht)=>`${Re}${"_".repeat(ht+1)}`)].join(" ")}return`${ne}${M}`};class l{constructor(ne,de){this.buffer="",this.classPrefix=de.classPrefix,ne.walk(this)}addText(ne){this.buffer+=r(ne)}openNode(ne){if(!a(ne))return;const de=o(ne.scope,{prefix:this.classPrefix});this.span(de)}closeNode(ne){a(ne)&&(this.buffer+=i)}value(){return this.buffer}span(ne){this.buffer+=`<span class="${ne}">`}}const u=(M={})=>{const ne={children:[]};return Object.assign(ne,M),ne};class d{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(ne){this.top.children.push(ne)}openNode(ne){const de=u({scope:ne});this.add(de),this.stack.push(de)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(ne){return this.constructor._walk(ne,this.rootNode)}static _walk(ne,de){return typeof de=="string"?ne.addText(de):de.children&&(ne.openNode(de),de.children.forEach(Re=>this._walk(ne,Re)),ne.closeNode(de)),ne}static _collapse(ne){typeof ne!="string"&&ne.children&&(ne.children.every(de=>typeof de=="string")?ne.children=[ne.children.join("")]:ne.children.forEach(de=>{d._collapse(de)}))}}class p extends d{constructor(ne){super(),this.options=ne}addText(ne){ne!==""&&this.add(ne)}startScope(ne){this.openNode(ne)}endScope(){this.closeNode()}__addSublanguage(ne,de){const Re=ne.root;de&&(Re.scope=`language:${de}`),this.add(Re)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function f(M){return M?typeof M=="string"?M:M.source:null}function g(M){return _("(?=",M,")")}function v(M){return _("(?:",M,")*")}function x(M){return _("(?:",M,")?")}function _(...M){return M.map(de=>f(de)).join("")}function b(M){const ne=M[M.length-1];return typeof ne=="object"&&ne.constructor===Object?(M.splice(M.length-1,1),ne):{}}function k(...M){return"("+(b(M).capture?"":"?:")+M.map(Re=>f(Re)).join("|")+")"}function A(M){return new RegExp(M.toString()+"|").exec("").length-1}function O(M,ne){const de=M&&M.exec(ne);return de&&de.index===0}const C=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function E(M,{joinWith:ne}){let de=0;return M.map(Re=>{de+=1;const ht=de;let Ke=f(Re),ye="";for(;Ke.length>0;){const we=C.exec(Ke);if(!we){ye+=Ke;break}ye+=Ke.substring(0,we.index),Ke=Ke.substring(we.index+we[0].length),we[0][0]==="\\"&&we[1]?ye+="\\"+String(Number(we[1])+ht):(ye+=we[0],we[0]==="("&&de++)}return ye}).map(Re=>`(${Re})`).join(ne)}const T=/\b\B/,P="[a-zA-Z]\\w*",R="[a-zA-Z_]\\w*",I="\\b\\d+(\\.\\d+)?",Y="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",W="\\b(0b[01]+)",B="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",X=(M={})=>{const ne=/^#![ ]*\//;return M.binary&&(M.begin=_(ne,/.*\b/,M.binary,/\b.*/)),n({scope:"meta",begin:ne,end:/$/,relevance:0,"on:begin":(de,Re)=>{de.index!==0&&Re.ignoreMatch()}},M)},K={begin:"\\\\[\\s\\S]",relevance:0},U={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[K]},G={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[K]},J={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},F=function(M,ne,de={}){const Re=n({scope:"comment",begin:M,end:ne,contains:[]},de);Re.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const ht=k("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Re.contains.push({begin:_(/[ ]+/,"(",ht,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Re},te=F("//","$"),q=F("/\\*","\\*/"),z=F("#","$"),L={scope:"number",begin:I,relevance:0},Z={scope:"number",begin:Y,relevance:0},se={scope:"number",begin:W,relevance:0},le={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[K,{begin:/\[/,end:/\]/,relevance:0,contains:[K]}]},ve={scope:"title",begin:P,relevance:0},qe={scope:"title",begin:R,relevance:0},xe={begin:"\\.\\s*"+R,relevance:0};var Se=Object.freeze({__proto__:null,APOS_STRING_MODE:U,BACKSLASH_ESCAPE:K,BINARY_NUMBER_MODE:se,BINARY_NUMBER_RE:W,COMMENT:F,C_BLOCK_COMMENT_MODE:q,C_LINE_COMMENT_MODE:te,C_NUMBER_MODE:Z,C_NUMBER_RE:Y,END_SAME_AS_BEGIN:function(M){return Object.assign(M,{"on:begin":(ne,de)=>{de.data._beginMatch=ne[1]},"on:end":(ne,de)=>{de.data._beginMatch!==ne[1]&&de.ignoreMatch()}})},HASH_COMMENT_MODE:z,IDENT_RE:P,MATCH_NOTHING_RE:T,METHOD_GUARD:xe,NUMBER_MODE:L,NUMBER_RE:I,PHRASAL_WORDS_MODE:J,QUOTE_STRING_MODE:G,REGEXP_MODE:le,RE_STARTERS_RE:B,SHEBANG:X,TITLE_MODE:ve,UNDERSCORE_IDENT_RE:R,UNDERSCORE_TITLE_MODE:qe});function Me(M,ne){M.input[M.index-1]==="."&&ne.ignoreMatch()}function oe(M,ne){M.className!==void 0&&(M.scope=M.className,delete M.className)}function tt(M,ne){ne&&M.beginKeywords&&(M.begin="\\b("+M.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",M.__beforeBegin=Me,M.keywords=M.keywords||M.beginKeywords,delete M.beginKeywords,M.relevance===void 0&&(M.relevance=0))}function Fe(M,ne){Array.isArray(M.illegal)&&(M.illegal=k(...M.illegal))}function kt(M,ne){if(M.match){if(M.begin||M.end)throw new Error("begin & end are not supported with match");M.begin=M.match,delete M.match}}function wt(M,ne){M.relevance===void 0&&(M.relevance=1)}const Et=(M,ne)=>{if(!M.beforeMatch)return;if(M.starts)throw new Error("beforeMatch cannot be used with starts");const de=Object.assign({},M);Object.keys(M).forEach(Re=>{delete M[Re]}),M.keywords=de.keywords,M.begin=_(de.beforeMatch,g(de.begin)),M.starts={relevance:0,contains:[Object.assign(de,{endsParent:!0})]},M.relevance=0,delete de.beforeMatch},Sr=["of","and","for","in","not","or","if","then","parent","list","value"],Bt="keyword";function Rr(M,ne,de=Bt){const Re=Object.create(null);return typeof M=="string"?ht(de,M.split(" ")):Array.isArray(M)?ht(de,M):Object.keys(M).forEach(function(Ke){Object.assign(Re,Rr(M[Ke],ne,Ke))}),Re;function ht(Ke,ye){ne&&(ye=ye.map(we=>we.toLowerCase())),ye.forEach(function(we){const Ce=we.split("|");Re[Ce[0]]=[Ke,lr(Ce[0],Ce[1])]})}}function lr(M,ne){return ne?Number(ne):_t(M)?0:1}function _t(M){return Sr.includes(M.toLowerCase())}const kr={},Ir=M=>{console.error(M)},ni=(M,...ne)=>{console.log(`WARN: ${M}`,...ne)},Ur=(M,ne)=>{kr[`${M}/${ne}`]||(console.log(`Deprecated as of ${M}. ${ne}`),kr[`${M}/${ne}`]=!0)},ii=new Error;function ai(M,ne,{key:de}){let Re=0;const ht=M[de],Ke={},ye={};for(let we=1;we<=ne.length;we++)ye[we+Re]=ht[we],Ke[we+Re]=!0,Re+=A(ne[we-1]);M[de]=ye,M[de]._emit=Ke,M[de]._multi=!0}function aa(M){if(Array.isArray(M.begin)){if(M.skip||M.excludeBegin||M.returnBegin)throw Ir("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ii;if(typeof M.beginScope!="object"||M.beginScope===null)throw Ir("beginScope must be object"),ii;ai(M,M.begin,{key:"beginScope"}),M.begin=E(M.begin,{joinWith:""})}}function qr(M){if(Array.isArray(M.end)){if(M.skip||M.excludeEnd||M.returnEnd)throw Ir("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ii;if(typeof M.endScope!="object"||M.endScope===null)throw Ir("endScope must be object"),ii;ai(M,M.end,{key:"endScope"}),M.end=E(M.end,{joinWith:""})}}function oi(M){M.scope&&typeof M.scope=="object"&&M.scope!==null&&(M.beginScope=M.scope,delete M.scope)}function si(M){oi(M),typeof M.beginScope=="string"&&(M.beginScope={_wrap:M.beginScope}),typeof M.endScope=="string"&&(M.endScope={_wrap:M.endScope}),aa(M),qr(M)}function Ho(M){function ne(ye,we){return new RegExp(f(ye),"m"+(M.case_insensitive?"i":"")+(M.unicodeRegex?"u":"")+(we?"g":""))}class de{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(we,Ce){Ce.position=this.position++,this.matchIndexes[this.matchAt]=Ce,this.regexes.push([Ce,we]),this.matchAt+=A(we)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const we=this.regexes.map(Ce=>Ce[1]);this.matcherRe=ne(E(we,{joinWith:"|"}),!0),this.lastIndex=0}exec(we){this.matcherRe.lastIndex=this.lastIndex;const Ce=this.matcherRe.exec(we);if(!Ce)return null;const ct=Ce.findIndex((cr,Oi)=>Oi>0&&cr!==void 0),gt=this.matchIndexes[ct];return Ce.splice(0,ct),Object.assign(Ce,gt)}}class Re{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(we){if(this.multiRegexes[we])return this.multiRegexes[we];const Ce=new de;return this.rules.slice(we).forEach(([ct,gt])=>Ce.addRule(ct,gt)),Ce.compile(),this.multiRegexes[we]=Ce,Ce}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(we,Ce){this.rules.push([we,Ce]),Ce.type==="begin"&&this.count++}exec(we){const Ce=this.getMatcher(this.regexIndex);Ce.lastIndex=this.lastIndex;let ct=Ce.exec(we);if(this.resumingScanAtSamePosition()&&!(ct&&ct.index===this.lastIndex)){const gt=this.getMatcher(0);gt.lastIndex=this.lastIndex+1,ct=gt.exec(we)}return ct&&(this.regexIndex+=ct.position+1,this.regexIndex===this.count&&this.considerAll()),ct}}function ht(ye){const we=new Re;return ye.contains.forEach(Ce=>we.addRule(Ce.begin,{rule:Ce,type:"begin"})),ye.terminatorEnd&&we.addRule(ye.terminatorEnd,{type:"end"}),ye.illegal&&we.addRule(ye.illegal,{type:"illegal"}),we}function Ke(ye,we){const Ce=ye;if(ye.isCompiled)return Ce;[oe,kt,si,Et].forEach(gt=>gt(ye,we)),M.compilerExtensions.forEach(gt=>gt(ye,we)),ye.__beforeBegin=null,[tt,Fe,wt].forEach(gt=>gt(ye,we)),ye.isCompiled=!0;let ct=null;return typeof ye.keywords=="object"&&ye.keywords.$pattern&&(ye.keywords=Object.assign({},ye.keywords),ct=ye.keywords.$pattern,delete ye.keywords.$pattern),ct=ct||/\w+/,ye.keywords&&(ye.keywords=Rr(ye.keywords,M.case_insensitive)),Ce.keywordPatternRe=ne(ct,!0),we&&(ye.begin||(ye.begin=/\B|\b/),Ce.beginRe=ne(Ce.begin),!ye.end&&!ye.endsWithParent&&(ye.end=/\B|\b/),ye.end&&(Ce.endRe=ne(Ce.end)),Ce.terminatorEnd=f(Ce.end)||"",ye.endsWithParent&&we.terminatorEnd&&(Ce.terminatorEnd+=(ye.end?"|":"")+we.terminatorEnd)),ye.illegal&&(Ce.illegalRe=ne(ye.illegal)),ye.contains||(ye.contains=[]),ye.contains=[].concat(...ye.contains.map(function(gt){return Wo(gt==="self"?ye:gt)})),ye.contains.forEach(function(gt){Ke(gt,Ce)}),ye.starts&&Ke(ye.starts,we),Ce.matcher=ht(Ce),Ce}if(M.compilerExtensions||(M.compilerExtensions=[]),M.contains&&M.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return M.classNameAliases=n(M.classNameAliases||{}),Ke(M)}function Ka(M){return M?M.endsWithParent||Ka(M.starts):!1}function Wo(M){return M.variants&&!M.cachedVariants&&(M.cachedVariants=M.variants.map(function(ne){return n(M,{variants:null},ne)})),M.cachedVariants?M.cachedVariants:Ka(M)?n(M,{starts:M.starts?n(M.starts):null}):Object.isFrozen(M)?n(M):M}var oa="11.11.1";class Va extends Error{constructor(ne,de){super(ne),this.name="HTMLInjectionError",this.html=de}}const Rn=r,$r=n,sa=Symbol("nomatch"),li=7,hn=function(M){const ne=Object.create(null),de=Object.create(null),Re=[];let ht=!0;const Ke="Could not find the language '{}', did you forget to load/include a language module?",ye={disableAutodetect:!0,name:"Plain text",contains:[]};let we={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:p};function Ce(he){return we.noHighlightRe.test(he)}function ct(he){let $e=he.className+" ";$e+=he.parentNode?he.parentNode.className:"";const Ve=we.languageDetectRe.exec($e);if(Ve){const Ze=In(Ve[1]);return Ze||(ni(Ke.replace("{}",Ve[1])),ni("Falling back to no-highlight mode for this block.",he)),Ze?Ve[1]:"no-highlight"}return $e.split(/\s+/).find(Ze=>Ce(Ze)||In(Ze))}function gt(he,$e,Ve){let Ze="",Wt="";typeof $e=="object"?(Ze=he,Ve=$e.ignoreIllegals,Wt=$e.language):(Ur("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ur("10.7.0",`Please use highlight(code, options) instead.
432
+ https://github.com/highlightjs/highlight.js/issues/2277`),Wt=he,Ze=$e),Ve===void 0&&(Ve=!0);const Lt={code:Ze,language:Wt};Ya("before:highlight",Lt);const ci=Lt.result?Lt.result:cr(Lt.language,Lt.code,Ve);return ci.code=Lt.code,Ya("after:highlight",ci),ci}function cr(he,$e,Ve,Ze){const Wt=Object.create(null);function Lt(me,Ee){return me.keywords[Ee]}function ci(){if(!Ge.keywords){Gt.addText(yt);return}let me=0;Ge.keywordPatternRe.lastIndex=0;let Ee=Ge.keywordPatternRe.exec(yt),He="";for(;Ee;){He+=yt.substring(me,Ee.index);const rt=mn.case_insensitive?Ee[0].toLowerCase():Ee[0],Ut=Lt(Ge,rt);if(Ut){const[ur,zp]=Ut;if(Gt.addText(He),He="",Wt[rt]=(Wt[rt]||0)+1,Wt[rt]<=li&&(Qa+=zp),ur.startsWith("_"))He+=Ee[0];else{const Xu=mn.classNameAliases[ur]||ur;Lr(Ee[0],Xu)}}else He+=Ee[0];me=Ge.keywordPatternRe.lastIndex,Ee=Ge.keywordPatternRe.exec(yt)}He+=yt.substring(me),Gt.addText(He)}function Vo(){if(yt==="")return;let me=null;if(typeof Ge.subLanguage=="string"){if(!ne[Ge.subLanguage]){Gt.addText(yt);return}me=cr(Ge.subLanguage,yt,!0,Pl[Ge.subLanguage]),Pl[Ge.subLanguage]=me._top}else me=Xa(yt,Ge.subLanguage.length?Ge.subLanguage:null);Ge.relevance>0&&(Qa+=me.relevance),Gt.__addSublanguage(me._emitter,me.language)}function Mr(){Ge.subLanguage!=null?Vo():ci(),yt=""}function Lr(me,Ee){me!==""&&(Gt.startScope(Ee),Gt.addText(me),Gt.endScope())}function Ja(me,Ee){let He=1;const rt=Ee.length-1;for(;He<=rt;){if(!me._emit[He]){He++;continue}const Ut=mn.classNameAliases[me[He]]||me[He],ur=Ee[He];Ut?Lr(ur,Ut):(yt=ur,ci(),yt=""),He++}}function la(me,Ee){return me.scope&&typeof me.scope=="string"&&Gt.openNode(mn.classNameAliases[me.scope]||me.scope),me.beginScope&&(me.beginScope._wrap?(Lr(yt,mn.classNameAliases[me.beginScope._wrap]||me.beginScope._wrap),yt=""):me.beginScope._multi&&(Ja(me.beginScope,Ee),yt="")),Ge=Object.create(me,{parent:{value:Ge}}),Ge}function Za(me,Ee,He){let rt=O(me.endRe,He);if(rt){if(me["on:end"]){const Ut=new e(me);me["on:end"](Ee,Ut),Ut.isMatchIgnored&&(rt=!1)}if(rt){for(;me.endsParent&&me.parent;)me=me.parent;return me}}if(me.endsWithParent)return Za(me.parent,Ee,He)}function Lp(me){return Ge.matcher.regexIndex===0?(yt+=me[0],1):(da=!0,0)}function Dp(me){const Ee=me[0],He=me.rule,rt=new e(He),Ut=[He.__beforeBegin,He["on:begin"]];for(const ur of Ut)if(ur&&(ur(me,rt),rt.isMatchIgnored))return Lp(Ee);return He.skip?yt+=Ee:(He.excludeBegin&&(yt+=Ee),Mr(),!He.returnBegin&&!He.excludeBegin&&(yt=Ee)),la(He,me),He.returnBegin?0:Ee.length}function Cl(me){const Ee=me[0],He=$e.substring(me.index),rt=Za(Ge,me,He);if(!rt)return sa;const Ut=Ge;Ge.endScope&&Ge.endScope._wrap?(Mr(),Lr(Ee,Ge.endScope._wrap)):Ge.endScope&&Ge.endScope._multi?(Mr(),Ja(Ge.endScope,me)):Ut.skip?yt+=Ee:(Ut.returnEnd||Ut.excludeEnd||(yt+=Ee),Mr(),Ut.excludeEnd&&(yt=Ee));do Ge.scope&&Gt.closeNode(),!Ge.skip&&!Ge.subLanguage&&(Qa+=Ge.relevance),Ge=Ge.parent;while(Ge!==rt.parent);return rt.starts&&la(rt.starts,me),Ut.returnEnd?0:Ee.length}function Vu(){const me=[];for(let Ee=Ge;Ee!==mn;Ee=Ee.parent)Ee.scope&&me.unshift(Ee.scope);me.forEach(Ee=>Gt.openNode(Ee))}let ca={};function ua(me,Ee){const He=Ee&&Ee[0];if(yt+=me,He==null)return Mr(),0;if(ca.type==="begin"&&Ee.type==="end"&&ca.index===Ee.index&&He===""){if(yt+=$e.slice(Ee.index,Ee.index+1),!ht){const rt=new Error(`0 width match regex (${he})`);throw rt.languageName=he,rt.badRule=ca.rule,rt}return 1}if(ca=Ee,Ee.type==="begin")return Dp(Ee);if(Ee.type==="illegal"&&!Ve){const rt=new Error('Illegal lexeme "'+He+'" for mode "'+(Ge.scope||"<unnamed>")+'"');throw rt.mode=Ge,rt}else if(Ee.type==="end"){const rt=Cl(Ee);if(rt!==sa)return rt}if(Ee.type==="illegal"&&He==="")return yt+=`
433
+ `,1;if(eo>1e5&&eo>Ee.index*3)throw new Error("potential infinite loop, way more iterations than matches");return yt+=He,He.length}const mn=In(he);if(!mn)throw Ir(Ke.replace("{}",he)),new Error('Unknown language: "'+he+'"');const jl=Ho(mn);let st="",Ge=Ze||jl;const Pl={},Gt=new we.__emitter(we);Vu();let yt="",Qa=0,ui=0,eo=0,da=!1;try{if(mn.__emitTokens)mn.__emitTokens($e,Gt);else{for(Ge.matcher.considerAll();;){eo++,da?da=!1:Ge.matcher.considerAll(),Ge.matcher.lastIndex=ui;const me=Ge.matcher.exec($e);if(!me)break;const Ee=$e.substring(ui,me.index),He=ua(Ee,me);ui=me.index+He}ua($e.substring(ui))}return Gt.finalize(),st=Gt.toHTML(),{language:he,value:st,relevance:Qa,illegal:!1,_emitter:Gt,_top:Ge}}catch(me){if(me.message&&me.message.includes("Illegal"))return{language:he,value:Rn($e),illegal:!0,relevance:0,_illegalBy:{message:me.message,index:ui,context:$e.slice(ui-100,ui+100),mode:me.mode,resultSoFar:st},_emitter:Gt};if(ht)return{language:he,value:Rn($e),illegal:!1,relevance:0,errorRaised:me,_emitter:Gt,_top:Ge};throw me}}function Oi(he){const $e={value:Rn(he),illegal:!1,relevance:0,_top:ye,_emitter:new we.__emitter(we)};return $e._emitter.addText(he),$e}function Xa(he,$e){$e=$e||we.languages||Object.keys(ne);const Ve=Oi(he),Ze=$e.filter(In).filter(Ku).map(Mr=>cr(Mr,he,!1));Ze.unshift(Ve);const Wt=Ze.sort((Mr,Lr)=>{if(Mr.relevance!==Lr.relevance)return Lr.relevance-Mr.relevance;if(Mr.language&&Lr.language){if(In(Mr.language).supersetOf===Lr.language)return 1;if(In(Lr.language).supersetOf===Mr.language)return-1}return 0}),[Lt,ci]=Wt,Vo=Lt;return Vo.secondBest=ci,Vo}function Ip(he,$e,Ve){const Ze=$e&&de[$e]||Ve;he.classList.add("hljs"),he.classList.add(`language-${Ze}`)}function Ol(he){let $e=null;const Ve=ct(he);if(Ce(Ve))return;if(Ya("before:highlightElement",{el:he,language:Ve}),he.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",he);return}if(he.children.length>0&&(we.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(he)),we.throwUnescapedHTML))throw new Va("One of your code blocks includes unescaped HTML.",he.innerHTML);$e=he;const Ze=$e.textContent,Wt=Ve?gt(Ze,{language:Ve,ignoreIllegals:!0}):Xa(Ze);he.innerHTML=Wt.value,he.dataset.highlighted="yes",Ip(he,Ve,Wt.language),he.result={language:Wt.language,re:Wt.relevance,relevance:Wt.relevance},Wt.secondBest&&(he.secondBest={language:Wt.secondBest.language,relevance:Wt.secondBest.relevance}),Ya("after:highlightElement",{el:he,result:Wt,text:Ze})}function $p(he){we=$r(we,he)}const Ai=()=>{Go(),Ur("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function qu(){Go(),Ur("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Al=!1;function Go(){function he(){Go()}if(document.readyState==="loading"){Al||window.addEventListener("DOMContentLoaded",he,!1),Al=!0;return}document.querySelectorAll(we.cssSelector).forEach(Ol)}function Fu(he,$e){let Ve=null;try{Ve=$e(M)}catch(Ze){if(Ir("Language definition for '{}' could not be registered.".replace("{}",he)),ht)Ir(Ze);else throw Ze;Ve=ye}Ve.name||(Ve.name=he),ne[he]=Ve,Ve.rawDefinition=$e.bind(null,M),Ve.aliases&&Gu(Ve.aliases,{languageName:he})}function Hu(he){delete ne[he];for(const $e of Object.keys(de))de[$e]===he&&delete de[$e]}function Wu(){return Object.keys(ne)}function In(he){return he=(he||"").toLowerCase(),ne[he]||ne[de[he]]}function Gu(he,{languageName:$e}){typeof he=="string"&&(he=[he]),he.forEach(Ve=>{de[Ve.toLowerCase()]=$e})}function Ku(he){const $e=In(he);return $e&&!$e.disableAutodetect}function Mt(he){he["before:highlightBlock"]&&!he["before:highlightElement"]&&(he["before:highlightElement"]=$e=>{he["before:highlightBlock"](Object.assign({block:$e.el},$e))}),he["after:highlightBlock"]&&!he["after:highlightElement"]&&(he["after:highlightElement"]=$e=>{he["after:highlightBlock"](Object.assign({block:$e.el},$e))})}function Mp(he){Mt(he),Re.push(he)}function Tl(he){const $e=Re.indexOf(he);$e!==-1&&Re.splice($e,1)}function Ya(he,$e){const Ve=he;Re.forEach(function(Ze){Ze[Ve]&&Ze[Ve]($e)})}function Ko(he){return Ur("10.7.0","highlightBlock will be removed entirely in v12.0"),Ur("10.7.0","Please use highlightElement now."),Ol(he)}Object.assign(M,{highlight:gt,highlightAuto:Xa,highlightAll:Go,highlightElement:Ol,highlightBlock:Ko,configure:$p,initHighlighting:Ai,initHighlightingOnLoad:qu,registerLanguage:Fu,unregisterLanguage:Hu,listLanguages:Wu,getLanguage:In,registerAliases:Gu,autoDetection:Ku,inherit:$r,addPlugin:Mp,removePlugin:Tl}),M.debugMode=function(){ht=!1},M.safeMode=function(){ht=!0},M.versionString=oa,M.regex={concat:_,lookahead:g,either:k,optional:x,anyNumberOfTimes:v};for(const he in Se)typeof Se[he]=="object"&&t(Se[he]);return Object.assign(M,Se),M},pn=hn({});return pn.newInstance=()=>hn({}),Tg=pn,pn.HighlightJS=pn,pn.default=pn,Tg}var YU=XU();const Qt=vt(YU),JU=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),ZU=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],QU=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],eq=[...ZU,...QU],tq=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),rq=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),nq=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),iq=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function aq(t){const e=t.regex,r=JU(t),n={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",a=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",l=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[r.BLOCK_COMMENT,n,r.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},r.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+rq.join("|")+")"},{begin:":(:)?("+nq.join("|")+")"}]},r.CSS_VARIABLE,{className:"attribute",begin:"\\b("+iq.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[r.BLOCK_COMMENT,r.HEXCOLOR,r.IMPORTANT,r.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},r.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:a},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:tq.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,r.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+eq.join("|")+")\\b"}]}}function oq(t){const a={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:a,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:a,illegal:/["']/}]}]}}const AE="[A-Za-z$_][0-9A-Za-z$_]*",sq=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],lq=["true","false","null","undefined","NaN","Infinity"],XN=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],YN=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],JN=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],cq=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],uq=[].concat(JN,XN,YN);function ZN(t){const e=t.regex,r=(F,{after:te})=>{const q="</"+F[0].slice(1);return F.input.indexOf(q,te)!==-1},n=AE,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(F,te)=>{const q=F[0].length+F.index,z=F.input[q];if(z==="<"||z===","){te.ignoreMatch();return}z===">"&&(r(F,{after:q})||te.ignoreMatch());let L;const Z=F.input.substring(q);if(L=Z.match(/^\s*=/)){te.ignoreMatch();return}if((L=Z.match(/^\s+extends\s+/))&&L.index===0){te.ignoreMatch();return}}},l={$pattern:AE,keyword:sq,literal:lq,built_in:uq,"variable.language":cq},u="[0-9](_?[0-9])*",d=`\\.(${u})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${p})((${d})|\\.)?|(${d}))[eE][+-]?(${u})\\b`},{begin:`\\b(${p})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},g={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},v={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,g],subLanguage:"xml"}},x={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,g],subLanguage:"css"}},_={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,g],subLanguage:"graphql"}},b={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,g]},A={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},O=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,v,x,_,b,{match:/\$\d+/},f];g.contains=O.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(O)});const C=[].concat(A,g.contains),E=C.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(C)}]),T={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:E},P={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,e.concat(n,"(",e.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},R={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...XN,...YN]}},I={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},Y={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[T],illegal:/%/},W={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function B(F){return e.concat("(?!",F.join("|"),")")}const X={match:e.concat(/\b/,B([...JN,"super","import"].map(F=>`${F}\\s*\\(`)),n,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},K={begin:e.concat(/\./,e.lookahead(e.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},U={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},T]},G="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",J={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(G)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[T]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:E,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),I,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,v,x,_,b,A,{match:/\$\d+/},f,R,{scope:"attr",match:n+e.lookahead(":"),relevance:0},J,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[A,t.REGEXP_MODE,{className:"function",begin:G,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:E}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},Y,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[T,t.inherit(t.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},K,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[T]},X,W,P,U,{match:/\$[(.]/}]}}function dq(t){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},n=["true","false","null"],i={scope:"literal",beginKeywords:n.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:n},contains:[e,r,t.QUOTE_STRING_MODE,i,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function QN(t){const e=t.regex,r=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),n=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:n,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},u={className:"meta",begin:/^(>>>|\.\.\.) /},d={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},p={begin:/\{\{/,relevance:0},f={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,u,p,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,u,p,d]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,p,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,p,d]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},g="[0-9](_?[0-9])*",v=`(\\b(${g}))?\\.(${g})|\\b(${g})\\.`,x=`\\b|${n.join("|")}`,_={className:"number",relevance:0,variants:[{begin:`(\\b(${g})|(${v}))[eE][+-]?(${g})[jJ]?(?=${x})`},{begin:`(${v})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${x})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${x})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${x})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${x})`},{begin:`\\b(${g})[jJ](?=${x})`}]},b={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},k={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",u,_,f,t.HASH_COMMENT_MODE]}]};return d.contains=[f,_,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[u,_,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,b,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[k]},{variants:[{match:[/\bclass/,/\s+/,r,/\s*/,/\(\s*/,r,/\s*\)/]},{match:[/\bclass/,/\s+/,r]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[_,k,f]}]}}function fq(t){const e=t.regex,r=/(r#)?/,n=e.concat(r,t.UNDERSCORE_IDENT_RE),i=e.concat(r,t.IDENT_RE),a={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,e.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",l=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],u=["true","false","Some","None","Ok","Err"],d=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],p=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:p,keyword:l,literal:u,built_in:d},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+o},{begin:"\\b0o([0-7_]+)"+o},{begin:"\\b0x([A-Fa-f0-9_]+)"+o},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+o}],relevance:0},{begin:[/fn/,/\s+/,n],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,n],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,n,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:d,type:p}},{className:"punctuation",begin:"->"},a]}}function Vw(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}const qf="[A-Za-z$_][0-9A-Za-z$_]*",eR=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],tR=["true","false","null","undefined","NaN","Infinity"],rR=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],nR=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],iR=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],aR=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],oR=[].concat(iR,rR,nR);function hq(t){const e=t.regex,r=(F,{after:te})=>{const q="</"+F[0].slice(1);return F.input.indexOf(q,te)!==-1},n=qf,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(F,te)=>{const q=F[0].length+F.index,z=F.input[q];if(z==="<"||z===","){te.ignoreMatch();return}z===">"&&(r(F,{after:q})||te.ignoreMatch());let L;const Z=F.input.substring(q);if(L=Z.match(/^\s*=/)){te.ignoreMatch();return}if((L=Z.match(/^\s+extends\s+/))&&L.index===0){te.ignoreMatch();return}}},l={$pattern:qf,keyword:eR,literal:tR,built_in:oR,"variable.language":aR},u="[0-9](_?[0-9])*",d=`\\.(${u})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${p})((${d})|\\.)?|(${d}))[eE][+-]?(${u})\\b`},{begin:`\\b(${p})\\b((${d})\\b|\\.)?|(${d})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},g={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},v={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,g],subLanguage:"xml"}},x={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,g],subLanguage:"css"}},_={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,g],subLanguage:"graphql"}},b={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,g]},A={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},O=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,v,x,_,b,{match:/\$\d+/},f];g.contains=O.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(O)});const C=[].concat(A,g.contains),E=C.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(C)}]),T={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:E},P={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,e.concat(n,"(",e.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},R={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...rR,...nR]}},I={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},Y={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[T],illegal:/%/},W={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function B(F){return e.concat("(?!",F.join("|"),")")}const X={match:e.concat(/\b/,B([...iR,"super","import"].map(F=>`${F}\\s*\\(`)),n,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},K={begin:e.concat(/\./,e.lookahead(e.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},U={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},T]},G="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",J={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(G)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[T]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:E,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),I,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,v,x,_,b,A,{match:/\$\d+/},f,R,{scope:"attr",match:n+e.lookahead(":"),relevance:0},J,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[A,t.REGEXP_MODE,{className:"function",begin:G,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:E}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},Y,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[T,t.inherit(t.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},K,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[T]},X,W,P,U,{match:/\$[(.]/}]}}function sR(t){const e=t.regex,r=hq(t),n=qf,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[r.exports.CLASS_REFERENCE]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},u=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],d={$pattern:qf,keyword:eR.concat(u),literal:tR,built_in:oR.concat(i),"variable.language":aR},p={className:"meta",begin:"@"+n},f=(_,b,k)=>{const A=_.contains.findIndex(O=>O.label===b);if(A===-1)throw new Error("can not find mode to replace");_.contains.splice(A,1,k)};Object.assign(r.keywords,d),r.exports.PARAMS_CONTAINS.push(p);const g=r.contains.find(_=>_.scope==="attr"),v=Object.assign({},g,{match:e.concat(n,e.lookahead(/\s*\?:/))});r.exports.PARAMS_CONTAINS.push([r.exports.CLASS_REFERENCE,g,v]),r.contains=r.contains.concat([p,a,o,v]),f(r,"shebang",t.SHEBANG()),f(r,"use_strict",l);const x=r.contains.find(_=>_.label==="func.def");return x.relevance=0,Object.assign(r,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),r}function lR(t){const e=t.regex,r=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),n=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=t.inherit(a,{begin:/\(/,end:/\)/}),l=t.inherit(t.APOS_STRING_MODE,{className:"string"}),u=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),d={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:n,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,u,l,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[a,o,u,l]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[u]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[d],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[d],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(r,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:r,relevance:0,starts:d}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(r,/>/))),contains:[{className:"name",begin:r,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function cR(t){const e="true false yes no null",r="[\\w#;/?:@&=+$,.~*'()[\\]]+",n={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,i]},l=t.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),g={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},v={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},x={begin:/\{/,end:/\}/,contains:[v],illegal:"\\n",relevance:0},_={begin:"\\[",end:"\\]",contains:[v],illegal:"\\n",relevance:0},b=[n,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+r},{className:"type",begin:"!<"+r+">"},{className:"type",begin:"!"+r},{className:"type",begin:"!!"+r},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},g,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},x,_,a,o],k=[...b];return k.pop(),k.push(l),v.contains=k,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:b}}Qt.registerLanguage("javascript",ZN);Qt.registerLanguage("js",ZN);Qt.registerLanguage("typescript",sR);Qt.registerLanguage("ts",sR);Qt.registerLanguage("python",QN);Qt.registerLanguage("py",QN);Qt.registerLanguage("rust",fq);Qt.registerLanguage("go",oq);Qt.registerLanguage("json",dq);Qt.registerLanguage("yaml",cR);Qt.registerLanguage("yml",cR);Qt.registerLanguage("shell",Vw);Qt.registerLanguage("bash",Vw);Qt.registerLanguage("sh",Vw);Qt.registerLanguage("html",lR);Qt.registerLanguage("xml",lR);Qt.registerLanguage("css",aq);nt.use({renderer:{heading({tokens:t,depth:e}){const r=t.map(a=>a.raw).join(""),n=`h${e}`;return`<${n} style="font-size:${{1:"2rem",2:"1.625rem",3:"1.375rem",4:"1.125rem"}[e]??"1rem"};font-weight:500;color:#e4e4e7;margin:1.1em 0 0.4em;line-height:1.5;">${r}</${n}>`},code({text:t,lang:e}){let r;return e&&Qt.getLanguage(e)?r=Qt.highlight(t,{language:e}).value:r=Qt.highlightAuto(t).value,`<pre style="background:#161616;border:1px solid rgba(255,255,255,0.07);border-radius:10px;padding:0.9em 1.1em;overflow-x:auto;margin:0.8em 0;"><code class="hljs" style="background:none;border:none;padding:0;color:#d4d4d8;font-size:0.85em;">${r}</code></pre>`}}});function uR({content:t,className:e=""}){const r=N.useMemo(()=>nt.parse(t),[t]);return y.jsx("div",{className:`prose-io ${e}`,style:{color:"#d4d4d8",fontSize:"0.875rem",lineHeight:"1.7"},dangerouslySetInnerHTML:{__html:r}})}const pq={orchestrator:"#71717a",io:"#71717a"};function TE({name:t}){const e=pq[t.toLowerCase()]??"#a78bfa";return y.jsx("span",{className:"inline-flex items-center px-1.5 py-px rounded text-[10px] font-mono border",style:{background:`${e}15`,color:e,borderColor:`${e}30`},children:t})}function mq(){const[t,e]=N.useState([]),[r,n]=N.useState(null),[i,a]=N.useState(new Set),[o,l]=N.useState("all"),u=ml();N.useEffect(()=>{et.get("/inbox").then(O=>e(O.entries)).catch(()=>{})},[]);const d=t.filter(O=>O.status==="unread").length,p=o==="unread"?t.filter(O=>O.status==="unread"):t,f=p.length>0&&p.every(O=>i.has(O.id)),g=i.size>0;function v(O){g||(n(O),O.status==="unread"&&(et.post(`/inbox/${O.id}/read`).catch(()=>{}),e(C=>C.map(E=>E.id===O.id?{...E,status:"read"}:E))))}function x(O,C){O.stopPropagation(),a(E=>{const T=new Set(E);return T.has(C)?T.delete(C):T.add(C),T})}function _(){a(f?new Set:new Set(p.map(O=>O.id)))}function b(){const O=Array.from(i);et.post("/inbox/bulk/read",{ids:O}).catch(()=>{}),e(C=>C.map(E=>i.has(E.id)?{...E,status:"read"}:E)),a(new Set)}function k(){const O=Array.from(i);et.post("/inbox/bulk/delete",{ids:O}).catch(()=>{}),e(C=>C.filter(E=>!i.has(E.id))),r&&i.has(r.id)&&n(null),a(new Set)}function A(O){et.delete(`/inbox/${O}`).catch(()=>{}),e(C=>C.filter(E=>E.id!==O)),(r==null?void 0:r.id)===O&&n(null)}return y.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[y.jsxs("div",{className:"w-72 flex-shrink-0 border-r border-white/[0.06] flex flex-col overflow-hidden",children:[y.jsxs("div",{className:"px-4 py-3 border-b border-white/[0.06] flex-shrink-0 space-y-2",children:[y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsx("span",{className:"text-lg tracking-wide text-zinc-200",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Inbox"}),d>0&&y.jsxs(Vt,{variant:"default",children:[d," unread"]})]}),y.jsx("div",{className:"flex gap-1",children:["all","unread"].map(O=>y.jsx("button",{type:"button",onClick:()=>{l(O),a(new Set)},className:`flex-1 py-1 text-[11px] font-mono rounded-lg transition-colors cursor-pointer ${o===O?"text-[#E43A9C]":"text-zinc-600 hover:text-zinc-300"}`,style:o===O?{background:"rgba(228,58,156,0.12)"}:void 0,children:O},O))})]}),g&&y.jsxs("div",{className:"px-3 py-2 border-b border-white/[0.06] flex items-center gap-1.5 flex-shrink-0",style:{background:"rgba(228,58,156,0.06)"},children:[y.jsxs("span",{className:"text-[10px] font-mono text-zinc-500 flex-1",children:[i.size," selected"]}),y.jsxs("button",{type:"button",onClick:b,className:"flex items-center gap-1 px-2 py-1 rounded-lg text-[10px] font-mono text-zinc-400 hover:text-zinc-200 hover:bg-white/[0.06] transition-colors cursor-pointer",children:[y.jsx(Ib,{className:"w-3 h-3"}),"Mark read"]}),y.jsxs("button",{type:"button",onClick:k,className:"flex items-center gap-1 px-2 py-1 rounded-lg text-[10px] font-mono text-red-400 hover:text-red-300 hover:bg-red-500/10 transition-colors cursor-pointer",children:[y.jsx(Ms,{className:"w-3 h-3"}),"Delete"]})]}),p.length>0&&y.jsxs("div",{className:"px-4 py-1.5 border-b border-white/[0.04] flex items-center gap-2 flex-shrink-0",children:[y.jsx("button",{type:"button",onClick:_,className:`w-3.5 h-3.5 rounded border flex items-center justify-center flex-shrink-0 transition-colors cursor-pointer ${f?"border-[#E43A9C] bg-[#E43A9C]":"border-white/20 hover:border-white/40"}`,children:f&&y.jsx("svg",{className:"w-2 h-2 text-white",fill:"none",viewBox:"0 0 8 8",children:y.jsx("path",{d:"M1 4l2 2 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),y.jsx("span",{className:"text-[10px] font-mono text-zinc-700",children:"Select all"})]}),y.jsxs("div",{className:"flex-1 overflow-y-auto",children:[p.map(O=>{const C=i.has(O.id),E=(r==null?void 0:r.id)===O.id&&!g;return y.jsxs("div",{onClick:()=>v(O),onKeyDown:T=>T.key==="Enter"&&v(O),className:`flex items-start gap-2.5 px-3 py-3 border-b border-white/[0.04] cursor-pointer transition-colors ${E?"border-l-2 border-l-[#E43A9C] pl-2.5":"hover:bg-white/[0.025]"} ${C?"bg-[#E43A9C]/5":""}`,style:E?{background:"rgba(228,58,156,0.05)"}:void 0,children:[y.jsx("button",{type:"button",onClick:T=>x(T,O.id),className:`mt-0.5 w-3.5 h-3.5 rounded border flex items-center justify-center flex-shrink-0 transition-colors cursor-pointer ${C?"border-[#E43A9C] bg-[#E43A9C]":"border-white/20 hover:border-white/50"}`,children:C&&y.jsx("svg",{className:"w-2 h-2 text-white",fill:"none",viewBox:"0 0 8 8",children:y.jsx("path",{d:"M1 4l2 2 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),y.jsxs("div",{className:"flex-1 min-w-0",children:[y.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[O.status==="unread"&&y.jsx("div",{className:"w-1 h-1 rounded-full bg-[#E43A9C] flex-shrink-0"}),y.jsx(TE,{name:O.squadName??(O.squadId?O.squadId.slice(0,8):"Orchestrator")})]}),y.jsx("p",{className:`text-[11px] truncate ${O.status==="unread"?"text-zinc-200":"text-zinc-500"}`,children:O.title}),y.jsx("p",{className:"text-[10px] text-zinc-700 font-mono mt-1",children:Db(O.createdAt,u)})]})]},O.id)}),p.length===0&&y.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[y.jsx($b,{size:32,className:"text-zinc-800 mb-2"}),y.jsx("p",{className:"text-[11px] font-mono text-zinc-700",children:o==="unread"?"All caught up":"No items yet"})]})]})]}),y.jsx("div",{className:"flex-1 flex flex-col overflow-hidden",children:r&&!g?y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"px-6 py-4 border-b border-white/[0.06] flex items-start justify-between flex-shrink-0",children:[y.jsxs("div",{className:"flex-1 min-w-0 mr-4",children:[y.jsx(TE,{name:r.squadName??(r.squadId?r.squadId.slice(0,8):"Orchestrator")}),y.jsx("h3",{className:"text-sm font-mono text-zinc-100 mt-1.5",children:r.title}),y.jsx("p",{className:"text-[11px] text-zinc-700 font-mono mt-0.5",children:Db(r.createdAt,u)})]}),y.jsxs("button",{type:"button",onClick:()=>A(r.id),className:"flex items-center gap-1.5 px-2.5 py-1 rounded-lg font-mono text-[11px] text-zinc-400 bg-[#252525] hover:bg-red-500/10 hover:text-red-400 transition-colors cursor-pointer",children:[y.jsx(Ms,{className:"w-3 h-3"}),"Delete"]})]}),y.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-5",children:y.jsx(uR,{content:r.content})})]}):g?y.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4 text-center px-8",children:[y.jsx("div",{className:"w-10 h-10 rounded-2xl flex items-center justify-center border border-[#E43A9C]/20",style:{background:"rgba(228,58,156,0.08)"},children:y.jsx($b,{className:"w-4 h-4 text-[#E43A9C]"})}),y.jsxs("div",{children:[y.jsxs("p",{className:"text-sm font-mono text-zinc-300",children:[i.size," message",i.size!==1?"s":""," selected"]}),y.jsx("p",{className:"text-[11px] text-zinc-600 mt-1",children:"Use the actions above to mark as read or delete"})]}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsxs("button",{type:"button",onClick:b,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-[11px] font-mono text-zinc-300 border border-white/[0.1] hover:bg-white/[0.05] transition-colors cursor-pointer",children:[y.jsx(Ib,{className:"w-3 h-3"}),"Mark read"]}),y.jsxs("button",{type:"button",onClick:k,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-[11px] font-mono text-red-400 border border-red-500/20 hover:bg-red-500/10 transition-colors cursor-pointer",children:[y.jsx(Ms,{className:"w-3 h-3"}),"Delete selected"]})]})]}):y.jsx("div",{className:"flex-1 flex items-center justify-center text-zinc-700 font-mono text-xs",children:"Select an item to read"})})]})}function gq(){const{signIn:t}=rp(),[e,r]=N.useState(""),[n,i]=N.useState(""),[a,o]=N.useState(null),[l,u]=N.useState(!1);async function d(p){p.preventDefault(),o(null),u(!0);const{error:f}=await t(e,n);f&&o(f),u(!1)}return y.jsxs("div",{className:"min-h-screen bg-[#161616] flex items-center justify-center relative overflow-hidden",children:[y.jsx("div",{className:"absolute inset-0 opacity-[0.04]",style:{backgroundImage:"radial-gradient(circle, #E43A9C 1px, transparent 1px)",backgroundSize:"32px 32px"}}),y.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-[60%] w-[400px] h-[300px] rounded-full blur-3xl pointer-events-none",style:{background:"radial-gradient(ellipse, rgba(228,58,156,0.12) 0%, transparent 70%)"}}),y.jsxs("div",{className:"relative z-10 w-full max-w-[360px] mx-4",children:[y.jsxs("div",{className:"flex flex-col items-center mb-8 gap-3",children:[y.jsx(Ra,{height:52}),y.jsx("div",{className:"text-center",children:y.jsx("p",{className:"text-[11px] font-mono text-zinc-600 tracking-widest uppercase mt-1",children:"personal ai orchestrator"})})]}),y.jsxs("form",{onSubmit:d,className:"glass-card border border-white/[0.07] rounded-2xl p-6 space-y-4",children:[y.jsxs("div",{className:"space-y-1",children:[y.jsx("label",{className:"text-[11px] font-mono text-zinc-500 block",children:"Email"}),y.jsx("input",{type:"email",value:e,onChange:p=>r(p.target.value),required:!0,className:"w-full bg-[#161616] border border-white/[0.08] rounded-xl px-3 py-2.5 text-sm text-zinc-200 font-mono placeholder:text-zinc-700 focus:outline-none focus:border-[#E43A9C]/40 focus:ring-1 focus:ring-[#E43A9C]/15 transition-colors"})]}),y.jsxs("div",{className:"space-y-1",children:[y.jsx("label",{className:"text-[11px] font-mono text-zinc-500 block",children:"Password"}),y.jsx("input",{type:"password",value:n,onChange:p=>i(p.target.value),required:!0,placeholder:"••••••••",className:"w-full bg-[#161616] border border-white/[0.08] rounded-xl px-3 py-2.5 text-sm text-zinc-200 font-mono placeholder:text-zinc-700 focus:outline-none focus:border-[#E43A9C]/40 focus:ring-1 focus:ring-[#E43A9C]/15 transition-colors"})]}),a&&y.jsx("p",{className:"text-[11px] font-mono text-red-400",children:a}),y.jsx("button",{type:"submit",disabled:l,className:"w-full text-white font-mono text-sm rounded-xl py-3 mt-1 transition-opacity hover:opacity-90 disabled:opacity-50 flex items-center justify-center gap-2",style:{background:"linear-gradient(135deg, #D83333 0%, #E43A9C 55%, #F041FF 100%)"},children:l?y.jsxs(y.Fragment,{children:[y.jsx("span",{className:"w-3.5 h-3.5 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Authenticating…"]}):"Sign In"})]}),y.jsx("p",{className:"text-center text-[11px] text-zinc-700 font-mono mt-4",children:"Secured by Supabase Auth"})]})]})}const dR="w-full bg-[#161616] border border-white/[0.08] rounded-xl px-3 py-2 text-[11px] text-zinc-300 font-mono placeholder:text-zinc-700 focus:outline-none focus:border-[#E43A9C]/40 focus:ring-1 focus:ring-[#E43A9C]/10 transition-colors",Ds="bg-[#161616] border border-white/[0.08] rounded-xl px-3 py-2 text-[11px] text-zinc-300 font-mono placeholder:text-zinc-700 focus:outline-none focus:border-[#E43A9C]/40 focus:ring-1 focus:ring-[#E43A9C]/10 transition-colors";function Ui({label:t,hint:e,align:r="center",children:n}){const i=r==="start"?"flex-1 min-w-0":"flex-1 flex justify-end items-center";return y.jsxs("div",{className:`glass-card border border-white/[0.07] rounded-2xl px-4 py-3.5 flex gap-4 ${r==="start"?"items-start":"items-center"}`,children:[y.jsxs("div",{className:"w-[140px] shrink-0",children:[y.jsx("span",{className:"text-[11px] font-mono text-zinc-400",children:t}),e&&y.jsxs("span",{className:"text-[10px] font-mono text-zinc-700 ml-1.5",children:["(",e,")"]})]}),y.jsx("div",{className:i,children:n})]})}function yq({onSave:t,onCancel:e,squads:r}){var x;const[n,i]=N.useState("io"),[a,o]=N.useState(((x=r[0])==null?void 0:x.id)??""),[l,u]=N.useState(""),[d,p]=N.useState(""),[f,g]=N.useState(""),v=()=>{!d.trim()||!f.trim()||!l.trim()||t({name:l.trim(),targetType:n==="io"?"orchestrator":"squad",targetId:n==="squad"?a:void 0,cron:d.trim(),prompt:f.trim()})};return y.jsx("div",{className:"fixed inset-0 z-40 flex items-center justify-center p-6",style:{background:"rgba(0,0,0,0.55)",backdropFilter:"blur(4px)"},children:y.jsxs("div",{className:"glass-card border border-white/[0.09] rounded-2xl w-full max-w-lg shadow-2xl flex flex-col",style:{maxHeight:"90vh"},children:[y.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-white/[0.06] flex-shrink-0",children:[y.jsx("h3",{className:"text-lg tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"New Schedule"}),y.jsx("button",{type:"button",onClick:e,className:"p-1.5 rounded-lg text-zinc-600 hover:text-zinc-300 hover:bg-white/[0.06] transition-colors cursor-pointer",children:y.jsx(YP,{className:"w-4 h-4"})})]}),y.jsxs("div",{className:"overflow-y-auto flex-1 px-5 py-4 space-y-2",children:[y.jsx(Ui,{label:"Name",children:y.jsx("input",{value:l,onChange:_=>u(_.target.value),placeholder:"Daily triage",className:`${Ds} w-48`})}),y.jsx(Ui,{label:"Type",children:y.jsx("div",{className:"flex gap-2",children:["io","squad"].map(_=>y.jsx("button",{type:"button",onClick:()=>i(_),className:`px-4 py-1.5 rounded-xl text-[11px] font-mono capitalize transition-colors border cursor-pointer ${n===_?"text-[#E43A9C] border-[#E43A9C]/30":"text-zinc-500 border-white/[0.08] hover:text-zinc-300 hover:bg-white/[0.04]"}`,style:n===_?{background:"rgba(228,58,156,0.08)"}:void 0,children:_==="io"?"IO":"Squad"},_))})}),n==="squad"&&y.jsx(Ui,{label:"Squad",children:y.jsx("select",{value:a,onChange:_=>o(_.target.value),className:`${Ds} w-48`,children:r.map(_=>y.jsx("option",{value:_.id,style:{background:"#1a1a1a",color:"#d4d4d8"},children:_.name},_.id))})}),y.jsx(Ui,{label:"Cron Expression",children:y.jsx("input",{value:d,onChange:_=>p(_.target.value),placeholder:"0 9 * * 1-5",className:`${Ds} w-40`})}),y.jsx(Ui,{label:"Prompt",hint:"supports Markdown",align:"start",children:y.jsx("textarea",{value:f,onChange:_=>g(_.target.value),placeholder:"Describe what IO or the squad should do when this schedule fires.",rows:8,className:`${dR} resize-none leading-relaxed`})})]}),y.jsxs("div",{className:"flex items-center justify-end gap-2 px-5 py-3.5 border-t border-white/[0.06] flex-shrink-0",children:[y.jsx(Wi,{onClick:e,children:"Cancel"}),y.jsxs(Da,{onClick:v,className:"px-4 py-1.5",children:[y.jsx(Nw,{className:"w-3 h-3"}),"Create Schedule"]})]})]})})}function vq({sched:t,squads:e,onSave:r,onBack:n}){var x,_;const[i,a]=N.useState(t.name),[o,l]=N.useState(t.cron),[u,d]=N.useState(t.prompt),[p,f]=N.useState(t.targetId??((x=e[0])==null?void 0:x.id)??""),g=()=>{!o.trim()||!u.trim()||!i.trim()||r({name:i.trim(),cron:o.trim(),prompt:u.trim(),targetId:t.targetType==="squad"?p:void 0})},v=t.targetType==="orchestrator"?"IO Schedule":`Squad — ${((_=e.find(b=>b.id===t.targetId))==null?void 0:_.name)??"Unknown"}`;return y.jsxs("div",{className:"flex-1 overflow-y-auto p-6 max-w-3xl",children:[y.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[y.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1.5 text-[11px] font-mono text-zinc-600 hover:text-zinc-300 transition-colors cursor-pointer",children:[y.jsx(Cu,{className:"w-3.5 h-3.5"}),"Schedules"]}),y.jsx("span",{className:"text-zinc-700 text-[11px]",children:"/"}),y.jsx("span",{className:"text-[11px] font-mono text-zinc-400",children:"Edit"})]}),y.jsxs("div",{className:"flex items-start justify-between mb-6",children:[y.jsxs("div",{children:[y.jsx("h2",{className:"text-2xl tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Edit Schedule"}),y.jsx("p",{className:"text-[11px] font-mono text-zinc-600 mt-0.5",children:v})]}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx(Wi,{onClick:n,children:"Cancel"}),y.jsxs(Da,{onClick:g,className:"px-4 py-1.5",children:[y.jsx(Nw,{className:"w-3 h-3"}),"Save Changes"]})]})]}),y.jsxs("div",{className:"space-y-3",children:[y.jsx(Ui,{label:"Name",children:y.jsx("input",{value:i,onChange:b=>a(b.target.value),placeholder:"Schedule name",className:`${Ds} w-48`})}),t.targetType==="squad"&&y.jsx(Ui,{label:"Squad",children:y.jsx("select",{value:p,onChange:b=>f(b.target.value),className:`${Ds} w-48`,children:e.map(b=>y.jsx("option",{value:b.id,style:{background:"#1a1a1a",color:"#d4d4d8"},children:b.name},b.id))})}),y.jsx(Ui,{label:"Cron Expression",children:y.jsx("input",{value:o,onChange:b=>l(b.target.value),placeholder:"0 9 * * 1-5",className:`${Ds} w-40`})}),y.jsx(Ui,{label:"Prompt",hint:"supports Markdown",align:"start",children:y.jsxs("div",{className:"space-y-1.5",children:[y.jsx("textarea",{value:u,onChange:b=>d(b.target.value),placeholder:"Describe what IO or the squad should do when this schedule fires.",className:`${dR} leading-relaxed resize-y`,style:{minHeight:"360px"}}),y.jsx("p",{className:"text-[10px] font-mono text-zinc-700",children:"Tip: use # headings and - lists to structure multi-step instructions."})]})})]})]})}function bq(){const[t,e]=N.useState("squad"),[r,n]=N.useState([]),[i,a]=N.useState([]),[o,l]=N.useState(!1),[u,d]=N.useState(null),p=ml();N.useEffect(()=>{f(),g()},[]);function f(){et.get("/schedules").then(R=>n(R.schedules)).catch(()=>{})}function g(){et.get("/squads").then(R=>a(R.squads)).catch(()=>{})}const v=r.filter(R=>R.targetType==="squad"),x=r.filter(R=>R.targetType==="orchestrator"),_=t==="squad"?v:x;async function b(R){try{await et.post("/schedules",R),ft.success("Schedule created"),l(!1),f()}catch(I){ft.error(I instanceof Error?I.message:"Failed to create")}}async function k(R){if(u)try{await et.patch(`/schedules/${u.id}`,R),ft.success("Schedule saved"),d(null),f()}catch{ft.error("Failed to save schedule")}}const[A,O]=N.useState(null);async function C(R,I){O(R);try{await et.patch(`/schedules/${R}`,{enabled:!I}),ft.success(I?"Schedule paused":"Schedule resumed"),f()}catch{ft.error("Failed to toggle schedule")}finally{O(null)}}async function E(R){O(R);try{await et.post(`/schedules/${R}/run`,{}),ft.success("Schedule triggered")}catch{ft.error("Failed to trigger schedule")}finally{O(null)}}async function T(R){O(R);try{await et.delete(`/schedules/${R}`),ft.success("Schedule deleted"),f()}catch{ft.error("Failed to delete")}finally{O(null)}}if(u)return y.jsx(vq,{sched:u,squads:i,onSave:k,onBack:()=>d(null)});const P=t==="squad"?["Squad","Name","Cron","Next Run","Status",""]:["Name","Cron","Next Run","Status",""];return y.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[o&&y.jsx(yq,{onSave:b,onCancel:()=>l(!1),squads:i}),y.jsxs("div",{className:"flex items-center justify-between mb-5",children:[y.jsxs("div",{children:[y.jsx("h2",{className:"text-2xl tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Schedules"}),y.jsxs("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:[r.filter(R=>R.enabled).length," active · ",r.filter(R=>!R.enabled).length," paused"]})]}),y.jsxs(Da,{onClick:()=>l(!0),className:"px-3 py-1.5",children:[y.jsx(KP,{className:"w-3.5 h-3.5"}),"Add Schedule"]})]}),y.jsx("div",{className:"flex gap-1 mb-4",children:[["squad","Squad Schedules"],["io","IO Schedules"]].map(([R,I])=>y.jsx("button",{type:"button",onClick:()=>e(R),className:`px-4 py-2 text-[11px] font-mono rounded-xl transition-colors cursor-pointer ${t===R?"text-[#E43A9C]":"text-zinc-600 hover:text-zinc-300 hover:bg-white/[0.04]"}`,style:t===R?{background:"rgba(228,58,156,0.12)"}:void 0,children:I},R))}),y.jsx("div",{className:"overflow-x-auto rounded-2xl border border-white/[0.07] glass-card",children:_.length===0?y.jsx("div",{className:"px-4 py-12 text-center text-zinc-600 font-mono text-sm",children:"No schedules for this category"}):y.jsxs("table",{className:"w-full text-[11px] font-mono min-w-[640px]",children:[y.jsx("thead",{children:y.jsx("tr",{className:"border-b border-white/[0.06]",style:{background:"rgba(20,20,20,0.6)"},children:P.map(R=>y.jsx("th",{className:"text-left px-4 py-2.5 text-zinc-600 font-medium",children:R},R))})}),y.jsx("tbody",{children:_.map(R=>{var I;return y.jsxs("tr",{className:`border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors ${R.enabled?"":"opacity-50"}`,children:[t==="squad"?y.jsx("td",{className:"px-4 py-3",children:y.jsx(qB,{name:((I=i.find(Y=>Y.id===R.targetId))==null?void 0:I.name)??"Unknown"})}):null,y.jsx("td",{className:"px-4 py-3 text-zinc-300",children:R.name}),y.jsx("td",{className:"px-4 py-3 text-zinc-600 text-[10px]",children:R.cron}),y.jsx("td",{className:"px-4 py-3 text-zinc-600",children:y.jsxs("span",{className:"flex items-center gap-1",children:[y.jsx(W5,{className:"w-3 h-3"}),R.enabled&&R.nextRun?Db(R.nextRun,p):"—"]})}),y.jsx("td",{className:"px-4 py-3",children:y.jsx(Vt,{variant:R.enabled?"success":"muted",children:R.enabled?"active":"paused"})}),y.jsx("td",{className:"px-4 py-3",children:y.jsxs("div",{className:`flex items-center gap-1 ${A===R.id?"opacity-50 pointer-events-none":""}`,children:[y.jsxs(Wi,{onClick:()=>E(R.id),children:[y.jsx(T4,{className:"w-3 h-3"}),"Run now"]}),y.jsx(FB,{onClick:()=>C(R.id,R.enabled),children:R.enabled?y.jsxs(y.Fragment,{children:[y.jsx(S4,{className:"w-3 h-3"}),"Pause"]}):y.jsxs(y.Fragment,{children:[y.jsx(Kh,{className:"w-3 h-3"}),"Resume"]})}),y.jsxs(Wi,{onClick:()=>d(R),children:[y.jsx(E4,{className:"w-3 h-3"}),"Edit"]}),y.jsxs(Ww,{onClick:()=>T(R.id),children:[y.jsx(Ms,{className:"w-3 h-3"}),"Delete"]})]})})]},R.id)})})]})})]})}const xq=[{id:"general",label:"General"},{id:"telegram",label:"Telegram"},{id:"auth",label:"Auth"}],zo="rounded-xl border border-white/[0.07] bg-white/[0.04] px-3 py-2 text-sm font-mono text-zinc-300 outline-none focus:border-[#E43A9C]/50",CE=`${zo} w-[72px]`,wq=`${zo} w-[100px]`,jE=`${zo} w-[200px]`,PE=`${zo} w-[320px]`,_q=`${zo} w-[140px] appearance-none bg-[url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2012%2012%22%3E%3Cpath%20fill%3D%22%2371717a%22%20d%3D%22M3%204.5L6%208l3-3.5H3z%22%2F%3E%3C%2Fsvg%3E')] bg-[position:right_10px_center] bg-no-repeat pr-8`;function Sq(){const[t,e]=N.useState(null),[r,n]=N.useState("general");N.useEffect(()=>{et.get("/config").then(o=>e(o.config)).catch(()=>{})},[]);function i(o){t&&e({...t,...o})}async function a(){if(t)try{const{dataDir:o,...l}=t;await et.patch("/config",l),ft.success("Settings saved")}catch{ft.error("Failed to save settings")}}return t?y.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:y.jsxs("div",{className:"max-w-3xl",children:[y.jsx("h2",{className:"mb-6 text-2xl tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Settings"}),y.jsx("div",{className:"mb-6 flex gap-6 border-b border-white/[0.07]",children:xq.map(o=>y.jsx("button",{type:"button",onClick:()=>n(o.id),className:`-mb-px border-b-2 px-1 pb-3 text-[11px] font-mono transition-colors ${r===o.id?"border-[#E43A9C] text-[#E43A9C]":"border-transparent text-zinc-500 hover:text-zinc-300"}`,children:o.label},o.id))}),y.jsxs("div",{className:"glass-card rounded-2xl border border-white/[0.07] p-5",children:[r==="general"&&y.jsxs(y.Fragment,{children:[y.jsx(_n,{label:"Log Level",children:y.jsx("select",{value:t.logLevel,onChange:o=>i({logLevel:o.target.value}),className:_q,children:["trace","debug","info","warn","error","fatal"].map(o=>y.jsx("option",{value:o,children:o},o))})}),y.jsx(_n,{label:"Default Model",children:y.jsx("input",{type:"text",value:t.defaultModel,onChange:o=>i({defaultModel:o.target.value}),className:jE})}),y.jsx(_n,{label:"Timezone",children:y.jsx("select",{value:t.timezone,onChange:o=>i({timezone:o.target.value}),className:`${zo} w-[200px] appearance-none bg-[url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2012%2012%22%3E%3Cpath%20fill%3D%22%2371717a%22%20d%3D%22M3%204.5L6%208l3-3.5H3z%22%2F%3E%3C%2Fsvg%3E')] bg-[position:right_10px_center] bg-no-repeat pr-8`,children:J4.map(o=>y.jsx("option",{value:o.value,children:o.label},o.value))})}),y.jsx(_n,{label:"Max Instances",children:y.jsx("input",{type:"number",value:t.maxInstancesPerSquad,onChange:o=>i({maxInstancesPerSquad:Number(o.target.value)}),className:CE,min:1,max:10})}),y.jsx(_n,{label:"API Port",children:y.jsx("input",{type:"number",value:t.apiPort,onChange:o=>i({apiPort:Number(o.target.value)}),className:CE})}),y.jsx(_n,{label:"Pricing Refresh (hrs)",children:y.jsx("input",{type:"number",value:t.pricing.refreshIntervalHours,onChange:o=>i({pricing:{refreshIntervalHours:Number(o.target.value)}}),className:wq,min:1})}),y.jsx(_n,{label:"Data Dir",children:y.jsx("input",{type:"text",value:t.dataDir,readOnly:!0,className:`${PE} cursor-default text-zinc-500`})})]}),r==="telegram"&&y.jsxs(y.Fragment,{children:[y.jsx(_n,{label:"Bot Token",children:y.jsx(Cg,{value:t.telegram.botToken??"",onChange:o=>i({telegram:{...t.telegram,botToken:o||null}}),size:"lg"})}),y.jsx(_n,{label:"Allowed Chat IDs",children:y.jsx("input",{type:"text",value:t.telegram.allowedChatIds.join(", "),onChange:o=>i({telegram:{...t.telegram,allowedChatIds:o.target.value.split(",").map(l=>Number(l.trim())).filter(l=>!Number.isNaN(l))}}),className:jE})})]}),r==="auth"&&y.jsxs(y.Fragment,{children:[y.jsx(_n,{label:"Project URL",children:y.jsx("input",{type:"text",value:t.supabase.projectUrl??"",onChange:o=>i({supabase:{...t.supabase,projectUrl:o.target.value||null}}),className:PE})}),y.jsx(_n,{label:"Anon Key",children:y.jsx(Cg,{value:t.supabase.anonKey??"",onChange:o=>i({supabase:{...t.supabase,anonKey:o||null}}),size:"lg"})}),y.jsx(_n,{label:"JWT Secret",children:y.jsx(Cg,{value:t.supabase.jwtSecret??"",onChange:o=>i({supabase:{...t.supabase,jwtSecret:o||null}}),size:"lg"})})]}),y.jsx("div",{className:"flex justify-end pt-6",children:y.jsx(Da,{onClick:a,className:"px-4 py-2.5",children:"Save Settings"})})]})]})}):y.jsx("div",{className:"flex h-full items-center justify-center text-zinc-600",children:"Loading..."})}function _n({label:t,children:e}){return y.jsxs("div",{className:"flex items-center justify-between gap-6 border-b border-white/[0.07] py-3",children:[y.jsx("label",{className:"text-[11px] font-mono text-zinc-400 shrink-0",children:t}),y.jsx("div",{className:"flex justify-end",children:e})]})}function Cg({value:t,onChange:e,size:r="lg"}){const[n,i]=N.useState(!1),a=r==="lg"?"w-[320px]":"w-[200px]";return y.jsxs("div",{className:"relative",children:[y.jsx("input",{type:n?"text":"password",value:t,onChange:o=>e(o.target.value),className:`${zo} ${a} pr-9`}),y.jsx("button",{type:"button",onClick:()=>i(o=>!o),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-zinc-600 transition-colors hover:text-zinc-400","aria-label":n?"Hide value":"Show value",children:n?y.jsx(Q5,{size:14}):y.jsx(Ib,{size:14})})]})}const kq=[{id:"installed",label:"Installed"},{id:"awesome-copilot",label:"Awesome Copilot"},{id:"skillssh",label:"skills.sh"}];function NE(t){return t==="awesome-copilot"?"Awesome Copilot":"skills.sh"}function RE(t){return t?t>=1e6?`${(t/1e6).toFixed(1).replace(/\.0$/,"")}M installs`:t>=1e3?`${(t/1e3).toFixed(1).replace(/\.0$/,"")}K installs`:`${t} installs`:null}function Eq(t){const e=t.match(/^---\s*\n([\s\S]*?)\n---\s*\n([\s\S]*)$/);if(!e)return{frontMatter:{},body:t};const r=e[1]??"",n=e[2]??"",i={};let a="",o=null;for(const l of r.split(`
434
+ `)){const u=l.match(/^(\w[\w-]*)\s*:\s*(.*)$/);if(u){a&&o&&(i[a]=o,o=null),a=u[1]??"";const d=(u[2]??"").trim();d===""||d==="[]"?o=[]:d.startsWith("[")&&d.endsWith("]")?i[a]=d.slice(1,-1).split(",").map(p=>p.trim().replace(/^["']|["']$/g,"")):i[a]=d.replace(/^["']|["']$/g,"")}else l.match(/^\s+-\s+(.+)/)&&a&&(o||(o=[]),o.push(l.replace(/^\s+-\s+/,"").trim()))}return a&&o&&(i[a]=o),{frontMatter:i,body:n}}const IE=["name","description","version","author","license","argument_hint","argument-hint","use_when","use-when","enhancements","metadata","tags"];function Oq({content:t}){const{frontMatter:e,body:r}=Eq(t),n=IE.filter(o=>e[o]!==void 0),i=Object.keys(e).filter(o=>!IE.includes(o)),a=[...n,...i];return y.jsxs("div",{children:[a.length>0&&y.jsxs("div",{className:"border-b border-white/[0.05] pb-4 mb-4",children:[y.jsx("p",{className:"text-[10px] font-mono text-zinc-700 uppercase tracking-wider mb-3",children:"Front Matter"}),y.jsx("div",{className:"space-y-2",children:a.map(o=>{const l=e[o];return l==null||Array.isArray(l)&&l.length===0?null:y.jsxs("div",{className:"flex gap-3 items-start",children:[y.jsx("span",{className:"text-[10px] font-mono text-zinc-600 w-28 flex-shrink-0 pt-0.5",children:o}),y.jsx("div",{className:"flex-1 min-w-0",children:Array.isArray(l)?y.jsx("div",{className:"flex flex-wrap gap-1",children:l.map((u,d)=>y.jsx(Vt,{variant:"muted",children:u},d))}):typeof l=="object"?y.jsx("div",{className:"space-y-0.5",children:Object.entries(l).map(([u,d])=>y.jsxs("p",{className:"text-[11px] font-mono text-zinc-400",children:[y.jsxs("span",{className:"text-zinc-600",children:[u,":"]})," ",d]},u))}):o==="use_when"||o==="use-when"?y.jsx("p",{className:"text-[11px] text-zinc-300 leading-relaxed",children:l}):o==="argument_hint"||o==="argument-hint"?y.jsx("code",{className:"text-[11px] font-mono text-[#E43A9C] bg-[#2d1a24] px-1.5 py-0.5 rounded",children:l}):y.jsx("span",{className:"text-[11px] font-mono text-zinc-300",children:l})})]},o)})})]}),r.trim()&&y.jsxs("div",{children:[y.jsx("p",{className:"text-[10px] font-mono text-zinc-700 uppercase tracking-wider mb-3",children:"Body"}),y.jsx(uR,{content:r})]})]})}function Aq(){const[t,e]=N.useState("installed"),[r,n]=N.useState([]),[i,a]=N.useState([]),[o,l]=N.useState(null);function u(L){return"url"in L&&L.url?L.url:L.name}const[d,p]=N.useState(null),[f,g]=N.useState(""),[v,x]=N.useState(!1),[_,b]=N.useState(!1),[k,A]=N.useState(!1),[O,C]=N.useState(""),[E,T]=N.useState(null),[P,R]=N.useState(null),I=N.useCallback(async()=>{try{const L=await et.get("/skills"),Z=new Set(L.skills.map(se=>se.name.toLowerCase()));n(L.skills),a(se=>se.map(le=>({...le,installed:Z.has(le.name.toLowerCase())})))}catch(L){ft.error(L instanceof Error?L.message:"Failed to load skills")}},[]),Y=N.useCallback(async L=>{b(!0);try{const Z=await et.get(`/skills/${encodeURIComponent(L)}`);p(Z),C(Z.content)}catch(Z){ft.error(Z instanceof Error?Z.message:"Failed to load skill"),p(null)}finally{b(!1)}},[]);N.useEffect(()=>{I()},[I]),N.useEffect(()=>{if(t==="installed"){R(null);return}const L=f.trim();if(t==="skillssh"&&!L){a([]),R(null),x(!1);return}let Z=!1;x(!0);const se=window.setTimeout(async()=>{try{const le=await et.get(`/skills/discover?source=${t}&q=${encodeURIComponent(L)}`);if(Z)return;a(le.skills),R(null)}catch(le){if(Z)return;a([]),R(le instanceof Error?le.message:"Discovery failed")}finally{Z||x(!1)}},250);return()=>{Z=!0,window.clearTimeout(se)}},[f,t]);const W=N.useMemo(()=>{const L=f.trim().toLowerCase();return L?r.filter(Z=>[Z.name,Z.description,Z.preview].some(se=>se.toLowerCase().includes(L))):r},[r,f]),B=t==="installed"?W:i,X=W.find(L=>L.name===o)??null,K=i.find(L=>u(L)===o)??null,U=(X==null?void 0:X.name)??(K==null?void 0:K.name)??null;N.useEffect(()=>{if(A(!1),!B.length){l(null),t!=="installed"&&p(null);return}if(!o||!B.some(L=>u(L)===o)){const L=B[0];L&&l(u(L))}},[o,t,B]),N.useEffect(()=>{if(t!=="installed"||!U){p(null);return}Y(U)},[Y,U,t]);async function G(L){if(!L.url&&!L.registrySource){ft.error("Install source is not available for this skill yet");return}T(L.name);try{await et.post("/skills/install",{name:L.name,source:L.source,url:L.url,registrySource:L.registrySource,skillId:L.skillId}),ft.success(`Installed ${L.title||L.name}`),await I(),a(Z=>Z.map(se=>se.name===L.name?{...se,installed:!0}:se))}catch(Z){ft.error(Z instanceof Error?Z.message:"Install failed")}finally{T(null)}}async function J(L){T(L);try{await et.delete(`/skills/${encodeURIComponent(L)}`),ft.success(`Removed ${L}`),await I(),a(Z=>Z.map(se=>se.name===L?{...se,installed:!1}:se))}catch(Z){ft.error(Z instanceof Error?Z.message:"Failed to remove skill")}finally{T(null)}}async function F(){if(d){T(d.name);try{await et.put(`/skills/${encodeURIComponent(d.name)}`,{content:O}),ft.success(`Updated ${d.name}`),A(!1),await Promise.all([I(),Y(d.name)])}catch(L){ft.error(L instanceof Error?L.message:"Failed to save skill")}finally{T(null)}}}const te=!!(X!=null&&X.activatedForOrchestrator),q=E===(d==null?void 0:d.name),z=E===(K==null?void 0:K.name);return y.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[y.jsxs("div",{className:"w-64 flex-shrink-0 border-r border-white/[0.06] flex flex-col overflow-hidden",children:[y.jsxs("div",{className:"px-2.5 pt-2.5 pb-2 flex-shrink-0 border-b border-white/[0.06] space-y-2",children:[y.jsxs("div",{className:"relative",children:[y.jsx(VP,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3 w-3 -translate-y-1/2 text-zinc-700"}),y.jsx("input",{type:"text",value:f,onChange:L=>g(L.target.value),placeholder:"Search skills…",className:"w-full bg-[#181818] border border-white/[0.06] rounded-xl pl-7 pr-2 py-1.5 text-[11px] text-zinc-300 font-mono placeholder:text-zinc-700 focus:outline-none focus:border-[#E43A9C]/30 transition-colors"})]}),y.jsx("div",{className:"flex flex-col gap-0.5",children:kq.map(L=>y.jsxs("button",{type:"button",onClick:()=>e(L.id),className:`w-full text-left px-2.5 py-1.5 rounded-lg text-[11px] font-mono transition-colors flex items-center justify-between cursor-pointer ${t===L.id?"text-[#E43A9C]":"text-zinc-500 hover:text-zinc-300 hover:bg-white/[0.04]"}`,style:t===L.id?{background:"rgba(228,58,156,0.10)"}:void 0,children:[y.jsx("span",{children:L.label}),L.id==="installed"&&y.jsx("span",{className:"text-[10px] text-zinc-600",children:r.length})]},L.id))})]}),y.jsxs("div",{className:"flex-1 overflow-y-auto py-1.5",children:[v&&t!=="installed"?y.jsxs("div",{className:"flex items-center gap-2 rounded-2xl border border-white/[0.08] bg-white/[0.03] px-3 py-3 font-mono text-[11px] text-zinc-500",children:[y.jsx(As,{className:"h-3.5 w-3.5 animate-spin"})," Searching registry..."]}):null,B.map(L=>{const Z=u(L),se=o===Z,le=L.description||("preview"in L?L.preview:"No description available.");return y.jsxs("button",{type:"button",onClick:()=>{A(!1),l(Z)},className:`w-full text-left px-3 py-2.5 border-b border-white/[0.03] transition-colors cursor-pointer ${se?"border-l-2 border-l-[#E43A9C] bg-[#E43A9C]/5":"hover:bg-white/[0.03]"}`,children:[y.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[y.jsx("span",{className:"truncate font-mono text-[11px] text-zinc-200",children:L.name}),"installed"in L&&L.installed?y.jsx(Vt,{variant:"success",children:"installed"}):null]}),y.jsx("p",{className:"line-clamp-2 font-mono text-[10px] leading-relaxed text-zinc-600",children:le})]},`${t}:${Z}`)}),!v&&B.length===0?y.jsx("div",{className:"px-4 py-8",children:y.jsx("p",{className:"font-mono text-[11px] leading-relaxed text-zinc-500",children:P||(t==="skillssh"&&!f.trim()?"Start typing to search the skills.sh registry.":f.trim()?"No skills match your search.":"No skills available in this source.")})}):null]})]}),y.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto p-5",children:t==="installed"&&X?y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"mb-5 flex items-start justify-between gap-4 border-b border-white/[0.06] pb-5",children:[y.jsxs("div",{className:"flex min-w-0 gap-4",children:[y.jsx("div",{className:"flex h-14 w-14 shrink-0 items-center justify-center rounded-2xl bg-[#E43A9C]/12 text-[#E43A9C]",children:y.jsx(Lb,{className:"h-6 w-6"})}),y.jsxs("div",{className:"min-w-0",children:[y.jsx("h3",{className:"truncate text-[34px] uppercase tracking-[0.08em] text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:X.name}),y.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[y.jsx(Vt,{variant:"success",children:"installed"}),te?y.jsx(Vt,{variant:"warning",children:"active"}):y.jsx(Vt,{variant:"muted",children:"inactive"}),y.jsx(Vt,{variant:"muted",children:"local skill"})]}),y.jsxs("div",{className:"mt-3 space-y-1 font-mono text-[11px] text-zinc-500",children:[y.jsxs("p",{children:["path: ",X.filePath]}),y.jsxs("p",{children:["orchestrator: ",te?"enabled":"disabled"]})]})]})]}),y.jsxs("div",{className:"flex items-center gap-2",children:[k?y.jsxs(Da,{onClick:F,disabled:q||O===(d==null?void 0:d.content),className:"px-3 py-2",children:[q?y.jsx(As,{className:"h-3.5 w-3.5 animate-spin"}):y.jsx(Mb,{className:"h-3.5 w-3.5"}),"Save"]}):y.jsxs(Wi,{onClick:()=>A(!0),className:"px-3 py-2",children:[y.jsx(Mb,{className:"h-3.5 w-3.5"})," Edit"]}),y.jsxs(Ww,{onClick:()=>J(X.name),className:"px-3 py-2",children:[q?y.jsx(As,{className:"h-3.5 w-3.5 animate-spin"}):y.jsx(Ms,{className:"h-3.5 w-3.5"}),"Remove"]})]})]}),y.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto pr-1",children:_&&!d?y.jsxs("div",{className:"flex items-center gap-2 font-mono text-[11px] text-zinc-500",children:[y.jsx(As,{className:"h-3.5 w-3.5 animate-spin"})," Loading skill..."]}):k?y.jsxs("div",{className:"space-y-3",children:[y.jsx("textarea",{value:O,onChange:L=>C(L.target.value),className:"min-h-[440px] w-full rounded-2xl border border-white/[0.08] bg-black/30 p-4 font-mono text-[12px] leading-6 text-zinc-200 outline-none transition-colors focus:border-[#E43A9C]/50"}),y.jsxs("div",{className:"flex items-center justify-between font-mono text-[11px] text-zinc-500",children:[y.jsx("span",{children:"Editing raw SKILL.md"}),y.jsx(Wi,{onClick:()=>{A(!1),C((d==null?void 0:d.content)??"")},className:"px-3 py-2",children:"Cancel"})]})]}):d?y.jsx(Oq,{content:d.content}):y.jsx("p",{className:"font-mono text-[11px] text-zinc-500",children:"Select an installed skill to inspect it."})})]}):t!=="installed"&&K?y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"mb-5 flex items-start justify-between gap-4 border-b border-white/[0.06] pb-5",children:[y.jsxs("div",{className:"flex min-w-0 gap-4",children:[y.jsx("div",{className:"flex h-14 w-14 shrink-0 items-center justify-center rounded-2xl bg-[#E43A9C]/12 text-[#E43A9C]",children:y.jsx(D4,{className:"h-6 w-6"})}),y.jsxs("div",{className:"min-w-0",children:[y.jsx("h3",{className:"truncate text-[34px] uppercase tracking-[0.08em] text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:K.title||K.name}),y.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[y.jsx(Vt,{variant:K.installed?"success":"default",children:K.installed?"installed":"available"}),y.jsx(Vt,{variant:"muted",children:NE(K.source)}),RE(K.installs)?y.jsx(Vt,{variant:"info",children:RE(K.installs)}):null]}),y.jsxs("div",{className:"mt-3 space-y-1 font-mono text-[11px] text-zinc-500",children:[y.jsxs("p",{children:["registry: ",NE(K.source)]}),K.registrySource?y.jsxs("p",{children:["source: ",K.registrySource]}):null,K.url?y.jsxs("p",{children:["url: ",K.url]}):null]})]})]}),y.jsx("div",{className:"flex items-center gap-2",children:K.installed?y.jsx(Wi,{onClick:()=>{e("installed"),l(K.name)},className:"px-3 py-2",children:"Open installed"}):y.jsxs(Da,{onClick:()=>G(K),disabled:z||!K.url&&!K.registrySource,className:"px-3 py-2",children:[z?y.jsx(As,{className:"h-3.5 w-3.5 animate-spin"}):y.jsx(Y5,{className:"h-3.5 w-3.5"}),"Install"]})})]}),y.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto pr-1",children:[y.jsx("div",{className:"rounded-2xl border border-white/[0.06] bg-white/[0.02] p-5",children:y.jsx("p",{className:"font-mono text-[12px] leading-7 text-zinc-300",children:K.description||"No registry description is available for this skill yet."})}),y.jsx("div",{className:"mt-4 rounded-2xl border border-dashed border-white/[0.08] bg-black/20 p-4 font-mono text-[11px] leading-6 text-zinc-500",children:"Install will fetch the skill definition from the selected registry source and add it to your local skills library."})]})]}):y.jsx("div",{className:"flex h-full items-center justify-center rounded-2xl border border-dashed border-white/[0.08] bg-white/[0.02] p-8 text-center",children:y.jsxs("div",{children:[y.jsx("div",{className:"mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-[#E43A9C]/12 text-[#E43A9C]",children:y.jsx(Lb,{className:"h-6 w-6"})}),y.jsx("h3",{className:"text-[28px] uppercase tracking-[0.08em] text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Select a Skill"}),y.jsx("p",{className:"mt-2 font-mono text-[11px] leading-relaxed text-zinc-500",children:"Choose a skill from the left panel to inspect details, install registry entries, or edit local definitions."})]})})})]})}const Ff=["#38bdf8","#a78bfa","#34d399","#f59e0b","#f87171","#E43A9C"];function Tq(t){return Ff[t%Ff.length]}function jg(){const{name:t,instanceId:e}=XL();return t&&e?y.jsx(Nq,{squadName:t,instanceId:e}):t?y.jsx(Pq,{name:t}):y.jsx(Cq,{})}function Cq(){const[t,e]=N.useState([]),[r,n]=N.useState(null),i=Au();return N.useEffect(()=>{Promise.all([et.get("/squads"),et.get("/config")]).then(([a,o])=>{e(a.squads),n(o.config.maxInstancesPerSquad)}).catch(()=>{})},[]),y.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[y.jsx("div",{className:"mb-6",children:y.jsxs("div",{children:[y.jsx("h2",{className:"text-2xl tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Squads"}),y.jsxs("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:[t.length," squads · ",t.reduce((a,o)=>a+(o.activeInstances||0),0)," ","active instances"]})]})}),y.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3",children:[t.map((a,o)=>{const l=Tq(o);return y.jsxs("button",{type:"button",onClick:()=>i(`/squads/${a.name}`),className:"text-left rounded-2xl p-5 transition-all group cursor-pointer",style:{border:`1px solid ${l}30`,background:`${l}08`,backdropFilter:"blur(20px)"},onMouseEnter:u=>{u.currentTarget.style.borderColor=`${l}70`,u.currentTarget.style.background=`${l}12`},onMouseLeave:u=>{u.currentTarget.style.borderColor=`${l}30`,u.currentTarget.style.background=`${l}08`},children:[y.jsxs("div",{className:"flex items-start justify-between mb-1",children:[y.jsx("h3",{className:"text-sm font-mono transition-colors",style:{color:l},children:a.name}),y.jsx(Vt,{variant:To(a.status),children:a.status})]}),y.jsxs("div",{className:"flex items-center justify-between mb-3",children:[y.jsx("p",{className:"text-[11px] text-zinc-600 font-mono",children:a.universe}),y.jsxs("span",{className:"text-[11px] text-zinc-600 font-mono flex items-center gap-1",children:[y.jsx(K5,{className:"w-3 h-3"}),a.activeInstances,"/",r??(a.totalInstances||a.memberCount)]})]}),a.repoUrl&&y.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-zinc-700 font-mono mb-4",children:[y.jsx(FP,{className:"w-3 h-3 flex-shrink-0"}),y.jsx("span",{className:"truncate",children:a.repoUrl.replace("https://github.com/","")})]}),a.recentActivity&&a.recentActivity.length>0&&y.jsxs("div",{className:"border-t pt-3",style:{borderColor:`${l}15`},children:[y.jsx("p",{className:"text-[10px] font-mono uppercase tracking-wider mb-2",style:{color:`${l}80`},children:"Recent Work"}),y.jsx("ul",{className:"space-y-1.5",children:a.recentActivity.map(u=>{const d={className:"w-3.5 h-3.5 flex-shrink-0 mt-px"},p=jq(u.status,d),f=u.objective?u.objective.length>60?`${u.objective.slice(0,60)}…`:u.objective:u.issueRef||"Instance";return y.jsxs("li",{className:"flex items-start gap-1.5 text-[11px] font-mono text-zinc-600",children:[p,y.jsx("span",{className:"truncate",children:f})]},u.id)})})]})]},a.id)}),t.length===0&&y.jsxs("div",{className:"col-span-full text-center py-12 text-zinc-600",children:[y.jsx(Xh,{size:48,className:"mx-auto mb-3 opacity-30"}),y.jsx("p",{className:"text-[11px] font-mono",children:"No squads hired yet. Ask IO to hire a squad for a project."})]})]})]})}function jq(t,e){const r=t.toLowerCase();return r.includes("complete")||r.includes("success")||r.includes("done")?y.jsx(U5,{...e,style:{color:"#34d399"}}):r.includes("warning")||r.includes("review")?y.jsx(H4,{...e,style:{color:"#fbbf24"}}):r.includes("error")||r.includes("fail")?y.jsx(F5,{...e,style:{color:"#f87171"}}):r.includes("working")||r.includes("progress")||r.includes("running")?y.jsx(HP,{...e,style:{color:"#E43A9C"}}):y.jsx(h4,{...e,style:{color:"#60a5fa"}})}function fR(t,e){const r="w-4 h-4",n={color:e},i=t.toLowerCase();return i.includes("lead")||i.includes("pm")||i.includes("technical")?y.jsx(qP,{className:r,style:n}):i.includes("qa")||i.includes("test")?y.jsx(P5,{className:r,style:n}):i.includes("scribe")?y.jsx(N4,{className:r,style:n}):y.jsx(UP,{className:r,style:n})}function Pq({name:t}){const[e,r]=N.useState(null),[n,i]=N.useState("agents"),a=Au();if(N.useEffect(()=>{et.get(`/squads/${t}`).then(r).catch(()=>{})},[t]),!e)return y.jsx("div",{className:"h-full flex items-center justify-center text-zinc-600",children:"Loading..."});const o=Ff[0];return y.jsxs("div",{className:"flex-1 overflow-y-auto p-6",style:{background:`${o}06`},children:[y.jsxs("button",{type:"button",onClick:()=>a("/squads"),className:"flex items-center gap-1.5 text-[11px] text-zinc-600 hover:text-zinc-300 font-mono mb-5 transition-colors",children:[y.jsx(Cu,{className:"w-3.5 h-3.5"})," All Squads"]}),y.jsxs("div",{className:"flex items-start justify-between mb-5",children:[y.jsxs("div",{children:[y.jsx("h2",{className:"text-3xl tracking-wide",style:{fontFamily:"'Bebas Neue', sans-serif",color:o},children:e.squad.name}),y.jsxs("p",{className:"text-[11px] text-zinc-600 font-mono",children:[e.squad.universe," · ",e.squad.autonomyTier||"standard"," autonomy"]}),e.squad.repoUrl&&y.jsxs("a",{href:e.squad.repoUrl,target:"_blank",rel:"noreferrer",className:"text-[11px] font-mono text-[#E43A9C] hover:text-[#F041FF] flex items-center gap-1 mt-1 transition-colors",children:[y.jsx(FP,{className:"w-3 h-3"}),e.squad.repoUrl.replace("https://github.com/","")]})]}),y.jsx(Vt,{variant:To(e.squad.status),children:e.squad.status})]}),y.jsx("div",{className:"flex gap-0 mb-5 border-b border-white/[0.06]",children:["agents","instances"].map(l=>y.jsx("button",{type:"button",onClick:()=>i(l),className:`px-4 py-2 text-[11px] font-mono capitalize transition-colors border-b-2 -mb-px ${n===l?"text-[#E43A9C] border-[#E43A9C]":"text-zinc-600 hover:text-zinc-300 border-transparent"}`,children:l},l))}),n==="agents"&&y.jsx("div",{className:"space-y-2",children:e.members.map(l=>y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-4 flex items-center gap-3",children:[y.jsx("div",{className:"w-8 h-8 rounded-xl flex items-center justify-center flex-shrink-0",style:{border:`1px solid ${o}30`,background:`${o}12`},children:fR(l.roleName||l.role,o)}),y.jsxs("div",{className:"flex-1 min-w-0",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("span",{className:"text-sm font-mono text-zinc-200",children:l.displayName}),y.jsx(Vt,{variant:To(l.status),children:l.status})]}),y.jsx("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:l.role}),l.currentTask&&y.jsx("p",{className:"text-xs text-zinc-500 mt-1 truncate",children:l.currentTask})]})]},l.id))}),n==="instances"&&y.jsx("div",{className:"space-y-2",children:e.instances.length===0?y.jsx("div",{className:"text-center py-16 text-zinc-700 font-mono text-sm",children:"No active instances"}):e.instances.map(l=>y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-4 flex items-center gap-4",children:[y.jsxs("div",{className:"flex-1 grid grid-cols-2 gap-2 text-[11px] font-mono",children:[y.jsxs("div",{children:[y.jsx("span",{className:"text-zinc-700",children:"ID"}),y.jsx("p",{className:"text-zinc-300 mt-0.5 truncate",children:l.id.slice(0,8)})]}),y.jsxs("div",{children:[y.jsx("span",{className:"text-zinc-700",children:"Branch"}),y.jsx("p",{className:"text-zinc-300 mt-0.5 truncate",children:l.branch||"—"})]}),y.jsxs("div",{children:[y.jsx("span",{className:"text-zinc-700",children:"Status"}),y.jsx("p",{className:"text-zinc-300 mt-0.5",children:y.jsx(Vt,{variant:To(l.status),children:l.status})})]}),y.jsxs("div",{children:[y.jsx("span",{className:"text-zinc-700",children:"Tasks"}),y.jsxs("p",{className:"text-zinc-300 mt-0.5",children:[l.tasksComplete,"/",l.taskCount]})]})]}),y.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[y.jsx("button",{type:"button",onClick:()=>a(`/squads/${t}/instances/${l.id}`),title:"View instance agents",className:"p-2 rounded-xl hover:bg-white/[0.06] transition-colors cursor-pointer",style:{color:o},children:y.jsx(Kh,{className:"w-4 h-4"})}),y.jsx("button",{type:"button",onClick:()=>ft.info("Stop not yet implemented"),title:"Stop instance",className:"p-2 rounded-xl hover:bg-red-500/10 text-zinc-600 hover:text-red-400 transition-colors cursor-pointer",children:y.jsx(Vh,{className:"w-4 h-4"})})]})]},l.id))})]})}function Nq({squadName:t,instanceId:e}){const[r,n]=N.useState(null),[i,a]=N.useState(null),o=Au();if(N.useEffect(()=>{et.get(`/squads/${t}/instances/${e}`).then(n).catch(()=>{ft.error("Failed to load instance")})},[t,e]),!r)return y.jsx("div",{className:"h-full flex items-center justify-center text-zinc-600",children:"Loading..."});const l=Ff[0];if(i){const u=r.members.find(p=>p.roleName===i),d=r.activity.filter(p=>p.agent===i);return y.jsx($q,{agentName:(u==null?void 0:u.displayName)||i,agentRole:i,agentStatus:(u==null?void 0:u.status)||"idle",currentTask:(u==null?void 0:u.currentTask)||null,events:d,color:l,onBack:()=>a(null),squadName:t})}return y.jsxs("div",{className:"flex-1 overflow-y-auto p-6",style:{background:`${l}06`},children:[y.jsxs("button",{type:"button",onClick:()=>o(`/squads/${t}`),className:"flex items-center gap-1.5 text-[11px] text-zinc-600 hover:text-zinc-300 font-mono mb-5 transition-colors",children:[y.jsx(Cu,{className:"w-3.5 h-3.5"})," Back to ",t]}),y.jsxs("div",{className:"flex items-start justify-between mb-6",children:[y.jsxs("div",{children:[y.jsx("h2",{className:"text-2xl tracking-wide",style:{fontFamily:"'Bebas Neue', sans-serif",color:l},children:"Instance"}),y.jsx("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:r.instance.id.slice(0,8)}),r.instance.branch&&y.jsx("p",{className:"text-[11px] text-zinc-700 font-mono mt-0.5",children:r.instance.branch})]}),y.jsx(Vt,{variant:To(r.instance.status),children:r.instance.status})]}),y.jsx("div",{className:"space-y-2",children:r.members.map(u=>y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-4 flex items-center gap-3",children:[y.jsx("div",{className:"w-8 h-8 rounded-xl flex items-center justify-center flex-shrink-0",style:{border:`1px solid ${l}30`,background:`${l}12`},children:fR(u.roleName||u.role,l)}),y.jsxs("div",{className:"flex-1 min-w-0",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("span",{className:"text-sm font-mono text-zinc-200",children:u.displayName}),y.jsx(Vt,{variant:To(u.status),children:u.status})]}),y.jsx("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:u.role}),u.currentTask&&y.jsx("p",{className:"text-xs text-zinc-500 mt-1 truncate",children:u.currentTask})]}),(u.status==="working"||u.status==="in meeting")&&y.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[y.jsx("button",{type:"button",onClick:()=>a(u.roleName||u.role),title:"View work in progress",className:"p-2 rounded-xl hover:bg-white/[0.06] transition-colors cursor-pointer",style:{color:l},children:y.jsx(Kh,{className:"w-4 h-4"})}),u.status==="working"&&y.jsx("button",{type:"button",onClick:()=>ft.success(`${u.displayName} stopped`),title:"Stop agent",className:"p-2 rounded-xl hover:bg-red-500/10 text-zinc-600 hover:text-red-400 transition-colors cursor-pointer",children:y.jsx(Vh,{className:"w-4 h-4"})})]})]},u.id))}),(r.instance.status==="meeting"||r.instance.status==="planning")&&r.instance.meetingLog&&r.instance.meetingLog.length>0&&y.jsxs("div",{className:"mt-6",children:[y.jsx("h3",{className:"text-lg tracking-wide mb-3",style:{fontFamily:"'Bebas Neue', sans-serif",color:l},children:"Meeting Discussion"}),y.jsx("div",{className:"space-y-2",children:r.instance.meetingLog.map((u,d)=>{const p=u.match(/^\[([^\]]+)\]\s*(.*)/s),f=p?p[1]:"unknown",g=p?p[2]:u;return y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-xl px-4 py-3",children:[y.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[y.jsx(Xh,{className:"w-3.5 h-3.5",style:{color:"#818cf8"}}),y.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wider text-indigo-400",children:f})]}),y.jsx("p",{className:"text-xs text-zinc-400 whitespace-pre-wrap leading-relaxed",children:g})]},`meeting-${d}`)})})]})]})}const Rq={thought:{label:"Thinking",icon:WP,color:"#a78bfa",bg:"rgba(167,139,250,0.1)"},tool_call:{label:"Tool Call",icon:U4,color:"#38bdf8",bg:"rgba(56,189,248,0.1)"},tool_result:{label:"Tool Result",icon:u4,color:"#34d399",bg:"rgba(52,211,153,0.1)"},message:{label:"Message",icon:UP,color:"#E43A9C",bg:"rgba(228,58,156,0.15)"},decision:{label:"Decision",icon:qP,color:"#fbbf24",bg:"rgba(251,191,36,0.1)"},meeting:{label:"Meeting",icon:Xh,color:"#818cf8",bg:"rgba(129,140,248,0.1)"}};function Iq(t){const e=t.toLowerCase();return e.includes("meeting")?"meeting":e.includes("tool_call")||e.includes("tool-call")?"tool_call":e.includes("tool_result")||e.includes("tool-result")?"tool_result":e.includes("thought")||e.includes("thinking")||e.includes("reason")?"thought":e.includes("decision")?"decision":"message"}function $q({agentName:t,agentRole:e,agentStatus:r,currentTask:n,events:i,color:a,onBack:o,squadName:l}){const u=ml();return y.jsxs("div",{className:"flex-1 overflow-y-auto p-6",style:{background:`${a}06`},children:[y.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-1.5 text-[11px] text-zinc-600 hover:text-zinc-300 font-mono mb-5 transition-colors",children:[y.jsx(Cu,{className:"w-3.5 h-3.5"})," Back to ",l]}),y.jsxs("div",{className:"flex items-start justify-between mb-6",children:[y.jsxs("div",{children:[y.jsx("h2",{className:"text-2xl tracking-wide",style:{fontFamily:"'Bebas Neue', sans-serif",color:a},children:t}),y.jsx("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:e}),n&&y.jsx("p",{className:"text-sm text-zinc-400 mt-1",children:n})]}),y.jsx(Vt,{variant:To(r),children:r})]}),y.jsxs("div",{className:"relative",children:[y.jsx("div",{className:"absolute left-[15px] top-0 bottom-0 w-px bg-white/[0.06]"}),y.jsxs("div",{className:"space-y-3 pl-10",children:[i.length===0&&y.jsx("div",{className:"text-center py-12 text-zinc-700 font-mono text-sm",children:"No activity recorded yet"}),i.map(d=>{const p=Iq(d.type),f=Rq[p],g=f.icon,v=p==="tool_call"||p==="tool_result",x=d.type.toLowerCase().includes("error")||d.type.toLowerCase().includes("fail");return y.jsxs("div",{className:"relative",children:[y.jsx("div",{className:"absolute -left-10 top-3 w-[30px] h-[30px] rounded-full flex items-center justify-center",style:{background:f.bg,border:`1px solid ${f.color}30`},children:y.jsx(g,{className:"w-3.5 h-3.5",style:{color:f.color}})}),y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl px-4 py-3",children:[y.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wider",style:{color:f.color},children:f.label}),d.model&&y.jsx("span",{className:"text-[10px] font-mono text-zinc-600 border border-white/[0.08] rounded px-1.5 py-px bg-white/[0.03]",children:d.model}),x&&y.jsx(Vt,{variant:"error",children:"failed"})]}),y.jsx("span",{className:"text-[10px] font-mono text-zinc-700",children:Rw(d.timestamp,u)})]}),v?y.jsx("pre",{className:"text-[11px] font-mono text-zinc-400 whitespace-pre-wrap leading-relaxed overflow-x-auto rounded-lg p-2.5 bg-black/20",children:d.content}):y.jsx("p",{className:"text-[12px] text-zinc-400 leading-relaxed",children:d.content})]})]},d.id)}),y.jsxs("div",{className:"relative",children:[y.jsx("div",{className:"absolute -left-10 top-3 w-[30px] h-[30px] rounded-full flex items-center justify-center",style:{background:`${a}15`,border:`1px solid ${a}40`},children:y.jsx(HP,{className:"w-3.5 h-3.5 animate-spin",style:{color:a}})}),y.jsx("div",{className:"glass-card border rounded-2xl px-4 py-3",style:{borderColor:`${a}20`},children:y.jsx("span",{className:"text-[11px] font-mono",style:{color:a},children:"Agent is working…"})})]})]})]})]})}var Pg,$E;function Zr(){if($E)return Pg;$E=1;var t=Array.isArray;return Pg=t,Pg}var Ng,ME;function hR(){if(ME)return Ng;ME=1;var t=typeof Xd=="object"&&Xd&&Xd.Object===Object&&Xd;return Ng=t,Ng}var Rg,LE;function Ei(){if(LE)return Rg;LE=1;var t=hR(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return Rg=r,Rg}var Ig,DE;function Nu(){if(DE)return Ig;DE=1;var t=Ei(),e=t.Symbol;return Ig=e,Ig}var $g,zE;function Mq(){if(zE)return $g;zE=1;var t=Nu(),e=Object.prototype,r=e.hasOwnProperty,n=e.toString,i=t?t.toStringTag:void 0;function a(o){var l=r.call(o,i),u=o[i];try{o[i]=void 0;var d=!0}catch{}var p=n.call(o);return d&&(l?o[i]=u:delete o[i]),p}return $g=a,$g}var Mg,BE;function Lq(){if(BE)return Mg;BE=1;var t=Object.prototype,e=t.toString;function r(n){return e.call(n)}return Mg=r,Mg}var Lg,UE;function ra(){if(UE)return Lg;UE=1;var t=Nu(),e=Mq(),r=Lq(),n="[object Null]",i="[object Undefined]",a=t?t.toStringTag:void 0;function o(l){return l==null?l===void 0?i:n:a&&a in Object(l)?e(l):r(l)}return Lg=o,Lg}var Dg,qE;function na(){if(qE)return Dg;qE=1;function t(e){return e!=null&&typeof e=="object"}return Dg=t,Dg}var zg,FE;function vl(){if(FE)return zg;FE=1;var t=ra(),e=na(),r="[object Symbol]";function n(i){return typeof i=="symbol"||e(i)&&t(i)==r}return zg=n,zg}var Bg,HE;function Xw(){if(HE)return Bg;HE=1;var t=Zr(),e=vl(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(a,o){if(t(a))return!1;var l=typeof a;return l=="number"||l=="symbol"||l=="boolean"||a==null||e(a)?!0:n.test(a)||!r.test(a)||o!=null&&a in Object(o)}return Bg=i,Bg}var Ug,WE;function qa(){if(WE)return Ug;WE=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return Ug=t,Ug}var qg,GE;function Yw(){if(GE)return qg;GE=1;var t=ra(),e=qa(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function o(l){if(!e(l))return!1;var u=t(l);return u==n||u==i||u==r||u==a}return qg=o,qg}var Fg,KE;function Dq(){if(KE)return Fg;KE=1;var t=Ei(),e=t["__core-js_shared__"];return Fg=e,Fg}var Hg,VE;function zq(){if(VE)return Hg;VE=1;var t=Dq(),e=(function(){var n=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!e&&e in n}return Hg=r,Hg}var Wg,XE;function pR(){if(XE)return Wg;XE=1;var t=Function.prototype,e=t.toString;function r(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return Wg=r,Wg}var Gg,YE;function Bq(){if(YE)return Gg;YE=1;var t=Yw(),e=zq(),r=qa(),n=pR(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,l=Object.prototype,u=o.toString,d=l.hasOwnProperty,p=RegExp("^"+u.call(d).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(g){if(!r(g)||e(g))return!1;var v=t(g)?p:a;return v.test(n(g))}return Gg=f,Gg}var Kg,JE;function Uq(){if(JE)return Kg;JE=1;function t(e,r){return e==null?void 0:e[r]}return Kg=t,Kg}var Vg,ZE;function Bo(){if(ZE)return Vg;ZE=1;var t=Bq(),e=Uq();function r(n,i){var a=e(n,i);return t(a)?a:void 0}return Vg=r,Vg}var Xg,QE;function np(){if(QE)return Xg;QE=1;var t=Bo(),e=t(Object,"create");return Xg=e,Xg}var Yg,eO;function qq(){if(eO)return Yg;eO=1;var t=np();function e(){this.__data__=t?t(null):{},this.size=0}return Yg=e,Yg}var Jg,tO;function Fq(){if(tO)return Jg;tO=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return Jg=t,Jg}var Zg,rO;function Hq(){if(rO)return Zg;rO=1;var t=np(),e="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(a){var o=this.__data__;if(t){var l=o[a];return l===e?void 0:l}return n.call(o,a)?o[a]:void 0}return Zg=i,Zg}var Qg,nO;function Wq(){if(nO)return Qg;nO=1;var t=np(),e=Object.prototype,r=e.hasOwnProperty;function n(i){var a=this.__data__;return t?a[i]!==void 0:r.call(a,i)}return Qg=n,Qg}var ey,iO;function Gq(){if(iO)return ey;iO=1;var t=np(),e="__lodash_hash_undefined__";function r(n,i){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=t&&i===void 0?e:i,this}return ey=r,ey}var ty,aO;function Kq(){if(aO)return ty;aO=1;var t=qq(),e=Fq(),r=Hq(),n=Wq(),i=Gq();function a(o){var l=-1,u=o==null?0:o.length;for(this.clear();++l<u;){var d=o[l];this.set(d[0],d[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,ty=a,ty}var ry,oO;function Vq(){if(oO)return ry;oO=1;function t(){this.__data__=[],this.size=0}return ry=t,ry}var ny,sO;function Jw(){if(sO)return ny;sO=1;function t(e,r){return e===r||e!==e&&r!==r}return ny=t,ny}var iy,lO;function ip(){if(lO)return iy;lO=1;var t=Jw();function e(r,n){for(var i=r.length;i--;)if(t(r[i][0],n))return i;return-1}return iy=e,iy}var ay,cO;function Xq(){if(cO)return ay;cO=1;var t=ip(),e=Array.prototype,r=e.splice;function n(i){var a=this.__data__,o=t(a,i);if(o<0)return!1;var l=a.length-1;return o==l?a.pop():r.call(a,o,1),--this.size,!0}return ay=n,ay}var oy,uO;function Yq(){if(uO)return oy;uO=1;var t=ip();function e(r){var n=this.__data__,i=t(n,r);return i<0?void 0:n[i][1]}return oy=e,oy}var sy,dO;function Jq(){if(dO)return sy;dO=1;var t=ip();function e(r){return t(this.__data__,r)>-1}return sy=e,sy}var ly,fO;function Zq(){if(fO)return ly;fO=1;var t=ip();function e(r,n){var i=this.__data__,a=t(i,r);return a<0?(++this.size,i.push([r,n])):i[a][1]=n,this}return ly=e,ly}var cy,hO;function ap(){if(hO)return cy;hO=1;var t=Vq(),e=Xq(),r=Yq(),n=Jq(),i=Zq();function a(o){var l=-1,u=o==null?0:o.length;for(this.clear();++l<u;){var d=o[l];this.set(d[0],d[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,cy=a,cy}var uy,pO;function Zw(){if(pO)return uy;pO=1;var t=Bo(),e=Ei(),r=t(e,"Map");return uy=r,uy}var dy,mO;function Qq(){if(mO)return dy;mO=1;var t=Kq(),e=ap(),r=Zw();function n(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return dy=n,dy}var fy,gO;function e9(){if(gO)return fy;gO=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return fy=t,fy}var hy,yO;function op(){if(yO)return hy;yO=1;var t=e9();function e(r,n){var i=r.__data__;return t(n)?i[typeof n=="string"?"string":"hash"]:i.map}return hy=e,hy}var py,vO;function t9(){if(vO)return py;vO=1;var t=op();function e(r){var n=t(this,r).delete(r);return this.size-=n?1:0,n}return py=e,py}var my,bO;function r9(){if(bO)return my;bO=1;var t=op();function e(r){return t(this,r).get(r)}return my=e,my}var gy,xO;function n9(){if(xO)return gy;xO=1;var t=op();function e(r){return t(this,r).has(r)}return gy=e,gy}var yy,wO;function i9(){if(wO)return yy;wO=1;var t=op();function e(r,n){var i=t(this,r),a=i.size;return i.set(r,n),this.size+=i.size==a?0:1,this}return yy=e,yy}var vy,_O;function Qw(){if(_O)return vy;_O=1;var t=Qq(),e=t9(),r=r9(),n=n9(),i=i9();function a(o){var l=-1,u=o==null?0:o.length;for(this.clear();++l<u;){var d=o[l];this.set(d[0],d[1])}}return a.prototype.clear=t,a.prototype.delete=e,a.prototype.get=r,a.prototype.has=n,a.prototype.set=i,vy=a,vy}var by,SO;function mR(){if(SO)return by;SO=1;var t=Qw(),e="Expected a function";function r(n,i){if(typeof n!="function"||i!=null&&typeof i!="function")throw new TypeError(e);var a=function(){var o=arguments,l=i?i.apply(this,o):o[0],u=a.cache;if(u.has(l))return u.get(l);var d=n.apply(this,o);return a.cache=u.set(l,d)||u,d};return a.cache=new(r.Cache||t),a}return r.Cache=t,by=r,by}var xy,kO;function a9(){if(kO)return xy;kO=1;var t=mR(),e=500;function r(n){var i=t(n,function(o){return a.size===e&&a.clear(),o}),a=i.cache;return i}return xy=r,xy}var wy,EO;function o9(){if(EO)return wy;EO=1;var t=a9(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=t(function(i){var a=[];return i.charCodeAt(0)===46&&a.push(""),i.replace(e,function(o,l,u,d){a.push(u?d.replace(r,"$1"):l||o)}),a});return wy=n,wy}var _y,OO;function e1(){if(OO)return _y;OO=1;function t(e,r){for(var n=-1,i=e==null?0:e.length,a=Array(i);++n<i;)a[n]=r(e[n],n,e);return a}return _y=t,_y}var Sy,AO;function s9(){if(AO)return Sy;AO=1;var t=Nu(),e=e1(),r=Zr(),n=vl(),i=t?t.prototype:void 0,a=i?i.toString:void 0;function o(l){if(typeof l=="string")return l;if(r(l))return e(l,o)+"";if(n(l))return a?a.call(l):"";var u=l+"";return u=="0"&&1/l==-1/0?"-0":u}return Sy=o,Sy}var ky,TO;function gR(){if(TO)return ky;TO=1;var t=s9();function e(r){return r==null?"":t(r)}return ky=e,ky}var Ey,CO;function yR(){if(CO)return Ey;CO=1;var t=Zr(),e=Xw(),r=o9(),n=gR();function i(a,o){return t(a)?a:e(a,o)?[a]:r(n(a))}return Ey=i,Ey}var Oy,jO;function sp(){if(jO)return Oy;jO=1;var t=vl();function e(r){if(typeof r=="string"||t(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return Oy=e,Oy}var Ay,PO;function t1(){if(PO)return Ay;PO=1;var t=yR(),e=sp();function r(n,i){i=t(i,n);for(var a=0,o=i.length;n!=null&&a<o;)n=n[e(i[a++])];return a&&a==o?n:void 0}return Ay=r,Ay}var Ty,NO;function vR(){if(NO)return Ty;NO=1;var t=t1();function e(r,n,i){var a=r==null?void 0:t(r,n);return a===void 0?i:a}return Ty=e,Ty}var l9=vR();const Tn=vt(l9);var Cy,RO;function c9(){if(RO)return Cy;RO=1;function t(e){return e==null}return Cy=t,Cy}var u9=c9();const Qe=vt(u9);var jy,IO;function d9(){if(IO)return jy;IO=1;var t=ra(),e=Zr(),r=na(),n="[object String]";function i(a){return typeof a=="string"||!e(a)&&r(a)&&t(a)==n}return jy=i,jy}var f9=d9();const No=vt(f9);var h9=Yw();const Ye=vt(h9);var p9=qa();const bl=vt(p9);var Py={exports:{}},pt={};/**
435
+ * @license React
436
+ * react-is.production.min.js
437
+ *
438
+ * Copyright (c) Facebook, Inc. and its affiliates.
439
+ *
440
+ * This source code is licensed under the MIT license found in the
441
+ * LICENSE file in the root directory of this source tree.
442
+ */var $O;function m9(){if($O)return pt;$O=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),x;x=Symbol.for("react.module.reference");function _(b){if(typeof b=="object"&&b!==null){var k=b.$$typeof;switch(k){case t:switch(b=b.type,b){case r:case i:case n:case d:case p:return b;default:switch(b=b&&b.$$typeof,b){case l:case o:case u:case g:case f:case a:return b;default:return k}}case e:return k}}}return pt.ContextConsumer=o,pt.ContextProvider=a,pt.Element=t,pt.ForwardRef=u,pt.Fragment=r,pt.Lazy=g,pt.Memo=f,pt.Portal=e,pt.Profiler=i,pt.StrictMode=n,pt.Suspense=d,pt.SuspenseList=p,pt.isAsyncMode=function(){return!1},pt.isConcurrentMode=function(){return!1},pt.isContextConsumer=function(b){return _(b)===o},pt.isContextProvider=function(b){return _(b)===a},pt.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===t},pt.isForwardRef=function(b){return _(b)===u},pt.isFragment=function(b){return _(b)===r},pt.isLazy=function(b){return _(b)===g},pt.isMemo=function(b){return _(b)===f},pt.isPortal=function(b){return _(b)===e},pt.isProfiler=function(b){return _(b)===i},pt.isStrictMode=function(b){return _(b)===n},pt.isSuspense=function(b){return _(b)===d},pt.isSuspenseList=function(b){return _(b)===p},pt.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===r||b===i||b===n||b===d||b===p||b===v||typeof b=="object"&&b!==null&&(b.$$typeof===g||b.$$typeof===f||b.$$typeof===a||b.$$typeof===o||b.$$typeof===u||b.$$typeof===x||b.getModuleId!==void 0)},pt.typeOf=_,pt}var MO;function g9(){return MO||(MO=1,Py.exports=m9()),Py.exports}var y9=g9(),Ny,LO;function bR(){if(LO)return Ny;LO=1;var t=ra(),e=na(),r="[object Number]";function n(i){return typeof i=="number"||e(i)&&t(i)==r}return Ny=n,Ny}var Ry,DO;function v9(){if(DO)return Ry;DO=1;var t=bR();function e(r){return t(r)&&r!=+r}return Ry=e,Ry}var b9=v9();const Ru=vt(b9);var x9=bR();const w9=vt(x9);var Jn=function(e){return e===0?0:e>0?1:-1},So=function(e){return No(e)&&e.indexOf("%")===e.length-1},ge=function(e){return w9(e)&&!Ru(e)},_9=function(e){return Qe(e)},or=function(e){return ge(e)||No(e)},S9=0,Iu=function(e){var r=++S9;return"".concat(e||"").concat(r)},Ro=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ge(e)&&!No(e))return n;var a;if(So(e)){var o=e.indexOf("%");a=r*parseFloat(e.slice(0,o))/100}else a=+e;return Ru(a)&&(a=n),i&&a>r&&(a=r),a},Na=function(e){if(!e)return null;var r=Object.keys(e);return r&&r.length?e[r[0]]:null},k9=function(e){if(!Array.isArray(e))return!1;for(var r=e.length,n={},i=0;i<r;i++)if(!n[e[i]])n[e[i]]=!0;else return!0;return!1},Vn=function(e,r){return ge(e)&&ge(r)?function(n){return e+n*(r-e)}:function(){return r}};function Hf(t,e,r){return!t||!t.length?null:t.find(function(n){return n&&(typeof e=="function"?e(n):Tn(n,e))===r})}var E9=function(e,r){return ge(e)&&ge(r)?e-r:No(e)&&No(r)?e.localeCompare(r):e instanceof Date&&r instanceof Date?e.getTime()-r.getTime():String(e).localeCompare(String(r))};function zs(t,e){for(var r in t)if({}.hasOwnProperty.call(t,r)&&(!{}.hasOwnProperty.call(e,r)||t[r]!==e[r]))return!1;for(var n in e)if({}.hasOwnProperty.call(e,n)&&!{}.hasOwnProperty.call(t,n))return!1;return!0}function rx(t){"@babel/helpers - typeof";return rx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rx(t)}var O9=["viewBox","children"],A9=["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"],zO=["points","pathLength"],Iy={svg:O9,polygon:zO,polyline:zO},r1=["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"],Wf=function(e,r){if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(N.isValidElement(e)&&(n=e.props),!bl(n))return null;var i={};return Object.keys(n).forEach(function(a){r1.includes(a)&&(i[a]=r||function(o){return n[a](n,o)})}),i},T9=function(e,r,n){return function(i){return e(r,n,i),null}},Gf=function(e,r,n){if(!bl(e)||rx(e)!=="object")return null;var i=null;return Object.keys(e).forEach(function(a){var o=e[a];r1.includes(a)&&typeof o=="function"&&(i||(i={}),i[a]=T9(o,r,n))}),i},C9=["children"],j9=["children"];function BO(t,e){if(t==null)return{};var r=P9(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function P9(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function nx(t){"@babel/helpers - typeof";return nx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nx(t)}var UO={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Gi=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},qO=null,$y=null,n1=function t(e){if(e===qO&&Array.isArray($y))return $y;var r=[];return N.Children.forEach(e,function(n){Qe(n)||(y9.isFragment(n)?r=r.concat(t(n.props.children)):r.push(n))}),$y=r,qO=e,r};function Cn(t,e){var r=[],n=[];return Array.isArray(e)?n=e.map(function(i){return Gi(i)}):n=[Gi(e)],n1(t).forEach(function(i){var a=Tn(i,"type.displayName")||Tn(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function sn(t,e){var r=Cn(t,e);return r&&r[0]}var FO=function(e){if(!e||!e.props)return!1;var r=e.props,n=r.width,i=r.height;return!(!ge(n)||n<=0||!ge(i)||i<=0)},N9=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],R9=function(e){return e&&e.type&&No(e.type)&&N9.indexOf(e.type)>=0},I9=function(e){return e&&nx(e)==="object"&&"clipDot"in e},$9=function(e,r,n,i){var a,o=(a=Iy==null?void 0:Iy[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!Ye(e)&&(i&&o.includes(r)||A9.includes(r))||n&&r1.includes(r)},it=function(e,r,n){if(!e||typeof e=="function"||typeof e=="boolean")return null;var i=e;if(N.isValidElement(e)&&(i=e.props),!bl(i))return null;var a={};return Object.keys(i).forEach(function(o){var l;$9((l=i)===null||l===void 0?void 0:l[o],o,r,n)&&(a[o]=i[o])}),a},ix=function t(e,r){if(e===r)return!0;var n=N.Children.count(e);if(n!==N.Children.count(r))return!1;if(n===0)return!0;if(n===1)return HO(Array.isArray(e)?e[0]:e,Array.isArray(r)?r[0]:r);for(var i=0;i<n;i++){var a=e[i],o=r[i];if(Array.isArray(a)||Array.isArray(o)){if(!t(a,o))return!1}else if(!HO(a,o))return!1}return!0},HO=function(e,r){if(Qe(e)&&Qe(r))return!0;if(!Qe(e)&&!Qe(r)){var n=e.props||{},i=n.children,a=BO(n,C9),o=r.props||{},l=o.children,u=BO(o,j9);return i&&l?zs(a,u)&&ix(i,l):!i&&!l?zs(a,u):!1}return!1},WO=function(e,r){var n=[],i={};return n1(e).forEach(function(a,o){if(R9(a))n.push(a);else if(a){var l=Gi(a.type),u=r[l]||{},d=u.handler,p=u.once;if(d&&(!p||!i[l])){var f=d(a,l,o);n.push(f),i[l]=!0}}}),n},M9=function(e){var r=e&&e.type;return r&&UO[r]?UO[r]:null},L9=function(e,r){return n1(r).indexOf(e)},D9=["children","width","height","viewBox","className","style","title","desc"];function ax(){return ax=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ax.apply(this,arguments)}function z9(t,e){if(t==null)return{};var r=B9(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function B9(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function ox(t){var e=t.children,r=t.width,n=t.height,i=t.viewBox,a=t.className,o=t.style,l=t.title,u=t.desc,d=z9(t,D9),p=i||{width:r,height:n,x:0,y:0},f=at("recharts-surface",a);return $.createElement("svg",ax({},it(d,!0,"svg"),{className:f,width:r,height:n,style:o,viewBox:"".concat(p.x," ").concat(p.y," ").concat(p.width," ").concat(p.height)}),$.createElement("title",null,l),$.createElement("desc",null,u),e)}var U9=["children","className"];function sx(){return sx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},sx.apply(this,arguments)}function q9(t,e){if(t==null)return{};var r=F9(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function F9(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var Xt=$.forwardRef(function(t,e){var r=t.children,n=t.className,i=q9(t,U9),a=at("recharts-layer",n);return $.createElement("g",sx({className:a},it(i,!0),{ref:e}),r)}),Ki=function(e,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;a<n;a++)i[a-2]=arguments[a]},My,GO;function H9(){if(GO)return My;GO=1;function t(e,r,n){var i=-1,a=e.length;r<0&&(r=-r>a?0:a+r),n=n>a?a:n,n<0&&(n+=a),a=r>n?0:n-r>>>0,r>>>=0;for(var o=Array(a);++i<a;)o[i]=e[i+r];return o}return My=t,My}var Ly,KO;function W9(){if(KO)return Ly;KO=1;var t=H9();function e(r,n,i){var a=r.length;return i=i===void 0?a:i,!n&&i>=a?r:t(r,n,i)}return Ly=e,Ly}var Dy,VO;function xR(){if(VO)return Dy;VO=1;var t="\\ud800-\\udfff",e="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=e+r+n,a="\\ufe0e\\ufe0f",o="\\u200d",l=RegExp("["+o+t+i+a+"]");function u(d){return l.test(d)}return Dy=u,Dy}var zy,XO;function G9(){if(XO)return zy;XO=1;function t(e){return e.split("")}return zy=t,zy}var By,YO;function K9(){if(YO)return By;YO=1;var t="\\ud800-\\udfff",e="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=e+r+n,a="\\ufe0e\\ufe0f",o="["+t+"]",l="["+i+"]",u="\\ud83c[\\udffb-\\udfff]",d="(?:"+l+"|"+u+")",p="[^"+t+"]",f="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",v="\\u200d",x=d+"?",_="["+a+"]?",b="(?:"+v+"(?:"+[p,f,g].join("|")+")"+_+x+")*",k=_+x+b,A="(?:"+[p+l+"?",l,f,g,o].join("|")+")",O=RegExp(u+"(?="+u+")|"+A+k,"g");function C(E){return E.match(O)||[]}return By=C,By}var Uy,JO;function V9(){if(JO)return Uy;JO=1;var t=G9(),e=xR(),r=K9();function n(i){return e(i)?r(i):t(i)}return Uy=n,Uy}var qy,ZO;function X9(){if(ZO)return qy;ZO=1;var t=W9(),e=xR(),r=V9(),n=gR();function i(a){return function(o){o=n(o);var l=e(o)?r(o):void 0,u=l?l[0]:o.charAt(0),d=l?t(l,1).join(""):o.slice(1);return u[a]()+d}}return qy=i,qy}var Fy,QO;function Y9(){if(QO)return Fy;QO=1;var t=X9(),e=t("toUpperCase");return Fy=e,Fy}var J9=Y9();const lp=vt(J9);function Tt(t){return function(){return t}}const wR=Math.cos,Kf=Math.sin,ri=Math.sqrt,Vf=Math.PI,cp=2*Vf,lx=Math.PI,cx=2*lx,bo=1e-6,Z9=cx-bo;function _R(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=arguments[e]+t[e]}function Q9(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return _R;const r=10**e;return function(n){this._+=n[0];for(let i=1,a=n.length;i<a;++i)this._+=Math.round(arguments[i]*r)/r+n[i]}}class eF{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?_R:Q9(e)}moveTo(e,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,r){this._append`L${this._x1=+e},${this._y1=+r}`}quadraticCurveTo(e,r,n,i){this._append`Q${+e},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(e,r,n,i,a,o){this._append`C${+e},${+r},${+n},${+i},${this._x1=+a},${this._y1=+o}`}arcTo(e,r,n,i,a){if(e=+e,r=+r,n=+n,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,l=this._y1,u=n-e,d=i-r,p=o-e,f=l-r,g=p*p+f*f;if(this._x1===null)this._append`M${this._x1=e},${this._y1=r}`;else if(g>bo)if(!(Math.abs(f*u-d*p)>bo)||!a)this._append`L${this._x1=e},${this._y1=r}`;else{let v=n-o,x=i-l,_=u*u+d*d,b=v*v+x*x,k=Math.sqrt(_),A=Math.sqrt(g),O=a*Math.tan((lx-Math.acos((_+g-b)/(2*k*A)))/2),C=O/A,E=O/k;Math.abs(C-1)>bo&&this._append`L${e+C*p},${r+C*f}`,this._append`A${a},${a},0,0,${+(f*v>p*x)},${this._x1=e+E*u},${this._y1=r+E*d}`}}arc(e,r,n,i,a,o){if(e=+e,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(i),u=n*Math.sin(i),d=e+l,p=r+u,f=1^o,g=o?i-a:a-i;this._x1===null?this._append`M${d},${p}`:(Math.abs(this._x1-d)>bo||Math.abs(this._y1-p)>bo)&&this._append`L${d},${p}`,n&&(g<0&&(g=g%cx+cx),g>Z9?this._append`A${n},${n},0,1,${f},${e-l},${r-u}A${n},${n},0,1,${f},${this._x1=d},${this._y1=p}`:g>bo&&this._append`A${n},${n},0,${+(g>=lx)},${f},${this._x1=e+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(e,r,n,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function i1(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(r==null)e=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);e=n}return t},()=>new eF(e)}function a1(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function SR(t){this._context=t}SR.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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function up(t){return new SR(t)}function kR(t){return t[0]}function ER(t){return t[1]}function OR(t,e){var r=Tt(!0),n=null,i=up,a=null,o=i1(l);t=typeof t=="function"?t:t===void 0?kR:Tt(t),e=typeof e=="function"?e:e===void 0?ER:Tt(e);function l(u){var d,p=(u=a1(u)).length,f,g=!1,v;for(n==null&&(a=i(v=o())),d=0;d<=p;++d)!(d<p&&r(f=u[d],d,u))===g&&((g=!g)?a.lineStart():a.lineEnd()),g&&a.point(+t(f,d,u),+e(f,d,u));if(v)return a=null,v+""||null}return l.x=function(u){return arguments.length?(t=typeof u=="function"?u:Tt(+u),l):t},l.y=function(u){return arguments.length?(e=typeof u=="function"?u:Tt(+u),l):e},l.defined=function(u){return arguments.length?(r=typeof u=="function"?u:Tt(!!u),l):r},l.curve=function(u){return arguments.length?(i=u,n!=null&&(a=i(n)),l):i},l.context=function(u){return arguments.length?(u==null?n=a=null:a=i(n=u),l):n},l}function df(t,e,r){var n=null,i=Tt(!0),a=null,o=up,l=null,u=i1(d);t=typeof t=="function"?t:t===void 0?kR:Tt(+t),e=typeof e=="function"?e:Tt(e===void 0?0:+e),r=typeof r=="function"?r:r===void 0?ER:Tt(+r);function d(f){var g,v,x,_=(f=a1(f)).length,b,k=!1,A,O=new Array(_),C=new Array(_);for(a==null&&(l=o(A=u())),g=0;g<=_;++g){if(!(g<_&&i(b=f[g],g,f))===k)if(k=!k)v=g,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),x=g-1;x>=v;--x)l.point(O[x],C[x]);l.lineEnd(),l.areaEnd()}k&&(O[g]=+t(b,g,f),C[g]=+e(b,g,f),l.point(n?+n(b,g,f):O[g],r?+r(b,g,f):C[g]))}if(A)return l=null,A+""||null}function p(){return OR().defined(i).curve(o).context(a)}return d.x=function(f){return arguments.length?(t=typeof f=="function"?f:Tt(+f),n=null,d):t},d.x0=function(f){return arguments.length?(t=typeof f=="function"?f:Tt(+f),d):t},d.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Tt(+f),d):n},d.y=function(f){return arguments.length?(e=typeof f=="function"?f:Tt(+f),r=null,d):e},d.y0=function(f){return arguments.length?(e=typeof f=="function"?f:Tt(+f),d):e},d.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Tt(+f),d):r},d.lineX0=d.lineY0=function(){return p().x(t).y(e)},d.lineY1=function(){return p().x(t).y(r)},d.lineX1=function(){return p().x(n).y(e)},d.defined=function(f){return arguments.length?(i=typeof f=="function"?f:Tt(!!f),d):i},d.curve=function(f){return arguments.length?(o=f,a!=null&&(l=o(a)),d):o},d.context=function(f){return arguments.length?(f==null?a=l=null:l=o(a=f),d):a},d}class AR{constructor(e,r){this._context=e,this._x=r}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(e,r){switch(e=+e,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,r,e,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,e,this._y0,e,r);break}}this._x0=e,this._y0=r}}function tF(t){return new AR(t,!0)}function rF(t){return new AR(t,!1)}const o1={draw(t,e){const r=ri(e/Vf);t.moveTo(r,0),t.arc(0,0,r,0,cp)}},nF={draw(t,e){const r=ri(e/5)/2;t.moveTo(-3*r,-r),t.lineTo(-r,-r),t.lineTo(-r,-3*r),t.lineTo(r,-3*r),t.lineTo(r,-r),t.lineTo(3*r,-r),t.lineTo(3*r,r),t.lineTo(r,r),t.lineTo(r,3*r),t.lineTo(-r,3*r),t.lineTo(-r,r),t.lineTo(-3*r,r),t.closePath()}},TR=ri(1/3),iF=TR*2,aF={draw(t,e){const r=ri(e/iF),n=r*TR;t.moveTo(0,-r),t.lineTo(n,0),t.lineTo(0,r),t.lineTo(-n,0),t.closePath()}},oF={draw(t,e){const r=ri(e),n=-r/2;t.rect(n,n,r,r)}},sF=.8908130915292852,CR=Kf(Vf/10)/Kf(7*Vf/10),lF=Kf(cp/10)*CR,cF=-wR(cp/10)*CR,uF={draw(t,e){const r=ri(e*sF),n=lF*r,i=cF*r;t.moveTo(0,-r),t.lineTo(n,i);for(let a=1;a<5;++a){const o=cp*a/5,l=wR(o),u=Kf(o);t.lineTo(u*r,-l*r),t.lineTo(l*n-u*i,u*n+l*i)}t.closePath()}},Hy=ri(3),dF={draw(t,e){const r=-ri(e/(Hy*3));t.moveTo(0,r*2),t.lineTo(-Hy*r,-r),t.lineTo(Hy*r,-r),t.closePath()}},Sn=-.5,kn=ri(3)/2,ux=1/ri(12),fF=(ux/2+1)*3,hF={draw(t,e){const r=ri(e/fF),n=r/2,i=r*ux,a=n,o=r*ux+r,l=-a,u=o;t.moveTo(n,i),t.lineTo(a,o),t.lineTo(l,u),t.lineTo(Sn*n-kn*i,kn*n+Sn*i),t.lineTo(Sn*a-kn*o,kn*a+Sn*o),t.lineTo(Sn*l-kn*u,kn*l+Sn*u),t.lineTo(Sn*n+kn*i,Sn*i-kn*n),t.lineTo(Sn*a+kn*o,Sn*o-kn*a),t.lineTo(Sn*l+kn*u,Sn*u-kn*l),t.closePath()}};function pF(t,e){let r=null,n=i1(i);t=typeof t=="function"?t:Tt(t||o1),e=typeof e=="function"?e:Tt(e===void 0?64:+e);function i(){let a;if(r||(r=a=n()),t.apply(this,arguments).draw(r,+e.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(t=typeof a=="function"?a:Tt(a),i):t},i.size=function(a){return arguments.length?(e=typeof a=="function"?a:Tt(+a),i):e},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function Xf(){}function Yf(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function jR(t){this._context=t}jR.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:Yf(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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);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:Yf(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function mF(t){return new jR(t)}function PR(t){this._context=t}PR.prototype={areaStart:Xf,areaEnd:Xf,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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Yf(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function gF(t){return new PR(t)}function NR(t){this._context=t}NR.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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Yf(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function yF(t){return new NR(t)}function RR(t){this._context=t}RR.prototype={areaStart:Xf,areaEnd:Xf,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function vF(t){return new RR(t)}function eA(t){return t<0?-1:1}function tA(t,e,r){var n=t._x1-t._x0,i=e-t._x1,a=(t._y1-t._y0)/(n||i<0&&-0),o=(r-t._y1)/(i||n<0&&-0),l=(a*i+o*n)/(n+i);return(eA(a)+eA(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function rA(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function Wy(t,e,r){var n=t._x0,i=t._y0,a=t._x1,o=t._y1,l=(a-n)/3;t._context.bezierCurveTo(n+l,i+l*e,a-l,o-l*r,a,o)}function Jf(t){this._context=t}Jf.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:Wy(this,this._t0,rA(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Wy(this,rA(this,r=tA(this,t,e)),r);break;default:Wy(this,this._t0,r=tA(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function IR(t){this._context=new $R(t)}(IR.prototype=Object.create(Jf.prototype)).point=function(t,e){Jf.prototype.point.call(this,e,t)};function $R(t){this._context=t}$R.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,n,i,a){this._context.bezierCurveTo(e,t,n,r,a,i)}};function bF(t){return new Jf(t)}function xF(t){return new IR(t)}function MR(t){this._context=t}MR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),r===2)this._context.lineTo(t[1],e[1]);else for(var n=nA(t),i=nA(e),a=0,o=1;o<r;++a,++o)this._context.bezierCurveTo(n[0][a],i[0][a],n[1][a],i[1][a],t[o],e[o]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function nA(t){var e,r=t.length-1,n,i=new Array(r),a=new Array(r),o=new Array(r);for(i[0]=0,a[0]=2,o[0]=t[0]+2*t[1],e=1;e<r-1;++e)i[e]=1,a[e]=4,o[e]=4*t[e]+2*t[e+1];for(i[r-1]=2,a[r-1]=7,o[r-1]=8*t[r-1]+t[r],e=1;e<r;++e)n=i[e]/a[e-1],a[e]-=n,o[e]-=n*o[e-1];for(i[r-1]=o[r-1]/a[r-1],e=r-2;e>=0;--e)i[e]=(o[e]-i[e+1])/a[e];for(a[r-1]=(t[r]+i[r-1])/2,e=0;e<r-1;++e)a[e]=2*t[e+1]-i[e+1];return[i,a]}function wF(t){return new MR(t)}function dp(t,e){this._context=t,this._t=e}dp.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(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}break}}this._x=t,this._y=e}};function _F(t){return new dp(t,.5)}function SF(t){return new dp(t,0)}function kF(t){return new dp(t,1)}function Hs(t,e){if((o=t.length)>1)for(var r=1,n,i,a=t[e[0]],o,l=a.length;r<o;++r)for(i=a,a=t[e[r]],n=0;n<l;++n)a[n][1]+=a[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function dx(t){for(var e=t.length,r=new Array(e);--e>=0;)r[e]=e;return r}function EF(t,e){return t[e]}function OF(t){const e=[];return e.key=t,e}function AF(){var t=Tt([]),e=dx,r=Hs,n=EF;function i(a){var o=Array.from(t.apply(this,arguments),OF),l,u=o.length,d=-1,p;for(const f of a)for(l=0,++d;l<u;++l)(o[l][d]=[0,+n(f,o[l].key,d,a)]).data=f;for(l=0,p=a1(e(o));l<u;++l)o[p[l]].index=l;return r(o,p),o}return i.keys=function(a){return arguments.length?(t=typeof a=="function"?a:Tt(Array.from(a)),i):t},i.value=function(a){return arguments.length?(n=typeof a=="function"?a:Tt(+a),i):n},i.order=function(a){return arguments.length?(e=a==null?dx:typeof a=="function"?a:Tt(Array.from(a)),i):e},i.offset=function(a){return arguments.length?(r=a??Hs,i):r},i}function TF(t,e){if((n=t.length)>0){for(var r,n,i=0,a=t[0].length,o;i<a;++i){for(o=r=0;r<n;++r)o+=t[r][i][1]||0;if(o)for(r=0;r<n;++r)t[r][i][1]/=o}Hs(t,e)}}function CF(t,e){if((i=t.length)>0){for(var r=0,n=t[e[0]],i,a=n.length;r<a;++r){for(var o=0,l=0;o<i;++o)l+=t[o][r][1]||0;n[r][1]+=n[r][0]=-l/2}Hs(t,e)}}function jF(t,e){if(!(!((o=t.length)>0)||!((a=(i=t[e[0]]).length)>0))){for(var r=0,n=1,i,a,o;n<a;++n){for(var l=0,u=0,d=0;l<o;++l){for(var p=t[e[l]],f=p[n][1]||0,g=p[n-1][1]||0,v=(f-g)/2,x=0;x<l;++x){var _=t[e[x]],b=_[n][1]||0,k=_[n-1][1]||0;v+=b-k}u+=f,d+=v*f}i[n-1][1]+=i[n-1][0]=r,u&&(r-=d/u)}i[n-1][1]+=i[n-1][0]=r,Hs(t,e)}}function Hc(t){"@babel/helpers - typeof";return Hc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hc(t)}var PF=["type","size","sizeType"];function fx(){return fx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},fx.apply(this,arguments)}function iA(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function aA(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?iA(Object(r),!0).forEach(function(n){NF(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):iA(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function NF(t,e,r){return e=RF(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function RF(t){var e=IF(t,"string");return Hc(e)=="symbol"?e:e+""}function IF(t,e){if(Hc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Hc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function $F(t,e){if(t==null)return{};var r=MF(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function MF(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var LR={symbolCircle:o1,symbolCross:nF,symbolDiamond:aF,symbolSquare:oF,symbolStar:uF,symbolTriangle:dF,symbolWye:hF},LF=Math.PI/180,DF=function(e){var r="symbol".concat(lp(e));return LR[r]||o1},zF=function(e,r,n){if(r==="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 i=18*LF;return 1.25*e*e*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),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}},BF=function(e,r){LR["symbol".concat(lp(e))]=r},s1=function(e){var r=e.type,n=r===void 0?"circle":r,i=e.size,a=i===void 0?64:i,o=e.sizeType,l=o===void 0?"area":o,u=$F(e,PF),d=aA(aA({},u),{},{type:n,size:a,sizeType:l}),p=function(){var b=DF(n),k=pF().type(b).size(zF(a,l,n));return k()},f=d.className,g=d.cx,v=d.cy,x=it(d,!0);return g===+g&&v===+v&&a===+a?$.createElement("path",fx({},x,{className:at("recharts-symbols",f),transform:"translate(".concat(g,", ").concat(v,")"),d:p()})):null};s1.registerSymbol=BF;function Ws(t){"@babel/helpers - typeof";return Ws=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ws(t)}function hx(){return hx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},hx.apply(this,arguments)}function oA(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function UF(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?oA(Object(r),!0).forEach(function(n){Wc(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):oA(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function qF(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function FF(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,zR(n.key),n)}}function HF(t,e,r){return e&&FF(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function WF(t,e,r){return e=Zf(e),GF(t,DR()?Reflect.construct(e,r||[],Zf(t).constructor):e.apply(t,r))}function GF(t,e){if(e&&(Ws(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return KF(t)}function KF(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function DR(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(DR=function(){return!!t})()}function Zf(t){return Zf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Zf(t)}function VF(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&px(t,e)}function px(t,e){return px=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},px(t,e)}function Wc(t,e,r){return e=zR(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function zR(t){var e=XF(t,"string");return Ws(e)=="symbol"?e:e+""}function XF(t,e){if(Ws(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Ws(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var En=32,l1=(function(t){function e(){return qF(this,e),WF(this,e,arguments)}return VF(e,t),HF(e,[{key:"renderIcon",value:function(n){var i=this.props.inactiveColor,a=En/2,o=En/6,l=En/3,u=n.inactive?i:n.color;if(n.type==="plainline")return $.createElement("line",{strokeWidth:4,fill:"none",stroke:u,strokeDasharray:n.payload.strokeDasharray,x1:0,y1:a,x2:En,y2:a,className:"recharts-legend-icon"});if(n.type==="line")return $.createElement("path",{strokeWidth:4,fill:"none",stroke:u,d:"M0,".concat(a,"h").concat(l,`
443
+ A`).concat(o,",").concat(o,",0,1,1,").concat(2*l,",").concat(a,`
444
+ H`).concat(En,"M").concat(2*l,",").concat(a,`
445
+ A`).concat(o,",").concat(o,",0,1,1,").concat(l,",").concat(a),className:"recharts-legend-icon"});if(n.type==="rect")return $.createElement("path",{stroke:"none",fill:u,d:"M0,".concat(En/8,"h").concat(En,"v").concat(En*3/4,"h").concat(-En,"z"),className:"recharts-legend-icon"});if($.isValidElement(n.legendIcon)){var d=UF({},n);return delete d.legendIcon,$.cloneElement(n.legendIcon,d)}return $.createElement(s1,{fill:u,cx:a,cy:a,size:En,sizeType:"diameter",type:n.type})}},{key:"renderItems",value:function(){var n=this,i=this.props,a=i.payload,o=i.iconSize,l=i.layout,u=i.formatter,d=i.inactiveColor,p={x:0,y:0,width:En,height:En},f={display:l==="horizontal"?"inline-block":"block",marginRight:10},g={display:"inline-block",verticalAlign:"middle",marginRight:4};return a.map(function(v,x){var _=v.formatter||u,b=at(Wc(Wc({"recharts-legend-item":!0},"legend-item-".concat(x),!0),"inactive",v.inactive));if(v.type==="none")return null;var k=Ye(v.value)?null:v.value;Ki(!Ye(v.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var A=v.inactive?d:v.color;return $.createElement("li",hx({className:b,style:f,key:"legend-item-".concat(x)},Gf(n.props,v,x)),$.createElement(ox,{width:o,height:o,viewBox:p,style:g},n.renderIcon(v)),$.createElement("span",{className:"recharts-legend-item-text",style:{color:A}},_?_(k,v,x):k))})}},{key:"render",value:function(){var n=this.props,i=n.payload,a=n.layout,o=n.align;if(!i||!i.length)return null;var l={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return $.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])})(N.PureComponent);Wc(l1,"displayName","Legend");Wc(l1,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Gy,sA;function YF(){if(sA)return Gy;sA=1;var t=ap();function e(){this.__data__=new t,this.size=0}return Gy=e,Gy}var Ky,lA;function JF(){if(lA)return Ky;lA=1;function t(e){var r=this.__data__,n=r.delete(e);return this.size=r.size,n}return Ky=t,Ky}var Vy,cA;function ZF(){if(cA)return Vy;cA=1;function t(e){return this.__data__.get(e)}return Vy=t,Vy}var Xy,uA;function QF(){if(uA)return Xy;uA=1;function t(e){return this.__data__.has(e)}return Xy=t,Xy}var Yy,dA;function e7(){if(dA)return Yy;dA=1;var t=ap(),e=Zw(),r=Qw(),n=200;function i(a,o){var l=this.__data__;if(l instanceof t){var u=l.__data__;if(!e||u.length<n-1)return u.push([a,o]),this.size=++l.size,this;l=this.__data__=new r(u)}return l.set(a,o),this.size=l.size,this}return Yy=i,Yy}var Jy,fA;function BR(){if(fA)return Jy;fA=1;var t=ap(),e=YF(),r=JF(),n=ZF(),i=QF(),a=e7();function o(l){var u=this.__data__=new t(l);this.size=u.size}return o.prototype.clear=e,o.prototype.delete=r,o.prototype.get=n,o.prototype.has=i,o.prototype.set=a,Jy=o,Jy}var Zy,hA;function t7(){if(hA)return Zy;hA=1;var t="__lodash_hash_undefined__";function e(r){return this.__data__.set(r,t),this}return Zy=e,Zy}var Qy,pA;function r7(){if(pA)return Qy;pA=1;function t(e){return this.__data__.has(e)}return Qy=t,Qy}var ev,mA;function UR(){if(mA)return ev;mA=1;var t=Qw(),e=t7(),r=r7();function n(i){var a=-1,o=i==null?0:i.length;for(this.__data__=new t;++a<o;)this.add(i[a])}return n.prototype.add=n.prototype.push=e,n.prototype.has=r,ev=n,ev}var tv,gA;function qR(){if(gA)return tv;gA=1;function t(e,r){for(var n=-1,i=e==null?0:e.length;++n<i;)if(r(e[n],n,e))return!0;return!1}return tv=t,tv}var rv,yA;function FR(){if(yA)return rv;yA=1;function t(e,r){return e.has(r)}return rv=t,rv}var nv,vA;function HR(){if(vA)return nv;vA=1;var t=UR(),e=qR(),r=FR(),n=1,i=2;function a(o,l,u,d,p,f){var g=u&n,v=o.length,x=l.length;if(v!=x&&!(g&&x>v))return!1;var _=f.get(o),b=f.get(l);if(_&&b)return _==l&&b==o;var k=-1,A=!0,O=u&i?new t:void 0;for(f.set(o,l),f.set(l,o);++k<v;){var C=o[k],E=l[k];if(d)var T=g?d(E,C,k,l,o,f):d(C,E,k,o,l,f);if(T!==void 0){if(T)continue;A=!1;break}if(O){if(!e(l,function(P,R){if(!r(O,R)&&(C===P||p(C,P,u,d,f)))return O.push(R)})){A=!1;break}}else if(!(C===E||p(C,E,u,d,f))){A=!1;break}}return f.delete(o),f.delete(l),A}return nv=a,nv}var iv,bA;function n7(){if(bA)return iv;bA=1;var t=Ei(),e=t.Uint8Array;return iv=e,iv}var av,xA;function i7(){if(xA)return av;xA=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(i,a){n[++r]=[a,i]}),n}return av=t,av}var ov,wA;function c1(){if(wA)return ov;wA=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(i){n[++r]=i}),n}return ov=t,ov}var sv,_A;function a7(){if(_A)return sv;_A=1;var t=Nu(),e=n7(),r=Jw(),n=HR(),i=i7(),a=c1(),o=1,l=2,u="[object Boolean]",d="[object Date]",p="[object Error]",f="[object Map]",g="[object Number]",v="[object RegExp]",x="[object Set]",_="[object String]",b="[object Symbol]",k="[object ArrayBuffer]",A="[object DataView]",O=t?t.prototype:void 0,C=O?O.valueOf:void 0;function E(T,P,R,I,Y,W,B){switch(R){case A:if(T.byteLength!=P.byteLength||T.byteOffset!=P.byteOffset)return!1;T=T.buffer,P=P.buffer;case k:return!(T.byteLength!=P.byteLength||!W(new e(T),new e(P)));case u:case d:case g:return r(+T,+P);case p:return T.name==P.name&&T.message==P.message;case v:case _:return T==P+"";case f:var X=i;case x:var K=I&o;if(X||(X=a),T.size!=P.size&&!K)return!1;var U=B.get(T);if(U)return U==P;I|=l,B.set(T,P);var G=n(X(T),X(P),I,Y,W,B);return B.delete(T),G;case b:if(C)return C.call(T)==C.call(P)}return!1}return sv=E,sv}var lv,SA;function WR(){if(SA)return lv;SA=1;function t(e,r){for(var n=-1,i=r.length,a=e.length;++n<i;)e[a+n]=r[n];return e}return lv=t,lv}var cv,kA;function o7(){if(kA)return cv;kA=1;var t=WR(),e=Zr();function r(n,i,a){var o=i(n);return e(n)?o:t(o,a(n))}return cv=r,cv}var uv,EA;function s7(){if(EA)return uv;EA=1;function t(e,r){for(var n=-1,i=e==null?0:e.length,a=0,o=[];++n<i;){var l=e[n];r(l,n,e)&&(o[a++]=l)}return o}return uv=t,uv}var dv,OA;function l7(){if(OA)return dv;OA=1;function t(){return[]}return dv=t,dv}var fv,AA;function c7(){if(AA)return fv;AA=1;var t=s7(),e=l7(),r=Object.prototype,n=r.propertyIsEnumerable,i=Object.getOwnPropertySymbols,a=i?function(o){return o==null?[]:(o=Object(o),t(i(o),function(l){return n.call(o,l)}))}:e;return fv=a,fv}var hv,TA;function u7(){if(TA)return hv;TA=1;function t(e,r){for(var n=-1,i=Array(e);++n<e;)i[n]=r(n);return i}return hv=t,hv}var pv,CA;function d7(){if(CA)return pv;CA=1;var t=ra(),e=na(),r="[object Arguments]";function n(i){return e(i)&&t(i)==r}return pv=n,pv}var mv,jA;function u1(){if(jA)return mv;jA=1;var t=d7(),e=na(),r=Object.prototype,n=r.hasOwnProperty,i=r.propertyIsEnumerable,a=t((function(){return arguments})())?t:function(o){return e(o)&&n.call(o,"callee")&&!i.call(o,"callee")};return mv=a,mv}var Oc={exports:{}},gv,PA;function f7(){if(PA)return gv;PA=1;function t(){return!1}return gv=t,gv}Oc.exports;var NA;function GR(){return NA||(NA=1,(function(t,e){var r=Ei(),n=f7(),i=e&&!e.nodeType&&e,a=i&&!0&&t&&!t.nodeType&&t,o=a&&a.exports===i,l=o?r.Buffer:void 0,u=l?l.isBuffer:void 0,d=u||n;t.exports=d})(Oc,Oc.exports)),Oc.exports}var yv,RA;function d1(){if(RA)return yv;RA=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function r(n,i){var a=typeof n;return i=i??t,!!i&&(a=="number"||a!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<i}return yv=r,yv}var vv,IA;function f1(){if(IA)return vv;IA=1;var t=9007199254740991;function e(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=t}return vv=e,vv}var bv,$A;function h7(){if($A)return bv;$A=1;var t=ra(),e=f1(),r=na(),n="[object Arguments]",i="[object Array]",a="[object Boolean]",o="[object Date]",l="[object Error]",u="[object Function]",d="[object Map]",p="[object Number]",f="[object Object]",g="[object RegExp]",v="[object Set]",x="[object String]",_="[object WeakMap]",b="[object ArrayBuffer]",k="[object DataView]",A="[object Float32Array]",O="[object Float64Array]",C="[object Int8Array]",E="[object Int16Array]",T="[object Int32Array]",P="[object Uint8Array]",R="[object Uint8ClampedArray]",I="[object Uint16Array]",Y="[object Uint32Array]",W={};W[A]=W[O]=W[C]=W[E]=W[T]=W[P]=W[R]=W[I]=W[Y]=!0,W[n]=W[i]=W[b]=W[a]=W[k]=W[o]=W[l]=W[u]=W[d]=W[p]=W[f]=W[g]=W[v]=W[x]=W[_]=!1;function B(X){return r(X)&&e(X.length)&&!!W[t(X)]}return bv=B,bv}var xv,MA;function KR(){if(MA)return xv;MA=1;function t(e){return function(r){return e(r)}}return xv=t,xv}var Ac={exports:{}};Ac.exports;var LA;function p7(){return LA||(LA=1,(function(t,e){var r=hR(),n=e&&!e.nodeType&&e,i=n&&!0&&t&&!t.nodeType&&t,a=i&&i.exports===n,o=a&&r.process,l=(function(){try{var u=i&&i.require&&i.require("util").types;return u||o&&o.binding&&o.binding("util")}catch{}})();t.exports=l})(Ac,Ac.exports)),Ac.exports}var wv,DA;function VR(){if(DA)return wv;DA=1;var t=h7(),e=KR(),r=p7(),n=r&&r.isTypedArray,i=n?e(n):t;return wv=i,wv}var _v,zA;function m7(){if(zA)return _v;zA=1;var t=u7(),e=u1(),r=Zr(),n=GR(),i=d1(),a=VR(),o=Object.prototype,l=o.hasOwnProperty;function u(d,p){var f=r(d),g=!f&&e(d),v=!f&&!g&&n(d),x=!f&&!g&&!v&&a(d),_=f||g||v||x,b=_?t(d.length,String):[],k=b.length;for(var A in d)(p||l.call(d,A))&&!(_&&(A=="length"||v&&(A=="offset"||A=="parent")||x&&(A=="buffer"||A=="byteLength"||A=="byteOffset")||i(A,k)))&&b.push(A);return b}return _v=u,_v}var Sv,BA;function g7(){if(BA)return Sv;BA=1;var t=Object.prototype;function e(r){var n=r&&r.constructor,i=typeof n=="function"&&n.prototype||t;return r===i}return Sv=e,Sv}var kv,UA;function XR(){if(UA)return kv;UA=1;function t(e,r){return function(n){return e(r(n))}}return kv=t,kv}var Ev,qA;function y7(){if(qA)return Ev;qA=1;var t=XR(),e=t(Object.keys,Object);return Ev=e,Ev}var Ov,FA;function v7(){if(FA)return Ov;FA=1;var t=g7(),e=y7(),r=Object.prototype,n=r.hasOwnProperty;function i(a){if(!t(a))return e(a);var o=[];for(var l in Object(a))n.call(a,l)&&l!="constructor"&&o.push(l);return o}return Ov=i,Ov}var Av,HA;function $u(){if(HA)return Av;HA=1;var t=Yw(),e=f1();function r(n){return n!=null&&e(n.length)&&!t(n)}return Av=r,Av}var Tv,WA;function fp(){if(WA)return Tv;WA=1;var t=m7(),e=v7(),r=$u();function n(i){return r(i)?t(i):e(i)}return Tv=n,Tv}var Cv,GA;function b7(){if(GA)return Cv;GA=1;var t=o7(),e=c7(),r=fp();function n(i){return t(i,r,e)}return Cv=n,Cv}var jv,KA;function x7(){if(KA)return jv;KA=1;var t=b7(),e=1,r=Object.prototype,n=r.hasOwnProperty;function i(a,o,l,u,d,p){var f=l&e,g=t(a),v=g.length,x=t(o),_=x.length;if(v!=_&&!f)return!1;for(var b=v;b--;){var k=g[b];if(!(f?k in o:n.call(o,k)))return!1}var A=p.get(a),O=p.get(o);if(A&&O)return A==o&&O==a;var C=!0;p.set(a,o),p.set(o,a);for(var E=f;++b<v;){k=g[b];var T=a[k],P=o[k];if(u)var R=f?u(P,T,k,o,a,p):u(T,P,k,a,o,p);if(!(R===void 0?T===P||d(T,P,l,u,p):R)){C=!1;break}E||(E=k=="constructor")}if(C&&!E){var I=a.constructor,Y=o.constructor;I!=Y&&"constructor"in a&&"constructor"in o&&!(typeof I=="function"&&I instanceof I&&typeof Y=="function"&&Y instanceof Y)&&(C=!1)}return p.delete(a),p.delete(o),C}return jv=i,jv}var Pv,VA;function w7(){if(VA)return Pv;VA=1;var t=Bo(),e=Ei(),r=t(e,"DataView");return Pv=r,Pv}var Nv,XA;function _7(){if(XA)return Nv;XA=1;var t=Bo(),e=Ei(),r=t(e,"Promise");return Nv=r,Nv}var Rv,YA;function YR(){if(YA)return Rv;YA=1;var t=Bo(),e=Ei(),r=t(e,"Set");return Rv=r,Rv}var Iv,JA;function S7(){if(JA)return Iv;JA=1;var t=Bo(),e=Ei(),r=t(e,"WeakMap");return Iv=r,Iv}var $v,ZA;function k7(){if(ZA)return $v;ZA=1;var t=w7(),e=Zw(),r=_7(),n=YR(),i=S7(),a=ra(),o=pR(),l="[object Map]",u="[object Object]",d="[object Promise]",p="[object Set]",f="[object WeakMap]",g="[object DataView]",v=o(t),x=o(e),_=o(r),b=o(n),k=o(i),A=a;return(t&&A(new t(new ArrayBuffer(1)))!=g||e&&A(new e)!=l||r&&A(r.resolve())!=d||n&&A(new n)!=p||i&&A(new i)!=f)&&(A=function(O){var C=a(O),E=C==u?O.constructor:void 0,T=E?o(E):"";if(T)switch(T){case v:return g;case x:return l;case _:return d;case b:return p;case k:return f}return C}),$v=A,$v}var Mv,QA;function E7(){if(QA)return Mv;QA=1;var t=BR(),e=HR(),r=a7(),n=x7(),i=k7(),a=Zr(),o=GR(),l=VR(),u=1,d="[object Arguments]",p="[object Array]",f="[object Object]",g=Object.prototype,v=g.hasOwnProperty;function x(_,b,k,A,O,C){var E=a(_),T=a(b),P=E?p:i(_),R=T?p:i(b);P=P==d?f:P,R=R==d?f:R;var I=P==f,Y=R==f,W=P==R;if(W&&o(_)){if(!o(b))return!1;E=!0,I=!1}if(W&&!I)return C||(C=new t),E||l(_)?e(_,b,k,A,O,C):r(_,b,P,k,A,O,C);if(!(k&u)){var B=I&&v.call(_,"__wrapped__"),X=Y&&v.call(b,"__wrapped__");if(B||X){var K=B?_.value():_,U=X?b.value():b;return C||(C=new t),O(K,U,k,A,C)}}return W?(C||(C=new t),n(_,b,k,A,O,C)):!1}return Mv=x,Mv}var Lv,eT;function h1(){if(eT)return Lv;eT=1;var t=E7(),e=na();function r(n,i,a,o,l){return n===i?!0:n==null||i==null||!e(n)&&!e(i)?n!==n&&i!==i:t(n,i,a,o,r,l)}return Lv=r,Lv}var Dv,tT;function O7(){if(tT)return Dv;tT=1;var t=BR(),e=h1(),r=1,n=2;function i(a,o,l,u){var d=l.length,p=d,f=!u;if(a==null)return!p;for(a=Object(a);d--;){var g=l[d];if(f&&g[2]?g[1]!==a[g[0]]:!(g[0]in a))return!1}for(;++d<p;){g=l[d];var v=g[0],x=a[v],_=g[1];if(f&&g[2]){if(x===void 0&&!(v in a))return!1}else{var b=new t;if(u)var k=u(x,_,v,a,o,b);if(!(k===void 0?e(_,x,r|n,u,b):k))return!1}}return!0}return Dv=i,Dv}var zv,rT;function JR(){if(rT)return zv;rT=1;var t=qa();function e(r){return r===r&&!t(r)}return zv=e,zv}var Bv,nT;function A7(){if(nT)return Bv;nT=1;var t=JR(),e=fp();function r(n){for(var i=e(n),a=i.length;a--;){var o=i[a],l=n[o];i[a]=[o,l,t(l)]}return i}return Bv=r,Bv}var Uv,iT;function ZR(){if(iT)return Uv;iT=1;function t(e,r){return function(n){return n==null?!1:n[e]===r&&(r!==void 0||e in Object(n))}}return Uv=t,Uv}var qv,aT;function T7(){if(aT)return qv;aT=1;var t=O7(),e=A7(),r=ZR();function n(i){var a=e(i);return a.length==1&&a[0][2]?r(a[0][0],a[0][1]):function(o){return o===i||t(o,i,a)}}return qv=n,qv}var Fv,oT;function C7(){if(oT)return Fv;oT=1;function t(e,r){return e!=null&&r in Object(e)}return Fv=t,Fv}var Hv,sT;function j7(){if(sT)return Hv;sT=1;var t=yR(),e=u1(),r=Zr(),n=d1(),i=f1(),a=sp();function o(l,u,d){u=t(u,l);for(var p=-1,f=u.length,g=!1;++p<f;){var v=a(u[p]);if(!(g=l!=null&&d(l,v)))break;l=l[v]}return g||++p!=f?g:(f=l==null?0:l.length,!!f&&i(f)&&n(v,f)&&(r(l)||e(l)))}return Hv=o,Hv}var Wv,lT;function P7(){if(lT)return Wv;lT=1;var t=C7(),e=j7();function r(n,i){return n!=null&&e(n,i,t)}return Wv=r,Wv}var Gv,cT;function N7(){if(cT)return Gv;cT=1;var t=h1(),e=vR(),r=P7(),n=Xw(),i=JR(),a=ZR(),o=sp(),l=1,u=2;function d(p,f){return n(p)&&i(f)?a(o(p),f):function(g){var v=e(g,p);return v===void 0&&v===f?r(g,p):t(f,v,l|u)}}return Gv=d,Gv}var Kv,uT;function xl(){if(uT)return Kv;uT=1;function t(e){return e}return Kv=t,Kv}var Vv,dT;function R7(){if(dT)return Vv;dT=1;function t(e){return function(r){return r==null?void 0:r[e]}}return Vv=t,Vv}var Xv,fT;function I7(){if(fT)return Xv;fT=1;var t=t1();function e(r){return function(n){return t(n,r)}}return Xv=e,Xv}var Yv,hT;function $7(){if(hT)return Yv;hT=1;var t=R7(),e=I7(),r=Xw(),n=sp();function i(a){return r(a)?t(n(a)):e(a)}return Yv=i,Yv}var Jv,pT;function Fa(){if(pT)return Jv;pT=1;var t=T7(),e=N7(),r=xl(),n=Zr(),i=$7();function a(o){return typeof o=="function"?o:o==null?r:typeof o=="object"?n(o)?e(o[0],o[1]):t(o):i(o)}return Jv=a,Jv}var Zv,mT;function QR(){if(mT)return Zv;mT=1;function t(e,r,n,i){for(var a=e.length,o=n+(i?1:-1);i?o--:++o<a;)if(r(e[o],o,e))return o;return-1}return Zv=t,Zv}var Qv,gT;function M7(){if(gT)return Qv;gT=1;function t(e){return e!==e}return Qv=t,Qv}var e0,yT;function L7(){if(yT)return e0;yT=1;function t(e,r,n){for(var i=n-1,a=e.length;++i<a;)if(e[i]===r)return i;return-1}return e0=t,e0}var t0,vT;function D7(){if(vT)return t0;vT=1;var t=QR(),e=M7(),r=L7();function n(i,a,o){return a===a?r(i,a,o):t(i,e,o)}return t0=n,t0}var r0,bT;function z7(){if(bT)return r0;bT=1;var t=D7();function e(r,n){var i=r==null?0:r.length;return!!i&&t(r,n,0)>-1}return r0=e,r0}var n0,xT;function B7(){if(xT)return n0;xT=1;function t(e,r,n){for(var i=-1,a=e==null?0:e.length;++i<a;)if(n(r,e[i]))return!0;return!1}return n0=t,n0}var i0,wT;function U7(){if(wT)return i0;wT=1;function t(){}return i0=t,i0}var a0,_T;function q7(){if(_T)return a0;_T=1;var t=YR(),e=U7(),r=c1(),n=1/0,i=t&&1/r(new t([,-0]))[1]==n?function(a){return new t(a)}:e;return a0=i,a0}var o0,ST;function F7(){if(ST)return o0;ST=1;var t=UR(),e=z7(),r=B7(),n=FR(),i=q7(),a=c1(),o=200;function l(u,d,p){var f=-1,g=e,v=u.length,x=!0,_=[],b=_;if(p)x=!1,g=r;else if(v>=o){var k=d?null:i(u);if(k)return a(k);x=!1,g=n,b=new t}else b=d?[]:_;e:for(;++f<v;){var A=u[f],O=d?d(A):A;if(A=p||A!==0?A:0,x&&O===O){for(var C=b.length;C--;)if(b[C]===O)continue e;d&&b.push(O),_.push(A)}else g(b,O,p)||(b!==_&&b.push(O),_.push(A))}return _}return o0=l,o0}var s0,kT;function H7(){if(kT)return s0;kT=1;var t=Fa(),e=F7();function r(n,i){return n&&n.length?e(n,t(i,2)):[]}return s0=r,s0}var W7=H7();const ET=vt(W7);function eI(t,e,r){return e===!0?ET(t,r):Ye(e)?ET(t,e):t}function Gs(t){"@babel/helpers - typeof";return Gs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gs(t)}var G7=["ref"];function OT(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Di(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?OT(Object(r),!0).forEach(function(n){hp(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):OT(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function K7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function AT(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,rI(n.key),n)}}function V7(t,e,r){return e&&AT(t.prototype,e),r&&AT(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function X7(t,e,r){return e=Qf(e),Y7(t,tI()?Reflect.construct(e,r||[],Qf(t).constructor):e.apply(t,r))}function Y7(t,e){if(e&&(Gs(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return J7(t)}function J7(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function tI(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(tI=function(){return!!t})()}function Qf(t){return Qf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Qf(t)}function Z7(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&mx(t,e)}function mx(t,e){return mx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},mx(t,e)}function hp(t,e,r){return e=rI(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function rI(t){var e=Q7(t,"string");return Gs(e)=="symbol"?e:e+""}function Q7(t,e){if(Gs(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Gs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function eH(t,e){if(t==null)return{};var r=tH(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function tH(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function rH(t){return t.value}function nH(t,e){if($.isValidElement(t))return $.cloneElement(t,e);if(typeof t=="function")return $.createElement(t,e);e.ref;var r=eH(e,G7);return $.createElement(l1,r)}var TT=1,Bs=(function(t){function e(){var r;K7(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=X7(this,e,[].concat(i)),hp(r,"lastBoundingBox",{width:-1,height:-1}),r}return Z7(e,t),V7(e,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();return n.height=this.wrapperNode.offsetHeight,n.width=this.wrapperNode.offsetWidth,n}return null}},{key:"updateBBox",value:function(){var n=this.props.onBBoxUpdate,i=this.getBBox();i?(Math.abs(i.width-this.lastBoundingBox.width)>TT||Math.abs(i.height-this.lastBoundingBox.height)>TT)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Di({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,o=i.align,l=i.verticalAlign,u=i.margin,d=i.chartWidth,p=i.chartHeight,f,g;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&a==="vertical"){var v=this.getBBoxSnapshot();f={left:((d||0)-v.width)/2}}else f=o==="right"?{right:u&&u.right||0}:{left:u&&u.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(l==="middle"){var x=this.getBBoxSnapshot();g={top:((p||0)-x.height)/2}}else g=l==="bottom"?{bottom:u&&u.bottom||0}:{top:u&&u.top||0};return Di(Di({},f),g)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,o=i.width,l=i.height,u=i.wrapperStyle,d=i.payloadUniqBy,p=i.payload,f=Di(Di({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(u)),u);return $.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(v){n.wrapperNode=v}},nH(a,Di(Di({},this.props),{},{payload:eI(p,d,rH)})))}}],[{key:"getWithHeight",value:function(n,i){var a=Di(Di({},this.defaultProps),n.props),o=a.layout;return o==="vertical"&&ge(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])})(N.PureComponent);hp(Bs,"displayName","Legend");hp(Bs,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var l0,CT;function iH(){if(CT)return l0;CT=1;var t=Nu(),e=u1(),r=Zr(),n=t?t.isConcatSpreadable:void 0;function i(a){return r(a)||e(a)||!!(n&&a&&a[n])}return l0=i,l0}var c0,jT;function nI(){if(jT)return c0;jT=1;var t=WR(),e=iH();function r(n,i,a,o,l){var u=-1,d=n.length;for(a||(a=e),l||(l=[]);++u<d;){var p=n[u];i>0&&a(p)?i>1?r(p,i-1,a,o,l):t(l,p):o||(l[l.length]=p)}return l}return c0=r,c0}var u0,PT;function aH(){if(PT)return u0;PT=1;function t(e){return function(r,n,i){for(var a=-1,o=Object(r),l=i(r),u=l.length;u--;){var d=l[e?u:++a];if(n(o[d],d,o)===!1)break}return r}}return u0=t,u0}var d0,NT;function oH(){if(NT)return d0;NT=1;var t=aH(),e=t();return d0=e,d0}var f0,RT;function iI(){if(RT)return f0;RT=1;var t=oH(),e=fp();function r(n,i){return n&&t(n,i,e)}return f0=r,f0}var h0,IT;function sH(){if(IT)return h0;IT=1;var t=$u();function e(r,n){return function(i,a){if(i==null)return i;if(!t(i))return r(i,a);for(var o=i.length,l=n?o:-1,u=Object(i);(n?l--:++l<o)&&a(u[l],l,u)!==!1;);return i}}return h0=e,h0}var p0,$T;function p1(){if($T)return p0;$T=1;var t=iI(),e=sH(),r=e(t);return p0=r,p0}var m0,MT;function aI(){if(MT)return m0;MT=1;var t=p1(),e=$u();function r(n,i){var a=-1,o=e(n)?Array(n.length):[];return t(n,function(l,u,d){o[++a]=i(l,u,d)}),o}return m0=r,m0}var g0,LT;function lH(){if(LT)return g0;LT=1;function t(e,r){var n=e.length;for(e.sort(r);n--;)e[n]=e[n].value;return e}return g0=t,g0}var y0,DT;function cH(){if(DT)return y0;DT=1;var t=vl();function e(r,n){if(r!==n){var i=r!==void 0,a=r===null,o=r===r,l=t(r),u=n!==void 0,d=n===null,p=n===n,f=t(n);if(!d&&!f&&!l&&r>n||l&&u&&p&&!d&&!f||a&&u&&p||!i&&p||!o)return 1;if(!a&&!l&&!f&&r<n||f&&i&&o&&!a&&!l||d&&i&&o||!u&&o||!p)return-1}return 0}return y0=e,y0}var v0,zT;function uH(){if(zT)return v0;zT=1;var t=cH();function e(r,n,i){for(var a=-1,o=r.criteria,l=n.criteria,u=o.length,d=i.length;++a<u;){var p=t(o[a],l[a]);if(p){if(a>=d)return p;var f=i[a];return p*(f=="desc"?-1:1)}}return r.index-n.index}return v0=e,v0}var b0,BT;function dH(){if(BT)return b0;BT=1;var t=e1(),e=t1(),r=Fa(),n=aI(),i=lH(),a=KR(),o=uH(),l=xl(),u=Zr();function d(p,f,g){f.length?f=t(f,function(_){return u(_)?function(b){return e(b,_.length===1?_[0]:_)}:_}):f=[l];var v=-1;f=t(f,a(r));var x=n(p,function(_,b,k){var A=t(f,function(O){return O(_)});return{criteria:A,index:++v,value:_}});return i(x,function(_,b){return o(_,b,g)})}return b0=d,b0}var x0,UT;function fH(){if(UT)return x0;UT=1;function t(e,r,n){switch(n.length){case 0:return e.call(r);case 1:return e.call(r,n[0]);case 2:return e.call(r,n[0],n[1]);case 3:return e.call(r,n[0],n[1],n[2])}return e.apply(r,n)}return x0=t,x0}var w0,qT;function hH(){if(qT)return w0;qT=1;var t=fH(),e=Math.max;function r(n,i,a){return i=e(i===void 0?n.length-1:i,0),function(){for(var o=arguments,l=-1,u=e(o.length-i,0),d=Array(u);++l<u;)d[l]=o[i+l];l=-1;for(var p=Array(i+1);++l<i;)p[l]=o[l];return p[i]=a(d),t(n,this,p)}}return w0=r,w0}var _0,FT;function pH(){if(FT)return _0;FT=1;function t(e){return function(){return e}}return _0=t,_0}var S0,HT;function oI(){if(HT)return S0;HT=1;var t=Bo(),e=(function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch{}})();return S0=e,S0}var k0,WT;function mH(){if(WT)return k0;WT=1;var t=pH(),e=oI(),r=xl(),n=e?function(i,a){return e(i,"toString",{configurable:!0,enumerable:!1,value:t(a),writable:!0})}:r;return k0=n,k0}var E0,GT;function gH(){if(GT)return E0;GT=1;var t=800,e=16,r=Date.now;function n(i){var a=0,o=0;return function(){var l=r(),u=e-(l-o);if(o=l,u>0){if(++a>=t)return arguments[0]}else a=0;return i.apply(void 0,arguments)}}return E0=n,E0}var O0,KT;function yH(){if(KT)return O0;KT=1;var t=mH(),e=gH(),r=e(t);return O0=r,O0}var A0,VT;function vH(){if(VT)return A0;VT=1;var t=xl(),e=hH(),r=yH();function n(i,a){return r(e(i,a,t),i+"")}return A0=n,A0}var T0,XT;function pp(){if(XT)return T0;XT=1;var t=Jw(),e=$u(),r=d1(),n=qa();function i(a,o,l){if(!n(l))return!1;var u=typeof o;return(u=="number"?e(l)&&r(o,l.length):u=="string"&&o in l)?t(l[o],a):!1}return T0=i,T0}var C0,YT;function bH(){if(YT)return C0;YT=1;var t=nI(),e=dH(),r=vH(),n=pp(),i=r(function(a,o){if(a==null)return[];var l=o.length;return l>1&&n(a,o[0],o[1])?o=[]:l>2&&n(o[0],o[1],o[2])&&(o=[o[0]]),e(a,t(o,1),[])});return C0=i,C0}var xH=bH();const m1=vt(xH);function Gc(t){"@babel/helpers - typeof";return Gc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gc(t)}function gx(){return gx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},gx.apply(this,arguments)}function wH(t,e){return EH(t)||kH(t,e)||SH(t,e)||_H()}function _H(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
446
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function SH(t,e){if(t){if(typeof t=="string")return JT(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return JT(t,e)}}function JT(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function kH(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,l=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return l}}function EH(t){if(Array.isArray(t))return t}function ZT(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function j0(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ZT(Object(r),!0).forEach(function(n){OH(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ZT(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function OH(t,e,r){return e=AH(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function AH(t){var e=TH(t,"string");return Gc(e)=="symbol"?e:e+""}function TH(t,e){if(Gc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Gc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function CH(t){return Array.isArray(t)&&or(t[0])&&or(t[1])?t.join(" ~ "):t}var jH=function(e){var r=e.separator,n=r===void 0?" : ":r,i=e.contentStyle,a=i===void 0?{}:i,o=e.itemStyle,l=o===void 0?{}:o,u=e.labelStyle,d=u===void 0?{}:u,p=e.payload,f=e.formatter,g=e.itemSorter,v=e.wrapperClassName,x=e.labelClassName,_=e.label,b=e.labelFormatter,k=e.accessibilityLayer,A=k===void 0?!1:k,O=function(){if(p&&p.length){var B={padding:0,margin:0},X=(g?m1(p,g):p).map(function(K,U){if(K.type==="none")return null;var G=j0({display:"block",paddingTop:4,paddingBottom:4,color:K.color||"#000"},l),J=K.formatter||f||CH,F=K.value,te=K.name,q=F,z=te;if(J&&q!=null&&z!=null){var L=J(F,te,K,U,p);if(Array.isArray(L)){var Z=wH(L,2);q=Z[0],z=Z[1]}else q=L}return $.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(U),style:G},or(z)?$.createElement("span",{className:"recharts-tooltip-item-name"},z):null,or(z)?$.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,$.createElement("span",{className:"recharts-tooltip-item-value"},q),$.createElement("span",{className:"recharts-tooltip-item-unit"},K.unit||""))});return $.createElement("ul",{className:"recharts-tooltip-item-list",style:B},X)}return null},C=j0({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},a),E=j0({margin:0},d),T=!Qe(_),P=T?_:"",R=at("recharts-default-tooltip",v),I=at("recharts-tooltip-label",x);T&&b&&p!==void 0&&p!==null&&(P=b(_,p));var Y=A?{role:"status","aria-live":"assertive"}:{};return $.createElement("div",gx({className:R,style:C},Y),$.createElement("p",{className:I,style:E},$.isValidElement(P)?P:"".concat(P)),O())};function Kc(t){"@babel/helpers - typeof";return Kc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kc(t)}function ff(t,e,r){return e=PH(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function PH(t){var e=NH(t,"string");return Kc(e)=="symbol"?e:e+""}function NH(t,e){if(Kc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Kc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var hc="recharts-tooltip-wrapper",RH={visibility:"hidden"};function IH(t){var e=t.coordinate,r=t.translateX,n=t.translateY;return at(hc,ff(ff(ff(ff({},"".concat(hc,"-right"),ge(r)&&e&&ge(e.x)&&r>=e.x),"".concat(hc,"-left"),ge(r)&&e&&ge(e.x)&&r<e.x),"".concat(hc,"-bottom"),ge(n)&&e&&ge(e.y)&&n>=e.y),"".concat(hc,"-top"),ge(n)&&e&&ge(e.y)&&n<e.y))}function QT(t){var e=t.allowEscapeViewBox,r=t.coordinate,n=t.key,i=t.offsetTopLeft,a=t.position,o=t.reverseDirection,l=t.tooltipDimension,u=t.viewBox,d=t.viewBoxDimension;if(a&&ge(a[n]))return a[n];var p=r[n]-l-i,f=r[n]+i;if(e[n])return o[n]?p:f;if(o[n]){var g=p,v=u[n];return g<v?Math.max(f,u[n]):Math.max(p,u[n])}var x=f+l,_=u[n]+d;return x>_?Math.max(p,u[n]):Math.max(f,u[n])}function $H(t){var e=t.translateX,r=t.translateY,n=t.useTranslate3d;return{transform:n?"translate3d(".concat(e,"px, ").concat(r,"px, 0)"):"translate(".concat(e,"px, ").concat(r,"px)")}}function MH(t){var e=t.allowEscapeViewBox,r=t.coordinate,n=t.offsetTopLeft,i=t.position,a=t.reverseDirection,o=t.tooltipBox,l=t.useTranslate3d,u=t.viewBox,d,p,f;return o.height>0&&o.width>0&&r?(p=QT({allowEscapeViewBox:e,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:u,viewBoxDimension:u.width}),f=QT({allowEscapeViewBox:e,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:u,viewBoxDimension:u.height}),d=$H({translateX:p,translateY:f,useTranslate3d:l})):d=RH,{cssProperties:d,cssClasses:IH({translateX:p,translateY:f,coordinate:r})}}function Ks(t){"@babel/helpers - typeof";return Ks=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ks(t)}function e2(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function t2(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?e2(Object(r),!0).forEach(function(n){vx(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e2(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function LH(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function DH(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,lI(n.key),n)}}function zH(t,e,r){return e&&DH(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function BH(t,e,r){return e=eh(e),UH(t,sI()?Reflect.construct(e,r||[],eh(t).constructor):e.apply(t,r))}function UH(t,e){if(e&&(Ks(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qH(t)}function qH(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function sI(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(sI=function(){return!!t})()}function eh(t){return eh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},eh(t)}function FH(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&yx(t,e)}function yx(t,e){return yx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},yx(t,e)}function vx(t,e,r){return e=lI(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function lI(t){var e=HH(t,"string");return Ks(e)=="symbol"?e:e+""}function HH(t,e){if(Ks(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Ks(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var r2=1,WH=(function(t){function e(){var r;LH(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=BH(this,e,[].concat(i)),vx(r,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),vx(r,"handleKeyDown",function(o){if(o.key==="Escape"){var l,u,d,p;r.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(u=r.props.coordinate)===null||u===void 0?void 0:u.x)!==null&&l!==void 0?l:0,y:(d=(p=r.props.coordinate)===null||p===void 0?void 0:p.y)!==null&&d!==void 0?d:0}})}}),r}return FH(e,t),zH(e,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();(Math.abs(n.width-this.state.lastBoundingBox.width)>r2||Math.abs(n.height-this.state.lastBoundingBox.height)>r2)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,l=i.animationDuration,u=i.animationEasing,d=i.children,p=i.coordinate,f=i.hasPayload,g=i.isAnimationActive,v=i.offset,x=i.position,_=i.reverseDirection,b=i.useTranslate3d,k=i.viewBox,A=i.wrapperStyle,O=MH({allowEscapeViewBox:o,coordinate:p,offsetTopLeft:v,position:x,reverseDirection:_,tooltipBox:this.state.lastBoundingBox,useTranslate3d:b,viewBox:k}),C=O.cssClasses,E=O.cssProperties,T=t2(t2({transition:g&&a?"transform ".concat(l,"ms ").concat(u):void 0},E),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&f?"visible":"hidden",position:"absolute",top:0,left:0},A);return $.createElement("div",{tabIndex:-1,className:C,style:T,ref:function(R){n.wrapperNode=R}},d)}}])})(N.PureComponent),GH=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},wl={isSsr:GH()};function Vs(t){"@babel/helpers - typeof";return Vs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vs(t)}function n2(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function i2(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?n2(Object(r),!0).forEach(function(n){g1(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n2(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function KH(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function VH(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,uI(n.key),n)}}function XH(t,e,r){return e&&VH(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function YH(t,e,r){return e=th(e),JH(t,cI()?Reflect.construct(e,r||[],th(t).constructor):e.apply(t,r))}function JH(t,e){if(e&&(Vs(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ZH(t)}function ZH(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function cI(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(cI=function(){return!!t})()}function th(t){return th=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},th(t)}function QH(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&bx(t,e)}function bx(t,e){return bx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},bx(t,e)}function g1(t,e,r){return e=uI(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function uI(t){var e=eW(t,"string");return Vs(e)=="symbol"?e:e+""}function eW(t,e){if(Vs(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Vs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function tW(t){return t.dataKey}function rW(t,e){return $.isValidElement(t)?$.cloneElement(t,e):typeof t=="function"?$.createElement(t,e):$.createElement(jH,e)}var ln=(function(t){function e(){return KH(this,e),YH(this,e,arguments)}return QH(e,t),XH(e,[{key:"render",value:function(){var n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,l=i.animationDuration,u=i.animationEasing,d=i.content,p=i.coordinate,f=i.filterNull,g=i.isAnimationActive,v=i.offset,x=i.payload,_=i.payloadUniqBy,b=i.position,k=i.reverseDirection,A=i.useTranslate3d,O=i.viewBox,C=i.wrapperStyle,E=x??[];f&&E.length&&(E=eI(x.filter(function(P){return P.value!=null&&(P.hide!==!0||n.props.includeHidden)}),_,tW));var T=E.length>0;return $.createElement(WH,{allowEscapeViewBox:o,animationDuration:l,animationEasing:u,isAnimationActive:g,active:a,coordinate:p,hasPayload:T,offset:v,position:b,reverseDirection:k,useTranslate3d:A,viewBox:O,wrapperStyle:C},rW(d,i2(i2({},this.props),{},{payload:E})))}}])})(N.PureComponent);g1(ln,"displayName","Tooltip");g1(ln,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!wl.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var P0,a2;function nW(){if(a2)return P0;a2=1;var t=Ei(),e=function(){return t.Date.now()};return P0=e,P0}var N0,o2;function iW(){if(o2)return N0;o2=1;var t=/\s/;function e(r){for(var n=r.length;n--&&t.test(r.charAt(n)););return n}return N0=e,N0}var R0,s2;function aW(){if(s2)return R0;s2=1;var t=iW(),e=/^\s+/;function r(n){return n&&n.slice(0,t(n)+1).replace(e,"")}return R0=r,R0}var I0,l2;function dI(){if(l2)return I0;l2=1;var t=aW(),e=qa(),r=vl(),n=NaN,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,l=parseInt;function u(d){if(typeof d=="number")return d;if(r(d))return n;if(e(d)){var p=typeof d.valueOf=="function"?d.valueOf():d;d=e(p)?p+"":p}if(typeof d!="string")return d===0?d:+d;d=t(d);var f=a.test(d);return f||o.test(d)?l(d.slice(2),f?2:8):i.test(d)?n:+d}return I0=u,I0}var $0,c2;function oW(){if(c2)return $0;c2=1;var t=qa(),e=nW(),r=dI(),n="Expected a function",i=Math.max,a=Math.min;function o(l,u,d){var p,f,g,v,x,_,b=0,k=!1,A=!1,O=!0;if(typeof l!="function")throw new TypeError(n);u=r(u)||0,t(d)&&(k=!!d.leading,A="maxWait"in d,g=A?i(r(d.maxWait)||0,u):g,O="trailing"in d?!!d.trailing:O);function C(X){var K=p,U=f;return p=f=void 0,b=X,v=l.apply(U,K),v}function E(X){return b=X,x=setTimeout(R,u),k?C(X):v}function T(X){var K=X-_,U=X-b,G=u-K;return A?a(G,g-U):G}function P(X){var K=X-_,U=X-b;return _===void 0||K>=u||K<0||A&&U>=g}function R(){var X=e();if(P(X))return I(X);x=setTimeout(R,T(X))}function I(X){return x=void 0,O&&p?C(X):(p=f=void 0,v)}function Y(){x!==void 0&&clearTimeout(x),b=0,p=_=f=x=void 0}function W(){return x===void 0?v:I(e())}function B(){var X=e(),K=P(X);if(p=arguments,f=this,_=X,K){if(x===void 0)return E(_);if(A)return clearTimeout(x),x=setTimeout(R,u),C(_)}return x===void 0&&(x=setTimeout(R,u)),v}return B.cancel=Y,B.flush=W,B}return $0=o,$0}var M0,u2;function sW(){if(u2)return M0;u2=1;var t=oW(),e=qa(),r="Expected a function";function n(i,a,o){var l=!0,u=!0;if(typeof i!="function")throw new TypeError(r);return e(o)&&(l="leading"in o?!!o.leading:l,u="trailing"in o?!!o.trailing:u),t(i,a,{leading:l,maxWait:a,trailing:u})}return M0=n,M0}var lW=sW();const fI=vt(lW);function Vc(t){"@babel/helpers - typeof";return Vc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vc(t)}function d2(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function hf(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?d2(Object(r),!0).forEach(function(n){cW(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):d2(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function cW(t,e,r){return e=uW(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function uW(t){var e=dW(t,"string");return Vc(e)=="symbol"?e:e+""}function dW(t,e){if(Vc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Vc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function fW(t,e){return gW(t)||mW(t,e)||pW(t,e)||hW()}function hW(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
447
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pW(t,e){if(t){if(typeof t=="string")return f2(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f2(t,e)}}function f2(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function mW(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,l=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return l}}function gW(t){if(Array.isArray(t))return t}var rh=N.forwardRef(function(t,e){var r=t.aspect,n=t.initialDimension,i=n===void 0?{width:-1,height:-1}:n,a=t.width,o=a===void 0?"100%":a,l=t.height,u=l===void 0?"100%":l,d=t.minWidth,p=d===void 0?0:d,f=t.minHeight,g=t.maxHeight,v=t.children,x=t.debounce,_=x===void 0?0:x,b=t.id,k=t.className,A=t.onResize,O=t.style,C=O===void 0?{}:O,E=N.useRef(null),T=N.useRef();T.current=A,N.useImperativeHandle(e,function(){return Object.defineProperty(E.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),E.current},configurable:!0})});var P=N.useState({containerWidth:i.width,containerHeight:i.height}),R=fW(P,2),I=R[0],Y=R[1],W=N.useCallback(function(X,K){Y(function(U){var G=Math.round(X),J=Math.round(K);return U.containerWidth===G&&U.containerHeight===J?U:{containerWidth:G,containerHeight:J}})},[]);N.useEffect(function(){var X=function(te){var q,z=te[0].contentRect,L=z.width,Z=z.height;W(L,Z),(q=T.current)===null||q===void 0||q.call(T,L,Z)};_>0&&(X=fI(X,_,{trailing:!0,leading:!1}));var K=new ResizeObserver(X),U=E.current.getBoundingClientRect(),G=U.width,J=U.height;return W(G,J),K.observe(E.current),function(){K.disconnect()}},[W,_]);var B=N.useMemo(function(){var X=I.containerWidth,K=I.containerHeight;if(X<0||K<0)return null;Ki(So(o)||So(u),`The width(%s) and height(%s) are both fixed numbers,
448
+ maybe you don't need to use a ResponsiveContainer.`,o,u),Ki(!r||r>0,"The aspect(%s) must be greater than zero.",r);var U=So(o)?X:o,G=So(u)?K:u;r&&r>0&&(U?G=U/r:G&&(U=G*r),g&&G>g&&(G=g)),Ki(U>0||G>0,`The width(%s) and height(%s) of chart should be greater than 0,
449
+ please check the style of container, or the props width(%s) and height(%s),
450
+ or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
451
+ height and width.`,U,G,o,u,p,f,r);var J=!Array.isArray(v)&&Gi(v.type).endsWith("Chart");return $.Children.map(v,function(F){return $.isValidElement(F)?N.cloneElement(F,hf({width:U,height:G},J?{style:hf({height:"100%",width:"100%",maxHeight:G,maxWidth:U},F.props.style)}:{})):F})},[r,v,u,g,f,p,I,o]);return $.createElement("div",{id:b?"".concat(b):void 0,className:at("recharts-responsive-container",k),style:hf(hf({},C),{},{width:o,height:u,minWidth:p,minHeight:f,maxHeight:g}),ref:E},B)}),hI=function(e){return null};hI.displayName="Cell";function Xc(t){"@babel/helpers - typeof";return Xc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xc(t)}function h2(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function xx(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?h2(Object(r),!0).forEach(function(n){yW(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):h2(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function yW(t,e,r){return e=vW(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vW(t){var e=bW(t,"string");return Xc(e)=="symbol"?e:e+""}function bW(t,e){if(Xc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Xc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Ss={widthCache:{},cacheCount:0},xW=2e3,wW={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},p2="recharts_measurement_span";function _W(t){var e=xx({},t);return Object.keys(e).forEach(function(r){e[r]||delete e[r]}),e}var Nc=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||wl.isSsr)return{width:0,height:0};var n=_W(r),i=JSON.stringify({text:e,copyStyle:n});if(Ss.widthCache[i])return Ss.widthCache[i];try{var a=document.getElementById(p2);a||(a=document.createElement("span"),a.setAttribute("id",p2),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=xx(xx({},wW),n);Object.assign(a.style,o),a.textContent="".concat(e);var l=a.getBoundingClientRect(),u={width:l.width,height:l.height};return Ss.widthCache[i]=u,++Ss.cacheCount>xW&&(Ss.cacheCount=0,Ss.widthCache={}),u}catch{return{width:0,height:0}}},SW=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function Yc(t){"@babel/helpers - typeof";return Yc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Yc(t)}function nh(t,e){return AW(t)||OW(t,e)||EW(t,e)||kW()}function kW(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
452
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function EW(t,e){if(t){if(typeof t=="string")return m2(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m2(t,e)}}function m2(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function OW(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,l=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return l}}function AW(t){if(Array.isArray(t))return t}function TW(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function g2(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,jW(n.key),n)}}function CW(t,e,r){return e&&g2(t.prototype,e),r&&g2(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function jW(t){var e=PW(t,"string");return Yc(e)=="symbol"?e:e+""}function PW(t,e){if(Yc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Yc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var y2=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,v2=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,NW=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,RW=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,pI={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},IW=Object.keys(pI),Rs="NaN";function $W(t,e){return t*pI[e]}var pf=(function(){function t(e,r){TW(this,t),this.num=e,this.unit=r,this.num=e,this.unit=r,Number.isNaN(e)&&(this.unit=""),r!==""&&!NW.test(r)&&(this.num=NaN,this.unit=""),IW.includes(r)&&(this.num=$W(e,r),this.unit="px")}return CW(t,[{key:"add",value:function(r){return this.unit!==r.unit?new t(NaN,""):new t(this.num+r.num,this.unit)}},{key:"subtract",value:function(r){return this.unit!==r.unit?new t(NaN,""):new t(this.num-r.num,this.unit)}},{key:"multiply",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new t(NaN,""):new t(this.num*r.num,this.unit||r.unit)}},{key:"divide",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new t(NaN,""):new t(this.num/r.num,this.unit||r.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(r){var n,i=(n=RW.exec(r))!==null&&n!==void 0?n:[],a=nh(i,3),o=a[1],l=a[2];return new t(parseFloat(o),l??"")}}])})();function mI(t){if(t.includes(Rs))return Rs;for(var e=t;e.includes("*")||e.includes("/");){var r,n=(r=y2.exec(e))!==null&&r!==void 0?r:[],i=nh(n,4),a=i[1],o=i[2],l=i[3],u=pf.parse(a??""),d=pf.parse(l??""),p=o==="*"?u.multiply(d):u.divide(d);if(p.isNaN())return Rs;e=e.replace(y2,p.toString())}for(;e.includes("+")||/.-\d+(?:\.\d+)?/.test(e);){var f,g=(f=v2.exec(e))!==null&&f!==void 0?f:[],v=nh(g,4),x=v[1],_=v[2],b=v[3],k=pf.parse(x??""),A=pf.parse(b??""),O=_==="+"?k.add(A):k.subtract(A);if(O.isNaN())return Rs;e=e.replace(v2,O.toString())}return e}var b2=/\(([^()]*)\)/;function MW(t){for(var e=t;e.includes("(");){var r=b2.exec(e),n=nh(r,2),i=n[1];e=e.replace(b2,mI(i))}return e}function LW(t){var e=t.replace(/\s+/g,"");return e=MW(e),e=mI(e),e}function DW(t){try{return LW(t)}catch{return Rs}}function L0(t){var e=DW(t.slice(5,-1));return e===Rs?"":e}var zW=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],BW=["dx","dy","angle","className","breakAll"];function wx(){return wx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},wx.apply(this,arguments)}function x2(t,e){if(t==null)return{};var r=UW(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function UW(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function w2(t,e){return WW(t)||HW(t,e)||FW(t,e)||qW()}function qW(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
453
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FW(t,e){if(t){if(typeof t=="string")return _2(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _2(t,e)}}function _2(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function HW(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,l=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return l}}function WW(t){if(Array.isArray(t))return t}var gI=/[ \f\n\r\t\v\u2028\u2029]+/,yI=function(e){var r=e.children,n=e.breakAll,i=e.style;try{var a=[];Qe(r)||(n?a=r.toString().split(""):a=r.toString().split(gI));var o=a.map(function(u){return{word:u,width:Nc(u,i).width}}),l=n?0:Nc(" ",i).width;return{wordsWithComputedWidth:o,spaceWidth:l}}catch{return null}},GW=function(e,r,n,i,a){var o=e.maxLines,l=e.children,u=e.style,d=e.breakAll,p=ge(o),f=l,g=function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return U.reduce(function(G,J){var F=J.word,te=J.width,q=G[G.length-1];if(q&&(i==null||a||q.width+te+n<Number(i)))q.words.push(F),q.width+=te+n;else{var z={words:[F],width:te};G.push(z)}return G},[])},v=g(r),x=function(U){return U.reduce(function(G,J){return G.width>J.width?G:J})};if(!p)return v;for(var _="…",b=function(U){var G=f.slice(0,U),J=yI({breakAll:d,style:u,children:G+_}).wordsWithComputedWidth,F=g(J),te=F.length>o||x(F).width>Number(i);return[te,F]},k=0,A=f.length-1,O=0,C;k<=A&&O<=f.length-1;){var E=Math.floor((k+A)/2),T=E-1,P=b(T),R=w2(P,2),I=R[0],Y=R[1],W=b(E),B=w2(W,1),X=B[0];if(!I&&!X&&(k=E+1),I&&X&&(A=E-1),!I&&X){C=Y;break}O++}return C||v},S2=function(e){var r=Qe(e)?[]:e.toString().split(gI);return[{words:r}]},KW=function(e){var r=e.width,n=e.scaleToFit,i=e.children,a=e.style,o=e.breakAll,l=e.maxLines;if((r||n)&&!wl.isSsr){var u,d,p=yI({breakAll:o,children:i,style:a});if(p){var f=p.wordsWithComputedWidth,g=p.spaceWidth;u=f,d=g}else return S2(i);return GW({breakAll:o,children:i,maxLines:l,style:a},u,d,r,n)}return S2(i)},k2="#808080",ih=function(e){var r=e.x,n=r===void 0?0:r,i=e.y,a=i===void 0?0:i,o=e.lineHeight,l=o===void 0?"1em":o,u=e.capHeight,d=u===void 0?"0.71em":u,p=e.scaleToFit,f=p===void 0?!1:p,g=e.textAnchor,v=g===void 0?"start":g,x=e.verticalAnchor,_=x===void 0?"end":x,b=e.fill,k=b===void 0?k2:b,A=x2(e,zW),O=N.useMemo(function(){return KW({breakAll:A.breakAll,children:A.children,maxLines:A.maxLines,scaleToFit:f,style:A.style,width:A.width})},[A.breakAll,A.children,A.maxLines,f,A.style,A.width]),C=A.dx,E=A.dy,T=A.angle,P=A.className,R=A.breakAll,I=x2(A,BW);if(!or(n)||!or(a))return null;var Y=n+(ge(C)?C:0),W=a+(ge(E)?E:0),B;switch(_){case"start":B=L0("calc(".concat(d,")"));break;case"middle":B=L0("calc(".concat((O.length-1)/2," * -").concat(l," + (").concat(d," / 2))"));break;default:B=L0("calc(".concat(O.length-1," * -").concat(l,")"));break}var X=[];if(f){var K=O[0].width,U=A.width;X.push("scale(".concat((ge(U)?U/K:1)/K,")"))}return T&&X.push("rotate(".concat(T,", ").concat(Y,", ").concat(W,")")),X.length&&(I.transform=X.join(" ")),$.createElement("text",wx({},it(I,!0),{x:Y,y:W,className:at("recharts-text",P),textAnchor:v,fill:k.includes("url")?k2:k}),O.map(function(G,J){var F=G.words.join(R?"":" ");return $.createElement("tspan",{x:Y,dy:J===0?B:l,key:"".concat(F,"-").concat(J)},F)}))};function Ma(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function VW(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function y1(t){let e,r,n;t.length!==2?(e=Ma,r=(l,u)=>Ma(t(l),u),n=(l,u)=>t(l)-u):(e=t===Ma||t===VW?t:XW,r=t,n=t);function i(l,u,d=0,p=l.length){if(d<p){if(e(u,u)!==0)return p;do{const f=d+p>>>1;r(l[f],u)<0?d=f+1:p=f}while(d<p)}return d}function a(l,u,d=0,p=l.length){if(d<p){if(e(u,u)!==0)return p;do{const f=d+p>>>1;r(l[f],u)<=0?d=f+1:p=f}while(d<p)}return d}function o(l,u,d=0,p=l.length){const f=i(l,u,d,p-1);return f>d&&n(l[f-1],u)>-n(l[f],u)?f-1:f}return{left:i,center:o,right:a}}function XW(){return 0}function vI(t){return t===null?NaN:+t}function*YW(t,e){for(let r of t)r!=null&&(r=+r)>=r&&(yield r)}const JW=y1(Ma),Mu=JW.right;y1(vI).center;class E2 extends Map{constructor(e,r=eG){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(const[n,i]of e)this.set(n,i)}get(e){return super.get(O2(this,e))}has(e){return super.has(O2(this,e))}set(e,r){return super.set(ZW(this,e),r)}delete(e){return super.delete(QW(this,e))}}function O2({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function ZW({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function QW({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function eG(t){return t!==null&&typeof t=="object"?t.valueOf():t}function tG(t=Ma){if(t===Ma)return bI;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,r)=>{const n=t(e,r);return n||n===0?n:(t(r,r)===0)-(t(e,e)===0)}}function bI(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(t<e?-1:t>e?1:0)}const rG=Math.sqrt(50),nG=Math.sqrt(10),iG=Math.sqrt(2);function ah(t,e,r){const n=(e-t)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=rG?10:a>=nG?5:a>=iG?2:1;let l,u,d;return i<0?(d=Math.pow(10,-i)/o,l=Math.round(t*d),u=Math.round(e*d),l/d<t&&++l,u/d>e&&--u,d=-d):(d=Math.pow(10,i)*o,l=Math.round(t/d),u=Math.round(e/d),l*d<t&&++l,u*d>e&&--u),u<l&&.5<=r&&r<2?ah(t,e,r*2):[l,u,d]}function _x(t,e,r){if(e=+e,t=+t,r=+r,!(r>0))return[];if(t===e)return[t];const n=e<t,[i,a,o]=n?ah(e,t,r):ah(t,e,r);if(!(a>=i))return[];const l=a-i+1,u=new Array(l);if(n)if(o<0)for(let d=0;d<l;++d)u[d]=(a-d)/-o;else for(let d=0;d<l;++d)u[d]=(a-d)*o;else if(o<0)for(let d=0;d<l;++d)u[d]=(i+d)/-o;else for(let d=0;d<l;++d)u[d]=(i+d)*o;return u}function Sx(t,e,r){return e=+e,t=+t,r=+r,ah(t,e,r)[2]}function kx(t,e,r){e=+e,t=+t,r=+r;const n=e<t,i=n?Sx(e,t,r):Sx(t,e,r);return(n?-1:1)*(i<0?1/-i:i)}function A2(t,e){let r;for(const n of t)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function T2(t,e){let r;for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function xI(t,e,r=0,n=1/0,i){if(e=Math.floor(e),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(t.length-1,n)),!(r<=e&&e<=n))return t;for(i=i===void 0?bI:tG(i);n>r;){if(n-r>600){const u=n-r+1,d=e-r+1,p=Math.log(u),f=.5*Math.exp(2*p/3),g=.5*Math.sqrt(p*f*(u-f)/u)*(d-u/2<0?-1:1),v=Math.max(r,Math.floor(e-d*f/u+g)),x=Math.min(n,Math.floor(e+(u-d)*f/u+g));xI(t,e,v,x,i)}const a=t[e];let o=r,l=n;for(pc(t,r,e),i(t[n],a)>0&&pc(t,r,n);o<l;){for(pc(t,o,l),++o,--l;i(t[o],a)<0;)++o;for(;i(t[l],a)>0;)--l}i(t[r],a)===0?pc(t,r,l):(++l,pc(t,l,n)),l<=e&&(r=l+1),e<=l&&(n=l-1)}return t}function pc(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function aG(t,e,r){if(t=Float64Array.from(YW(t)),!(!(n=t.length)||isNaN(e=+e))){if(e<=0||n<2)return T2(t);if(e>=1)return A2(t);var n,i=(n-1)*e,a=Math.floor(i),o=A2(xI(t,a).subarray(0,a+1)),l=T2(t.subarray(a+1));return o+(l-o)*(i-a)}}function oG(t,e,r=vI){if(!(!(n=t.length)||isNaN(e=+e))){if(e<=0||n<2)return+r(t[0],0,t);if(e>=1)return+r(t[n-1],n-1,t);var n,i=(n-1)*e,a=Math.floor(i),o=+r(t[a],a,t),l=+r(t[a+1],a+1,t);return o+(l-o)*(i-a)}}function sG(t,e,r){t=+t,e=+e,r=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((e-t)/r))|0,a=new Array(i);++n<i;)a[n]=t+n*r;return a}function Nn(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function ia(t,e){switch(arguments.length){case 0:break;case 1:{typeof t=="function"?this.interpolator(t):this.range(t);break}default:{this.domain(t),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}const Ex=Symbol("implicit");function v1(){var t=new E2,e=[],r=[],n=Ex;function i(a){let o=t.get(a);if(o===void 0){if(n!==Ex)return n;t.set(a,o=e.push(a)-1)}return r[o%r.length]}return i.domain=function(a){if(!arguments.length)return e.slice();e=[],t=new E2;for(const o of a)t.has(o)||t.set(o,e.push(o)-1);return i},i.range=function(a){return arguments.length?(r=Array.from(a),i):r.slice()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return v1(e,r).unknown(n)},Nn.apply(i,arguments),i}function Jc(){var t=v1().unknown(void 0),e=t.domain,r=t.range,n=0,i=1,a,o,l=!1,u=0,d=0,p=.5;delete t.unknown;function f(){var g=e().length,v=i<n,x=v?i:n,_=v?n:i;a=(_-x)/Math.max(1,g-u+d*2),l&&(a=Math.floor(a)),x+=(_-x-a*(g-u))*p,o=a*(1-u),l&&(x=Math.round(x),o=Math.round(o));var b=sG(g).map(function(k){return x+a*k});return r(v?b.reverse():b)}return t.domain=function(g){return arguments.length?(e(g),f()):e()},t.range=function(g){return arguments.length?([n,i]=g,n=+n,i=+i,f()):[n,i]},t.rangeRound=function(g){return[n,i]=g,n=+n,i=+i,l=!0,f()},t.bandwidth=function(){return o},t.step=function(){return a},t.round=function(g){return arguments.length?(l=!!g,f()):l},t.padding=function(g){return arguments.length?(u=Math.min(1,d=+g),f()):u},t.paddingInner=function(g){return arguments.length?(u=Math.min(1,g),f()):u},t.paddingOuter=function(g){return arguments.length?(d=+g,f()):d},t.align=function(g){return arguments.length?(p=Math.max(0,Math.min(1,g)),f()):p},t.copy=function(){return Jc(e(),[n,i]).round(l).paddingInner(u).paddingOuter(d).align(p)},Nn.apply(f(),arguments)}function wI(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return wI(e())},t}function Rc(){return wI(Jc.apply(null,arguments).paddingInner(1))}function b1(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function _I(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function Lu(){}var Zc=.7,oh=1/Zc,Us="\\s*([+-]?\\d+)\\s*",Qc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",_i="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",lG=/^#([0-9a-f]{3,8})$/,cG=new RegExp(`^rgb\\(${Us},${Us},${Us}\\)$`),uG=new RegExp(`^rgb\\(${_i},${_i},${_i}\\)$`),dG=new RegExp(`^rgba\\(${Us},${Us},${Us},${Qc}\\)$`),fG=new RegExp(`^rgba\\(${_i},${_i},${_i},${Qc}\\)$`),hG=new RegExp(`^hsl\\(${Qc},${_i},${_i}\\)$`),pG=new RegExp(`^hsla\\(${Qc},${_i},${_i},${Qc}\\)$`),C2={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};b1(Lu,eu,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:j2,formatHex:j2,formatHex8:mG,formatHsl:gG,formatRgb:P2,toString:P2});function j2(){return this.rgb().formatHex()}function mG(){return this.rgb().formatHex8()}function gG(){return SI(this).formatHsl()}function P2(){return this.rgb().formatRgb()}function eu(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=lG.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?N2(e):r===3?new Jr(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?mf(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?mf(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=cG.exec(t))?new Jr(e[1],e[2],e[3],1):(e=uG.exec(t))?new Jr(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=dG.exec(t))?mf(e[1],e[2],e[3],e[4]):(e=fG.exec(t))?mf(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=hG.exec(t))?$2(e[1],e[2]/100,e[3]/100,1):(e=pG.exec(t))?$2(e[1],e[2]/100,e[3]/100,e[4]):C2.hasOwnProperty(t)?N2(C2[t]):t==="transparent"?new Jr(NaN,NaN,NaN,0):null}function N2(t){return new Jr(t>>16&255,t>>8&255,t&255,1)}function mf(t,e,r,n){return n<=0&&(t=e=r=NaN),new Jr(t,e,r,n)}function yG(t){return t instanceof Lu||(t=eu(t)),t?(t=t.rgb(),new Jr(t.r,t.g,t.b,t.opacity)):new Jr}function Ox(t,e,r,n){return arguments.length===1?yG(t):new Jr(t,e,r,n??1)}function Jr(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}b1(Jr,Ox,_I(Lu,{brighter(t){return t=t==null?oh:Math.pow(oh,t),new Jr(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Zc:Math.pow(Zc,t),new Jr(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Jr(Co(this.r),Co(this.g),Co(this.b),sh(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:R2,formatHex:R2,formatHex8:vG,formatRgb:I2,toString:I2}));function R2(){return`#${ko(this.r)}${ko(this.g)}${ko(this.b)}`}function vG(){return`#${ko(this.r)}${ko(this.g)}${ko(this.b)}${ko((isNaN(this.opacity)?1:this.opacity)*255)}`}function I2(){const t=sh(this.opacity);return`${t===1?"rgb(":"rgba("}${Co(this.r)}, ${Co(this.g)}, ${Co(this.b)}${t===1?")":`, ${t})`}`}function sh(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Co(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ko(t){return t=Co(t),(t<16?"0":"")+t.toString(16)}function $2(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Yn(t,e,r,n)}function SI(t){if(t instanceof Yn)return new Yn(t.h,t.s,t.l,t.opacity);if(t instanceof Lu||(t=eu(t)),!t)return new Yn;if(t instanceof Yn)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),a=Math.max(e,r,n),o=NaN,l=a-i,u=(a+i)/2;return l?(e===a?o=(r-n)/l+(r<n)*6:r===a?o=(n-e)/l+2:o=(e-r)/l+4,l/=u<.5?a+i:2-a-i,o*=60):l=u>0&&u<1?0:o,new Yn(o,l,u,t.opacity)}function bG(t,e,r,n){return arguments.length===1?SI(t):new Yn(t,e,r,n??1)}function Yn(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}b1(Yn,bG,_I(Lu,{brighter(t){return t=t==null?oh:Math.pow(oh,t),new Yn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Zc:Math.pow(Zc,t),new Yn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new Jr(D0(t>=240?t-240:t+120,i,n),D0(t,i,n),D0(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new Yn(M2(this.h),gf(this.s),gf(this.l),sh(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 t=sh(this.opacity);return`${t===1?"hsl(":"hsla("}${M2(this.h)}, ${gf(this.s)*100}%, ${gf(this.l)*100}%${t===1?")":`, ${t})`}`}}));function M2(t){return t=(t||0)%360,t<0?t+360:t}function gf(t){return Math.max(0,Math.min(1,t||0))}function D0(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const x1=t=>()=>t;function xG(t,e){return function(r){return t+r*e}}function wG(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function _G(t){return(t=+t)==1?kI:function(e,r){return r-e?wG(e,r,t):x1(isNaN(e)?r:e)}}function kI(t,e){var r=e-t;return r?xG(t,r):x1(isNaN(t)?e:t)}const L2=(function t(e){var r=_G(e);function n(i,a){var o=r((i=Ox(i)).r,(a=Ox(a)).r),l=r(i.g,a.g),u=r(i.b,a.b),d=kI(i.opacity,a.opacity);return function(p){return i.r=o(p),i.g=l(p),i.b=u(p),i.opacity=d(p),i+""}}return n.gamma=t,n})(1);function SG(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),i;return function(a){for(i=0;i<r;++i)n[i]=t[i]*(1-a)+e[i]*a;return n}}function kG(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function EG(t,e){var r=e?e.length:0,n=t?Math.min(r,t.length):0,i=new Array(n),a=new Array(r),o;for(o=0;o<n;++o)i[o]=_l(t[o],e[o]);for(;o<r;++o)a[o]=e[o];return function(l){for(o=0;o<n;++o)a[o]=i[o](l);return a}}function OG(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function lh(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function AG(t,e){var r={},n={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?r[i]=_l(t[i],e[i]):n[i]=e[i];return function(a){for(i in r)n[i]=r[i](a);return n}}var Ax=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,z0=new RegExp(Ax.source,"g");function TG(t){return function(){return t}}function CG(t){return function(e){return t(e)+""}}function jG(t,e){var r=Ax.lastIndex=z0.lastIndex=0,n,i,a,o=-1,l=[],u=[];for(t=t+"",e=e+"";(n=Ax.exec(t))&&(i=z0.exec(e));)(a=i.index)>r&&(a=e.slice(r,a),l[o]?l[o]+=a:l[++o]=a),(n=n[0])===(i=i[0])?l[o]?l[o]+=i:l[++o]=i:(l[++o]=null,u.push({i:o,x:lh(n,i)})),r=z0.lastIndex;return r<e.length&&(a=e.slice(r),l[o]?l[o]+=a:l[++o]=a),l.length<2?u[0]?CG(u[0].x):TG(e):(e=u.length,function(d){for(var p=0,f;p<e;++p)l[(f=u[p]).i]=f.x(d);return l.join("")})}function _l(t,e){var r=typeof e,n;return e==null||r==="boolean"?x1(e):(r==="number"?lh:r==="string"?(n=eu(e))?(e=n,L2):jG:e instanceof eu?L2:e instanceof Date?OG:kG(e)?SG:Array.isArray(e)?EG:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?AG:lh)(t,e)}function w1(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}function PG(t,e){e===void 0&&(e=t,t=_l);for(var r=0,n=e.length-1,i=e[0],a=new Array(n<0?0:n);r<n;)a[r]=t(i,i=e[++r]);return function(o){var l=Math.max(0,Math.min(n-1,Math.floor(o*=n)));return a[l](o-l)}}function NG(t){return function(){return t}}function ch(t){return+t}var D2=[0,1];function Br(t){return t}function Tx(t,e){return(e-=t=+t)?function(r){return(r-t)/e}:NG(isNaN(e)?NaN:.5)}function RG(t,e){var r;return t>e&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function IG(t,e,r){var n=t[0],i=t[1],a=e[0],o=e[1];return i<n?(n=Tx(i,n),a=r(o,a)):(n=Tx(n,i),a=r(a,o)),function(l){return a(n(l))}}function $G(t,e,r){var n=Math.min(t.length,e.length)-1,i=new Array(n),a=new Array(n),o=-1;for(t[n]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<n;)i[o]=Tx(t[o],t[o+1]),a[o]=r(e[o],e[o+1]);return function(l){var u=Mu(t,l,1,n)-1;return a[u](i[u](l))}}function Du(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function mp(){var t=D2,e=D2,r=_l,n,i,a,o=Br,l,u,d;function p(){var g=Math.min(t.length,e.length);return o!==Br&&(o=RG(t[0],t[g-1])),l=g>2?$G:IG,u=d=null,f}function f(g){return g==null||isNaN(g=+g)?a:(u||(u=l(t.map(n),e,r)))(n(o(g)))}return f.invert=function(g){return o(i((d||(d=l(e,t.map(n),lh)))(g)))},f.domain=function(g){return arguments.length?(t=Array.from(g,ch),p()):t.slice()},f.range=function(g){return arguments.length?(e=Array.from(g),p()):e.slice()},f.rangeRound=function(g){return e=Array.from(g),r=w1,p()},f.clamp=function(g){return arguments.length?(o=g?!0:Br,p()):o!==Br},f.interpolate=function(g){return arguments.length?(r=g,p()):r},f.unknown=function(g){return arguments.length?(a=g,f):a},function(g,v){return n=g,i=v,p()}}function _1(){return mp()(Br,Br)}function MG(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function uh(t,e){if(!isFinite(t)||t===0)return null;var r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"),n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function Xs(t){return t=uh(Math.abs(t)),t?t[1]:NaN}function LG(t,e){return function(r,n){for(var i=r.length,a=[],o=0,l=t[0],u=0;i>0&&l>0&&(u+l+1>n&&(l=Math.max(1,n-u)),a.push(r.substring(i-=l,i+l)),!((u+=l+1)>n));)l=t[o=(o+1)%t.length];return a.reverse().join(e)}}function DG(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var zG=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function tu(t){if(!(e=zG.exec(t)))throw new Error("invalid format: "+t);var e;return new S1({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}tu.prototype=S1.prototype;function S1(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}S1.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 BG(t){e:for(var e=t.length,r=1,n=-1,i;r<e;++r)switch(t[r]){case".":n=i=r;break;case"0":n===0&&(n=r),i=r;break;default:if(!+t[r])break e;n>0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(i+1):t}var dh;function UG(t,e){var r=uh(t,e);if(!r)return dh=void 0,t.toPrecision(e);var n=r[0],i=r[1],a=i-(dh=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+uh(t,Math.max(0,e+a-1))[0]}function z2(t,e){var r=uh(t,e);if(!r)return t+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const B2={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:MG,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>z2(t*100,e),r:z2,s:UG,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function U2(t){return t}var q2=Array.prototype.map,F2=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function qG(t){var e=t.grouping===void 0||t.thousands===void 0?U2:LG(q2.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?U2:DG(q2.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",l=t.minus===void 0?"−":t.minus+"",u=t.nan===void 0?"NaN":t.nan+"";function d(f,g){f=tu(f);var v=f.fill,x=f.align,_=f.sign,b=f.symbol,k=f.zero,A=f.width,O=f.comma,C=f.precision,E=f.trim,T=f.type;T==="n"?(O=!0,T="g"):B2[T]||(C===void 0&&(C=12),E=!0,T="g"),(k||v==="0"&&x==="=")&&(k=!0,v="0",x="=");var P=(g&&g.prefix!==void 0?g.prefix:"")+(b==="$"?r:b==="#"&&/[boxX]/.test(T)?"0"+T.toLowerCase():""),R=(b==="$"?n:/[%p]/.test(T)?o:"")+(g&&g.suffix!==void 0?g.suffix:""),I=B2[T],Y=/[defgprs%]/.test(T);C=C===void 0?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,C)):Math.max(0,Math.min(20,C));function W(B){var X=P,K=R,U,G,J;if(T==="c")K=I(B)+K,B="";else{B=+B;var F=B<0||1/B<0;if(B=isNaN(B)?u:I(Math.abs(B),C),E&&(B=BG(B)),F&&+B==0&&_!=="+"&&(F=!1),X=(F?_==="("?_:l:_==="-"||_==="("?"":_)+X,K=(T==="s"&&!isNaN(B)&&dh!==void 0?F2[8+dh/3]:"")+K+(F&&_==="("?")":""),Y){for(U=-1,G=B.length;++U<G;)if(J=B.charCodeAt(U),48>J||J>57){K=(J===46?i+B.slice(U+1):B.slice(U))+K,B=B.slice(0,U);break}}}O&&!k&&(B=e(B,1/0));var te=X.length+B.length+K.length,q=te<A?new Array(A-te+1).join(v):"";switch(O&&k&&(B=e(q+B,q.length?A-K.length:1/0),q=""),x){case"<":B=X+B+K+q;break;case"=":B=X+q+B+K;break;case"^":B=q.slice(0,te=q.length>>1)+X+B+K+q.slice(te);break;default:B=q+X+B+K;break}return a(B)}return W.toString=function(){return f+""},W}function p(f,g){var v=Math.max(-8,Math.min(8,Math.floor(Xs(g)/3)))*3,x=Math.pow(10,-v),_=d((f=tu(f),f.type="f",f),{suffix:F2[8+v/3]});return function(b){return _(x*b)}}return{format:d,formatPrefix:p}}var yf,k1,EI;FG({thousands:",",grouping:[3],currency:["$",""]});function FG(t){return yf=qG(t),k1=yf.format,EI=yf.formatPrefix,yf}function HG(t){return Math.max(0,-Xs(Math.abs(t)))}function WG(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Xs(e)/3)))*3-Xs(Math.abs(t)))}function GG(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Xs(e)-Xs(t))+1}function OI(t,e,r,n){var i=kx(t,e,r),a;switch(n=tu(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(a=WG(i,o))&&(n.precision=a),EI(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=GG(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=HG(i))&&(n.precision=a-(n.type==="%")*2);break}}return k1(n)}function Ha(t){var e=t.domain;return t.ticks=function(r){var n=e();return _x(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return OI(i[0],i[i.length-1],r??10,n)},t.nice=function(r){r==null&&(r=10);var n=e(),i=0,a=n.length-1,o=n[i],l=n[a],u,d,p=10;for(l<o&&(d=o,o=l,l=d,d=i,i=a,a=d);p-- >0;){if(d=Sx(o,l,r),d===u)return n[i]=o,n[a]=l,e(n);if(d>0)o=Math.floor(o/d)*d,l=Math.ceil(l/d)*d;else if(d<0)o=Math.ceil(o*d)/d,l=Math.floor(l*d)/d;else break;u=d}return t},t}function fh(){var t=_1();return t.copy=function(){return Du(t,fh())},Nn.apply(t,arguments),Ha(t)}function AI(t){var e;function r(n){return n==null||isNaN(n=+n)?e:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(t=Array.from(n,ch),r):t.slice()},r.unknown=function(n){return arguments.length?(e=n,r):e},r.copy=function(){return AI(t).unknown(e)},t=arguments.length?Array.from(t,ch):[0,1],Ha(r)}function TI(t,e){t=t.slice();var r=0,n=t.length-1,i=t[r],a=t[n],o;return a<i&&(o=r,r=n,n=o,o=i,i=a,a=o),t[r]=e.floor(i),t[n]=e.ceil(a),t}function H2(t){return Math.log(t)}function W2(t){return Math.exp(t)}function KG(t){return-Math.log(-t)}function VG(t){return-Math.exp(-t)}function XG(t){return isFinite(t)?+("1e"+t):t<0?0:t}function YG(t){return t===10?XG:t===Math.E?Math.exp:e=>Math.pow(t,e)}function JG(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function G2(t){return(e,r)=>-t(-e,r)}function E1(t){const e=t(H2,W2),r=e.domain;let n=10,i,a;function o(){return i=JG(n),a=YG(n),r()[0]<0?(i=G2(i),a=G2(a),t(KG,VG)):t(H2,W2),e}return e.base=function(l){return arguments.length?(n=+l,o()):n},e.domain=function(l){return arguments.length?(r(l),o()):r()},e.ticks=l=>{const u=r();let d=u[0],p=u[u.length-1];const f=p<d;f&&([d,p]=[p,d]);let g=i(d),v=i(p),x,_;const b=l==null?10:+l;let k=[];if(!(n%1)&&v-g<b){if(g=Math.floor(g),v=Math.ceil(v),d>0){for(;g<=v;++g)for(x=1;x<n;++x)if(_=g<0?x/a(-g):x*a(g),!(_<d)){if(_>p)break;k.push(_)}}else for(;g<=v;++g)for(x=n-1;x>=1;--x)if(_=g>0?x/a(-g):x*a(g),!(_<d)){if(_>p)break;k.push(_)}k.length*2<b&&(k=_x(d,p,b))}else k=_x(g,v,Math.min(v-g,b)).map(a);return f?k.reverse():k},e.tickFormat=(l,u)=>{if(l==null&&(l=10),u==null&&(u=n===10?"s":","),typeof u!="function"&&(!(n%1)&&(u=tu(u)).precision==null&&(u.trim=!0),u=k1(u)),l===1/0)return u;const d=Math.max(1,n*l/e.ticks().length);return p=>{let f=p/a(Math.round(i(p)));return f*n<n-.5&&(f*=n),f<=d?u(p):""}},e.nice=()=>r(TI(r(),{floor:l=>a(Math.floor(i(l))),ceil:l=>a(Math.ceil(i(l)))})),e}function CI(){const t=E1(mp()).domain([1,10]);return t.copy=()=>Du(t,CI()).base(t.base()),Nn.apply(t,arguments),t}function K2(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function V2(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function O1(t){var e=1,r=t(K2(e),V2(e));return r.constant=function(n){return arguments.length?t(K2(e=+n),V2(e)):e},Ha(r)}function jI(){var t=O1(mp());return t.copy=function(){return Du(t,jI()).constant(t.constant())},Nn.apply(t,arguments)}function X2(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function ZG(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function QG(t){return t<0?-t*t:t*t}function A1(t){var e=t(Br,Br),r=1;function n(){return r===1?t(Br,Br):r===.5?t(ZG,QG):t(X2(r),X2(1/r))}return e.exponent=function(i){return arguments.length?(r=+i,n()):r},Ha(e)}function T1(){var t=A1(mp());return t.copy=function(){return Du(t,T1()).exponent(t.exponent())},Nn.apply(t,arguments),t}function eK(){return T1.apply(null,arguments).exponent(.5)}function Y2(t){return Math.sign(t)*t*t}function tK(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function PI(){var t=_1(),e=[0,1],r=!1,n;function i(a){var o=tK(t(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return t.invert(Y2(a))},i.domain=function(a){return arguments.length?(t.domain(a),i):t.domain()},i.range=function(a){return arguments.length?(t.range((e=Array.from(a,ch)).map(Y2)),i):e.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(t.clamp(a),i):t.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return PI(t.domain(),e).round(r).clamp(t.clamp()).unknown(n)},Nn.apply(i,arguments),Ha(i)}function NI(){var t=[],e=[],r=[],n;function i(){var o=0,l=Math.max(1,e.length);for(r=new Array(l-1);++o<l;)r[o-1]=oG(t,o/l);return a}function a(o){return o==null||isNaN(o=+o)?n:e[Mu(r,o)]}return a.invertExtent=function(o){var l=e.indexOf(o);return l<0?[NaN,NaN]:[l>0?r[l-1]:t[0],l<r.length?r[l]:t[t.length-1]]},a.domain=function(o){if(!arguments.length)return t.slice();t=[];for(let l of o)l!=null&&!isNaN(l=+l)&&t.push(l);return t.sort(Ma),i()},a.range=function(o){return arguments.length?(e=Array.from(o),i()):e.slice()},a.unknown=function(o){return arguments.length?(n=o,a):n},a.quantiles=function(){return r.slice()},a.copy=function(){return NI().domain(t).range(e).unknown(n)},Nn.apply(a,arguments)}function RI(){var t=0,e=1,r=1,n=[.5],i=[0,1],a;function o(u){return u!=null&&u<=u?i[Mu(n,u,0,r)]:a}function l(){var u=-1;for(n=new Array(r);++u<r;)n[u]=((u+1)*e-(u-r)*t)/(r+1);return o}return o.domain=function(u){return arguments.length?([t,e]=u,t=+t,e=+e,l()):[t,e]},o.range=function(u){return arguments.length?(r=(i=Array.from(u)).length-1,l()):i.slice()},o.invertExtent=function(u){var d=i.indexOf(u);return d<0?[NaN,NaN]:d<1?[t,n[0]]:d>=r?[n[r-1],e]:[n[d-1],n[d]]},o.unknown=function(u){return arguments.length&&(a=u),o},o.thresholds=function(){return n.slice()},o.copy=function(){return RI().domain([t,e]).range(i).unknown(a)},Nn.apply(Ha(o),arguments)}function II(){var t=[.5],e=[0,1],r,n=1;function i(a){return a!=null&&a<=a?e[Mu(t,a,0,n)]:r}return i.domain=function(a){return arguments.length?(t=Array.from(a),n=Math.min(t.length,e.length-1),i):t.slice()},i.range=function(a){return arguments.length?(e=Array.from(a),n=Math.min(t.length,e.length-1),i):e.slice()},i.invertExtent=function(a){var o=e.indexOf(a);return[t[o-1],t[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return II().domain(t).range(e).unknown(r)},Nn.apply(i,arguments)}const B0=new Date,U0=new Date;function sr(t,e,r,n){function i(a){return t(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(t(a=new Date(+a)),a),i.ceil=a=>(t(a=new Date(a-1)),e(a,1),t(a),a),i.round=a=>{const o=i(a),l=i.ceil(a);return a-o<l-a?o:l},i.offset=(a,o)=>(e(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,l)=>{const u=[];if(a=i.ceil(a),l=l==null?1:Math.floor(l),!(a<o)||!(l>0))return u;let d;do u.push(d=new Date(+a)),e(a,l),t(a);while(d<a&&a<o);return u},i.filter=a=>sr(o=>{if(o>=o)for(;t(o),!a(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;e(o,-1),!a(o););else for(;--l>=0;)for(;e(o,1),!a(o););}),r&&(i.count=(a,o)=>(B0.setTime(+a),U0.setTime(+o),t(B0),t(U0),Math.floor(r(B0,U0))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const hh=sr(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);hh.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?sr(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):hh);hh.range;const qi=1e3,An=qi*60,Fi=An*60,Yi=Fi*24,C1=Yi*7,J2=Yi*30,q0=Yi*365,Eo=sr(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*qi)},(t,e)=>(e-t)/qi,t=>t.getUTCSeconds());Eo.range;const j1=sr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*qi)},(t,e)=>{t.setTime(+t+e*An)},(t,e)=>(e-t)/An,t=>t.getMinutes());j1.range;const P1=sr(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*An)},(t,e)=>(e-t)/An,t=>t.getUTCMinutes());P1.range;const N1=sr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*qi-t.getMinutes()*An)},(t,e)=>{t.setTime(+t+e*Fi)},(t,e)=>(e-t)/Fi,t=>t.getHours());N1.range;const R1=sr(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Fi)},(t,e)=>(e-t)/Fi,t=>t.getUTCHours());R1.range;const zu=sr(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*An)/Yi,t=>t.getDate()-1);zu.range;const gp=sr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Yi,t=>t.getUTCDate()-1);gp.range;const $I=sr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Yi,t=>Math.floor(t/Yi));$I.range;function Uo(t){return sr(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*An)/C1)}const yp=Uo(0),ph=Uo(1),rK=Uo(2),nK=Uo(3),Ys=Uo(4),iK=Uo(5),aK=Uo(6);yp.range;ph.range;rK.range;nK.range;Ys.range;iK.range;aK.range;function qo(t){return sr(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/C1)}const vp=qo(0),mh=qo(1),oK=qo(2),sK=qo(3),Js=qo(4),lK=qo(5),cK=qo(6);vp.range;mh.range;oK.range;sK.range;Js.range;lK.range;cK.range;const I1=sr(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());I1.range;const $1=sr(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());$1.range;const Ji=sr(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());Ji.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:sr(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)});Ji.range;const Zi=sr(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());Zi.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:sr(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)});Zi.range;function MI(t,e,r,n,i,a){const o=[[Eo,1,qi],[Eo,5,5*qi],[Eo,15,15*qi],[Eo,30,30*qi],[a,1,An],[a,5,5*An],[a,15,15*An],[a,30,30*An],[i,1,Fi],[i,3,3*Fi],[i,6,6*Fi],[i,12,12*Fi],[n,1,Yi],[n,2,2*Yi],[r,1,C1],[e,1,J2],[e,3,3*J2],[t,1,q0]];function l(d,p,f){const g=p<d;g&&([d,p]=[p,d]);const v=f&&typeof f.range=="function"?f:u(d,p,f),x=v?v.range(d,+p+1):[];return g?x.reverse():x}function u(d,p,f){const g=Math.abs(p-d)/f,v=y1(([,,b])=>b).right(o,g);if(v===o.length)return t.every(kx(d/q0,p/q0,f));if(v===0)return hh.every(Math.max(kx(d,p,f),1));const[x,_]=o[g/o[v-1][2]<o[v][2]/g?v-1:v];return x.every(_)}return[l,u]}const[uK,dK]=MI(Zi,$1,vp,$I,R1,P1),[fK,hK]=MI(Ji,I1,yp,zu,N1,j1);function F0(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function H0(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function mc(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function pK(t){var e=t.dateTime,r=t.date,n=t.time,i=t.periods,a=t.days,o=t.shortDays,l=t.months,u=t.shortMonths,d=gc(i),p=yc(i),f=gc(a),g=yc(a),v=gc(o),x=yc(o),_=gc(l),b=yc(l),k=gc(u),A=yc(u),O={a:J,A:F,b:te,B:q,c:null,d:nC,e:nC,f:LK,g:KK,G:XK,H:IK,I:$K,j:MK,L:LI,m:DK,M:zK,p:z,q:L,Q:oC,s:sC,S:BK,u:UK,U:qK,V:FK,w:HK,W:WK,x:null,X:null,y:GK,Y:VK,Z:YK,"%":aC},C={a:Z,A:se,b:le,B:ve,c:null,d:iC,e:iC,f:eV,g:uV,G:fV,H:JK,I:ZK,j:QK,L:zI,m:tV,M:rV,p:qe,q:xe,Q:oC,s:sC,S:nV,u:iV,U:aV,V:oV,w:sV,W:lV,x:null,X:null,y:cV,Y:dV,Z:hV,"%":aC},E={a:Y,A:W,b:B,B:X,c:K,d:tC,e:tC,f:jK,g:eC,G:Q2,H:rC,I:rC,j:OK,L:CK,m:EK,M:AK,p:I,q:kK,Q:NK,s:RK,S:TK,u:bK,U:xK,V:wK,w:vK,W:_K,x:U,X:G,y:eC,Y:Q2,Z:SK,"%":PK};O.x=T(r,O),O.X=T(n,O),O.c=T(e,O),C.x=T(r,C),C.X=T(n,C),C.c=T(e,C);function T(ae,Se){return function(Me){var oe=[],tt=-1,Fe=0,kt=ae.length,wt,Et,Sr;for(Me instanceof Date||(Me=new Date(+Me));++tt<kt;)ae.charCodeAt(tt)===37&&(oe.push(ae.slice(Fe,tt)),(Et=Z2[wt=ae.charAt(++tt)])!=null?wt=ae.charAt(++tt):Et=wt==="e"?" ":"0",(Sr=Se[wt])&&(wt=Sr(Me,Et)),oe.push(wt),Fe=tt+1);return oe.push(ae.slice(Fe,tt)),oe.join("")}}function P(ae,Se){return function(Me){var oe=mc(1900,void 0,1),tt=R(oe,ae,Me+="",0),Fe,kt;if(tt!=Me.length)return null;if("Q"in oe)return new Date(oe.Q);if("s"in oe)return new Date(oe.s*1e3+("L"in oe?oe.L:0));if(Se&&!("Z"in oe)&&(oe.Z=0),"p"in oe&&(oe.H=oe.H%12+oe.p*12),oe.m===void 0&&(oe.m="q"in oe?oe.q:0),"V"in oe){if(oe.V<1||oe.V>53)return null;"w"in oe||(oe.w=1),"Z"in oe?(Fe=H0(mc(oe.y,0,1)),kt=Fe.getUTCDay(),Fe=kt>4||kt===0?mh.ceil(Fe):mh(Fe),Fe=gp.offset(Fe,(oe.V-1)*7),oe.y=Fe.getUTCFullYear(),oe.m=Fe.getUTCMonth(),oe.d=Fe.getUTCDate()+(oe.w+6)%7):(Fe=F0(mc(oe.y,0,1)),kt=Fe.getDay(),Fe=kt>4||kt===0?ph.ceil(Fe):ph(Fe),Fe=zu.offset(Fe,(oe.V-1)*7),oe.y=Fe.getFullYear(),oe.m=Fe.getMonth(),oe.d=Fe.getDate()+(oe.w+6)%7)}else("W"in oe||"U"in oe)&&("w"in oe||(oe.w="u"in oe?oe.u%7:"W"in oe?1:0),kt="Z"in oe?H0(mc(oe.y,0,1)).getUTCDay():F0(mc(oe.y,0,1)).getDay(),oe.m=0,oe.d="W"in oe?(oe.w+6)%7+oe.W*7-(kt+5)%7:oe.w+oe.U*7-(kt+6)%7);return"Z"in oe?(oe.H+=oe.Z/100|0,oe.M+=oe.Z%100,H0(oe)):F0(oe)}}function R(ae,Se,Me,oe){for(var tt=0,Fe=Se.length,kt=Me.length,wt,Et;tt<Fe;){if(oe>=kt)return-1;if(wt=Se.charCodeAt(tt++),wt===37){if(wt=Se.charAt(tt++),Et=E[wt in Z2?Se.charAt(tt++):wt],!Et||(oe=Et(ae,Me,oe))<0)return-1}else if(wt!=Me.charCodeAt(oe++))return-1}return oe}function I(ae,Se,Me){var oe=d.exec(Se.slice(Me));return oe?(ae.p=p.get(oe[0].toLowerCase()),Me+oe[0].length):-1}function Y(ae,Se,Me){var oe=v.exec(Se.slice(Me));return oe?(ae.w=x.get(oe[0].toLowerCase()),Me+oe[0].length):-1}function W(ae,Se,Me){var oe=f.exec(Se.slice(Me));return oe?(ae.w=g.get(oe[0].toLowerCase()),Me+oe[0].length):-1}function B(ae,Se,Me){var oe=k.exec(Se.slice(Me));return oe?(ae.m=A.get(oe[0].toLowerCase()),Me+oe[0].length):-1}function X(ae,Se,Me){var oe=_.exec(Se.slice(Me));return oe?(ae.m=b.get(oe[0].toLowerCase()),Me+oe[0].length):-1}function K(ae,Se,Me){return R(ae,e,Se,Me)}function U(ae,Se,Me){return R(ae,r,Se,Me)}function G(ae,Se,Me){return R(ae,n,Se,Me)}function J(ae){return o[ae.getDay()]}function F(ae){return a[ae.getDay()]}function te(ae){return u[ae.getMonth()]}function q(ae){return l[ae.getMonth()]}function z(ae){return i[+(ae.getHours()>=12)]}function L(ae){return 1+~~(ae.getMonth()/3)}function Z(ae){return o[ae.getUTCDay()]}function se(ae){return a[ae.getUTCDay()]}function le(ae){return u[ae.getUTCMonth()]}function ve(ae){return l[ae.getUTCMonth()]}function qe(ae){return i[+(ae.getUTCHours()>=12)]}function xe(ae){return 1+~~(ae.getUTCMonth()/3)}return{format:function(ae){var Se=T(ae+="",O);return Se.toString=function(){return ae},Se},parse:function(ae){var Se=P(ae+="",!1);return Se.toString=function(){return ae},Se},utcFormat:function(ae){var Se=T(ae+="",C);return Se.toString=function(){return ae},Se},utcParse:function(ae){var Se=P(ae+="",!0);return Se.toString=function(){return ae},Se}}}var Z2={"-":"",_:" ",0:"0"},gr=/^\s*\d+/,mK=/^%/,gK=/[\\^$*+?|[\]().{}]/g;function dt(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a<r?new Array(r-a+1).join(e)+i:i)}function yK(t){return t.replace(gK,"\\$&")}function gc(t){return new RegExp("^(?:"+t.map(yK).join("|")+")","i")}function yc(t){return new Map(t.map((e,r)=>[e.toLowerCase(),r]))}function vK(t,e,r){var n=gr.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function bK(t,e,r){var n=gr.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function xK(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function wK(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function _K(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function Q2(t,e,r){var n=gr.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function eC(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function SK(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function kK(t,e,r){var n=gr.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function EK(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function tC(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function OK(t,e,r){var n=gr.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function rC(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function AK(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function TK(t,e,r){var n=gr.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function CK(t,e,r){var n=gr.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function jK(t,e,r){var n=gr.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function PK(t,e,r){var n=mK.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function NK(t,e,r){var n=gr.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function RK(t,e,r){var n=gr.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function nC(t,e){return dt(t.getDate(),e,2)}function IK(t,e){return dt(t.getHours(),e,2)}function $K(t,e){return dt(t.getHours()%12||12,e,2)}function MK(t,e){return dt(1+zu.count(Ji(t),t),e,3)}function LI(t,e){return dt(t.getMilliseconds(),e,3)}function LK(t,e){return LI(t,e)+"000"}function DK(t,e){return dt(t.getMonth()+1,e,2)}function zK(t,e){return dt(t.getMinutes(),e,2)}function BK(t,e){return dt(t.getSeconds(),e,2)}function UK(t){var e=t.getDay();return e===0?7:e}function qK(t,e){return dt(yp.count(Ji(t)-1,t),e,2)}function DI(t){var e=t.getDay();return e>=4||e===0?Ys(t):Ys.ceil(t)}function FK(t,e){return t=DI(t),dt(Ys.count(Ji(t),t)+(Ji(t).getDay()===4),e,2)}function HK(t){return t.getDay()}function WK(t,e){return dt(ph.count(Ji(t)-1,t),e,2)}function GK(t,e){return dt(t.getFullYear()%100,e,2)}function KK(t,e){return t=DI(t),dt(t.getFullYear()%100,e,2)}function VK(t,e){return dt(t.getFullYear()%1e4,e,4)}function XK(t,e){var r=t.getDay();return t=r>=4||r===0?Ys(t):Ys.ceil(t),dt(t.getFullYear()%1e4,e,4)}function YK(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+dt(e/60|0,"0",2)+dt(e%60,"0",2)}function iC(t,e){return dt(t.getUTCDate(),e,2)}function JK(t,e){return dt(t.getUTCHours(),e,2)}function ZK(t,e){return dt(t.getUTCHours()%12||12,e,2)}function QK(t,e){return dt(1+gp.count(Zi(t),t),e,3)}function zI(t,e){return dt(t.getUTCMilliseconds(),e,3)}function eV(t,e){return zI(t,e)+"000"}function tV(t,e){return dt(t.getUTCMonth()+1,e,2)}function rV(t,e){return dt(t.getUTCMinutes(),e,2)}function nV(t,e){return dt(t.getUTCSeconds(),e,2)}function iV(t){var e=t.getUTCDay();return e===0?7:e}function aV(t,e){return dt(vp.count(Zi(t)-1,t),e,2)}function BI(t){var e=t.getUTCDay();return e>=4||e===0?Js(t):Js.ceil(t)}function oV(t,e){return t=BI(t),dt(Js.count(Zi(t),t)+(Zi(t).getUTCDay()===4),e,2)}function sV(t){return t.getUTCDay()}function lV(t,e){return dt(mh.count(Zi(t)-1,t),e,2)}function cV(t,e){return dt(t.getUTCFullYear()%100,e,2)}function uV(t,e){return t=BI(t),dt(t.getUTCFullYear()%100,e,2)}function dV(t,e){return dt(t.getUTCFullYear()%1e4,e,4)}function fV(t,e){var r=t.getUTCDay();return t=r>=4||r===0?Js(t):Js.ceil(t),dt(t.getUTCFullYear()%1e4,e,4)}function hV(){return"+0000"}function aC(){return"%"}function oC(t){return+t}function sC(t){return Math.floor(+t/1e3)}var ks,UI,qI;pV({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 pV(t){return ks=pK(t),UI=ks.format,ks.parse,qI=ks.utcFormat,ks.utcParse,ks}function mV(t){return new Date(t)}function gV(t){return t instanceof Date?+t:+new Date(+t)}function M1(t,e,r,n,i,a,o,l,u,d){var p=_1(),f=p.invert,g=p.domain,v=d(".%L"),x=d(":%S"),_=d("%I:%M"),b=d("%I %p"),k=d("%a %d"),A=d("%b %d"),O=d("%B"),C=d("%Y");function E(T){return(u(T)<T?v:l(T)<T?x:o(T)<T?_:a(T)<T?b:n(T)<T?i(T)<T?k:A:r(T)<T?O:C)(T)}return p.invert=function(T){return new Date(f(T))},p.domain=function(T){return arguments.length?g(Array.from(T,gV)):g().map(mV)},p.ticks=function(T){var P=g();return t(P[0],P[P.length-1],T??10)},p.tickFormat=function(T,P){return P==null?E:d(P)},p.nice=function(T){var P=g();return(!T||typeof T.range!="function")&&(T=e(P[0],P[P.length-1],T??10)),T?g(TI(P,T)):p},p.copy=function(){return Du(p,M1(t,e,r,n,i,a,o,l,u,d))},p}function yV(){return Nn.apply(M1(fK,hK,Ji,I1,yp,zu,N1,j1,Eo,UI).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function vV(){return Nn.apply(M1(uK,dK,Zi,$1,vp,gp,R1,P1,Eo,qI).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function bp(){var t=0,e=1,r,n,i,a,o=Br,l=!1,u;function d(f){return f==null||isNaN(f=+f)?u:o(i===0?.5:(f=(a(f)-r)*i,l?Math.max(0,Math.min(1,f)):f))}d.domain=function(f){return arguments.length?([t,e]=f,r=a(t=+t),n=a(e=+e),i=r===n?0:1/(n-r),d):[t,e]},d.clamp=function(f){return arguments.length?(l=!!f,d):l},d.interpolator=function(f){return arguments.length?(o=f,d):o};function p(f){return function(g){var v,x;return arguments.length?([v,x]=g,o=f(v,x),d):[o(0),o(1)]}}return d.range=p(_l),d.rangeRound=p(w1),d.unknown=function(f){return arguments.length?(u=f,d):u},function(f){return a=f,r=f(t),n=f(e),i=r===n?0:1/(n-r),d}}function Wa(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function FI(){var t=Ha(bp()(Br));return t.copy=function(){return Wa(t,FI())},ia.apply(t,arguments)}function HI(){var t=E1(bp()).domain([1,10]);return t.copy=function(){return Wa(t,HI()).base(t.base())},ia.apply(t,arguments)}function WI(){var t=O1(bp());return t.copy=function(){return Wa(t,WI()).constant(t.constant())},ia.apply(t,arguments)}function L1(){var t=A1(bp());return t.copy=function(){return Wa(t,L1()).exponent(t.exponent())},ia.apply(t,arguments)}function bV(){return L1.apply(null,arguments).exponent(.5)}function GI(){var t=[],e=Br;function r(n){if(n!=null&&!isNaN(n=+n))return e((Mu(t,n,1)-1)/(t.length-1))}return r.domain=function(n){if(!arguments.length)return t.slice();t=[];for(let i of n)i!=null&&!isNaN(i=+i)&&t.push(i);return t.sort(Ma),r},r.interpolator=function(n){return arguments.length?(e=n,r):e},r.range=function(){return t.map((n,i)=>e(i/(t.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>aG(t,a/n))},r.copy=function(){return GI(e).domain(t)},ia.apply(r,arguments)}function xp(){var t=0,e=.5,r=1,n=1,i,a,o,l,u,d=Br,p,f=!1,g;function v(_){return isNaN(_=+_)?g:(_=.5+((_=+p(_))-a)*(n*_<n*a?l:u),d(f?Math.max(0,Math.min(1,_)):_))}v.domain=function(_){return arguments.length?([t,e,r]=_,i=p(t=+t),a=p(e=+e),o=p(r=+r),l=i===a?0:.5/(a-i),u=a===o?0:.5/(o-a),n=a<i?-1:1,v):[t,e,r]},v.clamp=function(_){return arguments.length?(f=!!_,v):f},v.interpolator=function(_){return arguments.length?(d=_,v):d};function x(_){return function(b){var k,A,O;return arguments.length?([k,A,O]=b,d=PG(_,[k,A,O]),v):[d(0),d(.5),d(1)]}}return v.range=x(_l),v.rangeRound=x(w1),v.unknown=function(_){return arguments.length?(g=_,v):g},function(_){return p=_,i=_(t),a=_(e),o=_(r),l=i===a?0:.5/(a-i),u=a===o?0:.5/(o-a),n=a<i?-1:1,v}}function KI(){var t=Ha(xp()(Br));return t.copy=function(){return Wa(t,KI())},ia.apply(t,arguments)}function VI(){var t=E1(xp()).domain([.1,1,10]);return t.copy=function(){return Wa(t,VI()).base(t.base())},ia.apply(t,arguments)}function XI(){var t=O1(xp());return t.copy=function(){return Wa(t,XI()).constant(t.constant())},ia.apply(t,arguments)}function D1(){var t=A1(xp());return t.copy=function(){return Wa(t,D1()).exponent(t.exponent())},ia.apply(t,arguments)}function xV(){return D1.apply(null,arguments).exponent(.5)}const lC=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Jc,scaleDiverging:KI,scaleDivergingLog:VI,scaleDivergingPow:D1,scaleDivergingSqrt:xV,scaleDivergingSymlog:XI,scaleIdentity:AI,scaleImplicit:Ex,scaleLinear:fh,scaleLog:CI,scaleOrdinal:v1,scalePoint:Rc,scalePow:T1,scaleQuantile:NI,scaleQuantize:RI,scaleRadial:PI,scaleSequential:FI,scaleSequentialLog:HI,scaleSequentialPow:L1,scaleSequentialQuantile:GI,scaleSequentialSqrt:bV,scaleSequentialSymlog:WI,scaleSqrt:eK,scaleSymlog:jI,scaleThreshold:II,scaleTime:yV,scaleUtc:vV,tickFormat:OI},Symbol.toStringTag,{value:"Module"}));var W0,cC;function YI(){if(cC)return W0;cC=1;var t=vl();function e(r,n,i){for(var a=-1,o=r.length;++a<o;){var l=r[a],u=n(l);if(u!=null&&(d===void 0?u===u&&!t(u):i(u,d)))var d=u,p=l}return p}return W0=e,W0}var G0,uC;function wV(){if(uC)return G0;uC=1;function t(e,r){return e>r}return G0=t,G0}var K0,dC;function _V(){if(dC)return K0;dC=1;var t=YI(),e=wV(),r=xl();function n(i){return i&&i.length?t(i,r,e):void 0}return K0=n,K0}var SV=_V();const wp=vt(SV);var V0,fC;function kV(){if(fC)return V0;fC=1;function t(e,r){return e<r}return V0=t,V0}var X0,hC;function EV(){if(hC)return X0;hC=1;var t=YI(),e=kV(),r=xl();function n(i){return i&&i.length?t(i,r,e):void 0}return X0=n,X0}var OV=EV();const _p=vt(OV);var Y0,pC;function AV(){if(pC)return Y0;pC=1;var t=e1(),e=Fa(),r=aI(),n=Zr();function i(a,o){var l=n(a)?t:r;return l(a,e(o,3))}return Y0=i,Y0}var J0,mC;function TV(){if(mC)return J0;mC=1;var t=nI(),e=AV();function r(n,i){return t(e(n,i),1)}return J0=r,J0}var CV=TV();const jV=vt(CV);var Z0,gC;function PV(){if(gC)return Z0;gC=1;var t=h1();function e(r,n){return t(r,n)}return Z0=e,Z0}var NV=PV();const Sp=vt(NV);var Sl=1e9,RV={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},B1,It=!0,jn="[DecimalError] ",jo=jn+"Invalid argument: ",z1=jn+"Exponent out of range: ",kl=Math.floor,xo=Math.pow,IV=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,un,mr=1e7,Pt=7,JI=9007199254740991,gh=kl(JI/Pt),Te={};Te.absoluteValue=Te.abs=function(){var t=new this.constructor(this);return t.s&&(t.s=1),t};Te.comparedTo=Te.cmp=function(t){var e,r,n,i,a=this;if(t=new a.constructor(t),a.s!==t.s)return a.s||-t.s;if(a.e!==t.e)return a.e>t.e^a.s<0?1:-1;for(n=a.d.length,i=t.d.length,e=0,r=n<i?n:i;e<r;++e)if(a.d[e]!==t.d[e])return a.d[e]>t.d[e]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};Te.decimalPlaces=Te.dp=function(){var t=this,e=t.d.length-1,r=(e-t.e)*Pt;if(e=t.d[e],e)for(;e%10==0;e/=10)r--;return r<0?0:r};Te.dividedBy=Te.div=function(t){return Vi(this,new this.constructor(t))};Te.dividedToIntegerBy=Te.idiv=function(t){var e=this,r=e.constructor;return St(Vi(e,new r(t),0,1),r.precision)};Te.equals=Te.eq=function(t){return!this.cmp(t)};Te.exponent=function(){return er(this)};Te.greaterThan=Te.gt=function(t){return this.cmp(t)>0};Te.greaterThanOrEqualTo=Te.gte=function(t){return this.cmp(t)>=0};Te.isInteger=Te.isint=function(){return this.e>this.d.length-2};Te.isNegative=Te.isneg=function(){return this.s<0};Te.isPositive=Te.ispos=function(){return this.s>0};Te.isZero=function(){return this.s===0};Te.lessThan=Te.lt=function(t){return this.cmp(t)<0};Te.lessThanOrEqualTo=Te.lte=function(t){return this.cmp(t)<1};Te.logarithm=Te.log=function(t){var e,r=this,n=r.constructor,i=n.precision,a=i+5;if(t===void 0)t=new n(10);else if(t=new n(t),t.s<1||t.eq(un))throw Error(jn+"NaN");if(r.s<1)throw Error(jn+(r.s?"NaN":"-Infinity"));return r.eq(un)?new n(0):(It=!1,e=Vi(ru(r,a),ru(t,a),a),It=!0,St(e,i))};Te.minus=Te.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?e$(e,t):ZI(e,(t.s=-t.s,t))};Te.modulo=Te.mod=function(t){var e,r=this,n=r.constructor,i=n.precision;if(t=new n(t),!t.s)throw Error(jn+"NaN");return r.s?(It=!1,e=Vi(r,t,0,1).times(t),It=!0,r.minus(e)):St(new n(r),i)};Te.naturalExponential=Te.exp=function(){return QI(this)};Te.naturalLogarithm=Te.ln=function(){return ru(this)};Te.negated=Te.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};Te.plus=Te.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?ZI(e,t):e$(e,(t.s=-t.s,t))};Te.precision=Te.sd=function(t){var e,r,n,i=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(jo+t);if(e=er(i)+1,n=i.d.length-1,r=n*Pt+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return t&&e>r?e:r};Te.squareRoot=Te.sqrt=function(){var t,e,r,n,i,a,o,l=this,u=l.constructor;if(l.s<1){if(!l.s)return new u(0);throw Error(jn+"NaN")}for(t=er(l),It=!1,i=Math.sqrt(+l),i==0||i==1/0?(e=wi(l.d),(e.length+t)%2==0&&(e+="0"),i=Math.sqrt(e),t=kl((t+1)/2)-(t<0||t%2),i==1/0?e="5e"+t:(e=i.toExponential(),e=e.slice(0,e.indexOf("e")+1)+t),n=new u(e)):n=new u(i.toString()),r=u.precision,i=o=r+3;;)if(a=n,n=a.plus(Vi(l,a,o+2)).times(.5),wi(a.d).slice(0,o)===(e=wi(n.d)).slice(0,o)){if(e=e.slice(o-3,o+1),i==o&&e=="4999"){if(St(a,r+1,0),a.times(a).eq(l)){n=a;break}}else if(e!="9999")break;o+=4}return It=!0,St(n,r)};Te.times=Te.mul=function(t){var e,r,n,i,a,o,l,u,d,p=this,f=p.constructor,g=p.d,v=(t=new f(t)).d;if(!p.s||!t.s)return new f(0);for(t.s*=p.s,r=p.e+t.e,u=g.length,d=v.length,u<d&&(a=g,g=v,v=a,o=u,u=d,d=o),a=[],o=u+d,n=o;n--;)a.push(0);for(n=d;--n>=0;){for(e=0,i=u+n;i>n;)l=a[i]+v[n]*g[i-n-1]+e,a[i--]=l%mr|0,e=l/mr|0;a[i]=(a[i]+e)%mr|0}for(;!a[--o];)a.pop();return e?++r:a.shift(),t.d=a,t.e=r,It?St(t,f.precision):t};Te.toDecimalPlaces=Te.todp=function(t,e){var r=this,n=r.constructor;return r=new n(r),t===void 0?r:(ki(t,0,Sl),e===void 0?e=n.rounding:ki(e,0,8),St(r,t+er(r)+1,e))};Te.toExponential=function(t,e){var r,n=this,i=n.constructor;return t===void 0?r=Io(n,!0):(ki(t,0,Sl),e===void 0?e=i.rounding:ki(e,0,8),n=St(new i(n),t+1,e),r=Io(n,!0,t+1)),r};Te.toFixed=function(t,e){var r,n,i=this,a=i.constructor;return t===void 0?Io(i):(ki(t,0,Sl),e===void 0?e=a.rounding:ki(e,0,8),n=St(new a(i),t+er(i)+1,e),r=Io(n.abs(),!1,t+er(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};Te.toInteger=Te.toint=function(){var t=this,e=t.constructor;return St(new e(t),er(t)+1,e.rounding)};Te.toNumber=function(){return+this};Te.toPower=Te.pow=function(t){var e,r,n,i,a,o,l=this,u=l.constructor,d=12,p=+(t=new u(t));if(!t.s)return new u(un);if(l=new u(l),!l.s){if(t.s<1)throw Error(jn+"Infinity");return l}if(l.eq(un))return l;if(n=u.precision,t.eq(un))return St(l,n);if(e=t.e,r=t.d.length-1,o=e>=r,a=l.s,o){if((r=p<0?-p:p)<=JI){for(i=new u(un),e=Math.ceil(n/Pt+4),It=!1;r%2&&(i=i.times(l),vC(i.d,e)),r=kl(r/2),r!==0;)l=l.times(l),vC(l.d,e);return It=!0,t.s<0?new u(un).div(i):St(i,n)}}else if(a<0)throw Error(jn+"NaN");return a=a<0&&t.d[Math.max(e,r)]&1?-1:1,l.s=1,It=!1,i=t.times(ru(l,n+d)),It=!0,i=QI(i),i.s=a,i};Te.toPrecision=function(t,e){var r,n,i=this,a=i.constructor;return t===void 0?(r=er(i),n=Io(i,r<=a.toExpNeg||r>=a.toExpPos)):(ki(t,1,Sl),e===void 0?e=a.rounding:ki(e,0,8),i=St(new a(i),t,e),r=er(i),n=Io(i,t<=r||r<=a.toExpNeg,t)),n};Te.toSignificantDigits=Te.tosd=function(t,e){var r=this,n=r.constructor;return t===void 0?(t=n.precision,e=n.rounding):(ki(t,1,Sl),e===void 0?e=n.rounding:ki(e,0,8)),St(new n(r),t,e)};Te.toString=Te.valueOf=Te.val=Te.toJSON=Te[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=er(t),r=t.constructor;return Io(t,e<=r.toExpNeg||e>=r.toExpPos)};function ZI(t,e){var r,n,i,a,o,l,u,d,p=t.constructor,f=p.precision;if(!t.s||!e.s)return e.s||(e=new p(t)),It?St(e,f):e;if(u=t.d,d=e.d,o=t.e,i=e.e,u=u.slice(),a=o-i,a){for(a<0?(n=u,a=-a,l=d.length):(n=d,i=o,l=u.length),o=Math.ceil(f/Pt),l=o>l?o+1:l+1,a>l&&(a=l,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(l=u.length,a=d.length,l-a<0&&(a=l,n=d,d=u,u=n),r=0;a;)r=(u[--a]=u[a]+d[a]+r)/mr|0,u[a]%=mr;for(r&&(u.unshift(r),++i),l=u.length;u[--l]==0;)u.pop();return e.d=u,e.e=i,It?St(e,f):e}function ki(t,e,r){if(t!==~~t||t<e||t>r)throw Error(jo+t)}function wi(t){var e,r,n,i=t.length-1,a="",o=t[0];if(i>0){for(a+=o,e=1;e<i;e++)n=t[e]+"",r=Pt-n.length,r&&(a+=Ca(r)),a+=n;o=t[e],n=o+"",r=Pt-n.length,r&&(a+=Ca(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var Vi=(function(){function t(n,i){var a,o=0,l=n.length;for(n=n.slice();l--;)a=n[l]*i+o,n[l]=a%mr|0,o=a/mr|0;return o&&n.unshift(o),n}function e(n,i,a,o){var l,u;if(a!=o)u=a>o?1:-1;else for(l=u=0;l<a;l++)if(n[l]!=i[l]){u=n[l]>i[l]?1:-1;break}return u}function r(n,i,a){for(var o=0;a--;)n[a]-=o,o=n[a]<i[a]?1:0,n[a]=o*mr+n[a]-i[a];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,a,o){var l,u,d,p,f,g,v,x,_,b,k,A,O,C,E,T,P,R,I=n.constructor,Y=n.s==i.s?1:-1,W=n.d,B=i.d;if(!n.s)return new I(n);if(!i.s)throw Error(jn+"Division by zero");for(u=n.e-i.e,P=B.length,E=W.length,v=new I(Y),x=v.d=[],d=0;B[d]==(W[d]||0);)++d;if(B[d]>(W[d]||0)&&--u,a==null?A=a=I.precision:o?A=a+(er(n)-er(i))+1:A=a,A<0)return new I(0);if(A=A/Pt+2|0,d=0,P==1)for(p=0,B=B[0],A++;(d<E||p)&&A--;d++)O=p*mr+(W[d]||0),x[d]=O/B|0,p=O%B|0;else{for(p=mr/(B[0]+1)|0,p>1&&(B=t(B,p),W=t(W,p),P=B.length,E=W.length),C=P,_=W.slice(0,P),b=_.length;b<P;)_[b++]=0;R=B.slice(),R.unshift(0),T=B[0],B[1]>=mr/2&&++T;do p=0,l=e(B,_,P,b),l<0?(k=_[0],P!=b&&(k=k*mr+(_[1]||0)),p=k/T|0,p>1?(p>=mr&&(p=mr-1),f=t(B,p),g=f.length,b=_.length,l=e(f,_,g,b),l==1&&(p--,r(f,P<g?R:B,g))):(p==0&&(l=p=1),f=B.slice()),g=f.length,g<b&&f.unshift(0),r(_,f,b),l==-1&&(b=_.length,l=e(B,_,P,b),l<1&&(p++,r(_,P<b?R:B,b))),b=_.length):l===0&&(p++,_=[0]),x[d++]=p,l&&_[0]?_[b++]=W[C]||0:(_=[W[C]],b=1);while((C++<E||_[0]!==void 0)&&A--)}return x[0]||x.shift(),v.e=u,St(v,o?a+er(v)+1:a)}})();function QI(t,e){var r,n,i,a,o,l,u=0,d=0,p=t.constructor,f=p.precision;if(er(t)>16)throw Error(z1+er(t));if(!t.s)return new p(un);for(It=!1,l=f,o=new p(.03125);t.abs().gte(.1);)t=t.times(o),d+=5;for(n=Math.log(xo(2,d))/Math.LN10*2+5|0,l+=n,r=i=a=new p(un),p.precision=l;;){if(i=St(i.times(t),l),r=r.times(++u),o=a.plus(Vi(i,r,l)),wi(o.d).slice(0,l)===wi(a.d).slice(0,l)){for(;d--;)a=St(a.times(a),l);return p.precision=f,e==null?(It=!0,St(a,f)):a}a=o}}function er(t){for(var e=t.e*Pt,r=t.d[0];r>=10;r/=10)e++;return e}function Q0(t,e,r){if(e>t.LN10.sd())throw It=!0,r&&(t.precision=r),Error(jn+"LN10 precision limit exceeded");return St(new t(t.LN10),e)}function Ca(t){for(var e="";t--;)e+="0";return e}function ru(t,e){var r,n,i,a,o,l,u,d,p,f=1,g=10,v=t,x=v.d,_=v.constructor,b=_.precision;if(v.s<1)throw Error(jn+(v.s?"NaN":"-Infinity"));if(v.eq(un))return new _(0);if(e==null?(It=!1,d=b):d=e,v.eq(10))return e==null&&(It=!0),Q0(_,d);if(d+=g,_.precision=d,r=wi(x),n=r.charAt(0),a=er(v),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)v=v.times(t),r=wi(v.d),n=r.charAt(0),f++;a=er(v),n>1?(v=new _("0."+r),a++):v=new _(n+"."+r.slice(1))}else return u=Q0(_,d+2,b).times(a+""),v=ru(new _(n+"."+r.slice(1)),d-g).plus(u),_.precision=b,e==null?(It=!0,St(v,b)):v;for(l=o=v=Vi(v.minus(un),v.plus(un),d),p=St(v.times(v),d),i=3;;){if(o=St(o.times(p),d),u=l.plus(Vi(o,new _(i),d)),wi(u.d).slice(0,d)===wi(l.d).slice(0,d))return l=l.times(2),a!==0&&(l=l.plus(Q0(_,d+2,b).times(a+""))),l=Vi(l,new _(f),d),_.precision=b,e==null?(It=!0,St(l,b)):l;l=u,i+=2}}function yC(t,e){var r,n,i;for((r=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(r<0&&(r=n),r+=+e.slice(n+1),e=e.substring(0,n)):r<0&&(r=e.length),n=0;e.charCodeAt(n)===48;)++n;for(i=e.length;e.charCodeAt(i-1)===48;)--i;if(e=e.slice(n,i),e){if(i-=n,r=r-n-1,t.e=kl(r/Pt),t.d=[],n=(r+1)%Pt,r<0&&(n+=Pt),n<i){for(n&&t.d.push(+e.slice(0,n)),i-=Pt;n<i;)t.d.push(+e.slice(n,n+=Pt));e=e.slice(n),n=Pt-e.length}else n-=i;for(;n--;)e+="0";if(t.d.push(+e),It&&(t.e>gh||t.e<-gh))throw Error(z1+r)}else t.s=0,t.e=0,t.d=[0];return t}function St(t,e,r){var n,i,a,o,l,u,d,p,f=t.d;for(o=1,a=f[0];a>=10;a/=10)o++;if(n=e-o,n<0)n+=Pt,i=e,d=f[p=0];else{if(p=Math.ceil((n+1)/Pt),a=f.length,p>=a)return t;for(d=a=f[p],o=1;a>=10;a/=10)o++;n%=Pt,i=n-Pt+o}if(r!==void 0&&(a=xo(10,o-i-1),l=d/a%10|0,u=e<0||f[p+1]!==void 0||d%a,u=r<4?(l||u)&&(r==0||r==(t.s<0?3:2)):l>5||l==5&&(r==4||u||r==6&&(n>0?i>0?d/xo(10,o-i):0:f[p-1])%10&1||r==(t.s<0?8:7))),e<1||!f[0])return u?(a=er(t),f.length=1,e=e-a-1,f[0]=xo(10,(Pt-e%Pt)%Pt),t.e=kl(-e/Pt)||0):(f.length=1,f[0]=t.e=t.s=0),t;if(n==0?(f.length=p,a=1,p--):(f.length=p+1,a=xo(10,Pt-n),f[p]=i>0?(d/xo(10,o-i)%xo(10,i)|0)*a:0),u)for(;;)if(p==0){(f[0]+=a)==mr&&(f[0]=1,++t.e);break}else{if(f[p]+=a,f[p]!=mr)break;f[p--]=0,a=1}for(n=f.length;f[--n]===0;)f.pop();if(It&&(t.e>gh||t.e<-gh))throw Error(z1+er(t));return t}function e$(t,e){var r,n,i,a,o,l,u,d,p,f,g=t.constructor,v=g.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new g(t),It?St(e,v):e;if(u=t.d,f=e.d,n=e.e,d=t.e,u=u.slice(),o=d-n,o){for(p=o<0,p?(r=u,o=-o,l=f.length):(r=f,n=d,l=u.length),i=Math.max(Math.ceil(v/Pt),l)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=u.length,l=f.length,p=i<l,p&&(l=i),i=0;i<l;i++)if(u[i]!=f[i]){p=u[i]<f[i];break}o=0}for(p&&(r=u,u=f,f=r,e.s=-e.s),l=u.length,i=f.length-l;i>0;--i)u[l++]=0;for(i=f.length;i>o;){if(u[--i]<f[i]){for(a=i;a&&u[--a]===0;)u[a]=mr-1;--u[a],u[i]+=mr}u[i]-=f[i]}for(;u[--l]===0;)u.pop();for(;u[0]===0;u.shift())--n;return u[0]?(e.d=u,e.e=n,It?St(e,v):e):new g(0)}function Io(t,e,r){var n,i=er(t),a=wi(t.d),o=a.length;return e?(r&&(n=r-o)>0?a=a.charAt(0)+"."+a.slice(1)+Ca(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Ca(-i-1)+a,r&&(n=r-o)>0&&(a+=Ca(n))):i>=o?(a+=Ca(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+Ca(n))):((n=i+1)<o&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-o)>0&&(i+1===o&&(a+="."),a+=Ca(n))),t.s<0?"-"+a:a}function vC(t,e){if(t.length>e)return t.length=e,!0}function t$(t){var e,r,n;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(jo+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return yC(o,a.toString())}else if(typeof a!="string")throw Error(jo+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,IV.test(a))yC(o,a);else throw Error(jo+a)}if(i.prototype=Te,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=t$,i.config=i.set=$V,t===void 0&&(t={}),t)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],e=0;e<n.length;)t.hasOwnProperty(r=n[e++])||(t[r]=this[r]);return i.config(t),i}function $V(t){if(!t||typeof t!="object")throw Error(jn+"Object expected");var e,r,n,i=["precision",1,Sl,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(e=0;e<i.length;e+=3)if((n=t[r=i[e]])!==void 0)if(kl(n)===n&&n>=i[e+1]&&n<=i[e+2])this[r]=n;else throw Error(jo+r+": "+n);if((n=t[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(jo+r+": "+n);return this}var B1=t$(RV);un=new B1(1);const xt=B1;function MV(t){return BV(t)||zV(t)||DV(t)||LV()}function LV(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
454
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DV(t,e){if(t){if(typeof t=="string")return Cx(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Cx(t,e)}}function zV(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function BV(t){if(Array.isArray(t))return Cx(t)}function Cx(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var UV=function(e){return e},r$={},n$=function(e){return e===r$},bC=function(e){return function r(){return arguments.length===0||arguments.length===1&&n$(arguments.length<=0?void 0:arguments[0])?r:e.apply(void 0,arguments)}},qV=function t(e,r){return e===1?r:bC(function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];var o=i.filter(function(l){return l!==r$}).length;return o>=e?r.apply(void 0,i):t(e-o,bC(function(){for(var l=arguments.length,u=new Array(l),d=0;d<l;d++)u[d]=arguments[d];var p=i.map(function(f){return n$(f)?u.shift():f});return r.apply(void 0,MV(p).concat(u))}))})},kp=function(e){return qV(e.length,e)},jx=function(e,r){for(var n=[],i=e;i<r;++i)n[i-e]=i;return n},FV=kp(function(t,e){return Array.isArray(e)?e.map(t):Object.keys(e).map(function(r){return e[r]}).map(t)}),HV=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];if(!r.length)return UV;var i=r.reverse(),a=i[0],o=i.slice(1);return function(){return o.reduce(function(l,u){return u(l)},a.apply(void 0,arguments))}},Px=function(e){return Array.isArray(e)?e.reverse():e.split("").reverse.join("")},i$=function(e){var r=null,n=null;return function(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return r&&a.every(function(l,u){return l===r[u]})||(r=a,n=e.apply(void 0,a)),n}};function WV(t){var e;return t===0?e=1:e=Math.floor(new xt(t).abs().log(10).toNumber())+1,e}function GV(t,e,r){for(var n=new xt(t),i=0,a=[];n.lt(e)&&i<1e5;)a.push(n.toNumber()),n=n.add(r),i++;return a}var KV=kp(function(t,e,r){var n=+t,i=+e;return n+r*(i-n)}),VV=kp(function(t,e,r){var n=e-+t;return n=n||1/0,(r-t)/n}),XV=kp(function(t,e,r){var n=e-+t;return n=n||1/0,Math.max(0,Math.min(1,(r-t)/n))});const Ep={rangeStep:GV,getDigitCount:WV,interpolateNumber:KV,uninterpolateNumber:VV,uninterpolateTruncation:XV};function Nx(t){return ZV(t)||JV(t)||a$(t)||YV()}function YV(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
455
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JV(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function ZV(t){if(Array.isArray(t))return Rx(t)}function nu(t,e){return tX(t)||eX(t,e)||a$(t,e)||QV()}function QV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
456
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a$(t,e){if(t){if(typeof t=="string")return Rx(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Rx(t,e)}}function Rx(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function eX(t,e){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(t)))){var r=[],n=!0,i=!1,a=void 0;try{for(var o=t[Symbol.iterator](),l;!(n=(l=o.next()).done)&&(r.push(l.value),!(e&&r.length===e));n=!0);}catch(u){i=!0,a=u}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}}function tX(t){if(Array.isArray(t))return t}function o$(t){var e=nu(t,2),r=e[0],n=e[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function s$(t,e,r){if(t.lte(0))return new xt(0);var n=Ep.getDigitCount(t.toNumber()),i=new xt(10).pow(n),a=t.div(i),o=n!==1?.05:.1,l=new xt(Math.ceil(a.div(o).toNumber())).add(r).mul(o),u=l.mul(i);return e?u:new xt(Math.ceil(u))}function rX(t,e,r){var n=1,i=new xt(t);if(!i.isint()&&r){var a=Math.abs(t);a<1?(n=new xt(10).pow(Ep.getDigitCount(t)-1),i=new xt(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new xt(Math.floor(t)))}else t===0?i=new xt(Math.floor((e-1)/2)):r||(i=new xt(Math.floor(t)));var o=Math.floor((e-1)/2),l=HV(FV(function(u){return i.add(new xt(u-o).mul(n)).toNumber()}),jx);return l(0,e)}function l$(t,e,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((e-t)/(r-1)))return{step:new xt(0),tickMin:new xt(0),tickMax:new xt(0)};var a=s$(new xt(e).sub(t).div(r-1),n,i),o;t<=0&&e>=0?o=new xt(0):(o=new xt(t).add(e).div(2),o=o.sub(new xt(o).mod(a)));var l=Math.ceil(o.sub(t).div(a).toNumber()),u=Math.ceil(new xt(e).sub(o).div(a).toNumber()),d=l+u+1;return d>r?l$(t,e,r,n,i+1):(d<r&&(u=e>0?u+(r-d):u,l=e>0?l:l+(r-d)),{step:a,tickMin:o.sub(new xt(l).mul(a)),tickMax:o.add(new xt(u).mul(a))})}function nX(t){var e=nu(t,2),r=e[0],n=e[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),l=o$([r,n]),u=nu(l,2),d=u[0],p=u[1];if(d===-1/0||p===1/0){var f=p===1/0?[d].concat(Nx(jx(0,i-1).map(function(){return 1/0}))):[].concat(Nx(jx(0,i-1).map(function(){return-1/0})),[p]);return r>n?Px(f):f}if(d===p)return rX(d,i,a);var g=l$(d,p,o,a),v=g.step,x=g.tickMin,_=g.tickMax,b=Ep.rangeStep(x,_.add(new xt(.1).mul(v)),v);return r>n?Px(b):b}function iX(t,e){var r=nu(t,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=o$([n,i]),l=nu(o,2),u=l[0],d=l[1];if(u===-1/0||d===1/0)return[n,i];if(u===d)return[u];var p=Math.max(e,2),f=s$(new xt(d).sub(u).div(p-1),a,0),g=[].concat(Nx(Ep.rangeStep(new xt(u),new xt(d).sub(new xt(.99).mul(f)),f)),[d]);return n>i?Px(g):g}var aX=i$(nX),oX=i$(iX),sX="Invariant failed";function $o(t,e){throw new Error(sX)}var lX=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Zs(t){"@babel/helpers - typeof";return Zs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zs(t)}function yh(){return yh=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},yh.apply(this,arguments)}function cX(t,e){return hX(t)||fX(t,e)||dX(t,e)||uX()}function uX(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
457
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dX(t,e){if(t){if(typeof t=="string")return xC(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xC(t,e)}}function xC(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function fX(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,l=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return l}}function hX(t){if(Array.isArray(t))return t}function pX(t,e){if(t==null)return{};var r=mX(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function mX(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function gX(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function yX(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,d$(n.key),n)}}function vX(t,e,r){return e&&yX(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function bX(t,e,r){return e=vh(e),xX(t,c$()?Reflect.construct(e,r||[],vh(t).constructor):e.apply(t,r))}function xX(t,e){if(e&&(Zs(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wX(t)}function wX(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function c$(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(c$=function(){return!!t})()}function vh(t){return vh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},vh(t)}function _X(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ix(t,e)}function Ix(t,e){return Ix=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Ix(t,e)}function u$(t,e,r){return e=d$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function d$(t){var e=SX(t,"string");return Zs(e)=="symbol"?e:e+""}function SX(t,e){if(Zs(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Zs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Bu=(function(t){function e(){return gX(this,e),bX(this,e,arguments)}return _X(e,t),vX(e,[{key:"render",value:function(){var n=this.props,i=n.offset,a=n.layout,o=n.width,l=n.dataKey,u=n.data,d=n.dataPointFormatter,p=n.xAxis,f=n.yAxis,g=pX(n,lX),v=it(g,!1);this.props.direction==="x"&&p.type!=="number"&&$o();var x=u.map(function(_){var b=d(_,l),k=b.x,A=b.y,O=b.value,C=b.errorVal;if(!C)return null;var E=[],T,P;if(Array.isArray(C)){var R=cX(C,2);T=R[0],P=R[1]}else T=P=C;if(a==="vertical"){var I=p.scale,Y=A+i,W=Y+o,B=Y-o,X=I(O-T),K=I(O+P);E.push({x1:K,y1:W,x2:K,y2:B}),E.push({x1:X,y1:Y,x2:K,y2:Y}),E.push({x1:X,y1:W,x2:X,y2:B})}else if(a==="horizontal"){var U=f.scale,G=k+i,J=G-o,F=G+o,te=U(O-T),q=U(O+P);E.push({x1:J,y1:q,x2:F,y2:q}),E.push({x1:G,y1:te,x2:G,y2:q}),E.push({x1:J,y1:te,x2:F,y2:te})}return $.createElement(Xt,yh({className:"recharts-errorBar",key:"bar-".concat(E.map(function(z){return"".concat(z.x1,"-").concat(z.x2,"-").concat(z.y1,"-").concat(z.y2)}))},v),E.map(function(z){return $.createElement("line",yh({},z,{key:"line-".concat(z.x1,"-").concat(z.x2,"-").concat(z.y1,"-").concat(z.y2)}))}))});return $.createElement(Xt,{className:"recharts-errorBars"},x)}}])})($.Component);u$(Bu,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});u$(Bu,"displayName","ErrorBar");function iu(t){"@babel/helpers - typeof";return iu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},iu(t)}function wC(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function yo(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?wC(Object(r),!0).forEach(function(n){kX(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function kX(t,e,r){return e=EX(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function EX(t){var e=OX(t,"string");return iu(e)=="symbol"?e:e+""}function OX(t,e){if(iu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(iu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var f$=function(e){var r=e.children,n=e.formattedGraphicalItems,i=e.legendWidth,a=e.legendContent,o=sn(r,Bs);if(!o)return null;var l=Bs.defaultProps,u=l!==void 0?yo(yo({},l),o.props):{},d;return o.props&&o.props.payload?d=o.props&&o.props.payload:a==="children"?d=(n||[]).reduce(function(p,f){var g=f.item,v=f.props,x=v.sectors||v.data||[];return p.concat(x.map(function(_){return{type:o.props.iconType||g.props.legendType,value:_.name,color:_.fill,payload:_}}))},[]):d=(n||[]).map(function(p){var f=p.item,g=f.type.defaultProps,v=g!==void 0?yo(yo({},g),f.props):{},x=v.dataKey,_=v.name,b=v.legendType,k=v.hide;return{inactive:k,dataKey:x,type:u.iconType||b||"square",color:U1(f),value:_||x,payload:v}}),yo(yo(yo({},u),Bs.getWithHeight(o,i)),{},{payload:d,item:o})};function au(t){"@babel/helpers - typeof";return au=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},au(t)}function _C(t){return jX(t)||CX(t)||TX(t)||AX()}function AX(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
458
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function TX(t,e){if(t){if(typeof t=="string")return $x(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $x(t,e)}}function CX(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function jX(t){if(Array.isArray(t))return $x(t)}function $x(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function SC(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ht(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?SC(Object(r),!0).forEach(function(n){qs(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):SC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function qs(t,e,r){return e=PX(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function PX(t){var e=NX(t,"string");return au(e)=="symbol"?e:e+""}function NX(t,e){if(au(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(au(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function dn(t,e,r){return Qe(t)||Qe(e)?r:or(e)?Tn(t,e,r):Ye(e)?e(t):r}function Ic(t,e,r,n){var i=jV(t,function(l){return dn(l,e)});if(r==="number"){var a=i.filter(function(l){return ge(l)||parseFloat(l)});return a.length?[_p(a),wp(a)]:[1/0,-1/0]}var o=n?i.filter(function(l){return!Qe(l)}):i;return o.map(function(l){return or(l)||l instanceof Date?l:""})}var RX=function(e){var r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,l=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(l<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var u=a.range,d=0;d<l;d++){var p=d>0?i[d-1].coordinate:i[l-1].coordinate,f=i[d].coordinate,g=d>=l-1?i[0].coordinate:i[d+1].coordinate,v=void 0;if(Jn(f-p)!==Jn(g-f)){var x=[];if(Jn(g-f)===Jn(u[1]-u[0])){v=g;var _=f+u[1]-u[0];x[0]=Math.min(_,(_+p)/2),x[1]=Math.max(_,(_+p)/2)}else{v=p;var b=g+u[1]-u[0];x[0]=Math.min(f,(b+f)/2),x[1]=Math.max(f,(b+f)/2)}var k=[Math.min(f,(v+f)/2),Math.max(f,(v+f)/2)];if(e>k[0]&&e<=k[1]||e>=x[0]&&e<=x[1]){o=i[d].index;break}}else{var A=Math.min(p,g),O=Math.max(p,g);if(e>(A+f)/2&&e<=(O+f)/2){o=i[d].index;break}}}else for(var C=0;C<l;C++)if(C===0&&e<=(n[C].coordinate+n[C+1].coordinate)/2||C>0&&C<l-1&&e>(n[C].coordinate+n[C-1].coordinate)/2&&e<=(n[C].coordinate+n[C+1].coordinate)/2||C===l-1&&e>(n[C].coordinate+n[C-1].coordinate)/2){o=n[C].index;break}return o},U1=function(e){var r,n=e,i=n.type.displayName,a=(r=e.type)!==null&&r!==void 0&&r.defaultProps?Ht(Ht({},e.type.defaultProps),e.props):e.props,o=a.stroke,l=a.fill,u;switch(i){case"Line":u=o;break;case"Area":case"Radar":u=o&&o!=="none"?o:l;break;default:u=l;break}return u},IX=function(e){var r=e.barSize,n=e.totalSize,i=e.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var o={},l=Object.keys(a),u=0,d=l.length;u<d;u++)for(var p=a[l[u]].stackGroups,f=Object.keys(p),g=0,v=f.length;g<v;g++){var x=p[f[g]],_=x.items,b=x.cateAxisId,k=_.filter(function(P){return Gi(P.type).indexOf("Bar")>=0});if(k&&k.length){var A=k[0].type.defaultProps,O=A!==void 0?Ht(Ht({},A),k[0].props):k[0].props,C=O.barSize,E=O[b];o[E]||(o[E]=[]);var T=Qe(C)?r:C;o[E].push({item:k[0],stackList:k.slice(1),barSize:Qe(T)?void 0:Ro(T,n,0)})}}return o},$X=function(e){var r=e.barGap,n=e.barCategoryGap,i=e.bandSize,a=e.sizeList,o=a===void 0?[]:a,l=e.maxBarSize,u=o.length;if(u<1)return null;var d=Ro(r,i,0,!0),p,f=[];if(o[0].barSize===+o[0].barSize){var g=!1,v=i/u,x=o.reduce(function(C,E){return C+E.barSize||0},0);x+=(u-1)*d,x>=i&&(x-=(u-1)*d,d=0),x>=i&&v>0&&(g=!0,v*=.9,x=u*v);var _=(i-x)/2>>0,b={offset:_-d,size:0};p=o.reduce(function(C,E){var T={item:E.item,position:{offset:b.offset+b.size+d,size:g?v:E.barSize}},P=[].concat(_C(C),[T]);return b=P[P.length-1].position,E.stackList&&E.stackList.length&&E.stackList.forEach(function(R){P.push({item:R,position:b})}),P},f)}else{var k=Ro(n,i,0,!0);i-2*k-(u-1)*d<=0&&(d=0);var A=(i-2*k-(u-1)*d)/u;A>1&&(A>>=0);var O=l===+l?Math.min(A,l):A;p=o.reduce(function(C,E,T){var P=[].concat(_C(C),[{item:E.item,position:{offset:k+(A+d)*T+(A-O)/2,size:O}}]);return E.stackList&&E.stackList.length&&E.stackList.forEach(function(R){P.push({item:R,position:P[P.length-1].position})}),P},f)}return p},MX=function(e,r,n,i){var a=n.children,o=n.width,l=n.margin,u=o-(l.left||0)-(l.right||0),d=f$({children:a,legendWidth:u});if(d){var p=i||{},f=p.width,g=p.height,v=d.align,x=d.verticalAlign,_=d.layout;if((_==="vertical"||_==="horizontal"&&x==="middle")&&v!=="center"&&ge(e[v]))return Ht(Ht({},e),{},qs({},v,e[v]+(f||0)));if((_==="horizontal"||_==="vertical"&&v==="center")&&x!=="middle"&&ge(e[x]))return Ht(Ht({},e),{},qs({},x,e[x]+(g||0)))}return e},LX=function(e,r,n){return Qe(r)?!0:e==="horizontal"?r==="yAxis":e==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},h$=function(e,r,n,i,a){var o=r.props.children,l=Cn(o,Bu).filter(function(d){return LX(i,a,d.props.direction)});if(l&&l.length){var u=l.map(function(d){return d.props.dataKey});return e.reduce(function(d,p){var f=dn(p,n);if(Qe(f))return d;var g=Array.isArray(f)?[_p(f),wp(f)]:[f,f],v=u.reduce(function(x,_){var b=dn(p,_,0),k=g[0]-Math.abs(Array.isArray(b)?b[0]:b),A=g[1]+Math.abs(Array.isArray(b)?b[1]:b);return[Math.min(k,x[0]),Math.max(A,x[1])]},[1/0,-1/0]);return[Math.min(v[0],d[0]),Math.max(v[1],d[1])]},[1/0,-1/0])}return null},DX=function(e,r,n,i,a){var o=r.map(function(l){return h$(e,l,n,a,i)}).filter(function(l){return!Qe(l)});return o&&o.length?o.reduce(function(l,u){return[Math.min(l[0],u[0]),Math.max(l[1],u[1])]},[1/0,-1/0]):null},p$=function(e,r,n,i,a){var o=r.map(function(u){var d=u.props.dataKey;return n==="number"&&d&&h$(e,u,d,i)||Ic(e,d,n,a)});if(n==="number")return o.reduce(function(u,d){return[Math.min(u[0],d[0]),Math.max(u[1],d[1])]},[1/0,-1/0]);var l={};return o.reduce(function(u,d){for(var p=0,f=d.length;p<f;p++)l[d[p]]||(l[d[p]]=!0,u.push(d[p]));return u},[])},m$=function(e,r){return e==="horizontal"&&r==="xAxis"||e==="vertical"&&r==="yAxis"||e==="centric"&&r==="angleAxis"||e==="radial"&&r==="radiusAxis"},g$=function(e,r,n,i){if(i)return e.map(function(u){return u.coordinate});var a,o,l=e.map(function(u){return u.coordinate===r&&(a=!0),u.coordinate===n&&(o=!0),u.coordinate});return a||l.push(r),o||l.push(n),l},Hi=function(e,r,n){if(!e)return null;var i=e.scale,a=e.duplicateDomain,o=e.type,l=e.range,u=e.realScaleType==="scaleBand"?i.bandwidth()/2:2,d=(r||n)&&o==="category"&&i.bandwidth?i.bandwidth()/u:0;if(d=e.axisType==="angleAxis"&&(l==null?void 0:l.length)>=2?Jn(l[0]-l[1])*2*d:d,r&&(e.ticks||e.niceTicks)){var p=(e.ticks||e.niceTicks).map(function(f){var g=a?a.indexOf(f):f;return{coordinate:i(g)+d,value:f,offset:d}});return p.filter(function(f){return!Ru(f.coordinate)})}return e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(f,g){return{coordinate:i(f)+d,value:f,index:g,offset:d}}):i.ticks&&!n?i.ticks(e.tickCount).map(function(f){return{coordinate:i(f)+d,value:f,offset:d}}):i.domain().map(function(f,g){return{coordinate:i(f)+d,value:a?a[f]:f,index:g,offset:d}})},eb=new WeakMap,vf=function(e,r){if(typeof r!="function")return e;eb.has(e)||eb.set(e,new WeakMap);var n=eb.get(e);if(n.has(r))return n.get(r);var i=function(){e.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},zX=function(e,r,n){var i=e.scale,a=e.type,o=e.layout,l=e.axisType;if(i==="auto")return o==="radial"&&l==="radiusAxis"?{scale:Jc(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:fh(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Rc(),realScaleType:"point"}:a==="category"?{scale:Jc(),realScaleType:"band"}:{scale:fh(),realScaleType:"linear"};if(No(i)){var u="scale".concat(lp(i));return{scale:(lC[u]||Rc)(),realScaleType:lC[u]?u:"point"}}return Ye(i)?{scale:i}:{scale:Rc(),realScaleType:"point"}},kC=1e-4,BX=function(e){var r=e.domain();if(!(!r||r.length<=2)){var n=r.length,i=e.range(),a=Math.min(i[0],i[1])-kC,o=Math.max(i[0],i[1])+kC,l=e(r[0]),u=e(r[n-1]);(l<a||l>o||u<a||u>o)&&e.domain([r[0],r[n-1]])}},UX=function(e,r){if(!e)return null;for(var n=0,i=e.length;n<i;n++)if(e[n].item===r)return e[n].position;return null},qX=function(e,r){if(!r||r.length!==2||!ge(r[0])||!ge(r[1]))return e;var n=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]),a=[e[0],e[1]];return(!ge(e[0])||e[0]<n)&&(a[0]=n),(!ge(e[1])||e[1]>i)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]<n&&(a[1]=n),a},FX=function(e){var r=e.length;if(!(r<=0))for(var n=0,i=e[0].length;n<i;++n)for(var a=0,o=0,l=0;l<r;++l){var u=Ru(e[l][n][1])?e[l][n][0]:e[l][n][1];u>=0?(e[l][n][0]=a,e[l][n][1]=a+u,a=e[l][n][1]):(e[l][n][0]=o,e[l][n][1]=o+u,o=e[l][n][1])}},HX=function(e){var r=e.length;if(!(r<=0))for(var n=0,i=e[0].length;n<i;++n)for(var a=0,o=0;o<r;++o){var l=Ru(e[o][n][1])?e[o][n][0]:e[o][n][1];l>=0?(e[o][n][0]=a,e[o][n][1]=a+l,a=e[o][n][1]):(e[o][n][0]=0,e[o][n][1]=0)}},WX={sign:FX,expand:TF,none:Hs,silhouette:CF,wiggle:jF,positive:HX},GX=function(e,r,n){var i=r.map(function(l){return l.props.dataKey}),a=WX[n],o=AF().keys(i).value(function(l,u){return+dn(l,u,0)}).order(dx).offset(a);return o(e)},KX=function(e,r,n,i,a,o){if(!e)return null;var l=o?r.reverse():r,u={},d=l.reduce(function(f,g){var v,x=(v=g.type)!==null&&v!==void 0&&v.defaultProps?Ht(Ht({},g.type.defaultProps),g.props):g.props,_=x.stackId,b=x.hide;if(b)return f;var k=x[n],A=f[k]||{hasStack:!1,stackGroups:{}};if(or(_)){var O=A.stackGroups[_]||{numericAxisId:n,cateAxisId:i,items:[]};O.items.push(g),A.hasStack=!0,A.stackGroups[_]=O}else A.stackGroups[Iu("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[g]};return Ht(Ht({},f),{},qs({},k,A))},u),p={};return Object.keys(d).reduce(function(f,g){var v=d[g];if(v.hasStack){var x={};v.stackGroups=Object.keys(v.stackGroups).reduce(function(_,b){var k=v.stackGroups[b];return Ht(Ht({},_),{},qs({},b,{numericAxisId:n,cateAxisId:i,items:k.items,stackedData:GX(e,k.items,a)}))},x)}return Ht(Ht({},f),{},qs({},g,v))},p)},VX=function(e,r){var n=r.realScaleType,i=r.type,a=r.tickCount,o=r.originalDomain,l=r.allowDecimals,u=n||r.scale;if(u!=="auto"&&u!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var d=e.domain();if(!d.length)return null;var p=aX(d,a,l);return e.domain([_p(p),wp(p)]),{niceTicks:p}}if(a&&i==="number"){var f=e.domain(),g=oX(f,a,l);return{niceTicks:g}}return null};function EC(t){var e=t.axis,r=t.ticks,n=t.bandSize,i=t.entry,a=t.index,o=t.dataKey;if(e.type==="category"){if(!e.allowDuplicatedCategory&&e.dataKey&&!Qe(i[e.dataKey])){var l=Hf(r,"value",i[e.dataKey]);if(l)return l.coordinate+n/2}return r[a]?r[a].coordinate+n/2:null}var u=dn(i,Qe(o)?e.dataKey:o);return Qe(u)?null:e.scale(u)}var OC=function(e){var r=e.axis,n=e.ticks,i=e.offset,a=e.bandSize,o=e.entry,l=e.index;if(r.type==="category")return n[l]?n[l].coordinate+i:null;var u=dn(o,r.dataKey,r.domain[l]);return Qe(u)?null:r.scale(u)-a/2+i},XX=function(e){var r=e.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return i<=0&&a>=0?0:a<0?a:i}return n[0]},YX=function(e,r){var n,i=(n=e.type)!==null&&n!==void 0&&n.defaultProps?Ht(Ht({},e.type.defaultProps),e.props):e.props,a=i.stackId;if(or(a)){var o=r[a];if(o){var l=o.items.indexOf(e);return l>=0?o.stackedData[l]:null}}return null},JX=function(e){return e.reduce(function(r,n){return[_p(n.concat([r[0]]).filter(ge)),wp(n.concat([r[1]]).filter(ge))]},[1/0,-1/0])},y$=function(e,r,n){return Object.keys(e).reduce(function(i,a){var o=e[a],l=o.stackedData,u=l.reduce(function(d,p){var f=JX(p.slice(r,n+1));return[Math.min(d[0],f[0]),Math.max(d[1],f[1])]},[1/0,-1/0]);return[Math.min(u[0],i[0]),Math.max(u[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},AC=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,TC=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Mx=function(e,r,n){if(Ye(e))return e(r,n);if(!Array.isArray(e))return r;var i=[];if(ge(e[0]))i[0]=n?e[0]:Math.min(e[0],r[0]);else if(AC.test(e[0])){var a=+AC.exec(e[0])[1];i[0]=r[0]-a}else Ye(e[0])?i[0]=e[0](r[0]):i[0]=r[0];if(ge(e[1]))i[1]=n?e[1]:Math.max(e[1],r[1]);else if(TC.test(e[1])){var o=+TC.exec(e[1])[1];i[1]=r[1]+o}else Ye(e[1])?i[1]=e[1](r[1]):i[1]=r[1];return i},bh=function(e,r,n){if(e&&e.scale&&e.scale.bandwidth){var i=e.scale.bandwidth();if(!n||i>0)return i}if(e&&r&&r.length>=2){for(var a=m1(r,function(f){return f.coordinate}),o=1/0,l=1,u=a.length;l<u;l++){var d=a[l],p=a[l-1];o=Math.min((d.coordinate||0)-(p.coordinate||0),o)}return o===1/0?0:o}return n?void 0:0},CC=function(e,r,n){return!e||!e.length||Sp(e,Tn(n,"type.defaultProps.domain"))?r:e},v$=function(e,r){var n=e.type.defaultProps?Ht(Ht({},e.type.defaultProps),e.props):e.props,i=n.dataKey,a=n.name,o=n.unit,l=n.formatter,u=n.tooltipType,d=n.chartType,p=n.hide;return Ht(Ht({},it(e,!1)),{},{dataKey:i,unit:o,formatter:l,name:a||i,color:U1(e),value:dn(r,i),type:u,payload:r,chartType:d,hide:p})};function ou(t){"@babel/helpers - typeof";return ou=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ou(t)}function jC(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function PC(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?jC(Object(r),!0).forEach(function(n){ZX(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):jC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ZX(t,e,r){return e=QX(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function QX(t){var e=eY(t,"string");return ou(e)=="symbol"?e:e+""}function eY(t,e){if(ou(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ou(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var xh=Math.PI/180,tY=function(e){return e*180/Math.PI},_r=function(e,r,n,i){return{x:e+Math.cos(-xh*i)*n,y:r+Math.sin(-xh*i)*n}},rY=function(e,r){var n=e.x,i=e.y,a=r.x,o=r.y;return Math.sqrt(Math.pow(n-a,2)+Math.pow(i-o,2))},nY=function(e,r){var n=e.x,i=e.y,a=r.cx,o=r.cy,l=rY({x:n,y:i},{x:a,y:o});if(l<=0)return{radius:l};var u=(n-a)/l,d=Math.acos(u);return i>o&&(d=2*Math.PI-d),{radius:l,angle:tY(d),angleInRadian:d}},iY=function(e){var r=e.startAngle,n=e.endAngle,i=Math.floor(r/360),a=Math.floor(n/360),o=Math.min(i,a);return{startAngle:r-o*360,endAngle:n-o*360}},aY=function(e,r){var n=r.startAngle,i=r.endAngle,a=Math.floor(n/360),o=Math.floor(i/360),l=Math.min(a,o);return e+l*360},NC=function(e,r){var n=e.x,i=e.y,a=nY({x:n,y:i},r),o=a.radius,l=a.angle,u=r.innerRadius,d=r.outerRadius;if(o<u||o>d)return!1;if(o===0)return!0;var p=iY(r),f=p.startAngle,g=p.endAngle,v=l,x;if(f<=g){for(;v>g;)v-=360;for(;v<f;)v+=360;x=v>=f&&v<=g}else{for(;v>f;)v-=360;for(;v<g;)v+=360;x=v>=g&&v<=f}return x?PC(PC({},r),{},{radius:o,angle:aY(v,r)}):null};function su(t){"@babel/helpers - typeof";return su=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},su(t)}var oY=["offset"];function sY(t){return dY(t)||uY(t)||cY(t)||lY()}function lY(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
459
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cY(t,e){if(t){if(typeof t=="string")return Lx(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Lx(t,e)}}function uY(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function dY(t){if(Array.isArray(t))return Lx(t)}function Lx(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function fY(t,e){if(t==null)return{};var r=hY(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function hY(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function RC(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ar(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?RC(Object(r),!0).forEach(function(n){pY(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):RC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function pY(t,e,r){return e=mY(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function mY(t){var e=gY(t,"string");return su(e)=="symbol"?e:e+""}function gY(t,e){if(su(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(su(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function lu(){return lu=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},lu.apply(this,arguments)}var yY=function(e){var r=e.value,n=e.formatter,i=Qe(e.children)?r:e.children;return Ye(n)?n(i):i},vY=function(e,r){var n=Jn(r-e),i=Math.min(Math.abs(r-e),360);return n*i},bY=function(e,r,n){var i=e.position,a=e.viewBox,o=e.offset,l=e.className,u=a,d=u.cx,p=u.cy,f=u.innerRadius,g=u.outerRadius,v=u.startAngle,x=u.endAngle,_=u.clockWise,b=(f+g)/2,k=vY(v,x),A=k>=0?1:-1,O,C;i==="insideStart"?(O=v+A*o,C=_):i==="insideEnd"?(O=x-A*o,C=!_):i==="end"&&(O=x+A*o,C=_),C=k<=0?C:!C;var E=_r(d,p,b,O),T=_r(d,p,b,O+(C?1:-1)*359),P="M".concat(E.x,",").concat(E.y,`
460
+ A`).concat(b,",").concat(b,",0,1,").concat(C?0:1,`,
461
+ `).concat(T.x,",").concat(T.y),R=Qe(e.id)?Iu("recharts-radial-line-"):e.id;return $.createElement("text",lu({},n,{dominantBaseline:"central",className:at("recharts-radial-bar-label",l)}),$.createElement("defs",null,$.createElement("path",{id:R,d:P})),$.createElement("textPath",{xlinkHref:"#".concat(R)},r))},xY=function(e){var r=e.viewBox,n=e.offset,i=e.position,a=r,o=a.cx,l=a.cy,u=a.innerRadius,d=a.outerRadius,p=a.startAngle,f=a.endAngle,g=(p+f)/2;if(i==="outside"){var v=_r(o,l,d+n,g),x=v.x,_=v.y;return{x,y:_,textAnchor:x>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var b=(u+d)/2,k=_r(o,l,b,g),A=k.x,O=k.y;return{x:A,y:O,textAnchor:"middle",verticalAnchor:"middle"}},wY=function(e){var r=e.viewBox,n=e.parentViewBox,i=e.offset,a=e.position,o=r,l=o.x,u=o.y,d=o.width,p=o.height,f=p>=0?1:-1,g=f*i,v=f>0?"end":"start",x=f>0?"start":"end",_=d>=0?1:-1,b=_*i,k=_>0?"end":"start",A=_>0?"start":"end";if(a==="top"){var O={x:l+d/2,y:u-f*i,textAnchor:"middle",verticalAnchor:v};return ar(ar({},O),n?{height:Math.max(u-n.y,0),width:d}:{})}if(a==="bottom"){var C={x:l+d/2,y:u+p+g,textAnchor:"middle",verticalAnchor:x};return ar(ar({},C),n?{height:Math.max(n.y+n.height-(u+p),0),width:d}:{})}if(a==="left"){var E={x:l-b,y:u+p/2,textAnchor:k,verticalAnchor:"middle"};return ar(ar({},E),n?{width:Math.max(E.x-n.x,0),height:p}:{})}if(a==="right"){var T={x:l+d+b,y:u+p/2,textAnchor:A,verticalAnchor:"middle"};return ar(ar({},T),n?{width:Math.max(n.x+n.width-T.x,0),height:p}:{})}var P=n?{width:d,height:p}:{};return a==="insideLeft"?ar({x:l+b,y:u+p/2,textAnchor:A,verticalAnchor:"middle"},P):a==="insideRight"?ar({x:l+d-b,y:u+p/2,textAnchor:k,verticalAnchor:"middle"},P):a==="insideTop"?ar({x:l+d/2,y:u+g,textAnchor:"middle",verticalAnchor:x},P):a==="insideBottom"?ar({x:l+d/2,y:u+p-g,textAnchor:"middle",verticalAnchor:v},P):a==="insideTopLeft"?ar({x:l+b,y:u+g,textAnchor:A,verticalAnchor:x},P):a==="insideTopRight"?ar({x:l+d-b,y:u+g,textAnchor:k,verticalAnchor:x},P):a==="insideBottomLeft"?ar({x:l+b,y:u+p-g,textAnchor:A,verticalAnchor:v},P):a==="insideBottomRight"?ar({x:l+d-b,y:u+p-g,textAnchor:k,verticalAnchor:v},P):bl(a)&&(ge(a.x)||So(a.x))&&(ge(a.y)||So(a.y))?ar({x:l+Ro(a.x,d),y:u+Ro(a.y,p),textAnchor:"end",verticalAnchor:"end"},P):ar({x:l+d/2,y:u+p/2,textAnchor:"middle",verticalAnchor:"middle"},P)},_Y=function(e){return"cx"in e&&ge(e.cx)};function jr(t){var e=t.offset,r=e===void 0?5:e,n=fY(t,oY),i=ar({offset:r},n),a=i.viewBox,o=i.position,l=i.value,u=i.children,d=i.content,p=i.className,f=p===void 0?"":p,g=i.textBreakAll;if(!a||Qe(l)&&Qe(u)&&!N.isValidElement(d)&&!Ye(d))return null;if(N.isValidElement(d))return N.cloneElement(d,i);var v;if(Ye(d)){if(v=N.createElement(d,i),N.isValidElement(v))return v}else v=yY(i);var x=_Y(a),_=it(i,!0);if(x&&(o==="insideStart"||o==="insideEnd"||o==="end"))return bY(i,v,_);var b=x?xY(i):wY(i);return $.createElement(ih,lu({className:at("recharts-label",f)},_,b,{breakAll:g}),v)}jr.displayName="Label";var b$=function(e){var r=e.cx,n=e.cy,i=e.angle,a=e.startAngle,o=e.endAngle,l=e.r,u=e.radius,d=e.innerRadius,p=e.outerRadius,f=e.x,g=e.y,v=e.top,x=e.left,_=e.width,b=e.height,k=e.clockWise,A=e.labelViewBox;if(A)return A;if(ge(_)&&ge(b)){if(ge(f)&&ge(g))return{x:f,y:g,width:_,height:b};if(ge(v)&&ge(x))return{x:v,y:x,width:_,height:b}}return ge(f)&&ge(g)?{x:f,y:g,width:0,height:0}:ge(r)&&ge(n)?{cx:r,cy:n,startAngle:a||i||0,endAngle:o||i||0,innerRadius:d||0,outerRadius:p||u||l||0,clockWise:k}:e.viewBox?e.viewBox:{}},SY=function(e,r){return e?e===!0?$.createElement(jr,{key:"label-implicit",viewBox:r}):or(e)?$.createElement(jr,{key:"label-implicit",viewBox:r,value:e}):N.isValidElement(e)?e.type===jr?N.cloneElement(e,{key:"label-implicit",viewBox:r}):$.createElement(jr,{key:"label-implicit",content:e,viewBox:r}):Ye(e)?$.createElement(jr,{key:"label-implicit",content:e,viewBox:r}):bl(e)?$.createElement(jr,lu({viewBox:r},e,{key:"label-implicit"})):null:null},kY=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var i=e.children,a=b$(e),o=Cn(i,jr).map(function(u,d){return N.cloneElement(u,{viewBox:r||a,key:"label-".concat(d)})});if(!n)return o;var l=SY(e.label,r||a);return[l].concat(sY(o))};jr.parseViewBox=b$;jr.renderCallByParent=kY;var tb,IC;function EY(){if(IC)return tb;IC=1;function t(e){var r=e==null?0:e.length;return r?e[r-1]:void 0}return tb=t,tb}var OY=EY();const AY=vt(OY);function cu(t){"@babel/helpers - typeof";return cu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cu(t)}var TY=["valueAccessor"],CY=["data","dataKey","clockWise","id","textBreakAll"];function jY(t){return IY(t)||RY(t)||NY(t)||PY()}function PY(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
462
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NY(t,e){if(t){if(typeof t=="string")return Dx(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Dx(t,e)}}function RY(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function IY(t){if(Array.isArray(t))return Dx(t)}function Dx(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function wh(){return wh=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},wh.apply(this,arguments)}function $C(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function MC(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?$C(Object(r),!0).forEach(function(n){$Y(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$C(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function $Y(t,e,r){return e=MY(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function MY(t){var e=LY(t,"string");return cu(e)=="symbol"?e:e+""}function LY(t,e){if(cu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(cu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function LC(t,e){if(t==null)return{};var r=DY(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function DY(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var zY=function(e){return Array.isArray(e.value)?AY(e.value):e.value};function La(t){var e=t.valueAccessor,r=e===void 0?zY:e,n=LC(t,TY),i=n.data,a=n.dataKey,o=n.clockWise,l=n.id,u=n.textBreakAll,d=LC(n,CY);return!i||!i.length?null:$.createElement(Xt,{className:"recharts-label-list"},i.map(function(p,f){var g=Qe(a)?r(p,f):dn(p&&p.payload,a),v=Qe(l)?{}:{id:"".concat(l,"-").concat(f)};return $.createElement(jr,wh({},it(p,!0),d,v,{parentViewBox:p.parentViewBox,value:g,textBreakAll:u,viewBox:jr.parseViewBox(Qe(o)?p:MC(MC({},p),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}La.displayName="LabelList";function BY(t,e){return t?t===!0?$.createElement(La,{key:"labelList-implicit",data:e}):$.isValidElement(t)||Ye(t)?$.createElement(La,{key:"labelList-implicit",data:e,content:t}):bl(t)?$.createElement(La,wh({data:e},t,{key:"labelList-implicit"})):null:null}function UY(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var n=t.children,i=Cn(n,La).map(function(o,l){return N.cloneElement(o,{data:e,key:"labelList-".concat(l)})});if(!r)return i;var a=BY(t.label,e);return[a].concat(jY(i))}La.renderCallByParent=UY;function uu(t){"@babel/helpers - typeof";return uu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},uu(t)}function zx(){return zx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},zx.apply(this,arguments)}function DC(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function zC(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?DC(Object(r),!0).forEach(function(n){qY(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):DC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function qY(t,e,r){return e=FY(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function FY(t){var e=HY(t,"string");return uu(e)=="symbol"?e:e+""}function HY(t,e){if(uu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(uu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var WY=function(e,r){var n=Jn(r-e),i=Math.min(Math.abs(r-e),359.999);return n*i},bf=function(e){var r=e.cx,n=e.cy,i=e.radius,a=e.angle,o=e.sign,l=e.isExternal,u=e.cornerRadius,d=e.cornerIsExternal,p=u*(l?1:-1)+i,f=Math.asin(u/p)/xh,g=d?a:a+o*f,v=_r(r,n,p,g),x=_r(r,n,i,g),_=d?a-o*f:a,b=_r(r,n,p*Math.cos(f*xh),_);return{center:v,circleTangency:x,lineTangency:b,theta:f}},x$=function(e){var r=e.cx,n=e.cy,i=e.innerRadius,a=e.outerRadius,o=e.startAngle,l=e.endAngle,u=WY(o,l),d=o+u,p=_r(r,n,a,o),f=_r(r,n,a,d),g="M ".concat(p.x,",").concat(p.y,`
463
+ A `).concat(a,",").concat(a,`,0,
464
+ `).concat(+(Math.abs(u)>180),",").concat(+(o>d),`,
465
+ `).concat(f.x,",").concat(f.y,`
466
+ `);if(i>0){var v=_r(r,n,i,o),x=_r(r,n,i,d);g+="L ".concat(x.x,",").concat(x.y,`
467
+ A `).concat(i,",").concat(i,`,0,
468
+ `).concat(+(Math.abs(u)>180),",").concat(+(o<=d),`,
469
+ `).concat(v.x,",").concat(v.y," Z")}else g+="L ".concat(r,",").concat(n," Z");return g},GY=function(e){var r=e.cx,n=e.cy,i=e.innerRadius,a=e.outerRadius,o=e.cornerRadius,l=e.forceCornerRadius,u=e.cornerIsExternal,d=e.startAngle,p=e.endAngle,f=Jn(p-d),g=bf({cx:r,cy:n,radius:a,angle:d,sign:f,cornerRadius:o,cornerIsExternal:u}),v=g.circleTangency,x=g.lineTangency,_=g.theta,b=bf({cx:r,cy:n,radius:a,angle:p,sign:-f,cornerRadius:o,cornerIsExternal:u}),k=b.circleTangency,A=b.lineTangency,O=b.theta,C=u?Math.abs(d-p):Math.abs(d-p)-_-O;if(C<0)return l?"M ".concat(x.x,",").concat(x.y,`
470
+ a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0
471
+ a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0
472
+ `):x$({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:d,endAngle:p});var E="M ".concat(x.x,",").concat(x.y,`
473
+ A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(v.x,",").concat(v.y,`
474
+ A`).concat(a,",").concat(a,",0,").concat(+(C>180),",").concat(+(f<0),",").concat(k.x,",").concat(k.y,`
475
+ A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(A.x,",").concat(A.y,`
476
+ `);if(i>0){var T=bf({cx:r,cy:n,radius:i,angle:d,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:u}),P=T.circleTangency,R=T.lineTangency,I=T.theta,Y=bf({cx:r,cy:n,radius:i,angle:p,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:u}),W=Y.circleTangency,B=Y.lineTangency,X=Y.theta,K=u?Math.abs(d-p):Math.abs(d-p)-I-X;if(K<0&&o===0)return"".concat(E,"L").concat(r,",").concat(n,"Z");E+="L".concat(B.x,",").concat(B.y,`
477
+ A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(W.x,",").concat(W.y,`
478
+ A`).concat(i,",").concat(i,",0,").concat(+(K>180),",").concat(+(f>0),",").concat(P.x,",").concat(P.y,`
479
+ A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(R.x,",").concat(R.y,"Z")}else E+="L".concat(r,",").concat(n,"Z");return E},KY={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},w$=function(e){var r=zC(zC({},KY),e),n=r.cx,i=r.cy,a=r.innerRadius,o=r.outerRadius,l=r.cornerRadius,u=r.forceCornerRadius,d=r.cornerIsExternal,p=r.startAngle,f=r.endAngle,g=r.className;if(o<a||p===f)return null;var v=at("recharts-sector",g),x=o-a,_=Ro(l,x,0,!0),b;return _>0&&Math.abs(p-f)<360?b=GY({cx:n,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(_,x/2),forceCornerRadius:u,cornerIsExternal:d,startAngle:p,endAngle:f}):b=x$({cx:n,cy:i,innerRadius:a,outerRadius:o,startAngle:p,endAngle:f}),$.createElement("path",zx({},it(r,!0),{className:v,d:b,role:"img"}))};function du(t){"@babel/helpers - typeof";return du=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},du(t)}function Bx(){return Bx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Bx.apply(this,arguments)}function BC(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function UC(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?BC(Object(r),!0).forEach(function(n){VY(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):BC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function VY(t,e,r){return e=XY(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function XY(t){var e=YY(t,"string");return du(e)=="symbol"?e:e+""}function YY(t,e){if(du(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(du(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var qC={curveBasisClosed:gF,curveBasisOpen:yF,curveBasis:mF,curveBumpX:tF,curveBumpY:rF,curveLinearClosed:vF,curveLinear:up,curveMonotoneX:bF,curveMonotoneY:xF,curveNatural:wF,curveStep:_F,curveStepAfter:kF,curveStepBefore:SF},xf=function(e){return e.x===+e.x&&e.y===+e.y},vc=function(e){return e.x},bc=function(e){return e.y},JY=function(e,r){if(Ye(e))return e;var n="curve".concat(lp(e));return(n==="curveMonotone"||n==="curveBump")&&r?qC["".concat(n).concat(r==="vertical"?"Y":"X")]:qC[n]||up},ZY=function(e){var r=e.type,n=r===void 0?"linear":r,i=e.points,a=i===void 0?[]:i,o=e.baseLine,l=e.layout,u=e.connectNulls,d=u===void 0?!1:u,p=JY(n,l),f=d?a.filter(function(_){return xf(_)}):a,g;if(Array.isArray(o)){var v=d?o.filter(function(_){return xf(_)}):o,x=f.map(function(_,b){return UC(UC({},_),{},{base:v[b]})});return l==="vertical"?g=df().y(bc).x1(vc).x0(function(_){return _.base.x}):g=df().x(vc).y1(bc).y0(function(_){return _.base.y}),g.defined(xf).curve(p),g(x)}return l==="vertical"&&ge(o)?g=df().y(bc).x1(vc).x0(o):ge(o)?g=df().x(vc).y1(bc).y0(o):g=OR().x(vc).y(bc),g.defined(xf).curve(p),g(f)},Ux=function(e){var r=e.className,n=e.points,i=e.path,a=e.pathRef;if((!n||!n.length)&&!i)return null;var o=n&&n.length?ZY(e):i;return N.createElement("path",Bx({},it(e,!1),Wf(e),{className:at("recharts-curve",r),d:o,ref:a}))},rb={exports:{}},nb,FC;function QY(){if(FC)return nb;FC=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return nb=t,nb}var ib,HC;function eJ(){if(HC)return ib;HC=1;var t=QY();function e(){}function r(){}return r.resetWarningCache=e,ib=function(){function n(o,l,u,d,p,f){if(f!==t){var g=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw g.name="Invariant Violation",g}}n.isRequired=n;function i(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:i,element:n,elementType:n,instanceOf:i,node:n,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:r,resetWarningCache:e};return a.PropTypes=a,a},ib}var WC;function tJ(){return WC||(WC=1,rb.exports=eJ()()),rb.exports}var rJ=tJ();const mt=vt(rJ),{getOwnPropertyNames:nJ,getOwnPropertySymbols:iJ}=Object,{hasOwnProperty:aJ}=Object.prototype;function ab(t,e){return function(n,i,a){return t(n,i,a)&&e(n,i,a)}}function wf(t){return function(r,n,i){if(!r||!n||typeof r!="object"||typeof n!="object")return t(r,n,i);const{cache:a}=i,o=a.get(r),l=a.get(n);if(o&&l)return o===n&&l===r;a.set(r,n),a.set(n,r);const u=t(r,n,i);return a.delete(r),a.delete(n),u}}function oJ(t){return t!=null?t[Symbol.toStringTag]:void 0}function GC(t){return nJ(t).concat(iJ(t))}const sJ=Object.hasOwn||((t,e)=>aJ.call(t,e));function Fo(t,e){return t===e||!t&&!e&&t!==t&&e!==e}const lJ="__v",cJ="__o",uJ="_owner",{getOwnPropertyDescriptor:KC,keys:VC}=Object;function dJ(t,e){return t.byteLength===e.byteLength&&_h(new Uint8Array(t),new Uint8Array(e))}function fJ(t,e,r){let n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(!r.equals(t[n],e[n],n,n,t,e,r))return!1;return!0}function hJ(t,e){return t.byteLength===e.byteLength&&_h(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function pJ(t,e){return Fo(t.getTime(),e.getTime())}function mJ(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function gJ(t,e){return t===e}function XC(t,e,r){const n=t.size;if(n!==e.size)return!1;if(!n)return!0;const i=new Array(n),a=t.entries();let o,l,u=0;for(;(o=a.next())&&!o.done;){const d=e.entries();let p=!1,f=0;for(;(l=d.next())&&!l.done;){if(i[f]){f++;continue}const g=o.value,v=l.value;if(r.equals(g[0],v[0],u,f,t,e,r)&&r.equals(g[1],v[1],g[0],v[0],t,e,r)){p=i[f]=!0;break}f++}if(!p)return!1;u++}return!0}const yJ=Fo;function vJ(t,e,r){const n=VC(t);let i=n.length;if(VC(e).length!==i)return!1;for(;i-- >0;)if(!_$(t,e,r,n[i]))return!1;return!0}function xc(t,e,r){const n=GC(t);let i=n.length;if(GC(e).length!==i)return!1;let a,o,l;for(;i-- >0;)if(a=n[i],!_$(t,e,r,a)||(o=KC(t,a),l=KC(e,a),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function bJ(t,e){return Fo(t.valueOf(),e.valueOf())}function xJ(t,e){return t.source===e.source&&t.flags===e.flags}function YC(t,e,r){const n=t.size;if(n!==e.size)return!1;if(!n)return!0;const i=new Array(n),a=t.values();let o,l;for(;(o=a.next())&&!o.done;){const u=e.values();let d=!1,p=0;for(;(l=u.next())&&!l.done;){if(!i[p]&&r.equals(o.value,l.value,o.value,l.value,t,e,r)){d=i[p]=!0;break}p++}if(!d)return!1}return!0}function _h(t,e){let r=t.byteLength;if(e.byteLength!==r||t.byteOffset!==e.byteOffset)return!1;for(;r-- >0;)if(t[r]!==e[r])return!1;return!0}function wJ(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function _$(t,e,r,n){return(n===uJ||n===cJ||n===lJ)&&(t.$$typeof||e.$$typeof)?!0:sJ(e,n)&&r.equals(t[n],e[n],n,n,t,e,r)}const _J="[object ArrayBuffer]",SJ="[object Arguments]",kJ="[object Boolean]",EJ="[object DataView]",OJ="[object Date]",AJ="[object Error]",TJ="[object Map]",CJ="[object Number]",jJ="[object Object]",PJ="[object RegExp]",NJ="[object Set]",RJ="[object String]",IJ={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},$J="[object URL]",MJ=Object.prototype.toString;function LJ({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:l,areObjectsEqual:u,arePrimitiveWrappersEqual:d,areRegExpsEqual:p,areSetsEqual:f,areTypedArraysEqual:g,areUrlsEqual:v,unknownTagComparators:x}){return function(b,k,A){if(b===k)return!0;if(b==null||k==null)return!1;const O=typeof b;if(O!==typeof k)return!1;if(O!=="object")return O==="number"?l(b,k,A):O==="function"?a(b,k,A):!1;const C=b.constructor;if(C!==k.constructor)return!1;if(C===Object)return u(b,k,A);if(Array.isArray(b))return e(b,k,A);if(C===Date)return n(b,k,A);if(C===RegExp)return p(b,k,A);if(C===Map)return o(b,k,A);if(C===Set)return f(b,k,A);const E=MJ.call(b);if(E===OJ)return n(b,k,A);if(E===PJ)return p(b,k,A);if(E===TJ)return o(b,k,A);if(E===NJ)return f(b,k,A);if(E===jJ)return typeof b.then!="function"&&typeof k.then!="function"&&u(b,k,A);if(E===$J)return v(b,k,A);if(E===AJ)return i(b,k,A);if(E===SJ)return u(b,k,A);if(IJ[E])return g(b,k,A);if(E===_J)return t(b,k,A);if(E===EJ)return r(b,k,A);if(E===kJ||E===CJ||E===RJ)return d(b,k,A);if(x){let T=x[E];if(!T){const P=oJ(b);P&&(T=x[P])}if(T)return T(b,k,A)}return!1}}function DJ({circular:t,createCustomConfig:e,strict:r}){let n={areArrayBuffersEqual:dJ,areArraysEqual:r?xc:fJ,areDataViewsEqual:hJ,areDatesEqual:pJ,areErrorsEqual:mJ,areFunctionsEqual:gJ,areMapsEqual:r?ab(XC,xc):XC,areNumbersEqual:yJ,areObjectsEqual:r?xc:vJ,arePrimitiveWrappersEqual:bJ,areRegExpsEqual:xJ,areSetsEqual:r?ab(YC,xc):YC,areTypedArraysEqual:r?ab(_h,xc):_h,areUrlsEqual:wJ,unknownTagComparators:void 0};if(e&&(n=Object.assign({},n,e(n))),t){const i=wf(n.areArraysEqual),a=wf(n.areMapsEqual),o=wf(n.areObjectsEqual),l=wf(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:l})}return n}function zJ(t){return function(e,r,n,i,a,o,l){return t(e,r,l)}}function BJ({circular:t,comparator:e,createState:r,equals:n,strict:i}){if(r)return function(l,u){const{cache:d=t?new WeakMap:void 0,meta:p}=r();return e(l,u,{cache:d,equals:n,meta:p,strict:i})};if(t)return function(l,u){return e(l,u,{cache:new WeakMap,equals:n,meta:void 0,strict:i})};const a={cache:void 0,equals:n,meta:void 0,strict:i};return function(l,u){return e(l,u,a)}}const UJ=Ga();Ga({strict:!0});Ga({circular:!0});Ga({circular:!0,strict:!0});Ga({createInternalComparator:()=>Fo});Ga({strict:!0,createInternalComparator:()=>Fo});Ga({circular:!0,createInternalComparator:()=>Fo});Ga({circular:!0,createInternalComparator:()=>Fo,strict:!0});function Ga(t={}){const{circular:e=!1,createInternalComparator:r,createState:n,strict:i=!1}=t,a=DJ(t),o=LJ(a),l=r?r(o):zJ(o);return BJ({circular:e,comparator:o,createState:n,equals:l,strict:i})}function qJ(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function JC(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(a){r<0&&(r=a),a-r>e?(t(a),r=-1):qJ(i)};requestAnimationFrame(n)}function qx(t){"@babel/helpers - typeof";return qx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qx(t)}function FJ(t){return KJ(t)||GJ(t)||WJ(t)||HJ()}function HJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
480
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WJ(t,e){if(t){if(typeof t=="string")return ZC(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ZC(t,e)}}function ZC(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function GJ(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function KJ(t){if(Array.isArray(t))return t}function VJ(){var t={},e=function(){return null},r=!1,n=function i(a){if(!r){if(Array.isArray(a)){if(!a.length)return;var o=a,l=FJ(o),u=l[0],d=l.slice(1);if(typeof u=="number"){JC(i.bind(null,d),u);return}i(u),JC(i.bind(null,d));return}qx(a)==="object"&&(t=a,e(t)),typeof a=="function"&&a()}};return{stop:function(){r=!0},start:function(a){r=!1,n(a)},subscribe:function(a){return e=a,function(){e=function(){return null}}}}}function fu(t){"@babel/helpers - typeof";return fu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fu(t)}function QC(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ej(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?QC(Object(r),!0).forEach(function(n){S$(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):QC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function S$(t,e,r){return e=XJ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function XJ(t){var e=YJ(t,"string");return fu(e)==="symbol"?e:String(e)}function YJ(t,e){if(fu(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(fu(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var JJ=function(e,r){return[Object.keys(e),Object.keys(r)].reduce(function(n,i){return n.filter(function(a){return i.includes(a)})})},ZJ=function(e){return e},QJ=function(e){return e.replace(/([A-Z])/g,function(r){return"-".concat(r.toLowerCase())})},$c=function(e,r){return Object.keys(r).reduce(function(n,i){return ej(ej({},n),{},S$({},i,e(i,r[i])))},{})},tj=function(e,r,n){return e.map(function(i){return"".concat(QJ(i)," ").concat(r,"ms ").concat(n)}).join(",")};function eZ(t,e){return nZ(t)||rZ(t,e)||k$(t,e)||tZ()}function tZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
481
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rZ(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,l=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return l}}function nZ(t){if(Array.isArray(t))return t}function iZ(t){return sZ(t)||oZ(t)||k$(t)||aZ()}function aZ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
482
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function k$(t,e){if(t){if(typeof t=="string")return Fx(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Fx(t,e)}}function oZ(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function sZ(t){if(Array.isArray(t))return Fx(t)}function Fx(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Sh=1e-4,E$=function(e,r){return[0,3*e,3*r-6*e,3*e-3*r+1]},O$=function(e,r){return e.map(function(n,i){return n*Math.pow(r,i)}).reduce(function(n,i){return n+i})},rj=function(e,r){return function(n){var i=E$(e,r);return O$(i,n)}},lZ=function(e,r){return function(n){var i=E$(e,r),a=[].concat(iZ(i.map(function(o,l){return o*l}).slice(1)),[0]);return O$(a,n)}},nj=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var i=r[0],a=r[1],o=r[2],l=r[3];if(r.length===1)switch(r[0]){case"linear":i=0,a=0,o=1,l=1;break;case"ease":i=.25,a=.1,o=.25,l=1;break;case"ease-in":i=.42,a=0,o=1,l=1;break;case"ease-out":i=.42,a=0,o=.58,l=1;break;case"ease-in-out":i=0,a=0,o=.58,l=1;break;default:{var u=r[0].split("(");if(u[0]==="cubic-bezier"&&u[1].split(")")[0].split(",").length===4){var d=u[1].split(")")[0].split(",").map(function(b){return parseFloat(b)}),p=eZ(d,4);i=p[0],a=p[1],o=p[2],l=p[3]}}}var f=rj(i,o),g=rj(a,l),v=lZ(i,o),x=function(k){return k>1?1:k<0?0:k},_=function(k){for(var A=k>1?1:k,O=A,C=0;C<8;++C){var E=f(O)-A,T=v(O);if(Math.abs(E-A)<Sh||T<Sh)return g(O);O=x(O-E/T)}return g(O)};return _.isStepper=!1,_},cZ=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=e.stiff,n=r===void 0?100:r,i=e.damping,a=i===void 0?8:i,o=e.dt,l=o===void 0?17:o,u=function(p,f,g){var v=-(p-f)*n,x=g*a,_=g+(v-x)*l/1e3,b=g*l/1e3+p;return Math.abs(b-f)<Sh&&Math.abs(_)<Sh?[f,0]:[b,_]};return u.isStepper=!0,u.dt=l,u},uZ=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var i=r[0];if(typeof i=="string")switch(i){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return nj(i);case"spring":return cZ();default:if(i.split("(")[0]==="cubic-bezier")return nj(i)}return typeof i=="function"?i:null};function hu(t){"@babel/helpers - typeof";return hu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hu(t)}function ij(t){return hZ(t)||fZ(t)||A$(t)||dZ()}function dZ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
483
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fZ(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function hZ(t){if(Array.isArray(t))return Wx(t)}function aj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function wr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?aj(Object(r),!0).forEach(function(n){Hx(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):aj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Hx(t,e,r){return e=pZ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pZ(t){var e=mZ(t,"string");return hu(e)==="symbol"?e:String(e)}function mZ(t,e){if(hu(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(hu(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function gZ(t,e){return bZ(t)||vZ(t,e)||A$(t,e)||yZ()}function yZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
484
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function A$(t,e){if(t){if(typeof t=="string")return Wx(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Wx(t,e)}}function Wx(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function vZ(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,l=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return l}}function bZ(t){if(Array.isArray(t))return t}var kh=function(e,r,n){return e+(r-e)*n},Gx=function(e){var r=e.from,n=e.to;return r!==n},xZ=function t(e,r,n){var i=$c(function(a,o){if(Gx(o)){var l=e(o.from,o.to,o.velocity),u=gZ(l,2),d=u[0],p=u[1];return wr(wr({},o),{},{from:d,velocity:p})}return o},r);return n<1?$c(function(a,o){return Gx(o)?wr(wr({},o),{},{velocity:kh(o.velocity,i[a].velocity,n),from:kh(o.from,i[a].from,n)}):o},r):t(e,i,n-1)};const wZ=(function(t,e,r,n,i){var a=JJ(t,e),o=a.reduce(function(b,k){return wr(wr({},b),{},Hx({},k,[t[k],e[k]]))},{}),l=a.reduce(function(b,k){return wr(wr({},b),{},Hx({},k,{from:t[k],velocity:0,to:e[k]}))},{}),u=-1,d,p,f=function(){return null},g=function(){return $c(function(k,A){return A.from},l)},v=function(){return!Object.values(l).filter(Gx).length},x=function(k){d||(d=k);var A=k-d,O=A/r.dt;l=xZ(r,l,O),i(wr(wr(wr({},t),e),g())),d=k,v()||(u=requestAnimationFrame(f))},_=function(k){p||(p=k);var A=(k-p)/n,O=$c(function(E,T){return kh.apply(void 0,ij(T).concat([r(A)]))},o);if(i(wr(wr(wr({},t),e),O)),A<1)u=requestAnimationFrame(f);else{var C=$c(function(E,T){return kh.apply(void 0,ij(T).concat([r(1)]))},o);i(wr(wr(wr({},t),e),C))}};return f=r.isStepper?x:_,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(u)}}});function Qs(t){"@babel/helpers - typeof";return Qs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qs(t)}var _Z=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function SZ(t,e){if(t==null)return{};var r=kZ(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function kZ(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,a;for(a=0;a<n.length;a++)i=n[a],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}function ob(t){return TZ(t)||AZ(t)||OZ(t)||EZ()}function EZ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
485
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function OZ(t,e){if(t){if(typeof t=="string")return Kx(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Kx(t,e)}}function AZ(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function TZ(t){if(Array.isArray(t))return Kx(t)}function Kx(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function oj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Un(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?oj(Object(r),!0).forEach(function(n){Tc(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):oj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Tc(t,e,r){return e=T$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function CZ(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function jZ(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,T$(n.key),n)}}function PZ(t,e,r){return e&&jZ(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function T$(t){var e=NZ(t,"string");return Qs(e)==="symbol"?e:String(e)}function NZ(t,e){if(Qs(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Qs(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function RZ(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Vx(t,e)}function Vx(t,e){return Vx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Vx(t,e)}function IZ(t){var e=$Z();return function(){var n=Eh(t),i;if(e){var a=Eh(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Xx(this,i)}}function Xx(t,e){if(e&&(Qs(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Yx(t)}function Yx(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $Z(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Eh(t){return Eh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Eh(t)}var Qi=(function(t){RZ(r,t);var e=IZ(r);function r(n,i){var a;CZ(this,r),a=e.call(this,n,i);var o=a.props,l=o.isActive,u=o.attributeName,d=o.from,p=o.to,f=o.steps,g=o.children,v=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(Yx(a)),a.changeStyle=a.changeStyle.bind(Yx(a)),!l||v<=0)return a.state={style:{}},typeof g=="function"&&(a.state={style:p}),Xx(a);if(f&&f.length)a.state={style:f[0].style};else if(d){if(typeof g=="function")return a.state={style:d},Xx(a);a.state={style:u?Tc({},u,d):d}}else a.state={style:{}};return a}return PZ(r,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,o=i.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isActive,l=a.canBegin,u=a.attributeName,d=a.shouldReAnimate,p=a.to,f=a.from,g=this.state.style;if(l){if(!o){var v={style:u?Tc({},u,p):p};this.state&&g&&(u&&g[u]!==p||!u&&g!==p)&&this.setState(v);return}if(!(UJ(i.to,p)&&i.canBegin&&i.isActive)){var x=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var _=x||d?f:i.to;if(this.state&&g){var b={style:u?Tc({},u,_):_};(u&&g[u]!==_||!u&&g!==_)&&this.setState(b)}this.runAnimation(Un(Un({},this.props),{},{from:_,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,o=i.from,l=i.to,u=i.duration,d=i.easing,p=i.begin,f=i.onAnimationEnd,g=i.onAnimationStart,v=wZ(o,l,uZ(d),u,this.changeStyle),x=function(){a.stopJSAnimation=v()};this.manager.start([g,p,x,u,f])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,l=i.begin,u=i.onAnimationStart,d=o[0],p=d.style,f=d.duration,g=f===void 0?0:f,v=function(_,b,k){if(k===0)return _;var A=b.duration,O=b.easing,C=O===void 0?"ease":O,E=b.style,T=b.properties,P=b.onAnimationEnd,R=k>0?o[k-1]:b,I=T||Object.keys(E);if(typeof C=="function"||C==="spring")return[].concat(ob(_),[a.runJSAnimation.bind(a,{from:R.style,to:E,duration:A,easing:C}),A]);var Y=tj(I,A,C),W=Un(Un(Un({},R.style),E),{},{transition:Y});return[].concat(ob(_),[W,A,P]).filter(ZJ)};return this.manager.start([u].concat(ob(o.reduce(v,[p,Math.max(g,l)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=VJ());var a=i.begin,o=i.duration,l=i.attributeName,u=i.to,d=i.easing,p=i.onAnimationStart,f=i.onAnimationEnd,g=i.steps,v=i.children,x=this.manager;if(this.unSubscribe=x.subscribe(this.handleStyleChange),typeof d=="function"||typeof v=="function"||d==="spring"){this.runJSAnimation(i);return}if(g.length>1){this.runStepAnimation(i);return}var _=l?Tc({},l,u):u,b=tj(Object.keys(_),o,d);x.start([p,a,Un(Un({},_),{},{transition:b}),o,f])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var l=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var u=SZ(i,_Z),d=N.Children.count(a),p=this.state.style;if(typeof a=="function")return a(p);if(!l||d===0||o<=0)return a;var f=function(v){var x=v.props,_=x.style,b=_===void 0?{}:_,k=x.className,A=N.cloneElement(v,Un(Un({},u),{},{style:Un(Un({},b),p),className:k}));return A};return d===1?f(N.Children.only(a)):$.createElement("div",null,N.Children.map(a,function(g){return f(g)}))}}]),r})(N.PureComponent);Qi.displayName="Animate";Qi.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Qi.propTypes={from:mt.oneOfType([mt.object,mt.string]),to:mt.oneOfType([mt.object,mt.string]),attributeName:mt.string,duration:mt.number,begin:mt.number,easing:mt.oneOfType([mt.string,mt.func]),steps:mt.arrayOf(mt.shape({duration:mt.number.isRequired,style:mt.object.isRequired,easing:mt.oneOfType([mt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),mt.func]),properties:mt.arrayOf("string"),onAnimationEnd:mt.func})),children:mt.oneOfType([mt.node,mt.func]),isActive:mt.bool,canBegin:mt.bool,onAnimationEnd:mt.func,shouldReAnimate:mt.bool,onAnimationStart:mt.func,onAnimationReStart:mt.func};function pu(t){"@babel/helpers - typeof";return pu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pu(t)}function Oh(){return Oh=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Oh.apply(this,arguments)}function MZ(t,e){return BZ(t)||zZ(t,e)||DZ(t,e)||LZ()}function LZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
486
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DZ(t,e){if(t){if(typeof t=="string")return sj(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return sj(t,e)}}function sj(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function zZ(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,l=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return l}}function BZ(t){if(Array.isArray(t))return t}function lj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function cj(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?lj(Object(r),!0).forEach(function(n){UZ(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):lj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function UZ(t,e,r){return e=qZ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qZ(t){var e=FZ(t,"string");return pu(e)=="symbol"?e:e+""}function FZ(t,e){if(pu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(pu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var uj=function(e,r,n,i,a){var o=Math.min(Math.abs(n)/2,Math.abs(i)/2),l=i>=0?1:-1,u=n>=0?1:-1,d=i>=0&&n>=0||i<0&&n<0?1:0,p;if(o>0&&a instanceof Array){for(var f=[0,0,0,0],g=0,v=4;g<v;g++)f[g]=a[g]>o?o:a[g];p="M".concat(e,",").concat(r+l*f[0]),f[0]>0&&(p+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(d,",").concat(e+u*f[0],",").concat(r)),p+="L ".concat(e+n-u*f[1],",").concat(r),f[1]>0&&(p+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(d,`,
487
+ `).concat(e+n,",").concat(r+l*f[1])),p+="L ".concat(e+n,",").concat(r+i-l*f[2]),f[2]>0&&(p+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(d,`,
488
+ `).concat(e+n-u*f[2],",").concat(r+i)),p+="L ".concat(e+u*f[3],",").concat(r+i),f[3]>0&&(p+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(d,`,
489
+ `).concat(e,",").concat(r+i-l*f[3])),p+="Z"}else if(o>0&&a===+a&&a>0){var x=Math.min(o,a);p="M ".concat(e,",").concat(r+l*x,`
490
+ A `).concat(x,",").concat(x,",0,0,").concat(d,",").concat(e+u*x,",").concat(r,`
491
+ L `).concat(e+n-u*x,",").concat(r,`
492
+ A `).concat(x,",").concat(x,",0,0,").concat(d,",").concat(e+n,",").concat(r+l*x,`
493
+ L `).concat(e+n,",").concat(r+i-l*x,`
494
+ A `).concat(x,",").concat(x,",0,0,").concat(d,",").concat(e+n-u*x,",").concat(r+i,`
495
+ L `).concat(e+u*x,",").concat(r+i,`
496
+ A `).concat(x,",").concat(x,",0,0,").concat(d,",").concat(e,",").concat(r+i-l*x," Z")}else p="M ".concat(e,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return p},HZ=function(e,r){if(!e||!r)return!1;var n=e.x,i=e.y,a=r.x,o=r.y,l=r.width,u=r.height;if(Math.abs(l)>0&&Math.abs(u)>0){var d=Math.min(a,a+l),p=Math.max(a,a+l),f=Math.min(o,o+u),g=Math.max(o,o+u);return n>=d&&n<=p&&i>=f&&i<=g}return!1},WZ={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},q1=function(e){var r=cj(cj({},WZ),e),n=N.useRef(),i=N.useState(-1),a=MZ(i,2),o=a[0],l=a[1];N.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var C=n.current.getTotalLength();C&&l(C)}catch{}},[]);var u=r.x,d=r.y,p=r.width,f=r.height,g=r.radius,v=r.className,x=r.animationEasing,_=r.animationDuration,b=r.animationBegin,k=r.isAnimationActive,A=r.isUpdateAnimationActive;if(u!==+u||d!==+d||p!==+p||f!==+f||p===0||f===0)return null;var O=at("recharts-rectangle",v);return A?$.createElement(Qi,{canBegin:o>0,from:{width:p,height:f,x:u,y:d},to:{width:p,height:f,x:u,y:d},duration:_,animationEasing:x,isActive:A},function(C){var E=C.width,T=C.height,P=C.x,R=C.y;return $.createElement(Qi,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:b,duration:_,isActive:k,easing:x},$.createElement("path",Oh({},it(r,!0),{className:O,d:uj(P,R,E,T,g),ref:n})))}):$.createElement("path",Oh({},it(r,!0),{className:O,d:uj(u,d,p,f,g)}))};function Jx(){return Jx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Jx.apply(this,arguments)}var F1=function(e){var r=e.cx,n=e.cy,i=e.r,a=e.className,o=at("recharts-dot",a);return r===+r&&n===+n&&i===+i?N.createElement("circle",Jx({},it(e,!1),Wf(e),{className:o,cx:r,cy:n,r:i})):null};function mu(t){"@babel/helpers - typeof";return mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mu(t)}var GZ=["x","y","top","left","width","height","className"];function Zx(){return Zx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Zx.apply(this,arguments)}function dj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function KZ(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?dj(Object(r),!0).forEach(function(n){VZ(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):dj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function VZ(t,e,r){return e=XZ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function XZ(t){var e=YZ(t,"string");return mu(e)=="symbol"?e:e+""}function YZ(t,e){if(mu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(mu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function JZ(t,e){if(t==null)return{};var r=ZZ(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function ZZ(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var QZ=function(e,r,n,i,a,o){return"M".concat(e,",").concat(a,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},eQ=function(e){var r=e.x,n=r===void 0?0:r,i=e.y,a=i===void 0?0:i,o=e.top,l=o===void 0?0:o,u=e.left,d=u===void 0?0:u,p=e.width,f=p===void 0?0:p,g=e.height,v=g===void 0?0:g,x=e.className,_=JZ(e,GZ),b=KZ({x:n,y:a,top:l,left:d,width:f,height:v},_);return!ge(n)||!ge(a)||!ge(f)||!ge(v)||!ge(l)||!ge(d)?null:$.createElement("path",Zx({},it(b,!0),{className:at("recharts-cross",x),d:QZ(n,a,f,v,l,d)}))},sb,fj;function tQ(){if(fj)return sb;fj=1;var t=XR(),e=t(Object.getPrototypeOf,Object);return sb=e,sb}var lb,hj;function rQ(){if(hj)return lb;hj=1;var t=ra(),e=tQ(),r=na(),n="[object Object]",i=Function.prototype,a=Object.prototype,o=i.toString,l=a.hasOwnProperty,u=o.call(Object);function d(p){if(!r(p)||t(p)!=n)return!1;var f=e(p);if(f===null)return!0;var g=l.call(f,"constructor")&&f.constructor;return typeof g=="function"&&g instanceof g&&o.call(g)==u}return lb=d,lb}var nQ=rQ();const iQ=vt(nQ);var cb,pj;function aQ(){if(pj)return cb;pj=1;var t=ra(),e=na(),r="[object Boolean]";function n(i){return i===!0||i===!1||e(i)&&t(i)==r}return cb=n,cb}var oQ=aQ();const sQ=vt(oQ);function gu(t){"@babel/helpers - typeof";return gu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gu(t)}function Ah(){return Ah=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Ah.apply(this,arguments)}function lQ(t,e){return fQ(t)||dQ(t,e)||uQ(t,e)||cQ()}function cQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
497
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uQ(t,e){if(t){if(typeof t=="string")return mj(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mj(t,e)}}function mj(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function dQ(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,l=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return l}}function fQ(t){if(Array.isArray(t))return t}function gj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function yj(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?gj(Object(r),!0).forEach(function(n){hQ(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):gj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function hQ(t,e,r){return e=pQ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pQ(t){var e=mQ(t,"string");return gu(e)=="symbol"?e:e+""}function mQ(t,e){if(gu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(gu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var vj=function(e,r,n,i,a){var o=n-i,l;return l="M ".concat(e,",").concat(r),l+="L ".concat(e+n,",").concat(r),l+="L ".concat(e+n-o/2,",").concat(r+a),l+="L ".concat(e+n-o/2-i,",").concat(r+a),l+="L ".concat(e,",").concat(r," Z"),l},gQ={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},yQ=function(e){var r=yj(yj({},gQ),e),n=N.useRef(),i=N.useState(-1),a=lQ(i,2),o=a[0],l=a[1];N.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var O=n.current.getTotalLength();O&&l(O)}catch{}},[]);var u=r.x,d=r.y,p=r.upperWidth,f=r.lowerWidth,g=r.height,v=r.className,x=r.animationEasing,_=r.animationDuration,b=r.animationBegin,k=r.isUpdateAnimationActive;if(u!==+u||d!==+d||p!==+p||f!==+f||g!==+g||p===0&&f===0||g===0)return null;var A=at("recharts-trapezoid",v);return k?$.createElement(Qi,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:g,x:u,y:d},to:{upperWidth:p,lowerWidth:f,height:g,x:u,y:d},duration:_,animationEasing:x,isActive:k},function(O){var C=O.upperWidth,E=O.lowerWidth,T=O.height,P=O.x,R=O.y;return $.createElement(Qi,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:b,duration:_,easing:x},$.createElement("path",Ah({},it(r,!0),{className:A,d:vj(P,R,C,E,T),ref:n})))}):$.createElement("g",null,$.createElement("path",Ah({},it(r,!0),{className:A,d:vj(u,d,p,f,g)})))},vQ=["option","shapeType","propTransformer","activeClassName","isActive"];function yu(t){"@babel/helpers - typeof";return yu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yu(t)}function bQ(t,e){if(t==null)return{};var r=xQ(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function xQ(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function bj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Th(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?bj(Object(r),!0).forEach(function(n){wQ(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):bj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function wQ(t,e,r){return e=_Q(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _Q(t){var e=SQ(t,"string");return yu(e)=="symbol"?e:e+""}function SQ(t,e){if(yu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(yu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function kQ(t,e){return Th(Th({},e),t)}function EQ(t,e){return t==="symbols"}function xj(t){var e=t.shapeType,r=t.elementProps;switch(e){case"rectangle":return $.createElement(q1,r);case"trapezoid":return $.createElement(yQ,r);case"sector":return $.createElement(w$,r);case"symbols":if(EQ(e))return $.createElement(s1,r);break;default:return null}}function OQ(t){return N.isValidElement(t)?t.props:t}function AQ(t){var e=t.option,r=t.shapeType,n=t.propTransformer,i=n===void 0?kQ:n,a=t.activeClassName,o=a===void 0?"recharts-active-shape":a,l=t.isActive,u=bQ(t,vQ),d;if(N.isValidElement(e))d=N.cloneElement(e,Th(Th({},u),OQ(e)));else if(Ye(e))d=e(u);else if(iQ(e)&&!sQ(e)){var p=i(e,u);d=$.createElement(xj,{shapeType:r,elementProps:p})}else{var f=u;d=$.createElement(xj,{shapeType:r,elementProps:f})}return l?$.createElement(Xt,{className:o},d):d}function Op(t,e){return e!=null&&"trapezoids"in t.props}function Ap(t,e){return e!=null&&"sectors"in t.props}function vu(t,e){return e!=null&&"points"in t.props}function TQ(t,e){var r,n,i=t.x===(e==null||(r=e.labelViewBox)===null||r===void 0?void 0:r.x)||t.x===e.x,a=t.y===(e==null||(n=e.labelViewBox)===null||n===void 0?void 0:n.y)||t.y===e.y;return i&&a}function CQ(t,e){var r=t.endAngle===e.endAngle,n=t.startAngle===e.startAngle;return r&&n}function jQ(t,e){var r=t.x===e.x,n=t.y===e.y,i=t.z===e.z;return r&&n&&i}function PQ(t,e){var r;return Op(t,e)?r=TQ:Ap(t,e)?r=CQ:vu(t,e)&&(r=jQ),r}function NQ(t,e){var r;return Op(t,e)?r="trapezoids":Ap(t,e)?r="sectors":vu(t,e)&&(r="points"),r}function RQ(t,e){if(Op(t,e)){var r;return(r=e.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}if(Ap(t,e)){var n;return(n=e.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}return vu(t,e)?e.payload:{}}function IQ(t){var e=t.activeTooltipItem,r=t.graphicalItem,n=t.itemData,i=NQ(r,e),a=RQ(r,e),o=n.filter(function(u,d){var p=Sp(a,u),f=r.props[i].filter(function(x){var _=PQ(r,e);return _(x,e)}),g=r.props[i].indexOf(f[f.length-1]),v=d===g;return p&&v}),l=n.indexOf(o[o.length-1]);return l}var ub,wj;function $Q(){if(wj)return ub;wj=1;var t=Math.ceil,e=Math.max;function r(n,i,a,o){for(var l=-1,u=e(t((i-n)/(a||1)),0),d=Array(u);u--;)d[o?u:++l]=n,n+=a;return d}return ub=r,ub}var db,_j;function C$(){if(_j)return db;_j=1;var t=dI(),e=1/0,r=17976931348623157e292;function n(i){if(!i)return i===0?i:0;if(i=t(i),i===e||i===-e){var a=i<0?-1:1;return a*r}return i===i?i:0}return db=n,db}var fb,Sj;function MQ(){if(Sj)return fb;Sj=1;var t=$Q(),e=pp(),r=C$();function n(i){return function(a,o,l){return l&&typeof l!="number"&&e(a,o,l)&&(o=l=void 0),a=r(a),o===void 0?(o=a,a=0):o=r(o),l=l===void 0?a<o?1:-1:r(l),t(a,o,l,i)}}return fb=n,fb}var hb,kj;function LQ(){if(kj)return hb;kj=1;var t=MQ(),e=t();return hb=e,hb}var DQ=LQ();const Ch=vt(DQ);function bu(t){"@babel/helpers - typeof";return bu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bu(t)}function Ej(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Oj(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ej(Object(r),!0).forEach(function(n){j$(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ej(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function j$(t,e,r){return e=zQ(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function zQ(t){var e=BQ(t,"string");return bu(e)=="symbol"?e:e+""}function BQ(t,e){if(bu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(bu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var UQ=["Webkit","Moz","O","ms"],qQ=function(e,r){var n=e.replace(/(\w)/,function(a){return a.toUpperCase()}),i=UQ.reduce(function(a,o){return Oj(Oj({},a),{},j$({},o+n,r))},{});return i[e]=r,i};function el(t){"@babel/helpers - typeof";return el=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},el(t)}function jh(){return jh=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},jh.apply(this,arguments)}function Aj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function pb(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Aj(Object(r),!0).forEach(function(n){on(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Aj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function FQ(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Tj(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,N$(n.key),n)}}function HQ(t,e,r){return e&&Tj(t.prototype,e),r&&Tj(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function WQ(t,e,r){return e=Ph(e),GQ(t,P$()?Reflect.construct(e,r||[],Ph(t).constructor):e.apply(t,r))}function GQ(t,e){if(e&&(el(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return KQ(t)}function KQ(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function P$(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(P$=function(){return!!t})()}function Ph(t){return Ph=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ph(t)}function VQ(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Qx(t,e)}function Qx(t,e){return Qx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Qx(t,e)}function on(t,e,r){return e=N$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function N$(t){var e=XQ(t,"string");return el(e)=="symbol"?e:e+""}function XQ(t,e){if(el(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(el(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var YQ=function(e){var r=e.data,n=e.startIndex,i=e.endIndex,a=e.x,o=e.width,l=e.travellerWidth;if(!r||!r.length)return{};var u=r.length,d=Rc().domain(Ch(0,u)).range([a,a+o-l]),p=d.domain().map(function(f){return d(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:d(n),endX:d(i),scale:d,scaleValues:p}},Cj=function(e){return e.changedTouches&&!!e.changedTouches.length},tl=(function(t){function e(r){var n;return FQ(this,e),n=WQ(this,e,[r]),on(n,"handleDrag",function(i){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(i):n.state.isSlideMoving&&n.handleSlideDrag(i)}),on(n,"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&n.handleDrag(i.changedTouches[0])}),on(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,a=i.endIndex,o=i.onDragEnd,l=i.startIndex;o==null||o({endIndex:a,startIndex:l})}),n.detachDragEndListener()}),on(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),on(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),on(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),on(n,"handleSlideDragStart",function(i){var a=Cj(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return VQ(e,t),HQ(e,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,a=n.endX,o=this.state.scaleValues,l=this.props,u=l.gap,d=l.data,p=d.length-1,f=Math.min(i,a),g=Math.max(i,a),v=e.getIndexInRange(o,f),x=e.getIndexInRange(o,g);return{startIndex:v-v%u,endIndex:x===p?p:x-x%u}}},{key:"getTextOfTick",value:function(n){var i=this.props,a=i.data,o=i.tickFormatter,l=i.dataKey,u=dn(a[n],l,n);return Ye(o)?o(u,n):u}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,a=i.slideMoveStartX,o=i.startX,l=i.endX,u=this.props,d=u.x,p=u.width,f=u.travellerWidth,g=u.startIndex,v=u.endIndex,x=u.onChange,_=n.pageX-a;_>0?_=Math.min(_,d+p-f-l,d+p-f-o):_<0&&(_=Math.max(_,d-o,d-l));var b=this.getIndex({startX:o+_,endX:l+_});(b.startIndex!==g||b.endIndex!==v)&&x&&x(b),this.setState({startX:o+_,endX:l+_,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=Cj(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,a=i.brushMoveStartX,o=i.movingTravellerId,l=i.endX,u=i.startX,d=this.state[o],p=this.props,f=p.x,g=p.width,v=p.travellerWidth,x=p.onChange,_=p.gap,b=p.data,k={startX:this.state.startX,endX:this.state.endX},A=n.pageX-a;A>0?A=Math.min(A,f+g-v-d):A<0&&(A=Math.max(A,f-d)),k[o]=d+A;var O=this.getIndex(k),C=O.startIndex,E=O.endIndex,T=function(){var R=b.length-1;return o==="startX"&&(l>u?C%_===0:E%_===0)||l<u&&E===R||o==="endX"&&(l>u?E%_===0:C%_===0)||l>u&&E===R};this.setState(on(on({},o,d+A),"brushMoveStartX",n.pageX),function(){x&&T()&&x(O)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var a=this,o=this.state,l=o.scaleValues,u=o.startX,d=o.endX,p=this.state[i],f=l.indexOf(p);if(f!==-1){var g=f+n;if(!(g===-1||g>=l.length)){var v=l[g];i==="startX"&&v>=d||i==="endX"&&v<=u||this.setState(on({},i,v),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,l=n.height,u=n.fill,d=n.stroke;return $.createElement("rect",{stroke:d,fill:u,x:i,y:a,width:o,height:l})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,l=n.height,u=n.data,d=n.children,p=n.padding,f=N.Children.only(d);return f?$.cloneElement(f,{x:i,y:a,width:o,height:l,margin:p,compact:!0,data:u}):null}},{key:"renderTravellerLayer",value:function(n,i){var a,o,l=this,u=this.props,d=u.y,p=u.travellerWidth,f=u.height,g=u.traveller,v=u.ariaLabel,x=u.data,_=u.startIndex,b=u.endIndex,k=Math.max(n,this.props.x),A=pb(pb({},it(this.props,!1)),{},{x:k,y:d,width:p,height:f}),O=v||"Min value: ".concat((a=x[_])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=x[b])===null||o===void 0?void 0:o.name);return $.createElement(Xt,{tabIndex:0,role:"slider","aria-label":O,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(E){["ArrowLeft","ArrowRight"].includes(E.key)&&(E.preventDefault(),E.stopPropagation(),l.handleTravellerMoveKeyboard(E.key==="ArrowRight"?1:-1,i))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(g,A))}},{key:"renderSlide",value:function(n,i){var a=this.props,o=a.y,l=a.height,u=a.stroke,d=a.travellerWidth,p=Math.min(n,i)+d,f=Math.max(Math.abs(i-n)-d,0);return $.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:u,fillOpacity:.2,x:p,y:o,width:f,height:l})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,a=n.endIndex,o=n.y,l=n.height,u=n.travellerWidth,d=n.stroke,p=this.state,f=p.startX,g=p.endX,v=5,x={pointerEvents:"none",fill:d};return $.createElement(Xt,{className:"recharts-brush-texts"},$.createElement(ih,jh({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,g)-v,y:o+l/2},x),this.getTextOfTick(i)),$.createElement(ih,jh({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,g)+u+v,y:o+l/2},x),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,i=n.data,a=n.className,o=n.children,l=n.x,u=n.y,d=n.width,p=n.height,f=n.alwaysShowText,g=this.state,v=g.startX,x=g.endX,_=g.isTextActive,b=g.isSlideMoving,k=g.isTravellerMoving,A=g.isTravellerFocused;if(!i||!i.length||!ge(l)||!ge(u)||!ge(d)||!ge(p)||d<=0||p<=0)return null;var O=at("recharts-brush",a),C=$.Children.count(o)===1,E=qQ("userSelect","none");return $.createElement(Xt,{className:O,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:E},this.renderBackground(),C&&this.renderPanorama(),this.renderSlide(v,x),this.renderTravellerLayer(v,"startX"),this.renderTravellerLayer(x,"endX"),(_||b||k||A||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,a=n.y,o=n.width,l=n.height,u=n.stroke,d=Math.floor(a+l/2)-1;return $.createElement($.Fragment,null,$.createElement("rect",{x:i,y:a,width:o,height:l,fill:u,stroke:"none"}),$.createElement("line",{x1:i+1,y1:d,x2:i+o-1,y2:d,fill:"none",stroke:"#fff"}),$.createElement("line",{x1:i+1,y1:d+2,x2:i+o-1,y2:d+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var a;return $.isValidElement(n)?a=$.cloneElement(n,i):Ye(n)?a=n(i):a=e.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(n,i){var a=n.data,o=n.width,l=n.x,u=n.travellerWidth,d=n.updateId,p=n.startIndex,f=n.endIndex;if(a!==i.prevData||d!==i.prevUpdateId)return pb({prevData:a,prevTravellerWidth:u,prevUpdateId:d,prevX:l,prevWidth:o},a&&a.length?YQ({data:a,width:o,x:l,travellerWidth:u,startIndex:p,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||l!==i.prevX||u!==i.prevTravellerWidth)){i.scale.range([l,l+o-u]);var g=i.scale.domain().map(function(v){return i.scale(v)});return{prevData:a,prevTravellerWidth:u,prevUpdateId:d,prevX:l,prevWidth:o,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:g}}return null}},{key:"getIndexInRange",value:function(n,i){for(var a=n.length,o=0,l=a-1;l-o>1;){var u=Math.floor((o+l)/2);n[u]>i?l=u:o=u}return i>=n[l]?l:o}}])})(N.PureComponent);on(tl,"displayName","Brush");on(tl,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var mb,jj;function JQ(){if(jj)return mb;jj=1;var t=p1();function e(r,n){var i;return t(r,function(a,o,l){return i=n(a,o,l),!i}),!!i}return mb=e,mb}var gb,Pj;function ZQ(){if(Pj)return gb;Pj=1;var t=qR(),e=Fa(),r=JQ(),n=Zr(),i=pp();function a(o,l,u){var d=n(o)?t:r;return u&&i(o,l,u)&&(l=void 0),d(o,e(l,3))}return gb=a,gb}var QQ=ZQ();const eee=vt(QQ);var Si=function(e,r){var n=e.alwaysShow,i=e.ifOverflow;return n&&(i="extendDomain"),i===r},yb,Nj;function tee(){if(Nj)return yb;Nj=1;var t=oI();function e(r,n,i){n=="__proto__"&&t?t(r,n,{configurable:!0,enumerable:!0,value:i,writable:!0}):r[n]=i}return yb=e,yb}var vb,Rj;function ree(){if(Rj)return vb;Rj=1;var t=tee(),e=iI(),r=Fa();function n(i,a){var o={};return a=r(a,3),e(i,function(l,u,d){t(o,u,a(l,u,d))}),o}return vb=n,vb}var nee=ree();const iee=vt(nee);var bb,Ij;function aee(){if(Ij)return bb;Ij=1;function t(e,r){for(var n=-1,i=e==null?0:e.length;++n<i;)if(!r(e[n],n,e))return!1;return!0}return bb=t,bb}var xb,$j;function oee(){if($j)return xb;$j=1;var t=p1();function e(r,n){var i=!0;return t(r,function(a,o,l){return i=!!n(a,o,l),i}),i}return xb=e,xb}var wb,Mj;function see(){if(Mj)return wb;Mj=1;var t=aee(),e=oee(),r=Fa(),n=Zr(),i=pp();function a(o,l,u){var d=n(o)?t:e;return u&&i(o,l,u)&&(l=void 0),d(o,r(l,3))}return wb=a,wb}var lee=see();const R$=vt(lee);var cee=["x","y"];function xu(t){"@babel/helpers - typeof";return xu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xu(t)}function ew(){return ew=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ew.apply(this,arguments)}function Lj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function wc(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Lj(Object(r),!0).forEach(function(n){uee(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Lj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function uee(t,e,r){return e=dee(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function dee(t){var e=fee(t,"string");return xu(e)=="symbol"?e:e+""}function fee(t,e){if(xu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(xu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function hee(t,e){if(t==null)return{};var r=pee(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function pee(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function mee(t,e){var r=t.x,n=t.y,i=hee(t,cee),a="".concat(r),o=parseInt(a,10),l="".concat(n),u=parseInt(l,10),d="".concat(e.height||i.height),p=parseInt(d,10),f="".concat(e.width||i.width),g=parseInt(f,10);return wc(wc(wc(wc(wc({},e),i),o?{x:o}:{}),u?{y:u}:{}),{},{height:p,width:g,name:e.name,radius:e.radius})}function Dj(t){return $.createElement(AQ,ew({shapeType:"rectangle",propTransformer:mee,activeClassName:"recharts-active-bar"},t))}var gee=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof e=="number")return e;var a=ge(n)||_9(n);return a?e(n,i):(a||$o(),r)}},yee=["value","background"],I$;function rl(t){"@babel/helpers - typeof";return rl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rl(t)}function vee(t,e){if(t==null)return{};var r=bee(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function bee(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function Nh(){return Nh=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Nh.apply(this,arguments)}function zj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Jt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?zj(Object(r),!0).forEach(function(n){Ia(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):zj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function xee(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Bj(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,M$(n.key),n)}}function wee(t,e,r){return e&&Bj(t.prototype,e),r&&Bj(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function _ee(t,e,r){return e=Rh(e),See(t,$$()?Reflect.construct(e,r||[],Rh(t).constructor):e.apply(t,r))}function See(t,e){if(e&&(rl(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return kee(t)}function kee(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $$(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($$=function(){return!!t})()}function Rh(t){return Rh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Rh(t)}function Eee(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&tw(t,e)}function tw(t,e){return tw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},tw(t,e)}function Ia(t,e,r){return e=M$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function M$(t){var e=Oee(t,"string");return rl(e)=="symbol"?e:e+""}function Oee(t,e){if(rl(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(rl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var ea=(function(t){function e(){var r;xee(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=_ee(this,e,[].concat(i)),Ia(r,"state",{isAnimationFinished:!1}),Ia(r,"id",Iu("recharts-bar-")),Ia(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),o&&o()}),Ia(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),o&&o()}),r}return Eee(e,t),wee(e,[{key:"renderRectanglesStatically",value:function(n){var i=this,a=this.props,o=a.shape,l=a.dataKey,u=a.activeIndex,d=a.activeBar,p=it(this.props,!1);return n&&n.map(function(f,g){var v=g===u,x=v?d:o,_=Jt(Jt(Jt({},p),f),{},{isActive:v,option:x,index:g,dataKey:l,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return $.createElement(Xt,Nh({className:"recharts-bar-rectangle"},Gf(i.props,f,g),{key:"rectangle-".concat(f==null?void 0:f.x,"-").concat(f==null?void 0:f.y,"-").concat(f==null?void 0:f.value,"-").concat(g)}),$.createElement(Dj,_))})}},{key:"renderRectanglesWithAnimation",value:function(){var n=this,i=this.props,a=i.data,o=i.layout,l=i.isAnimationActive,u=i.animationBegin,d=i.animationDuration,p=i.animationEasing,f=i.animationId,g=this.state.prevData;return $.createElement(Qi,{begin:u,duration:d,isActive:l,easing:p,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(v){var x=v.t,_=a.map(function(b,k){var A=g&&g[k];if(A){var O=Vn(A.x,b.x),C=Vn(A.y,b.y),E=Vn(A.width,b.width),T=Vn(A.height,b.height);return Jt(Jt({},b),{},{x:O(x),y:C(x),width:E(x),height:T(x)})}if(o==="horizontal"){var P=Vn(0,b.height),R=P(x);return Jt(Jt({},b),{},{y:b.y+b.height-R,height:R})}var I=Vn(0,b.width),Y=I(x);return Jt(Jt({},b),{},{width:Y})});return $.createElement(Xt,null,n.renderRectanglesStatically(_))})}},{key:"renderRectangles",value:function(){var n=this.props,i=n.data,a=n.isAnimationActive,o=this.state.prevData;return a&&i&&i.length&&(!o||!Sp(o,i))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(i)}},{key:"renderBackground",value:function(){var n=this,i=this.props,a=i.data,o=i.dataKey,l=i.activeIndex,u=it(this.props.background,!1);return a.map(function(d,p){d.value;var f=d.background,g=vee(d,yee);if(!f)return null;var v=Jt(Jt(Jt(Jt(Jt({},g),{},{fill:"#eee"},f),u),Gf(n.props,d,p)),{},{onAnimationStart:n.handleAnimationStart,onAnimationEnd:n.handleAnimationEnd,dataKey:o,index:p,className:"recharts-bar-background-rectangle"});return $.createElement(Dj,Nh({key:"background-bar-".concat(p),option:n.props.background,isActive:p===l},v))})}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.data,l=a.xAxis,u=a.yAxis,d=a.layout,p=a.children,f=Cn(p,Bu);if(!f)return null;var g=d==="vertical"?o[0].height/2:o[0].width/2,v=function(b,k){var A=Array.isArray(b.value)?b.value[1]:b.value;return{x:b.x,y:b.y,value:A,errorVal:dn(b,k)}},x={clipPath:n?"url(#clipPath-".concat(i,")"):null};return $.createElement(Xt,x,f.map(function(_){return $.cloneElement(_,{key:"error-bar-".concat(i,"-").concat(_.props.dataKey),data:o,xAxis:l,yAxis:u,layout:d,offset:g,dataPointFormatter:v})}))}},{key:"render",value:function(){var n=this.props,i=n.hide,a=n.data,o=n.className,l=n.xAxis,u=n.yAxis,d=n.left,p=n.top,f=n.width,g=n.height,v=n.isAnimationActive,x=n.background,_=n.id;if(i||!a||!a.length)return null;var b=this.state.isAnimationFinished,k=at("recharts-bar",o),A=l&&l.allowDataOverflow,O=u&&u.allowDataOverflow,C=A||O,E=Qe(_)?this.id:_;return $.createElement(Xt,{className:k},A||O?$.createElement("defs",null,$.createElement("clipPath",{id:"clipPath-".concat(E)},$.createElement("rect",{x:A?d:d-f/2,y:O?p:p-g/2,width:A?f:f*2,height:O?g:g*2}))):null,$.createElement(Xt,{className:"recharts-bar-rectangles",clipPath:C?"url(#clipPath-".concat(E,")"):null},x?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(C,E),(!v||b)&&La.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curData:n.data,prevData:i.curData}:n.data!==i.curData?{curData:n.data}:null}}])})(N.PureComponent);I$=ea;Ia(ea,"displayName","Bar");Ia(ea,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!wl.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Ia(ea,"getComposedData",function(t){var e=t.props,r=t.item,n=t.barPosition,i=t.bandSize,a=t.xAxis,o=t.yAxis,l=t.xAxisTicks,u=t.yAxisTicks,d=t.stackedData,p=t.dataStartIndex,f=t.displayedData,g=t.offset,v=UX(n,r);if(!v)return null;var x=e.layout,_=r.type.defaultProps,b=_!==void 0?Jt(Jt({},_),r.props):r.props,k=b.dataKey,A=b.children,O=b.minPointSize,C=x==="horizontal"?o:a,E=d?C.scale.domain():null,T=XX({numericAxis:C}),P=Cn(A,hI),R=f.map(function(I,Y){var W,B,X,K,U,G;d?W=qX(d[p+Y],E):(W=dn(I,k),Array.isArray(W)||(W=[T,W]));var J=gee(O,I$.defaultProps.minPointSize)(W[1],Y);if(x==="horizontal"){var F,te=[o.scale(W[0]),o.scale(W[1])],q=te[0],z=te[1];B=OC({axis:a,ticks:l,bandSize:i,offset:v.offset,entry:I,index:Y}),X=(F=z??q)!==null&&F!==void 0?F:void 0,K=v.size;var L=q-z;if(U=Number.isNaN(L)?0:L,G={x:B,y:o.y,width:K,height:o.height},Math.abs(J)>0&&Math.abs(U)<Math.abs(J)){var Z=Jn(U||J)*(Math.abs(J)-Math.abs(U));X-=Z,U+=Z}}else{var se=[a.scale(W[0]),a.scale(W[1])],le=se[0],ve=se[1];if(B=le,X=OC({axis:o,ticks:u,bandSize:i,offset:v.offset,entry:I,index:Y}),K=ve-le,U=v.size,G={x:a.x,y:X,width:a.width,height:U},Math.abs(J)>0&&Math.abs(K)<Math.abs(J)){var qe=Jn(K||J)*(Math.abs(J)-Math.abs(K));K+=qe}}return Jt(Jt(Jt({},I),{},{x:B,y:X,width:K,height:U,value:d?W:W[1],payload:I,background:G},P&&P[Y]&&P[Y].props),{},{tooltipPayload:[v$(r,I)],tooltipPosition:{x:B+K/2,y:X+U/2}})});return Jt({data:R,layout:x},g)});function wu(t){"@babel/helpers - typeof";return wu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wu(t)}function Aee(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Uj(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,L$(n.key),n)}}function Tee(t,e,r){return e&&Uj(t.prototype,e),r&&Uj(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function qj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Hn(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?qj(Object(r),!0).forEach(function(n){Tp(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):qj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Tp(t,e,r){return e=L$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function L$(t){var e=Cee(t,"string");return wu(e)=="symbol"?e:e+""}function Cee(t,e){if(wu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(wu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var D$=function(e,r,n,i,a){var o=e.width,l=e.height,u=e.layout,d=e.children,p=Object.keys(r),f={left:n.left,leftMirror:n.left,right:o-n.right,rightMirror:o-n.right,top:n.top,topMirror:n.top,bottom:l-n.bottom,bottomMirror:l-n.bottom},g=!!sn(d,ea);return p.reduce(function(v,x){var _=r[x],b=_.orientation,k=_.domain,A=_.padding,O=A===void 0?{}:A,C=_.mirror,E=_.reversed,T="".concat(b).concat(C?"Mirror":""),P,R,I,Y,W;if(_.type==="number"&&(_.padding==="gap"||_.padding==="no-gap")){var B=k[1]-k[0],X=1/0,K=_.categoricalDomain.sort(E9);if(K.forEach(function(se,le){le>0&&(X=Math.min((se||0)-(K[le-1]||0),X))}),Number.isFinite(X)){var U=X/B,G=_.layout==="vertical"?n.height:n.width;if(_.padding==="gap"&&(P=U*G/2),_.padding==="no-gap"){var J=Ro(e.barCategoryGap,U*G),F=U*G/2;P=F-J-(F-J)/G*J}}}i==="xAxis"?R=[n.left+(O.left||0)+(P||0),n.left+n.width-(O.right||0)-(P||0)]:i==="yAxis"?R=u==="horizontal"?[n.top+n.height-(O.bottom||0),n.top+(O.top||0)]:[n.top+(O.top||0)+(P||0),n.top+n.height-(O.bottom||0)-(P||0)]:R=_.range,E&&(R=[R[1],R[0]]);var te=zX(_,a,g),q=te.scale,z=te.realScaleType;q.domain(k).range(R),BX(q);var L=VX(q,Hn(Hn({},_),{},{realScaleType:z}));i==="xAxis"?(W=b==="top"&&!C||b==="bottom"&&C,I=n.left,Y=f[T]-W*_.height):i==="yAxis"&&(W=b==="left"&&!C||b==="right"&&C,I=f[T]-W*_.width,Y=n.top);var Z=Hn(Hn(Hn({},_),L),{},{realScaleType:z,x:I,y:Y,scale:q,width:i==="xAxis"?n.width:_.width,height:i==="yAxis"?n.height:_.height});return Z.bandSize=bh(Z,L),!_.hide&&i==="xAxis"?f[T]+=(W?-1:1)*Z.height:_.hide||(f[T]+=(W?-1:1)*Z.width),Hn(Hn({},v),{},Tp({},x,Z))},{})},z$=function(e,r){var n=e.x,i=e.y,a=r.x,o=r.y;return{x:Math.min(n,a),y:Math.min(i,o),width:Math.abs(a-n),height:Math.abs(o-i)}},jee=function(e){var r=e.x1,n=e.y1,i=e.x2,a=e.y2;return z$({x:r,y:n},{x:i,y:a})},B$=(function(){function t(e){Aee(this,t),this.scale=e}return Tee(t,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,a=n.position;if(r!==void 0){if(a)switch(a){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(r)+l}default:return this.scale(r)}if(i){var u=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+u}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],a=n[n.length-1];return i<=a?r>=i&&r<=a:r>=a&&r<=i}}],[{key:"create",value:function(r){return new t(r)}}])})();Tp(B$,"EPS",1e-4);var H1=function(e){var r=Object.keys(e).reduce(function(n,i){return Hn(Hn({},n),{},Tp({},i,B$.create(e[i])))},{});return Hn(Hn({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,l=a.position;return iee(i,function(u,d){return r[d].apply(u,{bandAware:o,position:l})})},isInRange:function(i){return R$(i,function(a,o){return r[o].isInRange(a)})}})};function Pee(t){return(t%180+180)%180}var Nee=function(e){var r=e.width,n=e.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Pee(i),o=a*Math.PI/180,l=Math.atan(n/r),u=o>l&&o<Math.PI-l?n/Math.sin(o):r/Math.cos(o);return Math.abs(u)},_b,Fj;function Ree(){if(Fj)return _b;Fj=1;var t=Fa(),e=$u(),r=fp();function n(i){return function(a,o,l){var u=Object(a);if(!e(a)){var d=t(o,3);a=r(a),o=function(f){return d(u[f],f,u)}}var p=i(a,o,l);return p>-1?u[d?a[p]:p]:void 0}}return _b=n,_b}var Sb,Hj;function Iee(){if(Hj)return Sb;Hj=1;var t=C$();function e(r){var n=t(r),i=n%1;return n===n?i?n-i:n:0}return Sb=e,Sb}var kb,Wj;function $ee(){if(Wj)return kb;Wj=1;var t=QR(),e=Fa(),r=Iee(),n=Math.max;function i(a,o,l){var u=a==null?0:a.length;if(!u)return-1;var d=l==null?0:r(l);return d<0&&(d=n(u+d,0)),t(a,e(o,3),d)}return kb=i,kb}var Eb,Gj;function Mee(){if(Gj)return Eb;Gj=1;var t=Ree(),e=$ee(),r=t(e);return Eb=r,Eb}var Lee=Mee();const Dee=vt(Lee);var zee=mR();const Bee=vt(zee);var Uee=Bee(function(t){return{x:t.left,y:t.top,width:t.width,height:t.height}},function(t){return["l",t.left,"t",t.top,"w",t.width,"h",t.height].join("")}),W1=N.createContext(void 0),G1=N.createContext(void 0),U$=N.createContext(void 0),q$=N.createContext({}),F$=N.createContext(void 0),H$=N.createContext(0),W$=N.createContext(0),Kj=function(e){var r=e.state,n=r.xAxisMap,i=r.yAxisMap,a=r.offset,o=e.clipPathId,l=e.children,u=e.width,d=e.height,p=Uee(a);return $.createElement(W1.Provider,{value:n},$.createElement(G1.Provider,{value:i},$.createElement(q$.Provider,{value:a},$.createElement(U$.Provider,{value:p},$.createElement(F$.Provider,{value:o},$.createElement(H$.Provider,{value:d},$.createElement(W$.Provider,{value:u},l)))))))},qee=function(){return N.useContext(F$)},G$=function(e){var r=N.useContext(W1);r==null&&$o();var n=r[e];return n==null&&$o(),n},Fee=function(){var e=N.useContext(W1);return Na(e)},Hee=function(){var e=N.useContext(G1),r=Dee(e,function(n){return R$(n.domain,Number.isFinite)});return r||Na(e)},K$=function(e){var r=N.useContext(G1);r==null&&$o();var n=r[e];return n==null&&$o(),n},Wee=function(){var e=N.useContext(U$);return e},Gee=function(){return N.useContext(q$)},K1=function(){return N.useContext(W$)},V1=function(){return N.useContext(H$)};function nl(t){"@babel/helpers - typeof";return nl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nl(t)}function Kee(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Vee(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,X$(n.key),n)}}function Xee(t,e,r){return e&&Vee(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Yee(t,e,r){return e=Ih(e),Jee(t,V$()?Reflect.construct(e,r||[],Ih(t).constructor):e.apply(t,r))}function Jee(t,e){if(e&&(nl(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Zee(t)}function Zee(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function V$(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(V$=function(){return!!t})()}function Ih(t){return Ih=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ih(t)}function Qee(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&rw(t,e)}function rw(t,e){return rw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},rw(t,e)}function Vj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Xj(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Vj(Object(r),!0).forEach(function(n){X1(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Vj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function X1(t,e,r){return e=X$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function X$(t){var e=ete(t,"string");return nl(e)=="symbol"?e:e+""}function ete(t,e){if(nl(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(nl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function tte(t,e){return ate(t)||ite(t,e)||nte(t,e)||rte()}function rte(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
498
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nte(t,e){if(t){if(typeof t=="string")return Yj(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yj(t,e)}}function Yj(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ite(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,l=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return l}}function ate(t){if(Array.isArray(t))return t}function nw(){return nw=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},nw.apply(this,arguments)}var ote=function(e,r){var n;return $.isValidElement(e)?n=$.cloneElement(e,r):Ye(e)?n=e(r):n=$.createElement("line",nw({},r,{className:"recharts-reference-line-line"})),n},ste=function(e,r,n,i,a,o,l,u,d){var p=a.x,f=a.y,g=a.width,v=a.height;if(n){var x=d.y,_=e.y.apply(x,{position:o});if(Si(d,"discard")&&!e.y.isInRange(_))return null;var b=[{x:p+g,y:_},{x:p,y:_}];return u==="left"?b.reverse():b}if(r){var k=d.x,A=e.x.apply(k,{position:o});if(Si(d,"discard")&&!e.x.isInRange(A))return null;var O=[{x:A,y:f+v},{x:A,y:f}];return l==="top"?O.reverse():O}if(i){var C=d.segment,E=C.map(function(T){return e.apply(T,{position:o})});return Si(d,"discard")&&eee(E,function(T){return!e.isInRange(T)})?null:E}return null};function lte(t){var e=t.x,r=t.y,n=t.segment,i=t.xAxisId,a=t.yAxisId,o=t.shape,l=t.className,u=t.alwaysShow,d=qee(),p=G$(i),f=K$(a),g=Wee();if(!d||!g)return null;Ki(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var v=H1({x:p.scale,y:f.scale}),x=or(e),_=or(r),b=n&&n.length===2,k=ste(v,x,_,b,g,t.position,p.orientation,f.orientation,t);if(!k)return null;var A=tte(k,2),O=A[0],C=O.x,E=O.y,T=A[1],P=T.x,R=T.y,I=Si(t,"hidden")?"url(#".concat(d,")"):void 0,Y=Xj(Xj({clipPath:I},it(t,!0)),{},{x1:C,y1:E,x2:P,y2:R});return $.createElement(Xt,{className:at("recharts-reference-line",l)},ote(o,Y),jr.renderCallByParent(t,jee({x1:C,y1:E,x2:P,y2:R})))}var Y1=(function(t){function e(){return Kee(this,e),Yee(this,e,arguments)}return Qee(e,t),Xee(e,[{key:"render",value:function(){return $.createElement(lte,this.props)}}])})($.Component);X1(Y1,"displayName","ReferenceLine");X1(Y1,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function iw(){return iw=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},iw.apply(this,arguments)}function il(t){"@babel/helpers - typeof";return il=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},il(t)}function Jj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Zj(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Jj(Object(r),!0).forEach(function(n){Cp(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Jj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function cte(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ute(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,J$(n.key),n)}}function dte(t,e,r){return e&&ute(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function fte(t,e,r){return e=$h(e),hte(t,Y$()?Reflect.construct(e,r||[],$h(t).constructor):e.apply(t,r))}function hte(t,e){if(e&&(il(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pte(t)}function pte(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Y$(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Y$=function(){return!!t})()}function $h(t){return $h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},$h(t)}function mte(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&aw(t,e)}function aw(t,e){return aw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},aw(t,e)}function Cp(t,e,r){return e=J$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function J$(t){var e=gte(t,"string");return il(e)=="symbol"?e:e+""}function gte(t,e){if(il(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(il(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var yte=function(e){var r=e.x,n=e.y,i=e.xAxis,a=e.yAxis,o=H1({x:i.scale,y:a.scale}),l=o.apply({x:r,y:n},{bandAware:!0});return Si(e,"discard")&&!o.isInRange(l)?null:l},jp=(function(t){function e(){return cte(this,e),fte(this,e,arguments)}return mte(e,t),dte(e,[{key:"render",value:function(){var n=this.props,i=n.x,a=n.y,o=n.r,l=n.alwaysShow,u=n.clipPathId,d=or(i),p=or(a);if(Ki(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!d||!p)return null;var f=yte(this.props);if(!f)return null;var g=f.x,v=f.y,x=this.props,_=x.shape,b=x.className,k=Si(this.props,"hidden")?"url(#".concat(u,")"):void 0,A=Zj(Zj({clipPath:k},it(this.props,!0)),{},{cx:g,cy:v});return $.createElement(Xt,{className:at("recharts-reference-dot",b)},e.renderDot(_,A),jr.renderCallByParent(this.props,{x:g-o,y:v-o,width:2*o,height:2*o}))}}])})($.Component);Cp(jp,"displayName","ReferenceDot");Cp(jp,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});Cp(jp,"renderDot",function(t,e){var r;return $.isValidElement(t)?r=$.cloneElement(t,e):Ye(t)?r=t(e):r=$.createElement(F1,iw({},e,{cx:e.cx,cy:e.cy,className:"recharts-reference-dot-dot"})),r});function ow(){return ow=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ow.apply(this,arguments)}function al(t){"@babel/helpers - typeof";return al=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},al(t)}function Qj(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function eP(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Qj(Object(r),!0).forEach(function(n){Pp(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Qj(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function vte(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function bte(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Q$(n.key),n)}}function xte(t,e,r){return e&&bte(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function wte(t,e,r){return e=Mh(e),_te(t,Z$()?Reflect.construct(e,r||[],Mh(t).constructor):e.apply(t,r))}function _te(t,e){if(e&&(al(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ste(t)}function Ste(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Z$(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Z$=function(){return!!t})()}function Mh(t){return Mh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Mh(t)}function kte(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&sw(t,e)}function sw(t,e){return sw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},sw(t,e)}function Pp(t,e,r){return e=Q$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Q$(t){var e=Ete(t,"string");return al(e)=="symbol"?e:e+""}function Ete(t,e){if(al(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(al(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Ote=function(e,r,n,i,a){var o=a.x1,l=a.x2,u=a.y1,d=a.y2,p=a.xAxis,f=a.yAxis;if(!p||!f)return null;var g=H1({x:p.scale,y:f.scale}),v={x:e?g.x.apply(o,{position:"start"}):g.x.rangeMin,y:n?g.y.apply(u,{position:"start"}):g.y.rangeMin},x={x:r?g.x.apply(l,{position:"end"}):g.x.rangeMax,y:i?g.y.apply(d,{position:"end"}):g.y.rangeMax};return Si(a,"discard")&&(!g.isInRange(v)||!g.isInRange(x))?null:z$(v,x)},Np=(function(t){function e(){return vte(this,e),wte(this,e,arguments)}return kte(e,t),xte(e,[{key:"render",value:function(){var n=this.props,i=n.x1,a=n.x2,o=n.y1,l=n.y2,u=n.className,d=n.alwaysShow,p=n.clipPathId;Ki(d===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=or(i),g=or(a),v=or(o),x=or(l),_=this.props.shape;if(!f&&!g&&!v&&!x&&!_)return null;var b=Ote(f,g,v,x,this.props);if(!b&&!_)return null;var k=Si(this.props,"hidden")?"url(#".concat(p,")"):void 0;return $.createElement(Xt,{className:at("recharts-reference-area",u)},e.renderRect(_,eP(eP({clipPath:k},it(this.props,!0)),b)),jr.renderCallByParent(this.props,b))}}])})($.Component);Pp(Np,"displayName","ReferenceArea");Pp(Np,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});Pp(Np,"renderRect",function(t,e){var r;return $.isValidElement(t)?r=$.cloneElement(t,e):Ye(t)?r=t(e):r=$.createElement(q1,ow({},e,{className:"recharts-reference-area-rect"})),r});function eM(t,e,r){if(e<1)return[];if(e===1&&r===void 0)return t;for(var n=[],i=0;i<t.length;i+=e)n.push(t[i]);return n}function Ate(t,e,r){var n={width:t.width+e.width,height:t.height+e.height};return Nee(n,r)}function Tte(t,e,r){var n=r==="width",i=t.x,a=t.y,o=t.width,l=t.height;return e===1?{start:n?i:a,end:n?i+o:a+l}:{start:n?i+o:a+l,end:n?i:a}}function Lh(t,e,r,n,i){if(t*e<t*n||t*e>t*i)return!1;var a=r();return t*(e-t*a/2-n)>=0&&t*(e+t*a/2-i)<=0}function Cte(t,e){return eM(t,e+1)}function jte(t,e,r,n,i){for(var a=(n||[]).slice(),o=e.start,l=e.end,u=0,d=1,p=o,f=function(){var x=n==null?void 0:n[u];if(x===void 0)return{v:eM(n,d)};var _=u,b,k=function(){return b===void 0&&(b=r(x,_)),b},A=x.coordinate,O=u===0||Lh(t,A,k,p,l);O||(u=0,p=o,d+=1),O&&(p=A+t*(k()/2+i),u+=d)},g;d<=a.length;)if(g=f(),g)return g.v;return[]}function _u(t){"@babel/helpers - typeof";return _u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_u(t)}function tP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Cr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?tP(Object(r),!0).forEach(function(n){Pte(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):tP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Pte(t,e,r){return e=Nte(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Nte(t){var e=Rte(t,"string");return _u(e)=="symbol"?e:e+""}function Rte(t,e){if(_u(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(_u(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ite(t,e,r,n,i){for(var a=(n||[]).slice(),o=a.length,l=e.start,u=e.end,d=function(g){var v=a[g],x,_=function(){return x===void 0&&(x=r(v,g)),x};if(g===o-1){var b=t*(v.coordinate+t*_()/2-u);a[g]=v=Cr(Cr({},v),{},{tickCoord:b>0?v.coordinate-b*t:v.coordinate})}else a[g]=v=Cr(Cr({},v),{},{tickCoord:v.coordinate});var k=Lh(t,v.tickCoord,_,l,u);k&&(u=v.tickCoord-t*(_()/2+i),a[g]=Cr(Cr({},v),{},{isShow:!0}))},p=o-1;p>=0;p--)d(p);return a}function $te(t,e,r,n,i,a){var o=(n||[]).slice(),l=o.length,u=e.start,d=e.end;if(a){var p=n[l-1],f=r(p,l-1),g=t*(p.coordinate+t*f/2-d);o[l-1]=p=Cr(Cr({},p),{},{tickCoord:g>0?p.coordinate-g*t:p.coordinate});var v=Lh(t,p.tickCoord,function(){return f},u,d);v&&(d=p.tickCoord-t*(f/2+i),o[l-1]=Cr(Cr({},p),{},{isShow:!0}))}for(var x=a?l-1:l,_=function(A){var O=o[A],C,E=function(){return C===void 0&&(C=r(O,A)),C};if(A===0){var T=t*(O.coordinate-t*E()/2-u);o[A]=O=Cr(Cr({},O),{},{tickCoord:T<0?O.coordinate-T*t:O.coordinate})}else o[A]=O=Cr(Cr({},O),{},{tickCoord:O.coordinate});var P=Lh(t,O.tickCoord,E,u,d);P&&(u=O.tickCoord+t*(E()/2+i),o[A]=Cr(Cr({},O),{},{isShow:!0}))},b=0;b<x;b++)_(b);return o}function J1(t,e,r){var n=t.tick,i=t.ticks,a=t.viewBox,o=t.minTickGap,l=t.orientation,u=t.interval,d=t.tickFormatter,p=t.unit,f=t.angle;if(!i||!i.length||!n)return[];if(ge(u)||wl.isSsr)return Cte(i,typeof u=="number"&&ge(u)?u:0);var g=[],v=l==="top"||l==="bottom"?"width":"height",x=p&&v==="width"?Nc(p,{fontSize:e,letterSpacing:r}):{width:0,height:0},_=function(O,C){var E=Ye(d)?d(O.value,C):O.value;return v==="width"?Ate(Nc(E,{fontSize:e,letterSpacing:r}),x,f):Nc(E,{fontSize:e,letterSpacing:r})[v]},b=i.length>=2?Jn(i[1].coordinate-i[0].coordinate):1,k=Tte(a,b,v);return u==="equidistantPreserveStart"?jte(b,k,_,i,o):(u==="preserveStart"||u==="preserveStartEnd"?g=$te(b,k,_,i,o,u==="preserveStartEnd"):g=Ite(b,k,_,i,o),g.filter(function(A){return A.isShow}))}var Mte=["viewBox"],Lte=["viewBox"],Dte=["ticks"];function ol(t){"@babel/helpers - typeof";return ol=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ol(t)}function Is(){return Is=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Is.apply(this,arguments)}function rP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ir(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?rP(Object(r),!0).forEach(function(n){Z1(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):rP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ob(t,e){if(t==null)return{};var r=zte(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function zte(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function Bte(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function nP(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,rM(n.key),n)}}function Ute(t,e,r){return e&&nP(t.prototype,e),r&&nP(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function qte(t,e,r){return e=Dh(e),Fte(t,tM()?Reflect.construct(e,r||[],Dh(t).constructor):e.apply(t,r))}function Fte(t,e){if(e&&(ol(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Hte(t)}function Hte(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function tM(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(tM=function(){return!!t})()}function Dh(t){return Dh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Dh(t)}function Wte(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&lw(t,e)}function lw(t,e){return lw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},lw(t,e)}function Z1(t,e,r){return e=rM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function rM(t){var e=Gte(t,"string");return ol(e)=="symbol"?e:e+""}function Gte(t,e){if(ol(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ol(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var El=(function(t){function e(r){var n;return Bte(this,e),n=qte(this,e,[r]),n.state={fontSize:"",letterSpacing:""},n}return Wte(e,t),Ute(e,[{key:"shouldComponentUpdate",value:function(n,i){var a=n.viewBox,o=Ob(n,Mte),l=this.props,u=l.viewBox,d=Ob(l,Lte);return!zs(a,u)||!zs(o,d)||!zs(i,this.state)}},{key:"componentDidMount",value:function(){var n=this.layerReference;if(n){var i=n.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];i&&this.setState({fontSize:window.getComputedStyle(i).fontSize,letterSpacing:window.getComputedStyle(i).letterSpacing})}}},{key:"getTickLineCoord",value:function(n){var i=this.props,a=i.x,o=i.y,l=i.width,u=i.height,d=i.orientation,p=i.tickSize,f=i.mirror,g=i.tickMargin,v,x,_,b,k,A,O=f?-1:1,C=n.tickSize||p,E=ge(n.tickCoord)?n.tickCoord:n.coordinate;switch(d){case"top":v=x=n.coordinate,b=o+ +!f*u,_=b-O*C,A=_-O*g,k=E;break;case"left":_=b=n.coordinate,x=a+ +!f*l,v=x-O*C,k=v-O*g,A=E;break;case"right":_=b=n.coordinate,x=a+ +f*l,v=x+O*C,k=v+O*g,A=E;break;default:v=x=n.coordinate,b=o+ +f*u,_=b+O*C,A=_+O*g,k=E;break}return{line:{x1:v,y1:_,x2:x,y2:b},tick:{x:k,y:A}}}},{key:"getTickTextAnchor",value:function(){var n=this.props,i=n.orientation,a=n.mirror,o;switch(i){case"left":o=a?"start":"end";break;case"right":o=a?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var n=this.props,i=n.orientation,a=n.mirror,o="end";switch(i){case"left":case"right":o="middle";break;case"top":o=a?"start":"end";break;default:o=a?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,l=n.height,u=n.orientation,d=n.mirror,p=n.axisLine,f=ir(ir(ir({},it(this.props,!1)),it(p,!1)),{},{fill:"none"});if(u==="top"||u==="bottom"){var g=+(u==="top"&&!d||u==="bottom"&&d);f=ir(ir({},f),{},{x1:i,y1:a+g*l,x2:i+o,y2:a+g*l})}else{var v=+(u==="left"&&!d||u==="right"&&d);f=ir(ir({},f),{},{x1:i+v*o,y1:a,x2:i+v*o,y2:a+l})}return $.createElement("line",Is({},f,{className:at("recharts-cartesian-axis-line",Tn(p,"className"))}))}},{key:"renderTicks",value:function(n,i,a){var o=this,l=this.props,u=l.tickLine,d=l.stroke,p=l.tick,f=l.tickFormatter,g=l.unit,v=J1(ir(ir({},this.props),{},{ticks:n}),i,a),x=this.getTickTextAnchor(),_=this.getTickVerticalAnchor(),b=it(this.props,!1),k=it(p,!1),A=ir(ir({},b),{},{fill:"none"},it(u,!1)),O=v.map(function(C,E){var T=o.getTickLineCoord(C),P=T.line,R=T.tick,I=ir(ir(ir(ir({textAnchor:x,verticalAnchor:_},b),{},{stroke:"none",fill:d},k),R),{},{index:E,payload:C,visibleTicksCount:v.length,tickFormatter:f});return $.createElement(Xt,Is({className:"recharts-cartesian-axis-tick",key:"tick-".concat(C.value,"-").concat(C.coordinate,"-").concat(C.tickCoord)},Gf(o.props,C,E)),u&&$.createElement("line",Is({},A,P,{className:at("recharts-cartesian-axis-tick-line",Tn(u,"className"))})),p&&e.renderTickItem(p,I,"".concat(Ye(f)?f(C.value,E):C.value).concat(g||"")))});return $.createElement("g",{className:"recharts-cartesian-axis-ticks"},O)}},{key:"render",value:function(){var n=this,i=this.props,a=i.axisLine,o=i.width,l=i.height,u=i.ticksGenerator,d=i.className,p=i.hide;if(p)return null;var f=this.props,g=f.ticks,v=Ob(f,Dte),x=g;return Ye(u)&&(x=g&&g.length>0?u(this.props):u(v)),o<=0||l<=0||!x||!x.length?null:$.createElement(Xt,{className:at("recharts-cartesian-axis",d),ref:function(b){n.layerReference=b}},a&&this.renderAxisLine(),this.renderTicks(x,this.state.fontSize,this.state.letterSpacing),jr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var o,l=at(i.className,"recharts-cartesian-axis-tick-value");return $.isValidElement(n)?o=$.cloneElement(n,ir(ir({},i),{},{className:l})):Ye(n)?o=n(ir(ir({},i),{},{className:l})):o=$.createElement(ih,Is({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])})(N.Component);Z1(El,"displayName","CartesianAxis");Z1(El,"defaultProps",{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"});var Kte=["x1","y1","x2","y2","key"],Vte=["offset"];function Mo(t){"@babel/helpers - typeof";return Mo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mo(t)}function iP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Pr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?iP(Object(r),!0).forEach(function(n){Xte(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):iP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Xte(t,e,r){return e=Yte(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Yte(t){var e=Jte(t,"string");return Mo(e)=="symbol"?e:e+""}function Jte(t,e){if(Mo(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Mo(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Oo(){return Oo=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Oo.apply(this,arguments)}function aP(t,e){if(t==null)return{};var r=Zte(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Zte(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var Qte=function(e){var r=e.fill;if(!r||r==="none")return null;var n=e.fillOpacity,i=e.x,a=e.y,o=e.width,l=e.height,u=e.ry;return $.createElement("rect",{x:i,y:a,ry:u,width:o,height:l,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function nM(t,e){var r;if($.isValidElement(t))r=$.cloneElement(t,e);else if(Ye(t))r=t(e);else{var n=e.x1,i=e.y1,a=e.x2,o=e.y2,l=e.key,u=aP(e,Kte),d=it(u,!1);d.offset;var p=aP(d,Vte);r=$.createElement("line",Oo({},p,{x1:n,y1:i,x2:a,y2:o,fill:"none",key:l}))}return r}function ere(t){var e=t.x,r=t.width,n=t.horizontal,i=n===void 0?!0:n,a=t.horizontalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(l,u){var d=Pr(Pr({},t),{},{x1:e,y1:l,x2:e+r,y2:l,key:"line-".concat(u),index:u});return nM(i,d)});return $.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function tre(t){var e=t.y,r=t.height,n=t.vertical,i=n===void 0?!0:n,a=t.verticalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(l,u){var d=Pr(Pr({},t),{},{x1:l,y1:e,x2:l,y2:e+r,key:"line-".concat(u),index:u});return nM(i,d)});return $.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function rre(t){var e=t.horizontalFill,r=t.fillOpacity,n=t.x,i=t.y,a=t.width,o=t.height,l=t.horizontalPoints,u=t.horizontal,d=u===void 0?!0:u;if(!d||!e||!e.length)return null;var p=l.map(function(g){return Math.round(g+i-i)}).sort(function(g,v){return g-v});i!==p[0]&&p.unshift(0);var f=p.map(function(g,v){var x=!p[v+1],_=x?i+o-g:p[v+1]-g;if(_<=0)return null;var b=v%e.length;return $.createElement("rect",{key:"react-".concat(v),y:g,x:n,height:_,width:a,stroke:"none",fill:e[b],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return $.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function nre(t){var e=t.vertical,r=e===void 0?!0:e,n=t.verticalFill,i=t.fillOpacity,a=t.x,o=t.y,l=t.width,u=t.height,d=t.verticalPoints;if(!r||!n||!n.length)return null;var p=d.map(function(g){return Math.round(g+a-a)}).sort(function(g,v){return g-v});a!==p[0]&&p.unshift(0);var f=p.map(function(g,v){var x=!p[v+1],_=x?a+l-g:p[v+1]-g;if(_<=0)return null;var b=v%n.length;return $.createElement("rect",{key:"react-".concat(v),x:g,y:o,width:_,height:u,stroke:"none",fill:n[b],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return $.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var ire=function(e,r){var n=e.xAxis,i=e.width,a=e.height,o=e.offset;return g$(J1(Pr(Pr(Pr({},El.defaultProps),n),{},{ticks:Hi(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.left,o.left+o.width,r)},are=function(e,r){var n=e.yAxis,i=e.width,a=e.height,o=e.offset;return g$(J1(Pr(Pr(Pr({},El.defaultProps),n),{},{ticks:Hi(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.top,o.top+o.height,r)},Es={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Su(t){var e,r,n,i,a,o,l=K1(),u=V1(),d=Gee(),p=Pr(Pr({},t),{},{stroke:(e=t.stroke)!==null&&e!==void 0?e:Es.stroke,fill:(r=t.fill)!==null&&r!==void 0?r:Es.fill,horizontal:(n=t.horizontal)!==null&&n!==void 0?n:Es.horizontal,horizontalFill:(i=t.horizontalFill)!==null&&i!==void 0?i:Es.horizontalFill,vertical:(a=t.vertical)!==null&&a!==void 0?a:Es.vertical,verticalFill:(o=t.verticalFill)!==null&&o!==void 0?o:Es.verticalFill,x:ge(t.x)?t.x:d.left,y:ge(t.y)?t.y:d.top,width:ge(t.width)?t.width:d.width,height:ge(t.height)?t.height:d.height}),f=p.x,g=p.y,v=p.width,x=p.height,_=p.syncWithTicks,b=p.horizontalValues,k=p.verticalValues,A=Fee(),O=Hee();if(!ge(v)||v<=0||!ge(x)||x<=0||!ge(f)||f!==+f||!ge(g)||g!==+g)return null;var C=p.verticalCoordinatesGenerator||ire,E=p.horizontalCoordinatesGenerator||are,T=p.horizontalPoints,P=p.verticalPoints;if((!T||!T.length)&&Ye(E)){var R=b&&b.length,I=E({yAxis:O?Pr(Pr({},O),{},{ticks:R?b:O.ticks}):void 0,width:l,height:u,offset:d},R?!0:_);Ki(Array.isArray(I),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Mo(I),"]")),Array.isArray(I)&&(T=I)}if((!P||!P.length)&&Ye(C)){var Y=k&&k.length,W=C({xAxis:A?Pr(Pr({},A),{},{ticks:Y?k:A.ticks}):void 0,width:l,height:u,offset:d},Y?!0:_);Ki(Array.isArray(W),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Mo(W),"]")),Array.isArray(W)&&(P=W)}return $.createElement("g",{className:"recharts-cartesian-grid"},$.createElement(Qte,{fill:p.fill,fillOpacity:p.fillOpacity,x:p.x,y:p.y,width:p.width,height:p.height,ry:p.ry}),$.createElement(ere,Oo({},p,{offset:d,horizontalPoints:T,xAxis:A,yAxis:O})),$.createElement(tre,Oo({},p,{offset:d,verticalPoints:P,xAxis:A,yAxis:O})),$.createElement(rre,Oo({},p,{horizontalPoints:T})),$.createElement(nre,Oo({},p,{verticalPoints:P})))}Su.displayName="CartesianGrid";var ore=["type","layout","connectNulls","ref"],sre=["key"];function sl(t){"@babel/helpers - typeof";return sl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sl(t)}function oP(t,e){if(t==null)return{};var r=lre(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function lre(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function Mc(){return Mc=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Mc.apply(this,arguments)}function sP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function an(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?sP(Object(r),!0).forEach(function(n){Wn(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):sP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Os(t){return fre(t)||dre(t)||ure(t)||cre()}function cre(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
499
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ure(t,e){if(t){if(typeof t=="string")return cw(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cw(t,e)}}function dre(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function fre(t){if(Array.isArray(t))return cw(t)}function cw(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function hre(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lP(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,aM(n.key),n)}}function pre(t,e,r){return e&&lP(t.prototype,e),r&&lP(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function mre(t,e,r){return e=zh(e),gre(t,iM()?Reflect.construct(e,r||[],zh(t).constructor):e.apply(t,r))}function gre(t,e){if(e&&(sl(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yre(t)}function yre(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function iM(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(iM=function(){return!!t})()}function zh(t){return zh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},zh(t)}function vre(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&uw(t,e)}function uw(t,e){return uw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},uw(t,e)}function Wn(t,e,r){return e=aM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function aM(t){var e=bre(t,"string");return sl(e)=="symbol"?e:e+""}function bre(t,e){if(sl(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(sl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Uu=(function(t){function e(){var r;hre(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=mre(this,e,[].concat(i)),Wn(r,"state",{isAnimationFinished:!0,totalLength:0}),Wn(r,"generateSimpleStrokeDasharray",function(o,l){return"".concat(l,"px ").concat(o-l,"px")}),Wn(r,"getStrokeDasharray",function(o,l,u){var d=u.reduce(function(k,A){return k+A});if(!d)return r.generateSimpleStrokeDasharray(l,o);for(var p=Math.floor(o/d),f=o%d,g=l-o,v=[],x=0,_=0;x<u.length;_+=u[x],++x)if(_+u[x]>f){v=[].concat(Os(u.slice(0,x)),[f-_]);break}var b=v.length%2===0?[0,g]:[g];return[].concat(Os(e.repeat(u,p)),Os(v),b).map(function(k){return"".concat(k,"px")}).join(", ")}),Wn(r,"id",Iu("recharts-line-")),Wn(r,"pathRef",function(o){r.mainCurve=o}),Wn(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Wn(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return vre(e,t),pre(e,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.points,l=a.xAxis,u=a.yAxis,d=a.layout,p=a.children,f=Cn(p,Bu);if(!f)return null;var g=function(_,b){return{x:_.x,y:_.y,value:_.value,errorVal:dn(_.payload,b)}},v={clipPath:n?"url(#clipPath-".concat(i,")"):null};return $.createElement(Xt,v,f.map(function(x){return $.cloneElement(x,{key:"bar-".concat(x.props.dataKey),data:o,xAxis:l,yAxis:u,layout:d,dataPointFormatter:g})}))}},{key:"renderDots",value:function(n,i,a){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var l=this.props,u=l.dot,d=l.points,p=l.dataKey,f=it(this.props,!1),g=it(u,!0),v=d.map(function(_,b){var k=an(an(an({key:"dot-".concat(b),r:3},f),g),{},{index:b,cx:_.x,cy:_.y,value:_.value,dataKey:p,payload:_.payload,points:d});return e.renderDotItem(u,k)}),x={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return $.createElement(Xt,Mc({className:"recharts-line-dots",key:"dots"},x),v)}},{key:"renderCurveStatically",value:function(n,i,a,o){var l=this.props,u=l.type,d=l.layout,p=l.connectNulls;l.ref;var f=oP(l,ore),g=an(an(an({},it(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:n},o),{},{type:u,layout:d,connectNulls:p});return $.createElement(Ux,Mc({},g,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var a=this,o=this.props,l=o.points,u=o.strokeDasharray,d=o.isAnimationActive,p=o.animationBegin,f=o.animationDuration,g=o.animationEasing,v=o.animationId,x=o.animateNewValues,_=o.width,b=o.height,k=this.state,A=k.prevPoints,O=k.totalLength;return $.createElement(Qi,{begin:p,duration:f,isActive:d,easing:g,from:{t:0},to:{t:1},key:"line-".concat(v),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(C){var E=C.t;if(A){var T=A.length/l.length,P=l.map(function(B,X){var K=Math.floor(X*T);if(A[K]){var U=A[K],G=Vn(U.x,B.x),J=Vn(U.y,B.y);return an(an({},B),{},{x:G(E),y:J(E)})}if(x){var F=Vn(_*2,B.x),te=Vn(b/2,B.y);return an(an({},B),{},{x:F(E),y:te(E)})}return an(an({},B),{},{x:B.x,y:B.y})});return a.renderCurveStatically(P,n,i)}var R=Vn(0,O),I=R(E),Y;if(u){var W="".concat(u).split(/[,\s]+/gim).map(function(B){return parseFloat(B)});Y=a.getStrokeDasharray(I,O,W)}else Y=a.generateSimpleStrokeDasharray(O,I);return a.renderCurveStatically(l,n,i,{strokeDasharray:Y})})}},{key:"renderCurve",value:function(n,i){var a=this.props,o=a.points,l=a.isAnimationActive,u=this.state,d=u.prevPoints,p=u.totalLength;return l&&o&&o.length&&(!d&&p>0||!Sp(d,o))?this.renderCurveWithAnimation(n,i):this.renderCurveStatically(o,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,l=i.points,u=i.className,d=i.xAxis,p=i.yAxis,f=i.top,g=i.left,v=i.width,x=i.height,_=i.isAnimationActive,b=i.id;if(a||!l||!l.length)return null;var k=this.state.isAnimationFinished,A=l.length===1,O=at("recharts-line",u),C=d&&d.allowDataOverflow,E=p&&p.allowDataOverflow,T=C||E,P=Qe(b)?this.id:b,R=(n=it(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},I=R.r,Y=I===void 0?3:I,W=R.strokeWidth,B=W===void 0?2:W,X=I9(o)?o:{},K=X.clipDot,U=K===void 0?!0:K,G=Y*2+B;return $.createElement(Xt,{className:O},C||E?$.createElement("defs",null,$.createElement("clipPath",{id:"clipPath-".concat(P)},$.createElement("rect",{x:C?g:g-v/2,y:E?f:f-x/2,width:C?v:v*2,height:E?x:x*2})),!U&&$.createElement("clipPath",{id:"clipPath-dots-".concat(P)},$.createElement("rect",{x:g-G/2,y:f-G/2,width:v+G,height:x+G}))):null,!A&&this.renderCurve(T,P),this.renderErrorBar(T,P),(A||o)&&this.renderDots(T,U,P),(!_||k)&&La.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:i.curPoints}:n.points!==i.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,i){for(var a=n.length%2!==0?[].concat(Os(n),[0]):n,o=[],l=0;l<i;++l)o=[].concat(Os(o),Os(a));return o}},{key:"renderDotItem",value:function(n,i){var a;if($.isValidElement(n))a=$.cloneElement(n,i);else if(Ye(n))a=n(i);else{var o=i.key,l=oP(i,sre),u=at("recharts-line-dot",typeof n!="boolean"?n.className:"");a=$.createElement(F1,Mc({key:o},l,{className:u}))}return a}}])})(N.PureComponent);Wn(Uu,"displayName","Line");Wn(Uu,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!wl.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Wn(Uu,"getComposedData",function(t){var e=t.props,r=t.xAxis,n=t.yAxis,i=t.xAxisTicks,a=t.yAxisTicks,o=t.dataKey,l=t.bandSize,u=t.displayedData,d=t.offset,p=e.layout,f=u.map(function(g,v){var x=dn(g,o);return p==="horizontal"?{x:EC({axis:r,ticks:i,bandSize:l,entry:g,index:v}),y:Qe(x)?null:n.scale(x),value:x,payload:g}:{x:Qe(x)?null:r.scale(x),y:EC({axis:n,ticks:a,bandSize:l,entry:g,index:v}),value:x,payload:g}});return an({points:f,layout:p},d)});function ll(t){"@babel/helpers - typeof";return ll=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ll(t)}function xre(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wre(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,lM(n.key),n)}}function _re(t,e,r){return e&&wre(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Sre(t,e,r){return e=Bh(e),kre(t,oM()?Reflect.construct(e,r||[],Bh(t).constructor):e.apply(t,r))}function kre(t,e){if(e&&(ll(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ere(t)}function Ere(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function oM(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(oM=function(){return!!t})()}function Bh(t){return Bh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Bh(t)}function Ore(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&dw(t,e)}function dw(t,e){return dw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},dw(t,e)}function sM(t,e,r){return e=lM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function lM(t){var e=Are(t,"string");return ll(e)=="symbol"?e:e+""}function Are(t,e){if(ll(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ll(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function fw(){return fw=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},fw.apply(this,arguments)}function Tre(t){var e=t.xAxisId,r=K1(),n=V1(),i=G$(e);return i==null?null:N.createElement(El,fw({},i,{className:at("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(o){return Hi(o,!0)}}))}var za=(function(t){function e(){return xre(this,e),Sre(this,e,arguments)}return Ore(e,t),_re(e,[{key:"render",value:function(){return N.createElement(Tre,this.props)}}])})(N.Component);sM(za,"displayName","XAxis");sM(za,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function cl(t){"@babel/helpers - typeof";return cl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cl(t)}function Cre(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function jre(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,dM(n.key),n)}}function Pre(t,e,r){return e&&jre(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Nre(t,e,r){return e=Uh(e),Rre(t,cM()?Reflect.construct(e,r||[],Uh(t).constructor):e.apply(t,r))}function Rre(t,e){if(e&&(cl(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ire(t)}function Ire(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function cM(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(cM=function(){return!!t})()}function Uh(t){return Uh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Uh(t)}function $re(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&hw(t,e)}function hw(t,e){return hw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},hw(t,e)}function uM(t,e,r){return e=dM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function dM(t){var e=Mre(t,"string");return cl(e)=="symbol"?e:e+""}function Mre(t,e){if(cl(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(cl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function pw(){return pw=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},pw.apply(this,arguments)}var Lre=function(e){var r=e.yAxisId,n=K1(),i=V1(),a=K$(r);return a==null?null:N.createElement(El,pw({},a,{className:at("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:i},ticksGenerator:function(l){return Hi(l,!0)}}))},Ba=(function(t){function e(){return Cre(this,e),Nre(this,e,arguments)}return $re(e,t),Pre(e,[{key:"render",value:function(){return N.createElement(Lre,this.props)}}])})(N.Component);uM(Ba,"displayName","YAxis");uM(Ba,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function cP(t){return Ure(t)||Bre(t)||zre(t)||Dre()}function Dre(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
500
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zre(t,e){if(t){if(typeof t=="string")return mw(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mw(t,e)}}function Bre(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Ure(t){if(Array.isArray(t))return mw(t)}function mw(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var gw=function(e,r,n,i,a){var o=Cn(e,Y1),l=Cn(e,jp),u=[].concat(cP(o),cP(l)),d=Cn(e,Np),p="".concat(i,"Id"),f=i[0],g=r;if(u.length&&(g=u.reduce(function(_,b){if(b.props[p]===n&&Si(b.props,"extendDomain")&&ge(b.props[f])){var k=b.props[f];return[Math.min(_[0],k),Math.max(_[1],k)]}return _},g)),d.length){var v="".concat(f,"1"),x="".concat(f,"2");g=d.reduce(function(_,b){if(b.props[p]===n&&Si(b.props,"extendDomain")&&ge(b.props[v])&&ge(b.props[x])){var k=b.props[v],A=b.props[x];return[Math.min(_[0],k,A),Math.max(_[1],k,A)]}return _},g)}return a&&a.length&&(g=a.reduce(function(_,b){return ge(b)?[Math.min(_[0],b),Math.max(_[1],b)]:_},g)),g},Ab={exports:{}},uP;function qre(){return uP||(uP=1,(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(u,d,p){this.fn=u,this.context=d,this.once=p||!1}function a(u,d,p,f,g){if(typeof p!="function")throw new TypeError("The listener must be a function");var v=new i(p,f||u,g),x=r?r+d:d;return u._events[x]?u._events[x].fn?u._events[x]=[u._events[x],v]:u._events[x].push(v):(u._events[x]=v,u._eventsCount++),u}function o(u,d){--u._eventsCount===0?u._events=new n:delete u._events[d]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var d=[],p,f;if(this._eventsCount===0)return d;for(f in p=this._events)e.call(p,f)&&d.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(p)):d},l.prototype.listeners=function(d){var p=r?r+d:d,f=this._events[p];if(!f)return[];if(f.fn)return[f.fn];for(var g=0,v=f.length,x=new Array(v);g<v;g++)x[g]=f[g].fn;return x},l.prototype.listenerCount=function(d){var p=r?r+d:d,f=this._events[p];return f?f.fn?1:f.length:0},l.prototype.emit=function(d,p,f,g,v,x){var _=r?r+d:d;if(!this._events[_])return!1;var b=this._events[_],k=arguments.length,A,O;if(b.fn){switch(b.once&&this.removeListener(d,b.fn,void 0,!0),k){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,p),!0;case 3:return b.fn.call(b.context,p,f),!0;case 4:return b.fn.call(b.context,p,f,g),!0;case 5:return b.fn.call(b.context,p,f,g,v),!0;case 6:return b.fn.call(b.context,p,f,g,v,x),!0}for(O=1,A=new Array(k-1);O<k;O++)A[O-1]=arguments[O];b.fn.apply(b.context,A)}else{var C=b.length,E;for(O=0;O<C;O++)switch(b[O].once&&this.removeListener(d,b[O].fn,void 0,!0),k){case 1:b[O].fn.call(b[O].context);break;case 2:b[O].fn.call(b[O].context,p);break;case 3:b[O].fn.call(b[O].context,p,f);break;case 4:b[O].fn.call(b[O].context,p,f,g);break;default:if(!A)for(E=1,A=new Array(k-1);E<k;E++)A[E-1]=arguments[E];b[O].fn.apply(b[O].context,A)}}return!0},l.prototype.on=function(d,p,f){return a(this,d,p,f,!1)},l.prototype.once=function(d,p,f){return a(this,d,p,f,!0)},l.prototype.removeListener=function(d,p,f,g){var v=r?r+d:d;if(!this._events[v])return this;if(!p)return o(this,v),this;var x=this._events[v];if(x.fn)x.fn===p&&(!g||x.once)&&(!f||x.context===f)&&o(this,v);else{for(var _=0,b=[],k=x.length;_<k;_++)(x[_].fn!==p||g&&!x[_].once||f&&x[_].context!==f)&&b.push(x[_]);b.length?this._events[v]=b.length===1?b[0]:b:o(this,v)}return this},l.prototype.removeAllListeners=function(d){var p;return d?(p=r?r+d:d,this._events[p]&&o(this,p)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,t.exports=l})(Ab)),Ab.exports}var Fre=qre();const Hre=vt(Fre);var Tb=new Hre,Cb="recharts.syncMouseEvents";function ku(t){"@babel/helpers - typeof";return ku=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ku(t)}function Wre(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Gre(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,fM(n.key),n)}}function Kre(t,e,r){return e&&Gre(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function jb(t,e,r){return e=fM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fM(t){var e=Vre(t,"string");return ku(e)=="symbol"?e:e+""}function Vre(t,e){if(ku(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ku(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Xre=(function(){function t(){Wre(this,t),jb(this,"activeIndex",0),jb(this,"coordinateList",[]),jb(this,"layout","horizontal")}return Kre(t,[{key:"setDetails",value:function(r){var n,i=r.coordinateList,a=i===void 0?null:i,o=r.container,l=o===void 0?null:o,u=r.layout,d=u===void 0?null:u,p=r.offset,f=p===void 0?null:p,g=r.mouseHandlerCallback,v=g===void 0?null:g;this.coordinateList=(n=a??this.coordinateList)!==null&&n!==void 0?n:[],this.container=l??this.container,this.layout=d??this.layout,this.offset=f??this.offset,this.mouseHandlerCallback=v??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(r){if(this.coordinateList.length!==0)switch(r.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(r){this.activeIndex=r}},{key:"spoofMouse",value:function(){var r,n;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var i=this.container.getBoundingClientRect(),a=i.x,o=i.y,l=i.height,u=this.coordinateList[this.activeIndex].coordinate,d=((r=window)===null||r===void 0?void 0:r.scrollX)||0,p=((n=window)===null||n===void 0?void 0:n.scrollY)||0,f=a+u+d,g=o+this.offset.top+l/2+p;this.mouseHandlerCallback({pageX:f,pageY:g})}}}])})();function Yre(t,e,r){if(r==="number"&&e===!0&&Array.isArray(t)){var n=t==null?void 0:t[0],i=t==null?void 0:t[1];if(n&&i&&ge(n)&&ge(i))return!0}return!1}function Jre(t,e,r,n){var i=n/2;return{stroke:"none",fill:"#ccc",x:t==="horizontal"?e.x-i:r.left+.5,y:t==="horizontal"?r.top+.5:e.y-i,width:t==="horizontal"?n:r.width-1,height:t==="horizontal"?r.height-1:n}}function hM(t){var e=t.cx,r=t.cy,n=t.radius,i=t.startAngle,a=t.endAngle,o=_r(e,r,n,i),l=_r(e,r,n,a);return{points:[o,l],cx:e,cy:r,radius:n,startAngle:i,endAngle:a}}function Zre(t,e,r){var n,i,a,o;if(t==="horizontal")n=e.x,a=n,i=r.top,o=r.top+r.height;else if(t==="vertical")i=e.y,o=i,n=r.left,a=r.left+r.width;else if(e.cx!=null&&e.cy!=null)if(t==="centric"){var l=e.cx,u=e.cy,d=e.innerRadius,p=e.outerRadius,f=e.angle,g=_r(l,u,d,f),v=_r(l,u,p,f);n=g.x,i=g.y,a=v.x,o=v.y}else return hM(e);return[{x:n,y:i},{x:a,y:o}]}function Eu(t){"@babel/helpers - typeof";return Eu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Eu(t)}function dP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function _f(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?dP(Object(r),!0).forEach(function(n){Qre(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):dP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Qre(t,e,r){return e=ene(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ene(t){var e=tne(t,"string");return Eu(e)=="symbol"?e:e+""}function tne(t,e){if(Eu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Eu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function rne(t){var e,r,n=t.element,i=t.tooltipEventType,a=t.isActive,o=t.activeCoordinate,l=t.activePayload,u=t.offset,d=t.activeTooltipIndex,p=t.tooltipAxisBandSize,f=t.layout,g=t.chartName,v=(e=n.props.cursor)!==null&&e!==void 0?e:(r=n.type.defaultProps)===null||r===void 0?void 0:r.cursor;if(!n||!v||!a||!o||g!=="ScatterChart"&&i!=="axis")return null;var x,_=Ux;if(g==="ScatterChart")x=o,_=eQ;else if(g==="BarChart")x=Jre(f,o,u,p),_=q1;else if(f==="radial"){var b=hM(o),k=b.cx,A=b.cy,O=b.radius,C=b.startAngle,E=b.endAngle;x={cx:k,cy:A,startAngle:C,endAngle:E,innerRadius:O,outerRadius:O},_=w$}else x={points:Zre(f,o,u)},_=Ux;var T=_f(_f(_f(_f({stroke:"#ccc",pointerEvents:"none"},u),x),it(v,!1)),{},{payload:l,payloadIndex:d,className:at("recharts-tooltip-cursor",v.className)});return N.isValidElement(v)?N.cloneElement(v,T):N.createElement(_,T)}var nne=["item"],ine=["children","className","width","height","style","compact","title","desc"];function ul(t){"@babel/helpers - typeof";return ul=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ul(t)}function $s(){return $s=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},$s.apply(this,arguments)}function fP(t,e){return sne(t)||one(t,e)||mM(t,e)||ane()}function ane(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
501
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function one(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,l=[],u=!0,d=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw i}}return l}}function sne(t){if(Array.isArray(t))return t}function hP(t,e){if(t==null)return{};var r=lne(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function lne(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function cne(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function une(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,gM(n.key),n)}}function dne(t,e,r){return e&&une(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function fne(t,e,r){return e=qh(e),hne(t,pM()?Reflect.construct(e,r||[],qh(t).constructor):e.apply(t,r))}function hne(t,e){if(e&&(ul(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pne(t)}function pne(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function pM(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(pM=function(){return!!t})()}function qh(t){return qh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},qh(t)}function mne(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&yw(t,e)}function yw(t,e){return yw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},yw(t,e)}function dl(t){return vne(t)||yne(t)||mM(t)||gne()}function gne(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
502
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mM(t,e){if(t){if(typeof t=="string")return vw(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vw(t,e)}}function yne(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function vne(t){if(Array.isArray(t))return vw(t)}function vw(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function pP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ie(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?pP(Object(r),!0).forEach(function(n){ze(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):pP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ze(t,e,r){return e=gM(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gM(t){var e=bne(t,"string");return ul(e)=="symbol"?e:e+""}function bne(t,e){if(ul(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ul(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var xne={xAxis:["bottom","top"],yAxis:["left","right"]},wne={width:"100%",height:"100%"},yM={x:0,y:0};function Sf(t){return t}var _ne=function(e,r){return r==="horizontal"?e.x:r==="vertical"?e.y:r==="centric"?e.angle:e.radius},Sne=function(e,r,n,i){var a=r.find(function(p){return p&&p.index===n});if(a){if(e==="horizontal")return{x:a.coordinate,y:i.y};if(e==="vertical")return{x:i.x,y:a.coordinate};if(e==="centric"){var o=a.coordinate,l=i.radius;return ie(ie(ie({},i),_r(i.cx,i.cy,l,o)),{},{angle:o,radius:l})}var u=a.coordinate,d=i.angle;return ie(ie(ie({},i),_r(i.cx,i.cy,u,d)),{},{angle:d,radius:u})}return yM},Rp=function(e,r){var n=r.graphicalItems,i=r.dataStartIndex,a=r.dataEndIndex,o=(n??[]).reduce(function(l,u){var d=u.props.data;return d&&d.length?[].concat(dl(l),dl(d)):l},[]);return o.length>0?o:e&&e.length&&ge(i)&&ge(a)?e.slice(i,a+1):[]};function vM(t){return t==="number"?[0,"auto"]:void 0}var bw=function(e,r,n,i){var a=e.graphicalItems,o=e.tooltipAxis,l=Rp(r,e);return n<0||!a||!a.length||n>=l.length?null:a.reduce(function(u,d){var p,f=(p=d.props.data)!==null&&p!==void 0?p:r;f&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=n&&(f=f.slice(e.dataStartIndex,e.dataEndIndex+1));var g;if(o.dataKey&&!o.allowDuplicatedCategory){var v=f===void 0?l:f;g=Hf(v,o.dataKey,i)}else g=f&&f[n]||l[n];return g?[].concat(dl(u),[v$(d,g)]):u},[])},mP=function(e,r,n,i){var a=i||{x:e.chartX,y:e.chartY},o=_ne(a,n),l=e.orderedTooltipTicks,u=e.tooltipAxis,d=e.tooltipTicks,p=RX(o,l,d,u);if(p>=0&&d){var f=d[p]&&d[p].value,g=bw(e,r,p,f),v=Sne(n,l,p,a);return{activeTooltipIndex:p,activeLabel:f,activePayload:g,activeCoordinate:v}}return null},kne=function(e,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,l=r.stackGroups,u=r.dataStartIndex,d=r.dataEndIndex,p=e.layout,f=e.children,g=e.stackOffset,v=m$(p,a);return n.reduce(function(x,_){var b,k=_.type.defaultProps!==void 0?ie(ie({},_.type.defaultProps),_.props):_.props,A=k.type,O=k.dataKey,C=k.allowDataOverflow,E=k.allowDuplicatedCategory,T=k.scale,P=k.ticks,R=k.includeHidden,I=k[o];if(x[I])return x;var Y=Rp(e.data,{graphicalItems:i.filter(function(L){var Z,se=o in L.props?L.props[o]:(Z=L.type.defaultProps)===null||Z===void 0?void 0:Z[o];return se===I}),dataStartIndex:u,dataEndIndex:d}),W=Y.length,B,X,K;Yre(k.domain,C,A)&&(B=Mx(k.domain,null,C),v&&(A==="number"||T!=="auto")&&(K=Ic(Y,O,"category")));var U=vM(A);if(!B||B.length===0){var G,J=(G=k.domain)!==null&&G!==void 0?G:U;if(O){if(B=Ic(Y,O,A),A==="category"&&v){var F=k9(B);E&&F?(X=B,B=Ch(0,W)):E||(B=CC(J,B,_).reduce(function(L,Z){return L.indexOf(Z)>=0?L:[].concat(dl(L),[Z])},[]))}else if(A==="category")E?B=B.filter(function(L){return L!==""&&!Qe(L)}):B=CC(J,B,_).reduce(function(L,Z){return L.indexOf(Z)>=0||Z===""||Qe(Z)?L:[].concat(dl(L),[Z])},[]);else if(A==="number"){var te=DX(Y,i.filter(function(L){var Z,se,le=o in L.props?L.props[o]:(Z=L.type.defaultProps)===null||Z===void 0?void 0:Z[o],ve="hide"in L.props?L.props.hide:(se=L.type.defaultProps)===null||se===void 0?void 0:se.hide;return le===I&&(R||!ve)}),O,a,p);te&&(B=te)}v&&(A==="number"||T!=="auto")&&(K=Ic(Y,O,"category"))}else v?B=Ch(0,W):l&&l[I]&&l[I].hasStack&&A==="number"?B=g==="expand"?[0,1]:y$(l[I].stackGroups,u,d):B=p$(Y,i.filter(function(L){var Z=o in L.props?L.props[o]:L.type.defaultProps[o],se="hide"in L.props?L.props.hide:L.type.defaultProps.hide;return Z===I&&(R||!se)}),A,p,!0);if(A==="number")B=gw(f,B,I,a,P),J&&(B=Mx(J,B,C));else if(A==="category"&&J){var q=J,z=B.every(function(L){return q.indexOf(L)>=0});z&&(B=q)}}return ie(ie({},x),{},ze({},I,ie(ie({},k),{},{axisType:a,domain:B,categoricalDomain:K,duplicateDomain:X,originalDomain:(b=k.domain)!==null&&b!==void 0?b:U,isCategorical:v,layout:p})))},{})},Ene=function(e,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,l=r.stackGroups,u=r.dataStartIndex,d=r.dataEndIndex,p=e.layout,f=e.children,g=Rp(e.data,{graphicalItems:n,dataStartIndex:u,dataEndIndex:d}),v=g.length,x=m$(p,a),_=-1;return n.reduce(function(b,k){var A=k.type.defaultProps!==void 0?ie(ie({},k.type.defaultProps),k.props):k.props,O=A[o],C=vM("number");if(!b[O]){_++;var E;return x?E=Ch(0,v):l&&l[O]&&l[O].hasStack?(E=y$(l[O].stackGroups,u,d),E=gw(f,E,O,a)):(E=Mx(C,p$(g,n.filter(function(T){var P,R,I=o in T.props?T.props[o]:(P=T.type.defaultProps)===null||P===void 0?void 0:P[o],Y="hide"in T.props?T.props.hide:(R=T.type.defaultProps)===null||R===void 0?void 0:R.hide;return I===O&&!Y}),"number",p),i.defaultProps.allowDataOverflow),E=gw(f,E,O,a)),ie(ie({},b),{},ze({},O,ie(ie({axisType:a},i.defaultProps),{},{hide:!0,orientation:Tn(xne,"".concat(a,".").concat(_%2),null),domain:E,originalDomain:C,isCategorical:x,layout:p})))}return b},{})},One=function(e,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,l=r.stackGroups,u=r.dataStartIndex,d=r.dataEndIndex,p=e.children,f="".concat(i,"Id"),g=Cn(p,a),v={};return g&&g.length?v=kne(e,{axes:g,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:l,dataStartIndex:u,dataEndIndex:d}):o&&o.length&&(v=Ene(e,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:l,dataStartIndex:u,dataEndIndex:d})),v},Ane=function(e){var r=Na(e),n=Hi(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:m1(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:bh(r,n)}},gP=function(e){var r=e.children,n=e.defaultShowTooltip,i=sn(r,tl),a=0,o=0;return e.data&&e.data.length!==0&&(o=e.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},Tne=function(e){return!e||!e.length?!1:e.some(function(r){var n=Gi(r&&r.type);return n&&n.indexOf("Bar")>=0})},yP=function(e){return e==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:e==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:e==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},Cne=function(e,r){var n=e.props,i=e.graphicalItems,a=e.xAxisMap,o=a===void 0?{}:a,l=e.yAxisMap,u=l===void 0?{}:l,d=n.width,p=n.height,f=n.children,g=n.margin||{},v=sn(f,tl),x=sn(f,Bs),_=Object.keys(u).reduce(function(E,T){var P=u[T],R=P.orientation;return!P.mirror&&!P.hide?ie(ie({},E),{},ze({},R,E[R]+P.width)):E},{left:g.left||0,right:g.right||0}),b=Object.keys(o).reduce(function(E,T){var P=o[T],R=P.orientation;return!P.mirror&&!P.hide?ie(ie({},E),{},ze({},R,Tn(E,"".concat(R))+P.height)):E},{top:g.top||0,bottom:g.bottom||0}),k=ie(ie({},b),_),A=k.bottom;v&&(k.bottom+=v.props.height||tl.defaultProps.height),x&&r&&(k=MX(k,i,n,r));var O=d-k.left-k.right,C=p-k.top-k.bottom;return ie(ie({brushBottom:A},k),{},{width:Math.max(O,0),height:Math.max(C,0)})},jne=function(e,r){if(r==="xAxis")return e[r].width;if(r==="yAxis")return e[r].height},bM=function(e){var r=e.chartName,n=e.GraphicalChild,i=e.defaultTooltipEventType,a=i===void 0?"axis":i,o=e.validateTooltipEventTypes,l=o===void 0?["axis"]:o,u=e.axisComponents,d=e.legendContent,p=e.formatAxisMap,f=e.defaultProps,g=function(k,A){var O=A.graphicalItems,C=A.stackGroups,E=A.offset,T=A.updateId,P=A.dataStartIndex,R=A.dataEndIndex,I=k.barSize,Y=k.layout,W=k.barGap,B=k.barCategoryGap,X=k.maxBarSize,K=yP(Y),U=K.numericAxisName,G=K.cateAxisName,J=Tne(O),F=[];return O.forEach(function(te,q){var z=Rp(k.data,{graphicalItems:[te],dataStartIndex:P,dataEndIndex:R}),L=te.type.defaultProps!==void 0?ie(ie({},te.type.defaultProps),te.props):te.props,Z=L.dataKey,se=L.maxBarSize,le=L["".concat(U,"Id")],ve=L["".concat(G,"Id")],qe={},xe=u.reduce(function(lr,_t){var kr=A["".concat(_t.axisType,"Map")],Ir=L["".concat(_t.axisType,"Id")];kr&&kr[Ir]||_t.axisType==="zAxis"||$o();var ni=kr[Ir];return ie(ie({},lr),{},ze(ze({},_t.axisType,ni),"".concat(_t.axisType,"Ticks"),Hi(ni)))},qe),ae=xe[G],Se=xe["".concat(G,"Ticks")],Me=C&&C[le]&&C[le].hasStack&&YX(te,C[le].stackGroups),oe=Gi(te.type).indexOf("Bar")>=0,tt=bh(ae,Se),Fe=[],kt=J&&IX({barSize:I,stackGroups:C,totalSize:jne(xe,G)});if(oe){var wt,Et,Sr=Qe(se)?X:se,Bt=(wt=(Et=bh(ae,Se,!0))!==null&&Et!==void 0?Et:Sr)!==null&&wt!==void 0?wt:0;Fe=$X({barGap:W,barCategoryGap:B,bandSize:Bt!==tt?Bt:tt,sizeList:kt[ve],maxBarSize:Sr}),Bt!==tt&&(Fe=Fe.map(function(lr){return ie(ie({},lr),{},{position:ie(ie({},lr.position),{},{offset:lr.position.offset-Bt/2})})}))}var Rr=te&&te.type&&te.type.getComposedData;Rr&&F.push({props:ie(ie({},Rr(ie(ie({},xe),{},{displayedData:z,props:k,dataKey:Z,item:te,bandSize:tt,barPosition:Fe,offset:E,stackedData:Me,layout:Y,dataStartIndex:P,dataEndIndex:R}))),{},ze(ze(ze({key:te.key||"item-".concat(q)},U,xe[U]),G,xe[G]),"animationId",T)),childIndex:L9(te,k.children),item:te})}),F},v=function(k,A){var O=k.props,C=k.dataStartIndex,E=k.dataEndIndex,T=k.updateId;if(!FO({props:O}))return null;var P=O.children,R=O.layout,I=O.stackOffset,Y=O.data,W=O.reverseStackOrder,B=yP(R),X=B.numericAxisName,K=B.cateAxisName,U=Cn(P,n),G=KX(Y,U,"".concat(X,"Id"),"".concat(K,"Id"),I,W),J=u.reduce(function(L,Z){var se="".concat(Z.axisType,"Map");return ie(ie({},L),{},ze({},se,One(O,ie(ie({},Z),{},{graphicalItems:U,stackGroups:Z.axisType===X&&G,dataStartIndex:C,dataEndIndex:E}))))},{}),F=Cne(ie(ie({},J),{},{props:O,graphicalItems:U}),A==null?void 0:A.legendBBox);Object.keys(J).forEach(function(L){J[L]=p(O,J[L],F,L.replace("Map",""),r)});var te=J["".concat(K,"Map")],q=Ane(te),z=g(O,ie(ie({},J),{},{dataStartIndex:C,dataEndIndex:E,updateId:T,graphicalItems:U,stackGroups:G,offset:F}));return ie(ie({formattedGraphicalItems:z,graphicalItems:U,offset:F,stackGroups:G},q),J)},x=(function(b){function k(A){var O,C,E;return cne(this,k),E=fne(this,k,[A]),ze(E,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),ze(E,"accessibilityManager",new Xre),ze(E,"handleLegendBBoxUpdate",function(T){if(T){var P=E.state,R=P.dataStartIndex,I=P.dataEndIndex,Y=P.updateId;E.setState(ie({legendBBox:T},v({props:E.props,dataStartIndex:R,dataEndIndex:I,updateId:Y},ie(ie({},E.state),{},{legendBBox:T}))))}}),ze(E,"handleReceiveSyncEvent",function(T,P,R){if(E.props.syncId===T){if(R===E.eventEmitterSymbol&&typeof E.props.syncMethod!="function")return;E.applySyncEvent(P)}}),ze(E,"handleBrushChange",function(T){var P=T.startIndex,R=T.endIndex;if(P!==E.state.dataStartIndex||R!==E.state.dataEndIndex){var I=E.state.updateId;E.setState(function(){return ie({dataStartIndex:P,dataEndIndex:R},v({props:E.props,dataStartIndex:P,dataEndIndex:R,updateId:I},E.state))}),E.triggerSyncEvent({dataStartIndex:P,dataEndIndex:R})}}),ze(E,"handleMouseEnter",function(T){var P=E.getMouseInfo(T);if(P){var R=ie(ie({},P),{},{isTooltipActive:!0});E.setState(R),E.triggerSyncEvent(R);var I=E.props.onMouseEnter;Ye(I)&&I(R,T)}}),ze(E,"triggeredAfterMouseMove",function(T){var P=E.getMouseInfo(T),R=P?ie(ie({},P),{},{isTooltipActive:!0}):{isTooltipActive:!1};E.setState(R),E.triggerSyncEvent(R);var I=E.props.onMouseMove;Ye(I)&&I(R,T)}),ze(E,"handleItemMouseEnter",function(T){E.setState(function(){return{isTooltipActive:!0,activeItem:T,activePayload:T.tooltipPayload,activeCoordinate:T.tooltipPosition||{x:T.cx,y:T.cy}}})}),ze(E,"handleItemMouseLeave",function(){E.setState(function(){return{isTooltipActive:!1}})}),ze(E,"handleMouseMove",function(T){T.persist(),E.throttleTriggeredAfterMouseMove(T)}),ze(E,"handleMouseLeave",function(T){E.throttleTriggeredAfterMouseMove.cancel();var P={isTooltipActive:!1};E.setState(P),E.triggerSyncEvent(P);var R=E.props.onMouseLeave;Ye(R)&&R(P,T)}),ze(E,"handleOuterEvent",function(T){var P=M9(T),R=Tn(E.props,"".concat(P));if(P&&Ye(R)){var I,Y;/.*touch.*/i.test(P)?Y=E.getMouseInfo(T.changedTouches[0]):Y=E.getMouseInfo(T),R((I=Y)!==null&&I!==void 0?I:{},T)}}),ze(E,"handleClick",function(T){var P=E.getMouseInfo(T);if(P){var R=ie(ie({},P),{},{isTooltipActive:!0});E.setState(R),E.triggerSyncEvent(R);var I=E.props.onClick;Ye(I)&&I(R,T)}}),ze(E,"handleMouseDown",function(T){var P=E.props.onMouseDown;if(Ye(P)){var R=E.getMouseInfo(T);P(R,T)}}),ze(E,"handleMouseUp",function(T){var P=E.props.onMouseUp;if(Ye(P)){var R=E.getMouseInfo(T);P(R,T)}}),ze(E,"handleTouchMove",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&E.throttleTriggeredAfterMouseMove(T.changedTouches[0])}),ze(E,"handleTouchStart",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&E.handleMouseDown(T.changedTouches[0])}),ze(E,"handleTouchEnd",function(T){T.changedTouches!=null&&T.changedTouches.length>0&&E.handleMouseUp(T.changedTouches[0])}),ze(E,"handleDoubleClick",function(T){var P=E.props.onDoubleClick;if(Ye(P)){var R=E.getMouseInfo(T);P(R,T)}}),ze(E,"handleContextMenu",function(T){var P=E.props.onContextMenu;if(Ye(P)){var R=E.getMouseInfo(T);P(R,T)}}),ze(E,"triggerSyncEvent",function(T){E.props.syncId!==void 0&&Tb.emit(Cb,E.props.syncId,T,E.eventEmitterSymbol)}),ze(E,"applySyncEvent",function(T){var P=E.props,R=P.layout,I=P.syncMethod,Y=E.state.updateId,W=T.dataStartIndex,B=T.dataEndIndex;if(T.dataStartIndex!==void 0||T.dataEndIndex!==void 0)E.setState(ie({dataStartIndex:W,dataEndIndex:B},v({props:E.props,dataStartIndex:W,dataEndIndex:B,updateId:Y},E.state)));else if(T.activeTooltipIndex!==void 0){var X=T.chartX,K=T.chartY,U=T.activeTooltipIndex,G=E.state,J=G.offset,F=G.tooltipTicks;if(!J)return;if(typeof I=="function")U=I(F,T);else if(I==="value"){U=-1;for(var te=0;te<F.length;te++)if(F[te].value===T.activeLabel){U=te;break}}var q=ie(ie({},J),{},{x:J.left,y:J.top}),z=Math.min(X,q.x+q.width),L=Math.min(K,q.y+q.height),Z=F[U]&&F[U].value,se=bw(E.state,E.props.data,U),le=F[U]?{x:R==="horizontal"?F[U].coordinate:z,y:R==="horizontal"?L:F[U].coordinate}:yM;E.setState(ie(ie({},T),{},{activeLabel:Z,activeCoordinate:le,activePayload:se,activeTooltipIndex:U}))}else E.setState(T)}),ze(E,"renderCursor",function(T){var P,R=E.state,I=R.isTooltipActive,Y=R.activeCoordinate,W=R.activePayload,B=R.offset,X=R.activeTooltipIndex,K=R.tooltipAxisBandSize,U=E.getTooltipEventType(),G=(P=T.props.active)!==null&&P!==void 0?P:I,J=E.props.layout,F=T.key||"_recharts-cursor";return $.createElement(rne,{key:F,activeCoordinate:Y,activePayload:W,activeTooltipIndex:X,chartName:r,element:T,isActive:G,layout:J,offset:B,tooltipAxisBandSize:K,tooltipEventType:U})}),ze(E,"renderPolarAxis",function(T,P,R){var I=Tn(T,"type.axisType"),Y=Tn(E.state,"".concat(I,"Map")),W=T.type.defaultProps,B=W!==void 0?ie(ie({},W),T.props):T.props,X=Y&&Y[B["".concat(I,"Id")]];return N.cloneElement(T,ie(ie({},X),{},{className:at(I,X.className),key:T.key||"".concat(P,"-").concat(R),ticks:Hi(X,!0)}))}),ze(E,"renderPolarGrid",function(T){var P=T.props,R=P.radialLines,I=P.polarAngles,Y=P.polarRadius,W=E.state,B=W.radiusAxisMap,X=W.angleAxisMap,K=Na(B),U=Na(X),G=U.cx,J=U.cy,F=U.innerRadius,te=U.outerRadius;return N.cloneElement(T,{polarAngles:Array.isArray(I)?I:Hi(U,!0).map(function(q){return q.coordinate}),polarRadius:Array.isArray(Y)?Y:Hi(K,!0).map(function(q){return q.coordinate}),cx:G,cy:J,innerRadius:F,outerRadius:te,key:T.key||"polar-grid",radialLines:R})}),ze(E,"renderLegend",function(){var T=E.state.formattedGraphicalItems,P=E.props,R=P.children,I=P.width,Y=P.height,W=E.props.margin||{},B=I-(W.left||0)-(W.right||0),X=f$({children:R,formattedGraphicalItems:T,legendWidth:B,legendContent:d});if(!X)return null;var K=X.item,U=hP(X,nne);return N.cloneElement(K,ie(ie({},U),{},{chartWidth:I,chartHeight:Y,margin:W,onBBoxUpdate:E.handleLegendBBoxUpdate}))}),ze(E,"renderTooltip",function(){var T,P=E.props,R=P.children,I=P.accessibilityLayer,Y=sn(R,ln);if(!Y)return null;var W=E.state,B=W.isTooltipActive,X=W.activeCoordinate,K=W.activePayload,U=W.activeLabel,G=W.offset,J=(T=Y.props.active)!==null&&T!==void 0?T:B;return N.cloneElement(Y,{viewBox:ie(ie({},G),{},{x:G.left,y:G.top}),active:J,label:U,payload:J?K:[],coordinate:X,accessibilityLayer:I})}),ze(E,"renderBrush",function(T){var P=E.props,R=P.margin,I=P.data,Y=E.state,W=Y.offset,B=Y.dataStartIndex,X=Y.dataEndIndex,K=Y.updateId;return N.cloneElement(T,{key:T.key||"_recharts-brush",onChange:vf(E.handleBrushChange,T.props.onChange),data:I,x:ge(T.props.x)?T.props.x:W.left,y:ge(T.props.y)?T.props.y:W.top+W.height+W.brushBottom-(R.bottom||0),width:ge(T.props.width)?T.props.width:W.width,startIndex:B,endIndex:X,updateId:"brush-".concat(K)})}),ze(E,"renderReferenceElement",function(T,P,R){if(!T)return null;var I=E,Y=I.clipPathId,W=E.state,B=W.xAxisMap,X=W.yAxisMap,K=W.offset,U=T.type.defaultProps||{},G=T.props,J=G.xAxisId,F=J===void 0?U.xAxisId:J,te=G.yAxisId,q=te===void 0?U.yAxisId:te;return N.cloneElement(T,{key:T.key||"".concat(P,"-").concat(R),xAxis:B[F],yAxis:X[q],viewBox:{x:K.left,y:K.top,width:K.width,height:K.height},clipPathId:Y})}),ze(E,"renderActivePoints",function(T){var P=T.item,R=T.activePoint,I=T.basePoint,Y=T.childIndex,W=T.isRange,B=[],X=P.props.key,K=P.item.type.defaultProps!==void 0?ie(ie({},P.item.type.defaultProps),P.item.props):P.item.props,U=K.activeDot,G=K.dataKey,J=ie(ie({index:Y,dataKey:G,cx:R.x,cy:R.y,r:4,fill:U1(P.item),strokeWidth:2,stroke:"#fff",payload:R.payload,value:R.value},it(U,!1)),Wf(U));return B.push(k.renderActiveDot(U,J,"".concat(X,"-activePoint-").concat(Y))),I?B.push(k.renderActiveDot(U,ie(ie({},J),{},{cx:I.x,cy:I.y}),"".concat(X,"-basePoint-").concat(Y))):W&&B.push(null),B}),ze(E,"renderGraphicChild",function(T,P,R){var I=E.filterFormatItem(T,P,R);if(!I)return null;var Y=E.getTooltipEventType(),W=E.state,B=W.isTooltipActive,X=W.tooltipAxis,K=W.activeTooltipIndex,U=W.activeLabel,G=E.props.children,J=sn(G,ln),F=I.props,te=F.points,q=F.isRange,z=F.baseLine,L=I.item.type.defaultProps!==void 0?ie(ie({},I.item.type.defaultProps),I.item.props):I.item.props,Z=L.activeDot,se=L.hide,le=L.activeBar,ve=L.activeShape,qe=!!(!se&&B&&J&&(Z||le||ve)),xe={};Y!=="axis"&&J&&J.props.trigger==="click"?xe={onClick:vf(E.handleItemMouseEnter,T.props.onClick)}:Y!=="axis"&&(xe={onMouseLeave:vf(E.handleItemMouseLeave,T.props.onMouseLeave),onMouseEnter:vf(E.handleItemMouseEnter,T.props.onMouseEnter)});var ae=N.cloneElement(T,ie(ie({},I.props),xe));function Se(_t){return typeof X.dataKey=="function"?X.dataKey(_t.payload):null}if(qe)if(K>=0){var Me,oe;if(X.dataKey&&!X.allowDuplicatedCategory){var tt=typeof X.dataKey=="function"?Se:"payload.".concat(X.dataKey.toString());Me=Hf(te,tt,U),oe=q&&z&&Hf(z,tt,U)}else Me=te==null?void 0:te[K],oe=q&&z&&z[K];if(ve||le){var Fe=T.props.activeIndex!==void 0?T.props.activeIndex:K;return[N.cloneElement(T,ie(ie(ie({},I.props),xe),{},{activeIndex:Fe})),null,null]}if(!Qe(Me))return[ae].concat(dl(E.renderActivePoints({item:I,activePoint:Me,basePoint:oe,childIndex:K,isRange:q})))}else{var kt,wt=(kt=E.getItemByXY(E.state.activeCoordinate))!==null&&kt!==void 0?kt:{graphicalItem:ae},Et=wt.graphicalItem,Sr=Et.item,Bt=Sr===void 0?T:Sr,Rr=Et.childIndex,lr=ie(ie(ie({},I.props),xe),{},{activeIndex:Rr});return[N.cloneElement(Bt,lr),null,null]}return q?[ae,null,null]:[ae,null]}),ze(E,"renderCustomized",function(T,P,R){return N.cloneElement(T,ie(ie({key:"recharts-customized-".concat(R)},E.props),E.state))}),ze(E,"renderMap",{CartesianGrid:{handler:Sf,once:!0},ReferenceArea:{handler:E.renderReferenceElement},ReferenceLine:{handler:Sf},ReferenceDot:{handler:E.renderReferenceElement},XAxis:{handler:Sf},YAxis:{handler:Sf},Brush:{handler:E.renderBrush,once:!0},Bar:{handler:E.renderGraphicChild},Line:{handler:E.renderGraphicChild},Area:{handler:E.renderGraphicChild},Radar:{handler:E.renderGraphicChild},RadialBar:{handler:E.renderGraphicChild},Scatter:{handler:E.renderGraphicChild},Pie:{handler:E.renderGraphicChild},Funnel:{handler:E.renderGraphicChild},Tooltip:{handler:E.renderCursor,once:!0},PolarGrid:{handler:E.renderPolarGrid,once:!0},PolarAngleAxis:{handler:E.renderPolarAxis},PolarRadiusAxis:{handler:E.renderPolarAxis},Customized:{handler:E.renderCustomized}}),E.clipPathId="".concat((O=A.id)!==null&&O!==void 0?O:Iu("recharts"),"-clip"),E.throttleTriggeredAfterMouseMove=fI(E.triggeredAfterMouseMove,(C=A.throttleDelay)!==null&&C!==void 0?C:1e3/60),E.state={},E}return mne(k,b),dne(k,[{key:"componentDidMount",value:function(){var O,C;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(O=this.props.margin.left)!==null&&O!==void 0?O:0,top:(C=this.props.margin.top)!==null&&C!==void 0?C:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var O=this.props,C=O.children,E=O.data,T=O.height,P=O.layout,R=sn(C,ln);if(R){var I=R.props.defaultIndex;if(!(typeof I!="number"||I<0||I>this.state.tooltipTicks.length-1)){var Y=this.state.tooltipTicks[I]&&this.state.tooltipTicks[I].value,W=bw(this.state,E,I,Y),B=this.state.tooltipTicks[I].coordinate,X=(this.state.offset.top+T)/2,K=P==="horizontal",U=K?{x:B,y:X}:{y:B,x:X},G=this.state.formattedGraphicalItems.find(function(F){var te=F.item;return te.type.name==="Scatter"});G&&(U=ie(ie({},U),G.props.points[I].tooltipPosition),W=G.props.points[I].tooltipPayload);var J={activeTooltipIndex:I,isTooltipActive:!0,activeLabel:Y,activePayload:W,activeCoordinate:U};this.setState(J),this.renderCursor(R),this.accessibilityManager.setIndex(I)}}}},{key:"getSnapshotBeforeUpdate",value:function(O,C){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==C.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==O.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==O.margin){var E,T;this.accessibilityManager.setDetails({offset:{left:(E=this.props.margin.left)!==null&&E!==void 0?E:0,top:(T=this.props.margin.top)!==null&&T!==void 0?T:0}})}return null}},{key:"componentDidUpdate",value:function(O){ix([sn(O.children,ln)],[sn(this.props.children,ln)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var O=sn(this.props.children,ln);if(O&&typeof O.props.shared=="boolean"){var C=O.props.shared?"axis":"item";return l.indexOf(C)>=0?C:a}return a}},{key:"getMouseInfo",value:function(O){if(!this.container)return null;var C=this.container,E=C.getBoundingClientRect(),T=SW(E),P={chartX:Math.round(O.pageX-T.left),chartY:Math.round(O.pageY-T.top)},R=E.width/C.offsetWidth||1,I=this.inRange(P.chartX,P.chartY,R);if(!I)return null;var Y=this.state,W=Y.xAxisMap,B=Y.yAxisMap,X=this.getTooltipEventType(),K=mP(this.state,this.props.data,this.props.layout,I);if(X!=="axis"&&W&&B){var U=Na(W).scale,G=Na(B).scale,J=U&&U.invert?U.invert(P.chartX):null,F=G&&G.invert?G.invert(P.chartY):null;return ie(ie({},P),{},{xValue:J,yValue:F},K)}return K?ie(ie({},P),K):null}},{key:"inRange",value:function(O,C){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,T=this.props.layout,P=O/E,R=C/E;if(T==="horizontal"||T==="vertical"){var I=this.state.offset,Y=P>=I.left&&P<=I.left+I.width&&R>=I.top&&R<=I.top+I.height;return Y?{x:P,y:R}:null}var W=this.state,B=W.angleAxisMap,X=W.radiusAxisMap;if(B&&X){var K=Na(B);return NC({x:P,y:R},K)}return null}},{key:"parseEventsOfWrapper",value:function(){var O=this.props.children,C=this.getTooltipEventType(),E=sn(O,ln),T={};E&&C==="axis"&&(E.props.trigger==="click"?T={onClick:this.handleClick}:T={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var P=Wf(this.props,this.handleOuterEvent);return ie(ie({},P),T)}},{key:"addListener",value:function(){Tb.on(Cb,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Tb.removeListener(Cb,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(O,C,E){for(var T=this.state.formattedGraphicalItems,P=0,R=T.length;P<R;P++){var I=T[P];if(I.item===O||I.props.key===O.key||C===Gi(I.item.type)&&E===I.childIndex)return I}return null}},{key:"renderClipPath",value:function(){var O=this.clipPathId,C=this.state.offset,E=C.left,T=C.top,P=C.height,R=C.width;return $.createElement("defs",null,$.createElement("clipPath",{id:O},$.createElement("rect",{x:E,y:T,height:P,width:R})))}},{key:"getXScales",value:function(){var O=this.state.xAxisMap;return O?Object.entries(O).reduce(function(C,E){var T=fP(E,2),P=T[0],R=T[1];return ie(ie({},C),{},ze({},P,R.scale))},{}):null}},{key:"getYScales",value:function(){var O=this.state.yAxisMap;return O?Object.entries(O).reduce(function(C,E){var T=fP(E,2),P=T[0],R=T[1];return ie(ie({},C),{},ze({},P,R.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(O){var C;return(C=this.state.xAxisMap)===null||C===void 0||(C=C[O])===null||C===void 0?void 0:C.scale}},{key:"getYScaleByAxisId",value:function(O){var C;return(C=this.state.yAxisMap)===null||C===void 0||(C=C[O])===null||C===void 0?void 0:C.scale}},{key:"getItemByXY",value:function(O){var C=this.state,E=C.formattedGraphicalItems,T=C.activeItem;if(E&&E.length)for(var P=0,R=E.length;P<R;P++){var I=E[P],Y=I.props,W=I.item,B=W.type.defaultProps!==void 0?ie(ie({},W.type.defaultProps),W.props):W.props,X=Gi(W.type);if(X==="Bar"){var K=(Y.data||[]).find(function(F){return HZ(O,F)});if(K)return{graphicalItem:I,payload:K}}else if(X==="RadialBar"){var U=(Y.data||[]).find(function(F){return NC(O,F)});if(U)return{graphicalItem:I,payload:U}}else if(Op(I,T)||Ap(I,T)||vu(I,T)){var G=IQ({graphicalItem:I,activeTooltipItem:T,itemData:B.data}),J=B.activeIndex===void 0?G:B.activeIndex;return{graphicalItem:ie(ie({},I),{},{childIndex:J}),payload:vu(I,T)?B.data[G]:I.props.data[G]}}}return null}},{key:"render",value:function(){var O=this;if(!FO(this))return null;var C=this.props,E=C.children,T=C.className,P=C.width,R=C.height,I=C.style,Y=C.compact,W=C.title,B=C.desc,X=hP(C,ine),K=it(X,!1);if(Y)return $.createElement(Kj,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},$.createElement(ox,$s({},K,{width:P,height:R,title:W,desc:B}),this.renderClipPath(),WO(E,this.renderMap)));if(this.props.accessibilityLayer){var U,G;K.tabIndex=(U=this.props.tabIndex)!==null&&U!==void 0?U:0,K.role=(G=this.props.role)!==null&&G!==void 0?G:"application",K.onKeyDown=function(F){O.accessibilityManager.keyboardEvent(F)},K.onFocus=function(){O.accessibilityManager.focus()}}var J=this.parseEventsOfWrapper();return $.createElement(Kj,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},$.createElement("div",$s({className:at("recharts-wrapper",T),style:ie({position:"relative",cursor:"default",width:P,height:R},I)},J,{ref:function(te){O.container=te}}),$.createElement(ox,$s({},K,{width:P,height:R,title:W,desc:B,style:wne}),this.renderClipPath(),WO(E,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(N.Component);ze(x,"displayName",r),ze(x,"defaultProps",ie({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),ze(x,"getDerivedStateFromProps",function(b,k){var A=b.dataKey,O=b.data,C=b.children,E=b.width,T=b.height,P=b.layout,R=b.stackOffset,I=b.margin,Y=k.dataStartIndex,W=k.dataEndIndex;if(k.updateId===void 0){var B=gP(b);return ie(ie(ie({},B),{},{updateId:0},v(ie(ie({props:b},B),{},{updateId:0}),k)),{},{prevDataKey:A,prevData:O,prevWidth:E,prevHeight:T,prevLayout:P,prevStackOffset:R,prevMargin:I,prevChildren:C})}if(A!==k.prevDataKey||O!==k.prevData||E!==k.prevWidth||T!==k.prevHeight||P!==k.prevLayout||R!==k.prevStackOffset||!zs(I,k.prevMargin)){var X=gP(b),K={chartX:k.chartX,chartY:k.chartY,isTooltipActive:k.isTooltipActive},U=ie(ie({},mP(k,O,P)),{},{updateId:k.updateId+1}),G=ie(ie(ie({},X),K),U);return ie(ie(ie({},G),v(ie({props:b},G),k)),{},{prevDataKey:A,prevData:O,prevWidth:E,prevHeight:T,prevLayout:P,prevStackOffset:R,prevMargin:I,prevChildren:C})}if(!ix(C,k.prevChildren)){var J,F,te,q,z=sn(C,tl),L=z&&(J=(F=z.props)===null||F===void 0?void 0:F.startIndex)!==null&&J!==void 0?J:Y,Z=z&&(te=(q=z.props)===null||q===void 0?void 0:q.endIndex)!==null&&te!==void 0?te:W,se=L!==Y||Z!==W,le=!Qe(O),ve=le&&!se?k.updateId:k.updateId+1;return ie(ie({updateId:ve},v(ie(ie({props:b},k),{},{updateId:ve,dataStartIndex:L,dataEndIndex:Z}),k)),{},{prevChildren:C,dataStartIndex:L,dataEndIndex:Z})}return null}),ze(x,"renderActiveDot",function(b,k,A){var O;return N.isValidElement(b)?O=N.cloneElement(b,k):Ye(b)?O=b(k):O=$.createElement(F1,k),$.createElement(Xt,{className:"recharts-active-dot",key:A},O)});var _=N.forwardRef(function(k,A){return $.createElement(x,$s({},k,{ref:A}))});return _.displayName=x.displayName,_},Pne=bM({chartName:"LineChart",GraphicalChild:Uu,axisComponents:[{axisType:"xAxis",AxisComp:za},{axisType:"yAxis",AxisComp:Ba}],formatAxisMap:D$}),xw=bM({chartName:"BarChart",GraphicalChild:ea,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:za},{axisType:"yAxis",AxisComp:Ba}],formatAxisMap:D$});const Fh={backgroundColor:"#1e1e1e",border:"1px solid rgba(255,255,255,0.08)",borderRadius:"12px",color:"#e4e0dc",fontSize:"11px",fontFamily:"JetBrains Mono, monospace"};function Rt(t){return t>=1e6?`${(t/1e6).toFixed(2)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(Math.round(t))}function Zn(t){return`$${t.toFixed(2)}`}function $a({label:t,value:e,sub:r,accent:n}){return y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl px-5 py-4",children:[y.jsx("p",{className:"text-[11px] font-mono text-zinc-600 mb-1",children:t}),y.jsx("p",{className:`text-xl font-mono font-medium ${n?"text-[#E43A9C]":"text-zinc-100"}`,children:e}),r&&y.jsx("p",{className:"text-[10px] font-mono text-zinc-600 mt-0.5",children:r})]})}const Nne={summary:"Summary","by squad":"By Squad","by agent":"By Agent",io:"IO",timeline:"Timeline"};function Rne({tabs:t,active:e,onChange:r}){return y.jsx("div",{className:"flex gap-0 border-b border-white/[0.06] mb-5",children:t.map(n=>y.jsx("button",{type:"button",onClick:()=>r(n),className:`px-4 py-2 text-[11px] font-mono transition-colors border-b-2 -mb-px cursor-pointer ${e===n?"text-[#E43A9C] border-[#E43A9C]":"text-zinc-600 hover:text-zinc-300 border-transparent"}`,children:Nne[n]??n},n))})}function Ine({records:t,totals:e}){const r=e.totalInputTokens+e.totalOutputTokens,n=new Map;for(const o of t){const l=o.squadId??"__io__",u=o.squadName??(o.squadId?`${o.squadId.slice(0,8)} (deleted)`:"IO Orchestrator"),d=n.get(l)??{name:u,inputTokens:0,outputTokens:0,calls:0,cost:0};d.inputTokens+=o.inputTokens,d.outputTokens+=o.outputTokens,d.calls+=1,d.cost+=o.estimatedCostUsd??0,n.set(l,d)}const i=Array.from(n.values()).sort((o,l)=>l.cost-o.cost),a=i.map(o=>({name:o.name.length>12?`${o.name.slice(0,12)}…`:o.name,cost:Number.parseFloat(o.cost.toFixed(2)),tokens:Math.round((o.inputTokens+o.outputTokens)/1e3)}));return y.jsxs("div",{className:"space-y-5",children:[y.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[y.jsx($a,{label:"Total Tokens",value:Rt(r),sub:`${Rt(e.totalInputTokens)} in · ${Rt(e.totalOutputTokens)} out`}),y.jsx($a,{label:"Total Cost",value:Zn(e.totalCostUsd),accent:!0}),y.jsx($a,{label:"API Calls",value:Rt(e.callCount),sub:"across all entities"}),y.jsx($a,{label:"Avg Cost / Call",value:e.callCount>0?Zn(e.totalCostUsd/e.callCount):"$0.00",sub:`over ${e.callCount} calls`})]}),y.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:[y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-4",children:[y.jsx("p",{className:"text-[11px] font-mono text-zinc-500 mb-3",children:"Cost by entity"}),a.length>0?y.jsx(rh,{width:"100%",height:180,children:y.jsxs(xw,{data:a,barCategoryGap:"35%",children:[y.jsx(Su,{vertical:!1,stroke:"rgba(255,255,255,0.04)"}),y.jsx(za,{dataKey:"name",tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1}),y.jsx(Ba,{tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1,tickFormatter:o=>`$${o}`,width:40}),y.jsx(ln,{contentStyle:Fh,cursor:{fill:"rgba(255,255,255,0.03)"},formatter:o=>[`$${o.toFixed(2)}`,"Cost"]}),y.jsx(ea,{dataKey:"cost",fill:"url(#costGrad)",radius:[6,6,0,0]}),y.jsx("defs",{children:y.jsxs("linearGradient",{id:"costGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[y.jsx("stop",{offset:"0%",stopColor:"#E43A9C"}),y.jsx("stop",{offset:"100%",stopColor:"#D83333",stopOpacity:.7})]})})]})}):y.jsx("div",{className:"h-[180px] flex items-center justify-center text-zinc-700 text-[11px] font-mono",children:"No data"})]}),y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-4",children:[y.jsx("p",{className:"text-[11px] font-mono text-zinc-500 mb-3",children:"Tokens by entity (k)"}),a.length>0?y.jsx(rh,{width:"100%",height:180,children:y.jsxs(xw,{data:a,barCategoryGap:"35%",children:[y.jsx(Su,{vertical:!1,stroke:"rgba(255,255,255,0.04)"}),y.jsx(za,{dataKey:"name",tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1}),y.jsx(Ba,{tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1,tickFormatter:o=>`${o}k`,width:40}),y.jsx(ln,{contentStyle:Fh,cursor:{fill:"rgba(255,255,255,0.03)"},formatter:o=>[`${o}k`,"Tokens"]}),y.jsx(ea,{dataKey:"tokens",fill:"url(#tokenGrad)",radius:[6,6,0,0]}),y.jsx("defs",{children:y.jsxs("linearGradient",{id:"tokenGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[y.jsx("stop",{offset:"0%",stopColor:"#818cf8"}),y.jsx("stop",{offset:"100%",stopColor:"#6366f1",stopOpacity:.7})]})})]})}):y.jsx("div",{className:"h-[180px] flex items-center justify-center text-zinc-700 text-[11px] font-mono",children:"No data"})]})]}),y.jsx("div",{className:"overflow-auto rounded-2xl border border-white/[0.07] glass-card",children:y.jsxs("table",{className:"w-full text-[11px] font-mono",children:[y.jsx("thead",{children:y.jsx("tr",{className:"border-b border-white/[0.06] bg-[#1a1a1a]",children:["Entity","Input","Output","Calls","Cost"].map(o=>y.jsx("th",{className:`text-left px-4 py-2.5 text-zinc-600 font-medium ${o==="Cost"?"text-right":""}`,children:o},o))})}),y.jsxs("tbody",{children:[i.map(o=>y.jsxs("tr",{className:"border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors",children:[y.jsx("td",{className:"px-4 py-3 text-zinc-300",children:o.name}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:Rt(o.inputTokens)}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:Rt(o.outputTokens)}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:o.calls}),y.jsx("td",{className:"px-4 py-3 text-right text-[#E43A9C]",children:Zn(o.cost)})]},o.name)),y.jsxs("tr",{className:"bg-[#1a1a1a]",children:[y.jsx("td",{className:"px-4 py-3 text-zinc-200 font-medium",children:"Total"}),y.jsx("td",{className:"px-4 py-3 text-zinc-300",children:Rt(e.totalInputTokens)}),y.jsx("td",{className:"px-4 py-3 text-zinc-300",children:Rt(e.totalOutputTokens)}),y.jsx("td",{className:"px-4 py-3 text-zinc-300",children:e.callCount}),y.jsx("td",{className:"px-4 py-3 text-right text-[#E43A9C] font-medium",children:Zn(e.totalCostUsd)})]})]})]})})]})}function $ne({records:t}){const[e,r]=N.useState([]),[n,i]=N.useState("cost"),[a,o]=N.useState("desc");function l(f){f===n?o(g=>g==="asc"?"desc":"asc"):(i(f),o("desc"))}const u=N.useMemo(()=>{const f=new Map;for(const v of t){if(!v.squadId)continue;const x=f.get(v.squadId)??{id:v.squadId,name:v.squadName??`${v.squadId.slice(0,8)} (deleted)`,agents:new Map,inputTokens:0,outputTokens:0,calls:0,cost:0};x.inputTokens+=v.inputTokens,x.outputTokens+=v.outputTokens,x.calls+=1,x.cost+=v.estimatedCostUsd??0;const _=v.agentRole??"unknown",b=x.agents.get(_)??{role:_,model:v.model,inputTokens:0,outputTokens:0,calls:0,cost:0};b.inputTokens+=v.inputTokens,b.outputTokens+=v.outputTokens,b.calls+=1,b.cost+=v.estimatedCostUsd??0,x.agents.set(_,b),f.set(v.squadId,x)}return[...Array.from(f.values())].sort((v,x)=>{const _=v[n],b=x[n],k=typeof _=="string"?_.localeCompare(b):_-b;return a==="desc"?-k:k})},[t,n,a]),d=f=>r(g=>g.includes(f)?g.filter(v=>v!==f):[...g,f]),p=[{key:"name",label:"Squad"},{key:"inputTokens",label:"In"},{key:"outputTokens",label:"Out"},{key:"calls",label:"Calls"},{key:"cost",label:"Cost"}];return u.length===0?y.jsx("div",{className:"text-center py-12 text-zinc-700 text-[11px] font-mono",children:"No squad usage data"}):y.jsxs("div",{className:"space-y-2",children:[y.jsxs("div",{className:"flex items-center gap-1 px-1 mb-1",children:[y.jsx("span",{className:"text-[10px] font-mono text-zinc-700 mr-1",children:"sort by"}),p.map(f=>y.jsxs("button",{type:"button",onClick:()=>l(f.key),className:`flex items-center gap-0.5 px-2 py-1 rounded-lg text-[10px] font-mono transition-colors ${n===f.key?"text-[#E43A9C]":"text-zinc-600 hover:text-zinc-400 hover:bg-white/[0.04]"}`,style:n===f.key?{background:"rgba(228,58,156,0.1)"}:void 0,children:[f.label,n===f.key&&y.jsx("span",{className:"text-[9px]",children:a==="desc"?"↓":"↑"})]},f.key))]}),u.map(f=>{const g=e.includes(f.id),v=Array.from(f.agents.values());return y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl overflow-hidden",children:[y.jsxs("button",{type:"button",onClick:()=>d(f.id),className:"w-full flex items-center gap-3 px-4 py-3.5 hover:bg-white/[0.02] transition-colors text-left cursor-pointer",children:[y.jsx("div",{className:`transition-transform ${g?"rotate-90":""}`,children:y.jsx(Pw,{className:"w-3.5 h-3.5 text-zinc-600"})}),y.jsx("span",{className:"text-sm font-mono text-zinc-100 flex-1",children:f.name}),y.jsxs("div",{className:"flex items-center gap-6 text-[11px] font-mono",children:[y.jsxs("span",{className:"text-zinc-500 hidden sm:block",children:[y.jsx("span",{className:"text-zinc-700 mr-1",children:"in"}),Rt(f.inputTokens)]}),y.jsxs("span",{className:"text-zinc-500 hidden sm:block",children:[y.jsx("span",{className:"text-zinc-700 mr-1",children:"out"}),Rt(f.outputTokens)]}),y.jsxs("span",{className:"text-zinc-500",children:[y.jsx("span",{className:"text-zinc-700 mr-1",children:"calls"}),f.calls]}),y.jsx("span",{className:"text-[#E43A9C] font-medium w-16 text-right",children:Zn(f.cost)})]})]}),g&&y.jsx("div",{className:"border-t border-white/[0.05]",children:y.jsxs("table",{className:"w-full text-[11px] font-mono",children:[y.jsx("thead",{children:y.jsx("tr",{className:"bg-[#191919]",children:["Agent","Model","Input","Output","Calls","Cost"].map(x=>y.jsx("th",{className:`text-left px-4 py-2 text-zinc-700 font-medium ${x==="Cost"?"text-right":""}`,children:x},x))})}),y.jsx("tbody",{children:v.map(x=>y.jsxs("tr",{className:"border-t border-white/[0.04] hover:bg-white/[0.015] transition-colors",children:[y.jsx("td",{className:"px-4 py-2.5 text-zinc-300",children:x.role}),y.jsx("td",{className:"px-4 py-2.5 text-zinc-600",children:x.model}),y.jsx("td",{className:"px-4 py-2.5 text-zinc-500",children:Rt(x.inputTokens)}),y.jsx("td",{className:"px-4 py-2.5 text-zinc-500",children:Rt(x.outputTokens)}),y.jsx("td",{className:"px-4 py-2.5 text-zinc-500",children:x.calls}),y.jsx("td",{className:"px-4 py-2.5 text-right text-[#E43A9C]",children:Zn(x.cost)})]},x.role))})]})})]},f.id)})]})}function Mne({records:t}){const e=N.useMemo(()=>{const n=new Map;for(const i of t){const a=`${i.squadId??"io"}:${i.agentRole??"orchestrator"}`,o=n.get(a)??{name:i.agentRole??"orchestrator",squad:i.squadName??(i.squadId?i.squadId.slice(0,8):"IO"),model:i.model,inputTokens:0,outputTokens:0,calls:0,cost:0};o.inputTokens+=i.inputTokens,o.outputTokens+=i.outputTokens,o.calls+=1,o.cost+=i.estimatedCostUsd??0,n.set(a,o)}return Array.from(n.values()).sort((i,a)=>a.cost-i.cost)},[t]),r=e.reduce((n,i)=>n+i.cost,0);return y.jsx("div",{className:"overflow-auto rounded-2xl border border-white/[0.07] glass-card",children:y.jsxs("table",{className:"w-full text-[11px] font-mono",children:[y.jsx("thead",{children:y.jsx("tr",{className:"border-b border-white/[0.06] bg-[#1a1a1a]",children:["Agent","Squad","Model","Input","Output","Calls","Cost","% of total"].map(n=>y.jsx("th",{className:`text-left px-4 py-2.5 text-zinc-600 font-medium ${n==="Cost"?"text-right":""}`,children:n},n))})}),y.jsx("tbody",{children:e.map(n=>y.jsxs("tr",{className:"border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors",children:[y.jsx("td",{className:"px-4 py-3 text-zinc-300",children:n.name}),y.jsx("td",{className:"px-4 py-3 text-zinc-600",children:n.squad}),y.jsx("td",{className:"px-4 py-3 text-zinc-600",children:n.model}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:Rt(n.inputTokens)}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:Rt(n.outputTokens)}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:n.calls}),y.jsx("td",{className:"px-4 py-3 text-right text-[#E43A9C]",children:Zn(n.cost)}),y.jsx("td",{className:"px-4 py-3",children:y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("div",{className:"w-16 h-1.5 rounded-full bg-[#252525] overflow-hidden",children:y.jsx("div",{className:"h-full bg-[#E43A9C] rounded-full",style:{width:`${r>0?n.cost/r*100:0}%`}})}),y.jsx("span",{className:"text-zinc-600 text-[10px]",children:r>0?`${(n.cost/r*100).toFixed(1)}%`:"0%"})]})})]},`${n.squad}:${n.name}`))})]})})}function Lne({records:t}){const e=N.useMemo(()=>t.filter(o=>!o.squadId),[t]),r=N.useMemo(()=>{const o=new Map;for(const l of e){const u=l.agentRole??"orchestrator",d=o.get(u)??{name:u,model:l.model,inputTokens:0,outputTokens:0,calls:0,cost:0};d.inputTokens+=l.inputTokens,d.outputTokens+=l.outputTokens,d.calls+=1,d.cost+=l.estimatedCostUsd??0,o.set(u,d)}return Array.from(o.values()).sort((l,u)=>u.cost-l.cost)},[e]),n=e.reduce((o,l)=>o+l.inputTokens,0),i=e.reduce((o,l)=>o+l.outputTokens,0),a=e.reduce((o,l)=>o+(l.estimatedCostUsd??0),0);return y.jsxs("div",{className:"space-y-5",children:[y.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[y.jsx($a,{label:"IO Tokens",value:Rt(n+i),sub:`${Rt(n)} in · ${Rt(i)} out`}),y.jsx($a,{label:"IO Cost",value:Zn(a),accent:!0}),y.jsx($a,{label:"IO Calls",value:Rt(e.length)}),y.jsx($a,{label:"IO Roles",value:String(r.length)})]}),y.jsx("div",{className:"overflow-auto rounded-2xl border border-white/[0.07] glass-card",children:y.jsxs("table",{className:"w-full text-[11px] font-mono",children:[y.jsx("thead",{children:y.jsx("tr",{className:"border-b border-white/[0.06] bg-[#1a1a1a]",children:["Role","Model","Input","Output","Calls","Cost"].map(o=>y.jsx("th",{className:`text-left px-4 py-2.5 text-zinc-600 font-medium ${o==="Cost"?"text-right":""}`,children:o},o))})}),y.jsx("tbody",{children:r.map(o=>y.jsxs("tr",{className:"border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors",children:[y.jsx("td",{className:"px-4 py-3 text-zinc-300",children:o.name}),y.jsx("td",{className:"px-4 py-3 text-zinc-600",children:o.model}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:Rt(o.inputTokens)}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:Rt(o.outputTokens)}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:o.calls}),y.jsx("td",{className:"px-4 py-3 text-right text-[#E43A9C]",children:Zn(o.cost)})]},o.name))})]})})]})}function Dne({records:t}){const e=ml(),r=N.useMemo(()=>{const i=new Map;for(const a of t){const o=a.timestamp.slice(0,10),l=i.get(o)??{date:o,inputTokens:0,outputTokens:0,cost:0,calls:0};l.inputTokens+=a.inputTokens,l.outputTokens+=a.outputTokens,l.cost+=a.estimatedCostUsd??0,l.calls+=1,i.set(o,l)}return Array.from(i.values()).sort((a,o)=>a.date.localeCompare(o.date))},[t]),n=r.map(i=>({...i,label:Z4(i.date,e),tokens:i.inputTokens+i.outputTokens}));return y.jsxs("div",{className:"space-y-5",children:[y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-5",children:[y.jsx("p",{className:"text-[11px] font-mono text-zinc-500 mb-3",children:"Tokens per day"}),n.length>0?y.jsx(rh,{width:"100%",height:220,children:y.jsxs(Pne,{data:n,children:[y.jsx(Su,{vertical:!1,stroke:"rgba(255,255,255,0.04)"}),y.jsx(za,{dataKey:"label",tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1}),y.jsx(Ba,{tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1,tickFormatter:Rt,width:44}),y.jsx(ln,{contentStyle:Fh,cursor:{fill:"rgba(255,255,255,0.03)"},formatter:i=>[Rt(i),"Tokens"]}),y.jsx(Uu,{type:"monotone",dataKey:"tokens",stroke:"#E43A9C",strokeWidth:2,dot:!1})]})}):y.jsx("div",{className:"h-[220px] flex items-center justify-center text-zinc-700 text-[11px] font-mono",children:"No data"})]}),y.jsxs("div",{className:"glass-card border border-white/[0.07] rounded-2xl p-5",children:[y.jsx("p",{className:"text-[11px] font-mono text-zinc-500 mb-3",children:"Cost per day"}),n.length>0?y.jsx(rh,{width:"100%",height:180,children:y.jsxs(xw,{data:n,barCategoryGap:"20%",children:[y.jsx(Su,{vertical:!1,stroke:"rgba(255,255,255,0.04)"}),y.jsx(za,{dataKey:"label",tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1}),y.jsx(Ba,{tick:{fill:"#52525b",fontSize:10,fontFamily:"JetBrains Mono, monospace"},axisLine:!1,tickLine:!1,tickFormatter:i=>`$${i.toFixed(2)}`,width:44}),y.jsx(ln,{contentStyle:Fh,cursor:{fill:"rgba(255,255,255,0.03)"},formatter:i=>[Zn(i),"Cost"]}),y.jsx(ea,{dataKey:"cost",fill:"url(#costGradTl)",radius:[4,4,0,0]}),y.jsx("defs",{children:y.jsxs("linearGradient",{id:"costGradTl",x1:"0",y1:"0",x2:"0",y2:"1",children:[y.jsx("stop",{offset:"0%",stopColor:"#E43A9C"}),y.jsx("stop",{offset:"100%",stopColor:"#D83333",stopOpacity:.7})]})})]})}):y.jsx("div",{className:"h-[180px] flex items-center justify-center text-zinc-700 text-[11px] font-mono",children:"No data"})]}),y.jsx("div",{className:"overflow-auto rounded-2xl border border-white/[0.07] glass-card",children:y.jsxs("table",{className:"w-full text-[11px] font-mono",children:[y.jsx("thead",{children:y.jsx("tr",{className:"border-b border-white/[0.06] bg-[#1a1a1a]",children:["Date","Input","Output","Calls","Cost"].map(i=>y.jsx("th",{className:`text-left px-4 py-2.5 text-zinc-600 font-medium ${i==="Cost"?"text-right":""}`,children:i},i))})}),y.jsx("tbody",{children:r.map(i=>y.jsxs("tr",{className:"border-b border-white/[0.04] hover:bg-white/[0.015] transition-colors",children:[y.jsx("td",{className:"px-4 py-3 text-zinc-300",children:i.date}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:Rt(i.inputTokens)}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:Rt(i.outputTokens)}),y.jsx("td",{className:"px-4 py-3 text-zinc-500",children:i.calls}),y.jsx("td",{className:"px-4 py-3 text-right text-[#E43A9C]",children:Zn(i.cost)})]},i.date))})]})})]})}function zne(){const[t,e]=N.useState("summary"),[r,n]=N.useState(null),[i,a]=N.useState("14d"),o=["summary","by squad","by agent","io","timeline"];if(N.useEffect(()=>{const u=new Date;i==="7d"?u.setDate(u.getDate()-7):i==="14d"?u.setDate(u.getDate()-14):i==="30d"?u.setDate(u.getDate()-30):u.setDate(u.getDate()-1),et.get(`/usage?since=${u.toISOString()}`).then(n).catch(()=>{})},[i]),!r)return y.jsx("div",{className:"h-full flex items-center justify-center text-zinc-600 font-mono text-[11px]",children:"Loading..."});const l=i==="1d"?"Today":`Last ${i}`;return y.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[y.jsxs("div",{className:"flex items-start justify-between mb-5 gap-4 flex-wrap",children:[y.jsxs("div",{children:[y.jsx("h2",{className:"text-2xl tracking-wide text-zinc-100",style:{fontFamily:"'Bebas Neue', sans-serif"},children:"Usage"}),y.jsx("p",{className:"text-[11px] text-zinc-600 font-mono mt-0.5",children:l})]}),y.jsx("div",{className:"flex gap-1 p-1 rounded-xl bg-white/[0.03] border border-white/[0.07]",children:["1d","7d","14d","30d"].map(u=>y.jsx("button",{type:"button",onClick:()=>a(u),className:`px-3 py-1.5 rounded-lg text-[11px] font-mono transition-colors cursor-pointer ${i===u?"text-[#E43A9C]":"text-zinc-600 hover:text-zinc-400"}`,style:i===u?{background:"rgba(228,58,156,0.12)"}:void 0,children:u},u))})]}),y.jsx(Rne,{tabs:o,active:t,onChange:u=>e(u)}),t==="summary"&&y.jsx(Ine,{records:r.records,totals:r.totals}),t==="by squad"&&y.jsx($ne,{records:r.records}),t==="by agent"&&y.jsx(Mne,{records:r.records}),t==="io"&&y.jsx(Lne,{records:r.records}),t==="timeline"&&y.jsx(Dne,{records:r.records})]})}function xM(t){return[...t].sort((e,r)=>e.isDir!==r.isDir?e.isDir?-1:1:e.name.localeCompare(r.name)).map(e=>({...e,children:xM(e.children)}))}function Bne(t){const e=[];for(const r of t){const n=r.path.split("/").filter(Boolean);let i=e,a="";for(const[o,l]of n.entries()){const u=o===n.length-1;a=a?`${a}/${l}`:l;let d=i.find(p=>p.path===a);d||(d={name:u&&r.name||l,path:a,isDir:!u,children:[]},i.push(d)),i=d.children}}return xM(e)}function wM(t,e){return e?t.flatMap(r=>{const n=r.name.toLowerCase().includes(e)||r.path.toLowerCase().includes(e);if(!r.isDir)return n?[r]:[];if(n)return[r];const i=wM(r.children,e);return i.length?[{...r,children:i}]:[]}):t}function ww(t){const e=new Set;for(const r of t)if(r.isDir){e.add(r.path);for(const n of ww(r.children))e.add(n)}return e}function Une(t){const e=t.split("/").filter(Boolean),r=[];let n="";for(const i of e.slice(0,-1))n=n?`${n}/${i}`:i,r.push(n);return r}function _M({node:t,depth:e,selectedPage:r,expandedPaths:n,autoExpandedPaths:i,onToggle:a,onSelect:o}){const l=r===t.path,u=t.isDir&&(n.has(t.path)||i.has(t.path)),d=12+e*16;return t.isDir?y.jsxs("div",{children:[y.jsxs("button",{type:"button",onClick:()=>a(t.path),className:"flex w-full items-center gap-2 rounded-lg py-2 pr-3 text-left text-[11px] font-mono text-zinc-400 transition-colors hover:bg-white/[0.04] hover:text-zinc-200",style:{paddingLeft:d},children:[y.jsx(Pw,{size:14,className:`shrink-0 transition-transform ${u?"rotate-90":""}`}),u?y.jsx(i4,{size:14,className:"shrink-0 text-zinc-500"}):y.jsx(o4,{size:14,className:"shrink-0 text-zinc-500"}),y.jsx("span",{className:"truncate",children:t.name})]}),u&&y.jsx("div",{children:t.children.map(p=>y.jsx(_M,{node:p,depth:e+1,selectedPage:r,expandedPaths:n,autoExpandedPaths:i,onToggle:a,onSelect:o},p.path))})]}):y.jsxs("button",{type:"button",onClick:()=>o(t.path),className:`flex w-full items-center gap-2 rounded-lg py-2 pr-3 text-left text-[11px] font-mono transition-colors ${l?"border-l-2 border-[#E43A9C] bg-[#E43A9C]/10 text-[#E43A9C]":"text-zinc-500 hover:bg-white/[0.04] hover:text-zinc-300"}`,style:{paddingLeft:d},children:[y.jsx(r4,{size:14,className:"shrink-0"}),y.jsx("span",{className:"truncate",children:t.name})]})}function qne(){const[t,e]=N.useState([]),[r,n]=N.useState(null),[i,a]=N.useState(""),[o,l]=N.useState(!1),[u,d]=N.useState(""),[p,f]=N.useState(""),[g,v]=N.useState(""),[x,_]=N.useState(new Set),[b,k]=N.useState(!1);N.useEffect(()=>{R()},[]);const A=N.useMemo(()=>Bne(t),[t]),O=g.trim().toLowerCase(),C=N.useMemo(()=>wM(A,O),[A,O]),E=N.useMemo(()=>{const U=O?ww(C):new Set;if(r)for(const G of Une(r))U.add(G);return U},[C,O,r]),T=r?(function U(G){for(const J of G){if(J.path===r)return J;const F=U(J.children);if(F)return F}return null})(C):null,P=(T==null?void 0:T.name)??(r?r.split("/").pop()??"":"");N.useEffect(()=>{const U=ww(A);_(G=>new Set([...G,...U]))},[A]);async function R(){try{const U=await et.get("/wiki/all");e(U.pages)}catch{e([])}}function I(U){if(U.startsWith("squads/")){const G=U.split("/"),J=G[1]??"",F=G.slice(2).join("/");return{scope:J,relativePath:F}}return U.startsWith("io/")?{scope:"io",relativePath:U.slice(3)}:U.startsWith("shared/")?{scope:"shared",relativePath:U.slice(7)}:{scope:"shared",relativePath:U}}async function Y(U){try{const{scope:G,relativePath:J}=I(U),F=await et.get(`/wiki/${G}/${J}`);a(F.content),d(F.content),n(U),l(!1)}catch{ft.error("Failed to load page")}}async function W(){if(r)try{const{scope:U,relativePath:G}=I(r);await et.put(`/wiki/${U}/${G}`,{content:u}),a(u),l(!1),ft.success("Page saved")}catch{ft.error("Failed to save page")}}async function B(){if(r)try{const{scope:U,relativePath:G}=I(r);await et.delete(`/wiki/${U}/${G}`),ft.success("Page deleted"),n(null),a(""),d(""),l(!1),R()}catch{ft.error("Failed to delete page")}}async function X(){let U=p.trim().replace(/^\/+|\/+$/g,"");if(!U)return;U=U.replace(/\.md$/i,"");const G=U.startsWith("io/")||U.startsWith("shared/")||U.startsWith("squads/")?U:`shared/${U}`;k(!0);try{const{scope:J,relativePath:F}=I(G),te=F.split("/").slice(-1)[0]??F;await et.put(`/wiki/${J}/${F}`,{content:`# ${te}
503
+
504
+ `}),ft.success("Page created"),f(""),await R(),await Y(G)}catch{ft.error("Failed to create page")}finally{k(!1)}}function K(U){_(G=>{const J=new Set(G);return J.has(U)?J.delete(U):J.add(U),J})}return y.jsxs("div",{className:"flex h-full",children:[y.jsxs("div",{className:"flex h-full w-64 flex-col border-r border-white/[0.07] bg-[#181818]",children:[y.jsx("div",{className:"border-b border-white/[0.07] p-3",children:y.jsxs("div",{className:"relative",children:[y.jsx(VP,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-zinc-600"}),y.jsx("input",{type:"text",value:g,onChange:U=>v(U.target.value),placeholder:"Search pages...",className:"w-full rounded-lg border border-white/[0.07] bg-white/[0.04] py-2 pl-8 pr-3 text-[11px] font-mono text-zinc-300 outline-none placeholder:text-zinc-700 focus:border-[#E43A9C]/50"})]})}),y.jsx("div",{className:"flex-1 overflow-y-auto px-2 py-3",children:C.length>0?C.map(U=>y.jsx(_M,{node:U,depth:0,selectedPage:r,expandedPaths:x,autoExpandedPaths:E,onToggle:K,onSelect:Y},U.path)):y.jsx("p",{className:"py-4 text-center font-mono text-[11px] text-zinc-700",children:"No pages found"})}),y.jsx("div",{className:"border-t border-white/[0.07] p-3",children:y.jsxs("div",{className:"space-y-2",children:[y.jsx("input",{type:"text",value:p,onChange:U=>f(U.target.value),onKeyDown:U=>{U.key==="Enter"&&X(),U.key==="Escape"&&f("")},placeholder:"folder/new-page",className:"w-full rounded-lg border border-white/[0.07] bg-white/[0.04] px-3 py-2 text-[11px] font-mono text-zinc-300 outline-none placeholder:text-zinc-700 focus:border-[#E43A9C]/50"}),y.jsx(Da,{onClick:X,disabled:!p.trim()||b,className:"w-full justify-center px-3 py-2",children:b?y.jsxs(y.Fragment,{children:[y.jsx(As,{size:13,className:"animate-spin"})," Creating..."]}):y.jsxs(y.Fragment,{children:[y.jsx(KP,{size:13})," Add Page"]})})]})})]}),y.jsx("div",{className:"flex flex-1 flex-col overflow-hidden",children:r?y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"flex h-14 shrink-0 items-center justify-between border-b border-white/[0.07] px-6",children:[y.jsxs("div",{className:"min-w-0",children:[y.jsx("h3",{className:"truncate font-mono text-sm text-zinc-100",children:P}),y.jsxs("p",{className:"truncate font-mono text-[11px] text-zinc-500",children:[r,".md"]})]}),y.jsxs("div",{className:"flex items-center gap-2",children:[o?y.jsxs(y.Fragment,{children:[y.jsxs(Da,{onClick:W,className:"px-3 py-1.5",children:[y.jsx(Nw,{size:12})," Save"]}),y.jsx(Wi,{onClick:()=>{l(!1),d(i)},className:"px-3 py-1.5",children:"Cancel"})]}):y.jsxs(Wi,{onClick:()=>{l(!0),d(i)},className:"px-3 py-1.5",children:[y.jsx(Mb,{size:12})," Edit"]}),y.jsxs(Ww,{onClick:B,className:"px-3 py-1.5",children:[y.jsx(Ms,{size:12})," Delete"]})]})]}),y.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:o?y.jsx("textarea",{value:u,onChange:U=>d(U.target.value),className:"h-full min-h-[320px] w-full resize-none rounded-xl border border-white/[0.07] bg-[#181818] p-4 font-mono text-sm text-zinc-300 outline-none focus:border-[#E43A9C]/50"}):y.jsx("div",{className:"mx-auto max-w-4xl",children:y.jsx("div",{className:"prose-io text-sm text-zinc-300",dangerouslySetInnerHTML:{__html:nt.parse(i)}})})})]}):y.jsx("div",{className:"flex h-full items-center justify-center",children:y.jsxs("div",{className:"text-center",children:[y.jsx(BP,{size:48,className:"mx-auto mb-3 text-zinc-800"}),y.jsx("p",{className:"font-mono text-[11px] text-zinc-700",children:"Select a page to view"})]})})})]})}function Fne({children:t}){const{session:e,supabase:r,loading:n}=rp();return n?y.jsx("div",{className:"min-h-screen flex items-center justify-center text-[var(--color-muted-foreground)]",children:"Loading..."}):r?e?y.jsx(y.Fragment,{children:t}):y.jsx(gq,{}):y.jsx(y.Fragment,{children:t})}function Hne(){const{pathname:t}=ti(),e=t==="/"||t==="/chat"||t.startsWith("/chat/");return y.jsxs(y.Fragment,{children:[y.jsx(fD,{children:y.jsxs(nn,{element:y.jsx(KU,{}),children:[y.jsx(nn,{index:!0,element:y.jsx(VU,{})}),y.jsx(nn,{path:"squads",element:y.jsx(jg,{})}),y.jsx(nn,{path:"squads/:name",element:y.jsx(jg,{})}),y.jsx(nn,{path:"squads/:name/instances/:instanceId",element:y.jsx(jg,{})}),y.jsx(nn,{path:"feed",element:y.jsx(mq,{})}),y.jsx(nn,{path:"skills",element:y.jsx(Aq,{})}),y.jsx(nn,{path:"schedules",element:y.jsx(bq,{})}),y.jsx(nn,{path:"wiki",element:y.jsx(qne,{})}),y.jsx(nn,{path:"settings",element:y.jsx(Sq,{})}),y.jsx(nn,{path:"usage",element:y.jsx(zne,{})}),y.jsx(nn,{path:"*",element:y.jsx(cD,{to:"/",replace:!0})})]})}),!e&&y.jsx(Xz,{})]})}function Wne(){return y.jsx(HU,{children:y.jsx(Fne,{children:y.jsx(Y4,{children:y.jsx(sz,{children:y.jsx(Hne,{})})})})})}cL.createRoot(document.getElementById("root")).render(y.jsx(N.StrictMode,{children:y.jsxs(MD,{children:[y.jsx(Wne,{}),y.jsx(b5,{theme:"dark",position:"bottom-right"})]})}));
505
+ //# sourceMappingURL=index-BJlurAmH.js.map