visual-forge-hub-test-env 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +9074 -9705
- package/dist/index.umd.js +72 -101
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,42 +1,13 @@
|
|
|
1
|
-
(function(Vr,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],x):(Vr=typeof globalThis<"u"?globalThis:Vr||self,x(Vr.VisualForgeHub={},Vr.React))})(this,function(Vr,x){"use strict";function xx(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}function Ox(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in t)){const a=Object.getOwnPropertyDescriptor(n,i);a&&Object.defineProperty(t,i,a.get?a:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const ve=xx(x);var Eo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function je(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function nh(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var Vu={exports:{}},Qi={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.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 ih;function Sx(){if(ih)return Qi;ih=1;var t=x,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(s,u,l){var c,f={},d=null,h=null;l!==void 0&&(d=""+l),u.key!==void 0&&(d=""+u.key),u.ref!==void 0&&(h=u.ref);for(c in u)n.call(u,c)&&!a.hasOwnProperty(c)&&(f[c]=u[c]);if(s&&s.defaultProps)for(c in u=s.defaultProps,u)f[c]===void 0&&(f[c]=u[c]);return{$$typeof:e,type:s,key:d,ref:h,props:f,_owner:i.current}}return Qi.Fragment=r,Qi.jsx=o,Qi.jsxs=o,Qi}var ea={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.development.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 ah;function Ax(){return ah||(ah=1,process.env.NODE_ENV!=="production"&&function(){var t=x,e=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),y=Symbol.iterator,v="@@iterator";function p(T){if(T===null||typeof T!="object")return null;var K=y&&T[y]||T[v];return typeof K=="function"?K:null}var m=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(T){{for(var K=arguments.length,X=new Array(K>1?K-1:0),de=1;de<K;de++)X[de-1]=arguments[de];w("error",T,X)}}function w(T,K,X){{var de=m.ReactDebugCurrentFrame,Te=de.getStackAddendum();Te!==""&&(K+="%s",X=X.concat([Te]));var Ce=X.map(function(me){return String(me)});Ce.unshift("Warning: "+K),Function.prototype.apply.call(console[T],console,Ce)}}var O=!1,g=!1,_=!1,S=!1,A=!1,E;E=Symbol.for("react.module.reference");function N(T){return!!(typeof T=="string"||typeof T=="function"||T===n||T===a||A||T===i||T===l||T===c||S||T===h||O||g||_||typeof T=="object"&&T!==null&&(T.$$typeof===d||T.$$typeof===f||T.$$typeof===o||T.$$typeof===s||T.$$typeof===u||T.$$typeof===E||T.getModuleId!==void 0))}function j(T,K,X){var de=T.displayName;if(de)return de;var Te=K.displayName||K.name||"";return Te!==""?X+"("+Te+")":X}function $(T){return T.displayName||"Context"}function k(T){if(T==null)return null;if(typeof T.tag=="number"&&b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof T=="function")return T.displayName||T.name||null;if(typeof T=="string")return T;switch(T){case n:return"Fragment";case r:return"Portal";case a:return"Profiler";case i:return"StrictMode";case l:return"Suspense";case c:return"SuspenseList"}if(typeof T=="object")switch(T.$$typeof){case s:var K=T;return $(K)+".Consumer";case o:var X=T;return $(X._context)+".Provider";case u:return j(T,T.render,"ForwardRef");case f:var de=T.displayName||null;return de!==null?de:k(T.type)||"Memo";case d:{var Te=T,Ce=Te._payload,me=Te._init;try{return k(me(Ce))}catch{return null}}}return null}var I=Object.assign,R=0,M,L,q,z,D,B,F;function G(){}G.__reactDisabledLog=!0;function J(){{if(R===0){M=console.log,L=console.info,q=console.warn,z=console.error,D=console.group,B=console.groupCollapsed,F=console.groupEnd;var T={configurable:!0,enumerable:!0,value:G,writable:!0};Object.defineProperties(console,{info:T,log:T,warn:T,error:T,group:T,groupCollapsed:T,groupEnd:T})}R++}}function re(){{if(R--,R===0){var T={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:I({},T,{value:M}),info:I({},T,{value:L}),warn:I({},T,{value:q}),error:I({},T,{value:z}),group:I({},T,{value:D}),groupCollapsed:I({},T,{value:B}),groupEnd:I({},T,{value:F})})}R<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ne=m.ReactCurrentDispatcher,ue;function oe(T,K,X){{if(ue===void 0)try{throw Error()}catch(Te){var de=Te.stack.trim().match(/\n( *(at )?)/);ue=de&&de[1]||""}return`
|
|
18
|
-
`+ue+T}}var W=!1,Y;{var te=typeof WeakMap=="function"?WeakMap:Map;Y=new te}function C(T,K){if(!T||W)return"";{var X=Y.get(T);if(X!==void 0)return X}var de;W=!0;var Te=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Ce;Ce=ne.current,ne.current=null,J();try{if(K){var me=function(){throw Error()};if(Object.defineProperty(me.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(me,[])}catch(bt){de=bt}Reflect.construct(T,[],me)}else{try{me.call()}catch(bt){de=bt}T.call(me.prototype)}}else{try{throw Error()}catch(bt){de=bt}T()}}catch(bt){if(bt&&de&&typeof bt.stack=="string"){for(var ge=bt.stack.split(`
|
|
19
|
-
`),vt=de.stack.split(`
|
|
20
|
-
`),ze=ge.length-1,Ye=vt.length-1;ze>=1&&Ye>=0&&ge[ze]!==vt[Ye];)Ye--;for(;ze>=1&&Ye>=0;ze--,Ye--)if(ge[ze]!==vt[Ye]){if(ze!==1||Ye!==1)do if(ze--,Ye--,Ye<0||ge[ze]!==vt[Ye]){var Bt=`
|
|
21
|
-
`+ge[ze].replace(" at new "," at ");return T.displayName&&Bt.includes("<anonymous>")&&(Bt=Bt.replace("<anonymous>",T.displayName)),typeof T=="function"&&Y.set(T,Bt),Bt}while(ze>=1&&Ye>=0);break}}}finally{W=!1,ne.current=Ce,re(),Error.prepareStackTrace=Te}var Zi=T?T.displayName||T.name:"",jn=Zi?oe(Zi):"";return typeof T=="function"&&Y.set(T,jn),jn}function ye(T,K,X){return C(T,!1)}function H(T){var K=T.prototype;return!!(K&&K.isReactComponent)}function _e(T,K,X){if(T==null)return"";if(typeof T=="function")return C(T,H(T));if(typeof T=="string")return oe(T);switch(T){case l:return oe("Suspense");case c:return oe("SuspenseList")}if(typeof T=="object")switch(T.$$typeof){case u:return ye(T.render);case f:return _e(T.type,K,X);case d:{var de=T,Te=de._payload,Ce=de._init;try{return _e(Ce(Te),K,X)}catch{}}}return""}var Ee=Object.prototype.hasOwnProperty,Ge={},Jt=m.ReactDebugCurrentFrame;function Zt(T){if(T){var K=T._owner,X=_e(T.type,T._source,K?K.type:null);Jt.setExtraStackFrame(X)}else Jt.setExtraStackFrame(null)}function Yi(T,K,X,de,Te){{var Ce=Function.call.bind(Ee);for(var me in T)if(Ce(T,me)){var ge=void 0;try{if(typeof T[me]!="function"){var vt=Error((de||"React class")+": "+X+" type `"+me+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof T[me]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw vt.name="Invariant Violation",vt}ge=T[me](K,me,de,X,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ze){ge=ze}ge&&!(ge instanceof Error)&&(Zt(Te),b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",de||"React class",X,me,typeof ge),Zt(null)),ge instanceof Error&&!(ge.message in Ge)&&(Ge[ge.message]=!0,Zt(Te),b("Failed %s type: %s",X,ge.message),Zt(null))}}}var Ar=Array.isArray;function jt(T){return Ar(T)}function So(T){{var K=typeof Symbol=="function"&&Symbol.toStringTag,X=K&&T[Symbol.toStringTag]||T.constructor.name||"Object";return X}}function Ao(T){try{return Xi(T),!1}catch{return!0}}function Xi(T){return""+T}function Po(T){if(Ao(T))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",So(T)),Xi(T)}var Kr=m.ReactCurrentOwner,v4={key:!0,ref:!0,__self:!0,__source:!0},hx,px,Zd;Zd={};function y4(T){if(Ee.call(T,"ref")){var K=Object.getOwnPropertyDescriptor(T,"ref").get;if(K&&K.isReactWarning)return!1}return T.ref!==void 0}function g4(T){if(Ee.call(T,"key")){var K=Object.getOwnPropertyDescriptor(T,"key").get;if(K&&K.isReactWarning)return!1}return T.key!==void 0}function m4(T,K){if(typeof T.ref=="string"&&Kr.current&&K&&Kr.current.stateNode!==K){var X=k(Kr.current.type);Zd[X]||(b('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',k(Kr.current.type),T.ref),Zd[X]=!0)}}function b4(T,K){{var X=function(){hx||(hx=!0,b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",K))};X.isReactWarning=!0,Object.defineProperty(T,"key",{get:X,configurable:!0})}}function w4(T,K){{var X=function(){px||(px=!0,b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",K))};X.isReactWarning=!0,Object.defineProperty(T,"ref",{get:X,configurable:!0})}}var _4=function(T,K,X,de,Te,Ce,me){var ge={$$typeof:e,type:T,key:K,ref:X,props:me,_owner:Ce};return ge._store={},Object.defineProperty(ge._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ge,"_self",{configurable:!1,enumerable:!1,writable:!1,value:de}),Object.defineProperty(ge,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Te}),Object.freeze&&(Object.freeze(ge.props),Object.freeze(ge)),ge};function x4(T,K,X,de,Te){{var Ce,me={},ge=null,vt=null;X!==void 0&&(Po(X),ge=""+X),g4(K)&&(Po(K.key),ge=""+K.key),y4(K)&&(vt=K.ref,m4(K,Te));for(Ce in K)Ee.call(K,Ce)&&!v4.hasOwnProperty(Ce)&&(me[Ce]=K[Ce]);if(T&&T.defaultProps){var ze=T.defaultProps;for(Ce in ze)me[Ce]===void 0&&(me[Ce]=ze[Ce])}if(ge||vt){var Ye=typeof T=="function"?T.displayName||T.name||"Unknown":T;ge&&b4(me,Ye),vt&&w4(me,Ye)}return _4(T,ge,vt,Te,de,Kr.current,me)}}var Qd=m.ReactCurrentOwner,vx=m.ReactDebugCurrentFrame;function Ji(T){if(T){var K=T._owner,X=_e(T.type,T._source,K?K.type:null);vx.setExtraStackFrame(X)}else vx.setExtraStackFrame(null)}var eh;eh=!1;function th(T){return typeof T=="object"&&T!==null&&T.$$typeof===e}function yx(){{if(Qd.current){var T=k(Qd.current.type);if(T)return`
|
|
22
|
-
|
|
23
|
-
Check the render method of \``+T+"`."}return""}}function O4(T){return""}var gx={};function S4(T){{var K=yx();if(!K){var X=typeof T=="string"?T:T.displayName||T.name;X&&(K=`
|
|
24
|
-
|
|
25
|
-
Check the top-level render call using <`+X+">.")}return K}}function mx(T,K){{if(!T._store||T._store.validated||T.key!=null)return;T._store.validated=!0;var X=S4(K);if(gx[X])return;gx[X]=!0;var de="";T&&T._owner&&T._owner!==Qd.current&&(de=" It was passed a child from "+k(T._owner.type)+"."),Ji(T),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',X,de),Ji(null)}}function bx(T,K){{if(typeof T!="object")return;if(jt(T))for(var X=0;X<T.length;X++){var de=T[X];th(de)&&mx(de,K)}else if(th(T))T._store&&(T._store.validated=!0);else if(T){var Te=p(T);if(typeof Te=="function"&&Te!==T.entries)for(var Ce=Te.call(T),me;!(me=Ce.next()).done;)th(me.value)&&mx(me.value,K)}}}function A4(T){{var K=T.type;if(K==null||typeof K=="string")return;var X;if(typeof K=="function")X=K.propTypes;else if(typeof K=="object"&&(K.$$typeof===u||K.$$typeof===f))X=K.propTypes;else return;if(X){var de=k(K);Yi(X,T.props,"prop",de,T)}else if(K.PropTypes!==void 0&&!eh){eh=!0;var Te=k(K);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Te||"Unknown")}typeof K.getDefaultProps=="function"&&!K.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function P4(T){{for(var K=Object.keys(T.props),X=0;X<K.length;X++){var de=K[X];if(de!=="children"&&de!=="key"){Ji(T),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",de),Ji(null);break}}T.ref!==null&&(Ji(T),b("Invalid attribute `ref` supplied to `React.Fragment`."),Ji(null))}}var wx={};function _x(T,K,X,de,Te,Ce){{var me=N(T);if(!me){var ge="";(T===void 0||typeof T=="object"&&T!==null&&Object.keys(T).length===0)&&(ge+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var vt=O4();vt?ge+=vt:ge+=yx();var ze;T===null?ze="null":jt(T)?ze="array":T!==void 0&&T.$$typeof===e?(ze="<"+(k(T.type)||"Unknown")+" />",ge=" Did you accidentally export a JSX literal instead of a component?"):ze=typeof T,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ze,ge)}var Ye=x4(T,K,X,Te,Ce);if(Ye==null)return Ye;if(me){var Bt=K.children;if(Bt!==void 0)if(de)if(jt(Bt)){for(var Zi=0;Zi<Bt.length;Zi++)bx(Bt[Zi],T);Object.freeze&&Object.freeze(Bt)}else b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else bx(Bt,T)}if(Ee.call(K,"key")){var jn=k(T),bt=Object.keys(K).filter(function(C4){return C4!=="key"}),rh=bt.length>0?"{key: someKey, "+bt.join(": ..., ")+": ...}":"{key: someKey}";if(!wx[jn+rh]){var k4=bt.length>0?"{"+bt.join(": ..., ")+": ...}":"{}";b(`A props object containing a "key" prop is being spread into JSX:
|
|
26
|
-
let props = %s;
|
|
27
|
-
<%s {...props} />
|
|
28
|
-
React keys must be passed directly to JSX without using spread:
|
|
29
|
-
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,rh,jn,k4,jn),wx[jn+rh]=!0}}return T===n?P4(Ye):A4(Ye),Ye}}function E4(T,K,X){return _x(T,K,X,!0)}function T4(T,K,X){return _x(T,K,X,!1)}var j4=T4,$4=E4;ea.Fragment=n,ea.jsx=j4,ea.jsxs=$4}()),ea}process.env.NODE_ENV==="production"?Vu.exports=Sx():Vu.exports=Ax();var P=Vu.exports,Hu=function(t,e){return Hu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Hu(t,e)};function oh(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Hu(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var To=function(){return To=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},To.apply(this,arguments)};function $n(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 sh(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a}function uh(t,e){return function(r,n){e(r,n,t)}}function lh(t,e,r,n,i,a){function o(m){if(m!==void 0&&typeof m!="function")throw new TypeError("Function expected");return m}for(var s=n.kind,u=s==="getter"?"get":s==="setter"?"set":"value",l=!e&&t?n.static?t:t.prototype:null,c=e||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),f,d=!1,h=r.length-1;h>=0;h--){var y={};for(var v in n)y[v]=v==="access"?{}:n[v];for(var v in n.access)y.access[v]=n.access[v];y.addInitializer=function(m){if(d)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(m||null))};var p=(0,r[h])(s==="accessor"?{get:c.get,set:c.set}:c[u],y);if(s==="accessor"){if(p===void 0)continue;if(p===null||typeof p!="object")throw new TypeError("Object expected");(f=o(p.get))&&(c.get=f),(f=o(p.set))&&(c.set=f),(f=o(p.init))&&i.unshift(f)}else(f=o(p))&&(s==="field"?i.unshift(f):c[u]=f)}l&&Object.defineProperty(l,n.name,c),d=!0}function ch(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0}function fh(t){return typeof t=="symbol"?t:"".concat(t)}function dh(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function hh(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function ee(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 s(c){try{l(n.next(c))}catch(f){o(f)}}function u(c){try{l(n.throw(c))}catch(f){o(f)}}function l(c){c.done?a(c.value):i(c.value).then(s,u)}l((n=n.apply(t,e||[])).next())})}function ph(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(l){return function(c){return u([l,c])}}function u(l){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(r=0)),r;)try{if(n=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){r.label=l[1];break}if(l[0]===6&&r.label<a[1]){r.label=a[1],a=l;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(l);break}a[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(c){l=[6,c],i=0}finally{n=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var jo=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};function vh(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&jo(e,t,r)}function $o(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Gu(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a}function yh(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Gu(arguments[e]));return t}function gh(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var a=arguments[e],o=0,s=a.length;o<s;o++,i++)n[i]=a[o];return n}function mh(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))}function kn(t){return this instanceof kn?(this.v=t,this):new kn(t)}function bh(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,a=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(h){return function(y){return Promise.resolve(y).then(h,f)}}function s(h,y){n[h]&&(i[h]=function(v){return new Promise(function(p,m){a.push([h,v,p,m])>1||u(h,v)})},y&&(i[h]=y(i[h])))}function u(h,y){try{l(n[h](y))}catch(v){d(a[0][3],v)}}function l(h){h.value instanceof kn?Promise.resolve(h.value.v).then(c,f):d(a[0][2],h)}function c(h){u("next",h)}function f(h){u("throw",h)}function d(h,y){h(y),a.shift(),a.length&&u(a[0][0],a[0][1])}}function wh(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,a){e[i]=t[i]?function(o){return(r=!r)?{value:kn(t[i](o)),done:!1}:a?a(o):o}:a}}function _h(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof $o=="function"?$o(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=t[a]&&function(o){return new Promise(function(s,u){o=t[a](o),i(s,u,o.done,o.value)})}}function i(a,o,s,u){Promise.resolve(u).then(function(l){a({value:l,done:s})},o)}}function xh(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var Px=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e},Yu=function(t){return Yu=Object.getOwnPropertyNames||function(e){var r=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[r.length]=n);return r},Yu(t)};function Oh(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=Yu(t),n=0;n<r.length;n++)r[n]!=="default"&&jo(e,t,r[n]);return Px(e,t),e}function Sh(t){return t&&t.__esModule?t:{default:t}}function Ah(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function Ph(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function Eh(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function Th(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n,i;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],r&&(i=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");i&&(n=function(){try{i.call(this)}catch(a){return Promise.reject(a)}}),t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}var Ex=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};function jh(t){function e(a){t.error=t.hasError?new Ex(a,t.error,"An error was suppressed during disposal."):a,t.hasError=!0}var r,n=0;function i(){for(;r=t.stack.pop();)try{if(!r.async&&n===1)return n=0,t.stack.push(r),Promise.resolve().then(i);if(r.dispose){var a=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(a).then(i,function(o){return e(o),i()})}else n|=1}catch(o){e(o)}if(n===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return i()}function $h(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,i,a,o){return n?e?".jsx":".js":i&&(!a||!o)?r:i+a+"."+o.toLowerCase()+"js"}):t}const Tx=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:Th,get __assign(){return To},__asyncDelegator:wh,__asyncGenerator:bh,__asyncValues:_h,__await:kn,__awaiter:ee,__classPrivateFieldGet:Ah,__classPrivateFieldIn:Eh,__classPrivateFieldSet:Ph,__createBinding:jo,__decorate:sh,__disposeResources:jh,__esDecorate:lh,__exportStar:vh,__extends:oh,__generator:ph,__importDefault:Sh,__importStar:Oh,__makeTemplateObject:xh,__metadata:hh,__param:uh,__propKey:fh,__read:Gu,__rest:$n,__rewriteRelativeImportExtension:$h,__runInitializers:ch,__setFunctionName:dh,__spread:yh,__spreadArray:mh,__spreadArrays:gh,__values:$o,default:{__extends:oh,__assign:To,__rest:$n,__decorate:sh,__param:uh,__esDecorate:lh,__runInitializers:ch,__propKey:fh,__setFunctionName:dh,__metadata:hh,__awaiter:ee,__generator:ph,__createBinding:jo,__exportStar:vh,__values:$o,__read:Gu,__spread:yh,__spreadArrays:gh,__spreadArray:mh,__await:kn,__asyncGenerator:bh,__asyncDelegator:wh,__asyncValues:_h,__makeTemplateObject:xh,__importStar:Oh,__importDefault:Sh,__classPrivateFieldGet:Ah,__classPrivateFieldSet:Ph,__classPrivateFieldIn:Eh,__addDisposableResource:Th,__disposeResources:jh,__rewriteRelativeImportExtension:$h}},Symbol.toStringTag,{value:"Module"})),jx=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>Hr).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};class Xu extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}}class kh extends Xu{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class Ch extends Xu{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class Ih extends Xu{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var Ju;(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"})(Ju||(Ju={}));class $x{constructor(e,{headers:r={},customFetch:n,region:i=Ju.Any}={}){this.url=e,this.headers=r,this.region=i,this.fetch=jx(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return ee(this,arguments,void 0,function*(r,n={}){var i;try{const{headers:a,method:o,body:s,signal:u}=n;let l={},{region:c}=n;c||(c=this.region);const f=new URL(`${this.url}/${r}`);c&&c!=="any"&&(l["x-region"]=c,f.searchParams.set("forceFunctionRegion",c));let d;s&&(a&&!Object.prototype.hasOwnProperty.call(a,"Content-Type")||!a)?typeof Blob<"u"&&s instanceof Blob||s instanceof ArrayBuffer?(l["Content-Type"]="application/octet-stream",d=s):typeof s=="string"?(l["Content-Type"]="text/plain",d=s):typeof FormData<"u"&&s instanceof FormData?d=s:(l["Content-Type"]="application/json",d=JSON.stringify(s)):d=s;const h=yield this.fetch(f.toString(),{method:o||"POST",headers:Object.assign(Object.assign(Object.assign({},l),this.headers),a),body:d,signal:u}).catch(m=>{throw m.name==="AbortError"?m:new kh(m)}),y=h.headers.get("x-relay-error");if(y&&y==="true")throw new Ch(h);if(!h.ok)throw new Ih(h);let v=((i=h.headers.get("Content-Type"))!==null&&i!==void 0?i:"text/plain").split(";")[0].trim(),p;return v==="application/json"?p=yield h.json():v==="application/octet-stream"||v==="application/pdf"?p=yield h.blob():v==="text/event-stream"?p=h:v==="multipart/form-data"?p=yield h.formData():p=yield h.text(),{data:p,error:null,response:h}}catch(a){return a instanceof Error&&a.name==="AbortError"?{data:null,error:new kh(a)}:{data:null,error:a,response:a instanceof Ih||a instanceof Ch?a.context:void 0}}})}}var ut={};const Cn=nh(Tx);var ko={},Co={},Io={},No={},Mo={},kx=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},In=kx();const Cx=In.fetch,Nh=In.fetch.bind(In),Mh=In.Headers,Ix=In.Request,Nx=In.Response,Hr=Object.freeze(Object.defineProperty({__proto__:null,Headers:Mh,Request:Ix,Response:Nx,default:Nh,fetch:Cx},Symbol.toStringTag,{value:"Module"})),Mx=nh(Hr);var Do={},Dh;function Rh(){if(Dh)return Do;Dh=1,Object.defineProperty(Do,"__esModule",{value:!0});class t extends Error{constructor(r){super(r.message),this.name="PostgrestError",this.details=r.details,this.hint=r.hint,this.code=r.code}}return Do.default=t,Do}var Lh;function Bh(){if(Lh)return Mo;Lh=1,Object.defineProperty(Mo,"__esModule",{value:!0});const t=Cn,e=t.__importDefault(Mx),r=t.__importDefault(Rh());class n{constructor(a){var o,s;this.shouldThrowOnError=!1,this.method=a.method,this.url=a.url,this.headers=new Headers(a.headers),this.schema=a.schema,this.body=a.body,this.shouldThrowOnError=(o=a.shouldThrowOnError)!==null&&o!==void 0?o:!1,this.signal=a.signal,this.isMaybeSingle=(s=a.isMaybeSingle)!==null&&s!==void 0?s:!1,a.fetch?this.fetch=a.fetch:typeof fetch>"u"?this.fetch=e.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(a,o){return this.headers=new Headers(this.headers),this.headers.set(a,o),this}then(a,o){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");const s=this.fetch;let u=s(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async l=>{var c,f,d,h;let y=null,v=null,p=null,m=l.status,b=l.statusText;if(l.ok){if(this.method!=="HEAD"){const _=await l.text();_===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&(!((c=this.headers.get("Accept"))===null||c===void 0)&&c.includes("application/vnd.pgrst.plan+text"))?v=_:v=JSON.parse(_))}const O=(f=this.headers.get("Prefer"))===null||f===void 0?void 0:f.match(/count=(exact|planned|estimated)/),g=(d=l.headers.get("content-range"))===null||d===void 0?void 0:d.split("/");O&&g&&g.length>1&&(p=parseInt(g[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(v)&&(v.length>1?(y={code:"PGRST116",details:`Results contain ${v.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},v=null,p=null,m=406,b="Not Acceptable"):v.length===1?v=v[0]:v=null)}else{const O=await l.text();try{y=JSON.parse(O),Array.isArray(y)&&l.status===404&&(v=[],y=null,m=200,b="OK")}catch{l.status===404&&O===""?(m=204,b="No Content"):y={message:O}}if(y&&this.isMaybeSingle&&(!((h=y==null?void 0:y.details)===null||h===void 0)&&h.includes("0 rows"))&&(y=null,m=200,b="OK"),y&&this.shouldThrowOnError)throw new r.default(y)}return{error:y,data:v,count:p,status:m,statusText:b}});return this.shouldThrowOnError||(u=u.catch(l=>{var c,f,d;return{error:{message:`${(c=l==null?void 0:l.name)!==null&&c!==void 0?c:"FetchError"}: ${l==null?void 0:l.message}`,details:`${(f=l==null?void 0:l.stack)!==null&&f!==void 0?f:""}`,hint:"",code:`${(d=l==null?void 0:l.code)!==null&&d!==void 0?d:""}`},data:null,count:null,status:0,statusText:""}})),u.then(a,o)}returns(){return this}overrideTypes(){return this}}return Mo.default=n,Mo}var Uh;function Fh(){if(Uh)return No;Uh=1,Object.defineProperty(No,"__esModule",{value:!0});const e=Cn.__importDefault(Bh());class r extends e.default{select(i){let a=!1;const o=(i??"*").split("").map(s=>/\s/.test(s)&&!a?"":(s==='"'&&(a=!a),s)).join("");return this.url.searchParams.set("select",o),this.headers.append("Prefer","return=representation"),this}order(i,{ascending:a=!0,nullsFirst:o,foreignTable:s,referencedTable:u=s}={}){const l=u?`${u}.order`:"order",c=this.url.searchParams.get(l);return this.url.searchParams.set(l,`${c?`${c},`:""}${i}.${a?"asc":"desc"}${o===void 0?"":o?".nullsfirst":".nullslast"}`),this}limit(i,{foreignTable:a,referencedTable:o=a}={}){const s=typeof o>"u"?"limit":`${o}.limit`;return this.url.searchParams.set(s,`${i}`),this}range(i,a,{foreignTable:o,referencedTable:s=o}={}){const u=typeof s>"u"?"offset":`${s}.offset`,l=typeof s>"u"?"limit":`${s}.limit`;return this.url.searchParams.set(u,`${i}`),this.url.searchParams.set(l,`${a-i+1}`),this}abortSignal(i){return this.signal=i,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),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:i=!1,verbose:a=!1,settings:o=!1,buffers:s=!1,wal:u=!1,format:l="text"}={}){var c;const f=[i?"analyze":null,a?"verbose":null,o?"settings":null,s?"buffers":null,u?"wal":null].filter(Boolean).join("|"),d=(c=this.headers.get("Accept"))!==null&&c!==void 0?c:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${l}; for="${d}"; options=${f};`),l==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(i){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${i}`),this}}return No.default=r,No}var Wh;function Zu(){if(Wh)return Io;Wh=1,Object.defineProperty(Io,"__esModule",{value:!0});const e=Cn.__importDefault(Fh()),r=new RegExp("[,()]");class n extends e.default{eq(a,o){return this.url.searchParams.append(a,`eq.${o}`),this}neq(a,o){return this.url.searchParams.append(a,`neq.${o}`),this}gt(a,o){return this.url.searchParams.append(a,`gt.${o}`),this}gte(a,o){return this.url.searchParams.append(a,`gte.${o}`),this}lt(a,o){return this.url.searchParams.append(a,`lt.${o}`),this}lte(a,o){return this.url.searchParams.append(a,`lte.${o}`),this}like(a,o){return this.url.searchParams.append(a,`like.${o}`),this}likeAllOf(a,o){return this.url.searchParams.append(a,`like(all).{${o.join(",")}}`),this}likeAnyOf(a,o){return this.url.searchParams.append(a,`like(any).{${o.join(",")}}`),this}ilike(a,o){return this.url.searchParams.append(a,`ilike.${o}`),this}ilikeAllOf(a,o){return this.url.searchParams.append(a,`ilike(all).{${o.join(",")}}`),this}ilikeAnyOf(a,o){return this.url.searchParams.append(a,`ilike(any).{${o.join(",")}}`),this}is(a,o){return this.url.searchParams.append(a,`is.${o}`),this}in(a,o){const s=Array.from(new Set(o)).map(u=>typeof u=="string"&&r.test(u)?`"${u}"`:`${u}`).join(",");return this.url.searchParams.append(a,`in.(${s})`),this}contains(a,o){return typeof o=="string"?this.url.searchParams.append(a,`cs.${o}`):Array.isArray(o)?this.url.searchParams.append(a,`cs.{${o.join(",")}}`):this.url.searchParams.append(a,`cs.${JSON.stringify(o)}`),this}containedBy(a,o){return typeof o=="string"?this.url.searchParams.append(a,`cd.${o}`):Array.isArray(o)?this.url.searchParams.append(a,`cd.{${o.join(",")}}`):this.url.searchParams.append(a,`cd.${JSON.stringify(o)}`),this}rangeGt(a,o){return this.url.searchParams.append(a,`sr.${o}`),this}rangeGte(a,o){return this.url.searchParams.append(a,`nxl.${o}`),this}rangeLt(a,o){return this.url.searchParams.append(a,`sl.${o}`),this}rangeLte(a,o){return this.url.searchParams.append(a,`nxr.${o}`),this}rangeAdjacent(a,o){return this.url.searchParams.append(a,`adj.${o}`),this}overlaps(a,o){return typeof o=="string"?this.url.searchParams.append(a,`ov.${o}`):this.url.searchParams.append(a,`ov.{${o.join(",")}}`),this}textSearch(a,o,{config:s,type:u}={}){let l="";u==="plain"?l="pl":u==="phrase"?l="ph":u==="websearch"&&(l="w");const c=s===void 0?"":`(${s})`;return this.url.searchParams.append(a,`${l}fts${c}.${o}`),this}match(a){return Object.entries(a).forEach(([o,s])=>{this.url.searchParams.append(o,`eq.${s}`)}),this}not(a,o,s){return this.url.searchParams.append(a,`not.${o}.${s}`),this}or(a,{foreignTable:o,referencedTable:s=o}={}){const u=s?`${s}.or`:"or";return this.url.searchParams.append(u,`(${a})`),this}filter(a,o,s){return this.url.searchParams.append(a,`${o}.${s}`),this}}return Io.default=n,Io}var qh;function zh(){if(qh)return Co;qh=1,Object.defineProperty(Co,"__esModule",{value:!0});const e=Cn.__importDefault(Zu());class r{constructor(i,{headers:a={},schema:o,fetch:s}){this.url=i,this.headers=new Headers(a),this.schema=o,this.fetch=s}select(i,a){const{head:o=!1,count:s}=a??{},u=o?"HEAD":"GET";let l=!1;const c=(i??"*").split("").map(f=>/\s/.test(f)&&!l?"":(f==='"'&&(l=!l),f)).join("");return this.url.searchParams.set("select",c),s&&this.headers.append("Prefer",`count=${s}`),new e.default({method:u,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(i,{count:a,defaultToNull:o=!0}={}){var s;const u="POST";if(a&&this.headers.append("Prefer",`count=${a}`),o||this.headers.append("Prefer","missing=default"),Array.isArray(i)){const l=i.reduce((c,f)=>c.concat(Object.keys(f)),[]);if(l.length>0){const c=[...new Set(l)].map(f=>`"${f}"`);this.url.searchParams.set("columns",c.join(","))}}return new e.default({method:u,url:this.url,headers:this.headers,schema:this.schema,body:i,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch})}upsert(i,{onConflict:a,ignoreDuplicates:o=!1,count:s,defaultToNull:u=!0}={}){var l;const c="POST";if(this.headers.append("Prefer",`resolution=${o?"ignore":"merge"}-duplicates`),a!==void 0&&this.url.searchParams.set("on_conflict",a),s&&this.headers.append("Prefer",`count=${s}`),u||this.headers.append("Prefer","missing=default"),Array.isArray(i)){const f=i.reduce((d,h)=>d.concat(Object.keys(h)),[]);if(f.length>0){const d=[...new Set(f)].map(h=>`"${h}"`);this.url.searchParams.set("columns",d.join(","))}}return new e.default({method:c,url:this.url,headers:this.headers,schema:this.schema,body:i,fetch:(l=this.fetch)!==null&&l!==void 0?l:fetch})}update(i,{count:a}={}){var o;const s="PATCH";return a&&this.headers.append("Prefer",`count=${a}`),new e.default({method:s,url:this.url,headers:this.headers,schema:this.schema,body:i,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}delete({count:i}={}){var a;const o="DELETE";return i&&this.headers.append("Prefer",`count=${i}`),new e.default({method:o,url:this.url,headers:this.headers,schema:this.schema,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch})}}return Co.default=r,Co}var Kh;function Dx(){if(Kh)return ko;Kh=1,Object.defineProperty(ko,"__esModule",{value:!0});const t=Cn,e=t.__importDefault(zh()),r=t.__importDefault(Zu());class n{constructor(a,{headers:o={},schema:s,fetch:u}={}){this.url=a,this.headers=new Headers(o),this.schemaName=s,this.fetch=u}from(a){const o=new URL(`${this.url}/${a}`);return new e.default(o,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(a){return new n(this.url,{headers:this.headers,schema:a,fetch:this.fetch})}rpc(a,o={},{head:s=!1,get:u=!1,count:l}={}){var c;let f;const d=new URL(`${this.url}/rpc/${a}`);let h;s||u?(f=s?"HEAD":"GET",Object.entries(o).filter(([v,p])=>p!==void 0).map(([v,p])=>[v,Array.isArray(p)?`{${p.join(",")}}`:`${p}`]).forEach(([v,p])=>{d.searchParams.append(v,p)})):(f="POST",h=o);const y=new Headers(this.headers);return l&&y.set("Prefer",`count=${l}`),new r.default({method:f,url:d,headers:y,schema:this.schemaName,body:h,fetch:(c=this.fetch)!==null&&c!==void 0?c:fetch})}}return ko.default=n,ko}Object.defineProperty(ut,"__esModule",{value:!0});var Vh=ut.PostgrestError=rp=ut.PostgrestBuilder=ep=ut.PostgrestTransformBuilder=Zh=ut.PostgrestFilterBuilder=Xh=ut.PostgrestQueryBuilder=Gh=ut.PostgrestClient=void 0;const Nn=Cn,Hh=Nn.__importDefault(Dx());var Gh=ut.PostgrestClient=Hh.default;const Yh=Nn.__importDefault(zh());var Xh=ut.PostgrestQueryBuilder=Yh.default;const Jh=Nn.__importDefault(Zu());var Zh=ut.PostgrestFilterBuilder=Jh.default;const Qh=Nn.__importDefault(Fh());var ep=ut.PostgrestTransformBuilder=Qh.default;const tp=Nn.__importDefault(Bh());var rp=ut.PostgrestBuilder=tp.default;const np=Nn.__importDefault(Rh());Vh=ut.PostgrestError=np.default;var ip=ut.default={PostgrestClient:Hh.default,PostgrestQueryBuilder:Yh.default,PostgrestFilterBuilder:Jh.default,PostgrestTransformBuilder:Qh.default,PostgrestBuilder:tp.default,PostgrestError:np.default};const Rx=Ox({__proto__:null,get PostgrestBuilder(){return rp},get PostgrestClient(){return Gh},get PostgrestError(){return Vh},get PostgrestFilterBuilder(){return Zh},get PostgrestQueryBuilder(){return Xh},get PostgrestTransformBuilder(){return ep},default:ip},[ut]),{PostgrestClient:Lx,PostgrestQueryBuilder:N4,PostgrestFilterBuilder:M4,PostgrestTransformBuilder:D4,PostgrestBuilder:R4,PostgrestError:L4}=ip||Rx;class Bx{static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.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"&&globalThis.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."};if(typeof process<"u"){const r=process.versions;if(r&&r.node){const n=r.node,i=parseInt(n.replace(/^v/,"").split(".")[0]);return i>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${i} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${i} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
|
|
1
|
+
(function(cr,P){typeof exports=="object"&&typeof module<"u"?P(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],P):(cr=typeof globalThis<"u"?globalThis:cr||self,P(cr.VisualForgeHub={},cr["react/jsx-runtime"],cr.React))})(this,function(cr,P,x){"use strict";function F_(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}function W_(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in t)){const a=Object.getOwnPropertyDescriptor(n,i);a&&Object.defineProperty(t,i,a.get?a:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const fe=F_(x);var Ol=function(t,e){return Ol=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Ol(t,e)};function kd(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Ol(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var ro=function(){return ro=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},ro.apply(this,arguments)};function pn(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 Cd(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a}function Id(t,e){return function(r,n){e(r,n,t)}}function Nd(t,e,r,n,i,a){function o(m){if(m!==void 0&&typeof m!="function")throw new TypeError("Function expected");return m}for(var s=n.kind,l=s==="getter"?"get":s==="setter"?"set":"value",u=!e&&t?n.static?t:t.prototype:null,c=e||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),f,d=!1,h=r.length-1;h>=0;h--){var y={};for(var v in n)y[v]=v==="access"?{}:n[v];for(var v in n.access)y.access[v]=n.access[v];y.addInitializer=function(m){if(d)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(m||null))};var p=(0,r[h])(s==="accessor"?{get:c.get,set:c.set}:c[l],y);if(s==="accessor"){if(p===void 0)continue;if(p===null||typeof p!="object")throw new TypeError("Object expected");(f=o(p.get))&&(c.get=f),(f=o(p.set))&&(c.set=f),(f=o(p.init))&&i.unshift(f)}else(f=o(p))&&(s==="field"?i.unshift(f):c[l]=f)}u&&Object.defineProperty(u,n.name,c),d=!0}function Md(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0}function Dd(t){return typeof t=="symbol"?t:"".concat(t)}function Ld(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function Bd(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function J(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 s(c){try{u(n.next(c))}catch(f){o(f)}}function l(c){try{u(n.throw(c))}catch(f){o(f)}}function u(c){c.done?a(c.value):i(c.value).then(s,l)}u((n=n.apply(t,e||[])).next())})}function Rd(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(u){return function(c){return l([u,c])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(r=0)),r;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(c){u=[6,c],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var no=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};function Ud(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&no(e,t,r)}function io(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Sl(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a}function Fd(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Sl(arguments[e]));return t}function Wd(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var a=arguments[e],o=0,s=a.length;o<s;o++,i++)n[i]=a[o];return n}function qd(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))}function vn(t){return this instanceof vn?(this.v=t,this):new vn(t)}function zd(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,a=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(h){return function(y){return Promise.resolve(y).then(h,f)}}function s(h,y){n[h]&&(i[h]=function(v){return new Promise(function(p,m){a.push([h,v,p,m])>1||l(h,v)})},y&&(i[h]=y(i[h])))}function l(h,y){try{u(n[h](y))}catch(v){d(a[0][3],v)}}function u(h){h.value instanceof vn?Promise.resolve(h.value.v).then(c,f):d(a[0][2],h)}function c(h){l("next",h)}function f(h){l("throw",h)}function d(h,y){h(y),a.shift(),a.length&&l(a[0][0],a[0][1])}}function Kd(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,a){e[i]=t[i]?function(o){return(r=!r)?{value:vn(t[i](o)),done:!1}:a?a(o):o}:a}}function Vd(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof io=="function"?io(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=t[a]&&function(o){return new Promise(function(s,l){o=t[a](o),i(s,l,o.done,o.value)})}}function i(a,o,s,l){Promise.resolve(l).then(function(u){a({value:u,done:s})},o)}}function Hd(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var q_=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e},Al=function(t){return Al=Object.getOwnPropertyNames||function(e){var r=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[r.length]=n);return r},Al(t)};function Gd(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=Al(t),n=0;n<r.length;n++)r[n]!=="default"&&no(e,t,r[n]);return q_(e,t),e}function Yd(t){return t&&t.__esModule?t:{default:t}}function Xd(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function Jd(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function Zd(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function Qd(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n,i;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],r&&(i=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");i&&(n=function(){try{i.call(this)}catch(a){return Promise.reject(a)}}),t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}var z_=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};function eh(t){function e(a){t.error=t.hasError?new z_(a,t.error,"An error was suppressed during disposal."):a,t.hasError=!0}var r,n=0;function i(){for(;r=t.stack.pop();)try{if(!r.async&&n===1)return n=0,t.stack.push(r),Promise.resolve().then(i);if(r.dispose){var a=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(a).then(i,function(o){return e(o),i()})}else n|=1}catch(o){e(o)}if(n===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return i()}function th(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,i,a,o){return n?e?".jsx":".js":i&&(!a||!o)?r:i+a+"."+o.toLowerCase()+"js"}):t}const K_=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:Qd,get __assign(){return ro},__asyncDelegator:Kd,__asyncGenerator:zd,__asyncValues:Vd,__await:vn,__awaiter:J,__classPrivateFieldGet:Xd,__classPrivateFieldIn:Zd,__classPrivateFieldSet:Jd,__createBinding:no,__decorate:Cd,__disposeResources:eh,__esDecorate:Nd,__exportStar:Ud,__extends:kd,__generator:Rd,__importDefault:Yd,__importStar:Gd,__makeTemplateObject:Hd,__metadata:Bd,__param:Id,__propKey:Dd,__read:Sl,__rest:pn,__rewriteRelativeImportExtension:th,__runInitializers:Md,__setFunctionName:Ld,__spread:Fd,__spreadArray:qd,__spreadArrays:Wd,__values:io,default:{__extends:kd,__assign:ro,__rest:pn,__decorate:Cd,__param:Id,__esDecorate:Nd,__runInitializers:Md,__propKey:Dd,__setFunctionName:Ld,__metadata:Bd,__awaiter:J,__generator:Rd,__createBinding:no,__exportStar:Ud,__values:io,__read:Sl,__spread:Fd,__spreadArrays:Wd,__spreadArray:qd,__await:vn,__asyncGenerator:zd,__asyncDelegator:Kd,__asyncValues:Vd,__makeTemplateObject:Hd,__importStar:Gd,__importDefault:Yd,__classPrivateFieldGet:Xd,__classPrivateFieldSet:Jd,__classPrivateFieldIn:Zd,__addDisposableResource:Qd,__disposeResources:eh,__rewriteRelativeImportExtension:th}},Symbol.toStringTag,{value:"Module"})),V_=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>kr).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};class Pl extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}}class rh extends Pl{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class nh extends Pl{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class ih extends Pl{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var El;(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"})(El||(El={}));class H_{constructor(e,{headers:r={},customFetch:n,region:i=El.Any}={}){this.url=e,this.headers=r,this.region=i,this.fetch=V_(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return J(this,arguments,void 0,function*(r,n={}){var i;try{const{headers:a,method:o,body:s,signal:l}=n;let u={},{region:c}=n;c||(c=this.region);const f=new URL(`${this.url}/${r}`);c&&c!=="any"&&(u["x-region"]=c,f.searchParams.set("forceFunctionRegion",c));let d;s&&(a&&!Object.prototype.hasOwnProperty.call(a,"Content-Type")||!a)?typeof Blob<"u"&&s instanceof Blob||s instanceof ArrayBuffer?(u["Content-Type"]="application/octet-stream",d=s):typeof s=="string"?(u["Content-Type"]="text/plain",d=s):typeof FormData<"u"&&s instanceof FormData?d=s:(u["Content-Type"]="application/json",d=JSON.stringify(s)):d=s;const h=yield this.fetch(f.toString(),{method:o||"POST",headers:Object.assign(Object.assign(Object.assign({},u),this.headers),a),body:d,signal:l}).catch(m=>{throw m.name==="AbortError"?m:new rh(m)}),y=h.headers.get("x-relay-error");if(y&&y==="true")throw new nh(h);if(!h.ok)throw new ih(h);let v=((i=h.headers.get("Content-Type"))!==null&&i!==void 0?i:"text/plain").split(";")[0].trim(),p;return v==="application/json"?p=yield h.json():v==="application/octet-stream"||v==="application/pdf"?p=yield h.blob():v==="text/event-stream"?p=h:v==="multipart/form-data"?p=yield h.formData():p=yield h.text(),{data:p,error:null,response:h}}catch(a){return a instanceof Error&&a.name==="AbortError"?{data:null,error:new rh(a)}:{data:null,error:a,response:a instanceof ih||a instanceof nh?a.context:void 0}}})}}var ao=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function we(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ah(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var Ze={};const yn=ah(K_);var oo={},so={},lo={},uo={},co={},G_=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},gn=G_();const Y_=gn.fetch,oh=gn.fetch.bind(gn),sh=gn.Headers,X_=gn.Request,J_=gn.Response,kr=Object.freeze(Object.defineProperty({__proto__:null,Headers:sh,Request:X_,Response:J_,default:oh,fetch:Y_},Symbol.toStringTag,{value:"Module"})),Z_=ah(kr);var fo={},lh;function uh(){if(lh)return fo;lh=1,Object.defineProperty(fo,"__esModule",{value:!0});class t extends Error{constructor(r){super(r.message),this.name="PostgrestError",this.details=r.details,this.hint=r.hint,this.code=r.code}}return fo.default=t,fo}var ch;function fh(){if(ch)return co;ch=1,Object.defineProperty(co,"__esModule",{value:!0});const t=yn,e=t.__importDefault(Z_),r=t.__importDefault(uh());class n{constructor(a){var o,s;this.shouldThrowOnError=!1,this.method=a.method,this.url=a.url,this.headers=new Headers(a.headers),this.schema=a.schema,this.body=a.body,this.shouldThrowOnError=(o=a.shouldThrowOnError)!==null&&o!==void 0?o:!1,this.signal=a.signal,this.isMaybeSingle=(s=a.isMaybeSingle)!==null&&s!==void 0?s:!1,a.fetch?this.fetch=a.fetch:typeof fetch>"u"?this.fetch=e.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(a,o){return this.headers=new Headers(this.headers),this.headers.set(a,o),this}then(a,o){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");const s=this.fetch;let l=s(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async u=>{var c,f,d,h;let y=null,v=null,p=null,m=u.status,w=u.statusText;if(u.ok){if(this.method!=="HEAD"){const _=await u.text();_===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&(!((c=this.headers.get("Accept"))===null||c===void 0)&&c.includes("application/vnd.pgrst.plan+text"))?v=_:v=JSON.parse(_))}const O=(f=this.headers.get("Prefer"))===null||f===void 0?void 0:f.match(/count=(exact|planned|estimated)/),g=(d=u.headers.get("content-range"))===null||d===void 0?void 0:d.split("/");O&&g&&g.length>1&&(p=parseInt(g[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(v)&&(v.length>1?(y={code:"PGRST116",details:`Results contain ${v.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},v=null,p=null,m=406,w="Not Acceptable"):v.length===1?v=v[0]:v=null)}else{const O=await u.text();try{y=JSON.parse(O),Array.isArray(y)&&u.status===404&&(v=[],y=null,m=200,w="OK")}catch{u.status===404&&O===""?(m=204,w="No Content"):y={message:O}}if(y&&this.isMaybeSingle&&(!((h=y==null?void 0:y.details)===null||h===void 0)&&h.includes("0 rows"))&&(y=null,m=200,w="OK"),y&&this.shouldThrowOnError)throw new r.default(y)}return{error:y,data:v,count:p,status:m,statusText:w}});return this.shouldThrowOnError||(l=l.catch(u=>{var c,f,d;return{error:{message:`${(c=u==null?void 0:u.name)!==null&&c!==void 0?c:"FetchError"}: ${u==null?void 0:u.message}`,details:`${(f=u==null?void 0:u.stack)!==null&&f!==void 0?f:""}`,hint:"",code:`${(d=u==null?void 0:u.code)!==null&&d!==void 0?d:""}`},data:null,count:null,status:0,statusText:""}})),l.then(a,o)}returns(){return this}overrideTypes(){return this}}return co.default=n,co}var dh;function hh(){if(dh)return uo;dh=1,Object.defineProperty(uo,"__esModule",{value:!0});const e=yn.__importDefault(fh());class r extends e.default{select(i){let a=!1;const o=(i??"*").split("").map(s=>/\s/.test(s)&&!a?"":(s==='"'&&(a=!a),s)).join("");return this.url.searchParams.set("select",o),this.headers.append("Prefer","return=representation"),this}order(i,{ascending:a=!0,nullsFirst:o,foreignTable:s,referencedTable:l=s}={}){const u=l?`${l}.order`:"order",c=this.url.searchParams.get(u);return this.url.searchParams.set(u,`${c?`${c},`:""}${i}.${a?"asc":"desc"}${o===void 0?"":o?".nullsfirst":".nullslast"}`),this}limit(i,{foreignTable:a,referencedTable:o=a}={}){const s=typeof o>"u"?"limit":`${o}.limit`;return this.url.searchParams.set(s,`${i}`),this}range(i,a,{foreignTable:o,referencedTable:s=o}={}){const l=typeof s>"u"?"offset":`${s}.offset`,u=typeof s>"u"?"limit":`${s}.limit`;return this.url.searchParams.set(l,`${i}`),this.url.searchParams.set(u,`${a-i+1}`),this}abortSignal(i){return this.signal=i,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),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:i=!1,verbose:a=!1,settings:o=!1,buffers:s=!1,wal:l=!1,format:u="text"}={}){var c;const f=[i?"analyze":null,a?"verbose":null,o?"settings":null,s?"buffers":null,l?"wal":null].filter(Boolean).join("|"),d=(c=this.headers.get("Accept"))!==null&&c!==void 0?c:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${u}; for="${d}"; options=${f};`),u==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(i){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${i}`),this}}return uo.default=r,uo}var ph;function Tl(){if(ph)return lo;ph=1,Object.defineProperty(lo,"__esModule",{value:!0});const e=yn.__importDefault(hh()),r=new RegExp("[,()]");class n extends e.default{eq(a,o){return this.url.searchParams.append(a,`eq.${o}`),this}neq(a,o){return this.url.searchParams.append(a,`neq.${o}`),this}gt(a,o){return this.url.searchParams.append(a,`gt.${o}`),this}gte(a,o){return this.url.searchParams.append(a,`gte.${o}`),this}lt(a,o){return this.url.searchParams.append(a,`lt.${o}`),this}lte(a,o){return this.url.searchParams.append(a,`lte.${o}`),this}like(a,o){return this.url.searchParams.append(a,`like.${o}`),this}likeAllOf(a,o){return this.url.searchParams.append(a,`like(all).{${o.join(",")}}`),this}likeAnyOf(a,o){return this.url.searchParams.append(a,`like(any).{${o.join(",")}}`),this}ilike(a,o){return this.url.searchParams.append(a,`ilike.${o}`),this}ilikeAllOf(a,o){return this.url.searchParams.append(a,`ilike(all).{${o.join(",")}}`),this}ilikeAnyOf(a,o){return this.url.searchParams.append(a,`ilike(any).{${o.join(",")}}`),this}is(a,o){return this.url.searchParams.append(a,`is.${o}`),this}in(a,o){const s=Array.from(new Set(o)).map(l=>typeof l=="string"&&r.test(l)?`"${l}"`:`${l}`).join(",");return this.url.searchParams.append(a,`in.(${s})`),this}contains(a,o){return typeof o=="string"?this.url.searchParams.append(a,`cs.${o}`):Array.isArray(o)?this.url.searchParams.append(a,`cs.{${o.join(",")}}`):this.url.searchParams.append(a,`cs.${JSON.stringify(o)}`),this}containedBy(a,o){return typeof o=="string"?this.url.searchParams.append(a,`cd.${o}`):Array.isArray(o)?this.url.searchParams.append(a,`cd.{${o.join(",")}}`):this.url.searchParams.append(a,`cd.${JSON.stringify(o)}`),this}rangeGt(a,o){return this.url.searchParams.append(a,`sr.${o}`),this}rangeGte(a,o){return this.url.searchParams.append(a,`nxl.${o}`),this}rangeLt(a,o){return this.url.searchParams.append(a,`sl.${o}`),this}rangeLte(a,o){return this.url.searchParams.append(a,`nxr.${o}`),this}rangeAdjacent(a,o){return this.url.searchParams.append(a,`adj.${o}`),this}overlaps(a,o){return typeof o=="string"?this.url.searchParams.append(a,`ov.${o}`):this.url.searchParams.append(a,`ov.{${o.join(",")}}`),this}textSearch(a,o,{config:s,type:l}={}){let u="";l==="plain"?u="pl":l==="phrase"?u="ph":l==="websearch"&&(u="w");const c=s===void 0?"":`(${s})`;return this.url.searchParams.append(a,`${u}fts${c}.${o}`),this}match(a){return Object.entries(a).forEach(([o,s])=>{this.url.searchParams.append(o,`eq.${s}`)}),this}not(a,o,s){return this.url.searchParams.append(a,`not.${o}.${s}`),this}or(a,{foreignTable:o,referencedTable:s=o}={}){const l=s?`${s}.or`:"or";return this.url.searchParams.append(l,`(${a})`),this}filter(a,o,s){return this.url.searchParams.append(a,`${o}.${s}`),this}}return lo.default=n,lo}var vh;function yh(){if(vh)return so;vh=1,Object.defineProperty(so,"__esModule",{value:!0});const e=yn.__importDefault(Tl());class r{constructor(i,{headers:a={},schema:o,fetch:s}){this.url=i,this.headers=new Headers(a),this.schema=o,this.fetch=s}select(i,a){const{head:o=!1,count:s}=a??{},l=o?"HEAD":"GET";let u=!1;const c=(i??"*").split("").map(f=>/\s/.test(f)&&!u?"":(f==='"'&&(u=!u),f)).join("");return this.url.searchParams.set("select",c),s&&this.headers.append("Prefer",`count=${s}`),new e.default({method:l,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(i,{count:a,defaultToNull:o=!0}={}){var s;const l="POST";if(a&&this.headers.append("Prefer",`count=${a}`),o||this.headers.append("Prefer","missing=default"),Array.isArray(i)){const u=i.reduce((c,f)=>c.concat(Object.keys(f)),[]);if(u.length>0){const c=[...new Set(u)].map(f=>`"${f}"`);this.url.searchParams.set("columns",c.join(","))}}return new e.default({method:l,url:this.url,headers:this.headers,schema:this.schema,body:i,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch})}upsert(i,{onConflict:a,ignoreDuplicates:o=!1,count:s,defaultToNull:l=!0}={}){var u;const c="POST";if(this.headers.append("Prefer",`resolution=${o?"ignore":"merge"}-duplicates`),a!==void 0&&this.url.searchParams.set("on_conflict",a),s&&this.headers.append("Prefer",`count=${s}`),l||this.headers.append("Prefer","missing=default"),Array.isArray(i)){const f=i.reduce((d,h)=>d.concat(Object.keys(h)),[]);if(f.length>0){const d=[...new Set(f)].map(h=>`"${h}"`);this.url.searchParams.set("columns",d.join(","))}}return new e.default({method:c,url:this.url,headers:this.headers,schema:this.schema,body:i,fetch:(u=this.fetch)!==null&&u!==void 0?u:fetch})}update(i,{count:a}={}){var o;const s="PATCH";return a&&this.headers.append("Prefer",`count=${a}`),new e.default({method:s,url:this.url,headers:this.headers,schema:this.schema,body:i,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}delete({count:i}={}){var a;const o="DELETE";return i&&this.headers.append("Prefer",`count=${i}`),new e.default({method:o,url:this.url,headers:this.headers,schema:this.schema,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch})}}return so.default=r,so}var gh;function Q_(){if(gh)return oo;gh=1,Object.defineProperty(oo,"__esModule",{value:!0});const t=yn,e=t.__importDefault(yh()),r=t.__importDefault(Tl());class n{constructor(a,{headers:o={},schema:s,fetch:l}={}){this.url=a,this.headers=new Headers(o),this.schemaName=s,this.fetch=l}from(a){const o=new URL(`${this.url}/${a}`);return new e.default(o,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(a){return new n(this.url,{headers:this.headers,schema:a,fetch:this.fetch})}rpc(a,o={},{head:s=!1,get:l=!1,count:u}={}){var c;let f;const d=new URL(`${this.url}/rpc/${a}`);let h;s||l?(f=s?"HEAD":"GET",Object.entries(o).filter(([v,p])=>p!==void 0).map(([v,p])=>[v,Array.isArray(p)?`{${p.join(",")}}`:`${p}`]).forEach(([v,p])=>{d.searchParams.append(v,p)})):(f="POST",h=o);const y=new Headers(this.headers);return u&&y.set("Prefer",`count=${u}`),new r.default({method:f,url:d,headers:y,schema:this.schemaName,body:h,fetch:(c=this.fetch)!==null&&c!==void 0?c:fetch})}}return oo.default=n,oo}Object.defineProperty(Ze,"__esModule",{value:!0});var mh=Ze.PostgrestError=Th=Ze.PostgrestBuilder=Ph=Ze.PostgrestTransformBuilder=Sh=Ze.PostgrestFilterBuilder=xh=Ze.PostgrestQueryBuilder=wh=Ze.PostgrestClient=void 0;const mn=yn,bh=mn.__importDefault(Q_());var wh=Ze.PostgrestClient=bh.default;const _h=mn.__importDefault(yh());var xh=Ze.PostgrestQueryBuilder=_h.default;const Oh=mn.__importDefault(Tl());var Sh=Ze.PostgrestFilterBuilder=Oh.default;const Ah=mn.__importDefault(hh());var Ph=Ze.PostgrestTransformBuilder=Ah.default;const Eh=mn.__importDefault(fh());var Th=Ze.PostgrestBuilder=Eh.default;const $h=mn.__importDefault(uh());mh=Ze.PostgrestError=$h.default;var jh=Ze.default={PostgrestClient:bh.default,PostgrestQueryBuilder:_h.default,PostgrestFilterBuilder:Oh.default,PostgrestTransformBuilder:Ah.default,PostgrestBuilder:Eh.default,PostgrestError:$h.default};const ex=W_({__proto__:null,get PostgrestBuilder(){return Th},get PostgrestClient(){return wh},get PostgrestError(){return mh},get PostgrestFilterBuilder(){return Sh},get PostgrestQueryBuilder(){return xh},get PostgrestTransformBuilder(){return Ph},default:jh},[Ze]),{PostgrestClient:tx,PostgrestQueryBuilder:I5,PostgrestFilterBuilder:N5,PostgrestTransformBuilder:M5,PostgrestBuilder:D5,PostgrestError:L5}=jh||ex;class rx{static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.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"&&globalThis.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."};if(typeof process<"u"){const r=process.versions;if(r&&r.node){const n=r.node,i=parseInt(n.replace(/^v/,"").split(".")[0]);return i>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${i} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${i} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
|
|
31
2
|
import ws from "ws"
|
|
32
3
|
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.constructor)return e.constructor;let r=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(r+=`
|
|
33
4
|
|
|
34
|
-
Suggested solution: ${e.workaround}`),new Error(r)}static createWebSocket(e,r){const n=this.getWebSocketConstructor();return new n(e,r)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const Ux="realtime-js/2.78.0",Fx="1.0.0",Qu=1e4,Wx=1e3,qx=100;var ta;(function(t){t[t.connecting=0]="connecting",t[t.open=1]="open",t[t.closing=2]="closing",t[t.closed=3]="closed"})(ta||(ta={}));var Xe;(function(t){t.closed="closed",t.errored="errored",t.joined="joined",t.joining="joining",t.leaving="leaving"})(Xe||(Xe={}));var Ut;(function(t){t.close="phx_close",t.error="phx_error",t.join="phx_join",t.reply="phx_reply",t.leave="phx_leave",t.access_token="access_token"})(Ut||(Ut={}));var el;(function(t){t.websocket="websocket"})(el||(el={}));var Gr;(function(t){t.Connecting="connecting",t.Open="open",t.Closing="closing",t.Closed="closed"})(Gr||(Gr={}));class zx{constructor(){this.HEADER_LENGTH=1}decode(e,r){return e.constructor===ArrayBuffer?r(this._binaryDecode(e)):r(typeof e=="string"?JSON.parse(e):{})}_binaryDecode(e){const r=new DataView(e),n=new TextDecoder;return this._decodeBroadcast(e,r,n)}_decodeBroadcast(e,r,n){const i=r.getUint8(1),a=r.getUint8(2);let o=this.HEADER_LENGTH+2;const s=n.decode(e.slice(o,o+i));o=o+i;const u=n.decode(e.slice(o,o+a));o=o+a;const l=JSON.parse(n.decode(e.slice(o,e.byteLength)));return{ref:null,topic:s,event:u,payload:l}}}class ap{constructor(e,r){this.callback=e,this.timerCalc=r,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=r}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var Ie;(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"})(Ie||(Ie={}));const op=(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]=Kx(o,t,e,i),a),{}):{}},Kx=(t,e,r,n)=>{const i=e.find(s=>s.name===t),a=i==null?void 0:i.type,o=r[t];return a&&!n.includes(a)?sp(a,o):tl(o)},sp=(t,e)=>{if(t.charAt(0)==="_"){const r=t.slice(1,t.length);return Yx(e,r)}switch(t){case Ie.bool:return Vx(e);case Ie.float4:case Ie.float8:case Ie.int2:case Ie.int4:case Ie.int8:case Ie.numeric:case Ie.oid:return Hx(e);case Ie.json:case Ie.jsonb:return Gx(e);case Ie.timestamp:return Xx(e);case Ie.abstime:case Ie.date:case Ie.daterange:case Ie.int4range:case Ie.int8range:case Ie.money:case Ie.reltime:case Ie.text:case Ie.time:case Ie.timestamptz:case Ie.timetz:case Ie.tsrange:case Ie.tstzrange:return tl(e);default:return tl(e)}},tl=t=>t,Vx=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},Hx=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},Gx=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch(e){return console.log(`JSON parse error: ${e}`),t}return t},Yx=(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(s=>sp(e,s))}return t},Xx=t=>typeof t=="string"?t.replace(" ","T"):t,up=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};class rl{constructor(e,r,n={},i=Qu){this.channel=e,this.event=r,this.payload=n,this.timeout=i,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,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()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,r){var n;return this._hasReceived(e)&&r((n=this.receivedResp)===null||n===void 0?void 0:n.response),this.recHooks.push({status:e,callback:r}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const e=r=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=r,this._matchReceive(r)};this.channel._on(this.refEvent,{},e),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(e,r){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:r})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:r}){this.recHooks.filter(n=>n.status===e).forEach(n=>n.callback(r))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}var lp;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(lp||(lp={}));class ra{constructor(e,r){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const n=(r==null?void 0:r.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(n.state,{},i=>{const{onJoin:a,onLeave:o,onSync:s}=this.caller;this.joinRef=this.channel._joinRef(),this.state=ra.syncState(this.state,i,a,o),this.pendingDiffs.forEach(u=>{this.state=ra.syncDiff(this.state,u,a,o)}),this.pendingDiffs=[],s()}),this.channel._on(n.diff,{},i=>{const{onJoin:a,onLeave:o,onSync:s}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(i):(this.state=ra.syncDiff(this.state,i,a,o),s())}),this.onJoin((i,a,o)=>{this.channel._trigger("presence",{event:"join",key:i,currentPresences:a,newPresences:o})}),this.onLeave((i,a,o)=>{this.channel._trigger("presence",{event:"leave",key:i,currentPresences:a,leftPresences:o})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,r,n,i){const a=this.cloneDeep(e),o=this.transformState(r),s={},u={};return this.map(a,(l,c)=>{o[l]||(u[l]=c)}),this.map(o,(l,c)=>{const f=a[l];if(f){const d=c.map(p=>p.presence_ref),h=f.map(p=>p.presence_ref),y=c.filter(p=>h.indexOf(p.presence_ref)<0),v=f.filter(p=>d.indexOf(p.presence_ref)<0);y.length>0&&(s[l]=y),v.length>0&&(u[l]=v)}else s[l]=c}),this.syncDiff(a,{joins:s,leaves:u},n,i)}static syncDiff(e,r,n,i){const{joins:a,leaves:o}={joins:this.transformState(r.joins),leaves:this.transformState(r.leaves)};return n||(n=()=>{}),i||(i=()=>{}),this.map(a,(s,u)=>{var l;const c=(l=e[s])!==null&&l!==void 0?l:[];if(e[s]=this.cloneDeep(u),c.length>0){const f=e[s].map(h=>h.presence_ref),d=c.filter(h=>f.indexOf(h.presence_ref)<0);e[s].unshift(...d)}n(s,c,u)}),this.map(o,(s,u)=>{let l=e[s];if(!l)return;const c=u.map(f=>f.presence_ref);l=l.filter(f=>c.indexOf(f.presence_ref)<0),e[s]=l,i(s,l,u),l.length===0&&delete e[s]}),e}static map(e,r){return Object.getOwnPropertyNames(e).map(n=>r(n,e[n]))}static transformState(e){return e=this.cloneDeep(e),Object.getOwnPropertyNames(e).reduce((r,n)=>{const i=e[n];return"metas"in i?r[n]=i.metas.map(a=>(a.presence_ref=a.phx_ref,delete a.phx_ref,delete a.phx_ref_prev,a)):r[n]=i,r},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var cp;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(cp||(cp={}));var na;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(na||(na={}));var sr;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(sr||(sr={}));class nl{constructor(e,r={config:{}},n){var i,a;if(this.topic=e,this.params=r,this.socket=n,this.bindings={},this.state=Xe.closed,this.joinedOnce=!1,this.pushBuffer=[],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.timeout=this.socket.timeout,this.joinPush=new rl(this,Ut.join,this.params,this.timeout),this.rejoinTimer=new ap(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Xe.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(o=>o.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Xe.closed,this.socket._remove(this)}),this._onError(o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=Xe.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Xe.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=Xe.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Ut.reply,{},(o,s)=>{this._trigger(this._replyEventName(s),o)}),this.presence=new ra(this),this.broadcastEndpointURL=up(this.socket.endPoint),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`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.state==Xe.closed){const{config:{broadcast:o,presence:s,private:u}}=this.params,l=(i=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(h=>h.filter))!==null&&i!==void 0?i:[],c=!!this.bindings[na.PRESENCE]&&this.bindings[na.PRESENCE].length>0||((a=this.params.config.presence)===null||a===void 0?void 0:a.enabled)===!0,f={},d={broadcast:o,presence:Object.assign(Object.assign({},s),{enabled:c}),postgres_changes:l,private:u};this.socket.accessTokenValue&&(f.access_token=this.socket.accessTokenValue),this._onError(h=>e==null?void 0:e(sr.CHANNEL_ERROR,h)),this._onClose(()=>e==null?void 0:e(sr.CLOSED)),this.updateJoinPayload(Object.assign({config:d},f)),this.joinedOnce=!0,this._rejoin(r),this.joinPush.receive("ok",async({postgres_changes:h})=>{var y;if(this.socket.setAuth(),h===void 0){e==null||e(sr.SUBSCRIBED);return}else{const v=this.bindings.postgres_changes,p=(y=v==null?void 0:v.length)!==null&&y!==void 0?y:0,m=[];for(let b=0;b<p;b++){const w=v[b],{filter:{event:O,schema:g,table:_,filter:S}}=w,A=h&&h[b];if(A&&A.event===O&&A.schema===g&&A.table===_&&A.filter===S)m.push(Object.assign(Object.assign({},w),{id:A.id}));else{this.unsubscribe(),this.state=Xe.errored,e==null||e(sr.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=m,e&&e(sr.SUBSCRIBED);return}}).receive("error",h=>{this.state=Xe.errored,e==null||e(sr.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(h).join(", ")||"error")))}).receive("timeout",()=>{e==null||e(sr.TIMED_OUT)})}return this}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){return this.state===Xe.joined&&e===na.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(()=>this.subscribe())),this._on(e,r,n)}async httpSend(e,r,n={}){var i;const a=this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"";if(r==null)return Promise.reject("Payload is required for httpSend()");const o={method:"POST",headers:{Authorization:a,apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:e,payload:r,private:this.private}]})},s=await this._fetchWithTimeout(this.broadcastEndpointURL,o,(i=n.timeout)!==null&&i!==void 0?i:this.timeout);if(s.status===202)return{success:!0};let u=s.statusText;try{const l=await s.json();u=l.error||l.message||u}catch{}return Promise.reject(new Error(u))}async send(e,r={}){var n,i;if(!this._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,u={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:a,payload:o,private:this.private}]})};try{const l=await this._fetchWithTimeout(this.broadcastEndpointURL,u,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((i=l.body)===null||i===void 0?void 0:i.cancel()),l.ok?"ok":"error"}catch(l){return l.name==="AbortError"?"timed out":"error"}}else return new Promise(a=>{var o,s,u;const l=this._push(e.type,e,r.timeout||this.timeout);e.type==="broadcast"&&!(!((u=(s=(o=this.params)===null||o===void 0?void 0:o.config)===null||s===void 0?void 0:s.broadcast)===null||u===void 0)&&u.ack)&&a("ok"),l.receive("ok",()=>a("ok")),l.receive("error",()=>a("error")),l.receive("timeout",()=>a("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=Xe.leaving;const r=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Ut.close,"leave",this._joinRef())};this.joinPush.destroy();let n=null;return new Promise(i=>{n=new rl(this,Ut.leave,{},e),n.receive("ok",()=>{r(),i("ok")}).receive("timeout",()=>{r(),i("timed out")}).receive("error",()=>{i("error")}),n.send(),this._canPush()||n.trigger("ok",{})}).finally(()=>{n==null||n.destroy()})}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Xe.closed,this.bindings={}}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}_push(e,r,n=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let i=new rl(this,e,r,n);return this._canPush()?i.send():this._addToPushBuffer(i),i}_addToPushBuffer(e){if(e.startTimeout(),this.pushBuffer.push(e),this.pushBuffer.length>qx){const r=this.pushBuffer.shift();r&&(r.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${r.event}`,r.payload))}}_onMessage(e,r,n){return r}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,r,n){var i,a;const o=e.toLocaleLowerCase(),{close:s,error:u,leave:l,join:c}=Ut;if(n&&[s,u,l,c].indexOf(o)>=0&&n!==this._joinRef())return;let d=this._onMessage(o,r,n);if(r&&!d)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?(i=this.bindings.postgres_changes)===null||i===void 0||i.filter(h=>{var y,v,p;return((y=h.filter)===null||y===void 0?void 0:y.event)==="*"||((p=(v=h.filter)===null||v===void 0?void 0:v.event)===null||p===void 0?void 0:p.toLocaleLowerCase())===o}).map(h=>h.callback(d,n)):(a=this.bindings[o])===null||a===void 0||a.filter(h=>{var y,v,p,m,b,w;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in h){const O=h.id,g=(y=h.filter)===null||y===void 0?void 0:y.event;return O&&((v=r.ids)===null||v===void 0?void 0:v.includes(O))&&(g==="*"||(g==null?void 0:g.toLocaleLowerCase())===((p=r.data)===null||p===void 0?void 0:p.type.toLocaleLowerCase()))}else{const O=(b=(m=h==null?void 0:h.filter)===null||m===void 0?void 0:m.event)===null||b===void 0?void 0:b.toLocaleLowerCase();return O==="*"||O===((w=r==null?void 0:r.event)===null||w===void 0?void 0:w.toLocaleLowerCase())}else return h.type.toLocaleLowerCase()===o}).map(h=>{if(typeof d=="object"&&"ids"in d){const y=d.data,{schema:v,table:p,commit_timestamp:m,type:b,errors:w}=y;d=Object.assign(Object.assign({},{schema:v,table:p,commit_timestamp:m,eventType:b,new:{},old:{},errors:w}),this._getPayloadRecords(y))}h.callback(d,n)})}_isClosed(){return this.state===Xe.closed}_isJoined(){return this.state===Xe.joined}_isJoining(){return this.state===Xe.joining}_isLeaving(){return this.state===Xe.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,r,n){const i=e.toLocaleLowerCase(),a={type:i,filter:r,callback:n};return this.bindings[i]?this.bindings[i].push(a):this.bindings[i]=[a],this}_off(e,r){const n=e.toLocaleLowerCase();return this.bindings[n]&&(this.bindings[n]=this.bindings[n].filter(i=>{var a;return!(((a=i.type)===null||a===void 0?void 0:a.toLocaleLowerCase())===n&&nl.isEqual(i.filter,r))})),this}static isEqual(e,r){if(Object.keys(e).length!==Object.keys(r).length)return!1;for(const n in e)if(e[n]!==r[n])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(Ut.close,{},e)}_onError(e){this._on(Ut.error,{},r=>e(r))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Xe.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const r={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(r.new=op(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(r.old=op(e.columns,e.old_record)),r}}const il=()=>{},Ro={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},Jx=[1e3,2e3,5e3,1e4],Zx=1e4,Qx=`
|
|
5
|
+
Suggested solution: ${e.workaround}`),new Error(r)}static createWebSocket(e,r){const n=this.getWebSocketConstructor();return new n(e,r)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const nx="realtime-js/2.78.0",ix="1.0.0",$l=1e4,ax=1e3,ox=100;var Ni;(function(t){t[t.connecting=0]="connecting",t[t.open=1]="open",t[t.closing=2]="closing",t[t.closed=3]="closed"})(Ni||(Ni={}));var Re;(function(t){t.closed="closed",t.errored="errored",t.joined="joined",t.joining="joining",t.leaving="leaving"})(Re||(Re={}));var Pt;(function(t){t.close="phx_close",t.error="phx_error",t.join="phx_join",t.reply="phx_reply",t.leave="phx_leave",t.access_token="access_token"})(Pt||(Pt={}));var jl;(function(t){t.websocket="websocket"})(jl||(jl={}));var Cr;(function(t){t.Connecting="connecting",t.Open="open",t.Closing="closing",t.Closed="closed"})(Cr||(Cr={}));class sx{constructor(){this.HEADER_LENGTH=1}decode(e,r){return e.constructor===ArrayBuffer?r(this._binaryDecode(e)):r(typeof e=="string"?JSON.parse(e):{})}_binaryDecode(e){const r=new DataView(e),n=new TextDecoder;return this._decodeBroadcast(e,r,n)}_decodeBroadcast(e,r,n){const i=r.getUint8(1),a=r.getUint8(2);let o=this.HEADER_LENGTH+2;const s=n.decode(e.slice(o,o+i));o=o+i;const l=n.decode(e.slice(o,o+a));o=o+a;const u=JSON.parse(n.decode(e.slice(o,e.byteLength)));return{ref:null,topic:s,event:l,payload:u}}}class kh{constructor(e,r){this.callback=e,this.timerCalc=r,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=r}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var Oe;(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"})(Oe||(Oe={}));const Ch=(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]=lx(o,t,e,i),a),{}):{}},lx=(t,e,r,n)=>{const i=e.find(s=>s.name===t),a=i==null?void 0:i.type,o=r[t];return a&&!n.includes(a)?Ih(a,o):kl(o)},Ih=(t,e)=>{if(t.charAt(0)==="_"){const r=t.slice(1,t.length);return dx(e,r)}switch(t){case Oe.bool:return ux(e);case Oe.float4:case Oe.float8:case Oe.int2:case Oe.int4:case Oe.int8:case Oe.numeric:case Oe.oid:return cx(e);case Oe.json:case Oe.jsonb:return fx(e);case Oe.timestamp:return hx(e);case Oe.abstime:case Oe.date:case Oe.daterange:case Oe.int4range:case Oe.int8range:case Oe.money:case Oe.reltime:case Oe.text:case Oe.time:case Oe.timestamptz:case Oe.timetz:case Oe.tsrange:case Oe.tstzrange:return kl(e);default:return kl(e)}},kl=t=>t,ux=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},cx=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},fx=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch(e){return console.log(`JSON parse error: ${e}`),t}return t},dx=(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(s=>Ih(e,s))}return t},hx=t=>typeof t=="string"?t.replace(" ","T"):t,Nh=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};class Cl{constructor(e,r,n={},i=$l){this.channel=e,this.event=r,this.payload=n,this.timeout=i,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,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()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,r){var n;return this._hasReceived(e)&&r((n=this.receivedResp)===null||n===void 0?void 0:n.response),this.recHooks.push({status:e,callback:r}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const e=r=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=r,this._matchReceive(r)};this.channel._on(this.refEvent,{},e),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(e,r){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:r})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:r}){this.recHooks.filter(n=>n.status===e).forEach(n=>n.callback(r))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}var Mh;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(Mh||(Mh={}));class Mi{constructor(e,r){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const n=(r==null?void 0:r.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(n.state,{},i=>{const{onJoin:a,onLeave:o,onSync:s}=this.caller;this.joinRef=this.channel._joinRef(),this.state=Mi.syncState(this.state,i,a,o),this.pendingDiffs.forEach(l=>{this.state=Mi.syncDiff(this.state,l,a,o)}),this.pendingDiffs=[],s()}),this.channel._on(n.diff,{},i=>{const{onJoin:a,onLeave:o,onSync:s}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(i):(this.state=Mi.syncDiff(this.state,i,a,o),s())}),this.onJoin((i,a,o)=>{this.channel._trigger("presence",{event:"join",key:i,currentPresences:a,newPresences:o})}),this.onLeave((i,a,o)=>{this.channel._trigger("presence",{event:"leave",key:i,currentPresences:a,leftPresences:o})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,r,n,i){const a=this.cloneDeep(e),o=this.transformState(r),s={},l={};return this.map(a,(u,c)=>{o[u]||(l[u]=c)}),this.map(o,(u,c)=>{const f=a[u];if(f){const d=c.map(p=>p.presence_ref),h=f.map(p=>p.presence_ref),y=c.filter(p=>h.indexOf(p.presence_ref)<0),v=f.filter(p=>d.indexOf(p.presence_ref)<0);y.length>0&&(s[u]=y),v.length>0&&(l[u]=v)}else s[u]=c}),this.syncDiff(a,{joins:s,leaves:l},n,i)}static syncDiff(e,r,n,i){const{joins:a,leaves:o}={joins:this.transformState(r.joins),leaves:this.transformState(r.leaves)};return n||(n=()=>{}),i||(i=()=>{}),this.map(a,(s,l)=>{var u;const c=(u=e[s])!==null&&u!==void 0?u:[];if(e[s]=this.cloneDeep(l),c.length>0){const f=e[s].map(h=>h.presence_ref),d=c.filter(h=>f.indexOf(h.presence_ref)<0);e[s].unshift(...d)}n(s,c,l)}),this.map(o,(s,l)=>{let u=e[s];if(!u)return;const c=l.map(f=>f.presence_ref);u=u.filter(f=>c.indexOf(f.presence_ref)<0),e[s]=u,i(s,u,l),u.length===0&&delete e[s]}),e}static map(e,r){return Object.getOwnPropertyNames(e).map(n=>r(n,e[n]))}static transformState(e){return e=this.cloneDeep(e),Object.getOwnPropertyNames(e).reduce((r,n)=>{const i=e[n];return"metas"in i?r[n]=i.metas.map(a=>(a.presence_ref=a.phx_ref,delete a.phx_ref,delete a.phx_ref_prev,a)):r[n]=i,r},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var Dh;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(Dh||(Dh={}));var Di;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(Di||(Di={}));var Kt;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(Kt||(Kt={}));class Il{constructor(e,r={config:{}},n){var i,a;if(this.topic=e,this.params=r,this.socket=n,this.bindings={},this.state=Re.closed,this.joinedOnce=!1,this.pushBuffer=[],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.timeout=this.socket.timeout,this.joinPush=new Cl(this,Pt.join,this.params,this.timeout),this.rejoinTimer=new kh(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Re.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(o=>o.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Re.closed,this.socket._remove(this)}),this._onError(o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=Re.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Re.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=Re.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Pt.reply,{},(o,s)=>{this._trigger(this._replyEventName(s),o)}),this.presence=new Mi(this),this.broadcastEndpointURL=Nh(this.socket.endPoint),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`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.state==Re.closed){const{config:{broadcast:o,presence:s,private:l}}=this.params,u=(i=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(h=>h.filter))!==null&&i!==void 0?i:[],c=!!this.bindings[Di.PRESENCE]&&this.bindings[Di.PRESENCE].length>0||((a=this.params.config.presence)===null||a===void 0?void 0:a.enabled)===!0,f={},d={broadcast:o,presence:Object.assign(Object.assign({},s),{enabled:c}),postgres_changes:u,private:l};this.socket.accessTokenValue&&(f.access_token=this.socket.accessTokenValue),this._onError(h=>e==null?void 0:e(Kt.CHANNEL_ERROR,h)),this._onClose(()=>e==null?void 0:e(Kt.CLOSED)),this.updateJoinPayload(Object.assign({config:d},f)),this.joinedOnce=!0,this._rejoin(r),this.joinPush.receive("ok",async({postgres_changes:h})=>{var y;if(this.socket.setAuth(),h===void 0){e==null||e(Kt.SUBSCRIBED);return}else{const v=this.bindings.postgres_changes,p=(y=v==null?void 0:v.length)!==null&&y!==void 0?y:0,m=[];for(let w=0;w<p;w++){const b=v[w],{filter:{event:O,schema:g,table:_,filter:S}}=b,A=h&&h[w];if(A&&A.event===O&&A.schema===g&&A.table===_&&A.filter===S)m.push(Object.assign(Object.assign({},b),{id:A.id}));else{this.unsubscribe(),this.state=Re.errored,e==null||e(Kt.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=m,e&&e(Kt.SUBSCRIBED);return}}).receive("error",h=>{this.state=Re.errored,e==null||e(Kt.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(h).join(", ")||"error")))}).receive("timeout",()=>{e==null||e(Kt.TIMED_OUT)})}return this}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){return this.state===Re.joined&&e===Di.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(()=>this.subscribe())),this._on(e,r,n)}async httpSend(e,r,n={}){var i;const a=this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"";if(r==null)return Promise.reject("Payload is required for httpSend()");const o={method:"POST",headers:{Authorization:a,apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:e,payload:r,private:this.private}]})},s=await this._fetchWithTimeout(this.broadcastEndpointURL,o,(i=n.timeout)!==null&&i!==void 0?i:this.timeout);if(s.status===202)return{success:!0};let l=s.statusText;try{const u=await s.json();l=u.error||u.message||l}catch{}return Promise.reject(new Error(l))}async send(e,r={}){var n,i;if(!this._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={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:a,payload:o,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((i=u.body)===null||i===void 0?void 0:i.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(a=>{var o,s,l;const u=this._push(e.type,e,r.timeout||this.timeout);e.type==="broadcast"&&!(!((l=(s=(o=this.params)===null||o===void 0?void 0:o.config)===null||s===void 0?void 0:s.broadcast)===null||l===void 0)&&l.ack)&&a("ok"),u.receive("ok",()=>a("ok")),u.receive("error",()=>a("error")),u.receive("timeout",()=>a("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=Re.leaving;const r=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Pt.close,"leave",this._joinRef())};this.joinPush.destroy();let n=null;return new Promise(i=>{n=new Cl(this,Pt.leave,{},e),n.receive("ok",()=>{r(),i("ok")}).receive("timeout",()=>{r(),i("timed out")}).receive("error",()=>{i("error")}),n.send(),this._canPush()||n.trigger("ok",{})}).finally(()=>{n==null||n.destroy()})}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Re.closed,this.bindings={}}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}_push(e,r,n=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let i=new Cl(this,e,r,n);return this._canPush()?i.send():this._addToPushBuffer(i),i}_addToPushBuffer(e){if(e.startTimeout(),this.pushBuffer.push(e),this.pushBuffer.length>ox){const r=this.pushBuffer.shift();r&&(r.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${r.event}`,r.payload))}}_onMessage(e,r,n){return r}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,r,n){var i,a;const o=e.toLocaleLowerCase(),{close:s,error:l,leave:u,join:c}=Pt;if(n&&[s,l,u,c].indexOf(o)>=0&&n!==this._joinRef())return;let d=this._onMessage(o,r,n);if(r&&!d)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?(i=this.bindings.postgres_changes)===null||i===void 0||i.filter(h=>{var y,v,p;return((y=h.filter)===null||y===void 0?void 0:y.event)==="*"||((p=(v=h.filter)===null||v===void 0?void 0:v.event)===null||p===void 0?void 0:p.toLocaleLowerCase())===o}).map(h=>h.callback(d,n)):(a=this.bindings[o])===null||a===void 0||a.filter(h=>{var y,v,p,m,w,b;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in h){const O=h.id,g=(y=h.filter)===null||y===void 0?void 0:y.event;return O&&((v=r.ids)===null||v===void 0?void 0:v.includes(O))&&(g==="*"||(g==null?void 0:g.toLocaleLowerCase())===((p=r.data)===null||p===void 0?void 0:p.type.toLocaleLowerCase()))}else{const O=(w=(m=h==null?void 0:h.filter)===null||m===void 0?void 0:m.event)===null||w===void 0?void 0:w.toLocaleLowerCase();return O==="*"||O===((b=r==null?void 0:r.event)===null||b===void 0?void 0:b.toLocaleLowerCase())}else return h.type.toLocaleLowerCase()===o}).map(h=>{if(typeof d=="object"&&"ids"in d){const y=d.data,{schema:v,table:p,commit_timestamp:m,type:w,errors:b}=y;d=Object.assign(Object.assign({},{schema:v,table:p,commit_timestamp:m,eventType:w,new:{},old:{},errors:b}),this._getPayloadRecords(y))}h.callback(d,n)})}_isClosed(){return this.state===Re.closed}_isJoined(){return this.state===Re.joined}_isJoining(){return this.state===Re.joining}_isLeaving(){return this.state===Re.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,r,n){const i=e.toLocaleLowerCase(),a={type:i,filter:r,callback:n};return this.bindings[i]?this.bindings[i].push(a):this.bindings[i]=[a],this}_off(e,r){const n=e.toLocaleLowerCase();return this.bindings[n]&&(this.bindings[n]=this.bindings[n].filter(i=>{var a;return!(((a=i.type)===null||a===void 0?void 0:a.toLocaleLowerCase())===n&&Il.isEqual(i.filter,r))})),this}static isEqual(e,r){if(Object.keys(e).length!==Object.keys(r).length)return!1;for(const n in e)if(e[n]!==r[n])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(Pt.close,{},e)}_onError(e){this._on(Pt.error,{},r=>e(r))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Re.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const r={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(r.new=Ch(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(r.old=Ch(e.columns,e.old_record)),r}}const Nl=()=>{},ho={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},px=[1e3,2e3,5e3,1e4],vx=1e4,yx=`
|
|
35
6
|
addEventListener("message", (e) => {
|
|
36
7
|
if (e.data.event === "start") {
|
|
37
8
|
setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
|
|
38
9
|
}
|
|
39
|
-
});`;class
|
|
10
|
+
});`;class gx{constructor(e,r){var n;if(this.accessTokenValue=null,this.apiKey=null,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=$l,this.transport=null,this.heartbeatIntervalMs=ho.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=Nl,this.ref=0,this.reconnectTimer=null,this.logger=Nl,this.conn=null,this.sendBuffer=[],this.serializer=new sx,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._resolveFetch=i=>{let a;return i?a=i:typeof fetch>"u"?a=(...o)=>Promise.resolve().then(()=>kr).then(({default:s})=>s(...o)).catch(s=>{throw new Error(`Failed to load @supabase/node-fetch: ${s.message}. This is required for HTTP requests in Node.js environments without native fetch.`)}):a=fetch,(...o)=>a(...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,this.endPoint=`${e}/${jl.websocket}`,this.httpEndpoint=Nh(e),this._initializeOptions(r),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=rx.createWebSocket(this.endpointURL())}catch(e){this._setConnectionState("disconnected");const r=e.message;throw r.includes("Node.js")?new Error(`${r}
|
|
40
11
|
|
|
41
12
|
To use Realtime in Node.js, you need to provide a WebSocket implementation:
|
|
42
13
|
|
|
@@ -49,9 +20,9 @@ Option 2: Install and provide the "ws" package:
|
|
|
49
20
|
const client = new RealtimeClient(url, {
|
|
50
21
|
...options,
|
|
51
22
|
transport: ws
|
|
52
|
-
})`):new Error(`WebSocket not available: ${r}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:Fx}))}disconnect(e,r){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const n=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(n),this._setConnectionState("disconnected")},e?this.conn.close(e,r??""):this.conn.close(),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(e){const r=await e.unsubscribe();return this.channels.length===0&&this.disconnect(),r}async removeAllChannels(){const e=await Promise.all(this.channels.map(r=>r.unsubscribe()));return this.channels=[],this.disconnect(),e}log(e,r,n){this.logger(e,r,n)}connectionState(){switch(this.conn&&this.conn.readyState){case ta.connecting:return Gr.Connecting;case ta.open:return Gr.Open;case ta.closing:return Gr.Closing;default:return Gr.Closed}}isConnected(){return this.connectionState()===Gr.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(e,r={config:{}}){const n=`realtime:${e}`,i=this.getChannels().find(a=>a.topic===n);if(i)return i;{const a=new nl(`realtime:${e}`,r,this);return this.channels.push(a),a}}push(e){const{topic:r,event:n,payload:i,ref:a}=e,o=()=>{this.encode(e,s=>{var u;(u=this.conn)===null||u===void 0||u.send(s)})};this.log("push",`${r} ${n} (${a})`,i),this.isConnected()?o():this.sendBuffer.push(o)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}async sendHeartbeat(){var e;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(r){this.log("error","error in heartbeat callback",r)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(r){this.log("error","error in heartbeat callback",r)}this._wasManualDisconnect=!1,(e=this.conn)===null||e===void 0||e.close(Wx,"heartbeat timeout"),setTimeout(()=>{var r;this.isConnected()||(r=this.reconnectTimer)===null||r===void 0||r.scheduleTimeout()},Ro.HEARTBEAT_TIMEOUT_FALLBACK);return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(r){this.log("error","error in heartbeat callback",r)}this._setAuthSafely("heartbeat")}onHeartbeat(e){this.heartbeatCallback=e}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let r=this.channels.find(n=>n.topic===e&&(n._isJoined()||n._isJoining()));r&&(this.log("transport",`leaving duplicate topic "${e}"`),r.unsubscribe())}_remove(e){this.channels=this.channels.filter(r=>r.topic!==e.topic)}_onConnMessage(e){this.decode(e.data,r=>{if(r.topic==="phoenix"&&r.event==="phx_reply")try{this.heartbeatCallback(r.payload.status==="ok"?"ok":"error")}catch(l){this.log("error","error in heartbeat callback",l)}r.ref&&r.ref===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null);const{topic:n,event:i,payload:a,ref:o}=r,s=o?`(${o})`:"",u=a.status||"";this.log("receive",`${u} ${n} ${i} ${s}`.trim(),a),this.channels.filter(l=>l._isMember(n)).forEach(l=>l._trigger(i,a,o)),this._triggerStateCallbacks("message",r)})}_clearTimer(e){var r;e==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):e==="reconnect"&&((r=this.reconnectTimer)===null||r===void 0||r.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),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))}_teardownConnection(){this.conn&&(this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null),this._clearAllTimers(),this.channels.forEach(e=>e.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_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.workerRef.terminate()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_onConnClose(e){var r;this._setConnectionState("disconnected"),this.log("transport","close",e),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(r=this.reconnectTimer)===null||r===void 0||r.scheduleTimeout(),this._triggerStateCallbacks("close",e)}_onConnError(e){this._setConnectionState("disconnected"),this.log("transport",`${e}`),this._triggerChanError(),this._triggerStateCallbacks("error",e)}_triggerChanError(){this.channels.forEach(e=>e._trigger(Ut.error))}_appendParams(e,r){if(Object.keys(r).length===0)return e;const n=e.match(/\?/)?"&":"?",i=new URLSearchParams(r);return`${e}${n}${i}`}_workerObjectUrl(e){let r;if(e)r=e;else{const n=new Blob([Qx],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_setConnectionState(e,r=!1){this._connectionState=e,e==="connecting"?this._wasManualDisconnect=!1:e==="disconnecting"&&(this._wasManualDisconnect=r)}async _performAuth(e=null){let r;e?r=e:this.accessToken?r=await this.accessToken():r=this.accessTokenValue,this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(n=>{const i={access_token:r,version:Ux};r&&n.updateJoinPayload(i),n.joinedOnce&&n._isJoined()&&n._push(Ut.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this.setAuth().catch(r=>{this.log("error",`error setting auth in ${e}`,r)})}_triggerStateCallbacks(e,r){try{this.stateChangeCallbacks[e].forEach(n=>{try{n(r)}catch(i){this.log("error",`error in ${e} callback`,i)}})}catch(n){this.log("error",`error triggering ${e} callbacks`,n)}}_setupReconnectionTimer(){this.reconnectTimer=new ap(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},Ro.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(e){var r,n,i,a,o,s,u,l,c;if(this.transport=(r=e==null?void 0:e.transport)!==null&&r!==void 0?r:null,this.timeout=(n=e==null?void 0:e.timeout)!==null&&n!==void 0?n:Qu,this.heartbeatIntervalMs=(i=e==null?void 0:e.heartbeatIntervalMs)!==null&&i!==void 0?i:Ro.HEARTBEAT_INTERVAL,this.worker=(a=e==null?void 0:e.worker)!==null&&a!==void 0?a:!1,this.accessToken=(o=e==null?void 0:e.accessToken)!==null&&o!==void 0?o:null,this.heartbeatCallback=(s=e==null?void 0:e.heartbeatCallback)!==null&&s!==void 0?s:il,e!=null&&e.params&&(this.params=e.params),e!=null&&e.logger&&(this.logger=e.logger),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(u=e==null?void 0:e.reconnectAfterMs)!==null&&u!==void 0?u:f=>Jx[f-1]||Zx,this.encode=(l=e==null?void 0:e.encode)!==null&&l!==void 0?l:(f,d)=>d(JSON.stringify(f)),this.decode=(c=e==null?void 0:e.decode)!==null&&c!==void 0?c:this.serializer.decode.bind(this.serializer),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e==null?void 0:e.workerUrl}}}class al extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function Ue(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}class tO extends al{constructor(e,r,n){super(e),this.name="StorageApiError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class ol extends al{constructor(e,r){super(e),this.name="StorageUnknownError",this.originalError=r}}const sl=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>Hr).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)},rO=()=>ee(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Promise.resolve().then(()=>Hr)).Response:Response}),ul=t=>{if(Array.isArray(t))return t.map(r=>ul(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]=ul(n)}),e},nO=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)},ll=t=>{var e;return t.msg||t.message||t.error_description||(typeof t.error=="string"?t.error:(e=t.error)===null||e===void 0?void 0:e.message)||JSON.stringify(t)},iO=(t,e,r)=>ee(void 0,void 0,void 0,function*(){const n=yield rO();t instanceof n&&!(r!=null&&r.noResolveJson)?t.json().then(i=>{const a=t.status||500,o=(i==null?void 0:i.statusCode)||a+"";e(new tO(ll(i),a,o))}).catch(i=>{e(new ol(ll(i),i))}):e(new ol(ll(t),t))}),aO=(t,e,r,n)=>{const i={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"||!n?i:(nO(n)?(i.headers=Object.assign({"Content-Type":"application/json"},e==null?void 0:e.headers),i.body=JSON.stringify(n)):i.body=n,e!=null&&e.duplex&&(i.duplex=e.duplex),Object.assign(Object.assign({},i),r))};function ia(t,e,r,n,i,a){return ee(this,void 0,void 0,function*(){return new Promise((o,s)=>{t(r,aO(e,n,i,a)).then(u=>{if(!u.ok)throw u;return n!=null&&n.noResolveJson?u:u.json()}).then(u=>o(u)).catch(u=>iO(u,s,n))})})}function aa(t,e,r,n){return ee(this,void 0,void 0,function*(){return ia(t,"GET",e,r,n)})}function Ft(t,e,r,n,i){return ee(this,void 0,void 0,function*(){return ia(t,"POST",e,n,i,r)})}function cl(t,e,r,n,i){return ee(this,void 0,void 0,function*(){return ia(t,"PUT",e,n,i,r)})}function oO(t,e,r,n){return ee(this,void 0,void 0,function*(){return ia(t,"HEAD",e,Object.assign(Object.assign({},r),{noResolveJson:!0}),n)})}function fl(t,e,r,n,i){return ee(this,void 0,void 0,function*(){return ia(t,"DELETE",e,n,i,r)})}class sO{constructor(e,r){this.downloadFn=e,this.shouldThrowOnError=r}then(e,r){return this.execute().then(e,r)}execute(){return ee(this,void 0,void 0,function*(){try{return{data:(yield this.downloadFn()).body,error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(Ue(e))return{data:null,error:e};throw e}})}}var fp;class uO{constructor(e,r){this.downloadFn=e,this.shouldThrowOnError=r,this[fp]="BlobDownloadBuilder",this.promise=null}asStream(){return new sO(this.downloadFn,this.shouldThrowOnError)}then(e,r){return this.getPromise().then(e,r)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}execute(){return ee(this,void 0,void 0,function*(){try{return{data:yield(yield this.downloadFn()).blob(),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(Ue(e))return{data:null,error:e};throw e}})}}fp=Symbol.toStringTag;const lO={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},dp={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class cO{constructor(e,r={},n,i){this.shouldThrowOnError=!1,this.url=e,this.headers=r,this.bucketId=n,this.fetch=sl(i)}throwOnError(){return this.shouldThrowOnError=!0,this}uploadOrUpdate(e,r,n,i){return ee(this,void 0,void 0,function*(){try{let a;const o=Object.assign(Object.assign({},dp),i);let s=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(o.upsert)});const u=o.metadata;typeof Blob<"u"&&n instanceof Blob?(a=new FormData,a.append("cacheControl",o.cacheControl),u&&a.append("metadata",this.encodeMetadata(u)),a.append("",n)):typeof FormData<"u"&&n instanceof FormData?(a=n,a.append("cacheControl",o.cacheControl),u&&a.append("metadata",this.encodeMetadata(u))):(a=n,s["cache-control"]=`max-age=${o.cacheControl}`,s["content-type"]=o.contentType,u&&(s["x-metadata"]=this.toBase64(this.encodeMetadata(u)))),i!=null&&i.headers&&(s=Object.assign(Object.assign({},s),i.headers));const l=this._removeEmptyFolders(r),c=this._getFinalPath(l),f=yield(e=="PUT"?cl:Ft)(this.fetch,`${this.url}/object/${c}`,a,Object.assign({headers:s},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{data:{path:l,id:f.Id,fullPath:f.Key},error:null}}catch(a){if(this.shouldThrowOnError)throw a;if(Ue(a))return{data:null,error:a};throw a}})}upload(e,r,n){return ee(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,r,n)})}uploadToSignedUrl(e,r,n,i){return ee(this,void 0,void 0,function*(){const a=this._removeEmptyFolders(e),o=this._getFinalPath(a),s=new URL(this.url+`/object/upload/sign/${o}`);s.searchParams.set("token",r);try{let u;const l=Object.assign({upsert:dp.upsert},i),c=Object.assign(Object.assign({},this.headers),{"x-upsert":String(l.upsert)});typeof Blob<"u"&&n instanceof Blob?(u=new FormData,u.append("cacheControl",l.cacheControl),u.append("",n)):typeof FormData<"u"&&n instanceof FormData?(u=n,u.append("cacheControl",l.cacheControl)):(u=n,c["cache-control"]=`max-age=${l.cacheControl}`,c["content-type"]=l.contentType);const f=yield cl(this.fetch,s.toString(),u,{headers:c});return{data:{path:a,fullPath:f.Key},error:null}}catch(u){if(this.shouldThrowOnError)throw u;if(Ue(u))return{data:null,error:u};throw u}})}createSignedUploadUrl(e,r){return ee(this,void 0,void 0,function*(){try{let n=this._getFinalPath(e);const i=Object.assign({},this.headers);r!=null&&r.upsert&&(i["x-upsert"]="true");const a=yield Ft(this.fetch,`${this.url}/object/upload/sign/${n}`,{},{headers:i}),o=new URL(this.url+a.url),s=o.searchParams.get("token");if(!s)throw new al("No token returned by API");return{data:{signedUrl:o.toString(),path:e,token:s},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Ue(n))return{data:null,error:n};throw n}})}update(e,r,n){return ee(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,r,n)})}move(e,r,n){return ee(this,void 0,void 0,function*(){try{return{data:yield Ft(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n==null?void 0:n.destinationBucket},{headers:this.headers}),error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(Ue(i))return{data:null,error:i};throw i}})}copy(e,r,n){return ee(this,void 0,void 0,function*(){try{return{data:{path:(yield Ft(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n==null?void 0:n.destinationBucket},{headers:this.headers})).Key},error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(Ue(i))return{data:null,error:i};throw i}})}createSignedUrl(e,r,n){return ee(this,void 0,void 0,function*(){try{let i=this._getFinalPath(e),a=yield Ft(this.fetch,`${this.url}/object/sign/${i}`,Object.assign({expiresIn:r},n!=null&&n.transform?{transform:n.transform}:{}),{headers:this.headers});const o=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return a={signedUrl:encodeURI(`${this.url}${a.signedURL}${o}`)},{data:a,error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(Ue(i))return{data:null,error:i};throw i}})}createSignedUrls(e,r,n){return ee(this,void 0,void 0,function*(){try{const i=yield Ft(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:r,paths:e},{headers:this.headers}),a=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return{data:i.map(o=>Object.assign(Object.assign({},o),{signedUrl:o.signedURL?encodeURI(`${this.url}${o.signedURL}${a}`):null})),error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(Ue(i))return{data:null,error:i};throw i}})}download(e,r){const i=typeof(r==null?void 0:r.transform)<"u"?"render/image/authenticated":"object",a=this.transformOptsToQueryString((r==null?void 0:r.transform)||{}),o=a?`?${a}`:"",s=this._getFinalPath(e),u=()=>aa(this.fetch,`${this.url}/${i}/${s}${o}`,{headers:this.headers,noResolveJson:!0});return new uO(u,this.shouldThrowOnError)}info(e){return ee(this,void 0,void 0,function*(){const r=this._getFinalPath(e);try{const n=yield aa(this.fetch,`${this.url}/object/info/${r}`,{headers:this.headers});return{data:ul(n),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Ue(n))return{data:null,error:n};throw n}})}exists(e){return ee(this,void 0,void 0,function*(){const r=this._getFinalPath(e);try{return yield oO(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Ue(n)&&n instanceof ol){const i=n.originalError;if([400,404].includes(i==null?void 0:i.status))return{data:!1,error:n}}throw n}})}getPublicUrl(e,r){const n=this._getFinalPath(e),i=[],a=r!=null&&r.download?`download=${r.download===!0?"":r.download}`:"";a!==""&&i.push(a);const s=typeof(r==null?void 0:r.transform)<"u"?"render/image":"object",u=this.transformOptsToQueryString((r==null?void 0:r.transform)||{});u!==""&&i.push(u);let l=i.join("&");return l!==""&&(l=`?${l}`),{data:{publicUrl:encodeURI(`${this.url}/${s}/public/${n}${l}`)}}}remove(e){return ee(this,void 0,void 0,function*(){try{return{data:yield fl(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Ue(r))return{data:null,error:r};throw r}})}list(e,r,n){return ee(this,void 0,void 0,function*(){try{const i=Object.assign(Object.assign(Object.assign({},lO),r),{prefix:e||""});return{data:yield Ft(this.fetch,`${this.url}/object/list/${this.bucketId}`,i,{headers:this.headers},n),error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(Ue(i))return{data:null,error:i};throw i}})}listV2(e,r){return ee(this,void 0,void 0,function*(){try{const n=Object.assign({},e);return{data:yield Ft(this.fetch,`${this.url}/object/list-v2/${this.bucketId}`,n,{headers:this.headers},r),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Ue(n))return{data:null,error:n};throw n}})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const r=[];return e.width&&r.push(`width=${e.width}`),e.height&&r.push(`height=${e.height}`),e.resize&&r.push(`resize=${e.resize}`),e.format&&r.push(`format=${e.format}`),e.quality&&r.push(`quality=${e.quality}`),r.join("&")}}const hp="2.78.0",pp={"X-Client-Info":`storage-js/${hp}`};class fO{constructor(e,r={},n,i){this.shouldThrowOnError=!1;const a=new URL(e);i!=null&&i.useNewHostname&&/supabase\.(co|in|red)$/.test(a.hostname)&&!a.hostname.includes("storage.supabase.")&&(a.hostname=a.hostname.replace("supabase.","storage.supabase.")),this.url=a.href.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},pp),r),this.fetch=sl(n)}throwOnError(){return this.shouldThrowOnError=!0,this}listBuckets(e){return ee(this,void 0,void 0,function*(){try{const r=this.listBucketOptionsToQueryString(e);return{data:yield aa(this.fetch,`${this.url}/bucket${r}`,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Ue(r))return{data:null,error:r};throw r}})}getBucket(e){return ee(this,void 0,void 0,function*(){try{return{data:yield aa(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Ue(r))return{data:null,error:r};throw r}})}createBucket(e){return ee(this,arguments,void 0,function*(r,n={public:!1}){try{return{data:yield Ft(this.fetch,`${this.url}/bucket`,{id:r,name:r,type:n.type,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:this.headers}),error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(Ue(i))return{data:null,error:i};throw i}})}updateBucket(e,r){return ee(this,void 0,void 0,function*(){try{return{data:yield cl(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Ue(n))return{data:null,error:n};throw n}})}emptyBucket(e){return ee(this,void 0,void 0,function*(){try{return{data:yield Ft(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Ue(r))return{data:null,error:r};throw r}})}deleteBucket(e){return ee(this,void 0,void 0,function*(){try{return{data:yield fl(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Ue(r))return{data:null,error:r};throw r}})}listBucketOptionsToQueryString(e){const r={};return e&&("limit"in e&&(r.limit=String(e.limit)),"offset"in e&&(r.offset=String(e.offset)),e.search&&(r.search=e.search),e.sortColumn&&(r.sortColumn=e.sortColumn),e.sortOrder&&(r.sortOrder=e.sortOrder)),Object.keys(r).length>0?"?"+new URLSearchParams(r).toString():""}}class dO{constructor(e,r={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},pp),r),this.fetch=sl(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(e){return ee(this,void 0,void 0,function*(){try{return{data:yield Ft(this.fetch,`${this.url}/bucket`,{name:e},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Ue(r))return{data:null,error:r};throw r}})}listBuckets(e){return ee(this,void 0,void 0,function*(){try{const r=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&r.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&r.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&r.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&r.set("sortOrder",e.sortOrder),e!=null&&e.search&&r.set("search",e.search);const n=r.toString(),i=n?`${this.url}/bucket?${n}`:`${this.url}/bucket`;return{data:yield aa(this.fetch,i,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Ue(r))return{data:null,error:r};throw r}})}deleteBucket(e){return ee(this,void 0,void 0,function*(){try{return{data:yield fl(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Ue(r))return{data:null,error:r};throw r}})}}const dl={"X-Client-Info":`storage-js/${hp}`,"Content-Type":"application/json"};class vp extends Error{constructor(e){super(e),this.__isStorageVectorsError=!0,this.name="StorageVectorsError"}}function wt(t){return typeof t=="object"&&t!==null&&"__isStorageVectorsError"in t}class hl extends vp{constructor(e,r,n){super(e),this.name="StorageVectorsApiError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class hO extends vp{constructor(e,r){super(e),this.name="StorageVectorsUnknownError",this.originalError=r}}var yp;(function(t){t.InternalError="InternalError",t.S3VectorConflictException="S3VectorConflictException",t.S3VectorNotFoundException="S3VectorNotFoundException",t.S3VectorBucketNotEmpty="S3VectorBucketNotEmpty",t.S3VectorMaxBucketsExceeded="S3VectorMaxBucketsExceeded",t.S3VectorMaxIndexesExceeded="S3VectorMaxIndexesExceeded"})(yp||(yp={}));const pl=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>Hr).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)},pO=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)},gp=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),vO=(t,e,r)=>ee(void 0,void 0,void 0,function*(){if(t&&typeof t=="object"&&"status"in t&&"ok"in t&&typeof t.status=="number"&&!(r!=null&&r.noResolveJson)){const i=t.status||500,a=t;if(typeof a.json=="function")a.json().then(o=>{const s=(o==null?void 0:o.statusCode)||(o==null?void 0:o.code)||i+"";e(new hl(gp(o),i,s))}).catch(()=>{const o=i+"",s=a.statusText||`HTTP ${i} error`;e(new hl(s,i,o))});else{const o=i+"",s=a.statusText||`HTTP ${i} error`;e(new hl(s,i,o))}}else e(new hO(gp(t),t))}),yO=(t,e,r,n)=>{const i={method:t,headers:(e==null?void 0:e.headers)||{}};return n?(pO(n)?(i.headers=Object.assign({"Content-Type":"application/json"},e==null?void 0:e.headers),i.body=JSON.stringify(n)):i.body=n,Object.assign(Object.assign({},i),r)):i};function gO(t,e,r,n,i,a){return ee(this,void 0,void 0,function*(){return new Promise((o,s)=>{t(r,yO(e,n,i,a)).then(u=>{if(!u.ok)throw u;if(n!=null&&n.noResolveJson)return u;const l=u.headers.get("content-type");return!l||!l.includes("application/json")?{}:u.json()}).then(u=>o(u)).catch(u=>vO(u,s,n))})})}function _t(t,e,r,n,i){return ee(this,void 0,void 0,function*(){return gO(t,"POST",e,n,i,r)})}class mO{constructor(e,r={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},dl),r),this.fetch=pl(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createIndex(e){return ee(this,void 0,void 0,function*(){try{return{data:(yield _t(this.fetch,`${this.url}/CreateIndex`,e,{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(wt(r))return{data:null,error:r};throw r}})}getIndex(e,r){return ee(this,void 0,void 0,function*(){try{return{data:yield _t(this.fetch,`${this.url}/GetIndex`,{vectorBucketName:e,indexName:r},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(wt(n))return{data:null,error:n};throw n}})}listIndexes(e){return ee(this,void 0,void 0,function*(){try{return{data:yield _t(this.fetch,`${this.url}/ListIndexes`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(wt(r))return{data:null,error:r};throw r}})}deleteIndex(e,r){return ee(this,void 0,void 0,function*(){try{return{data:(yield _t(this.fetch,`${this.url}/DeleteIndex`,{vectorBucketName:e,indexName:r},{headers:this.headers}))||{},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(wt(n))return{data:null,error:n};throw n}})}}class bO{constructor(e,r={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},dl),r),this.fetch=pl(n)}throwOnError(){return this.shouldThrowOnError=!0,this}putVectors(e){return ee(this,void 0,void 0,function*(){try{if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return{data:(yield _t(this.fetch,`${this.url}/PutVectors`,e,{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(wt(r))return{data:null,error:r};throw r}})}getVectors(e){return ee(this,void 0,void 0,function*(){try{return{data:yield _t(this.fetch,`${this.url}/GetVectors`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(wt(r))return{data:null,error:r};throw r}})}listVectors(e){return ee(this,void 0,void 0,function*(){try{if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return{data:yield _t(this.fetch,`${this.url}/ListVectors`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(wt(r))return{data:null,error:r};throw r}})}queryVectors(e){return ee(this,void 0,void 0,function*(){try{return{data:yield _t(this.fetch,`${this.url}/QueryVectors`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(wt(r))return{data:null,error:r};throw r}})}deleteVectors(e){return ee(this,void 0,void 0,function*(){try{if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return{data:(yield _t(this.fetch,`${this.url}/DeleteVectors`,e,{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(wt(r))return{data:null,error:r};throw r}})}}class wO{constructor(e,r={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},dl),r),this.fetch=pl(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(e){return ee(this,void 0,void 0,function*(){try{return{data:(yield _t(this.fetch,`${this.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(wt(r))return{data:null,error:r};throw r}})}getBucket(e){return ee(this,void 0,void 0,function*(){try{return{data:yield _t(this.fetch,`${this.url}/GetVectorBucket`,{vectorBucketName:e},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(wt(r))return{data:null,error:r};throw r}})}listBuckets(){return ee(this,arguments,void 0,function*(e={}){try{return{data:yield _t(this.fetch,`${this.url}/ListVectorBuckets`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(wt(r))return{data:null,error:r};throw r}})}deleteBucket(e){return ee(this,void 0,void 0,function*(){try{return{data:(yield _t(this.fetch,`${this.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(wt(r))return{data:null,error:r};throw r}})}}class _O extends wO{constructor(e,r={}){super(e,r.headers||{},r.fetch)}from(e){return new xO(this.url,this.headers,e,this.fetch)}}class xO extends mO{constructor(e,r,n,i){super(e,r,i),this.vectorBucketName=n}createIndex(e){const r=Object.create(null,{createIndex:{get:()=>super.createIndex}});return ee(this,void 0,void 0,function*(){return r.createIndex.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName}))})}listIndexes(){const e=Object.create(null,{listIndexes:{get:()=>super.listIndexes}});return ee(this,arguments,void 0,function*(r={}){return e.listIndexes.call(this,Object.assign(Object.assign({},r),{vectorBucketName:this.vectorBucketName}))})}getIndex(e){const r=Object.create(null,{getIndex:{get:()=>super.getIndex}});return ee(this,void 0,void 0,function*(){return r.getIndex.call(this,this.vectorBucketName,e)})}deleteIndex(e){const r=Object.create(null,{deleteIndex:{get:()=>super.deleteIndex}});return ee(this,void 0,void 0,function*(){return r.deleteIndex.call(this,this.vectorBucketName,e)})}index(e){return new OO(this.url,this.headers,this.vectorBucketName,e,this.fetch)}}class OO extends bO{constructor(e,r,n,i,a){super(e,r,a),this.vectorBucketName=n,this.indexName=i}putVectors(e){const r=Object.create(null,{putVectors:{get:()=>super.putVectors}});return ee(this,void 0,void 0,function*(){return r.putVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}getVectors(e){const r=Object.create(null,{getVectors:{get:()=>super.getVectors}});return ee(this,void 0,void 0,function*(){return r.getVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}listVectors(){const e=Object.create(null,{listVectors:{get:()=>super.listVectors}});return ee(this,arguments,void 0,function*(r={}){return e.listVectors.call(this,Object.assign(Object.assign({},r),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}queryVectors(e){const r=Object.create(null,{queryVectors:{get:()=>super.queryVectors}});return ee(this,void 0,void 0,function*(){return r.queryVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}deleteVectors(e){const r=Object.create(null,{deleteVectors:{get:()=>super.deleteVectors}});return ee(this,void 0,void 0,function*(){return r.deleteVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}}class SO extends fO{constructor(e,r={},n,i){super(e,r,n,i)}from(e){return new cO(this.url,this.headers,e,this.fetch)}get vectors(){return new _O(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new dO(this.url+"/iceberg",this.headers,this.fetch)}}const AO="2.78.0";let oa="";typeof Deno<"u"?oa="deno":typeof document<"u"?oa="web":typeof navigator<"u"&&navigator.product==="ReactNative"?oa="react-native":oa="node";const PO={headers:{"X-Client-Info":`supabase-js-${oa}/${AO}`}},EO={schema:"public"},TO={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},jO={},$O=t=>{let e;return t?e=t:typeof fetch>"u"?e=Nh:e=fetch,(...r)=>e(...r)},kO=()=>typeof Headers>"u"?Mh:Headers,CO=(t,e,r)=>{const n=$O(r),i=kO();return async(a,o)=>{var s;const u=(s=await e())!==null&&s!==void 0?s:t;let l=new i(o==null?void 0:o.headers);return l.has("apikey")||l.set("apikey",t),l.has("Authorization")||l.set("Authorization",`Bearer ${u}`),n(a,Object.assign(Object.assign({},o),{headers:l}))}};function IO(t){return t.endsWith("/")?t:t+"/"}function NO(t,e){var r,n;const{db:i,auth:a,realtime:o,global:s}=t,{db:u,auth:l,realtime:c,global:f}=e,d={db:Object.assign(Object.assign({},u),i),auth:Object.assign(Object.assign({},l),a),realtime:Object.assign(Object.assign({},c),o),storage:{},global:Object.assign(Object.assign(Object.assign({},f),s),{headers:Object.assign(Object.assign({},(r=f==null?void 0:f.headers)!==null&&r!==void 0?r:{}),(n=s==null?void 0:s.headers)!==null&&n!==void 0?n:{})}),accessToken:async()=>""};return t.accessToken?d.accessToken=t.accessToken:delete d.accessToken,d}function MO(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(IO(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}const mp="2.78.0",Mn=30*1e3,vl=3,yl=vl*Mn,DO="http://localhost:9999",RO="supabase.auth.token",LO={"X-Client-Info":`gotrue-js/${mp}`},gl="X-Supabase-Api-Version",bp={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},BO=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,UO=10*60*1e3;class sa extends Error{constructor(e,r,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}}function ie(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class FO extends sa{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.code=n}}function WO(t){return ie(t)&&t.name==="AuthApiError"}class Yr extends sa{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}}class Pr extends sa{constructor(e,r,n,i){super(e,n,i),this.name=r,this.status=n}}class Wt extends Pr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function qO(t){return ie(t)&&t.name==="AuthSessionMissingError"}class Dn extends Pr{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class Lo extends Pr{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class Bo extends Pr{constructor(e,r=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function zO(t){return ie(t)&&t.name==="AuthImplicitGrantRedirectError"}class wp extends Pr{constructor(e,r=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class ml extends Pr{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}}function bl(t){return ie(t)&&t.name==="AuthRetryableFetchError"}class _p extends Pr{constructor(e,r,n){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}}class wl extends Pr{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const Uo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),xp=`
|
|
53
|
-
\r=`.split(""),KO=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<xp.length;e+=1)t[xp[e].charCodeAt(0)]=-2;for(let e=0;e<Uo.length;e+=1)t[Uo[e].charCodeAt(0)]=e;return t})();function Op(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(Uo[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(Uo[n]),e.queuedBits-=6}}function Sp(t,e,r){const n=KO[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 Ap(t){const e=[],r=o=>{e.push(String.fromCodePoint(o))},n={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},a=o=>{GO(o,n,r)};for(let o=0;o<t.length;o+=1)Sp(t.charCodeAt(o),i,a);return e.join("")}function VO(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 HO(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}VO(n,e)}}function GO(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)){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 Rn(t){const e=[],r={queue:0,queuedBits:0},n=i=>{e.push(i)};for(let i=0;i<t.length;i+=1)Sp(t.charCodeAt(i),r,n);return new Uint8Array(e)}function YO(t){const e=[];return HO(t,r=>e.push(r)),new Uint8Array(e)}function Xr(t){const e=[],r={queue:0,queuedBits:0},n=i=>{e.push(i)};return t.forEach(i=>Op(i,r,n)),Op(null,r,n),e.join("")}function XO(t){return Math.round(Date.now()/1e3)+t}function JO(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=Math.random()*16|0;return(t=="x"?e:e&3|8).toString(16)})}const lt=()=>typeof window<"u"&&typeof document<"u",Jr={tested:!1,writable:!1},Pp=()=>{if(!lt())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Jr.tested)return Jr.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),Jr.tested=!0,Jr.writable=!0}catch{Jr.tested=!0,Jr.writable=!1}return Jr.writable};function ZO(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 Ep=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>Hr).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)},QO=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",Ln=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))},Zr=async(t,e)=>{const r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return r}},Er=async(t,e)=>{await t.removeItem(e)};class Fo{constructor(){this.promise=new Fo.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}}Fo.promiseConstructor=Promise;function _l(t){const e=t.split(".");if(e.length!==3)throw new wl("Invalid JWT structure");for(let n=0;n<e.length;n++)if(!BO.test(e[n]))throw new wl("JWT not in base64url format");return{header:JSON.parse(Ap(e[0])),payload:JSON.parse(Ap(e[1])),signature:Rn(e[2]),raw:{header:e[0],payload:e[1]}}}async function eS(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function tS(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 rS(t){return("0"+t.toString(16)).substr(-2)}function nS(){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,rS).join("")}async function iS(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 aS(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 iS(t);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Bn(t,e,r=!1){const n=nS();let i=n;r&&(i+="/PASSWORD_RECOVERY"),await Ln(t,`${e}-code-verifier`,i);const a=await aS(n);return[a,n===a?"plain":"s256"]}const oS=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function sS(t){const e=t.headers.get(gl);if(!e||!e.match(oS))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function uS(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 lS(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 cS=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Un(t){if(!cS.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function xl(){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 fS(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 Tp(t){return JSON.parse(JSON.stringify(t))}const Qr=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),dS=[502,503,504];async function jp(t){var e;if(!QO(t))throw new ml(Qr(t),0);if(dS.includes(t.status))throw new ml(Qr(t),t.status);let r;try{r=await t.json()}catch(a){throw new Yr(Qr(a),a)}let n;const i=sS(t);if(i&&i.getTime()>=bp["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 _p(Qr(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(n==="session_not_found")throw new Wt}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 _p(Qr(r),t.status,r.weak_password.reasons);throw new FO(Qr(r),t.status||500,n)}const hS=(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 ce(t,e,r,n){var i;const a=Object.assign({},n==null?void 0:n.headers);a[gl]||(a[gl]=bp["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 s=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",u=await pS(t,e,r+s,{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 pS(t,e,r,n,i,a){const o=hS(e,n,i,a);let s;try{s=await t(r,Object.assign({},o))}catch(u){throw console.error(u),new ml(Qr(u),0)}if(s.ok||await jp(s),n!=null&&n.noResolveJson)return s;try{return await s.json()}catch(u){await jp(u)}}function qt(t){var e;let r=null;gS(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=XO(t.expires_in)));const n=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:r,user:n},error:null}}function $p(t){const e=qt(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 Tr(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function vS(t){return{data:t,error:null}}function yS(t){const{action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:a}=t,o=$n(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),s={action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:a},u=Object.assign({},o);return{data:{properties:s,user:u},error:null}}function kp(t){return t}function gS(t){return t.access_token&&t.refresh_token&&t.expires_in}const Ol=["global","local","others"];class mS{constructor({url:e="",headers:r={},fetch:n}){this.url=e,this.headers=r,this.fetch=Ep(n),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)}}async signOut(e,r=Ol[0]){if(Ol.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Ol.join(", ")}`);try{return await ce(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if(ie(n))return{data:null,error:n};throw n}}async inviteUserByEmail(e,r={}){try{return await ce(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:Tr})}catch(n){if(ie(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{const{options:r}=e,n=$n(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 ce(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:yS,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(ie(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(e){try{return await ce(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:Tr})}catch(r){if(ie(r))return{data:{user:null},error:r};throw r}}async listUsers(e){var r,n,i,a,o,s,u;try{const l={nextPage:null,lastPage:0,total:0},c=await ce(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:kp});if(c.error)throw c.error;const f=await c.json(),d=(o=c.headers.get("x-total-count"))!==null&&o!==void 0?o:0,h=(u=(s=c.headers.get("link"))===null||s===void 0?void 0:s.split(","))!==null&&u!==void 0?u:[];return h.length>0&&(h.forEach(y=>{const v=parseInt(y.split(";")[0].split("=")[1].substring(0,1)),p=JSON.parse(y.split(";")[1].split("=")[1]);l[`${p}Page`]=v}),l.total=parseInt(d)),{data:Object.assign(Object.assign({},f),l),error:null}}catch(l){if(ie(l))return{data:{users:[]},error:l};throw l}}async getUserById(e){Un(e);try{return await ce(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:Tr})}catch(r){if(ie(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){Un(e);try{return await ce(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:Tr})}catch(n){if(ie(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,r=!1){Un(e);try{return await ce(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:Tr})}catch(n){if(ie(n))return{data:{user:null},error:n};throw n}}async _listFactors(e){Un(e.userId);try{const{data:r,error:n}=await ce(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(ie(r))return{data:null,error:r};throw r}}async _deleteFactor(e){Un(e.userId),Un(e.id);try{return{data:await ce(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(r){if(ie(r))return{data:null,error:r};throw r}}async _listOAuthClients(e){var r,n,i,a,o,s,u;try{const l={nextPage:null,lastPage:0,total:0},c=await ce(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:kp});if(c.error)throw c.error;const f=await c.json(),d=(o=c.headers.get("x-total-count"))!==null&&o!==void 0?o:0,h=(u=(s=c.headers.get("link"))===null||s===void 0?void 0:s.split(","))!==null&&u!==void 0?u:[];return h.length>0&&(h.forEach(y=>{const v=parseInt(y.split(";")[0].split("=")[1].substring(0,1)),p=JSON.parse(y.split(";")[1].split("=")[1]);l[`${p}Page`]=v}),l.total=parseInt(d)),{data:Object.assign(Object.assign({},f),l),error:null}}catch(l){if(ie(l))return{data:{clients:[]},error:l};throw l}}async _createOAuthClient(e){try{return await ce(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(ie(r))return{data:null,error:r};throw r}}async _getOAuthClient(e){try{return await ce(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(ie(r))return{data:null,error:r};throw r}}async _updateOAuthClient(e,r){try{return await ce(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ie(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(e){try{return await ce(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(ie(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(e){try{return await ce(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(ie(r))return{data:null,error:r};throw r}}}function Cp(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}const Fn={debug:!!(globalThis&&Pp()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class Ip extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class bS extends Ip{}async function wS(t,e,r){Fn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);const n=new globalThis.AbortController;return e>0&&setTimeout(()=>{n.abort(),Fn.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async i=>{if(i){Fn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,i.name);try{return await r()}finally{Fn.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,i.name)}}else{if(e===0)throw Fn.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new bS(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(Fn.debug)try{const a=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(a,null," "))}catch(a){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",a)}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"),await r()}}))}function _S(){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 Np(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}" is invalid.`);return t.toLowerCase()}function xS(t){return parseInt(t,16)}function OS(t){const e=new TextEncoder().encode(t);return"0x"+Array.from(e,n=>n.toString(16).padStart(2,"0")).join("")}function SS(t){var e;const{chainId:r,domain:n,expirationTime:i,issuedAt:a=new Date,nonce:o,notBefore:s,requestId:u,resources:l,scheme:c,uri:f,version:d}=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(d!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${d}`);if(!((e=t.statement)===null||e===void 0)&&e.includes(`
|
|
54
|
-
`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${t.statement}`)}const h=
|
|
23
|
+
})`):new Error(`WebSocket not available: ${r}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:ix}))}disconnect(e,r){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const n=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(n),this._setConnectionState("disconnected")},e?this.conn.close(e,r??""):this.conn.close(),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(e){const r=await e.unsubscribe();return this.channels.length===0&&this.disconnect(),r}async removeAllChannels(){const e=await Promise.all(this.channels.map(r=>r.unsubscribe()));return this.channels=[],this.disconnect(),e}log(e,r,n){this.logger(e,r,n)}connectionState(){switch(this.conn&&this.conn.readyState){case Ni.connecting:return Cr.Connecting;case Ni.open:return Cr.Open;case Ni.closing:return Cr.Closing;default:return Cr.Closed}}isConnected(){return this.connectionState()===Cr.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(e,r={config:{}}){const n=`realtime:${e}`,i=this.getChannels().find(a=>a.topic===n);if(i)return i;{const a=new Il(`realtime:${e}`,r,this);return this.channels.push(a),a}}push(e){const{topic:r,event:n,payload:i,ref:a}=e,o=()=>{this.encode(e,s=>{var l;(l=this.conn)===null||l===void 0||l.send(s)})};this.log("push",`${r} ${n} (${a})`,i),this.isConnected()?o():this.sendBuffer.push(o)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}async sendHeartbeat(){var e;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(r){this.log("error","error in heartbeat callback",r)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(r){this.log("error","error in heartbeat callback",r)}this._wasManualDisconnect=!1,(e=this.conn)===null||e===void 0||e.close(ax,"heartbeat timeout"),setTimeout(()=>{var r;this.isConnected()||(r=this.reconnectTimer)===null||r===void 0||r.scheduleTimeout()},ho.HEARTBEAT_TIMEOUT_FALLBACK);return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(r){this.log("error","error in heartbeat callback",r)}this._setAuthSafely("heartbeat")}onHeartbeat(e){this.heartbeatCallback=e}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let r=this.channels.find(n=>n.topic===e&&(n._isJoined()||n._isJoining()));r&&(this.log("transport",`leaving duplicate topic "${e}"`),r.unsubscribe())}_remove(e){this.channels=this.channels.filter(r=>r.topic!==e.topic)}_onConnMessage(e){this.decode(e.data,r=>{if(r.topic==="phoenix"&&r.event==="phx_reply")try{this.heartbeatCallback(r.payload.status==="ok"?"ok":"error")}catch(u){this.log("error","error in heartbeat callback",u)}r.ref&&r.ref===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null);const{topic:n,event:i,payload:a,ref:o}=r,s=o?`(${o})`:"",l=a.status||"";this.log("receive",`${l} ${n} ${i} ${s}`.trim(),a),this.channels.filter(u=>u._isMember(n)).forEach(u=>u._trigger(i,a,o)),this._triggerStateCallbacks("message",r)})}_clearTimer(e){var r;e==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):e==="reconnect"&&((r=this.reconnectTimer)===null||r===void 0||r.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),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))}_teardownConnection(){this.conn&&(this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null),this._clearAllTimers(),this.channels.forEach(e=>e.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_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.workerRef.terminate()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_onConnClose(e){var r;this._setConnectionState("disconnected"),this.log("transport","close",e),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(r=this.reconnectTimer)===null||r===void 0||r.scheduleTimeout(),this._triggerStateCallbacks("close",e)}_onConnError(e){this._setConnectionState("disconnected"),this.log("transport",`${e}`),this._triggerChanError(),this._triggerStateCallbacks("error",e)}_triggerChanError(){this.channels.forEach(e=>e._trigger(Pt.error))}_appendParams(e,r){if(Object.keys(r).length===0)return e;const n=e.match(/\?/)?"&":"?",i=new URLSearchParams(r);return`${e}${n}${i}`}_workerObjectUrl(e){let r;if(e)r=e;else{const n=new Blob([yx],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_setConnectionState(e,r=!1){this._connectionState=e,e==="connecting"?this._wasManualDisconnect=!1:e==="disconnecting"&&(this._wasManualDisconnect=r)}async _performAuth(e=null){let r;e?r=e:this.accessToken?r=await this.accessToken():r=this.accessTokenValue,this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(n=>{const i={access_token:r,version:nx};r&&n.updateJoinPayload(i),n.joinedOnce&&n._isJoined()&&n._push(Pt.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this.setAuth().catch(r=>{this.log("error",`error setting auth in ${e}`,r)})}_triggerStateCallbacks(e,r){try{this.stateChangeCallbacks[e].forEach(n=>{try{n(r)}catch(i){this.log("error",`error in ${e} callback`,i)}})}catch(n){this.log("error",`error triggering ${e} callbacks`,n)}}_setupReconnectionTimer(){this.reconnectTimer=new kh(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},ho.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(e){var r,n,i,a,o,s,l,u,c;if(this.transport=(r=e==null?void 0:e.transport)!==null&&r!==void 0?r:null,this.timeout=(n=e==null?void 0:e.timeout)!==null&&n!==void 0?n:$l,this.heartbeatIntervalMs=(i=e==null?void 0:e.heartbeatIntervalMs)!==null&&i!==void 0?i:ho.HEARTBEAT_INTERVAL,this.worker=(a=e==null?void 0:e.worker)!==null&&a!==void 0?a:!1,this.accessToken=(o=e==null?void 0:e.accessToken)!==null&&o!==void 0?o:null,this.heartbeatCallback=(s=e==null?void 0:e.heartbeatCallback)!==null&&s!==void 0?s:Nl,e!=null&&e.params&&(this.params=e.params),e!=null&&e.logger&&(this.logger=e.logger),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(l=e==null?void 0:e.reconnectAfterMs)!==null&&l!==void 0?l:f=>px[f-1]||vx,this.encode=(u=e==null?void 0:e.encode)!==null&&u!==void 0?u:(f,d)=>d(JSON.stringify(f)),this.decode=(c=e==null?void 0:e.decode)!==null&&c!==void 0?c:this.serializer.decode.bind(this.serializer),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e==null?void 0:e.workerUrl}}}class Ml extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function Ce(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}class mx extends Ml{constructor(e,r,n){super(e),this.name="StorageApiError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class Dl extends Ml{constructor(e,r){super(e),this.name="StorageUnknownError",this.originalError=r}}const Ll=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>kr).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)},bx=()=>J(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Promise.resolve().then(()=>kr)).Response:Response}),Bl=t=>{if(Array.isArray(t))return t.map(r=>Bl(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]=Bl(n)}),e},wx=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)},Rl=t=>{var e;return t.msg||t.message||t.error_description||(typeof t.error=="string"?t.error:(e=t.error)===null||e===void 0?void 0:e.message)||JSON.stringify(t)},_x=(t,e,r)=>J(void 0,void 0,void 0,function*(){const n=yield bx();t instanceof n&&!(r!=null&&r.noResolveJson)?t.json().then(i=>{const a=t.status||500,o=(i==null?void 0:i.statusCode)||a+"";e(new mx(Rl(i),a,o))}).catch(i=>{e(new Dl(Rl(i),i))}):e(new Dl(Rl(t),t))}),xx=(t,e,r,n)=>{const i={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"||!n?i:(wx(n)?(i.headers=Object.assign({"Content-Type":"application/json"},e==null?void 0:e.headers),i.body=JSON.stringify(n)):i.body=n,e!=null&&e.duplex&&(i.duplex=e.duplex),Object.assign(Object.assign({},i),r))};function Li(t,e,r,n,i,a){return J(this,void 0,void 0,function*(){return new Promise((o,s)=>{t(r,xx(e,n,i,a)).then(l=>{if(!l.ok)throw l;return n!=null&&n.noResolveJson?l:l.json()}).then(l=>o(l)).catch(l=>_x(l,s,n))})})}function Bi(t,e,r,n){return J(this,void 0,void 0,function*(){return Li(t,"GET",e,r,n)})}function Et(t,e,r,n,i){return J(this,void 0,void 0,function*(){return Li(t,"POST",e,n,i,r)})}function Ul(t,e,r,n,i){return J(this,void 0,void 0,function*(){return Li(t,"PUT",e,n,i,r)})}function Ox(t,e,r,n){return J(this,void 0,void 0,function*(){return Li(t,"HEAD",e,Object.assign(Object.assign({},r),{noResolveJson:!0}),n)})}function Fl(t,e,r,n,i){return J(this,void 0,void 0,function*(){return Li(t,"DELETE",e,n,i,r)})}class Sx{constructor(e,r){this.downloadFn=e,this.shouldThrowOnError=r}then(e,r){return this.execute().then(e,r)}execute(){return J(this,void 0,void 0,function*(){try{return{data:(yield this.downloadFn()).body,error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(Ce(e))return{data:null,error:e};throw e}})}}var Lh;class Ax{constructor(e,r){this.downloadFn=e,this.shouldThrowOnError=r,this[Lh]="BlobDownloadBuilder",this.promise=null}asStream(){return new Sx(this.downloadFn,this.shouldThrowOnError)}then(e,r){return this.getPromise().then(e,r)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}execute(){return J(this,void 0,void 0,function*(){try{return{data:yield(yield this.downloadFn()).blob(),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(Ce(e))return{data:null,error:e};throw e}})}}Lh=Symbol.toStringTag;const Px={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Bh={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class Ex{constructor(e,r={},n,i){this.shouldThrowOnError=!1,this.url=e,this.headers=r,this.bucketId=n,this.fetch=Ll(i)}throwOnError(){return this.shouldThrowOnError=!0,this}uploadOrUpdate(e,r,n,i){return J(this,void 0,void 0,function*(){try{let a;const o=Object.assign(Object.assign({},Bh),i);let s=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(o.upsert)});const l=o.metadata;typeof Blob<"u"&&n instanceof Blob?(a=new FormData,a.append("cacheControl",o.cacheControl),l&&a.append("metadata",this.encodeMetadata(l)),a.append("",n)):typeof FormData<"u"&&n instanceof FormData?(a=n,a.append("cacheControl",o.cacheControl),l&&a.append("metadata",this.encodeMetadata(l))):(a=n,s["cache-control"]=`max-age=${o.cacheControl}`,s["content-type"]=o.contentType,l&&(s["x-metadata"]=this.toBase64(this.encodeMetadata(l)))),i!=null&&i.headers&&(s=Object.assign(Object.assign({},s),i.headers));const u=this._removeEmptyFolders(r),c=this._getFinalPath(u),f=yield(e=="PUT"?Ul:Et)(this.fetch,`${this.url}/object/${c}`,a,Object.assign({headers:s},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{data:{path:u,id:f.Id,fullPath:f.Key},error:null}}catch(a){if(this.shouldThrowOnError)throw a;if(Ce(a))return{data:null,error:a};throw a}})}upload(e,r,n){return J(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,r,n)})}uploadToSignedUrl(e,r,n,i){return J(this,void 0,void 0,function*(){const a=this._removeEmptyFolders(e),o=this._getFinalPath(a),s=new URL(this.url+`/object/upload/sign/${o}`);s.searchParams.set("token",r);try{let l;const u=Object.assign({upsert:Bh.upsert},i),c=Object.assign(Object.assign({},this.headers),{"x-upsert":String(u.upsert)});typeof Blob<"u"&&n instanceof Blob?(l=new FormData,l.append("cacheControl",u.cacheControl),l.append("",n)):typeof FormData<"u"&&n instanceof FormData?(l=n,l.append("cacheControl",u.cacheControl)):(l=n,c["cache-control"]=`max-age=${u.cacheControl}`,c["content-type"]=u.contentType);const f=yield Ul(this.fetch,s.toString(),l,{headers:c});return{data:{path:a,fullPath:f.Key},error:null}}catch(l){if(this.shouldThrowOnError)throw l;if(Ce(l))return{data:null,error:l};throw l}})}createSignedUploadUrl(e,r){return J(this,void 0,void 0,function*(){try{let n=this._getFinalPath(e);const i=Object.assign({},this.headers);r!=null&&r.upsert&&(i["x-upsert"]="true");const a=yield Et(this.fetch,`${this.url}/object/upload/sign/${n}`,{},{headers:i}),o=new URL(this.url+a.url),s=o.searchParams.get("token");if(!s)throw new Ml("No token returned by API");return{data:{signedUrl:o.toString(),path:e,token:s},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Ce(n))return{data:null,error:n};throw n}})}update(e,r,n){return J(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,r,n)})}move(e,r,n){return J(this,void 0,void 0,function*(){try{return{data:yield Et(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n==null?void 0:n.destinationBucket},{headers:this.headers}),error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(Ce(i))return{data:null,error:i};throw i}})}copy(e,r,n){return J(this,void 0,void 0,function*(){try{return{data:{path:(yield Et(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n==null?void 0:n.destinationBucket},{headers:this.headers})).Key},error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(Ce(i))return{data:null,error:i};throw i}})}createSignedUrl(e,r,n){return J(this,void 0,void 0,function*(){try{let i=this._getFinalPath(e),a=yield Et(this.fetch,`${this.url}/object/sign/${i}`,Object.assign({expiresIn:r},n!=null&&n.transform?{transform:n.transform}:{}),{headers:this.headers});const o=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return a={signedUrl:encodeURI(`${this.url}${a.signedURL}${o}`)},{data:a,error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(Ce(i))return{data:null,error:i};throw i}})}createSignedUrls(e,r,n){return J(this,void 0,void 0,function*(){try{const i=yield Et(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:r,paths:e},{headers:this.headers}),a=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return{data:i.map(o=>Object.assign(Object.assign({},o),{signedUrl:o.signedURL?encodeURI(`${this.url}${o.signedURL}${a}`):null})),error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(Ce(i))return{data:null,error:i};throw i}})}download(e,r){const i=typeof(r==null?void 0:r.transform)<"u"?"render/image/authenticated":"object",a=this.transformOptsToQueryString((r==null?void 0:r.transform)||{}),o=a?`?${a}`:"",s=this._getFinalPath(e),l=()=>Bi(this.fetch,`${this.url}/${i}/${s}${o}`,{headers:this.headers,noResolveJson:!0});return new Ax(l,this.shouldThrowOnError)}info(e){return J(this,void 0,void 0,function*(){const r=this._getFinalPath(e);try{const n=yield Bi(this.fetch,`${this.url}/object/info/${r}`,{headers:this.headers});return{data:Bl(n),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Ce(n))return{data:null,error:n};throw n}})}exists(e){return J(this,void 0,void 0,function*(){const r=this._getFinalPath(e);try{return yield Ox(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Ce(n)&&n instanceof Dl){const i=n.originalError;if([400,404].includes(i==null?void 0:i.status))return{data:!1,error:n}}throw n}})}getPublicUrl(e,r){const n=this._getFinalPath(e),i=[],a=r!=null&&r.download?`download=${r.download===!0?"":r.download}`:"";a!==""&&i.push(a);const s=typeof(r==null?void 0:r.transform)<"u"?"render/image":"object",l=this.transformOptsToQueryString((r==null?void 0:r.transform)||{});l!==""&&i.push(l);let u=i.join("&");return u!==""&&(u=`?${u}`),{data:{publicUrl:encodeURI(`${this.url}/${s}/public/${n}${u}`)}}}remove(e){return J(this,void 0,void 0,function*(){try{return{data:yield Fl(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Ce(r))return{data:null,error:r};throw r}})}list(e,r,n){return J(this,void 0,void 0,function*(){try{const i=Object.assign(Object.assign(Object.assign({},Px),r),{prefix:e||""});return{data:yield Et(this.fetch,`${this.url}/object/list/${this.bucketId}`,i,{headers:this.headers},n),error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(Ce(i))return{data:null,error:i};throw i}})}listV2(e,r){return J(this,void 0,void 0,function*(){try{const n=Object.assign({},e);return{data:yield Et(this.fetch,`${this.url}/object/list-v2/${this.bucketId}`,n,{headers:this.headers},r),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Ce(n))return{data:null,error:n};throw n}})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const r=[];return e.width&&r.push(`width=${e.width}`),e.height&&r.push(`height=${e.height}`),e.resize&&r.push(`resize=${e.resize}`),e.format&&r.push(`format=${e.format}`),e.quality&&r.push(`quality=${e.quality}`),r.join("&")}}const Rh="2.78.0",Uh={"X-Client-Info":`storage-js/${Rh}`};class Tx{constructor(e,r={},n,i){this.shouldThrowOnError=!1;const a=new URL(e);i!=null&&i.useNewHostname&&/supabase\.(co|in|red)$/.test(a.hostname)&&!a.hostname.includes("storage.supabase.")&&(a.hostname=a.hostname.replace("supabase.","storage.supabase.")),this.url=a.href.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},Uh),r),this.fetch=Ll(n)}throwOnError(){return this.shouldThrowOnError=!0,this}listBuckets(e){return J(this,void 0,void 0,function*(){try{const r=this.listBucketOptionsToQueryString(e);return{data:yield Bi(this.fetch,`${this.url}/bucket${r}`,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Ce(r))return{data:null,error:r};throw r}})}getBucket(e){return J(this,void 0,void 0,function*(){try{return{data:yield Bi(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Ce(r))return{data:null,error:r};throw r}})}createBucket(e){return J(this,arguments,void 0,function*(r,n={public:!1}){try{return{data:yield Et(this.fetch,`${this.url}/bucket`,{id:r,name:r,type:n.type,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:this.headers}),error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(Ce(i))return{data:null,error:i};throw i}})}updateBucket(e,r){return J(this,void 0,void 0,function*(){try{return{data:yield Ul(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Ce(n))return{data:null,error:n};throw n}})}emptyBucket(e){return J(this,void 0,void 0,function*(){try{return{data:yield Et(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Ce(r))return{data:null,error:r};throw r}})}deleteBucket(e){return J(this,void 0,void 0,function*(){try{return{data:yield Fl(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Ce(r))return{data:null,error:r};throw r}})}listBucketOptionsToQueryString(e){const r={};return e&&("limit"in e&&(r.limit=String(e.limit)),"offset"in e&&(r.offset=String(e.offset)),e.search&&(r.search=e.search),e.sortColumn&&(r.sortColumn=e.sortColumn),e.sortOrder&&(r.sortOrder=e.sortOrder)),Object.keys(r).length>0?"?"+new URLSearchParams(r).toString():""}}class $x{constructor(e,r={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},Uh),r),this.fetch=Ll(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(e){return J(this,void 0,void 0,function*(){try{return{data:yield Et(this.fetch,`${this.url}/bucket`,{name:e},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Ce(r))return{data:null,error:r};throw r}})}listBuckets(e){return J(this,void 0,void 0,function*(){try{const r=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&r.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&r.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&r.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&r.set("sortOrder",e.sortOrder),e!=null&&e.search&&r.set("search",e.search);const n=r.toString(),i=n?`${this.url}/bucket?${n}`:`${this.url}/bucket`;return{data:yield Bi(this.fetch,i,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Ce(r))return{data:null,error:r};throw r}})}deleteBucket(e){return J(this,void 0,void 0,function*(){try{return{data:yield Fl(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Ce(r))return{data:null,error:r};throw r}})}}const Wl={"X-Client-Info":`storage-js/${Rh}`,"Content-Type":"application/json"};class Fh extends Error{constructor(e){super(e),this.__isStorageVectorsError=!0,this.name="StorageVectorsError"}}function lt(t){return typeof t=="object"&&t!==null&&"__isStorageVectorsError"in t}class ql extends Fh{constructor(e,r,n){super(e),this.name="StorageVectorsApiError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class jx extends Fh{constructor(e,r){super(e),this.name="StorageVectorsUnknownError",this.originalError=r}}var Wh;(function(t){t.InternalError="InternalError",t.S3VectorConflictException="S3VectorConflictException",t.S3VectorNotFoundException="S3VectorNotFoundException",t.S3VectorBucketNotEmpty="S3VectorBucketNotEmpty",t.S3VectorMaxBucketsExceeded="S3VectorMaxBucketsExceeded",t.S3VectorMaxIndexesExceeded="S3VectorMaxIndexesExceeded"})(Wh||(Wh={}));const zl=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>kr).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)},kx=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)},qh=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),Cx=(t,e,r)=>J(void 0,void 0,void 0,function*(){if(t&&typeof t=="object"&&"status"in t&&"ok"in t&&typeof t.status=="number"&&!(r!=null&&r.noResolveJson)){const i=t.status||500,a=t;if(typeof a.json=="function")a.json().then(o=>{const s=(o==null?void 0:o.statusCode)||(o==null?void 0:o.code)||i+"";e(new ql(qh(o),i,s))}).catch(()=>{const o=i+"",s=a.statusText||`HTTP ${i} error`;e(new ql(s,i,o))});else{const o=i+"",s=a.statusText||`HTTP ${i} error`;e(new ql(s,i,o))}}else e(new jx(qh(t),t))}),Ix=(t,e,r,n)=>{const i={method:t,headers:(e==null?void 0:e.headers)||{}};return n?(kx(n)?(i.headers=Object.assign({"Content-Type":"application/json"},e==null?void 0:e.headers),i.body=JSON.stringify(n)):i.body=n,Object.assign(Object.assign({},i),r)):i};function Nx(t,e,r,n,i,a){return J(this,void 0,void 0,function*(){return new Promise((o,s)=>{t(r,Ix(e,n,i,a)).then(l=>{if(!l.ok)throw l;if(n!=null&&n.noResolveJson)return l;const u=l.headers.get("content-type");return!u||!u.includes("application/json")?{}:l.json()}).then(l=>o(l)).catch(l=>Cx(l,s,n))})})}function ut(t,e,r,n,i){return J(this,void 0,void 0,function*(){return Nx(t,"POST",e,n,i,r)})}class Mx{constructor(e,r={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},Wl),r),this.fetch=zl(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createIndex(e){return J(this,void 0,void 0,function*(){try{return{data:(yield ut(this.fetch,`${this.url}/CreateIndex`,e,{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(lt(r))return{data:null,error:r};throw r}})}getIndex(e,r){return J(this,void 0,void 0,function*(){try{return{data:yield ut(this.fetch,`${this.url}/GetIndex`,{vectorBucketName:e,indexName:r},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(lt(n))return{data:null,error:n};throw n}})}listIndexes(e){return J(this,void 0,void 0,function*(){try{return{data:yield ut(this.fetch,`${this.url}/ListIndexes`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(lt(r))return{data:null,error:r};throw r}})}deleteIndex(e,r){return J(this,void 0,void 0,function*(){try{return{data:(yield ut(this.fetch,`${this.url}/DeleteIndex`,{vectorBucketName:e,indexName:r},{headers:this.headers}))||{},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(lt(n))return{data:null,error:n};throw n}})}}class Dx{constructor(e,r={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},Wl),r),this.fetch=zl(n)}throwOnError(){return this.shouldThrowOnError=!0,this}putVectors(e){return J(this,void 0,void 0,function*(){try{if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return{data:(yield ut(this.fetch,`${this.url}/PutVectors`,e,{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(lt(r))return{data:null,error:r};throw r}})}getVectors(e){return J(this,void 0,void 0,function*(){try{return{data:yield ut(this.fetch,`${this.url}/GetVectors`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(lt(r))return{data:null,error:r};throw r}})}listVectors(e){return J(this,void 0,void 0,function*(){try{if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return{data:yield ut(this.fetch,`${this.url}/ListVectors`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(lt(r))return{data:null,error:r};throw r}})}queryVectors(e){return J(this,void 0,void 0,function*(){try{return{data:yield ut(this.fetch,`${this.url}/QueryVectors`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(lt(r))return{data:null,error:r};throw r}})}deleteVectors(e){return J(this,void 0,void 0,function*(){try{if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return{data:(yield ut(this.fetch,`${this.url}/DeleteVectors`,e,{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(lt(r))return{data:null,error:r};throw r}})}}class Lx{constructor(e,r={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},Wl),r),this.fetch=zl(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(e){return J(this,void 0,void 0,function*(){try{return{data:(yield ut(this.fetch,`${this.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(lt(r))return{data:null,error:r};throw r}})}getBucket(e){return J(this,void 0,void 0,function*(){try{return{data:yield ut(this.fetch,`${this.url}/GetVectorBucket`,{vectorBucketName:e},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(lt(r))return{data:null,error:r};throw r}})}listBuckets(){return J(this,arguments,void 0,function*(e={}){try{return{data:yield ut(this.fetch,`${this.url}/ListVectorBuckets`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(lt(r))return{data:null,error:r};throw r}})}deleteBucket(e){return J(this,void 0,void 0,function*(){try{return{data:(yield ut(this.fetch,`${this.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(lt(r))return{data:null,error:r};throw r}})}}class Bx extends Lx{constructor(e,r={}){super(e,r.headers||{},r.fetch)}from(e){return new Rx(this.url,this.headers,e,this.fetch)}}class Rx extends Mx{constructor(e,r,n,i){super(e,r,i),this.vectorBucketName=n}createIndex(e){const r=Object.create(null,{createIndex:{get:()=>super.createIndex}});return J(this,void 0,void 0,function*(){return r.createIndex.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName}))})}listIndexes(){const e=Object.create(null,{listIndexes:{get:()=>super.listIndexes}});return J(this,arguments,void 0,function*(r={}){return e.listIndexes.call(this,Object.assign(Object.assign({},r),{vectorBucketName:this.vectorBucketName}))})}getIndex(e){const r=Object.create(null,{getIndex:{get:()=>super.getIndex}});return J(this,void 0,void 0,function*(){return r.getIndex.call(this,this.vectorBucketName,e)})}deleteIndex(e){const r=Object.create(null,{deleteIndex:{get:()=>super.deleteIndex}});return J(this,void 0,void 0,function*(){return r.deleteIndex.call(this,this.vectorBucketName,e)})}index(e){return new Ux(this.url,this.headers,this.vectorBucketName,e,this.fetch)}}class Ux extends Dx{constructor(e,r,n,i,a){super(e,r,a),this.vectorBucketName=n,this.indexName=i}putVectors(e){const r=Object.create(null,{putVectors:{get:()=>super.putVectors}});return J(this,void 0,void 0,function*(){return r.putVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}getVectors(e){const r=Object.create(null,{getVectors:{get:()=>super.getVectors}});return J(this,void 0,void 0,function*(){return r.getVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}listVectors(){const e=Object.create(null,{listVectors:{get:()=>super.listVectors}});return J(this,arguments,void 0,function*(r={}){return e.listVectors.call(this,Object.assign(Object.assign({},r),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}queryVectors(e){const r=Object.create(null,{queryVectors:{get:()=>super.queryVectors}});return J(this,void 0,void 0,function*(){return r.queryVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}deleteVectors(e){const r=Object.create(null,{deleteVectors:{get:()=>super.deleteVectors}});return J(this,void 0,void 0,function*(){return r.deleteVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}}class Fx extends Tx{constructor(e,r={},n,i){super(e,r,n,i)}from(e){return new Ex(this.url,this.headers,e,this.fetch)}get vectors(){return new Bx(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new $x(this.url+"/iceberg",this.headers,this.fetch)}}const Wx="2.78.0";let Ri="";typeof Deno<"u"?Ri="deno":typeof document<"u"?Ri="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Ri="react-native":Ri="node";const qx={headers:{"X-Client-Info":`supabase-js-${Ri}/${Wx}`}},zx={schema:"public"},Kx={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},Vx={},Hx=t=>{let e;return t?e=t:typeof fetch>"u"?e=oh:e=fetch,(...r)=>e(...r)},Gx=()=>typeof Headers>"u"?sh:Headers,Yx=(t,e,r)=>{const n=Hx(r),i=Gx();return async(a,o)=>{var s;const l=(s=await e())!==null&&s!==void 0?s:t;let u=new i(o==null?void 0:o.headers);return u.has("apikey")||u.set("apikey",t),u.has("Authorization")||u.set("Authorization",`Bearer ${l}`),n(a,Object.assign(Object.assign({},o),{headers:u}))}};function Xx(t){return t.endsWith("/")?t:t+"/"}function Jx(t,e){var r,n;const{db:i,auth:a,realtime:o,global:s}=t,{db:l,auth:u,realtime:c,global:f}=e,d={db:Object.assign(Object.assign({},l),i),auth:Object.assign(Object.assign({},u),a),realtime:Object.assign(Object.assign({},c),o),storage:{},global:Object.assign(Object.assign(Object.assign({},f),s),{headers:Object.assign(Object.assign({},(r=f==null?void 0:f.headers)!==null&&r!==void 0?r:{}),(n=s==null?void 0:s.headers)!==null&&n!==void 0?n:{})}),accessToken:async()=>""};return t.accessToken?d.accessToken=t.accessToken:delete d.accessToken,d}function Zx(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(Xx(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}const zh="2.78.0",bn=30*1e3,Kl=3,Vl=Kl*bn,Qx="http://localhost:9999",eO="supabase.auth.token",tO={"X-Client-Info":`gotrue-js/${zh}`},Hl="X-Supabase-Api-Version",Kh={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},rO=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,nO=10*60*1e3;class Ui extends Error{constructor(e,r,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}}function Z(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class iO extends Ui{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.code=n}}function aO(t){return Z(t)&&t.name==="AuthApiError"}class Ir extends Ui{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}}class fr extends Ui{constructor(e,r,n,i){super(e,n,i),this.name=r,this.status=n}}class Tt extends fr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function oO(t){return Z(t)&&t.name==="AuthSessionMissingError"}class wn extends fr{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class po extends fr{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class vo extends fr{constructor(e,r=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function sO(t){return Z(t)&&t.name==="AuthImplicitGrantRedirectError"}class Vh extends fr{constructor(e,r=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class Gl extends fr{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}}function Yl(t){return Z(t)&&t.name==="AuthRetryableFetchError"}class Hh extends fr{constructor(e,r,n){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}}class Xl extends fr{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const yo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Gh=`
|
|
24
|
+
\r=`.split(""),lO=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<Gh.length;e+=1)t[Gh[e].charCodeAt(0)]=-2;for(let e=0;e<yo.length;e+=1)t[yo[e].charCodeAt(0)]=e;return t})();function Yh(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(yo[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(yo[n]),e.queuedBits-=6}}function Xh(t,e,r){const n=lO[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 Jh(t){const e=[],r=o=>{e.push(String.fromCodePoint(o))},n={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},a=o=>{fO(o,n,r)};for(let o=0;o<t.length;o+=1)Xh(t.charCodeAt(o),i,a);return e.join("")}function uO(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 cO(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}uO(n,e)}}function fO(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)){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 _n(t){const e=[],r={queue:0,queuedBits:0},n=i=>{e.push(i)};for(let i=0;i<t.length;i+=1)Xh(t.charCodeAt(i),r,n);return new Uint8Array(e)}function dO(t){const e=[];return cO(t,r=>e.push(r)),new Uint8Array(e)}function Nr(t){const e=[],r={queue:0,queuedBits:0},n=i=>{e.push(i)};return t.forEach(i=>Yh(i,r,n)),Yh(null,r,n),e.join("")}function hO(t){return Math.round(Date.now()/1e3)+t}function pO(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=Math.random()*16|0;return(t=="x"?e:e&3|8).toString(16)})}const Qe=()=>typeof window<"u"&&typeof document<"u",Mr={tested:!1,writable:!1},Zh=()=>{if(!Qe())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Mr.tested)return Mr.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),Mr.tested=!0,Mr.writable=!0}catch{Mr.tested=!0,Mr.writable=!1}return Mr.writable};function vO(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 Qh=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>kr).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)},yO=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",xn=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))},Dr=async(t,e)=>{const r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return r}},dr=async(t,e)=>{await t.removeItem(e)};class go{constructor(){this.promise=new go.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}}go.promiseConstructor=Promise;function Jl(t){const e=t.split(".");if(e.length!==3)throw new Xl("Invalid JWT structure");for(let n=0;n<e.length;n++)if(!rO.test(e[n]))throw new Xl("JWT not in base64url format");return{header:JSON.parse(Jh(e[0])),payload:JSON.parse(Jh(e[1])),signature:_n(e[2]),raw:{header:e[0],payload:e[1]}}}async function gO(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function mO(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 bO(t){return("0"+t.toString(16)).substr(-2)}function wO(){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,bO).join("")}async function _O(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 xO(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 _O(t);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function On(t,e,r=!1){const n=wO();let i=n;r&&(i+="/PASSWORD_RECOVERY"),await xn(t,`${e}-code-verifier`,i);const a=await xO(n);return[a,n===a?"plain":"s256"]}const OO=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function SO(t){const e=t.headers.get(Hl);if(!e||!e.match(OO))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function AO(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 PO(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 EO=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Sn(t){if(!EO.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Zl(){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 TO(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 ep(t){return JSON.parse(JSON.stringify(t))}const Lr=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),$O=[502,503,504];async function tp(t){var e;if(!yO(t))throw new Gl(Lr(t),0);if($O.includes(t.status))throw new Gl(Lr(t),t.status);let r;try{r=await t.json()}catch(a){throw new Ir(Lr(a),a)}let n;const i=SO(t);if(i&&i.getTime()>=Kh["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 Hh(Lr(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(n==="session_not_found")throw new Tt}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 Hh(Lr(r),t.status,r.weak_password.reasons);throw new iO(Lr(r),t.status||500,n)}const jO=(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 oe(t,e,r,n){var i;const a=Object.assign({},n==null?void 0:n.headers);a[Hl]||(a[Hl]=Kh["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 s=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",l=await kO(t,e,r+s,{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(l):{data:Object.assign({},l),error:null}}async function kO(t,e,r,n,i,a){const o=jO(e,n,i,a);let s;try{s=await t(r,Object.assign({},o))}catch(l){throw console.error(l),new Gl(Lr(l),0)}if(s.ok||await tp(s),n!=null&&n.noResolveJson)return s;try{return await s.json()}catch(l){await tp(l)}}function $t(t){var e;let r=null;NO(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=hO(t.expires_in)));const n=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:r,user:n},error:null}}function rp(t){const e=$t(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 hr(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function CO(t){return{data:t,error:null}}function IO(t){const{action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:a}=t,o=pn(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),s={action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:a},l=Object.assign({},o);return{data:{properties:s,user:l},error:null}}function np(t){return t}function NO(t){return t.access_token&&t.refresh_token&&t.expires_in}const Ql=["global","local","others"];class MO{constructor({url:e="",headers:r={},fetch:n}){this.url=e,this.headers=r,this.fetch=Qh(n),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)}}async signOut(e,r=Ql[0]){if(Ql.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Ql.join(", ")}`);try{return await oe(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if(Z(n))return{data:null,error:n};throw n}}async inviteUserByEmail(e,r={}){try{return await oe(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:hr})}catch(n){if(Z(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{const{options:r}=e,n=pn(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 oe(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:IO,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(Z(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(e){try{return await oe(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:hr})}catch(r){if(Z(r))return{data:{user:null},error:r};throw r}}async listUsers(e){var r,n,i,a,o,s,l;try{const u={nextPage:null,lastPage:0,total:0},c=await oe(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:np});if(c.error)throw c.error;const f=await c.json(),d=(o=c.headers.get("x-total-count"))!==null&&o!==void 0?o:0,h=(l=(s=c.headers.get("link"))===null||s===void 0?void 0:s.split(","))!==null&&l!==void 0?l:[];return h.length>0&&(h.forEach(y=>{const v=parseInt(y.split(";")[0].split("=")[1].substring(0,1)),p=JSON.parse(y.split(";")[1].split("=")[1]);u[`${p}Page`]=v}),u.total=parseInt(d)),{data:Object.assign(Object.assign({},f),u),error:null}}catch(u){if(Z(u))return{data:{users:[]},error:u};throw u}}async getUserById(e){Sn(e);try{return await oe(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:hr})}catch(r){if(Z(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){Sn(e);try{return await oe(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:hr})}catch(n){if(Z(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,r=!1){Sn(e);try{return await oe(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:hr})}catch(n){if(Z(n))return{data:{user:null},error:n};throw n}}async _listFactors(e){Sn(e.userId);try{const{data:r,error:n}=await oe(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(Z(r))return{data:null,error:r};throw r}}async _deleteFactor(e){Sn(e.userId),Sn(e.id);try{return{data:await oe(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(r){if(Z(r))return{data:null,error:r};throw r}}async _listOAuthClients(e){var r,n,i,a,o,s,l;try{const u={nextPage:null,lastPage:0,total:0},c=await oe(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:np});if(c.error)throw c.error;const f=await c.json(),d=(o=c.headers.get("x-total-count"))!==null&&o!==void 0?o:0,h=(l=(s=c.headers.get("link"))===null||s===void 0?void 0:s.split(","))!==null&&l!==void 0?l:[];return h.length>0&&(h.forEach(y=>{const v=parseInt(y.split(";")[0].split("=")[1].substring(0,1)),p=JSON.parse(y.split(";")[1].split("=")[1]);u[`${p}Page`]=v}),u.total=parseInt(d)),{data:Object.assign(Object.assign({},f),u),error:null}}catch(u){if(Z(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(e){try{return await oe(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Z(r))return{data:null,error:r};throw r}}async _getOAuthClient(e){try{return await oe(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Z(r))return{data:null,error:r};throw r}}async _updateOAuthClient(e,r){try{return await oe(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Z(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(e){try{return await oe(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Z(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(e){try{return await oe(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Z(r))return{data:null,error:r};throw r}}}function ip(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}const An={debug:!!(globalThis&&Zh()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class ap extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class DO extends ap{}async function LO(t,e,r){An.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);const n=new globalThis.AbortController;return e>0&&setTimeout(()=>{n.abort(),An.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async i=>{if(i){An.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,i.name);try{return await r()}finally{An.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,i.name)}}else{if(e===0)throw An.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new DO(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(An.debug)try{const a=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(a,null," "))}catch(a){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",a)}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"),await r()}}))}function BO(){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 op(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}" is invalid.`);return t.toLowerCase()}function RO(t){return parseInt(t,16)}function UO(t){const e=new TextEncoder().encode(t);return"0x"+Array.from(e,n=>n.toString(16).padStart(2,"0")).join("")}function FO(t){var e;const{chainId:r,domain:n,expirationTime:i,issuedAt:a=new Date,nonce:o,notBefore:s,requestId:l,resources:u,scheme:c,uri:f,version:d}=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(d!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${d}`);if(!((e=t.statement)===null||e===void 0)&&e.includes(`
|
|
25
|
+
`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${t.statement}`)}const h=op(t.address),y=c?`${c}://${n}`:n,v=t.statement?`${t.statement}
|
|
55
26
|
`:"",p=`${y} wants you to sign in with your Ethereum account:
|
|
56
27
|
${h}
|
|
57
28
|
|
|
@@ -61,12 +32,12 @@ Chain ID: ${r}${o?`
|
|
|
61
32
|
Nonce: ${o}`:""}
|
|
62
33
|
Issued At: ${a.toISOString()}`;if(i&&(m+=`
|
|
63
34
|
Expiration Time: ${i.toISOString()}`),s&&(m+=`
|
|
64
|
-
Not Before: ${s.toISOString()}`),
|
|
65
|
-
Request ID: ${
|
|
66
|
-
Resources:`;for(const
|
|
67
|
-
- ${
|
|
68
|
-
${m}`}class Ke 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}}class Wo extends Ke{constructor(e,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:e}),this.name="WebAuthnUnknownError",this.originalError=r}}function AS({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 Ke({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 Ke({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 Ke({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 Ke({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 Ke({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new Ke({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return a.pubKeyCredParams.filter(s=>s.type==="public-key").length===0?new Ke({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new Ke({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(Mp(o)){if(a.rp.id!==o)return new Ke({message:`The RP ID "${a.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Ke({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 Ke({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 Ke({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 Ke({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function PS({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 Ke({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new Ke({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const n=window.location.hostname;if(Mp(n)){if(r.rpId!==n)return new Ke({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Ke({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new Ke({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 Ke({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}class ES{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 TS=new ES;function jS(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=$n(t,["challenge","user","excludeCredentials"]),a=Rn(e).buffer,o=Object.assign(Object.assign({},r),{id:Rn(r.id).buffer}),s=Object.assign(Object.assign({},i),{challenge:a,user:o});if(n&&n.length>0){s.excludeCredentials=new Array(n.length);for(let u=0;u<n.length;u++){const l=n[u];s.excludeCredentials[u]=Object.assign(Object.assign({},l),{id:Rn(l.id).buffer,type:l.type||"public-key",transports:l.transports})}}return s}function $S(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=$n(t,["challenge","allowCredentials"]),i=Rn(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 s=r[o];a.allowCredentials[o]=Object.assign(Object.assign({},s),{id:Rn(s.id).buffer,type:s.type||"public-key",transports:s.transports})}}return a}function kS(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:Xr(new Uint8Array(t.response.attestationObject)),clientDataJSON:Xr(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function CS(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:Xr(new Uint8Array(i.authenticatorData)),clientDataJSON:Xr(new Uint8Array(i.clientDataJSON)),signature:Xr(new Uint8Array(i.signature)),userHandle:i.userHandle?Xr(new Uint8Array(i.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function Mp(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function Dp(){var t,e;return!!(lt()&&"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 IS(t){try{const e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new Wo("Browser returned unexpected credential type",e)}:{data:null,error:new Wo("Empty credential response",e)}}catch(e){return{data:null,error:AS({error:e,options:t})}}}async function NS(t){try{const e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new Wo("Browser returned unexpected credential type",e)}:{data:null,error:new Wo("Empty credential response",e)}}catch(e){return{data:null,error:PS({error:e,options:t})}}}const MS={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"none"},DS={userVerification:"preferred",hints:["security-key"]};function qo(...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 s=n[a];e(s)?n[a]=qo(s,o):n[a]=qo(o)}else n[a]=o}return n}function RS(t,e){return qo(MS,t,e||{})}function LS(t,e){return qo(DS,t,e||{})}class BS{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){try{const{data:o,error:s}=await this.client.mfa.challenge({factorId:e,webauthn:r});if(!o)return{data:null,error:s};const u=i??TS.createNewAbortSignal();if(o.webauthn.type==="create"){const{user:l}=o.webauthn.credential_options.publicKey;l.name||(l.name=`${l.id}:${n}`),l.displayName||(l.displayName=l.name)}switch(o.webauthn.type){case"create":{const l=RS(o.webauthn.credential_options.publicKey,a==null?void 0:a.create),{data:c,error:f}=await IS({publicKey:l,signal:u});return c?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:c}},error:null}:{data:null,error:f}}case"request":{const l=LS(o.webauthn.credential_options.publicKey,a==null?void 0:a.request),{data:c,error:f}=await NS(Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:l,signal:u}));return c?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:c}},error:null}:{data:null,error:f}}}}catch(o){return ie(o)?{data:null,error:o}:{data:null,error:new Yr("Unexpected error in challenge",o)}}}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 sa("rpId is required for WebAuthn authentication")};try{if(!Dp())return{data:null,error:new Yr("Browser does not support WebAuthn",null)};const{data:o,error:s}=await this.challenge({factorId:e,webauthn:{rpId:r,rpOrigins:n},signal:i},{request:a});if(!o)return{data:null,error:s};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 ie(o)?{data:null,error:o}:{data:null,error:new Yr("Unexpected error in authenticate",o)}}}async _register({friendlyName:e,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 sa("rpId is required for WebAuthn registration")};try{if(!Dp())return{data:null,error:new Yr("Browser does not support WebAuthn",null)};const{data:o,error:s}=await this._enroll({friendlyName:e});if(!o)return await this.client.mfa.listFactors().then(c=>{var f;return(f=c.data)===null||f===void 0?void 0:f.all.find(d=>d.factor_type==="webauthn"&&d.friendly_name===e&&d.status!=="unverified")}).then(c=>c?this.client.mfa.unenroll({factorId:c==null?void 0:c.id}):void 0),{data:null,error:s};const{data:u,error:l}=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:l}}catch(o){return ie(o)?{data:null,error:o}:{data:null,error:new Yr("Unexpected error in register",o)}}}}_S();const US={url:DO,storageKey:RO,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:LO,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function Rp(t,e,r){return await r()}const Wn={};class ua{get jwks(){var e,r;return(r=(e=Wn[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(e){Wn[this.storageKey]=Object.assign(Object.assign({},Wn[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,r;return(r=(e=Wn[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){Wn[this.storageKey]=Object.assign(Object.assign({},Wn[this.storageKey]),{cachedAt:e})}constructor(e){var r,n;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=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,this.instanceID=ua.nextInstanceID,ua.nextInstanceID+=1,this.instanceID>0&<()&&console.warn("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.");const i=Object.assign(Object.assign({},US),e);if(this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.persistSession=i.persistSession,this.storageKey=i.storageKey,this.autoRefreshToken=i.autoRefreshToken,this.admin=new mS({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=Ep(i.fetch),this.lock=i.lock||Rp,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,i.lock?this.lock=i.lock:lt()&&(!((r=globalThis==null?void 0:globalThis.navigator)===null||r===void 0)&&r.locks)?this.lock=wS:this.lock=Rp,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 BS(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this)},this.persistSession?(i.storage?this.storage=i.storage:Pp()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Cp(this.memoryStorage)),i.userStorage&&(this.userStorage=i.userStorage)):(this.memoryStorage={},this.storage=Cp(this.memoryStorage)),lt()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(a){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",a)}(n=this.broadcastChannel)===null||n===void 0||n.addEventListener("message",async a=>{this._debug("received broadcast notification from other tab or client",a),await this._notifyAllSubscribers(a.data.event,a.data.session,!1)})}this.initialize()}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${mp}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{const r=ZO(window.location.href);let n="none";if(this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce"),lt()&&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),zO(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 await this._removeSession(),{error:a}}const{session:o,redirectType:s}=i;return this._debug("#_initialize()","detected session in URL",o,"redirect type",s),await this._saveSession(o),setTimeout(async()=>{s==="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 ie(r)?{error:r}:{error:new Yr("Unexpected error during initialization",r)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,n,i;try{const a=await ce(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:qt}),{data:o,error:s}=a;if(s||!o)return{data:{user:null,session:null},error:s};const u=o.session,l=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",u)),{data:{user:l,session:u},error:null}}catch(a){if(ie(a))return{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:c,password:f,options:d}=e;let h=null,y=null;this.flowType==="pkce"&&([h,y]=await Bn(this.storage,this.storageKey)),a=await ce(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:d==null?void 0:d.emailRedirectTo,body:{email:c,password:f,data:(r=d==null?void 0:d.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:d==null?void 0:d.captchaToken},code_challenge:h,code_challenge_method:y},xform:qt})}else if("phone"in e){const{phone:c,password:f,options:d}=e;a=await ce(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:c,password:f,data:(n=d==null?void 0:d.data)!==null&&n!==void 0?n:{},channel:(i=d==null?void 0:d.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:d==null?void 0:d.captchaToken}},xform:qt})}else throw new Lo("You must provide either an email or phone number and a password");const{data:o,error:s}=a;if(s||!o)return{data:{user:null,session:null},error:s};const u=o.session,l=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",u)),{data:{user:l,session:u},error:null}}catch(a){if(ie(a))return{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:s}=e;r=await ce(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:a,password:o,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}},xform:$p})}else if("phone"in e){const{phone:a,password:o,options:s}=e;r=await ce(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:a,password:o,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}},xform:$p})}else throw new Lo("You must provide either an email or phone number and a password");const{data:n,error:i}=r;return i?{data:{user:null,session:null},error:i}:!n||!n.session||!n.user?{data:{user:null,session:null},error:new Dn}:(n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),{data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:i})}catch(r){if(ie(r))return{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(-1,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,s,u,l,c,f,d;let h,y;if("message"in e)h=e.message,y=e.signature;else{const{chain:v,wallet:p,statement:m,options:b}=e;let w;if(lt())if(typeof p=="object")w=p;else{const E=window;if("ethereum"in E&&typeof E.ethereum=="object"&&"request"in E.ethereum&&typeof E.ethereum.request=="function")w=E.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 p!="object"||!(b!=null&&b.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");w=p}const O=new URL((r=b==null?void 0:b.url)!==null&&r!==void 0?r:window.location.href),g=await w.request({method:"eth_requestAccounts"}).then(E=>E).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!g||g.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const _=Np(g[0]);let S=(n=b==null?void 0:b.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!S){const E=await w.request({method:"eth_chainId"});S=xS(E)}const A={domain:O.host,address:_,statement:m,uri:O.href,version:"1",chainId:S,nonce:(i=b==null?void 0:b.signInWithEthereum)===null||i===void 0?void 0:i.nonce,issuedAt:(o=(a=b==null?void 0:b.signInWithEthereum)===null||a===void 0?void 0:a.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(s=b==null?void 0:b.signInWithEthereum)===null||s===void 0?void 0:s.expirationTime,notBefore:(u=b==null?void 0:b.signInWithEthereum)===null||u===void 0?void 0:u.notBefore,requestId:(l=b==null?void 0:b.signInWithEthereum)===null||l===void 0?void 0:l.requestId,resources:(c=b==null?void 0:b.signInWithEthereum)===null||c===void 0?void 0:c.resources};h=SS(A),y=await w.request({method:"personal_sign",params:[OS(h),_]})}try{const{data:v,error:p}=await ce(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:h,signature:y},!((f=e.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(d=e.options)===null||d===void 0?void 0:d.captchaToken}}:null),xform:qt});if(p)throw p;return!v||!v.session||!v.user?{data:{user:null,session:null},error:new Dn}:(v.session&&(await this._saveSession(v.session),await this._notifyAllSubscribers("SIGNED_IN",v.session)),{data:Object.assign({},v),error:p})}catch(v){if(ie(v))return{data:{user:null,session:null},error:v};throw v}}async signInWithSolana(e){var r,n,i,a,o,s,u,l,c,f,d,h;let y,v;if("message"in e)y=e.message,v=e.signature;else{const{chain:p,wallet:m,statement:b,options:w}=e;let O;if(lt())if(typeof m=="object")O=m;else{const _=window;if("solana"in _&&typeof _.solana=="object"&&("signIn"in _.solana&&typeof _.solana.signIn=="function"||"signMessage"in _.solana&&typeof _.solana.signMessage=="function"))O=_.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 m!="object"||!(w!=null&&w.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");O=m}const g=new URL((r=w==null?void 0:w.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in O&&O.signIn){const _=await O.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},w==null?void 0:w.signInWithSolana),{version:"1",domain:g.host,uri:g.href}),b?{statement:b}:null));let S;if(Array.isArray(_)&&_[0]&&typeof _[0]=="object")S=_[0];else if(_&&typeof _=="object"&&"signedMessage"in _&&"signature"in _)S=_;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in S&&"signature"in S&&(typeof S.signedMessage=="string"||S.signedMessage instanceof Uint8Array)&&S.signature instanceof Uint8Array)y=typeof S.signedMessage=="string"?S.signedMessage:new TextDecoder().decode(S.signedMessage),v=S.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in O)||typeof O.signMessage!="function"||!("publicKey"in O)||typeof O!="object"||!O.publicKey||!("toBase58"in O.publicKey)||typeof O.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");y=[`${g.host} wants you to sign in with your Solana account:`,O.publicKey.toBase58(),...b?["",b,""]:[""],"Version: 1",`URI: ${g.href}`,`Issued At: ${(i=(n=w==null?void 0:w.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&i!==void 0?i:new Date().toISOString()}`,...!((a=w==null?void 0:w.signInWithSolana)===null||a===void 0)&&a.notBefore?[`Not Before: ${w.signInWithSolana.notBefore}`]:[],...!((o=w==null?void 0:w.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${w.signInWithSolana.expirationTime}`]:[],...!((s=w==null?void 0:w.signInWithSolana)===null||s===void 0)&&s.chainId?[`Chain ID: ${w.signInWithSolana.chainId}`]:[],...!((u=w==null?void 0:w.signInWithSolana)===null||u===void 0)&&u.nonce?[`Nonce: ${w.signInWithSolana.nonce}`]:[],...!((l=w==null?void 0:w.signInWithSolana)===null||l===void 0)&&l.requestId?[`Request ID: ${w.signInWithSolana.requestId}`]:[],...!((f=(c=w==null?void 0:w.signInWithSolana)===null||c===void 0?void 0:c.resources)===null||f===void 0)&&f.length?["Resources",...w.signInWithSolana.resources.map(S=>`- ${S}`)]:[]].join(`
|
|
69
|
-
`);const _=await O.signMessage(new TextEncoder().encode(y),"utf8");if(!_||!(_ instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");v=_}}try{const{data:p,error:m}=await ce(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:y,signature:Xr(v)},!((d=e.options)===null||d===void 0)&&d.captchaToken?{gotrue_meta_security:{captcha_token:(h=e.options)===null||h===void 0?void 0:h.captchaToken}}:null),xform:qt});if(m)throw m;return!p||!p.session||!p.user?{data:{user:null,session:null},error:new Dn}:(p.session&&(await this._saveSession(p.session),await this._notifyAllSubscribers("SIGNED_IN",p.session)),{data:Object.assign({},p),error:m})}catch(p){if(ie(p))return{data:{user:null,session:null},error:p};throw p}}async _exchangeCodeForSession(e){const r=await Zr(this.storage,`${this.storageKey}-code-verifier`),[n,i]=(r??"").split("/");try{const{data:a,error:o}=await ce(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:qt});if(await Er(this.storage,`${this.storageKey}-code-verifier`),o)throw o;return!a||!a.session||!a.user?{data:{user:null,session:null,redirectType:null},error:new Dn}:(a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),{data:Object.assign(Object.assign({},a),{redirectType:i??null}),error:o})}catch(a){if(ie(a))return{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,s=await ce(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:qt}),{data:u,error:l}=s;return l?{data:{user:null,session:null},error:l}:!u||!u.session||!u.user?{data:{user:null,session:null},error:new Dn}:(u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",u.session)),{data:u,error:l})}catch(r){if(ie(r))return{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:s,options:u}=e;let l=null,c=null;this.flowType==="pkce"&&([l,c]=await Bn(this.storage,this.storageKey));const{error:f}=await ce(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:s,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:l,code_challenge_method:c},redirectTo:u==null?void 0:u.emailRedirectTo});return{data:{user:null,session:null},error:f}}if("phone"in e){const{phone:s,options:u}=e,{data:l,error:c}=await ce(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:s,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{data:{user:null,session:null,messageId:l==null?void 0:l.message_id},error:c}}throw new Lo("You must provide either an email or phone number.")}catch(s){if(ie(s))return{data:{user:null,session:null},error:s};throw s}}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:s}=await ce(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:a}}),redirectTo:i,xform:qt});if(s)throw s;if(!o)throw new Error("An error occurred on token verification.");const u=o.session,l=o.user;return u!=null&&u.access_token&&(await this._saveSession(u),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",u)),{data:{user:l,session:u},error:null}}catch(i){if(ie(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithSSO(e){var r,n,i;try{let a=null,o=null;return this.flowType==="pkce"&&([a,o]=await Bn(this.storage,this.storageKey)),await ce(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:a,code_challenge_method:o}),headers:this.headers,xform:vS})}catch(a){if(ie(a))return{data:null,error:a};throw a}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,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 Wt;const{error:i}=await ce(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return{data:{user:null,session:null},error:i}})}catch(e){if(ie(e))return{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 ce(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{data:{user:null,session:null},error:o}}else if("phone"in e){const{phone:n,type:i,options:a}=e,{data:o,error:s}=await ce(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:i,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}}});return{data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:s}}throw new Lo("You must provide either an email or phone number and a type")}catch(r){if(ie(r))return{data:{user:null,session:null},error:r};throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,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 Zr(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()<yl:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",e.expires_at),!n){if(this.userStorage){const o=await Zr(this.userStorage,this.storageKey+"-user");o!=null&&o.user?e.user=o.user:e.user=xl()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const o={value:this.suppressGetSessionWarning};e.user=fS(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?{data:{session:null},error:a}:{data:{session:i},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await ce(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:Tr}):await this._useSession(async r=>{var n,i,a;const{data:o,error:s}=r;if(s)throw s;return!(!((n=o.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Wt}:await ce(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:Tr})})}catch(r){if(ie(r))return qO(r)&&(await this._removeSession(),await Er(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:r};throw r}}async updateUser(e,r={}){return await this.initializePromise,await this._acquireLock(-1,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 Wt;const o=i.session;let s=null,u=null;this.flowType==="pkce"&&e.email!=null&&([s,u]=await Bn(this.storage,this.storageKey));const{data:l,error:c}=await ce(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:s,code_challenge_method:u}),jwt:o.access_token,xform:Tr});if(c)throw c;return o.user=l.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),{data:{user:o.user},error:null}})}catch(n){if(ie(n))return{data:{user:null},error:n};throw n}}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new Wt;const r=Date.now()/1e3;let n=r,i=!0,a=null;const{payload:o}=_l(e.access_token);if(o.exp&&(n=o.exp,i=n<=r),i){const{data:s,error:u}=await this._callRefreshToken(e.refresh_token);if(u)return{data:{user:null,session:null},error:u};if(!s)return{data:{user:null,session:null},error:null};a=s}else{const{data:s,error:u}=await this._getUser(e.access_token);if(u)throw u;a={access_token:e.access_token,refresh_token:e.refresh_token,user:s.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)}return{data:{user:a.user,session:a},error:null}}catch(r){if(ie(r))return{data:{session:null,user:null},error:r};throw r}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async r=>{var n;if(!e){const{data:o,error:s}=r;if(s)throw s;e=(n=o.session)!==null&&n!==void 0?n:void 0}if(!(e!=null&&e.refresh_token))throw new Wt;const{data:i,error:a}=await this._callRefreshToken(e.refresh_token);return a?{data:{user:null,session:null},error:a}:i?{data:{user:i.user,session:i},error:null}:{data:{user:null,session:null},error:null}})}catch(r){if(ie(r))return{data:{user:null,session:null},error:r};throw r}}async _getSessionFromURL(e,r){try{if(!lt())throw new Bo("No browser detected.");if(e.error||e.error_description||e.error_code)throw new Bo(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 wp("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Bo("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 wp("No code detected.");const{data:b,error:w}=await this._exchangeCodeForSession(e.code);if(w)throw w;const O=new URL(window.location.href);return O.searchParams.delete("code"),window.history.replaceState(window.history.state,"",O.toString()),{data:{session:b.session,redirectType:null},error:null}}const{provider_token:n,provider_refresh_token:i,access_token:a,refresh_token:o,expires_in:s,expires_at:u,token_type:l}=e;if(!a||!s||!o||!l)throw new Bo("No session defined in URL");const c=Math.round(Date.now()/1e3),f=parseInt(s);let d=c+f;u&&(d=parseInt(u));const h=d-c;h*1e3<=Mn&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${h}s, should have been closer to ${f}s`);const y=d-f;c-y>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",y,d,c):c-y<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",y,d,c);const{data:v,error:p}=await this._getUser(a);if(p)throw p;const m={provider_token:n,provider_refresh_token:i,access_token:a,expires_in:f,expires_at:d,refresh_token:o,token_type:l,user:v.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:m,redirectType:e.type},error:null}}catch(n){if(ie(n))return{data:{session:null,redirectType:null},error:n};throw n}}_isImplicitGrantCallback(e){return!!(e.access_token||e.error_description)}async _isPKCECallback(e){const r=await Zr(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&r)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,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)return{error:a};const o=(n=i.session)===null||n===void 0?void 0:n.access_token;if(o){const{error:s}=await this.admin.signOut(o,e);if(s&&!(WO(s)&&(s.status===404||s.status===401||s.status===403)))return{error:s}}return e!=="others"&&(await this._removeSession(),await Er(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(e){const r=JO(),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(-1,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),console.error(a)}})}async resetPasswordForEmail(e,r={}){let n=null,i=null;this.flowType==="pkce"&&([n,i]=await Bn(this.storage,this.storageKey,!0));try{return await ce(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(ie(a))return{data:null,error:a};throw a}}async getUserIdentities(){var e;try{const{data:r,error:n}=await this.getUser();if(n)throw n;return{data:{identities:(e=r.user.identities)!==null&&e!==void 0?e:[]},error:null}}catch(r){if(ie(r))return{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,s,u,l,c;const{data:f,error:d}=a;if(d)throw d;const h=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(o=e.options)===null||o===void 0?void 0:o.redirectTo,scopes:(s=e.options)===null||s===void 0?void 0:s.scopes,queryParams:(u=e.options)===null||u===void 0?void 0:u.queryParams,skipBrowserRedirect:!0});return await ce(this.fetch,"GET",h,{headers:this.headers,jwt:(c=(l=f.session)===null||l===void 0?void 0:l.access_token)!==null&&c!==void 0?c:void 0})});if(i)throw i;return lt()&&!(!((r=e.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n==null?void 0:n.url),{data:{provider:e.provider,url:n==null?void 0:n.url},error:null}}catch(n){if(ie(n))return{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:s,token:u,access_token:l,nonce:c}=e,f=await ce(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:s,id_token:u,access_token:l,nonce:c,link_identity:!0,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:qt}),{data:d,error:h}=f;return h?{data:{user:null,session:null},error:h}:!d||!d.session||!d.user?{data:{user:null,session:null},error:new Dn}:(d.session&&(await this._saveSession(d.session),await this._notifyAllSubscribers("USER_UPDATED",d.session)),{data:d,error:h})}catch(i){if(ie(i))return{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 ce(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(ie(r))return{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 tS(async i=>(i>0&&await eS(200*Math.pow(2,i-1)),this._debug(r,"refreshing attempt",i),await ce(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:qt})),(i,a)=>{const o=200*Math.pow(2,i);return a&&bl(a)&&Date.now()+o-n<Mn})}catch(n){if(this._debug(r,"error",n),ie(n))return{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),lt()&&!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 Zr(this.storage,this.storageKey);if(i&&this.userStorage){let o=await Zr(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:i.user},await Ln(this.userStorage,this.storageKey+"-user",o)),i.user=(e=o==null?void 0:o.user)!==null&&e!==void 0?e:xl()}else if(i&&!i.user&&!i.user){const o=await Zr(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(i.user=o.user,await Er(this.storage,this.storageKey+"-user"),await Ln(this.storage,this.storageKey,i)):i.user=xl()}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()<yl;if(this._debug(n,`session has${a?"":" not"} expired with margin of ${yl}s`),a){if(this.autoRefreshToken&&i.refresh_token){const{error:o}=await this._callRefreshToken(i.refresh_token);o&&(console.error(o),bl(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:s}=await this._getUser(i.access_token);!s&&(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 Wt;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const i=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new Fo;const{data:a,error:o}=await this._refreshAccessToken(e);if(o)throw o;if(!a.session)throw new Wt;await this._saveSession(a.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",a.session);const s={data:a.session,error:null};return this.refreshingDeferred.resolve(s),s}catch(a){if(this._debug(i,"error",a),ie(a)){const o={data:null,error:a};return bl(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 s=>{try{await s.callback(e,r)}catch(u){a.push(u)}});if(await Promise.all(o),a.length>0){for(let s=0;s<a.length;s+=1)console.error(a[s]);throw a[0]}}finally{this._debug(i,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0;const r=Object.assign({},e),n=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&r.user&&await Ln(this.userStorage,this.storageKey+"-user",{user:r.user});const i=Object.assign({},r);delete i.user;const a=Tp(i);await Ln(this.storage,this.storageKey,a)}else{const i=Tp(r);await Ln(this.storage,this.storageKey,i)}}async _removeSession(){this._debug("#_removeSession()"),await Er(this.storage,this.storageKey),await Er(this.storage,this.storageKey+"-code-verifier"),await Er(this.storage,this.storageKey+"-user"),this.userStorage&&await Er(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&<()&&(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(),Mn);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}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)/Mn);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${Mn}ms, refresh threshold is ${vl} ticks`),i<=vl&&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.isAcquireTimeout||e instanceof Ip)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!lt()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),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(-1,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 Bn(this.storage,this.storageKey),s=new URLSearchParams({code_challenge:`${encodeURIComponent(a)}`,code_challenge_method:`${encodeURIComponent(o)}`});i.push(s.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?{data:null,error:a}:await ce(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(ie(r))return{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{data:null,error:o};const s=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:l}=await ce(this.fetch,"POST",`${this.url}/factors`,{body:s,headers:this.headers,jwt:(n=a==null?void 0:a.session)===null||n===void 0?void 0:n.access_token});return l?{data:null,error:l}:(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}`),{data:u,error:null})})}catch(r){if(ie(r))return{data:null,error:r};throw r}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;const{data:i,error:a}=r;if(a)return{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"?kS(e.webauthn.credential_response):CS(e.webauthn.credential_response)})}:{code:e.code}),{data:s,error:u}=await ce(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?{data:null,error:u}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+s.expires_in},s)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",s),{data:s,error:u})})}catch(r){if(ie(r))return{data:null,error:r};throw r}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;const{data:i,error:a}=r;if(a)return{data:null,error:a};const o=await ce(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:s}=o;if(s.type!=="webauthn")return{data:s,error:null};switch(s.webauthn.type){case"create":return{data:Object.assign(Object.assign({},s),{webauthn:Object.assign(Object.assign({},s.webauthn),{credential_options:Object.assign(Object.assign({},s.webauthn.credential_options),{publicKey:jS(s.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},s),{webauthn:Object.assign(Object.assign({},s.webauthn),{credential_options:Object.assign(Object.assign({},s.webauthn.credential_options),{publicKey:$S(s.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(ie(r))return{data:null,error:r};throw r}})}async _challengeAndVerify(e){const{data:r,error:n}=await this._challenge({factorId:e.factorId});return n?{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(){var e,r;const{data:{session:n},error:i}=await this.getSession();if(i)return{data:null,error:i};if(!n)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:a}=_l(n.access_token);let o=null;a.aal&&(o=a.aal);let s=o;((r=(e=n.user.factors)===null||e===void 0?void 0:e.filter(c=>c.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(s="aal2");const l=a.amr||[];return{data:{currentLevel:o,nextLevel:s,currentAuthenticationMethods:l},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async r=>{const{data:{session:n},error:i}=r;return i?{data:null,error:i}:n?await ce(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:n.access_token,xform:a=>({data:a,error:null})}):{data:null,error:new Wt}})}catch(r){if(ie(r))return{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{data:null,error:a};if(!i)return{data:null,error:new Wt};const o=await ce(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"approve"},xform:s=>({data:s,error:null})});return o.data&&o.data.redirect_url&<()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(ie(n))return{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{data:null,error:a};if(!i)return{data:null,error:new Wt};const o=await ce(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"deny"},xform:s=>({data:s,error:null})});return o.data&&o.data.redirect_url&<()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(ie(n))return{data:null,error:n};throw n}}async fetchJwk(e,r={keys:[]}){let n=r.keys.find(s=>s.kid===e);if(n)return n;const i=Date.now();if(n=this.jwks.keys.find(s=>s.kid===e),n&&this.jwks_cached_at+UO>i)return n;const{data:a,error:o}=await ce(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(s=>s.kid===e),!n)?null:n}async getClaims(e,r={}){try{let n=e;if(!n){const{data:h,error:y}=await this.getSession();if(y||!h.session)return{data:null,error:y};n=h.session.access_token}const{header:i,payload:a,signature:o,raw:{header:s,payload:u}}=_l(n);r!=null&&r.allowExpired||uS(a.exp);const l=!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(!l){const{error:h}=await this.getUser(n);if(h)throw h;return{data:{claims:a,header:i,signature:o},error:null}}const c=lS(i.alg),f=await crypto.subtle.importKey("jwk",l,c,!0,["verify"]);if(!await crypto.subtle.verify(c,f,o,YO(`${s}.${u}`)))throw new wl("Invalid JWT signature");return{data:{claims:a,header:i,signature:o},error:null}}catch(n){if(ie(n))return{data:null,error:n};throw n}}}ua.nextInstanceID=0;const FS=ua;class WS extends FS{constructor(e){super(e)}}class qS{constructor(e,r,n){var i,a,o;this.supabaseUrl=e,this.supabaseKey=r;const s=MO(e);if(!r)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",s),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",s),this.storageUrl=new URL("storage/v1",s),this.functionsUrl=new URL("functions/v1",s);const u=`sb-${s.hostname.split(".")[0]}-auth-token`,l={db:EO,realtime:jO,auth:Object.assign(Object.assign({},TO),{storageKey:u}),global:PO},c=NO(n??{},l);this.storageKey=(i=c.auth.storageKey)!==null&&i!==void 0?i:"",this.headers=(a=c.global.headers)!==null&&a!==void 0?a:{},c.accessToken?(this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(f,d)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(d)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((o=c.auth)!==null&&o!==void 0?o:{},this.headers,c.global.fetch),this.fetch=CO(r,this._getAccessToken.bind(this),c.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},c.realtime)),this.rest=new Lx(new URL("rest/v1",s).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch}),this.storage=new SO(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new $x(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,r={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,r,n)}channel(e,r={config:{}}){return this.realtime.channel(e,r)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e,r;if(this.accessToken)return await this.accessToken();const{data:n}=await this.auth.getSession();return(r=(e=n.session)===null||e===void 0?void 0:e.access_token)!==null&&r!==void 0?r:this.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,userStorage:a,storageKey:o,flowType:s,lock:u,debug:l},c,f){const d={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new WS({url:this.authUrl.href,headers:Object.assign(Object.assign({},d),c),storageKey:o,autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,userStorage:a,flowType:s,lock:u,debug:l,fetch:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(h=>h.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new eO(this.realtimeUrl.href,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((r,n)=>{this._handleTokenChanged(r,"CLIENT",n==null?void 0:n.access_token)})}_handleTokenChanged(e,r,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const zS=(t,e,r)=>new qS(t,e,r);function KS(){if(typeof window<"u"||typeof process>"u")return!1;const t=process.version;if(t==null)return!1;const e=t.match(/^v(\d+)\./);return e?parseInt(e[1],10)<=18:!1}KS()&&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 ct=zS("https://qvfepptmcxwvalmbkgur.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InF2ZmVwcHRtY3h3dmFsbWJrZ3VyIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjE5MjE4NTEsImV4cCI6MjA3NzQ5Nzg1MX0.kuPTAjW1i54uJHZAAAZqAe-sZCKPHTdUPoRbAky-cQk",{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}});function Lp(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function VS(...t){return e=>{let r=!1;const n=t.map(i=>{const a=Lp(i,e);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let i=0;i<n.length;i++){const a=n[i];typeof a=="function"?a():Lp(t[i],null)}}}}function Bp(t){const e=GS(t),r=ve.forwardRef((n,i)=>{const{children:a,...o}=n,s=ve.Children.toArray(a),u=s.find(XS);if(u){const l=u.props.children,c=s.map(f=>f===u?ve.Children.count(l)>1?ve.Children.only(null):ve.isValidElement(l)?l.props.children:null:f);return P.jsx(e,{...o,ref:i,children:ve.isValidElement(l)?ve.cloneElement(l,void 0,c):null})}return P.jsx(e,{...o,ref:i,children:a})});return r.displayName=`${t}.Slot`,r}var HS=Bp("Slot");function GS(t){const e=ve.forwardRef((r,n)=>{const{children:i,...a}=r;if(ve.isValidElement(i)){const o=ZS(i),s=JS(a,i.props);return i.type!==ve.Fragment&&(s.ref=n?VS(n,o):o),ve.cloneElement(i,s)}return ve.Children.count(i)>1?ve.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var YS=Symbol("radix.slottable");function XS(t){return ve.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===YS}function JS(t,e){const r={...e};for(const n in e){const i=t[n],a=e[n];/^on[A-Z]/.test(n)?i&&a?r[n]=(...s)=>{const u=a(...s);return i(...s),u}:i&&(r[n]=i):n==="style"?r[n]={...i,...a}:n==="className"&&(r[n]=[i,a].filter(Boolean).join(" "))}return{...t,...r}}function ZS(t){var n,i;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}function Up(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=Up(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function le(){for(var t,e,r=0,n="",i=arguments.length;r<i;r++)(t=arguments[r])&&(e=Up(t))&&(n&&(n+=" "),n+=e);return n}const Fp=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Wp=le,QS=(t,e)=>r=>{var n;if((e==null?void 0:e.variants)==null)return Wp(t,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:i,defaultVariants:a}=e,o=Object.keys(i).map(l=>{const c=r==null?void 0:r[l],f=a==null?void 0:a[l];if(c===null)return null;const d=Fp(c)||Fp(f);return i[l][d]}),s=r&&Object.entries(r).reduce((l,c)=>{let[f,d]=c;return d===void 0||(l[f]=d),l},{}),u=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((l,c)=>{let{class:f,className:d,...h}=c;return Object.entries(h).every(y=>{let[v,p]=y;return Array.isArray(p)?p.includes({...a,...s}[v]):{...a,...s}[v]===p})?[...l,f,d]:l},[]);return Wp(t,o,u,r==null?void 0:r.class,r==null?void 0:r.className)},Sl="-",eA=t=>{const e=rA(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:o=>{const s=o.split(Sl);return s[0]===""&&s.length!==1&&s.shift(),qp(s,e)||tA(o)},getConflictingClassGroupIds:(o,s)=>{const u=r[o]||[];return s&&n[o]?[...u,...n[o]]:u}}},qp=(t,e)=>{var o;if(t.length===0)return e.classGroupId;const r=t[0],n=e.nextPart.get(r),i=n?qp(t.slice(1),n):void 0;if(i)return i;if(e.validators.length===0)return;const a=t.join(Sl);return(o=e.validators.find(({validator:s})=>s(a)))==null?void 0:o.classGroupId},zp=/^\[(.+)\]$/,tA=t=>{if(zp.test(t)){const e=zp.exec(t)[1],r=e==null?void 0:e.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}},rA=t=>{const{theme:e,prefix:r}=t,n={nextPart:new Map,validators:[]};return iA(Object.entries(t.classGroups),r).forEach(([a,o])=>{Al(o,n,a,e)}),n},Al=(t,e,r,n)=>{t.forEach(i=>{if(typeof i=="string"){const a=i===""?e:Kp(e,i);a.classGroupId=r;return}if(typeof i=="function"){if(nA(i)){Al(i(n),e,r,n);return}e.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([a,o])=>{Al(o,Kp(e,a),r,n)})})},Kp=(t,e)=>{let r=t;return e.split(Sl).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},nA=t=>t.isThemeGetter,iA=(t,e)=>e?t.map(([r,n])=>{const i=n.map(a=>typeof a=="string"?e+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([o,s])=>[e+o,s])):a);return[r,i]}):t,aA=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=new Map,n=new Map;const i=(a,o)=>{r.set(a,o),e++,e>t&&(e=0,n=r,r=new Map)};return{get(a){let o=r.get(a);if(o!==void 0)return o;if((o=n.get(a))!==void 0)return i(a,o),o},set(a,o){r.has(a)?r.set(a,o):i(a,o)}}},Vp="!",oA=t=>{const{separator:e,experimentalParseClassName:r}=t,n=e.length===1,i=e[0],a=e.length,o=s=>{const u=[];let l=0,c=0,f;for(let p=0;p<s.length;p++){let m=s[p];if(l===0){if(m===i&&(n||s.slice(p,p+a)===e)){u.push(s.slice(c,p)),c=p+a;continue}if(m==="/"){f=p;continue}}m==="["?l++:m==="]"&&l--}const d=u.length===0?s:s.substring(c),h=d.startsWith(Vp),y=h?d.substring(1):d,v=f&&f>c?f-c:void 0;return{modifiers:u,hasImportantModifier:h,baseClassName:y,maybePostfixModifierPosition:v}};return r?s=>r({className:s,parseClassName:o}):o},sA=t=>{if(t.length<=1)return t;const e=[];let r=[];return t.forEach(n=>{n[0]==="["?(e.push(...r.sort(),n),r=[]):r.push(n)}),e.push(...r.sort()),e},uA=t=>({cache:aA(t.cacheSize),parseClassName:oA(t),...eA(t)}),lA=/\s+/,cA=(t,e)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i}=e,a=[],o=t.trim().split(lA);let s="";for(let u=o.length-1;u>=0;u-=1){const l=o[u],{modifiers:c,hasImportantModifier:f,baseClassName:d,maybePostfixModifierPosition:h}=r(l);let y=!!h,v=n(y?d.substring(0,h):d);if(!v){if(!y){s=l+(s.length>0?" "+s:s);continue}if(v=n(d),!v){s=l+(s.length>0?" "+s:s);continue}y=!1}const p=sA(c).join(":"),m=f?p+Vp:p,b=m+v;if(a.includes(b))continue;a.push(b);const w=i(v,y);for(let O=0;O<w.length;++O){const g=w[O];a.push(m+g)}s=l+(s.length>0?" "+s:s)}return s};function fA(){let t=0,e,r,n="";for(;t<arguments.length;)(e=arguments[t++])&&(r=Hp(e))&&(n&&(n+=" "),n+=r);return n}const Hp=t=>{if(typeof t=="string")return t;let e,r="";for(let n=0;n<t.length;n++)t[n]&&(e=Hp(t[n]))&&(r&&(r+=" "),r+=e);return r};function dA(t,...e){let r,n,i,a=o;function o(u){const l=e.reduce((c,f)=>f(c),t());return r=uA(l),n=r.cache.get,i=r.cache.set,a=s,s(u)}function s(u){const l=n(u);if(l)return l;const c=cA(u,r);return i(u,c),c}return function(){return a(fA.apply(null,arguments))}}const De=t=>{const e=r=>r[t]||[];return e.isThemeGetter=!0,e},Gp=/^\[(?:([a-z-]+):)?(.+)\]$/i,hA=/^\d+\/\d+$/,pA=new Set(["px","full","screen"]),vA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,yA=/\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$/,gA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,mA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,bA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ur=t=>qn(t)||pA.has(t)||hA.test(t),jr=t=>zn(t,"length",EA),qn=t=>!!t&&!Number.isNaN(Number(t)),Pl=t=>zn(t,"number",qn),la=t=>!!t&&Number.isInteger(Number(t)),wA=t=>t.endsWith("%")&&qn(t.slice(0,-1)),he=t=>Gp.test(t),$r=t=>vA.test(t),_A=new Set(["length","size","percentage"]),xA=t=>zn(t,_A,Yp),OA=t=>zn(t,"position",Yp),SA=new Set(["image","url"]),AA=t=>zn(t,SA,jA),PA=t=>zn(t,"",TA),ca=()=>!0,zn=(t,e,r)=>{const n=Gp.exec(t);return n?n[1]?typeof e=="string"?n[1]===e:e.has(n[1]):r(n[2]):!1},EA=t=>yA.test(t)&&!gA.test(t),Yp=()=>!1,TA=t=>mA.test(t),jA=t=>bA.test(t),$A=dA(()=>{const t=De("colors"),e=De("spacing"),r=De("blur"),n=De("brightness"),i=De("borderColor"),a=De("borderRadius"),o=De("borderSpacing"),s=De("borderWidth"),u=De("contrast"),l=De("grayscale"),c=De("hueRotate"),f=De("invert"),d=De("gap"),h=De("gradientColorStops"),y=De("gradientColorStopPositions"),v=De("inset"),p=De("margin"),m=De("opacity"),b=De("padding"),w=De("saturate"),O=De("scale"),g=De("sepia"),_=De("skew"),S=De("space"),A=De("translate"),E=()=>["auto","contain","none"],N=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto",he,e],$=()=>[he,e],k=()=>["",ur,jr],I=()=>["auto",qn,he],R=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],M=()=>["solid","dashed","dotted","double","none"],L=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],q=()=>["start","end","center","between","around","evenly","stretch"],z=()=>["","0",he],D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[qn,he];return{cacheSize:500,separator:":",theme:{colors:[ca],spacing:[ur,jr],blur:["none","",$r,he],brightness:B(),borderColor:[t],borderRadius:["none","","full",$r,he],borderSpacing:$(),borderWidth:k(),contrast:B(),grayscale:z(),hueRotate:B(),invert:z(),gap:$(),gradientColorStops:[t],gradientColorStopPositions:[wA,jr],inset:j(),margin:j(),opacity:B(),padding:$(),saturate:B(),scale:B(),sepia:z(),skew:B(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",he]}],container:["container"],columns:[{columns:[$r]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"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"],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:[...R(),he]}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",la,he]}],basis:[{basis:j()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",he]}],grow:[{grow:z()}],shrink:[{shrink:z()}],order:[{order:["first","last","none",la,he]}],"grid-cols":[{"grid-cols":[ca]}],"col-start-end":[{col:["auto",{span:["full",la,he]},he]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[ca]}],"row-start-end":[{row:["auto",{span:[la,he]},he]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",he]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",he]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",...q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[p]}],mx:[{mx:[p]}],my:[{my:[p]}],ms:[{ms:[p]}],me:[{me:[p]}],mt:[{mt:[p]}],mr:[{mr:[p]}],mb:[{mb:[p]}],ml:[{ml:[p]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",he,e]}],"min-w":[{"min-w":[he,e,"min","max","fit"]}],"max-w":[{"max-w":[he,e,"none","full","min","max","fit","prose",{screen:[$r]},$r]}],h:[{h:[he,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[he,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[he,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[he,e,"auto","min","max","fit"]}],"font-size":[{text:["base",$r,jr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Pl]}],"font-family":[{font:[ca]}],"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:["tighter","tight","normal","wide","wider","widest",he]}],"line-clamp":[{"line-clamp":["none",qn,Pl]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ur,he]}],"list-image":[{"list-image":["none",he]}],"list-style-type":[{list:["none","disc","decimal",he]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...M(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ur,jr]}],"underline-offset":[{"underline-offset":["auto",ur,he]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",he]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",he]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...R(),OA]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",xA]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},AA]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[m]}],"border-style":[{border:[...M(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[m]}],"divide-style":[{divide:M()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...M()]}],"outline-offset":[{"outline-offset":[ur,he]}],"outline-w":[{outline:[ur,jr]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:k()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[ur,jr]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",$r,PA]}],"shadow-color":[{shadow:[ca]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":[...L(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":L()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",$r,he]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[g]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[m]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[g]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",he]}],duration:[{duration:B()}],ease:[{ease:["linear","in","out","in-out",he]}],delay:[{delay:B()}],animate:[{animate:["none","spin","ping","pulse","bounce",he]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[O]}],"scale-x":[{"scale-x":[O]}],"scale-y":[{"scale-y":[O]}],rotate:[{rotate:[la,he]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[_]}],"skew-y":[{"skew-y":[_]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",he]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],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",he]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"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",he]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[ur,jr,Pl]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-s","border-w-e","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-s","border-color-e","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"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","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-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"]}}});function it(...t){return $A(le(t))}const kA=QS("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),El=ve.forwardRef(({className:t,variant:e,size:r,asChild:n=!1,...i},a)=>{const o=n?HS:"button";return P.jsx(o,{className:it(kA({variant:e,size:r,className:t})),ref:a,...i})});El.displayName="Button";var CA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],IA=CA.reduce((t,e)=>{const r=Bp(`Primitive.${e}`),n=ve.forwardRef((i,a)=>{const{asChild:o,...s}=i,u=o?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),P.jsx(u,{...s,ref:a})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{}),NA="Separator",Xp="horizontal",MA=["horizontal","vertical"],Jp=ve.forwardRef((t,e)=>{const{decorative:r,orientation:n=Xp,...i}=t,a=DA(n)?n:Xp,s=r?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return P.jsx(IA.div,{"data-orientation":a,...s,...i,ref:e})});Jp.displayName=NA;function DA(t){return MA.includes(t)}var Zp=Jp;const Qp=ve.forwardRef(({className:t,orientation:e="horizontal",decorative:r=!0,...n},i)=>P.jsx(Zp,{ref:i,decorative:r,orientation:e,className:it("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...n}));Qp.displayName=Zp.displayName;const en=ve.forwardRef(({className:t,...e},r)=>P.jsx("div",{ref:r,className:it("rounded-lg border bg-card text-card-foreground shadow-sm",t),...e}));en.displayName="Card";const Tl=ve.forwardRef(({className:t,...e},r)=>P.jsx("div",{ref:r,className:it("flex flex-col space-y-1.5 p-6",t),...e}));Tl.displayName="CardHeader";const RA=ve.forwardRef(({className:t,...e},r)=>P.jsx("h3",{ref:r,className:it("text-2xl font-semibold leading-none tracking-tight",t),...e}));RA.displayName="CardTitle";const LA=ve.forwardRef(({className:t,...e},r)=>P.jsx("p",{ref:r,className:it("text-sm text-muted-foreground",t),...e}));LA.displayName="CardDescription";const jl=ve.forwardRef(({className:t,...e},r)=>P.jsx("div",{ref:r,className:it("p-6 pt-0",t),...e}));jl.displayName="CardContent";const BA=ve.forwardRef(({className:t,...e},r)=>P.jsx("div",{ref:r,className:it("flex items-center p-6 pt-0",t),...e}));BA.displayName="CardFooter";var UA=Array.isArray,yt=UA,FA=typeof Eo=="object"&&Eo&&Eo.Object===Object&&Eo,ev=FA,WA=ev,qA=typeof self=="object"&&self&&self.Object===Object&&self,zA=WA||qA||Function("return this")(),Qt=zA,KA=Qt,VA=KA.Symbol,fa=VA,tv=fa,rv=Object.prototype,HA=rv.hasOwnProperty,GA=rv.toString,da=tv?tv.toStringTag:void 0;function YA(t){var e=HA.call(t,da),r=t[da];try{t[da]=void 0;var n=!0}catch{}var i=GA.call(t);return n&&(e?t[da]=r:delete t[da]),i}var XA=YA,JA=Object.prototype,ZA=JA.toString;function QA(t){return ZA.call(t)}var eP=QA,nv=fa,tP=XA,rP=eP,nP="[object Null]",iP="[object Undefined]",iv=nv?nv.toStringTag:void 0;function aP(t){return t==null?t===void 0?iP:nP:iv&&iv in Object(t)?tP(t):rP(t)}var lr=aP;function oP(t){return t!=null&&typeof t=="object"}var cr=oP,sP=lr,uP=cr,lP="[object Symbol]";function cP(t){return typeof t=="symbol"||uP(t)&&sP(t)==lP}var Kn=cP,fP=yt,dP=Kn,hP=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,pP=/^\w*$/;function vP(t,e){if(fP(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||dP(t)?!0:pP.test(t)||!hP.test(t)||e!=null&&t in Object(e)}var $l=vP;function yP(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var kr=yP;const Vn=je(kr);var gP=lr,mP=kr,bP="[object AsyncFunction]",wP="[object Function]",_P="[object GeneratorFunction]",xP="[object Proxy]";function OP(t){if(!mP(t))return!1;var e=gP(t);return e==wP||e==_P||e==bP||e==xP}var kl=OP;const ae=je(kl);var SP=Qt,AP=SP["__core-js_shared__"],PP=AP,Cl=PP,av=function(){var t=/[^.]+$/.exec(Cl&&Cl.keys&&Cl.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function EP(t){return!!av&&av in t}var TP=EP,jP=Function.prototype,$P=jP.toString;function kP(t){if(t!=null){try{return $P.call(t)}catch{}try{return t+""}catch{}}return""}var ov=kP,CP=kl,IP=TP,NP=kr,MP=ov,DP=/[\\^$.*+?()[\]{}|]/g,RP=/^\[object .+?Constructor\]$/,LP=Function.prototype,BP=Object.prototype,UP=LP.toString,FP=BP.hasOwnProperty,WP=RegExp("^"+UP.call(FP).replace(DP,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function qP(t){if(!NP(t)||IP(t))return!1;var e=CP(t)?WP:RP;return e.test(MP(t))}var zP=qP;function KP(t,e){return t==null?void 0:t[e]}var VP=KP,HP=zP,GP=VP;function YP(t,e){var r=GP(t,e);return HP(r)?r:void 0}var tn=YP,XP=tn,JP=XP(Object,"create"),zo=JP,sv=zo;function ZP(){this.__data__=sv?sv(null):{},this.size=0}var QP=ZP;function eE(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var tE=eE,rE=zo,nE="__lodash_hash_undefined__",iE=Object.prototype,aE=iE.hasOwnProperty;function oE(t){var e=this.__data__;if(rE){var r=e[t];return r===nE?void 0:r}return aE.call(e,t)?e[t]:void 0}var sE=oE,uE=zo,lE=Object.prototype,cE=lE.hasOwnProperty;function fE(t){var e=this.__data__;return uE?e[t]!==void 0:cE.call(e,t)}var dE=fE,hE=zo,pE="__lodash_hash_undefined__";function vE(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=hE&&e===void 0?pE:e,this}var yE=vE,gE=QP,mE=tE,bE=sE,wE=dE,_E=yE;function Hn(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Hn.prototype.clear=gE,Hn.prototype.delete=mE,Hn.prototype.get=bE,Hn.prototype.has=wE,Hn.prototype.set=_E;var xE=Hn;function OE(){this.__data__=[],this.size=0}var SE=OE;function AE(t,e){return t===e||t!==t&&e!==e}var Il=AE,PE=Il;function EE(t,e){for(var r=t.length;r--;)if(PE(t[r][0],e))return r;return-1}var Ko=EE,TE=Ko,jE=Array.prototype,$E=jE.splice;function kE(t){var e=this.__data__,r=TE(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():$E.call(e,r,1),--this.size,!0}var CE=kE,IE=Ko;function NE(t){var e=this.__data__,r=IE(e,t);return r<0?void 0:e[r][1]}var ME=NE,DE=Ko;function RE(t){return DE(this.__data__,t)>-1}var LE=RE,BE=Ko;function UE(t,e){var r=this.__data__,n=BE(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var FE=UE,WE=SE,qE=CE,zE=ME,KE=LE,VE=FE;function Gn(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Gn.prototype.clear=WE,Gn.prototype.delete=qE,Gn.prototype.get=zE,Gn.prototype.has=KE,Gn.prototype.set=VE;var Vo=Gn,HE=tn,GE=Qt,YE=HE(GE,"Map"),Nl=YE,uv=xE,XE=Vo,JE=Nl;function ZE(){this.size=0,this.__data__={hash:new uv,map:new(JE||XE),string:new uv}}var QE=ZE;function e1(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var t1=e1,r1=t1;function n1(t,e){var r=t.__data__;return r1(e)?r[typeof e=="string"?"string":"hash"]:r.map}var Ho=n1,i1=Ho;function a1(t){var e=i1(this,t).delete(t);return this.size-=e?1:0,e}var o1=a1,s1=Ho;function u1(t){return s1(this,t).get(t)}var l1=u1,c1=Ho;function f1(t){return c1(this,t).has(t)}var d1=f1,h1=Ho;function p1(t,e){var r=h1(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var v1=p1,y1=QE,g1=o1,m1=l1,b1=d1,w1=v1;function Yn(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Yn.prototype.clear=y1,Yn.prototype.delete=g1,Yn.prototype.get=m1,Yn.prototype.has=b1,Yn.prototype.set=w1;var Ml=Yn,lv=Ml,_1="Expected a function";function Dl(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(_1);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=t.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(Dl.Cache||lv),r}Dl.Cache=lv;var cv=Dl;const x1=je(cv);var O1=cv,S1=500;function A1(t){var e=O1(t,function(n){return r.size===S1&&r.clear(),n}),r=e.cache;return e}var P1=A1,E1=P1,T1=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,j1=/\\(\\)?/g,$1=E1(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(T1,function(r,n,i,a){e.push(i?a.replace(j1,"$1"):n||r)}),e}),k1=$1;function C1(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var Rl=C1,fv=fa,I1=Rl,N1=yt,M1=Kn,D1=1/0,dv=fv?fv.prototype:void 0,hv=dv?dv.toString:void 0;function pv(t){if(typeof t=="string")return t;if(N1(t))return I1(t,pv)+"";if(M1(t))return hv?hv.call(t):"";var e=t+"";return e=="0"&&1/t==-D1?"-0":e}var R1=pv,L1=R1;function B1(t){return t==null?"":L1(t)}var vv=B1,U1=yt,F1=$l,W1=k1,q1=vv;function z1(t,e){return U1(t)?t:F1(t,e)?[t]:W1(q1(t))}var yv=z1,K1=Kn,V1=1/0;function H1(t){if(typeof t=="string"||K1(t))return t;var e=t+"";return e=="0"&&1/t==-V1?"-0":e}var Go=H1,G1=yv,Y1=Go;function X1(t,e){e=G1(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Y1(e[r++])];return r&&r==n?t:void 0}var Ll=X1,J1=Ll;function Z1(t,e,r){var n=t==null?void 0:J1(t,e);return n===void 0?r:n}var gv=Z1;const xt=je(gv);function Q1(t){return t==null}var eT=Q1;const fe=je(eT);var tT=lr,rT=yt,nT=cr,iT="[object String]";function aT(t){return typeof t=="string"||!rT(t)&&nT(t)&&tT(t)==iT}var oT=aT;const rn=je(oT);var Bl={exports:{}},xe={};/**
|
|
35
|
+
Not Before: ${s.toISOString()}`),l&&(m+=`
|
|
36
|
+
Request ID: ${l}`),u){let w=`
|
|
37
|
+
Resources:`;for(const b of u){if(!b||typeof b!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${b}`);w+=`
|
|
38
|
+
- ${b}`}m+=w}return`${p}
|
|
39
|
+
${m}`}class De 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}}class mo extends De{constructor(e,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:e}),this.name="WebAuthnUnknownError",this.originalError=r}}function WO({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 De({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 De({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 De({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 De({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 De({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new De({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return a.pubKeyCredParams.filter(s=>s.type==="public-key").length===0?new De({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new De({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(sp(o)){if(a.rp.id!==o)return new De({message:`The RP ID "${a.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new De({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 De({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 De({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 De({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function qO({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 De({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new De({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const n=window.location.hostname;if(sp(n)){if(r.rpId!==n)return new De({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new De({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new De({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 De({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}class zO{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 KO=new zO;function VO(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=pn(t,["challenge","user","excludeCredentials"]),a=_n(e).buffer,o=Object.assign(Object.assign({},r),{id:_n(r.id).buffer}),s=Object.assign(Object.assign({},i),{challenge:a,user:o});if(n&&n.length>0){s.excludeCredentials=new Array(n.length);for(let l=0;l<n.length;l++){const u=n[l];s.excludeCredentials[l]=Object.assign(Object.assign({},u),{id:_n(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return s}function HO(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=pn(t,["challenge","allowCredentials"]),i=_n(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 s=r[o];a.allowCredentials[o]=Object.assign(Object.assign({},s),{id:_n(s.id).buffer,type:s.type||"public-key",transports:s.transports})}}return a}function GO(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:Nr(new Uint8Array(t.response.attestationObject)),clientDataJSON:Nr(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function YO(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:Nr(new Uint8Array(i.authenticatorData)),clientDataJSON:Nr(new Uint8Array(i.clientDataJSON)),signature:Nr(new Uint8Array(i.signature)),userHandle:i.userHandle?Nr(new Uint8Array(i.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function sp(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function lp(){var t,e;return!!(Qe()&&"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 XO(t){try{const e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new mo("Browser returned unexpected credential type",e)}:{data:null,error:new mo("Empty credential response",e)}}catch(e){return{data:null,error:WO({error:e,options:t})}}}async function JO(t){try{const e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new mo("Browser returned unexpected credential type",e)}:{data:null,error:new mo("Empty credential response",e)}}catch(e){return{data:null,error:qO({error:e,options:t})}}}const ZO={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"none"},QO={userVerification:"preferred",hints:["security-key"]};function bo(...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 s=n[a];e(s)?n[a]=bo(s,o):n[a]=bo(o)}else n[a]=o}return n}function eS(t,e){return bo(ZO,t,e||{})}function tS(t,e){return bo(QO,t,e||{})}class rS{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){try{const{data:o,error:s}=await this.client.mfa.challenge({factorId:e,webauthn:r});if(!o)return{data:null,error:s};const l=i??KO.createNewAbortSignal();if(o.webauthn.type==="create"){const{user:u}=o.webauthn.credential_options.publicKey;u.name||(u.name=`${u.id}:${n}`),u.displayName||(u.displayName=u.name)}switch(o.webauthn.type){case"create":{const u=eS(o.webauthn.credential_options.publicKey,a==null?void 0:a.create),{data:c,error:f}=await XO({publicKey:u,signal:l});return c?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:c}},error:null}:{data:null,error:f}}case"request":{const u=tS(o.webauthn.credential_options.publicKey,a==null?void 0:a.request),{data:c,error:f}=await JO(Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:u,signal:l}));return c?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:c}},error:null}:{data:null,error:f}}}}catch(o){return Z(o)?{data:null,error:o}:{data:null,error:new Ir("Unexpected error in challenge",o)}}}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 Ui("rpId is required for WebAuthn authentication")};try{if(!lp())return{data:null,error:new Ir("Browser does not support WebAuthn",null)};const{data:o,error:s}=await this.challenge({factorId:e,webauthn:{rpId:r,rpOrigins:n},signal:i},{request:a});if(!o)return{data:null,error:s};const{webauthn:l}=o;return this._verify({factorId:e,challengeId:o.challengeId,webauthn:{type:l.type,rpId:r,rpOrigins:n,credential_response:l.credential_response}})}catch(o){return Z(o)?{data:null,error:o}:{data:null,error:new Ir("Unexpected error in authenticate",o)}}}async _register({friendlyName:e,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 Ui("rpId is required for WebAuthn registration")};try{if(!lp())return{data:null,error:new Ir("Browser does not support WebAuthn",null)};const{data:o,error:s}=await this._enroll({friendlyName:e});if(!o)return await this.client.mfa.listFactors().then(c=>{var f;return(f=c.data)===null||f===void 0?void 0:f.all.find(d=>d.factor_type==="webauthn"&&d.friendly_name===e&&d.status!=="unverified")}).then(c=>c?this.client.mfa.unenroll({factorId:c==null?void 0:c.id}):void 0),{data:null,error:s};const{data:l,error:u}=await this._challenge({factorId:o.id,friendlyName:o.friendly_name,webauthn:{rpId:r,rpOrigins:n},signal:i},{create:a});return l?this._verify({factorId:o.id,challengeId:l.challengeId,webauthn:{rpId:r,rpOrigins:n,type:l.webauthn.type,credential_response:l.webauthn.credential_response}}):{data:null,error:u}}catch(o){return Z(o)?{data:null,error:o}:{data:null,error:new Ir("Unexpected error in register",o)}}}}BO();const nS={url:Qx,storageKey:eO,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:tO,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function up(t,e,r){return await r()}const Pn={};class Fi{get jwks(){var e,r;return(r=(e=Pn[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(e){Pn[this.storageKey]=Object.assign(Object.assign({},Pn[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,r;return(r=(e=Pn[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){Pn[this.storageKey]=Object.assign(Object.assign({},Pn[this.storageKey]),{cachedAt:e})}constructor(e){var r,n;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=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,this.instanceID=Fi.nextInstanceID,Fi.nextInstanceID+=1,this.instanceID>0&&Qe()&&console.warn("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.");const i=Object.assign(Object.assign({},nS),e);if(this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.persistSession=i.persistSession,this.storageKey=i.storageKey,this.autoRefreshToken=i.autoRefreshToken,this.admin=new MO({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=Qh(i.fetch),this.lock=i.lock||up,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,i.lock?this.lock=i.lock:Qe()&&(!((r=globalThis==null?void 0:globalThis.navigator)===null||r===void 0)&&r.locks)?this.lock=LO:this.lock=up,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 rS(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this)},this.persistSession?(i.storage?this.storage=i.storage:Zh()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=ip(this.memoryStorage)),i.userStorage&&(this.userStorage=i.userStorage)):(this.memoryStorage={},this.storage=ip(this.memoryStorage)),Qe()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(a){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",a)}(n=this.broadcastChannel)===null||n===void 0||n.addEventListener("message",async a=>{this._debug("received broadcast notification from other tab or client",a),await this._notifyAllSubscribers(a.data.event,a.data.session,!1)})}this.initialize()}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${zh}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{const r=vO(window.location.href);let n="none";if(this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce"),Qe()&&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),sO(a)){const l=(e=a.details)===null||e===void 0?void 0:e.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="single_identity_not_deletable")return{error:a}}return await this._removeSession(),{error:a}}const{session:o,redirectType:s}=i;return this._debug("#_initialize()","detected session in URL",o,"redirect type",s),await this._saveSession(o),setTimeout(async()=>{s==="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 Z(r)?{error:r}:{error:new Ir("Unexpected error during initialization",r)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,n,i;try{const a=await oe(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:$t}),{data:o,error:s}=a;if(s||!o)return{data:{user:null,session:null},error:s};const l=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",l)),{data:{user:u,session:l},error:null}}catch(a){if(Z(a))return{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:c,password:f,options:d}=e;let h=null,y=null;this.flowType==="pkce"&&([h,y]=await On(this.storage,this.storageKey)),a=await oe(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:d==null?void 0:d.emailRedirectTo,body:{email:c,password:f,data:(r=d==null?void 0:d.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:d==null?void 0:d.captchaToken},code_challenge:h,code_challenge_method:y},xform:$t})}else if("phone"in e){const{phone:c,password:f,options:d}=e;a=await oe(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:c,password:f,data:(n=d==null?void 0:d.data)!==null&&n!==void 0?n:{},channel:(i=d==null?void 0:d.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:d==null?void 0:d.captchaToken}},xform:$t})}else throw new po("You must provide either an email or phone number and a password");const{data:o,error:s}=a;if(s||!o)return{data:{user:null,session:null},error:s};const l=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",l)),{data:{user:u,session:l},error:null}}catch(a){if(Z(a))return{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:s}=e;r=await oe(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:a,password:o,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}},xform:rp})}else if("phone"in e){const{phone:a,password:o,options:s}=e;r=await oe(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:a,password:o,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}},xform:rp})}else throw new po("You must provide either an email or phone number and a password");const{data:n,error:i}=r;return i?{data:{user:null,session:null},error:i}:!n||!n.session||!n.user?{data:{user:null,session:null},error:new wn}:(n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),{data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:i})}catch(r){if(Z(r))return{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(-1,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,s,l,u,c,f,d;let h,y;if("message"in e)h=e.message,y=e.signature;else{const{chain:v,wallet:p,statement:m,options:w}=e;let b;if(Qe())if(typeof p=="object")b=p;else{const E=window;if("ethereum"in E&&typeof E.ethereum=="object"&&"request"in E.ethereum&&typeof E.ethereum.request=="function")b=E.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 p!="object"||!(w!=null&&w.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");b=p}const O=new URL((r=w==null?void 0:w.url)!==null&&r!==void 0?r:window.location.href),g=await b.request({method:"eth_requestAccounts"}).then(E=>E).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!g||g.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const _=op(g[0]);let S=(n=w==null?void 0:w.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!S){const E=await b.request({method:"eth_chainId"});S=RO(E)}const A={domain:O.host,address:_,statement:m,uri:O.href,version:"1",chainId:S,nonce:(i=w==null?void 0:w.signInWithEthereum)===null||i===void 0?void 0:i.nonce,issuedAt:(o=(a=w==null?void 0:w.signInWithEthereum)===null||a===void 0?void 0:a.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(s=w==null?void 0:w.signInWithEthereum)===null||s===void 0?void 0:s.expirationTime,notBefore:(l=w==null?void 0:w.signInWithEthereum)===null||l===void 0?void 0:l.notBefore,requestId:(u=w==null?void 0:w.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(c=w==null?void 0:w.signInWithEthereum)===null||c===void 0?void 0:c.resources};h=FO(A),y=await b.request({method:"personal_sign",params:[UO(h),_]})}try{const{data:v,error:p}=await oe(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:h,signature:y},!((f=e.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(d=e.options)===null||d===void 0?void 0:d.captchaToken}}:null),xform:$t});if(p)throw p;return!v||!v.session||!v.user?{data:{user:null,session:null},error:new wn}:(v.session&&(await this._saveSession(v.session),await this._notifyAllSubscribers("SIGNED_IN",v.session)),{data:Object.assign({},v),error:p})}catch(v){if(Z(v))return{data:{user:null,session:null},error:v};throw v}}async signInWithSolana(e){var r,n,i,a,o,s,l,u,c,f,d,h;let y,v;if("message"in e)y=e.message,v=e.signature;else{const{chain:p,wallet:m,statement:w,options:b}=e;let O;if(Qe())if(typeof m=="object")O=m;else{const _=window;if("solana"in _&&typeof _.solana=="object"&&("signIn"in _.solana&&typeof _.solana.signIn=="function"||"signMessage"in _.solana&&typeof _.solana.signMessage=="function"))O=_.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 m!="object"||!(b!=null&&b.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");O=m}const g=new URL((r=b==null?void 0:b.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in O&&O.signIn){const _=await O.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},b==null?void 0:b.signInWithSolana),{version:"1",domain:g.host,uri:g.href}),w?{statement:w}:null));let S;if(Array.isArray(_)&&_[0]&&typeof _[0]=="object")S=_[0];else if(_&&typeof _=="object"&&"signedMessage"in _&&"signature"in _)S=_;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in S&&"signature"in S&&(typeof S.signedMessage=="string"||S.signedMessage instanceof Uint8Array)&&S.signature instanceof Uint8Array)y=typeof S.signedMessage=="string"?S.signedMessage:new TextDecoder().decode(S.signedMessage),v=S.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in O)||typeof O.signMessage!="function"||!("publicKey"in O)||typeof O!="object"||!O.publicKey||!("toBase58"in O.publicKey)||typeof O.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");y=[`${g.host} wants you to sign in with your Solana account:`,O.publicKey.toBase58(),...w?["",w,""]:[""],"Version: 1",`URI: ${g.href}`,`Issued At: ${(i=(n=b==null?void 0:b.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&i!==void 0?i:new Date().toISOString()}`,...!((a=b==null?void 0:b.signInWithSolana)===null||a===void 0)&&a.notBefore?[`Not Before: ${b.signInWithSolana.notBefore}`]:[],...!((o=b==null?void 0:b.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${b.signInWithSolana.expirationTime}`]:[],...!((s=b==null?void 0:b.signInWithSolana)===null||s===void 0)&&s.chainId?[`Chain ID: ${b.signInWithSolana.chainId}`]:[],...!((l=b==null?void 0:b.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${b.signInWithSolana.nonce}`]:[],...!((u=b==null?void 0:b.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${b.signInWithSolana.requestId}`]:[],...!((f=(c=b==null?void 0:b.signInWithSolana)===null||c===void 0?void 0:c.resources)===null||f===void 0)&&f.length?["Resources",...b.signInWithSolana.resources.map(S=>`- ${S}`)]:[]].join(`
|
|
40
|
+
`);const _=await O.signMessage(new TextEncoder().encode(y),"utf8");if(!_||!(_ instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");v=_}}try{const{data:p,error:m}=await oe(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:y,signature:Nr(v)},!((d=e.options)===null||d===void 0)&&d.captchaToken?{gotrue_meta_security:{captcha_token:(h=e.options)===null||h===void 0?void 0:h.captchaToken}}:null),xform:$t});if(m)throw m;return!p||!p.session||!p.user?{data:{user:null,session:null},error:new wn}:(p.session&&(await this._saveSession(p.session),await this._notifyAllSubscribers("SIGNED_IN",p.session)),{data:Object.assign({},p),error:m})}catch(p){if(Z(p))return{data:{user:null,session:null},error:p};throw p}}async _exchangeCodeForSession(e){const r=await Dr(this.storage,`${this.storageKey}-code-verifier`),[n,i]=(r??"").split("/");try{const{data:a,error:o}=await oe(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:$t});if(await dr(this.storage,`${this.storageKey}-code-verifier`),o)throw o;return!a||!a.session||!a.user?{data:{user:null,session:null,redirectType:null},error:new wn}:(a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),{data:Object.assign(Object.assign({},a),{redirectType:i??null}),error:o})}catch(a){if(Z(a))return{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,s=await oe(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:$t}),{data:l,error:u}=s;return u?{data:{user:null,session:null},error:u}:!l||!l.session||!l.user?{data:{user:null,session:null},error:new wn}:(l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),{data:l,error:u})}catch(r){if(Z(r))return{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:s,options:l}=e;let u=null,c=null;this.flowType==="pkce"&&([u,c]=await On(this.storage,this.storageKey));const{error:f}=await oe(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:s,data:(r=l==null?void 0:l.data)!==null&&r!==void 0?r:{},create_user:(n=l==null?void 0:l.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},code_challenge:u,code_challenge_method:c},redirectTo:l==null?void 0:l.emailRedirectTo});return{data:{user:null,session:null},error:f}}if("phone"in e){const{phone:s,options:l}=e,{data:u,error:c}=await oe(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:s,data:(i=l==null?void 0:l.data)!==null&&i!==void 0?i:{},create_user:(a=l==null?void 0:l.shouldCreateUser)!==null&&a!==void 0?a:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},channel:(o=l==null?void 0:l.channel)!==null&&o!==void 0?o:"sms"}});return{data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:c}}throw new po("You must provide either an email or phone number.")}catch(s){if(Z(s))return{data:{user:null,session:null},error:s};throw s}}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:s}=await oe(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:a}}),redirectTo:i,xform:$t});if(s)throw s;if(!o)throw new Error("An error occurred on token verification.");const l=o.session,u=o.user;return l!=null&&l.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),{data:{user:u,session:l},error:null}}catch(i){if(Z(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithSSO(e){var r,n,i;try{let a=null,o=null;return this.flowType==="pkce"&&([a,o]=await On(this.storage,this.storageKey)),await oe(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:a,code_challenge_method:o}),headers:this.headers,xform:CO})}catch(a){if(Z(a))return{data:null,error:a};throw a}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,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 Tt;const{error:i}=await oe(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return{data:{user:null,session:null},error:i}})}catch(e){if(Z(e))return{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 oe(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{data:{user:null,session:null},error:o}}else if("phone"in e){const{phone:n,type:i,options:a}=e,{data:o,error:s}=await oe(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:i,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}}});return{data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:s}}throw new po("You must provide either an email or phone number and a type")}catch(r){if(Z(r))return{data:{user:null,session:null},error:r};throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,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 Dr(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()<Vl:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",e.expires_at),!n){if(this.userStorage){const o=await Dr(this.userStorage,this.storageKey+"-user");o!=null&&o.user?e.user=o.user:e.user=Zl()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const o={value:this.suppressGetSessionWarning};e.user=TO(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?{data:{session:null},error:a}:{data:{session:i},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await oe(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:hr}):await this._useSession(async r=>{var n,i,a;const{data:o,error:s}=r;if(s)throw s;return!(!((n=o.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Tt}:await oe(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:hr})})}catch(r){if(Z(r))return oO(r)&&(await this._removeSession(),await dr(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:r};throw r}}async updateUser(e,r={}){return await this.initializePromise,await this._acquireLock(-1,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 Tt;const o=i.session;let s=null,l=null;this.flowType==="pkce"&&e.email!=null&&([s,l]=await On(this.storage,this.storageKey));const{data:u,error:c}=await oe(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:s,code_challenge_method:l}),jwt:o.access_token,xform:hr});if(c)throw c;return o.user=u.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),{data:{user:o.user},error:null}})}catch(n){if(Z(n))return{data:{user:null},error:n};throw n}}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new Tt;const r=Date.now()/1e3;let n=r,i=!0,a=null;const{payload:o}=Jl(e.access_token);if(o.exp&&(n=o.exp,i=n<=r),i){const{data:s,error:l}=await this._callRefreshToken(e.refresh_token);if(l)return{data:{user:null,session:null},error:l};if(!s)return{data:{user:null,session:null},error:null};a=s}else{const{data:s,error:l}=await this._getUser(e.access_token);if(l)throw l;a={access_token:e.access_token,refresh_token:e.refresh_token,user:s.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)}return{data:{user:a.user,session:a},error:null}}catch(r){if(Z(r))return{data:{session:null,user:null},error:r};throw r}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async r=>{var n;if(!e){const{data:o,error:s}=r;if(s)throw s;e=(n=o.session)!==null&&n!==void 0?n:void 0}if(!(e!=null&&e.refresh_token))throw new Tt;const{data:i,error:a}=await this._callRefreshToken(e.refresh_token);return a?{data:{user:null,session:null},error:a}:i?{data:{user:i.user,session:i},error:null}:{data:{user:null,session:null},error:null}})}catch(r){if(Z(r))return{data:{user:null,session:null},error:r};throw r}}async _getSessionFromURL(e,r){try{if(!Qe())throw new vo("No browser detected.");if(e.error||e.error_description||e.error_code)throw new vo(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 Vh("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new vo("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 Vh("No code detected.");const{data:w,error:b}=await this._exchangeCodeForSession(e.code);if(b)throw b;const O=new URL(window.location.href);return O.searchParams.delete("code"),window.history.replaceState(window.history.state,"",O.toString()),{data:{session:w.session,redirectType:null},error:null}}const{provider_token:n,provider_refresh_token:i,access_token:a,refresh_token:o,expires_in:s,expires_at:l,token_type:u}=e;if(!a||!s||!o||!u)throw new vo("No session defined in URL");const c=Math.round(Date.now()/1e3),f=parseInt(s);let d=c+f;l&&(d=parseInt(l));const h=d-c;h*1e3<=bn&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${h}s, should have been closer to ${f}s`);const y=d-f;c-y>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",y,d,c):c-y<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",y,d,c);const{data:v,error:p}=await this._getUser(a);if(p)throw p;const m={provider_token:n,provider_refresh_token:i,access_token:a,expires_in:f,expires_at:d,refresh_token:o,token_type:u,user:v.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:m,redirectType:e.type},error:null}}catch(n){if(Z(n))return{data:{session:null,redirectType:null},error:n};throw n}}_isImplicitGrantCallback(e){return!!(e.access_token||e.error_description)}async _isPKCECallback(e){const r=await Dr(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&r)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,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)return{error:a};const o=(n=i.session)===null||n===void 0?void 0:n.access_token;if(o){const{error:s}=await this.admin.signOut(o,e);if(s&&!(aO(s)&&(s.status===404||s.status===401||s.status===403)))return{error:s}}return e!=="others"&&(await this._removeSession(),await dr(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(e){const r=pO(),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(-1,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),console.error(a)}})}async resetPasswordForEmail(e,r={}){let n=null,i=null;this.flowType==="pkce"&&([n,i]=await On(this.storage,this.storageKey,!0));try{return await oe(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(Z(a))return{data:null,error:a};throw a}}async getUserIdentities(){var e;try{const{data:r,error:n}=await this.getUser();if(n)throw n;return{data:{identities:(e=r.user.identities)!==null&&e!==void 0?e:[]},error:null}}catch(r){if(Z(r))return{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,s,l,u,c;const{data:f,error:d}=a;if(d)throw d;const h=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(o=e.options)===null||o===void 0?void 0:o.redirectTo,scopes:(s=e.options)===null||s===void 0?void 0:s.scopes,queryParams:(l=e.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await oe(this.fetch,"GET",h,{headers:this.headers,jwt:(c=(u=f.session)===null||u===void 0?void 0:u.access_token)!==null&&c!==void 0?c:void 0})});if(i)throw i;return Qe()&&!(!((r=e.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n==null?void 0:n.url),{data:{provider:e.provider,url:n==null?void 0:n.url},error:null}}catch(n){if(Z(n))return{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:s,token:l,access_token:u,nonce:c}=e,f=await oe(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:s,id_token:l,access_token:u,nonce:c,link_identity:!0,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:$t}),{data:d,error:h}=f;return h?{data:{user:null,session:null},error:h}:!d||!d.session||!d.user?{data:{user:null,session:null},error:new wn}:(d.session&&(await this._saveSession(d.session),await this._notifyAllSubscribers("USER_UPDATED",d.session)),{data:d,error:h})}catch(i){if(Z(i))return{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 oe(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(Z(r))return{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 mO(async i=>(i>0&&await gO(200*Math.pow(2,i-1)),this._debug(r,"refreshing attempt",i),await oe(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:$t})),(i,a)=>{const o=200*Math.pow(2,i);return a&&Yl(a)&&Date.now()+o-n<bn})}catch(n){if(this._debug(r,"error",n),Z(n))return{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),Qe()&&!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 Dr(this.storage,this.storageKey);if(i&&this.userStorage){let o=await Dr(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:i.user},await xn(this.userStorage,this.storageKey+"-user",o)),i.user=(e=o==null?void 0:o.user)!==null&&e!==void 0?e:Zl()}else if(i&&!i.user&&!i.user){const o=await Dr(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(i.user=o.user,await dr(this.storage,this.storageKey+"-user"),await xn(this.storage,this.storageKey,i)):i.user=Zl()}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()<Vl;if(this._debug(n,`session has${a?"":" not"} expired with margin of ${Vl}s`),a){if(this.autoRefreshToken&&i.refresh_token){const{error:o}=await this._callRefreshToken(i.refresh_token);o&&(console.error(o),Yl(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:s}=await this._getUser(i.access_token);!s&&(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 Tt;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const i=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new go;const{data:a,error:o}=await this._refreshAccessToken(e);if(o)throw o;if(!a.session)throw new Tt;await this._saveSession(a.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",a.session);const s={data:a.session,error:null};return this.refreshingDeferred.resolve(s),s}catch(a){if(this._debug(i,"error",a),Z(a)){const o={data:null,error:a};return Yl(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 s=>{try{await s.callback(e,r)}catch(l){a.push(l)}});if(await Promise.all(o),a.length>0){for(let s=0;s<a.length;s+=1)console.error(a[s]);throw a[0]}}finally{this._debug(i,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0;const r=Object.assign({},e),n=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&r.user&&await xn(this.userStorage,this.storageKey+"-user",{user:r.user});const i=Object.assign({},r);delete i.user;const a=ep(i);await xn(this.storage,this.storageKey,a)}else{const i=ep(r);await xn(this.storage,this.storageKey,i)}}async _removeSession(){this._debug("#_removeSession()"),await dr(this.storage,this.storageKey),await dr(this.storage,this.storageKey+"-code-verifier"),await dr(this.storage,this.storageKey+"-user"),this.userStorage&&await dr(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&Qe()&&(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(),bn);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}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)/bn);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${bn}ms, refresh threshold is ${Kl} ticks`),i<=Kl&&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.isAcquireTimeout||e instanceof ap)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Qe()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),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(-1,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 On(this.storage,this.storageKey),s=new URLSearchParams({code_challenge:`${encodeURIComponent(a)}`,code_challenge_method:`${encodeURIComponent(o)}`});i.push(s.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?{data:null,error:a}:await oe(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(Z(r))return{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{data:null,error:o};const s=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:e.factorType==="totp"?{issuer:e.issuer}:{}),{data:l,error:u}=await oe(this.fetch,"POST",`${this.url}/factors`,{body:s,headers:this.headers,jwt:(n=a==null?void 0:a.session)===null||n===void 0?void 0:n.access_token});return u?{data:null,error:u}:(e.factorType==="totp"&&l.type==="totp"&&(!((i=l==null?void 0:l.totp)===null||i===void 0)&&i.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),{data:l,error:null})})}catch(r){if(Z(r))return{data:null,error:r};throw r}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;const{data:i,error:a}=r;if(a)return{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"?GO(e.webauthn.credential_response):YO(e.webauthn.credential_response)})}:{code:e.code}),{data:s,error:l}=await oe(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 l?{data:null,error:l}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+s.expires_in},s)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",s),{data:s,error:l})})}catch(r){if(Z(r))return{data:null,error:r};throw r}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;const{data:i,error:a}=r;if(a)return{data:null,error:a};const o=await oe(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:s}=o;if(s.type!=="webauthn")return{data:s,error:null};switch(s.webauthn.type){case"create":return{data:Object.assign(Object.assign({},s),{webauthn:Object.assign(Object.assign({},s.webauthn),{credential_options:Object.assign(Object.assign({},s.webauthn.credential_options),{publicKey:VO(s.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},s),{webauthn:Object.assign(Object.assign({},s.webauthn),{credential_options:Object.assign(Object.assign({},s.webauthn.credential_options),{publicKey:HO(s.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(Z(r))return{data:null,error:r};throw r}})}async _challengeAndVerify(e){const{data:r,error:n}=await this._challenge({factorId:e.factorId});return n?{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(){var e,r;const{data:{session:n},error:i}=await this.getSession();if(i)return{data:null,error:i};if(!n)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:a}=Jl(n.access_token);let o=null;a.aal&&(o=a.aal);let s=o;((r=(e=n.user.factors)===null||e===void 0?void 0:e.filter(c=>c.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(s="aal2");const u=a.amr||[];return{data:{currentLevel:o,nextLevel:s,currentAuthenticationMethods:u},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async r=>{const{data:{session:n},error:i}=r;return i?{data:null,error:i}:n?await oe(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:n.access_token,xform:a=>({data:a,error:null})}):{data:null,error:new Tt}})}catch(r){if(Z(r))return{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{data:null,error:a};if(!i)return{data:null,error:new Tt};const o=await oe(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"approve"},xform:s=>({data:s,error:null})});return o.data&&o.data.redirect_url&&Qe()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(Z(n))return{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{data:null,error:a};if(!i)return{data:null,error:new Tt};const o=await oe(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"deny"},xform:s=>({data:s,error:null})});return o.data&&o.data.redirect_url&&Qe()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(Z(n))return{data:null,error:n};throw n}}async fetchJwk(e,r={keys:[]}){let n=r.keys.find(s=>s.kid===e);if(n)return n;const i=Date.now();if(n=this.jwks.keys.find(s=>s.kid===e),n&&this.jwks_cached_at+nO>i)return n;const{data:a,error:o}=await oe(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(s=>s.kid===e),!n)?null:n}async getClaims(e,r={}){try{let n=e;if(!n){const{data:h,error:y}=await this.getSession();if(y||!h.session)return{data:null,error:y};n=h.session.access_token}const{header:i,payload:a,signature:o,raw:{header:s,payload:l}}=Jl(n);r!=null&&r.allowExpired||AO(a.exp);const u=!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(!u){const{error:h}=await this.getUser(n);if(h)throw h;return{data:{claims:a,header:i,signature:o},error:null}}const c=PO(i.alg),f=await crypto.subtle.importKey("jwk",u,c,!0,["verify"]);if(!await crypto.subtle.verify(c,f,o,dO(`${s}.${l}`)))throw new Xl("Invalid JWT signature");return{data:{claims:a,header:i,signature:o},error:null}}catch(n){if(Z(n))return{data:null,error:n};throw n}}}Fi.nextInstanceID=0;const iS=Fi;class aS extends iS{constructor(e){super(e)}}class oS{constructor(e,r,n){var i,a,o;this.supabaseUrl=e,this.supabaseKey=r;const s=Zx(e);if(!r)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",s),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",s),this.storageUrl=new URL("storage/v1",s),this.functionsUrl=new URL("functions/v1",s);const l=`sb-${s.hostname.split(".")[0]}-auth-token`,u={db:zx,realtime:Vx,auth:Object.assign(Object.assign({},Kx),{storageKey:l}),global:qx},c=Jx(n??{},u);this.storageKey=(i=c.auth.storageKey)!==null&&i!==void 0?i:"",this.headers=(a=c.global.headers)!==null&&a!==void 0?a:{},c.accessToken?(this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(f,d)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(d)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((o=c.auth)!==null&&o!==void 0?o:{},this.headers,c.global.fetch),this.fetch=Yx(r,this._getAccessToken.bind(this),c.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},c.realtime)),this.rest=new tx(new URL("rest/v1",s).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch}),this.storage=new Fx(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new H_(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,r={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,r,n)}channel(e,r={config:{}}){return this.realtime.channel(e,r)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e,r;if(this.accessToken)return await this.accessToken();const{data:n}=await this.auth.getSession();return(r=(e=n.session)===null||e===void 0?void 0:e.access_token)!==null&&r!==void 0?r:this.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,userStorage:a,storageKey:o,flowType:s,lock:l,debug:u},c,f){const d={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new aS({url:this.authUrl.href,headers:Object.assign(Object.assign({},d),c),storageKey:o,autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,userStorage:a,flowType:s,lock:l,debug:u,fetch:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(h=>h.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new gx(this.realtimeUrl.href,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((r,n)=>{this._handleTokenChanged(r,"CLIENT",n==null?void 0:n.access_token)})}_handleTokenChanged(e,r,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const sS=(t,e,r)=>new oS(t,e,r);function lS(){if(typeof window<"u"||typeof process>"u")return!1;const t=process.version;if(t==null)return!1;const e=t.match(/^v(\d+)\./);return e?parseInt(e[1],10)<=18:!1}lS()&&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 et=sS("https://qvfepptmcxwvalmbkgur.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InF2ZmVwcHRtY3h3dmFsbWJrZ3VyIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjE5MjE4NTEsImV4cCI6MjA3NzQ5Nzg1MX0.kuPTAjW1i54uJHZAAAZqAe-sZCKPHTdUPoRbAky-cQk",{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}});function cp(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function uS(...t){return e=>{let r=!1;const n=t.map(i=>{const a=cp(i,e);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let i=0;i<n.length;i++){const a=n[i];typeof a=="function"?a():cp(t[i],null)}}}}function fp(t){const e=fS(t),r=fe.forwardRef((n,i)=>{const{children:a,...o}=n,s=fe.Children.toArray(a),l=s.find(hS);if(l){const u=l.props.children,c=s.map(f=>f===l?fe.Children.count(u)>1?fe.Children.only(null):fe.isValidElement(u)?u.props.children:null:f);return P.jsx(e,{...o,ref:i,children:fe.isValidElement(u)?fe.cloneElement(u,void 0,c):null})}return P.jsx(e,{...o,ref:i,children:a})});return r.displayName=`${t}.Slot`,r}var cS=fp("Slot");function fS(t){const e=fe.forwardRef((r,n)=>{const{children:i,...a}=r;if(fe.isValidElement(i)){const o=vS(i),s=pS(a,i.props);return i.type!==fe.Fragment&&(s.ref=n?uS(n,o):o),fe.cloneElement(i,s)}return fe.Children.count(i)>1?fe.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var dS=Symbol("radix.slottable");function hS(t){return fe.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===dS}function pS(t,e){const r={...e};for(const n in e){const i=t[n],a=e[n];/^on[A-Z]/.test(n)?i&&a?r[n]=(...s)=>{const l=a(...s);return i(...s),l}:i&&(r[n]=i):n==="style"?r[n]={...i,...a}:n==="className"&&(r[n]=[i,a].filter(Boolean).join(" "))}return{...t,...r}}function vS(t){var n,i;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}function dp(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=dp(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function ie(){for(var t,e,r=0,n="",i=arguments.length;r<i;r++)(t=arguments[r])&&(e=dp(t))&&(n&&(n+=" "),n+=e);return n}const hp=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,pp=ie,yS=(t,e)=>r=>{var n;if((e==null?void 0:e.variants)==null)return pp(t,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:i,defaultVariants:a}=e,o=Object.keys(i).map(u=>{const c=r==null?void 0:r[u],f=a==null?void 0:a[u];if(c===null)return null;const d=hp(c)||hp(f);return i[u][d]}),s=r&&Object.entries(r).reduce((u,c)=>{let[f,d]=c;return d===void 0||(u[f]=d),u},{}),l=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((u,c)=>{let{class:f,className:d,...h}=c;return Object.entries(h).every(y=>{let[v,p]=y;return Array.isArray(p)?p.includes({...a,...s}[v]):{...a,...s}[v]===p})?[...u,f,d]:u},[]);return pp(t,o,l,r==null?void 0:r.class,r==null?void 0:r.className)},eu="-",gS=t=>{const e=bS(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:o=>{const s=o.split(eu);return s[0]===""&&s.length!==1&&s.shift(),vp(s,e)||mS(o)},getConflictingClassGroupIds:(o,s)=>{const l=r[o]||[];return s&&n[o]?[...l,...n[o]]:l}}},vp=(t,e)=>{var o;if(t.length===0)return e.classGroupId;const r=t[0],n=e.nextPart.get(r),i=n?vp(t.slice(1),n):void 0;if(i)return i;if(e.validators.length===0)return;const a=t.join(eu);return(o=e.validators.find(({validator:s})=>s(a)))==null?void 0:o.classGroupId},yp=/^\[(.+)\]$/,mS=t=>{if(yp.test(t)){const e=yp.exec(t)[1],r=e==null?void 0:e.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}},bS=t=>{const{theme:e,prefix:r}=t,n={nextPart:new Map,validators:[]};return _S(Object.entries(t.classGroups),r).forEach(([a,o])=>{tu(o,n,a,e)}),n},tu=(t,e,r,n)=>{t.forEach(i=>{if(typeof i=="string"){const a=i===""?e:gp(e,i);a.classGroupId=r;return}if(typeof i=="function"){if(wS(i)){tu(i(n),e,r,n);return}e.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([a,o])=>{tu(o,gp(e,a),r,n)})})},gp=(t,e)=>{let r=t;return e.split(eu).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},wS=t=>t.isThemeGetter,_S=(t,e)=>e?t.map(([r,n])=>{const i=n.map(a=>typeof a=="string"?e+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([o,s])=>[e+o,s])):a);return[r,i]}):t,xS=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=new Map,n=new Map;const i=(a,o)=>{r.set(a,o),e++,e>t&&(e=0,n=r,r=new Map)};return{get(a){let o=r.get(a);if(o!==void 0)return o;if((o=n.get(a))!==void 0)return i(a,o),o},set(a,o){r.has(a)?r.set(a,o):i(a,o)}}},mp="!",OS=t=>{const{separator:e,experimentalParseClassName:r}=t,n=e.length===1,i=e[0],a=e.length,o=s=>{const l=[];let u=0,c=0,f;for(let p=0;p<s.length;p++){let m=s[p];if(u===0){if(m===i&&(n||s.slice(p,p+a)===e)){l.push(s.slice(c,p)),c=p+a;continue}if(m==="/"){f=p;continue}}m==="["?u++:m==="]"&&u--}const d=l.length===0?s:s.substring(c),h=d.startsWith(mp),y=h?d.substring(1):d,v=f&&f>c?f-c:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:y,maybePostfixModifierPosition:v}};return r?s=>r({className:s,parseClassName:o}):o},SS=t=>{if(t.length<=1)return t;const e=[];let r=[];return t.forEach(n=>{n[0]==="["?(e.push(...r.sort(),n),r=[]):r.push(n)}),e.push(...r.sort()),e},AS=t=>({cache:xS(t.cacheSize),parseClassName:OS(t),...gS(t)}),PS=/\s+/,ES=(t,e)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i}=e,a=[],o=t.trim().split(PS);let s="";for(let l=o.length-1;l>=0;l-=1){const u=o[l],{modifiers:c,hasImportantModifier:f,baseClassName:d,maybePostfixModifierPosition:h}=r(u);let y=!!h,v=n(y?d.substring(0,h):d);if(!v){if(!y){s=u+(s.length>0?" "+s:s);continue}if(v=n(d),!v){s=u+(s.length>0?" "+s:s);continue}y=!1}const p=SS(c).join(":"),m=f?p+mp:p,w=m+v;if(a.includes(w))continue;a.push(w);const b=i(v,y);for(let O=0;O<b.length;++O){const g=b[O];a.push(m+g)}s=u+(s.length>0?" "+s:s)}return s};function TS(){let t=0,e,r,n="";for(;t<arguments.length;)(e=arguments[t++])&&(r=bp(e))&&(n&&(n+=" "),n+=r);return n}const bp=t=>{if(typeof t=="string")return t;let e,r="";for(let n=0;n<t.length;n++)t[n]&&(e=bp(t[n]))&&(r&&(r+=" "),r+=e);return r};function $S(t,...e){let r,n,i,a=o;function o(l){const u=e.reduce((c,f)=>f(c),t());return r=AS(u),n=r.cache.get,i=r.cache.set,a=s,s(l)}function s(l){const u=n(l);if(u)return u;const c=ES(l,r);return i(l,c),c}return function(){return a(TS.apply(null,arguments))}}const Ee=t=>{const e=r=>r[t]||[];return e.isThemeGetter=!0,e},wp=/^\[(?:([a-z-]+):)?(.+)\]$/i,jS=/^\d+\/\d+$/,kS=new Set(["px","full","screen"]),CS=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,IS=/\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$/,NS=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,MS=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,DS=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Vt=t=>En(t)||kS.has(t)||jS.test(t),pr=t=>Tn(t,"length",zS),En=t=>!!t&&!Number.isNaN(Number(t)),ru=t=>Tn(t,"number",En),Wi=t=>!!t&&Number.isInteger(Number(t)),LS=t=>t.endsWith("%")&&En(t.slice(0,-1)),ue=t=>wp.test(t),vr=t=>CS.test(t),BS=new Set(["length","size","percentage"]),RS=t=>Tn(t,BS,_p),US=t=>Tn(t,"position",_p),FS=new Set(["image","url"]),WS=t=>Tn(t,FS,VS),qS=t=>Tn(t,"",KS),qi=()=>!0,Tn=(t,e,r)=>{const n=wp.exec(t);return n?n[1]?typeof e=="string"?n[1]===e:e.has(n[1]):r(n[2]):!1},zS=t=>IS.test(t)&&!NS.test(t),_p=()=>!1,KS=t=>MS.test(t),VS=t=>DS.test(t),HS=$S(()=>{const t=Ee("colors"),e=Ee("spacing"),r=Ee("blur"),n=Ee("brightness"),i=Ee("borderColor"),a=Ee("borderRadius"),o=Ee("borderSpacing"),s=Ee("borderWidth"),l=Ee("contrast"),u=Ee("grayscale"),c=Ee("hueRotate"),f=Ee("invert"),d=Ee("gap"),h=Ee("gradientColorStops"),y=Ee("gradientColorStopPositions"),v=Ee("inset"),p=Ee("margin"),m=Ee("opacity"),w=Ee("padding"),b=Ee("saturate"),O=Ee("scale"),g=Ee("sepia"),_=Ee("skew"),S=Ee("space"),A=Ee("translate"),E=()=>["auto","contain","none"],I=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto",ue,e],$=()=>[ue,e],k=()=>["",Vt,pr],C=()=>["auto",En,ue],D=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],N=()=>["solid","dashed","dotted","double","none"],L=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>["start","end","center","between","around","evenly","stretch"],q=()=>["","0",ue],M=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>[En,ue];return{cacheSize:500,separator:":",theme:{colors:[qi],spacing:[Vt,pr],blur:["none","",vr,ue],brightness:R(),borderColor:[t],borderRadius:["none","","full",vr,ue],borderSpacing:$(),borderWidth:k(),contrast:R(),grayscale:q(),hueRotate:R(),invert:q(),gap:$(),gradientColorStops:[t],gradientColorStopPositions:[LS,pr],inset:T(),margin:T(),opacity:R(),padding:$(),saturate:R(),scale:R(),sepia:q(),skew:R(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",ue]}],container:["container"],columns:[{columns:[vr]}],"break-after":[{"break-after":M()}],"break-before":[{"break-before":M()}],"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"],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:[...D(),ue]}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Wi,ue]}],basis:[{basis:T()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ue]}],grow:[{grow:q()}],shrink:[{shrink:q()}],order:[{order:["first","last","none",Wi,ue]}],"grid-cols":[{"grid-cols":[qi]}],"col-start-end":[{col:["auto",{span:["full",Wi,ue]},ue]}],"col-start":[{"col-start":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":[qi]}],"row-start-end":[{row:["auto",{span:[Wi,ue]},ue]}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ue]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ue]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",...W()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...W(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...W(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[p]}],mx:[{mx:[p]}],my:[{my:[p]}],ms:[{ms:[p]}],me:[{me:[p]}],mt:[{mt:[p]}],mr:[{mr:[p]}],mb:[{mb:[p]}],ml:[{ml:[p]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ue,e]}],"min-w":[{"min-w":[ue,e,"min","max","fit"]}],"max-w":[{"max-w":[ue,e,"none","full","min","max","fit","prose",{screen:[vr]},vr]}],h:[{h:[ue,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ue,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ue,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ue,e,"auto","min","max","fit"]}],"font-size":[{text:["base",vr,pr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ru]}],"font-family":[{font:[qi]}],"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:["tighter","tight","normal","wide","wider","widest",ue]}],"line-clamp":[{"line-clamp":["none",En,ru]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Vt,ue]}],"list-image":[{"list-image":["none",ue]}],"list-style-type":[{list:["none","disc","decimal",ue]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...N(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Vt,pr]}],"underline-offset":[{"underline-offset":["auto",Vt,ue]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ue]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ue]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...D(),US]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",RS]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},WS]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[m]}],"border-style":[{border:[...N(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[m]}],"divide-style":[{divide:N()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...N()]}],"outline-offset":[{"outline-offset":[Vt,ue]}],"outline-w":[{outline:[Vt,pr]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:k()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[Vt,pr]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",vr,qS]}],"shadow-color":[{shadow:[qi]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":[...L(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":L()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",vr,ue]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[f]}],saturate:[{saturate:[b]}],sepia:[{sepia:[g]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[m]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[g]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ue]}],duration:[{duration:R()}],ease:[{ease:["linear","in","out","in-out",ue]}],delay:[{delay:R()}],animate:[{animate:["none","spin","ping","pulse","bounce",ue]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[O]}],"scale-x":[{"scale-x":[O]}],"scale-y":[{"scale-y":[O]}],rotate:[{rotate:[Wi,ue]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[_]}],"skew-y":[{"skew-y":[_]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ue]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],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",ue]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"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",ue]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Vt,pr,ru]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-s","border-w-e","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-s","border-color-e","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"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","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-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"]}}});function He(...t){return HS(ie(t))}const GS=yS("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),nu=fe.forwardRef(({className:t,variant:e,size:r,asChild:n=!1,...i},a)=>{const o=n?cS:"button";return P.jsx(o,{className:He(GS({variant:e,size:r,className:t})),ref:a,...i})});nu.displayName="Button";var YS=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],XS=YS.reduce((t,e)=>{const r=fp(`Primitive.${e}`),n=fe.forwardRef((i,a)=>{const{asChild:o,...s}=i,l=o?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),P.jsx(l,{...s,ref:a})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{}),JS="Separator",xp="horizontal",ZS=["horizontal","vertical"],Op=fe.forwardRef((t,e)=>{const{decorative:r,orientation:n=xp,...i}=t,a=QS(n)?n:xp,s=r?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return P.jsx(XS.div,{"data-orientation":a,...s,...i,ref:e})});Op.displayName=JS;function QS(t){return ZS.includes(t)}var Sp=Op;const Ap=fe.forwardRef(({className:t,orientation:e="horizontal",decorative:r=!0,...n},i)=>P.jsx(Sp,{ref:i,decorative:r,orientation:e,className:He("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...n}));Ap.displayName=Sp.displayName;const Br=fe.forwardRef(({className:t,...e},r)=>P.jsx("div",{ref:r,className:He("rounded-lg border bg-card text-card-foreground shadow-sm",t),...e}));Br.displayName="Card";const iu=fe.forwardRef(({className:t,...e},r)=>P.jsx("div",{ref:r,className:He("flex flex-col space-y-1.5 p-6",t),...e}));iu.displayName="CardHeader";const eA=fe.forwardRef(({className:t,...e},r)=>P.jsx("h3",{ref:r,className:He("text-2xl font-semibold leading-none tracking-tight",t),...e}));eA.displayName="CardTitle";const tA=fe.forwardRef(({className:t,...e},r)=>P.jsx("p",{ref:r,className:He("text-sm text-muted-foreground",t),...e}));tA.displayName="CardDescription";const au=fe.forwardRef(({className:t,...e},r)=>P.jsx("div",{ref:r,className:He("p-6 pt-0",t),...e}));au.displayName="CardContent";const rA=fe.forwardRef(({className:t,...e},r)=>P.jsx("div",{ref:r,className:He("flex items-center p-6 pt-0",t),...e}));rA.displayName="CardFooter";var nA=Array.isArray,at=nA,iA=typeof ao=="object"&&ao&&ao.Object===Object&&ao,Pp=iA,aA=Pp,oA=typeof self=="object"&&self&&self.Object===Object&&self,sA=aA||oA||Function("return this")(),Lt=sA,lA=Lt,uA=lA.Symbol,zi=uA,Ep=zi,Tp=Object.prototype,cA=Tp.hasOwnProperty,fA=Tp.toString,Ki=Ep?Ep.toStringTag:void 0;function dA(t){var e=cA.call(t,Ki),r=t[Ki];try{t[Ki]=void 0;var n=!0}catch{}var i=fA.call(t);return n&&(e?t[Ki]=r:delete t[Ki]),i}var hA=dA,pA=Object.prototype,vA=pA.toString;function yA(t){return vA.call(t)}var gA=yA,$p=zi,mA=hA,bA=gA,wA="[object Null]",_A="[object Undefined]",jp=$p?$p.toStringTag:void 0;function xA(t){return t==null?t===void 0?_A:wA:jp&&jp in Object(t)?mA(t):bA(t)}var Ht=xA;function OA(t){return t!=null&&typeof t=="object"}var Gt=OA,SA=Ht,AA=Gt,PA="[object Symbol]";function EA(t){return typeof t=="symbol"||AA(t)&&SA(t)==PA}var $n=EA,TA=at,$A=$n,jA=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,kA=/^\w*$/;function CA(t,e){if(TA(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||$A(t)?!0:kA.test(t)||!jA.test(t)||e!=null&&t in Object(e)}var ou=CA;function IA(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var yr=IA;const jn=we(yr);var NA=Ht,MA=yr,DA="[object AsyncFunction]",LA="[object Function]",BA="[object GeneratorFunction]",RA="[object Proxy]";function UA(t){if(!MA(t))return!1;var e=NA(t);return e==LA||e==BA||e==DA||e==RA}var su=UA;const te=we(su);var FA=Lt,WA=FA["__core-js_shared__"],qA=WA,lu=qA,kp=function(){var t=/[^.]+$/.exec(lu&&lu.keys&&lu.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function zA(t){return!!kp&&kp in t}var KA=zA,VA=Function.prototype,HA=VA.toString;function GA(t){if(t!=null){try{return HA.call(t)}catch{}try{return t+""}catch{}}return""}var Cp=GA,YA=su,XA=KA,JA=yr,ZA=Cp,QA=/[\\^$.*+?()[\]{}|]/g,eP=/^\[object .+?Constructor\]$/,tP=Function.prototype,rP=Object.prototype,nP=tP.toString,iP=rP.hasOwnProperty,aP=RegExp("^"+nP.call(iP).replace(QA,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function oP(t){if(!JA(t)||XA(t))return!1;var e=YA(t)?aP:eP;return e.test(ZA(t))}var sP=oP;function lP(t,e){return t==null?void 0:t[e]}var uP=lP,cP=sP,fP=uP;function dP(t,e){var r=fP(t,e);return cP(r)?r:void 0}var Rr=dP,hP=Rr,pP=hP(Object,"create"),wo=pP,Ip=wo;function vP(){this.__data__=Ip?Ip(null):{},this.size=0}var yP=vP;function gP(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var mP=gP,bP=wo,wP="__lodash_hash_undefined__",_P=Object.prototype,xP=_P.hasOwnProperty;function OP(t){var e=this.__data__;if(bP){var r=e[t];return r===wP?void 0:r}return xP.call(e,t)?e[t]:void 0}var SP=OP,AP=wo,PP=Object.prototype,EP=PP.hasOwnProperty;function TP(t){var e=this.__data__;return AP?e[t]!==void 0:EP.call(e,t)}var $P=TP,jP=wo,kP="__lodash_hash_undefined__";function CP(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=jP&&e===void 0?kP:e,this}var IP=CP,NP=yP,MP=mP,DP=SP,LP=$P,BP=IP;function kn(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}kn.prototype.clear=NP,kn.prototype.delete=MP,kn.prototype.get=DP,kn.prototype.has=LP,kn.prototype.set=BP;var RP=kn;function UP(){this.__data__=[],this.size=0}var FP=UP;function WP(t,e){return t===e||t!==t&&e!==e}var uu=WP,qP=uu;function zP(t,e){for(var r=t.length;r--;)if(qP(t[r][0],e))return r;return-1}var _o=zP,KP=_o,VP=Array.prototype,HP=VP.splice;function GP(t){var e=this.__data__,r=KP(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():HP.call(e,r,1),--this.size,!0}var YP=GP,XP=_o;function JP(t){var e=this.__data__,r=XP(e,t);return r<0?void 0:e[r][1]}var ZP=JP,QP=_o;function eE(t){return QP(this.__data__,t)>-1}var tE=eE,rE=_o;function nE(t,e){var r=this.__data__,n=rE(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var iE=nE,aE=FP,oE=YP,sE=ZP,lE=tE,uE=iE;function Cn(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Cn.prototype.clear=aE,Cn.prototype.delete=oE,Cn.prototype.get=sE,Cn.prototype.has=lE,Cn.prototype.set=uE;var xo=Cn,cE=Rr,fE=Lt,dE=cE(fE,"Map"),cu=dE,Np=RP,hE=xo,pE=cu;function vE(){this.size=0,this.__data__={hash:new Np,map:new(pE||hE),string:new Np}}var yE=vE;function gE(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var mE=gE,bE=mE;function wE(t,e){var r=t.__data__;return bE(e)?r[typeof e=="string"?"string":"hash"]:r.map}var Oo=wE,_E=Oo;function xE(t){var e=_E(this,t).delete(t);return this.size-=e?1:0,e}var OE=xE,SE=Oo;function AE(t){return SE(this,t).get(t)}var PE=AE,EE=Oo;function TE(t){return EE(this,t).has(t)}var $E=TE,jE=Oo;function kE(t,e){var r=jE(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var CE=kE,IE=yE,NE=OE,ME=PE,DE=$E,LE=CE;function In(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}In.prototype.clear=IE,In.prototype.delete=NE,In.prototype.get=ME,In.prototype.has=DE,In.prototype.set=LE;var fu=In,Mp=fu,BE="Expected a function";function du(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(BE);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=t.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(du.Cache||Mp),r}du.Cache=Mp;var Dp=du;const RE=we(Dp);var UE=Dp,FE=500;function WE(t){var e=UE(t,function(n){return r.size===FE&&r.clear(),n}),r=e.cache;return e}var qE=WE,zE=qE,KE=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,VE=/\\(\\)?/g,HE=zE(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(KE,function(r,n,i,a){e.push(i?a.replace(VE,"$1"):n||r)}),e}),GE=HE;function YE(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var hu=YE,Lp=zi,XE=hu,JE=at,ZE=$n,QE=1/0,Bp=Lp?Lp.prototype:void 0,Rp=Bp?Bp.toString:void 0;function Up(t){if(typeof t=="string")return t;if(JE(t))return XE(t,Up)+"";if(ZE(t))return Rp?Rp.call(t):"";var e=t+"";return e=="0"&&1/t==-QE?"-0":e}var e1=Up,t1=e1;function r1(t){return t==null?"":t1(t)}var Fp=r1,n1=at,i1=ou,a1=GE,o1=Fp;function s1(t,e){return n1(t)?t:i1(t,e)?[t]:a1(o1(t))}var Wp=s1,l1=$n,u1=1/0;function c1(t){if(typeof t=="string"||l1(t))return t;var e=t+"";return e=="0"&&1/t==-u1?"-0":e}var So=c1,f1=Wp,d1=So;function h1(t,e){e=f1(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[d1(e[r++])];return r&&r==n?t:void 0}var pu=h1,p1=pu;function v1(t,e,r){var n=t==null?void 0:p1(t,e);return n===void 0?r:n}var qp=v1;const ct=we(qp);function y1(t){return t==null}var g1=y1;const se=we(g1);var m1=Ht,b1=at,w1=Gt,_1="[object String]";function x1(t){return typeof t=="string"||!b1(t)&&w1(t)&&m1(t)==_1}var O1=x1;const Ur=we(O1);var vu={exports:{}},ve={};/**
|
|
70
41
|
* @license React
|
|
71
42
|
* react-is.production.min.js
|
|
72
43
|
*
|
|
@@ -74,7 +45,7 @@ ${m}`}class Ke extends Error{constructor({message:e,code:r,cause:n,name:i}){var
|
|
|
74
45
|
*
|
|
75
46
|
* This source code is licensed under the MIT license found in the
|
|
76
47
|
* LICENSE file in the root directory of this source tree.
|
|
77
|
-
*/var
|
|
48
|
+
*/var zp;function S1(){if(zp)return ve;zp=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"),s=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),y;y=Symbol.for("react.module.reference");function v(p){if(typeof p=="object"&&p!==null){var m=p.$$typeof;switch(m){case t:switch(p=p.type,p){case r:case i:case n:case u:case c:return p;default:switch(p=p&&p.$$typeof,p){case s:case o:case l:case d:case f:case a:return p;default:return m}}case e:return m}}}return ve.ContextConsumer=o,ve.ContextProvider=a,ve.Element=t,ve.ForwardRef=l,ve.Fragment=r,ve.Lazy=d,ve.Memo=f,ve.Portal=e,ve.Profiler=i,ve.StrictMode=n,ve.Suspense=u,ve.SuspenseList=c,ve.isAsyncMode=function(){return!1},ve.isConcurrentMode=function(){return!1},ve.isContextConsumer=function(p){return v(p)===o},ve.isContextProvider=function(p){return v(p)===a},ve.isElement=function(p){return typeof p=="object"&&p!==null&&p.$$typeof===t},ve.isForwardRef=function(p){return v(p)===l},ve.isFragment=function(p){return v(p)===r},ve.isLazy=function(p){return v(p)===d},ve.isMemo=function(p){return v(p)===f},ve.isPortal=function(p){return v(p)===e},ve.isProfiler=function(p){return v(p)===i},ve.isStrictMode=function(p){return v(p)===n},ve.isSuspense=function(p){return v(p)===u},ve.isSuspenseList=function(p){return v(p)===c},ve.isValidElementType=function(p){return typeof p=="string"||typeof p=="function"||p===r||p===i||p===n||p===u||p===c||p===h||typeof p=="object"&&p!==null&&(p.$$typeof===d||p.$$typeof===f||p.$$typeof===a||p.$$typeof===o||p.$$typeof===l||p.$$typeof===y||p.getModuleId!==void 0)},ve.typeOf=v,ve}var ye={};/**
|
|
78
49
|
* @license React
|
|
79
50
|
* react-is.development.js
|
|
80
51
|
*
|
|
@@ -82,94 +53,94 @@ ${m}`}class Ke extends Error{constructor({message:e,code:r,cause:n,name:i}){var
|
|
|
82
53
|
*
|
|
83
54
|
* This source code is licensed under the MIT license found in the
|
|
84
55
|
* LICENSE file in the root directory of this source tree.
|
|
85
|
-
*/var bv;function uT(){return bv||(bv=1,process.env.NODE_ENV!=="production"&&function(){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"),s=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),y=!1,v=!1,p=!1,m=!1,b=!1,w;w=Symbol.for("react.module.reference");function O(H){return!!(typeof H=="string"||typeof H=="function"||H===r||H===i||b||H===n||H===l||H===c||m||H===h||y||v||p||typeof H=="object"&&H!==null&&(H.$$typeof===d||H.$$typeof===f||H.$$typeof===a||H.$$typeof===o||H.$$typeof===u||H.$$typeof===w||H.getModuleId!==void 0))}function g(H){if(typeof H=="object"&&H!==null){var _e=H.$$typeof;switch(_e){case t:var Ee=H.type;switch(Ee){case r:case i:case n:case l:case c:return Ee;default:var Ge=Ee&&Ee.$$typeof;switch(Ge){case s:case o:case u:case d:case f:case a:return Ge;default:return _e}}case e:return _e}}}var _=o,S=a,A=t,E=u,N=r,j=d,$=f,k=e,I=i,R=n,M=l,L=c,q=!1,z=!1;function D(H){return q||(q=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}function B(H){return z||(z=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}function F(H){return g(H)===o}function G(H){return g(H)===a}function J(H){return typeof H=="object"&&H!==null&&H.$$typeof===t}function re(H){return g(H)===u}function ne(H){return g(H)===r}function ue(H){return g(H)===d}function oe(H){return g(H)===f}function W(H){return g(H)===e}function Y(H){return g(H)===i}function te(H){return g(H)===n}function C(H){return g(H)===l}function ye(H){return g(H)===c}Oe.ContextConsumer=_,Oe.ContextProvider=S,Oe.Element=A,Oe.ForwardRef=E,Oe.Fragment=N,Oe.Lazy=j,Oe.Memo=$,Oe.Portal=k,Oe.Profiler=I,Oe.StrictMode=R,Oe.Suspense=M,Oe.SuspenseList=L,Oe.isAsyncMode=D,Oe.isConcurrentMode=B,Oe.isContextConsumer=F,Oe.isContextProvider=G,Oe.isElement=J,Oe.isForwardRef=re,Oe.isFragment=ne,Oe.isLazy=ue,Oe.isMemo=oe,Oe.isPortal=W,Oe.isProfiler=Y,Oe.isStrictMode=te,Oe.isSuspense=C,Oe.isSuspenseList=ye,Oe.isValidElementType=O,Oe.typeOf=g}()),Oe}process.env.NODE_ENV==="production"?Bl.exports=sT():Bl.exports=uT();var lT=Bl.exports,cT=lr,fT=cr,dT="[object Number]";function hT(t){return typeof t=="number"||fT(t)&&cT(t)==dT}var wv=hT;const pT=je(wv);var vT=wv;function yT(t){return vT(t)&&t!=+t}var gT=yT;const Xn=je(gT);var ft=function(e){return e===0?0:e>0?1:-1},nn=function(e){return rn(e)&&e.indexOf("%")===e.length-1},V=function(e){return pT(e)&&!Xn(e)},mT=function(e){return fe(e)},Je=function(e){return V(e)||rn(e)},bT=0,an=function(e){var r=++bT;return"".concat(e||"").concat(r)},dt=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(!V(e)&&!rn(e))return n;var a;if(nn(e)){var o=e.indexOf("%");a=r*parseFloat(e.slice(0,o))/100}else a=+e;return Xn(a)&&(a=n),i&&a>r&&(a=r),a},Cr=function(e){if(!e)return null;var r=Object.keys(e);return r&&r.length?e[r[0]]:null},wT=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},Fe=function(e,r){return V(e)&&V(r)?function(n){return e+n*(r-e)}:function(){return r}};function Yo(t,e,r){return!t||!t.length?null:t.find(function(n){return n&&(typeof e=="function"?e(n):xt(n,e))===r})}var _T=function(e,r){return V(e)&&V(r)?e-r:rn(e)&&rn(r)?e.localeCompare(r):e instanceof Date&&r instanceof Date?e.getTime()-r.getTime():String(e).localeCompare(String(r))};function Jn(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 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)}var xT=["viewBox","children"],OT=["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"],_v=["points","pathLength"],Fl={svg:xT,polygon:_v,polyline:_v},Wl=["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"],Xo=function(e,r){if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(x.isValidElement(e)&&(n=e.props),!Vn(n))return null;var i={};return Object.keys(n).forEach(function(a){Wl.includes(a)&&(i[a]=r||function(o){return n[a](n,o)})}),i},ST=function(e,r,n){return function(i){return e(r,n,i),null}},on=function(e,r,n){if(!Vn(e)||Ul(e)!=="object")return null;var i=null;return Object.keys(e).forEach(function(a){var o=e[a];Wl.includes(a)&&typeof o=="function"&&(i||(i={}),i[a]=ST(o,r,n))}),i},AT=["children"],PT=["children"];function xv(t,e){if(t==null)return{};var r=ET(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 ET(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 ql(t){"@babel/helpers - typeof";return ql=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},ql(t)}var Ov={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"},fr=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},Sv=null,zl=null,Kl=function t(e){if(e===Sv&&Array.isArray(zl))return zl;var r=[];return x.Children.forEach(e,function(n){fe(n)||(lT.isFragment(n)?r=r.concat(t(n.props.children)):r.push(n))}),zl=r,Sv=e,r};function Ot(t,e){var r=[],n=[];return Array.isArray(e)?n=e.map(function(i){return fr(i)}):n=[fr(e)],Kl(t).forEach(function(i){var a=xt(i,"type.displayName")||xt(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function St(t,e){var r=Ot(t,e);return r&&r[0]}var Av=function(e){if(!e||!e.props)return!1;var r=e.props,n=r.width,i=r.height;return!(!V(n)||n<=0||!V(i)||i<=0)},TT=["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"],jT=function(e){return e&&e.type&&rn(e.type)&&TT.indexOf(e.type)>=0},Pv=function(e){return e&&ql(e)==="object"&&"clipDot"in e},$T=function(e,r,n,i){var a,o=(a=Fl==null?void 0:Fl[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!ae(e)&&(i&&o.includes(r)||OT.includes(r))||n&&Wl.includes(r)},Q=function(e,r,n){if(!e||typeof e=="function"||typeof e=="boolean")return null;var i=e;if(x.isValidElement(e)&&(i=e.props),!Vn(i))return null;var a={};return Object.keys(i).forEach(function(o){var s;$T((s=i)===null||s===void 0?void 0:s[o],o,r,n)&&(a[o]=i[o])}),a},Vl=function t(e,r){if(e===r)return!0;var n=x.Children.count(e);if(n!==x.Children.count(r))return!1;if(n===0)return!0;if(n===1)return Ev(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(!Ev(a,o))return!1}return!0},Ev=function(e,r){if(fe(e)&&fe(r))return!0;if(!fe(e)&&!fe(r)){var n=e.props||{},i=n.children,a=xv(n,AT),o=r.props||{},s=o.children,u=xv(o,PT);return i&&s?Jn(a,u)&&Vl(i,s):!i&&!s?Jn(a,u):!1}return!1},Tv=function(e,r){var n=[],i={};return Kl(e).forEach(function(a,o){if(jT(a))n.push(a);else if(a){var s=fr(a.type),u=r[s]||{},l=u.handler,c=u.once;if(l&&(!c||!i[s])){var f=l(a,s,o);n.push(f),i[s]=!0}}}),n},kT=function(e){var r=e&&e.type;return r&&Ov[r]?Ov[r]:null},CT=function(e,r){return Kl(r).indexOf(e)},IT=["children","width","height","viewBox","className","style","title","desc"];function Hl(){return Hl=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},Hl.apply(this,arguments)}function NT(t,e){if(t==null)return{};var r=MT(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 MT(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 Gl(t){var e=t.children,r=t.width,n=t.height,i=t.viewBox,a=t.className,o=t.style,s=t.title,u=t.desc,l=NT(t,IT),c=i||{width:r,height:n,x:0,y:0},f=le("recharts-surface",a);return x.createElement("svg",Hl({},Q(l,!0,"svg"),{className:f,width:r,height:n,style:o,viewBox:"".concat(c.x," ").concat(c.y," ").concat(c.width," ").concat(c.height)}),x.createElement("title",null,s),x.createElement("desc",null,u),e)}var DT=["children","className"];function Yl(){return Yl=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},Yl.apply(this,arguments)}function RT(t,e){if(t==null)return{};var r=LT(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 LT(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 pe=x.forwardRef(function(t,e){var r=t.children,n=t.className,i=RT(t,DT),a=le("recharts-layer",n);return x.createElement("g",Yl({className:a},Q(i,!0),{ref:e}),r)}),BT=process.env.NODE_ENV!=="production",zt=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];if(BT&&typeof console<"u"&&console.warn&&(r===void 0&&console.warn("LogUtils requires an error message argument"),!e))if(r===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var o=0;console.warn(r.replace(/%s/g,function(){return i[o++]}))}};function UT(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(i);++n<i;)a[n]=t[n+e];return a}var FT=UT,WT=FT;function qT(t,e,r){var n=t.length;return r=r===void 0?n:r,!e&&r>=n?t:WT(t,e,r)}var zT=qT,KT="\\ud800-\\udfff",VT="\\u0300-\\u036f",HT="\\ufe20-\\ufe2f",GT="\\u20d0-\\u20ff",YT=VT+HT+GT,XT="\\ufe0e\\ufe0f",JT="\\u200d",ZT=RegExp("["+JT+KT+YT+XT+"]");function QT(t){return ZT.test(t)}var jv=QT;function ej(t){return t.split("")}var tj=ej,$v="\\ud800-\\udfff",rj="\\u0300-\\u036f",nj="\\ufe20-\\ufe2f",ij="\\u20d0-\\u20ff",aj=rj+nj+ij,oj="\\ufe0e\\ufe0f",sj="["+$v+"]",Xl="["+aj+"]",Jl="\\ud83c[\\udffb-\\udfff]",uj="(?:"+Xl+"|"+Jl+")",kv="[^"+$v+"]",Cv="(?:\\ud83c[\\udde6-\\uddff]){2}",Iv="[\\ud800-\\udbff][\\udc00-\\udfff]",lj="\\u200d",Nv=uj+"?",Mv="["+oj+"]?",cj="(?:"+lj+"(?:"+[kv,Cv,Iv].join("|")+")"+Mv+Nv+")*",fj=Mv+Nv+cj,dj="(?:"+[kv+Xl+"?",Xl,Cv,Iv,sj].join("|")+")",hj=RegExp(Jl+"(?="+Jl+")|"+dj+fj,"g");function pj(t){return t.match(hj)||[]}var vj=pj,yj=tj,gj=jv,mj=vj;function bj(t){return gj(t)?mj(t):yj(t)}var wj=bj,_j=zT,xj=jv,Oj=wj,Sj=vv;function Aj(t){return function(e){e=Sj(e);var r=xj(e)?Oj(e):void 0,n=r?r[0]:e.charAt(0),i=r?_j(r,1).join(""):e.slice(1);return n[t]()+i}}var Pj=Aj,Ej=Pj,Tj=Ej("toUpperCase"),jj=Tj;const Jo=je(jj);function Ne(t){return function(){return t}}const Dv=Math.cos,Zo=Math.sin,Kt=Math.sqrt,Qo=Math.PI,es=2*Qo,Zl=Math.PI,Ql=2*Zl,sn=1e-6,$j=Ql-sn;function Rv(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=arguments[e]+t[e]}function kj(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Rv;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 Cj{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?Rv:kj(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,s=this._y1,u=n-e,l=i-r,c=o-e,f=s-r,d=c*c+f*f;if(this._x1===null)this._append`M${this._x1=e},${this._y1=r}`;else if(d>sn)if(!(Math.abs(f*u-l*c)>sn)||!a)this._append`L${this._x1=e},${this._y1=r}`;else{let h=n-o,y=i-s,v=u*u+l*l,p=h*h+y*y,m=Math.sqrt(v),b=Math.sqrt(d),w=a*Math.tan((Zl-Math.acos((v+d-p)/(2*m*b)))/2),O=w/b,g=w/m;Math.abs(O-1)>sn&&this._append`L${e+O*c},${r+O*f}`,this._append`A${a},${a},0,0,${+(f*h>c*y)},${this._x1=e+g*u},${this._y1=r+g*l}`}}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 s=n*Math.cos(i),u=n*Math.sin(i),l=e+s,c=r+u,f=1^o,d=o?i-a:a-i;this._x1===null?this._append`M${l},${c}`:(Math.abs(this._x1-l)>sn||Math.abs(this._y1-c)>sn)&&this._append`L${l},${c}`,n&&(d<0&&(d=d%Ql+Ql),d>$j?this._append`A${n},${n},0,1,${f},${e-s},${r-u}A${n},${n},0,1,${f},${this._x1=l},${this._y1=c}`:d>sn&&this._append`A${n},${n},0,${+(d>=Zl)},${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 ec(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 Cj(e)}function tc(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Lv(t){this._context=t}Lv.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 ts(t){return new Lv(t)}function Bv(t){return t[0]}function Uv(t){return t[1]}function Fv(t,e){var r=Ne(!0),n=null,i=ts,a=null,o=ec(s);t=typeof t=="function"?t:t===void 0?Bv:Ne(t),e=typeof e=="function"?e:e===void 0?Uv:Ne(e);function s(u){var l,c=(u=tc(u)).length,f,d=!1,h;for(n==null&&(a=i(h=o())),l=0;l<=c;++l)!(l<c&&r(f=u[l],l,u))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+t(f,l,u),+e(f,l,u));if(h)return a=null,h+""||null}return s.x=function(u){return arguments.length?(t=typeof u=="function"?u:Ne(+u),s):t},s.y=function(u){return arguments.length?(e=typeof u=="function"?u:Ne(+u),s):e},s.defined=function(u){return arguments.length?(r=typeof u=="function"?u:Ne(!!u),s):r},s.curve=function(u){return arguments.length?(i=u,n!=null&&(a=i(n)),s):i},s.context=function(u){return arguments.length?(u==null?n=a=null:a=i(n=u),s):n},s}function rs(t,e,r){var n=null,i=Ne(!0),a=null,o=ts,s=null,u=ec(l);t=typeof t=="function"?t:t===void 0?Bv:Ne(+t),e=typeof e=="function"?e:Ne(e===void 0?0:+e),r=typeof r=="function"?r:r===void 0?Uv:Ne(+r);function l(f){var d,h,y,v=(f=tc(f)).length,p,m=!1,b,w=new Array(v),O=new Array(v);for(a==null&&(s=o(b=u())),d=0;d<=v;++d){if(!(d<v&&i(p=f[d],d,f))===m)if(m=!m)h=d,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),y=d-1;y>=h;--y)s.point(w[y],O[y]);s.lineEnd(),s.areaEnd()}m&&(w[d]=+t(p,d,f),O[d]=+e(p,d,f),s.point(n?+n(p,d,f):w[d],r?+r(p,d,f):O[d]))}if(b)return s=null,b+""||null}function c(){return Fv().defined(i).curve(o).context(a)}return l.x=function(f){return arguments.length?(t=typeof f=="function"?f:Ne(+f),n=null,l):t},l.x0=function(f){return arguments.length?(t=typeof f=="function"?f:Ne(+f),l):t},l.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Ne(+f),l):n},l.y=function(f){return arguments.length?(e=typeof f=="function"?f:Ne(+f),r=null,l):e},l.y0=function(f){return arguments.length?(e=typeof f=="function"?f:Ne(+f),l):e},l.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Ne(+f),l):r},l.lineX0=l.lineY0=function(){return c().x(t).y(e)},l.lineY1=function(){return c().x(t).y(r)},l.lineX1=function(){return c().x(n).y(e)},l.defined=function(f){return arguments.length?(i=typeof f=="function"?f:Ne(!!f),l):i},l.curve=function(f){return arguments.length?(o=f,a!=null&&(s=o(a)),l):o},l.context=function(f){return arguments.length?(f==null?a=s=null:s=o(a=f),l):a},l}class Wv{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 Ij(t){return new Wv(t,!0)}function Nj(t){return new Wv(t,!1)}const rc={draw(t,e){const r=Kt(e/Qo);t.moveTo(r,0),t.arc(0,0,r,0,es)}},Mj={draw(t,e){const r=Kt(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()}},qv=Kt(1/3),Dj=qv*2,Rj={draw(t,e){const r=Kt(e/Dj),n=r*qv;t.moveTo(0,-r),t.lineTo(n,0),t.lineTo(0,r),t.lineTo(-n,0),t.closePath()}},Lj={draw(t,e){const r=Kt(e),n=-r/2;t.rect(n,n,r,r)}},Bj=.8908130915292852,zv=Zo(Qo/10)/Zo(7*Qo/10),Uj=Zo(es/10)*zv,Fj=-Dv(es/10)*zv,Wj={draw(t,e){const r=Kt(e*Bj),n=Uj*r,i=Fj*r;t.moveTo(0,-r),t.lineTo(n,i);for(let a=1;a<5;++a){const o=es*a/5,s=Dv(o),u=Zo(o);t.lineTo(u*r,-s*r),t.lineTo(s*n-u*i,u*n+s*i)}t.closePath()}},nc=Kt(3),qj={draw(t,e){const r=-Kt(e/(nc*3));t.moveTo(0,r*2),t.lineTo(-nc*r,-r),t.lineTo(nc*r,-r),t.closePath()}},$t=-.5,kt=Kt(3)/2,ic=1/Kt(12),zj=(ic/2+1)*3,Kj={draw(t,e){const r=Kt(e/zj),n=r/2,i=r*ic,a=n,o=r*ic+r,s=-a,u=o;t.moveTo(n,i),t.lineTo(a,o),t.lineTo(s,u),t.lineTo($t*n-kt*i,kt*n+$t*i),t.lineTo($t*a-kt*o,kt*a+$t*o),t.lineTo($t*s-kt*u,kt*s+$t*u),t.lineTo($t*n+kt*i,$t*i-kt*n),t.lineTo($t*a+kt*o,$t*o-kt*a),t.lineTo($t*s+kt*u,$t*u-kt*s),t.closePath()}};function Vj(t,e){let r=null,n=ec(i);t=typeof t=="function"?t:Ne(t||rc),e=typeof e=="function"?e:Ne(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:Ne(a),i):t},i.size=function(a){return arguments.length?(e=typeof a=="function"?a:Ne(+a),i):e},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function ns(){}function is(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 Kv(t){this._context=t}Kv.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:is(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:is(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Hj(t){return new Kv(t)}function Vv(t){this._context=t}Vv.prototype={areaStart:ns,areaEnd:ns,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:is(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Gj(t){return new Vv(t)}function Hv(t){this._context=t}Hv.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:is(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Yj(t){return new Hv(t)}function Gv(t){this._context=t}Gv.prototype={areaStart:ns,areaEnd:ns,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 Xj(t){return new Gv(t)}function Yv(t){return t<0?-1:1}function Xv(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),s=(a*i+o*n)/(n+i);return(Yv(a)+Yv(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Jv(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function ac(t,e,r){var n=t._x0,i=t._y0,a=t._x1,o=t._y1,s=(a-n)/3;t._context.bezierCurveTo(n+s,i+s*e,a-s,o-s*r,a,o)}function as(t){this._context=t}as.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:ac(this,this._t0,Jv(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,ac(this,Jv(this,r=Xv(this,t,e)),r);break;default:ac(this,this._t0,r=Xv(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function Zv(t){this._context=new Qv(t)}(Zv.prototype=Object.create(as.prototype)).point=function(t,e){as.prototype.point.call(this,e,t)};function Qv(t){this._context=t}Qv.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 Jj(t){return new as(t)}function Zj(t){return new Zv(t)}function ey(t){this._context=t}ey.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=ty(t),i=ty(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 ty(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 Qj(t){return new ey(t)}function os(t,e){this._context=t,this._t=e}os.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 e$(t){return new os(t,.5)}function t$(t){return new os(t,0)}function r$(t){return new os(t,1)}function Zn(t,e){if((o=t.length)>1)for(var r=1,n,i,a=t[e[0]],o,s=a.length;r<o;++r)for(i=a,a=t[e[r]],n=0;n<s;++n)a[n][1]+=a[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function oc(t){for(var e=t.length,r=new Array(e);--e>=0;)r[e]=e;return r}function n$(t,e){return t[e]}function i$(t){const e=[];return e.key=t,e}function a$(){var t=Ne([]),e=oc,r=Zn,n=n$;function i(a){var o=Array.from(t.apply(this,arguments),i$),s,u=o.length,l=-1,c;for(const f of a)for(s=0,++l;s<u;++s)(o[s][l]=[0,+n(f,o[s].key,l,a)]).data=f;for(s=0,c=tc(e(o));s<u;++s)o[c[s]].index=s;return r(o,c),o}return i.keys=function(a){return arguments.length?(t=typeof a=="function"?a:Ne(Array.from(a)),i):t},i.value=function(a){return arguments.length?(n=typeof a=="function"?a:Ne(+a),i):n},i.order=function(a){return arguments.length?(e=a==null?oc:typeof a=="function"?a:Ne(Array.from(a)),i):e},i.offset=function(a){return arguments.length?(r=a??Zn,i):r},i}function o$(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}Zn(t,e)}}function s$(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,s=0;o<i;++o)s+=t[o][r][1]||0;n[r][1]+=n[r][0]=-s/2}Zn(t,e)}}function u$(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 s=0,u=0,l=0;s<o;++s){for(var c=t[e[s]],f=c[n][1]||0,d=c[n-1][1]||0,h=(f-d)/2,y=0;y<s;++y){var v=t[e[y]],p=v[n][1]||0,m=v[n-1][1]||0;h+=p-m}u+=f,l+=h*f}i[n-1][1]+=i[n-1][0]=r,u&&(r-=l/u)}i[n-1][1]+=i[n-1][0]=r,Zn(t,e)}}function ha(t){"@babel/helpers - typeof";return ha=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},ha(t)}var l$=["type","size","sizeType"];function sc(){return sc=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},sc.apply(this,arguments)}function ry(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 ny(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ry(Object(r),!0).forEach(function(n){c$(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ry(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function c$(t,e,r){return e=f$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function f$(t){var e=d$(t,"string");return ha(e)=="symbol"?e:e+""}function d$(t,e){if(ha(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ha(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function h$(t,e){if(t==null)return{};var r=p$(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 p$(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 iy={symbolCircle:rc,symbolCross:Mj,symbolDiamond:Rj,symbolSquare:Lj,symbolStar:Wj,symbolTriangle:qj,symbolWye:Kj},v$=Math.PI/180,y$=function(e){var r="symbol".concat(Jo(e));return iy[r]||rc},g$=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*v$;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}},m$=function(e,r){iy["symbol".concat(Jo(e))]=r},uc=function(e){var r=e.type,n=r===void 0?"circle":r,i=e.size,a=i===void 0?64:i,o=e.sizeType,s=o===void 0?"area":o,u=h$(e,l$),l=ny(ny({},u),{},{type:n,size:a,sizeType:s}),c=function(){var p=y$(n),m=Vj().type(p).size(g$(a,s,n));return m()},f=l.className,d=l.cx,h=l.cy,y=Q(l,!0);return d===+d&&h===+h&&a===+a?x.createElement("path",sc({},y,{className:le("recharts-symbols",f),transform:"translate(".concat(d,", ").concat(h,")"),d:c()})):null};uc.registerSymbol=m$;function Qn(t){"@babel/helpers - typeof";return Qn=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},Qn(t)}function lc(){return lc=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},lc.apply(this,arguments)}function ay(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 b$(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ay(Object(r),!0).forEach(function(n){pa(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ay(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function w$(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _$(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,sy(n.key),n)}}function x$(t,e,r){return e&&_$(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function O$(t,e,r){return e=ss(e),S$(t,oy()?Reflect.construct(e,r||[],ss(t).constructor):e.apply(t,r))}function S$(t,e){if(e&&(Qn(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return A$(t)}function A$(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function oy(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(oy=function(){return!!t})()}function ss(t){return ss=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ss(t)}function P$(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&&cc(t,e)}function cc(t,e){return cc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},cc(t,e)}function pa(t,e,r){return e=sy(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function sy(t){var e=E$(t,"string");return Qn(e)=="symbol"?e:e+""}function E$(t,e){if(Qn(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Qn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Ct=32,fc=function(t){function e(){return w$(this,e),O$(this,e,arguments)}return P$(e,t),x$(e,[{key:"renderIcon",value:function(n){var i=this.props.inactiveColor,a=Ct/2,o=Ct/6,s=Ct/3,u=n.inactive?i:n.color;if(n.type==="plainline")return x.createElement("line",{strokeWidth:4,fill:"none",stroke:u,strokeDasharray:n.payload.strokeDasharray,x1:0,y1:a,x2:Ct,y2:a,className:"recharts-legend-icon"});if(n.type==="line")return x.createElement("path",{strokeWidth:4,fill:"none",stroke:u,d:"M0,".concat(a,"h").concat(s,`
|
|
56
|
+
*/var Kp;function A1(){return Kp||(Kp=1,process.env.NODE_ENV!=="production"&&function(){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"),s=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),y=!1,v=!1,p=!1,m=!1,w=!1,b;b=Symbol.for("react.module.reference");function O(K){return!!(typeof K=="string"||typeof K=="function"||K===r||K===i||w||K===n||K===u||K===c||m||K===h||y||v||p||typeof K=="object"&&K!==null&&(K.$$typeof===d||K.$$typeof===f||K.$$typeof===a||K.$$typeof===o||K.$$typeof===l||K.$$typeof===b||K.getModuleId!==void 0))}function g(K){if(typeof K=="object"&&K!==null){var Pe=K.$$typeof;switch(Pe){case t:var ke=K.type;switch(ke){case r:case i:case n:case u:case c:return ke;default:var Ye=ke&&ke.$$typeof;switch(Ye){case s:case o:case l:case d:case f:case a:return Ye;default:return Pe}}case e:return Pe}}}var _=o,S=a,A=t,E=l,I=r,T=d,$=f,k=e,C=i,D=n,N=u,L=c,W=!1,q=!1;function M(K){return W||(W=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}function R(K){return q||(q=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}function U(K){return g(K)===o}function V(K){return g(K)===a}function G(K){return typeof K=="object"&&K!==null&&K.$$typeof===t}function ee(K){return g(K)===l}function re(K){return g(K)===r}function le(K){return g(K)===d}function ae(K){return g(K)===f}function F(K){return g(K)===e}function H(K){return g(K)===i}function Q(K){return g(K)===n}function j(K){return g(K)===u}function de(K){return g(K)===c}ye.ContextConsumer=_,ye.ContextProvider=S,ye.Element=A,ye.ForwardRef=E,ye.Fragment=I,ye.Lazy=T,ye.Memo=$,ye.Portal=k,ye.Profiler=C,ye.StrictMode=D,ye.Suspense=N,ye.SuspenseList=L,ye.isAsyncMode=M,ye.isConcurrentMode=R,ye.isContextConsumer=U,ye.isContextProvider=V,ye.isElement=G,ye.isForwardRef=ee,ye.isFragment=re,ye.isLazy=le,ye.isMemo=ae,ye.isPortal=F,ye.isProfiler=H,ye.isStrictMode=Q,ye.isSuspense=j,ye.isSuspenseList=de,ye.isValidElementType=O,ye.typeOf=g}()),ye}process.env.NODE_ENV==="production"?vu.exports=S1():vu.exports=A1();var P1=vu.exports,E1=Ht,T1=Gt,$1="[object Number]";function j1(t){return typeof t=="number"||T1(t)&&E1(t)==$1}var Vp=j1;const k1=we(Vp);var C1=Vp;function I1(t){return C1(t)&&t!=+t}var N1=I1;const Nn=we(N1);var tt=function(e){return e===0?0:e>0?1:-1},Fr=function(e){return Ur(e)&&e.indexOf("%")===e.length-1},z=function(e){return k1(e)&&!Nn(e)},M1=function(e){return se(e)},Ue=function(e){return z(e)||Ur(e)},D1=0,Wr=function(e){var r=++D1;return"".concat(e||"").concat(r)},rt=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(!z(e)&&!Ur(e))return n;var a;if(Fr(e)){var o=e.indexOf("%");a=r*parseFloat(e.slice(0,o))/100}else a=+e;return Nn(a)&&(a=n),i&&a>r&&(a=r),a},gr=function(e){if(!e)return null;var r=Object.keys(e);return r&&r.length?e[r[0]]:null},L1=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},Ie=function(e,r){return z(e)&&z(r)?function(n){return e+n*(r-e)}:function(){return r}};function Ao(t,e,r){return!t||!t.length?null:t.find(function(n){return n&&(typeof e=="function"?e(n):ct(n,e))===r})}var B1=function(e,r){return z(e)&&z(r)?e-r:Ur(e)&&Ur(r)?e.localeCompare(r):e instanceof Date&&r instanceof Date?e.getTime()-r.getTime():String(e).localeCompare(String(r))};function Mn(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 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)}var R1=["viewBox","children"],U1=["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"],Hp=["points","pathLength"],gu={svg:R1,polygon:Hp,polyline:Hp},mu=["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"],Po=function(e,r){if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(x.isValidElement(e)&&(n=e.props),!jn(n))return null;var i={};return Object.keys(n).forEach(function(a){mu.includes(a)&&(i[a]=r||function(o){return n[a](n,o)})}),i},F1=function(e,r,n){return function(i){return e(r,n,i),null}},qr=function(e,r,n){if(!jn(e)||yu(e)!=="object")return null;var i=null;return Object.keys(e).forEach(function(a){var o=e[a];mu.includes(a)&&typeof o=="function"&&(i||(i={}),i[a]=F1(o,r,n))}),i},W1=["children"],q1=["children"];function Gp(t,e){if(t==null)return{};var r=z1(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 z1(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 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)}var Yp={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"},Yt=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},Xp=null,wu=null,_u=function t(e){if(e===Xp&&Array.isArray(wu))return wu;var r=[];return x.Children.forEach(e,function(n){se(n)||(P1.isFragment(n)?r=r.concat(t(n.props.children)):r.push(n))}),wu=r,Xp=e,r};function ft(t,e){var r=[],n=[];return Array.isArray(e)?n=e.map(function(i){return Yt(i)}):n=[Yt(e)],_u(t).forEach(function(i){var a=ct(i,"type.displayName")||ct(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function dt(t,e){var r=ft(t,e);return r&&r[0]}var Jp=function(e){if(!e||!e.props)return!1;var r=e.props,n=r.width,i=r.height;return!(!z(n)||n<=0||!z(i)||i<=0)},K1=["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"],V1=function(e){return e&&e.type&&Ur(e.type)&&K1.indexOf(e.type)>=0},Zp=function(e){return e&&bu(e)==="object"&&"clipDot"in e},H1=function(e,r,n,i){var a,o=(a=gu==null?void 0:gu[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!te(e)&&(i&&o.includes(r)||U1.includes(r))||n&&mu.includes(r)},X=function(e,r,n){if(!e||typeof e=="function"||typeof e=="boolean")return null;var i=e;if(x.isValidElement(e)&&(i=e.props),!jn(i))return null;var a={};return Object.keys(i).forEach(function(o){var s;H1((s=i)===null||s===void 0?void 0:s[o],o,r,n)&&(a[o]=i[o])}),a},xu=function t(e,r){if(e===r)return!0;var n=x.Children.count(e);if(n!==x.Children.count(r))return!1;if(n===0)return!0;if(n===1)return Qp(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(!Qp(a,o))return!1}return!0},Qp=function(e,r){if(se(e)&&se(r))return!0;if(!se(e)&&!se(r)){var n=e.props||{},i=n.children,a=Gp(n,W1),o=r.props||{},s=o.children,l=Gp(o,q1);return i&&s?Mn(a,l)&&xu(i,s):!i&&!s?Mn(a,l):!1}return!1},ev=function(e,r){var n=[],i={};return _u(e).forEach(function(a,o){if(V1(a))n.push(a);else if(a){var s=Yt(a.type),l=r[s]||{},u=l.handler,c=l.once;if(u&&(!c||!i[s])){var f=u(a,s,o);n.push(f),i[s]=!0}}}),n},G1=function(e){var r=e&&e.type;return r&&Yp[r]?Yp[r]:null},Y1=function(e,r){return _u(r).indexOf(e)},X1=["children","width","height","viewBox","className","style","title","desc"];function Ou(){return Ou=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},Ou.apply(this,arguments)}function J1(t,e){if(t==null)return{};var r=Z1(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 Z1(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 Su(t){var e=t.children,r=t.width,n=t.height,i=t.viewBox,a=t.className,o=t.style,s=t.title,l=t.desc,u=J1(t,X1),c=i||{width:r,height:n,x:0,y:0},f=ie("recharts-surface",a);return x.createElement("svg",Ou({},X(u,!0,"svg"),{className:f,width:r,height:n,style:o,viewBox:"".concat(c.x," ").concat(c.y," ").concat(c.width," ").concat(c.height)}),x.createElement("title",null,s),x.createElement("desc",null,l),e)}var Q1=["children","className"];function Au(){return Au=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},Au.apply(this,arguments)}function eT(t,e){if(t==null)return{};var r=tT(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 tT(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 ce=x.forwardRef(function(t,e){var r=t.children,n=t.className,i=eT(t,Q1),a=ie("recharts-layer",n);return x.createElement("g",Au({className:a},X(i,!0),{ref:e}),r)}),rT=process.env.NODE_ENV!=="production",jt=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];if(rT&&typeof console<"u"&&console.warn&&(r===void 0&&console.warn("LogUtils requires an error message argument"),!e))if(r===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var o=0;console.warn(r.replace(/%s/g,function(){return i[o++]}))}};function nT(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(i);++n<i;)a[n]=t[n+e];return a}var iT=nT,aT=iT;function oT(t,e,r){var n=t.length;return r=r===void 0?n:r,!e&&r>=n?t:aT(t,e,r)}var sT=oT,lT="\\ud800-\\udfff",uT="\\u0300-\\u036f",cT="\\ufe20-\\ufe2f",fT="\\u20d0-\\u20ff",dT=uT+cT+fT,hT="\\ufe0e\\ufe0f",pT="\\u200d",vT=RegExp("["+pT+lT+dT+hT+"]");function yT(t){return vT.test(t)}var tv=yT;function gT(t){return t.split("")}var mT=gT,rv="\\ud800-\\udfff",bT="\\u0300-\\u036f",wT="\\ufe20-\\ufe2f",_T="\\u20d0-\\u20ff",xT=bT+wT+_T,OT="\\ufe0e\\ufe0f",ST="["+rv+"]",Pu="["+xT+"]",Eu="\\ud83c[\\udffb-\\udfff]",AT="(?:"+Pu+"|"+Eu+")",nv="[^"+rv+"]",iv="(?:\\ud83c[\\udde6-\\uddff]){2}",av="[\\ud800-\\udbff][\\udc00-\\udfff]",PT="\\u200d",ov=AT+"?",sv="["+OT+"]?",ET="(?:"+PT+"(?:"+[nv,iv,av].join("|")+")"+sv+ov+")*",TT=sv+ov+ET,$T="(?:"+[nv+Pu+"?",Pu,iv,av,ST].join("|")+")",jT=RegExp(Eu+"(?="+Eu+")|"+$T+TT,"g");function kT(t){return t.match(jT)||[]}var CT=kT,IT=mT,NT=tv,MT=CT;function DT(t){return NT(t)?MT(t):IT(t)}var LT=DT,BT=sT,RT=tv,UT=LT,FT=Fp;function WT(t){return function(e){e=FT(e);var r=RT(e)?UT(e):void 0,n=r?r[0]:e.charAt(0),i=r?BT(r,1).join(""):e.slice(1);return n[t]()+i}}var qT=WT,zT=qT,KT=zT("toUpperCase"),VT=KT;const Eo=we(VT);function Se(t){return function(){return t}}const lv=Math.cos,To=Math.sin,kt=Math.sqrt,$o=Math.PI,jo=2*$o,Tu=Math.PI,$u=2*Tu,zr=1e-6,HT=$u-zr;function uv(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=arguments[e]+t[e]}function GT(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return uv;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 YT{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?uv:GT(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,s=this._y1,l=n-e,u=i-r,c=o-e,f=s-r,d=c*c+f*f;if(this._x1===null)this._append`M${this._x1=e},${this._y1=r}`;else if(d>zr)if(!(Math.abs(f*l-u*c)>zr)||!a)this._append`L${this._x1=e},${this._y1=r}`;else{let h=n-o,y=i-s,v=l*l+u*u,p=h*h+y*y,m=Math.sqrt(v),w=Math.sqrt(d),b=a*Math.tan((Tu-Math.acos((v+d-p)/(2*m*w)))/2),O=b/w,g=b/m;Math.abs(O-1)>zr&&this._append`L${e+O*c},${r+O*f}`,this._append`A${a},${a},0,0,${+(f*h>c*y)},${this._x1=e+g*l},${this._y1=r+g*u}`}}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 s=n*Math.cos(i),l=n*Math.sin(i),u=e+s,c=r+l,f=1^o,d=o?i-a:a-i;this._x1===null?this._append`M${u},${c}`:(Math.abs(this._x1-u)>zr||Math.abs(this._y1-c)>zr)&&this._append`L${u},${c}`,n&&(d<0&&(d=d%$u+$u),d>HT?this._append`A${n},${n},0,1,${f},${e-s},${r-l}A${n},${n},0,1,${f},${this._x1=u},${this._y1=c}`:d>zr&&this._append`A${n},${n},0,${+(d>=Tu)},${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 ju(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 YT(e)}function ku(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function cv(t){this._context=t}cv.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 ko(t){return new cv(t)}function fv(t){return t[0]}function dv(t){return t[1]}function hv(t,e){var r=Se(!0),n=null,i=ko,a=null,o=ju(s);t=typeof t=="function"?t:t===void 0?fv:Se(t),e=typeof e=="function"?e:e===void 0?dv:Se(e);function s(l){var u,c=(l=ku(l)).length,f,d=!1,h;for(n==null&&(a=i(h=o())),u=0;u<=c;++u)!(u<c&&r(f=l[u],u,l))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+t(f,u,l),+e(f,u,l));if(h)return a=null,h+""||null}return s.x=function(l){return arguments.length?(t=typeof l=="function"?l:Se(+l),s):t},s.y=function(l){return arguments.length?(e=typeof l=="function"?l:Se(+l),s):e},s.defined=function(l){return arguments.length?(r=typeof l=="function"?l:Se(!!l),s):r},s.curve=function(l){return arguments.length?(i=l,n!=null&&(a=i(n)),s):i},s.context=function(l){return arguments.length?(l==null?n=a=null:a=i(n=l),s):n},s}function Co(t,e,r){var n=null,i=Se(!0),a=null,o=ko,s=null,l=ju(u);t=typeof t=="function"?t:t===void 0?fv:Se(+t),e=typeof e=="function"?e:Se(e===void 0?0:+e),r=typeof r=="function"?r:r===void 0?dv:Se(+r);function u(f){var d,h,y,v=(f=ku(f)).length,p,m=!1,w,b=new Array(v),O=new Array(v);for(a==null&&(s=o(w=l())),d=0;d<=v;++d){if(!(d<v&&i(p=f[d],d,f))===m)if(m=!m)h=d,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),y=d-1;y>=h;--y)s.point(b[y],O[y]);s.lineEnd(),s.areaEnd()}m&&(b[d]=+t(p,d,f),O[d]=+e(p,d,f),s.point(n?+n(p,d,f):b[d],r?+r(p,d,f):O[d]))}if(w)return s=null,w+""||null}function c(){return hv().defined(i).curve(o).context(a)}return u.x=function(f){return arguments.length?(t=typeof f=="function"?f:Se(+f),n=null,u):t},u.x0=function(f){return arguments.length?(t=typeof f=="function"?f:Se(+f),u):t},u.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Se(+f),u):n},u.y=function(f){return arguments.length?(e=typeof f=="function"?f:Se(+f),r=null,u):e},u.y0=function(f){return arguments.length?(e=typeof f=="function"?f:Se(+f),u):e},u.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Se(+f),u):r},u.lineX0=u.lineY0=function(){return c().x(t).y(e)},u.lineY1=function(){return c().x(t).y(r)},u.lineX1=function(){return c().x(n).y(e)},u.defined=function(f){return arguments.length?(i=typeof f=="function"?f:Se(!!f),u):i},u.curve=function(f){return arguments.length?(o=f,a!=null&&(s=o(a)),u):o},u.context=function(f){return arguments.length?(f==null?a=s=null:s=o(a=f),u):a},u}class pv{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 XT(t){return new pv(t,!0)}function JT(t){return new pv(t,!1)}const Cu={draw(t,e){const r=kt(e/$o);t.moveTo(r,0),t.arc(0,0,r,0,jo)}},ZT={draw(t,e){const r=kt(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()}},vv=kt(1/3),QT=vv*2,e$={draw(t,e){const r=kt(e/QT),n=r*vv;t.moveTo(0,-r),t.lineTo(n,0),t.lineTo(0,r),t.lineTo(-n,0),t.closePath()}},t$={draw(t,e){const r=kt(e),n=-r/2;t.rect(n,n,r,r)}},r$=.8908130915292852,yv=To($o/10)/To(7*$o/10),n$=To(jo/10)*yv,i$=-lv(jo/10)*yv,a$={draw(t,e){const r=kt(e*r$),n=n$*r,i=i$*r;t.moveTo(0,-r),t.lineTo(n,i);for(let a=1;a<5;++a){const o=jo*a/5,s=lv(o),l=To(o);t.lineTo(l*r,-s*r),t.lineTo(s*n-l*i,l*n+s*i)}t.closePath()}},Iu=kt(3),o$={draw(t,e){const r=-kt(e/(Iu*3));t.moveTo(0,r*2),t.lineTo(-Iu*r,-r),t.lineTo(Iu*r,-r),t.closePath()}},gt=-.5,mt=kt(3)/2,Nu=1/kt(12),s$=(Nu/2+1)*3,l$={draw(t,e){const r=kt(e/s$),n=r/2,i=r*Nu,a=n,o=r*Nu+r,s=-a,l=o;t.moveTo(n,i),t.lineTo(a,o),t.lineTo(s,l),t.lineTo(gt*n-mt*i,mt*n+gt*i),t.lineTo(gt*a-mt*o,mt*a+gt*o),t.lineTo(gt*s-mt*l,mt*s+gt*l),t.lineTo(gt*n+mt*i,gt*i-mt*n),t.lineTo(gt*a+mt*o,gt*o-mt*a),t.lineTo(gt*s+mt*l,gt*l-mt*s),t.closePath()}};function u$(t,e){let r=null,n=ju(i);t=typeof t=="function"?t:Se(t||Cu),e=typeof e=="function"?e:Se(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:Se(a),i):t},i.size=function(a){return arguments.length?(e=typeof a=="function"?a:Se(+a),i):e},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function Io(){}function No(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 gv(t){this._context=t}gv.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:No(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:No(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function c$(t){return new gv(t)}function mv(t){this._context=t}mv.prototype={areaStart:Io,areaEnd:Io,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:No(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function f$(t){return new mv(t)}function bv(t){this._context=t}bv.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:No(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function d$(t){return new bv(t)}function wv(t){this._context=t}wv.prototype={areaStart:Io,areaEnd:Io,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 h$(t){return new wv(t)}function _v(t){return t<0?-1:1}function xv(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),s=(a*i+o*n)/(n+i);return(_v(a)+_v(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Ov(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function Mu(t,e,r){var n=t._x0,i=t._y0,a=t._x1,o=t._y1,s=(a-n)/3;t._context.bezierCurveTo(n+s,i+s*e,a-s,o-s*r,a,o)}function Mo(t){this._context=t}Mo.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:Mu(this,this._t0,Ov(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,Mu(this,Ov(this,r=xv(this,t,e)),r);break;default:Mu(this,this._t0,r=xv(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function Sv(t){this._context=new Av(t)}(Sv.prototype=Object.create(Mo.prototype)).point=function(t,e){Mo.prototype.point.call(this,e,t)};function Av(t){this._context=t}Av.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 p$(t){return new Mo(t)}function v$(t){return new Sv(t)}function Pv(t){this._context=t}Pv.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=Ev(t),i=Ev(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 Ev(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 y$(t){return new Pv(t)}function Do(t,e){this._context=t,this._t=e}Do.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 g$(t){return new Do(t,.5)}function m$(t){return new Do(t,0)}function b$(t){return new Do(t,1)}function Dn(t,e){if((o=t.length)>1)for(var r=1,n,i,a=t[e[0]],o,s=a.length;r<o;++r)for(i=a,a=t[e[r]],n=0;n<s;++n)a[n][1]+=a[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function Du(t){for(var e=t.length,r=new Array(e);--e>=0;)r[e]=e;return r}function w$(t,e){return t[e]}function _$(t){const e=[];return e.key=t,e}function x$(){var t=Se([]),e=Du,r=Dn,n=w$;function i(a){var o=Array.from(t.apply(this,arguments),_$),s,l=o.length,u=-1,c;for(const f of a)for(s=0,++u;s<l;++s)(o[s][u]=[0,+n(f,o[s].key,u,a)]).data=f;for(s=0,c=ku(e(o));s<l;++s)o[c[s]].index=s;return r(o,c),o}return i.keys=function(a){return arguments.length?(t=typeof a=="function"?a:Se(Array.from(a)),i):t},i.value=function(a){return arguments.length?(n=typeof a=="function"?a:Se(+a),i):n},i.order=function(a){return arguments.length?(e=a==null?Du:typeof a=="function"?a:Se(Array.from(a)),i):e},i.offset=function(a){return arguments.length?(r=a??Dn,i):r},i}function O$(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}Dn(t,e)}}function S$(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,s=0;o<i;++o)s+=t[o][r][1]||0;n[r][1]+=n[r][0]=-s/2}Dn(t,e)}}function A$(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 s=0,l=0,u=0;s<o;++s){for(var c=t[e[s]],f=c[n][1]||0,d=c[n-1][1]||0,h=(f-d)/2,y=0;y<s;++y){var v=t[e[y]],p=v[n][1]||0,m=v[n-1][1]||0;h+=p-m}l+=f,u+=h*f}i[n-1][1]+=i[n-1][0]=r,l&&(r-=u/l)}i[n-1][1]+=i[n-1][0]=r,Dn(t,e)}}function Vi(t){"@babel/helpers - typeof";return Vi=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},Vi(t)}var P$=["type","size","sizeType"];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)}function Tv(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 $v(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Tv(Object(r),!0).forEach(function(n){E$(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Tv(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function E$(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 T$(t){var e=$$(t,"string");return Vi(e)=="symbol"?e:e+""}function $$(t,e){if(Vi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Vi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function j$(t,e){if(t==null)return{};var r=k$(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 k$(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 jv={symbolCircle:Cu,symbolCross:ZT,symbolDiamond:e$,symbolSquare:t$,symbolStar:a$,symbolTriangle:o$,symbolWye:l$},C$=Math.PI/180,I$=function(e){var r="symbol".concat(Eo(e));return jv[r]||Cu},N$=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*C$;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}},M$=function(e,r){jv["symbol".concat(Eo(e))]=r},Bu=function(e){var r=e.type,n=r===void 0?"circle":r,i=e.size,a=i===void 0?64:i,o=e.sizeType,s=o===void 0?"area":o,l=j$(e,P$),u=$v($v({},l),{},{type:n,size:a,sizeType:s}),c=function(){var p=I$(n),m=u$().type(p).size(N$(a,s,n));return m()},f=u.className,d=u.cx,h=u.cy,y=X(u,!0);return d===+d&&h===+h&&a===+a?x.createElement("path",Lu({},y,{className:ie("recharts-symbols",f),transform:"translate(".concat(d,", ").concat(h,")"),d:c()})):null};Bu.registerSymbol=M$;function Ln(t){"@babel/helpers - typeof";return Ln=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},Ln(t)}function Ru(){return Ru=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},Ru.apply(this,arguments)}function kv(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 D$(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?kv(Object(r),!0).forEach(function(n){Hi(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):kv(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function L$(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function B$(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,Iv(n.key),n)}}function R$(t,e,r){return e&&B$(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function U$(t,e,r){return e=Lo(e),F$(t,Cv()?Reflect.construct(e,r||[],Lo(t).constructor):e.apply(t,r))}function F$(t,e){if(e&&(Ln(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return W$(t)}function W$(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Cv(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Cv=function(){return!!t})()}function Lo(t){return Lo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Lo(t)}function q$(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&&Uu(t,e)}function Uu(t,e){return Uu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Uu(t,e)}function Hi(t,e,r){return e=Iv(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Iv(t){var e=z$(t,"string");return Ln(e)=="symbol"?e:e+""}function z$(t,e){if(Ln(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ln(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var bt=32,Fu=function(t){function e(){return L$(this,e),U$(this,e,arguments)}return q$(e,t),R$(e,[{key:"renderIcon",value:function(n){var i=this.props.inactiveColor,a=bt/2,o=bt/6,s=bt/3,l=n.inactive?i:n.color;if(n.type==="plainline")return x.createElement("line",{strokeWidth:4,fill:"none",stroke:l,strokeDasharray:n.payload.strokeDasharray,x1:0,y1:a,x2:bt,y2:a,className:"recharts-legend-icon"});if(n.type==="line")return x.createElement("path",{strokeWidth:4,fill:"none",stroke:l,d:"M0,".concat(a,"h").concat(s,`
|
|
86
57
|
A`).concat(o,",").concat(o,",0,1,1,").concat(2*s,",").concat(a,`
|
|
87
|
-
H`).concat(
|
|
88
|
-
A`).concat(o,",").concat(o,",0,1,1,").concat(s,",").concat(a),className:"recharts-legend-icon"});if(n.type==="rect")return x.createElement("path",{stroke:"none",fill:u,d:"M0,".concat(Ct/8,"h").concat(Ct,"v").concat(Ct*3/4,"h").concat(-Ct,"z"),className:"recharts-legend-icon"});if(x.isValidElement(n.legendIcon)){var l=b$({},n);return delete l.legendIcon,x.cloneElement(n.legendIcon,l)}return x.createElement(uc,{fill:u,cx:a,cy:a,size:Ct,sizeType:"diameter",type:n.type})}},{key:"renderItems",value:function(){var n=this,i=this.props,a=i.payload,o=i.iconSize,s=i.layout,u=i.formatter,l=i.inactiveColor,c={x:0,y:0,width:Ct,height:Ct},f={display:s==="horizontal"?"inline-block":"block",marginRight:10},d={display:"inline-block",verticalAlign:"middle",marginRight:4};return a.map(function(h,y){var v=h.formatter||u,p=le(pa(pa({"recharts-legend-item":!0},"legend-item-".concat(y),!0),"inactive",h.inactive));if(h.type==="none")return null;var m=ae(h.value)?null:h.value;zt(!ae(h.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 b=h.inactive?l:h.color;return x.createElement("li",lc({className:p,style:f,key:"legend-item-".concat(y)},on(n.props,h,y)),x.createElement(Gl,{width:o,height:o,viewBox:c,style:d},n.renderIcon(h)),x.createElement("span",{className:"recharts-legend-item-text",style:{color:b}},v?v(m,h,y):m))})}},{key:"render",value:function(){var n=this.props,i=n.payload,a=n.layout,o=n.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return x.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(x.PureComponent);pa(fc,"displayName","Legend"),pa(fc,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var T$=Vo;function j$(){this.__data__=new T$,this.size=0}var $$=j$;function k$(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var C$=k$;function I$(t){return this.__data__.get(t)}var N$=I$;function M$(t){return this.__data__.has(t)}var D$=M$,R$=Vo,L$=Nl,B$=Ml,U$=200;function F$(t,e){var r=this.__data__;if(r instanceof R$){var n=r.__data__;if(!L$||n.length<U$-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new B$(n)}return r.set(t,e),this.size=r.size,this}var W$=F$,q$=Vo,z$=$$,K$=C$,V$=N$,H$=D$,G$=W$;function ei(t){var e=this.__data__=new q$(t);this.size=e.size}ei.prototype.clear=z$,ei.prototype.delete=K$,ei.prototype.get=V$,ei.prototype.has=H$,ei.prototype.set=G$;var uy=ei,Y$="__lodash_hash_undefined__";function X$(t){return this.__data__.set(t,Y$),this}var J$=X$;function Z$(t){return this.__data__.has(t)}var Q$=Z$,ek=Ml,tk=J$,rk=Q$;function us(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new ek;++e<r;)this.add(t[e])}us.prototype.add=us.prototype.push=tk,us.prototype.has=rk;var ly=us;function nk(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}var cy=nk;function ik(t,e){return t.has(e)}var fy=ik,ak=ly,ok=cy,sk=fy,uk=1,lk=2;function ck(t,e,r,n,i,a){var o=r&uk,s=t.length,u=e.length;if(s!=u&&!(o&&u>s))return!1;var l=a.get(t),c=a.get(e);if(l&&c)return l==e&&c==t;var f=-1,d=!0,h=r&lk?new ak:void 0;for(a.set(t,e),a.set(e,t);++f<s;){var y=t[f],v=e[f];if(n)var p=o?n(v,y,f,e,t,a):n(y,v,f,t,e,a);if(p!==void 0){if(p)continue;d=!1;break}if(h){if(!ok(e,function(m,b){if(!sk(h,b)&&(y===m||i(y,m,r,n,a)))return h.push(b)})){d=!1;break}}else if(!(y===v||i(y,v,r,n,a))){d=!1;break}}return a.delete(t),a.delete(e),d}var dy=ck,fk=Qt,dk=fk.Uint8Array,hk=dk;function pk(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}var vk=pk;function yk(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var dc=yk,hy=fa,py=hk,gk=Il,mk=dy,bk=vk,wk=dc,_k=1,xk=2,Ok="[object Boolean]",Sk="[object Date]",Ak="[object Error]",Pk="[object Map]",Ek="[object Number]",Tk="[object RegExp]",jk="[object Set]",$k="[object String]",kk="[object Symbol]",Ck="[object ArrayBuffer]",Ik="[object DataView]",vy=hy?hy.prototype:void 0,hc=vy?vy.valueOf:void 0;function Nk(t,e,r,n,i,a,o){switch(r){case Ik:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Ck:return!(t.byteLength!=e.byteLength||!a(new py(t),new py(e)));case Ok:case Sk:case Ek:return gk(+t,+e);case Ak:return t.name==e.name&&t.message==e.message;case Tk:case $k:return t==e+"";case Pk:var s=bk;case jk:var u=n&_k;if(s||(s=wk),t.size!=e.size&&!u)return!1;var l=o.get(t);if(l)return l==e;n|=xk,o.set(t,e);var c=mk(s(t),s(e),n,i,a,o);return o.delete(t),c;case kk:if(hc)return hc.call(t)==hc.call(e)}return!1}var Mk=Nk;function Dk(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var yy=Dk,Rk=yy,Lk=yt;function Bk(t,e,r){var n=e(t);return Lk(t)?n:Rk(n,r(t))}var Uk=Bk;function Fk(t,e){for(var r=-1,n=t==null?0:t.length,i=0,a=[];++r<n;){var o=t[r];e(o,r,t)&&(a[i++]=o)}return a}var Wk=Fk;function qk(){return[]}var zk=qk,Kk=Wk,Vk=zk,Hk=Object.prototype,Gk=Hk.propertyIsEnumerable,gy=Object.getOwnPropertySymbols,Yk=gy?function(t){return t==null?[]:(t=Object(t),Kk(gy(t),function(e){return Gk.call(t,e)}))}:Vk,Xk=Yk;function Jk(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Zk=Jk,Qk=lr,eC=cr,tC="[object Arguments]";function rC(t){return eC(t)&&Qk(t)==tC}var nC=rC,my=nC,iC=cr,by=Object.prototype,aC=by.hasOwnProperty,oC=by.propertyIsEnumerable,sC=my(function(){return arguments}())?my:function(t){return iC(t)&&aC.call(t,"callee")&&!oC.call(t,"callee")},pc=sC,ls={exports:{}};function uC(){return!1}var lC=uC;ls.exports,function(t,e){var r=Qt,n=lC,i=e&&!e.nodeType&&e,a=i&&!0&&t&&!t.nodeType&&t,o=a&&a.exports===i,s=o?r.Buffer:void 0,u=s?s.isBuffer:void 0,l=u||n;t.exports=l}(ls,ls.exports);var wy=ls.exports,cC=9007199254740991,fC=/^(?:0|[1-9]\d*)$/;function dC(t,e){var r=typeof t;return e=e??cC,!!e&&(r=="number"||r!="symbol"&&fC.test(t))&&t>-1&&t%1==0&&t<e}var vc=dC,hC=9007199254740991;function pC(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=hC}var yc=pC,vC=lr,yC=yc,gC=cr,mC="[object Arguments]",bC="[object Array]",wC="[object Boolean]",_C="[object Date]",xC="[object Error]",OC="[object Function]",SC="[object Map]",AC="[object Number]",PC="[object Object]",EC="[object RegExp]",TC="[object Set]",jC="[object String]",$C="[object WeakMap]",kC="[object ArrayBuffer]",CC="[object DataView]",IC="[object Float32Array]",NC="[object Float64Array]",MC="[object Int8Array]",DC="[object Int16Array]",RC="[object Int32Array]",LC="[object Uint8Array]",BC="[object Uint8ClampedArray]",UC="[object Uint16Array]",FC="[object Uint32Array]",Re={};Re[IC]=Re[NC]=Re[MC]=Re[DC]=Re[RC]=Re[LC]=Re[BC]=Re[UC]=Re[FC]=!0,Re[mC]=Re[bC]=Re[kC]=Re[wC]=Re[CC]=Re[_C]=Re[xC]=Re[OC]=Re[SC]=Re[AC]=Re[PC]=Re[EC]=Re[TC]=Re[jC]=Re[$C]=!1;function WC(t){return gC(t)&&yC(t.length)&&!!Re[vC(t)]}var qC=WC;function zC(t){return function(e){return t(e)}}var _y=zC,cs={exports:{}};cs.exports,function(t,e){var r=ev,n=e&&!e.nodeType&&e,i=n&&!0&&t&&!t.nodeType&&t,a=i&&i.exports===n,o=a&&r.process,s=function(){try{var u=i&&i.require&&i.require("util").types;return u||o&&o.binding&&o.binding("util")}catch{}}();t.exports=s}(cs,cs.exports);var KC=cs.exports,VC=qC,HC=_y,xy=KC,Oy=xy&&xy.isTypedArray,GC=Oy?HC(Oy):VC,Sy=GC,YC=Zk,XC=pc,JC=yt,ZC=wy,QC=vc,eI=Sy,tI=Object.prototype,rI=tI.hasOwnProperty;function nI(t,e){var r=JC(t),n=!r&&XC(t),i=!r&&!n&&ZC(t),a=!r&&!n&&!i&&eI(t),o=r||n||i||a,s=o?YC(t.length,String):[],u=s.length;for(var l in t)(e||rI.call(t,l))&&!(o&&(l=="length"||i&&(l=="offset"||l=="parent")||a&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||QC(l,u)))&&s.push(l);return s}var iI=nI,aI=Object.prototype;function oI(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||aI;return t===r}var sI=oI;function uI(t,e){return function(r){return t(e(r))}}var Ay=uI,lI=Ay,cI=lI(Object.keys,Object),fI=cI,dI=sI,hI=fI,pI=Object.prototype,vI=pI.hasOwnProperty;function yI(t){if(!dI(t))return hI(t);var e=[];for(var r in Object(t))vI.call(t,r)&&r!="constructor"&&e.push(r);return e}var gI=yI,mI=kl,bI=yc;function wI(t){return t!=null&&bI(t.length)&&!mI(t)}var va=wI,_I=iI,xI=gI,OI=va;function SI(t){return OI(t)?_I(t):xI(t)}var fs=SI,AI=Uk,PI=Xk,EI=fs;function TI(t){return AI(t,EI,PI)}var jI=TI,Py=jI,$I=1,kI=Object.prototype,CI=kI.hasOwnProperty;function II(t,e,r,n,i,a){var o=r&$I,s=Py(t),u=s.length,l=Py(e),c=l.length;if(u!=c&&!o)return!1;for(var f=u;f--;){var d=s[f];if(!(o?d in e:CI.call(e,d)))return!1}var h=a.get(t),y=a.get(e);if(h&&y)return h==e&&y==t;var v=!0;a.set(t,e),a.set(e,t);for(var p=o;++f<u;){d=s[f];var m=t[d],b=e[d];if(n)var w=o?n(b,m,d,e,t,a):n(m,b,d,t,e,a);if(!(w===void 0?m===b||i(m,b,r,n,a):w)){v=!1;break}p||(p=d=="constructor")}if(v&&!p){var O=t.constructor,g=e.constructor;O!=g&&"constructor"in t&&"constructor"in e&&!(typeof O=="function"&&O instanceof O&&typeof g=="function"&&g instanceof g)&&(v=!1)}return a.delete(t),a.delete(e),v}var NI=II,MI=tn,DI=Qt,RI=MI(DI,"DataView"),LI=RI,BI=tn,UI=Qt,FI=BI(UI,"Promise"),WI=FI,qI=tn,zI=Qt,KI=qI(zI,"Set"),Ey=KI,VI=tn,HI=Qt,GI=VI(HI,"WeakMap"),YI=GI,gc=LI,mc=Nl,bc=WI,wc=Ey,_c=YI,Ty=lr,ti=ov,jy="[object Map]",XI="[object Object]",$y="[object Promise]",ky="[object Set]",Cy="[object WeakMap]",Iy="[object DataView]",JI=ti(gc),ZI=ti(mc),QI=ti(bc),eN=ti(wc),tN=ti(_c),un=Ty;(gc&&un(new gc(new ArrayBuffer(1)))!=Iy||mc&&un(new mc)!=jy||bc&&un(bc.resolve())!=$y||wc&&un(new wc)!=ky||_c&&un(new _c)!=Cy)&&(un=function(t){var e=Ty(t),r=e==XI?t.constructor:void 0,n=r?ti(r):"";if(n)switch(n){case JI:return Iy;case ZI:return jy;case QI:return $y;case eN:return ky;case tN:return Cy}return e});var rN=un,xc=uy,nN=dy,iN=Mk,aN=NI,Ny=rN,My=yt,Dy=wy,oN=Sy,sN=1,Ry="[object Arguments]",Ly="[object Array]",ds="[object Object]",uN=Object.prototype,By=uN.hasOwnProperty;function lN(t,e,r,n,i,a){var o=My(t),s=My(e),u=o?Ly:Ny(t),l=s?Ly:Ny(e);u=u==Ry?ds:u,l=l==Ry?ds:l;var c=u==ds,f=l==ds,d=u==l;if(d&&Dy(t)){if(!Dy(e))return!1;o=!0,c=!1}if(d&&!c)return a||(a=new xc),o||oN(t)?nN(t,e,r,n,i,a):iN(t,e,u,r,n,i,a);if(!(r&sN)){var h=c&&By.call(t,"__wrapped__"),y=f&&By.call(e,"__wrapped__");if(h||y){var v=h?t.value():t,p=y?e.value():e;return a||(a=new xc),i(v,p,r,n,a)}}return d?(a||(a=new xc),aN(t,e,r,n,i,a)):!1}var cN=lN,fN=cN,Uy=cr;function Fy(t,e,r,n,i){return t===e?!0:t==null||e==null||!Uy(t)&&!Uy(e)?t!==t&&e!==e:fN(t,e,r,n,Fy,i)}var Oc=Fy,dN=uy,hN=Oc,pN=1,vN=2;function yN(t,e,r,n){var i=r.length,a=i,o=!n;if(t==null)return!a;for(t=Object(t);i--;){var s=r[i];if(o&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<a;){s=r[i];var u=s[0],l=t[u],c=s[1];if(o&&s[2]){if(l===void 0&&!(u in t))return!1}else{var f=new dN;if(n)var d=n(l,c,u,t,e,f);if(!(d===void 0?hN(c,l,pN|vN,n,f):d))return!1}}return!0}var gN=yN,mN=kr;function bN(t){return t===t&&!mN(t)}var Wy=bN,wN=Wy,_N=fs;function xN(t){for(var e=_N(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,wN(i)]}return e}var ON=xN;function SN(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}var qy=SN,AN=gN,PN=ON,EN=qy;function TN(t){var e=PN(t);return e.length==1&&e[0][2]?EN(e[0][0],e[0][1]):function(r){return r===t||AN(r,t,e)}}var jN=TN;function $N(t,e){return t!=null&&e in Object(t)}var kN=$N,CN=yv,IN=pc,NN=yt,MN=vc,DN=yc,RN=Go;function LN(t,e,r){e=CN(e,t);for(var n=-1,i=e.length,a=!1;++n<i;){var o=RN(e[n]);if(!(a=t!=null&&r(t,o)))break;t=t[o]}return a||++n!=i?a:(i=t==null?0:t.length,!!i&&DN(i)&&MN(o,i)&&(NN(t)||IN(t)))}var BN=LN,UN=kN,FN=BN;function WN(t,e){return t!=null&&FN(t,e,UN)}var qN=WN,zN=Oc,KN=gv,VN=qN,HN=$l,GN=Wy,YN=qy,XN=Go,JN=1,ZN=2;function QN(t,e){return HN(t)&&GN(e)?YN(XN(t),e):function(r){var n=KN(r,t);return n===void 0&&n===e?VN(r,t):zN(e,n,JN|ZN)}}var eM=QN;function tM(t){return t}var ri=tM;function rM(t){return function(e){return e==null?void 0:e[t]}}var nM=rM,iM=Ll;function aM(t){return function(e){return iM(e,t)}}var oM=aM,sM=nM,uM=oM,lM=$l,cM=Go;function fM(t){return lM(t)?sM(cM(t)):uM(t)}var dM=fM,hM=jN,pM=eM,vM=ri,yM=yt,gM=dM;function mM(t){return typeof t=="function"?t:t==null?vM:typeof t=="object"?yM(t)?pM(t[0],t[1]):hM(t):gM(t)}var er=mM;function bM(t,e,r,n){for(var i=t.length,a=r+(n?1:-1);n?a--:++a<i;)if(e(t[a],a,t))return a;return-1}var zy=bM;function wM(t){return t!==t}var _M=wM;function xM(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}var OM=xM,SM=zy,AM=_M,PM=OM;function EM(t,e,r){return e===e?PM(t,e,r):SM(t,AM,r)}var TM=EM,jM=TM;function $M(t,e){var r=t==null?0:t.length;return!!r&&jM(t,e,0)>-1}var kM=$M;function CM(t,e,r){for(var n=-1,i=t==null?0:t.length;++n<i;)if(r(e,t[n]))return!0;return!1}var IM=CM;function NM(){}var MM=NM,Sc=Ey,DM=MM,RM=dc,LM=1/0,BM=Sc&&1/RM(new Sc([,-0]))[1]==LM?function(t){return new Sc(t)}:DM,UM=BM,FM=ly,WM=kM,qM=IM,zM=fy,KM=UM,VM=dc,HM=200;function GM(t,e,r){var n=-1,i=WM,a=t.length,o=!0,s=[],u=s;if(r)o=!1,i=qM;else if(a>=HM){var l=e?null:KM(t);if(l)return VM(l);o=!1,i=zM,u=new FM}else u=e?[]:s;e:for(;++n<a;){var c=t[n],f=e?e(c):c;if(c=r||c!==0?c:0,o&&f===f){for(var d=u.length;d--;)if(u[d]===f)continue e;e&&u.push(f),s.push(c)}else i(u,f,r)||(u!==s&&u.push(f),s.push(c))}return s}var YM=GM,XM=er,JM=YM;function ZM(t,e){return t&&t.length?JM(t,XM(e)):[]}var QM=ZM;const Ky=je(QM);function Vy(t,e,r){return e===!0?Ky(t,r):ae(e)?Ky(t,e):t}function ni(t){"@babel/helpers - typeof";return ni=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},ni(t)}var eD=["ref"];function Hy(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 dr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Hy(Object(r),!0).forEach(function(n){ps(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Hy(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function tD(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Gy(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,Xy(n.key),n)}}function rD(t,e,r){return e&&Gy(t.prototype,e),r&&Gy(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function nD(t,e,r){return e=hs(e),iD(t,Yy()?Reflect.construct(e,r||[],hs(t).constructor):e.apply(t,r))}function iD(t,e){if(e&&(ni(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return aD(t)}function aD(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Yy(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Yy=function(){return!!t})()}function hs(t){return hs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},hs(t)}function oD(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&&Ac(t,e)}function Ac(t,e){return Ac=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Ac(t,e)}function ps(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=sD(t,"string");return ni(e)=="symbol"?e:e+""}function sD(t,e){if(ni(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ni(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function uD(t,e){if(t==null)return{};var r=lD(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 lD(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 cD(t){return t.value}function fD(t,e){if(x.isValidElement(t))return x.cloneElement(t,e);if(typeof t=="function")return x.createElement(t,e);e.ref;var r=uD(e,eD);return x.createElement(fc,r)}var Jy=1,ln=function(t){function e(){var r;tD(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=nD(this,e,[].concat(i)),ps(r,"lastBoundingBox",{width:-1,height:-1}),r}return oD(e,t),rD(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)>Jy||Math.abs(i.height-this.lastBoundingBox.height)>Jy)&&(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?dr({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,o=i.align,s=i.verticalAlign,u=i.margin,l=i.chartWidth,c=i.chartHeight,f,d;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&a==="vertical"){var h=this.getBBoxSnapshot();f={left:((l||0)-h.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(s==="middle"){var y=this.getBBoxSnapshot();d={top:((c||0)-y.height)/2}}else d=s==="bottom"?{bottom:u&&u.bottom||0}:{top:u&&u.top||0};return dr(dr({},f),d)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,o=i.width,s=i.height,u=i.wrapperStyle,l=i.payloadUniqBy,c=i.payload,f=dr(dr({position:"absolute",width:o||"auto",height:s||"auto"},this.getDefaultPosition(u)),u);return x.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(h){n.wrapperNode=h}},fD(a,dr(dr({},this.props),{},{payload:Vy(c,l,cD)})))}}],[{key:"getWithHeight",value:function(n,i){var a=dr(dr({},this.defaultProps),n.props),o=a.layout;return o==="vertical"&&V(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])}(x.PureComponent);ps(ln,"displayName","Legend"),ps(ln,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Zy=fa,dD=pc,hD=yt,Qy=Zy?Zy.isConcatSpreadable:void 0;function pD(t){return hD(t)||dD(t)||!!(Qy&&t&&t[Qy])}var vD=pD,yD=yy,gD=vD;function eg(t,e,r,n,i){var a=-1,o=t.length;for(r||(r=gD),i||(i=[]);++a<o;){var s=t[a];e>0&&r(s)?e>1?eg(s,e-1,r,n,i):yD(i,s):n||(i[i.length]=s)}return i}var tg=eg;function mD(t){return function(e,r,n){for(var i=-1,a=Object(e),o=n(e),s=o.length;s--;){var u=o[t?s:++i];if(r(a[u],u,a)===!1)break}return e}}var bD=mD,wD=bD,_D=wD(),xD=_D,OD=xD,SD=fs;function AD(t,e){return t&&OD(t,e,SD)}var rg=AD,PD=va;function ED(t,e){return function(r,n){if(r==null)return r;if(!PD(r))return t(r,n);for(var i=r.length,a=e?i:-1,o=Object(r);(e?a--:++a<i)&&n(o[a],a,o)!==!1;);return r}}var TD=ED,jD=rg,$D=TD,kD=$D(jD),Pc=kD,CD=Pc,ID=va;function ND(t,e){var r=-1,n=ID(t)?Array(t.length):[];return CD(t,function(i,a,o){n[++r]=e(i,a,o)}),n}var ng=ND;function MD(t,e){var r=t.length;for(t.sort(e);r--;)t[r]=t[r].value;return t}var DD=MD,ig=Kn;function RD(t,e){if(t!==e){var r=t!==void 0,n=t===null,i=t===t,a=ig(t),o=e!==void 0,s=e===null,u=e===e,l=ig(e);if(!s&&!l&&!a&&t>e||a&&o&&u&&!s&&!l||n&&o&&u||!r&&u||!i)return 1;if(!n&&!a&&!l&&t<e||l&&r&&i&&!n&&!a||s&&r&&i||!o&&i||!u)return-1}return 0}var LD=RD,BD=LD;function UD(t,e,r){for(var n=-1,i=t.criteria,a=e.criteria,o=i.length,s=r.length;++n<o;){var u=BD(i[n],a[n]);if(u){if(n>=s)return u;var l=r[n];return u*(l=="desc"?-1:1)}}return t.index-e.index}var FD=UD,Ec=Rl,WD=Ll,qD=er,zD=ng,KD=DD,VD=_y,HD=FD,GD=ri,YD=yt;function XD(t,e,r){e.length?e=Ec(e,function(a){return YD(a)?function(o){return WD(o,a.length===1?a[0]:a)}:a}):e=[GD];var n=-1;e=Ec(e,VD(qD));var i=zD(t,function(a,o,s){var u=Ec(e,function(l){return l(a)});return{criteria:u,index:++n,value:a}});return KD(i,function(a,o){return HD(a,o,r)})}var JD=XD;function ZD(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var QD=ZD,eR=QD,ag=Math.max;function tR(t,e,r){return e=ag(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,a=ag(n.length-e,0),o=Array(a);++i<a;)o[i]=n[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=n[i];return s[e]=r(o),eR(t,this,s)}}var rR=tR;function nR(t){return function(){return t}}var iR=nR,aR=tn,oR=function(){try{var t=aR(Object,"defineProperty");return t({},"",{}),t}catch{}}(),og=oR,sR=iR,sg=og,uR=ri,lR=sg?function(t,e){return sg(t,"toString",{configurable:!0,enumerable:!1,value:sR(e),writable:!0})}:uR,cR=lR,fR=800,dR=16,hR=Date.now;function pR(t){var e=0,r=0;return function(){var n=hR(),i=dR-(n-r);if(r=n,i>0){if(++e>=fR)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var vR=pR,yR=cR,gR=vR,mR=gR(yR),bR=mR,wR=ri,_R=rR,xR=bR;function OR(t,e){return xR(_R(t,e,wR),t+"")}var SR=OR,AR=Il,PR=va,ER=vc,TR=kr;function jR(t,e,r){if(!TR(r))return!1;var n=typeof e;return(n=="number"?PR(r)&&ER(e,r.length):n=="string"&&e in r)?AR(r[e],t):!1}var vs=jR,$R=tg,kR=JD,CR=SR,ug=vs,IR=CR(function(t,e){if(t==null)return[];var r=e.length;return r>1&&ug(t,e[0],e[1])?e=[]:r>2&&ug(e[0],e[1],e[2])&&(e=[e[0]]),kR(t,$R(e,1),[])}),NR=IR;const Tc=je(NR);function ya(t){"@babel/helpers - typeof";return ya=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},ya(t)}function jc(){return jc=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},jc.apply(this,arguments)}function MR(t,e){return BR(t)||LR(t,e)||RR(t,e)||DR()}function DR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
89
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RR(t,e){if(t){if(typeof t=="string")return lg(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 lg(t,e)}}function lg(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 LR(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,s=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(c){l=!0,i=c}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function BR(t){if(Array.isArray(t))return t}function cg(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 $c(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?cg(Object(r),!0).forEach(function(n){UR(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):cg(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function UR(t,e,r){return e=FR(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function FR(t){var e=WR(t,"string");return ya(e)=="symbol"?e:e+""}function WR(t,e){if(ya(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ya(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function qR(t){return Array.isArray(t)&&Je(t[0])&&Je(t[1])?t.join(" ~ "):t}var zR=function(e){var r=e.separator,n=r===void 0?" : ":r,i=e.contentStyle,a=i===void 0?{}:i,o=e.itemStyle,s=o===void 0?{}:o,u=e.labelStyle,l=u===void 0?{}:u,c=e.payload,f=e.formatter,d=e.itemSorter,h=e.wrapperClassName,y=e.labelClassName,v=e.label,p=e.labelFormatter,m=e.accessibilityLayer,b=m===void 0?!1:m,w=function(){if(c&&c.length){var $={padding:0,margin:0},k=(d?Tc(c,d):c).map(function(I,R){if(I.type==="none")return null;var M=$c({display:"block",paddingTop:4,paddingBottom:4,color:I.color||"#000"},s),L=I.formatter||f||qR,q=I.value,z=I.name,D=q,B=z;if(L&&D!=null&&B!=null){var F=L(q,z,I,R,c);if(Array.isArray(F)){var G=MR(F,2);D=G[0],B=G[1]}else D=F}return x.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(R),style:M},Je(B)?x.createElement("span",{className:"recharts-tooltip-item-name"},B):null,Je(B)?x.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,x.createElement("span",{className:"recharts-tooltip-item-value"},D),x.createElement("span",{className:"recharts-tooltip-item-unit"},I.unit||""))});return x.createElement("ul",{className:"recharts-tooltip-item-list",style:$},k)}return null},O=$c({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},a),g=$c({margin:0},l),_=!fe(v),S=_?v:"",A=le("recharts-default-tooltip",h),E=le("recharts-tooltip-label",y);_&&p&&c!==void 0&&c!==null&&(S=p(v,c));var N=b?{role:"status","aria-live":"assertive"}:{};return x.createElement("div",jc({className:A,style:O},N),x.createElement("p",{className:E,style:g},x.isValidElement(S)?S:"".concat(S)),w())};function ga(t){"@babel/helpers - typeof";return ga=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},ga(t)}function ys(t,e,r){return e=KR(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function KR(t){var e=VR(t,"string");return ga(e)=="symbol"?e:e+""}function VR(t,e){if(ga(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ga(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ma="recharts-tooltip-wrapper",HR={visibility:"hidden"};function GR(t){var e=t.coordinate,r=t.translateX,n=t.translateY;return le(ma,ys(ys(ys(ys({},"".concat(ma,"-right"),V(r)&&e&&V(e.x)&&r>=e.x),"".concat(ma,"-left"),V(r)&&e&&V(e.x)&&r<e.x),"".concat(ma,"-bottom"),V(n)&&e&&V(e.y)&&n>=e.y),"".concat(ma,"-top"),V(n)&&e&&V(e.y)&&n<e.y))}function fg(t){var e=t.allowEscapeViewBox,r=t.coordinate,n=t.key,i=t.offsetTopLeft,a=t.position,o=t.reverseDirection,s=t.tooltipDimension,u=t.viewBox,l=t.viewBoxDimension;if(a&&V(a[n]))return a[n];var c=r[n]-s-i,f=r[n]+i;if(e[n])return o[n]?c:f;if(o[n]){var d=c,h=u[n];return d<h?Math.max(f,u[n]):Math.max(c,u[n])}var y=f+s,v=u[n]+l;return y>v?Math.max(c,u[n]):Math.max(f,u[n])}function YR(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 XR(t){var e=t.allowEscapeViewBox,r=t.coordinate,n=t.offsetTopLeft,i=t.position,a=t.reverseDirection,o=t.tooltipBox,s=t.useTranslate3d,u=t.viewBox,l,c,f;return o.height>0&&o.width>0&&r?(c=fg({allowEscapeViewBox:e,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:u,viewBoxDimension:u.width}),f=fg({allowEscapeViewBox:e,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:u,viewBoxDimension:u.height}),l=YR({translateX:c,translateY:f,useTranslate3d:s})):l=HR,{cssProperties:l,cssClasses:GR({translateX:c,translateY:f,coordinate:r})}}function ii(t){"@babel/helpers - typeof";return ii=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},ii(t)}function dg(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 hg(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?dg(Object(r),!0).forEach(function(n){Cc(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):dg(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function JR(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ZR(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,vg(n.key),n)}}function QR(t,e,r){return e&&ZR(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function eL(t,e,r){return e=gs(e),tL(t,pg()?Reflect.construct(e,r||[],gs(t).constructor):e.apply(t,r))}function tL(t,e){if(e&&(ii(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return rL(t)}function rL(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function pg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(pg=function(){return!!t})()}function gs(t){return gs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},gs(t)}function nL(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&&kc(t,e)}function kc(t,e){return kc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},kc(t,e)}function Cc(t,e,r){return e=vg(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vg(t){var e=iL(t,"string");return ii(e)=="symbol"?e:e+""}function iL(t,e){if(ii(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ii(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var yg=1,aL=function(t){function e(){var r;JR(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=eL(this,e,[].concat(i)),Cc(r,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),Cc(r,"handleKeyDown",function(o){if(o.key==="Escape"){var s,u,l,c;r.setState({dismissed:!0,dismissedAtCoordinate:{x:(s=(u=r.props.coordinate)===null||u===void 0?void 0:u.x)!==null&&s!==void 0?s:0,y:(l=(c=r.props.coordinate)===null||c===void 0?void 0:c.y)!==null&&l!==void 0?l:0}})}}),r}return nL(e,t),QR(e,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();(Math.abs(n.width-this.state.lastBoundingBox.width)>yg||Math.abs(n.height-this.state.lastBoundingBox.height)>yg)&&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,s=i.animationDuration,u=i.animationEasing,l=i.children,c=i.coordinate,f=i.hasPayload,d=i.isAnimationActive,h=i.offset,y=i.position,v=i.reverseDirection,p=i.useTranslate3d,m=i.viewBox,b=i.wrapperStyle,w=XR({allowEscapeViewBox:o,coordinate:c,offsetTopLeft:h,position:y,reverseDirection:v,tooltipBox:this.state.lastBoundingBox,useTranslate3d:p,viewBox:m}),O=w.cssClasses,g=w.cssProperties,_=hg(hg({transition:d&&a?"transform ".concat(s,"ms ").concat(u):void 0},g),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&f?"visible":"hidden",position:"absolute",top:0,left:0},b);return x.createElement("div",{tabIndex:-1,className:O,style:_,ref:function(A){n.wrapperNode=A}},l)}}])}(x.PureComponent),oL=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},It={isSsr:oL(),get:function(e){return It[e]},set:function(e,r){if(typeof e=="string")It[e]=r;else{var n=Object.keys(e);n&&n.length&&n.forEach(function(i){It[i]=e[i]})}}};function ai(t){"@babel/helpers - typeof";return ai=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},ai(t)}function gg(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 mg(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?gg(Object(r),!0).forEach(function(n){Nc(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):gg(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function sL(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function uL(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,wg(n.key),n)}}function lL(t,e,r){return e&&uL(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function cL(t,e,r){return e=ms(e),fL(t,bg()?Reflect.construct(e,r||[],ms(t).constructor):e.apply(t,r))}function fL(t,e){if(e&&(ai(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dL(t)}function dL(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function bg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(bg=function(){return!!t})()}function ms(t){return ms=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ms(t)}function hL(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&&Ic(t,e)}function Ic(t,e){return Ic=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Ic(t,e)}function Nc(t,e,r){return e=wg(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function wg(t){var e=pL(t,"string");return ai(e)=="symbol"?e:e+""}function pL(t,e){if(ai(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ai(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function vL(t){return t.dataKey}function yL(t,e){return x.isValidElement(t)?x.cloneElement(t,e):typeof t=="function"?x.createElement(t,e):x.createElement(zR,e)}var tr=function(t){function e(){return sL(this,e),cL(this,e,arguments)}return hL(e,t),lL(e,[{key:"render",value:function(){var n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,s=i.animationDuration,u=i.animationEasing,l=i.content,c=i.coordinate,f=i.filterNull,d=i.isAnimationActive,h=i.offset,y=i.payload,v=i.payloadUniqBy,p=i.position,m=i.reverseDirection,b=i.useTranslate3d,w=i.viewBox,O=i.wrapperStyle,g=y??[];f&&g.length&&(g=Vy(y.filter(function(S){return S.value!=null&&(S.hide!==!0||n.props.includeHidden)}),v,vL));var _=g.length>0;return x.createElement(aL,{allowEscapeViewBox:o,animationDuration:s,animationEasing:u,isAnimationActive:d,active:a,coordinate:c,hasPayload:_,offset:h,position:p,reverseDirection:m,useTranslate3d:b,viewBox:w,wrapperStyle:O},yL(l,mg(mg({},this.props),{},{payload:g})))}}])}(x.PureComponent);Nc(tr,"displayName","Tooltip"),Nc(tr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!It.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 gL=Qt,mL=function(){return gL.Date.now()},bL=mL,wL=/\s/;function _L(t){for(var e=t.length;e--&&wL.test(t.charAt(e)););return e}var xL=_L,OL=xL,SL=/^\s+/;function AL(t){return t&&t.slice(0,OL(t)+1).replace(SL,"")}var PL=AL,EL=PL,_g=kr,TL=Kn,xg=NaN,jL=/^[-+]0x[0-9a-f]+$/i,$L=/^0b[01]+$/i,kL=/^0o[0-7]+$/i,CL=parseInt;function IL(t){if(typeof t=="number")return t;if(TL(t))return xg;if(_g(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=_g(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=EL(t);var r=$L.test(t);return r||kL.test(t)?CL(t.slice(2),r?2:8):jL.test(t)?xg:+t}var Og=IL,NL=kr,Mc=bL,Sg=Og,ML="Expected a function",DL=Math.max,RL=Math.min;function LL(t,e,r){var n,i,a,o,s,u,l=0,c=!1,f=!1,d=!0;if(typeof t!="function")throw new TypeError(ML);e=Sg(e)||0,NL(r)&&(c=!!r.leading,f="maxWait"in r,a=f?DL(Sg(r.maxWait)||0,e):a,d="trailing"in r?!!r.trailing:d);function h(_){var S=n,A=i;return n=i=void 0,l=_,o=t.apply(A,S),o}function y(_){return l=_,s=setTimeout(m,e),c?h(_):o}function v(_){var S=_-u,A=_-l,E=e-S;return f?RL(E,a-A):E}function p(_){var S=_-u,A=_-l;return u===void 0||S>=e||S<0||f&&A>=a}function m(){var _=Mc();if(p(_))return b(_);s=setTimeout(m,v(_))}function b(_){return s=void 0,d&&n?h(_):(n=i=void 0,o)}function w(){s!==void 0&&clearTimeout(s),l=0,n=u=i=s=void 0}function O(){return s===void 0?o:b(Mc())}function g(){var _=Mc(),S=p(_);if(n=arguments,i=this,u=_,S){if(s===void 0)return y(u);if(f)return clearTimeout(s),s=setTimeout(m,e),h(u)}return s===void 0&&(s=setTimeout(m,e)),o}return g.cancel=w,g.flush=O,g}var BL=LL,UL=BL,FL=kr,WL="Expected a function";function qL(t,e,r){var n=!0,i=!0;if(typeof t!="function")throw new TypeError(WL);return FL(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),UL(t,e,{leading:n,maxWait:e,trailing:i})}var zL=qL;const Ag=je(zL);function ba(t){"@babel/helpers - typeof";return ba=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},ba(t)}function Pg(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 bs(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Pg(Object(r),!0).forEach(function(n){KL(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Pg(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function KL(t,e,r){return e=VL(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function VL(t){var e=HL(t,"string");return ba(e)=="symbol"?e:e+""}function HL(t,e){if(ba(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ba(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function GL(t,e){return ZL(t)||JL(t,e)||XL(t,e)||YL()}function YL(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
90
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
91
|
-
maybe you don't need to use a ResponsiveContainer.`,o,
|
|
58
|
+
H`).concat(bt,"M").concat(2*s,",").concat(a,`
|
|
59
|
+
A`).concat(o,",").concat(o,",0,1,1,").concat(s,",").concat(a),className:"recharts-legend-icon"});if(n.type==="rect")return x.createElement("path",{stroke:"none",fill:l,d:"M0,".concat(bt/8,"h").concat(bt,"v").concat(bt*3/4,"h").concat(-bt,"z"),className:"recharts-legend-icon"});if(x.isValidElement(n.legendIcon)){var u=D$({},n);return delete u.legendIcon,x.cloneElement(n.legendIcon,u)}return x.createElement(Bu,{fill:l,cx:a,cy:a,size:bt,sizeType:"diameter",type:n.type})}},{key:"renderItems",value:function(){var n=this,i=this.props,a=i.payload,o=i.iconSize,s=i.layout,l=i.formatter,u=i.inactiveColor,c={x:0,y:0,width:bt,height:bt},f={display:s==="horizontal"?"inline-block":"block",marginRight:10},d={display:"inline-block",verticalAlign:"middle",marginRight:4};return a.map(function(h,y){var v=h.formatter||l,p=ie(Hi(Hi({"recharts-legend-item":!0},"legend-item-".concat(y),!0),"inactive",h.inactive));if(h.type==="none")return null;var m=te(h.value)?null:h.value;jt(!te(h.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 w=h.inactive?u:h.color;return x.createElement("li",Ru({className:p,style:f,key:"legend-item-".concat(y)},qr(n.props,h,y)),x.createElement(Su,{width:o,height:o,viewBox:c,style:d},n.renderIcon(h)),x.createElement("span",{className:"recharts-legend-item-text",style:{color:w}},v?v(m,h,y):m))})}},{key:"render",value:function(){var n=this.props,i=n.payload,a=n.layout,o=n.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return x.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(x.PureComponent);Hi(Fu,"displayName","Legend"),Hi(Fu,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var K$=xo;function V$(){this.__data__=new K$,this.size=0}var H$=V$;function G$(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var Y$=G$;function X$(t){return this.__data__.get(t)}var J$=X$;function Z$(t){return this.__data__.has(t)}var Q$=Z$,ej=xo,tj=cu,rj=fu,nj=200;function ij(t,e){var r=this.__data__;if(r instanceof ej){var n=r.__data__;if(!tj||n.length<nj-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new rj(n)}return r.set(t,e),this.size=r.size,this}var aj=ij,oj=xo,sj=H$,lj=Y$,uj=J$,cj=Q$,fj=aj;function Bn(t){var e=this.__data__=new oj(t);this.size=e.size}Bn.prototype.clear=sj,Bn.prototype.delete=lj,Bn.prototype.get=uj,Bn.prototype.has=cj,Bn.prototype.set=fj;var Nv=Bn,dj="__lodash_hash_undefined__";function hj(t){return this.__data__.set(t,dj),this}var pj=hj;function vj(t){return this.__data__.has(t)}var yj=vj,gj=fu,mj=pj,bj=yj;function Bo(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new gj;++e<r;)this.add(t[e])}Bo.prototype.add=Bo.prototype.push=mj,Bo.prototype.has=bj;var Mv=Bo;function wj(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}var Dv=wj;function _j(t,e){return t.has(e)}var Lv=_j,xj=Mv,Oj=Dv,Sj=Lv,Aj=1,Pj=2;function Ej(t,e,r,n,i,a){var o=r&Aj,s=t.length,l=e.length;if(s!=l&&!(o&&l>s))return!1;var u=a.get(t),c=a.get(e);if(u&&c)return u==e&&c==t;var f=-1,d=!0,h=r&Pj?new xj:void 0;for(a.set(t,e),a.set(e,t);++f<s;){var y=t[f],v=e[f];if(n)var p=o?n(v,y,f,e,t,a):n(y,v,f,t,e,a);if(p!==void 0){if(p)continue;d=!1;break}if(h){if(!Oj(e,function(m,w){if(!Sj(h,w)&&(y===m||i(y,m,r,n,a)))return h.push(w)})){d=!1;break}}else if(!(y===v||i(y,v,r,n,a))){d=!1;break}}return a.delete(t),a.delete(e),d}var Bv=Ej,Tj=Lt,$j=Tj.Uint8Array,jj=$j;function kj(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}var Cj=kj;function Ij(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var Wu=Ij,Rv=zi,Uv=jj,Nj=uu,Mj=Bv,Dj=Cj,Lj=Wu,Bj=1,Rj=2,Uj="[object Boolean]",Fj="[object Date]",Wj="[object Error]",qj="[object Map]",zj="[object Number]",Kj="[object RegExp]",Vj="[object Set]",Hj="[object String]",Gj="[object Symbol]",Yj="[object ArrayBuffer]",Xj="[object DataView]",Fv=Rv?Rv.prototype:void 0,qu=Fv?Fv.valueOf:void 0;function Jj(t,e,r,n,i,a,o){switch(r){case Xj:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Yj:return!(t.byteLength!=e.byteLength||!a(new Uv(t),new Uv(e)));case Uj:case Fj:case zj:return Nj(+t,+e);case Wj:return t.name==e.name&&t.message==e.message;case Kj:case Hj:return t==e+"";case qj:var s=Dj;case Vj:var l=n&Bj;if(s||(s=Lj),t.size!=e.size&&!l)return!1;var u=o.get(t);if(u)return u==e;n|=Rj,o.set(t,e);var c=Mj(s(t),s(e),n,i,a,o);return o.delete(t),c;case Gj:if(qu)return qu.call(t)==qu.call(e)}return!1}var Zj=Jj;function Qj(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var Wv=Qj,ek=Wv,tk=at;function rk(t,e,r){var n=e(t);return tk(t)?n:ek(n,r(t))}var nk=rk;function ik(t,e){for(var r=-1,n=t==null?0:t.length,i=0,a=[];++r<n;){var o=t[r];e(o,r,t)&&(a[i++]=o)}return a}var ak=ik;function ok(){return[]}var sk=ok,lk=ak,uk=sk,ck=Object.prototype,fk=ck.propertyIsEnumerable,qv=Object.getOwnPropertySymbols,dk=qv?function(t){return t==null?[]:(t=Object(t),lk(qv(t),function(e){return fk.call(t,e)}))}:uk,hk=dk;function pk(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var vk=pk,yk=Ht,gk=Gt,mk="[object Arguments]";function bk(t){return gk(t)&&yk(t)==mk}var wk=bk,zv=wk,_k=Gt,Kv=Object.prototype,xk=Kv.hasOwnProperty,Ok=Kv.propertyIsEnumerable,Sk=zv(function(){return arguments}())?zv:function(t){return _k(t)&&xk.call(t,"callee")&&!Ok.call(t,"callee")},zu=Sk,Ro={exports:{}};function Ak(){return!1}var Pk=Ak;Ro.exports,function(t,e){var r=Lt,n=Pk,i=e&&!e.nodeType&&e,a=i&&!0&&t&&!t.nodeType&&t,o=a&&a.exports===i,s=o?r.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||n;t.exports=u}(Ro,Ro.exports);var Vv=Ro.exports,Ek=9007199254740991,Tk=/^(?:0|[1-9]\d*)$/;function $k(t,e){var r=typeof t;return e=e??Ek,!!e&&(r=="number"||r!="symbol"&&Tk.test(t))&&t>-1&&t%1==0&&t<e}var Ku=$k,jk=9007199254740991;function kk(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=jk}var Vu=kk,Ck=Ht,Ik=Vu,Nk=Gt,Mk="[object Arguments]",Dk="[object Array]",Lk="[object Boolean]",Bk="[object Date]",Rk="[object Error]",Uk="[object Function]",Fk="[object Map]",Wk="[object Number]",qk="[object Object]",zk="[object RegExp]",Kk="[object Set]",Vk="[object String]",Hk="[object WeakMap]",Gk="[object ArrayBuffer]",Yk="[object DataView]",Xk="[object Float32Array]",Jk="[object Float64Array]",Zk="[object Int8Array]",Qk="[object Int16Array]",eC="[object Int32Array]",tC="[object Uint8Array]",rC="[object Uint8ClampedArray]",nC="[object Uint16Array]",iC="[object Uint32Array]",Te={};Te[Xk]=Te[Jk]=Te[Zk]=Te[Qk]=Te[eC]=Te[tC]=Te[rC]=Te[nC]=Te[iC]=!0,Te[Mk]=Te[Dk]=Te[Gk]=Te[Lk]=Te[Yk]=Te[Bk]=Te[Rk]=Te[Uk]=Te[Fk]=Te[Wk]=Te[qk]=Te[zk]=Te[Kk]=Te[Vk]=Te[Hk]=!1;function aC(t){return Nk(t)&&Ik(t.length)&&!!Te[Ck(t)]}var oC=aC;function sC(t){return function(e){return t(e)}}var Hv=sC,Uo={exports:{}};Uo.exports,function(t,e){var r=Pp,n=e&&!e.nodeType&&e,i=n&&!0&&t&&!t.nodeType&&t,a=i&&i.exports===n,o=a&&r.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();t.exports=s}(Uo,Uo.exports);var lC=Uo.exports,uC=oC,cC=Hv,Gv=lC,Yv=Gv&&Gv.isTypedArray,fC=Yv?cC(Yv):uC,Xv=fC,dC=vk,hC=zu,pC=at,vC=Vv,yC=Ku,gC=Xv,mC=Object.prototype,bC=mC.hasOwnProperty;function wC(t,e){var r=pC(t),n=!r&&hC(t),i=!r&&!n&&vC(t),a=!r&&!n&&!i&&gC(t),o=r||n||i||a,s=o?dC(t.length,String):[],l=s.length;for(var u in t)(e||bC.call(t,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||yC(u,l)))&&s.push(u);return s}var _C=wC,xC=Object.prototype;function OC(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||xC;return t===r}var SC=OC;function AC(t,e){return function(r){return t(e(r))}}var Jv=AC,PC=Jv,EC=PC(Object.keys,Object),TC=EC,$C=SC,jC=TC,kC=Object.prototype,CC=kC.hasOwnProperty;function IC(t){if(!$C(t))return jC(t);var e=[];for(var r in Object(t))CC.call(t,r)&&r!="constructor"&&e.push(r);return e}var NC=IC,MC=su,DC=Vu;function LC(t){return t!=null&&DC(t.length)&&!MC(t)}var Gi=LC,BC=_C,RC=NC,UC=Gi;function FC(t){return UC(t)?BC(t):RC(t)}var Fo=FC,WC=nk,qC=hk,zC=Fo;function KC(t){return WC(t,zC,qC)}var VC=KC,Zv=VC,HC=1,GC=Object.prototype,YC=GC.hasOwnProperty;function XC(t,e,r,n,i,a){var o=r&HC,s=Zv(t),l=s.length,u=Zv(e),c=u.length;if(l!=c&&!o)return!1;for(var f=l;f--;){var d=s[f];if(!(o?d in e:YC.call(e,d)))return!1}var h=a.get(t),y=a.get(e);if(h&&y)return h==e&&y==t;var v=!0;a.set(t,e),a.set(e,t);for(var p=o;++f<l;){d=s[f];var m=t[d],w=e[d];if(n)var b=o?n(w,m,d,e,t,a):n(m,w,d,t,e,a);if(!(b===void 0?m===w||i(m,w,r,n,a):b)){v=!1;break}p||(p=d=="constructor")}if(v&&!p){var O=t.constructor,g=e.constructor;O!=g&&"constructor"in t&&"constructor"in e&&!(typeof O=="function"&&O instanceof O&&typeof g=="function"&&g instanceof g)&&(v=!1)}return a.delete(t),a.delete(e),v}var JC=XC,ZC=Rr,QC=Lt,eI=ZC(QC,"DataView"),tI=eI,rI=Rr,nI=Lt,iI=rI(nI,"Promise"),aI=iI,oI=Rr,sI=Lt,lI=oI(sI,"Set"),Qv=lI,uI=Rr,cI=Lt,fI=uI(cI,"WeakMap"),dI=fI,Hu=tI,Gu=cu,Yu=aI,Xu=Qv,Ju=dI,ey=Ht,Rn=Cp,ty="[object Map]",hI="[object Object]",ry="[object Promise]",ny="[object Set]",iy="[object WeakMap]",ay="[object DataView]",pI=Rn(Hu),vI=Rn(Gu),yI=Rn(Yu),gI=Rn(Xu),mI=Rn(Ju),Kr=ey;(Hu&&Kr(new Hu(new ArrayBuffer(1)))!=ay||Gu&&Kr(new Gu)!=ty||Yu&&Kr(Yu.resolve())!=ry||Xu&&Kr(new Xu)!=ny||Ju&&Kr(new Ju)!=iy)&&(Kr=function(t){var e=ey(t),r=e==hI?t.constructor:void 0,n=r?Rn(r):"";if(n)switch(n){case pI:return ay;case vI:return ty;case yI:return ry;case gI:return ny;case mI:return iy}return e});var bI=Kr,Zu=Nv,wI=Bv,_I=Zj,xI=JC,oy=bI,sy=at,ly=Vv,OI=Xv,SI=1,uy="[object Arguments]",cy="[object Array]",Wo="[object Object]",AI=Object.prototype,fy=AI.hasOwnProperty;function PI(t,e,r,n,i,a){var o=sy(t),s=sy(e),l=o?cy:oy(t),u=s?cy:oy(e);l=l==uy?Wo:l,u=u==uy?Wo:u;var c=l==Wo,f=u==Wo,d=l==u;if(d&&ly(t)){if(!ly(e))return!1;o=!0,c=!1}if(d&&!c)return a||(a=new Zu),o||OI(t)?wI(t,e,r,n,i,a):_I(t,e,l,r,n,i,a);if(!(r&SI)){var h=c&&fy.call(t,"__wrapped__"),y=f&&fy.call(e,"__wrapped__");if(h||y){var v=h?t.value():t,p=y?e.value():e;return a||(a=new Zu),i(v,p,r,n,a)}}return d?(a||(a=new Zu),xI(t,e,r,n,i,a)):!1}var EI=PI,TI=EI,dy=Gt;function hy(t,e,r,n,i){return t===e?!0:t==null||e==null||!dy(t)&&!dy(e)?t!==t&&e!==e:TI(t,e,r,n,hy,i)}var Qu=hy,$I=Nv,jI=Qu,kI=1,CI=2;function II(t,e,r,n){var i=r.length,a=i,o=!n;if(t==null)return!a;for(t=Object(t);i--;){var s=r[i];if(o&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<a;){s=r[i];var l=s[0],u=t[l],c=s[1];if(o&&s[2]){if(u===void 0&&!(l in t))return!1}else{var f=new $I;if(n)var d=n(u,c,l,t,e,f);if(!(d===void 0?jI(c,u,kI|CI,n,f):d))return!1}}return!0}var NI=II,MI=yr;function DI(t){return t===t&&!MI(t)}var py=DI,LI=py,BI=Fo;function RI(t){for(var e=BI(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,LI(i)]}return e}var UI=RI;function FI(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}var vy=FI,WI=NI,qI=UI,zI=vy;function KI(t){var e=qI(t);return e.length==1&&e[0][2]?zI(e[0][0],e[0][1]):function(r){return r===t||WI(r,t,e)}}var VI=KI;function HI(t,e){return t!=null&&e in Object(t)}var GI=HI,YI=Wp,XI=zu,JI=at,ZI=Ku,QI=Vu,eN=So;function tN(t,e,r){e=YI(e,t);for(var n=-1,i=e.length,a=!1;++n<i;){var o=eN(e[n]);if(!(a=t!=null&&r(t,o)))break;t=t[o]}return a||++n!=i?a:(i=t==null?0:t.length,!!i&&QI(i)&&ZI(o,i)&&(JI(t)||XI(t)))}var rN=tN,nN=GI,iN=rN;function aN(t,e){return t!=null&&iN(t,e,nN)}var oN=aN,sN=Qu,lN=qp,uN=oN,cN=ou,fN=py,dN=vy,hN=So,pN=1,vN=2;function yN(t,e){return cN(t)&&fN(e)?dN(hN(t),e):function(r){var n=lN(r,t);return n===void 0&&n===e?uN(r,t):sN(e,n,pN|vN)}}var gN=yN;function mN(t){return t}var Un=mN;function bN(t){return function(e){return e==null?void 0:e[t]}}var wN=bN,_N=pu;function xN(t){return function(e){return _N(e,t)}}var ON=xN,SN=wN,AN=ON,PN=ou,EN=So;function TN(t){return PN(t)?SN(EN(t)):AN(t)}var $N=TN,jN=VI,kN=gN,CN=Un,IN=at,NN=$N;function MN(t){return typeof t=="function"?t:t==null?CN:typeof t=="object"?IN(t)?kN(t[0],t[1]):jN(t):NN(t)}var Bt=MN;function DN(t,e,r,n){for(var i=t.length,a=r+(n?1:-1);n?a--:++a<i;)if(e(t[a],a,t))return a;return-1}var yy=DN;function LN(t){return t!==t}var BN=LN;function RN(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}var UN=RN,FN=yy,WN=BN,qN=UN;function zN(t,e,r){return e===e?qN(t,e,r):FN(t,WN,r)}var KN=zN,VN=KN;function HN(t,e){var r=t==null?0:t.length;return!!r&&VN(t,e,0)>-1}var GN=HN;function YN(t,e,r){for(var n=-1,i=t==null?0:t.length;++n<i;)if(r(e,t[n]))return!0;return!1}var XN=YN;function JN(){}var ZN=JN,ec=Qv,QN=ZN,eM=Wu,tM=1/0,rM=ec&&1/eM(new ec([,-0]))[1]==tM?function(t){return new ec(t)}:QN,nM=rM,iM=Mv,aM=GN,oM=XN,sM=Lv,lM=nM,uM=Wu,cM=200;function fM(t,e,r){var n=-1,i=aM,a=t.length,o=!0,s=[],l=s;if(r)o=!1,i=oM;else if(a>=cM){var u=e?null:lM(t);if(u)return uM(u);o=!1,i=sM,l=new iM}else l=e?[]:s;e:for(;++n<a;){var c=t[n],f=e?e(c):c;if(c=r||c!==0?c:0,o&&f===f){for(var d=l.length;d--;)if(l[d]===f)continue e;e&&l.push(f),s.push(c)}else i(l,f,r)||(l!==s&&l.push(f),s.push(c))}return s}var dM=fM,hM=Bt,pM=dM;function vM(t,e){return t&&t.length?pM(t,hM(e)):[]}var yM=vM;const gy=we(yM);function my(t,e,r){return e===!0?gy(t,r):te(e)?gy(t,e):t}function Fn(t){"@babel/helpers - typeof";return Fn=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},Fn(t)}var gM=["ref"];function by(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 Xt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?by(Object(r),!0).forEach(function(n){zo(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):by(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function mM(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wy(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,xy(n.key),n)}}function bM(t,e,r){return e&&wy(t.prototype,e),r&&wy(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function wM(t,e,r){return e=qo(e),_M(t,_y()?Reflect.construct(e,r||[],qo(t).constructor):e.apply(t,r))}function _M(t,e){if(e&&(Fn(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xM(t)}function xM(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 qo(t){return qo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},qo(t)}function OM(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&&tc(t,e)}function tc(t,e){return tc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},tc(t,e)}function zo(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=SM(t,"string");return Fn(e)=="symbol"?e:e+""}function SM(t,e){if(Fn(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Fn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function AM(t,e){if(t==null)return{};var r=PM(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 PM(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 EM(t){return t.value}function TM(t,e){if(x.isValidElement(t))return x.cloneElement(t,e);if(typeof t=="function")return x.createElement(t,e);e.ref;var r=AM(e,gM);return x.createElement(Fu,r)}var Oy=1,Vr=function(t){function e(){var r;mM(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=wM(this,e,[].concat(i)),zo(r,"lastBoundingBox",{width:-1,height:-1}),r}return OM(e,t),bM(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)>Oy||Math.abs(i.height-this.lastBoundingBox.height)>Oy)&&(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?Xt({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,o=i.align,s=i.verticalAlign,l=i.margin,u=i.chartWidth,c=i.chartHeight,f,d;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&a==="vertical"){var h=this.getBBoxSnapshot();f={left:((u||0)-h.width)/2}}else f=o==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(s==="middle"){var y=this.getBBoxSnapshot();d={top:((c||0)-y.height)/2}}else d=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return Xt(Xt({},f),d)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,o=i.width,s=i.height,l=i.wrapperStyle,u=i.payloadUniqBy,c=i.payload,f=Xt(Xt({position:"absolute",width:o||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return x.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(h){n.wrapperNode=h}},TM(a,Xt(Xt({},this.props),{},{payload:my(c,u,EM)})))}}],[{key:"getWithHeight",value:function(n,i){var a=Xt(Xt({},this.defaultProps),n.props),o=a.layout;return o==="vertical"&&z(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])}(x.PureComponent);zo(Vr,"displayName","Legend"),zo(Vr,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Sy=zi,$M=zu,jM=at,Ay=Sy?Sy.isConcatSpreadable:void 0;function kM(t){return jM(t)||$M(t)||!!(Ay&&t&&t[Ay])}var CM=kM,IM=Wv,NM=CM;function Py(t,e,r,n,i){var a=-1,o=t.length;for(r||(r=NM),i||(i=[]);++a<o;){var s=t[a];e>0&&r(s)?e>1?Py(s,e-1,r,n,i):IM(i,s):n||(i[i.length]=s)}return i}var Ey=Py;function MM(t){return function(e,r,n){for(var i=-1,a=Object(e),o=n(e),s=o.length;s--;){var l=o[t?s:++i];if(r(a[l],l,a)===!1)break}return e}}var DM=MM,LM=DM,BM=LM(),RM=BM,UM=RM,FM=Fo;function WM(t,e){return t&&UM(t,e,FM)}var Ty=WM,qM=Gi;function zM(t,e){return function(r,n){if(r==null)return r;if(!qM(r))return t(r,n);for(var i=r.length,a=e?i:-1,o=Object(r);(e?a--:++a<i)&&n(o[a],a,o)!==!1;);return r}}var KM=zM,VM=Ty,HM=KM,GM=HM(VM),rc=GM,YM=rc,XM=Gi;function JM(t,e){var r=-1,n=XM(t)?Array(t.length):[];return YM(t,function(i,a,o){n[++r]=e(i,a,o)}),n}var $y=JM;function ZM(t,e){var r=t.length;for(t.sort(e);r--;)t[r]=t[r].value;return t}var QM=ZM,jy=$n;function eD(t,e){if(t!==e){var r=t!==void 0,n=t===null,i=t===t,a=jy(t),o=e!==void 0,s=e===null,l=e===e,u=jy(e);if(!s&&!u&&!a&&t>e||a&&o&&l&&!s&&!u||n&&o&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&t<e||u&&r&&i&&!n&&!a||s&&r&&i||!o&&i||!l)return-1}return 0}var tD=eD,rD=tD;function nD(t,e,r){for(var n=-1,i=t.criteria,a=e.criteria,o=i.length,s=r.length;++n<o;){var l=rD(i[n],a[n]);if(l){if(n>=s)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return t.index-e.index}var iD=nD,nc=hu,aD=pu,oD=Bt,sD=$y,lD=QM,uD=Hv,cD=iD,fD=Un,dD=at;function hD(t,e,r){e.length?e=nc(e,function(a){return dD(a)?function(o){return aD(o,a.length===1?a[0]:a)}:a}):e=[fD];var n=-1;e=nc(e,uD(oD));var i=sD(t,function(a,o,s){var l=nc(e,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return lD(i,function(a,o){return cD(a,o,r)})}var pD=hD;function vD(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var yD=vD,gD=yD,ky=Math.max;function mD(t,e,r){return e=ky(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,a=ky(n.length-e,0),o=Array(a);++i<a;)o[i]=n[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=n[i];return s[e]=r(o),gD(t,this,s)}}var bD=mD;function wD(t){return function(){return t}}var _D=wD,xD=Rr,OD=function(){try{var t=xD(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Cy=OD,SD=_D,Iy=Cy,AD=Un,PD=Iy?function(t,e){return Iy(t,"toString",{configurable:!0,enumerable:!1,value:SD(e),writable:!0})}:AD,ED=PD,TD=800,$D=16,jD=Date.now;function kD(t){var e=0,r=0;return function(){var n=jD(),i=$D-(n-r);if(r=n,i>0){if(++e>=TD)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var CD=kD,ID=ED,ND=CD,MD=ND(ID),DD=MD,LD=Un,BD=bD,RD=DD;function UD(t,e){return RD(BD(t,e,LD),t+"")}var FD=UD,WD=uu,qD=Gi,zD=Ku,KD=yr;function VD(t,e,r){if(!KD(r))return!1;var n=typeof e;return(n=="number"?qD(r)&&zD(e,r.length):n=="string"&&e in r)?WD(r[e],t):!1}var Ko=VD,HD=Ey,GD=pD,YD=FD,Ny=Ko,XD=YD(function(t,e){if(t==null)return[];var r=e.length;return r>1&&Ny(t,e[0],e[1])?e=[]:r>2&&Ny(e[0],e[1],e[2])&&(e=[e[0]]),GD(t,HD(e,1),[])}),JD=XD;const ic=we(JD);function Yi(t){"@babel/helpers - typeof";return Yi=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},Yi(t)}function ac(){return ac=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},ac.apply(this,arguments)}function ZD(t,e){return rL(t)||tL(t,e)||eL(t,e)||QD()}function QD(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
60
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eL(t,e){if(t){if(typeof t=="string")return My(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 My(t,e)}}function My(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 tL(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,s=[],l=!0,u=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}function rL(t){if(Array.isArray(t))return t}function Dy(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 oc(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Dy(Object(r),!0).forEach(function(n){nL(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Dy(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function nL(t,e,r){return e=iL(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function iL(t){var e=aL(t,"string");return Yi(e)=="symbol"?e:e+""}function aL(t,e){if(Yi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Yi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function oL(t){return Array.isArray(t)&&Ue(t[0])&&Ue(t[1])?t.join(" ~ "):t}var sL=function(e){var r=e.separator,n=r===void 0?" : ":r,i=e.contentStyle,a=i===void 0?{}:i,o=e.itemStyle,s=o===void 0?{}:o,l=e.labelStyle,u=l===void 0?{}:l,c=e.payload,f=e.formatter,d=e.itemSorter,h=e.wrapperClassName,y=e.labelClassName,v=e.label,p=e.labelFormatter,m=e.accessibilityLayer,w=m===void 0?!1:m,b=function(){if(c&&c.length){var $={padding:0,margin:0},k=(d?ic(c,d):c).map(function(C,D){if(C.type==="none")return null;var N=oc({display:"block",paddingTop:4,paddingBottom:4,color:C.color||"#000"},s),L=C.formatter||f||oL,W=C.value,q=C.name,M=W,R=q;if(L&&M!=null&&R!=null){var U=L(W,q,C,D,c);if(Array.isArray(U)){var V=ZD(U,2);M=V[0],R=V[1]}else M=U}return x.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(D),style:N},Ue(R)?x.createElement("span",{className:"recharts-tooltip-item-name"},R):null,Ue(R)?x.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,x.createElement("span",{className:"recharts-tooltip-item-value"},M),x.createElement("span",{className:"recharts-tooltip-item-unit"},C.unit||""))});return x.createElement("ul",{className:"recharts-tooltip-item-list",style:$},k)}return null},O=oc({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},a),g=oc({margin:0},u),_=!se(v),S=_?v:"",A=ie("recharts-default-tooltip",h),E=ie("recharts-tooltip-label",y);_&&p&&c!==void 0&&c!==null&&(S=p(v,c));var I=w?{role:"status","aria-live":"assertive"}:{};return x.createElement("div",ac({className:A,style:O},I),x.createElement("p",{className:E,style:g},x.isValidElement(S)?S:"".concat(S)),b())};function Xi(t){"@babel/helpers - typeof";return Xi=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},Xi(t)}function Vo(t,e,r){return e=lL(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function lL(t){var e=uL(t,"string");return Xi(e)=="symbol"?e:e+""}function uL(t,e){if(Xi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Xi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Ji="recharts-tooltip-wrapper",cL={visibility:"hidden"};function fL(t){var e=t.coordinate,r=t.translateX,n=t.translateY;return ie(Ji,Vo(Vo(Vo(Vo({},"".concat(Ji,"-right"),z(r)&&e&&z(e.x)&&r>=e.x),"".concat(Ji,"-left"),z(r)&&e&&z(e.x)&&r<e.x),"".concat(Ji,"-bottom"),z(n)&&e&&z(e.y)&&n>=e.y),"".concat(Ji,"-top"),z(n)&&e&&z(e.y)&&n<e.y))}function Ly(t){var e=t.allowEscapeViewBox,r=t.coordinate,n=t.key,i=t.offsetTopLeft,a=t.position,o=t.reverseDirection,s=t.tooltipDimension,l=t.viewBox,u=t.viewBoxDimension;if(a&&z(a[n]))return a[n];var c=r[n]-s-i,f=r[n]+i;if(e[n])return o[n]?c:f;if(o[n]){var d=c,h=l[n];return d<h?Math.max(f,l[n]):Math.max(c,l[n])}var y=f+s,v=l[n]+u;return y>v?Math.max(c,l[n]):Math.max(f,l[n])}function dL(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 hL(t){var e=t.allowEscapeViewBox,r=t.coordinate,n=t.offsetTopLeft,i=t.position,a=t.reverseDirection,o=t.tooltipBox,s=t.useTranslate3d,l=t.viewBox,u,c,f;return o.height>0&&o.width>0&&r?(c=Ly({allowEscapeViewBox:e,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:l,viewBoxDimension:l.width}),f=Ly({allowEscapeViewBox:e,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:l,viewBoxDimension:l.height}),u=dL({translateX:c,translateY:f,useTranslate3d:s})):u=cL,{cssProperties:u,cssClasses:fL({translateX:c,translateY:f,coordinate:r})}}function Wn(t){"@babel/helpers - typeof";return Wn=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},Wn(t)}function By(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 Ry(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?By(Object(r),!0).forEach(function(n){lc(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):By(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function pL(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vL(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,Fy(n.key),n)}}function yL(t,e,r){return e&&vL(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function gL(t,e,r){return e=Ho(e),mL(t,Uy()?Reflect.construct(e,r||[],Ho(t).constructor):e.apply(t,r))}function mL(t,e){if(e&&(Wn(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return bL(t)}function bL(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Uy(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Uy=function(){return!!t})()}function Ho(t){return Ho=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ho(t)}function wL(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&&sc(t,e)}function sc(t,e){return sc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},sc(t,e)}function lc(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=_L(t,"string");return Wn(e)=="symbol"?e:e+""}function _L(t,e){if(Wn(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Wn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Wy=1,xL=function(t){function e(){var r;pL(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=gL(this,e,[].concat(i)),lc(r,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),lc(r,"handleKeyDown",function(o){if(o.key==="Escape"){var s,l,u,c;r.setState({dismissed:!0,dismissedAtCoordinate:{x:(s=(l=r.props.coordinate)===null||l===void 0?void 0:l.x)!==null&&s!==void 0?s:0,y:(u=(c=r.props.coordinate)===null||c===void 0?void 0:c.y)!==null&&u!==void 0?u:0}})}}),r}return wL(e,t),yL(e,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();(Math.abs(n.width-this.state.lastBoundingBox.width)>Wy||Math.abs(n.height-this.state.lastBoundingBox.height)>Wy)&&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,s=i.animationDuration,l=i.animationEasing,u=i.children,c=i.coordinate,f=i.hasPayload,d=i.isAnimationActive,h=i.offset,y=i.position,v=i.reverseDirection,p=i.useTranslate3d,m=i.viewBox,w=i.wrapperStyle,b=hL({allowEscapeViewBox:o,coordinate:c,offsetTopLeft:h,position:y,reverseDirection:v,tooltipBox:this.state.lastBoundingBox,useTranslate3d:p,viewBox:m}),O=b.cssClasses,g=b.cssProperties,_=Ry(Ry({transition:d&&a?"transform ".concat(s,"ms ").concat(l):void 0},g),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&f?"visible":"hidden",position:"absolute",top:0,left:0},w);return x.createElement("div",{tabIndex:-1,className:O,style:_,ref:function(A){n.wrapperNode=A}},u)}}])}(x.PureComponent),OL=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},wt={isSsr:OL(),get:function(e){return wt[e]},set:function(e,r){if(typeof e=="string")wt[e]=r;else{var n=Object.keys(e);n&&n.length&&n.forEach(function(i){wt[i]=e[i]})}}};function qn(t){"@babel/helpers - typeof";return qn=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},qn(t)}function qy(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 zy(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?qy(Object(r),!0).forEach(function(n){cc(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):qy(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function SL(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function AL(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,Vy(n.key),n)}}function PL(t,e,r){return e&&AL(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function EL(t,e,r){return e=Go(e),TL(t,Ky()?Reflect.construct(e,r||[],Go(t).constructor):e.apply(t,r))}function TL(t,e){if(e&&(qn(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $L(t)}function $L(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ky(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ky=function(){return!!t})()}function Go(t){return Go=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Go(t)}function jL(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&&uc(t,e)}function uc(t,e){return uc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},uc(t,e)}function cc(t,e,r){return e=Vy(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Vy(t){var e=kL(t,"string");return qn(e)=="symbol"?e:e+""}function kL(t,e){if(qn(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(qn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function CL(t){return t.dataKey}function IL(t,e){return x.isValidElement(t)?x.cloneElement(t,e):typeof t=="function"?x.createElement(t,e):x.createElement(sL,e)}var Rt=function(t){function e(){return SL(this,e),EL(this,e,arguments)}return jL(e,t),PL(e,[{key:"render",value:function(){var n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,s=i.animationDuration,l=i.animationEasing,u=i.content,c=i.coordinate,f=i.filterNull,d=i.isAnimationActive,h=i.offset,y=i.payload,v=i.payloadUniqBy,p=i.position,m=i.reverseDirection,w=i.useTranslate3d,b=i.viewBox,O=i.wrapperStyle,g=y??[];f&&g.length&&(g=my(y.filter(function(S){return S.value!=null&&(S.hide!==!0||n.props.includeHidden)}),v,CL));var _=g.length>0;return x.createElement(xL,{allowEscapeViewBox:o,animationDuration:s,animationEasing:l,isAnimationActive:d,active:a,coordinate:c,hasPayload:_,offset:h,position:p,reverseDirection:m,useTranslate3d:w,viewBox:b,wrapperStyle:O},IL(u,zy(zy({},this.props),{},{payload:g})))}}])}(x.PureComponent);cc(Rt,"displayName","Tooltip"),cc(Rt,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!wt.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 NL=Lt,ML=function(){return NL.Date.now()},DL=ML,LL=/\s/;function BL(t){for(var e=t.length;e--&&LL.test(t.charAt(e)););return e}var RL=BL,UL=RL,FL=/^\s+/;function WL(t){return t&&t.slice(0,UL(t)+1).replace(FL,"")}var qL=WL,zL=qL,Hy=yr,KL=$n,Gy=NaN,VL=/^[-+]0x[0-9a-f]+$/i,HL=/^0b[01]+$/i,GL=/^0o[0-7]+$/i,YL=parseInt;function XL(t){if(typeof t=="number")return t;if(KL(t))return Gy;if(Hy(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Hy(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=zL(t);var r=HL.test(t);return r||GL.test(t)?YL(t.slice(2),r?2:8):VL.test(t)?Gy:+t}var Yy=XL,JL=yr,fc=DL,Xy=Yy,ZL="Expected a function",QL=Math.max,e2=Math.min;function t2(t,e,r){var n,i,a,o,s,l,u=0,c=!1,f=!1,d=!0;if(typeof t!="function")throw new TypeError(ZL);e=Xy(e)||0,JL(r)&&(c=!!r.leading,f="maxWait"in r,a=f?QL(Xy(r.maxWait)||0,e):a,d="trailing"in r?!!r.trailing:d);function h(_){var S=n,A=i;return n=i=void 0,u=_,o=t.apply(A,S),o}function y(_){return u=_,s=setTimeout(m,e),c?h(_):o}function v(_){var S=_-l,A=_-u,E=e-S;return f?e2(E,a-A):E}function p(_){var S=_-l,A=_-u;return l===void 0||S>=e||S<0||f&&A>=a}function m(){var _=fc();if(p(_))return w(_);s=setTimeout(m,v(_))}function w(_){return s=void 0,d&&n?h(_):(n=i=void 0,o)}function b(){s!==void 0&&clearTimeout(s),u=0,n=l=i=s=void 0}function O(){return s===void 0?o:w(fc())}function g(){var _=fc(),S=p(_);if(n=arguments,i=this,l=_,S){if(s===void 0)return y(l);if(f)return clearTimeout(s),s=setTimeout(m,e),h(l)}return s===void 0&&(s=setTimeout(m,e)),o}return g.cancel=b,g.flush=O,g}var r2=t2,n2=r2,i2=yr,a2="Expected a function";function o2(t,e,r){var n=!0,i=!0;if(typeof t!="function")throw new TypeError(a2);return i2(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),n2(t,e,{leading:n,maxWait:e,trailing:i})}var s2=o2;const Jy=we(s2);function Zi(t){"@babel/helpers - typeof";return Zi=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},Zi(t)}function Zy(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?Zy(Object(r),!0).forEach(function(n){l2(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Zy(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function l2(t,e,r){return e=u2(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function u2(t){var e=c2(t,"string");return Zi(e)=="symbol"?e:e+""}function c2(t,e){if(Zi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Zi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function f2(t,e){return v2(t)||p2(t,e)||h2(t,e)||d2()}function d2(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
61
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function h2(t,e){if(t){if(typeof t=="string")return Qy(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 Qy(t,e)}}function Qy(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 p2(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,s=[],l=!0,u=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}function v2(t){if(Array.isArray(t))return t}var y2=x.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,s=t.height,l=s===void 0?"100%":s,u=t.minWidth,c=u===void 0?0:u,f=t.minHeight,d=t.maxHeight,h=t.children,y=t.debounce,v=y===void 0?0:y,p=t.id,m=t.className,w=t.onResize,b=t.style,O=b===void 0?{}:b,g=x.useRef(null),_=x.useRef();_.current=w,x.useImperativeHandle(e,function(){return Object.defineProperty(g.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),g.current},configurable:!0})});var S=x.useState({containerWidth:i.width,containerHeight:i.height}),A=f2(S,2),E=A[0],I=A[1],T=x.useCallback(function(k,C){I(function(D){var N=Math.round(k),L=Math.round(C);return D.containerWidth===N&&D.containerHeight===L?D:{containerWidth:N,containerHeight:L}})},[]);x.useEffect(function(){var k=function(q){var M,R=q[0].contentRect,U=R.width,V=R.height;T(U,V),(M=_.current)===null||M===void 0||M.call(_,U,V)};v>0&&(k=Jy(k,v,{trailing:!0,leading:!1}));var C=new ResizeObserver(k),D=g.current.getBoundingClientRect(),N=D.width,L=D.height;return T(N,L),C.observe(g.current),function(){C.disconnect()}},[T,v]);var $=x.useMemo(function(){var k=E.containerWidth,C=E.containerHeight;if(k<0||C<0)return null;jt(Fr(o)||Fr(l),`The width(%s) and height(%s) are both fixed numbers,
|
|
62
|
+
maybe you don't need to use a ResponsiveContainer.`,o,l),jt(!r||r>0,"The aspect(%s) must be greater than zero.",r);var D=Fr(o)?k:o,N=Fr(l)?C:l;r&&r>0&&(D?N=D/r:N&&(D=N*r),d&&N>d&&(N=d)),jt(D>0||N>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
92
63
|
please check the style of container, or the props width(%s) and height(%s),
|
|
93
64
|
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
94
|
-
height and width.`,
|
|
95
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
96
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function P2(t,e){if(t){if(typeof t=="string")return Bg(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 Bg(t,e)}}function Bg(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 E2(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,s=[],u=!0,l=!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)&&(s.push(n.value),s.length!==e);u=!0);}catch(c){l=!0,i=c}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function T2(t){if(Array.isArray(t))return t}var Ug=/[ \f\n\r\t\v\u2028\u2029]+/,Fg=function(e){var r=e.children,n=e.breakAll,i=e.style;try{var a=[];fe(r)||(n?a=r.toString().split(""):a=r.toString().split(Ug));var o=a.map(function(u){return{word:u,width:_a(u,i).width}}),s=n?0:_a(" ",i).width;return{wordsWithComputedWidth:o,spaceWidth:s}}catch{return null}},j2=function(e,r,n,i,a){var o=e.maxLines,s=e.children,u=e.style,l=e.breakAll,c=V(o),f=s,d=function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return R.reduce(function(M,L){var q=L.word,z=L.width,D=M[M.length-1];if(D&&(i==null||a||D.width+z+n<Number(i)))D.words.push(q),D.width+=z+n;else{var B={words:[q],width:z};M.push(B)}return M},[])},h=d(r),y=function(R){return R.reduce(function(M,L){return M.width>L.width?M:L})};if(!c)return h;for(var v="…",p=function(R){var M=f.slice(0,R),L=Fg({breakAll:l,style:u,children:M+v}).wordsWithComputedWidth,q=d(L),z=q.length>o||y(q).width>Number(i);return[z,q]},m=0,b=f.length-1,w=0,O;m<=b&&w<=f.length-1;){var g=Math.floor((m+b)/2),_=g-1,S=p(_),A=Lg(S,2),E=A[0],N=A[1],j=p(g),$=Lg(j,1),k=$[0];if(!E&&!k&&(m=g+1),E&&k&&(b=g-1),!E&&k){O=N;break}w++}return O||h},Wg=function(e){var r=fe(e)?[]:e.toString().split(Ug);return[{words:r}]},$2=function(e){var r=e.width,n=e.scaleToFit,i=e.children,a=e.style,o=e.breakAll,s=e.maxLines;if((r||n)&&!It.isSsr){var u,l,c=Fg({breakAll:o,children:i,style:a});if(c){var f=c.wordsWithComputedWidth,d=c.spaceWidth;u=f,l=d}else return Wg(i);return j2({breakAll:o,children:i,maxLines:s,style:a},u,l,r,n)}return Wg(i)},qg="#808080",cn=function(e){var r=e.x,n=r===void 0?0:r,i=e.y,a=i===void 0?0:i,o=e.lineHeight,s=o===void 0?"1em":o,u=e.capHeight,l=u===void 0?"0.71em":u,c=e.scaleToFit,f=c===void 0?!1:c,d=e.textAnchor,h=d===void 0?"start":d,y=e.verticalAnchor,v=y===void 0?"end":y,p=e.fill,m=p===void 0?qg:p,b=Rg(e,x2),w=x.useMemo(function(){return $2({breakAll:b.breakAll,children:b.children,maxLines:b.maxLines,scaleToFit:f,style:b.style,width:b.width})},[b.breakAll,b.children,b.maxLines,f,b.style,b.width]),O=b.dx,g=b.dy,_=b.angle,S=b.className,A=b.breakAll,E=Rg(b,O2);if(!Je(n)||!Je(a))return null;var N=n+(V(O)?O:0),j=a+(V(g)?g:0),$;switch(v){case"start":$=Rc("calc(".concat(l,")"));break;case"middle":$=Rc("calc(".concat((w.length-1)/2," * -").concat(s," + (").concat(l," / 2))"));break;default:$=Rc("calc(".concat(w.length-1," * -").concat(s,")"));break}var k=[];if(f){var I=w[0].width,R=b.width;k.push("scale(".concat((V(R)?R/I:1)/I,")"))}return _&&k.push("rotate(".concat(_,", ").concat(N,", ").concat(j,")")),k.length&&(E.transform=k.join(" ")),x.createElement("text",Lc({},Q(E,!0),{x:N,y:j,className:le("recharts-text",S),textAnchor:h,fill:m.includes("url")?qg:m}),w.map(function(M,L){var q=M.words.join(A?"":" ");return x.createElement("tspan",{x:N,dy:L===0?$:s,key:"".concat(q,"-").concat(L)},q)}))};function Ir(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function k2(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Bc(t){let e,r,n;t.length!==2?(e=Ir,r=(s,u)=>Ir(t(s),u),n=(s,u)=>t(s)-u):(e=t===Ir||t===k2?t:C2,r=t,n=t);function i(s,u,l=0,c=s.length){if(l<c){if(e(u,u)!==0)return c;do{const f=l+c>>>1;r(s[f],u)<0?l=f+1:c=f}while(l<c)}return l}function a(s,u,l=0,c=s.length){if(l<c){if(e(u,u)!==0)return c;do{const f=l+c>>>1;r(s[f],u)<=0?l=f+1:c=f}while(l<c)}return l}function o(s,u,l=0,c=s.length){const f=i(s,u,l,c-1);return f>l&&n(s[f-1],u)>-n(s[f],u)?f-1:f}return{left:i,center:o,right:a}}function C2(){return 0}function zg(t){return t===null?NaN:+t}function*I2(t,e){for(let r of t)r!=null&&(r=+r)>=r&&(yield r)}const Oa=Bc(Ir).right;Bc(zg).center;class Kg extends Map{constructor(e,r=D2){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(Vg(this,e))}has(e){return super.has(Vg(this,e))}set(e,r){return super.set(N2(this,e),r)}delete(e){return super.delete(M2(this,e))}}function Vg({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function N2({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function M2({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function D2(t){return t!==null&&typeof t=="object"?t.valueOf():t}function R2(t=Ir){if(t===Ir)return Hg;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 Hg(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(t<e?-1:t>e?1:0)}const L2=Math.sqrt(50),B2=Math.sqrt(10),U2=Math.sqrt(2);function Os(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>=L2?10:a>=B2?5:a>=U2?2:1;let s,u,l;return i<0?(l=Math.pow(10,-i)/o,s=Math.round(t*l),u=Math.round(e*l),s/l<t&&++s,u/l>e&&--u,l=-l):(l=Math.pow(10,i)*o,s=Math.round(t/l),u=Math.round(e/l),s*l<t&&++s,u*l>e&&--u),u<s&&.5<=r&&r<2?Os(t,e,r*2):[s,u,l]}function Uc(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?Os(e,t,r):Os(t,e,r);if(!(a>=i))return[];const s=a-i+1,u=new Array(s);if(n)if(o<0)for(let l=0;l<s;++l)u[l]=(a-l)/-o;else for(let l=0;l<s;++l)u[l]=(a-l)*o;else if(o<0)for(let l=0;l<s;++l)u[l]=(i+l)/-o;else for(let l=0;l<s;++l)u[l]=(i+l)*o;return u}function Fc(t,e,r){return e=+e,t=+t,r=+r,Os(t,e,r)[2]}function Wc(t,e,r){e=+e,t=+t,r=+r;const n=e<t,i=n?Fc(e,t,r):Fc(t,e,r);return(n?-1:1)*(i<0?1/-i:i)}function Gg(t,e){let r;for(const n of t)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function Yg(t,e){let r;for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function Xg(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?Hg:R2(i);n>r;){if(n-r>600){const u=n-r+1,l=e-r+1,c=Math.log(u),f=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*f*(u-f)/u)*(l-u/2<0?-1:1),h=Math.max(r,Math.floor(e-l*f/u+d)),y=Math.min(n,Math.floor(e+(u-l)*f/u+d));Xg(t,e,h,y,i)}const a=t[e];let o=r,s=n;for(Sa(t,r,e),i(t[n],a)>0&&Sa(t,r,n);o<s;){for(Sa(t,o,s),++o,--s;i(t[o],a)<0;)++o;for(;i(t[s],a)>0;)--s}i(t[r],a)===0?Sa(t,r,s):(++s,Sa(t,s,n)),s<=e&&(r=s+1),e<=s&&(n=s-1)}return t}function Sa(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function F2(t,e,r){if(t=Float64Array.from(I2(t)),!(!(n=t.length)||isNaN(e=+e))){if(e<=0||n<2)return Yg(t);if(e>=1)return Gg(t);var n,i=(n-1)*e,a=Math.floor(i),o=Gg(Xg(t,a).subarray(0,a+1)),s=Yg(t.subarray(a+1));return o+(s-o)*(i-a)}}function W2(t,e,r=zg){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),s=+r(t[a+1],a+1,t);return o+(s-o)*(i-a)}}function q2(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 Nt(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function hr(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 qc=Symbol("implicit");function zc(){var t=new Kg,e=[],r=[],n=qc;function i(a){let o=t.get(a);if(o===void 0){if(n!==qc)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 Kg;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 zc(e,r).unknown(n)},Nt.apply(i,arguments),i}function Aa(){var t=zc().unknown(void 0),e=t.domain,r=t.range,n=0,i=1,a,o,s=!1,u=0,l=0,c=.5;delete t.unknown;function f(){var d=e().length,h=i<n,y=h?i:n,v=h?n:i;a=(v-y)/Math.max(1,d-u+l*2),s&&(a=Math.floor(a)),y+=(v-y-a*(d-u))*c,o=a*(1-u),s&&(y=Math.round(y),o=Math.round(o));var p=q2(d).map(function(m){return y+a*m});return r(h?p.reverse():p)}return t.domain=function(d){return arguments.length?(e(d),f()):e()},t.range=function(d){return arguments.length?([n,i]=d,n=+n,i=+i,f()):[n,i]},t.rangeRound=function(d){return[n,i]=d,n=+n,i=+i,s=!0,f()},t.bandwidth=function(){return o},t.step=function(){return a},t.round=function(d){return arguments.length?(s=!!d,f()):s},t.padding=function(d){return arguments.length?(u=Math.min(1,l=+d),f()):u},t.paddingInner=function(d){return arguments.length?(u=Math.min(1,d),f()):u},t.paddingOuter=function(d){return arguments.length?(l=+d,f()):l},t.align=function(d){return arguments.length?(c=Math.max(0,Math.min(1,d)),f()):c},t.copy=function(){return Aa(e(),[n,i]).round(s).paddingInner(u).paddingOuter(l).align(c)},Nt.apply(f(),arguments)}function Jg(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return Jg(e())},t}function Pa(){return Jg(Aa.apply(null,arguments).paddingInner(1))}function Kc(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function Zg(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function Ea(){}var Ta=.7,Ss=1/Ta,ui="\\s*([+-]?\\d+)\\s*",ja="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",rr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",z2=/^#([0-9a-f]{3,8})$/,K2=new RegExp(`^rgb\\(${ui},${ui},${ui}\\)$`),V2=new RegExp(`^rgb\\(${rr},${rr},${rr}\\)$`),H2=new RegExp(`^rgba\\(${ui},${ui},${ui},${ja}\\)$`),G2=new RegExp(`^rgba\\(${rr},${rr},${rr},${ja}\\)$`),Y2=new RegExp(`^hsl\\(${ja},${rr},${rr}\\)$`),X2=new RegExp(`^hsla\\(${ja},${rr},${rr},${ja}\\)$`),Qg={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};Kc(Ea,$a,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:em,formatHex:em,formatHex8:J2,formatHsl:Z2,formatRgb:tm,toString:tm});function em(){return this.rgb().formatHex()}function J2(){return this.rgb().formatHex8()}function Z2(){return om(this).formatHsl()}function tm(){return this.rgb().formatRgb()}function $a(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=z2.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?rm(e):r===3?new gt(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?As(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?As(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=K2.exec(t))?new gt(e[1],e[2],e[3],1):(e=V2.exec(t))?new gt(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=H2.exec(t))?As(e[1],e[2],e[3],e[4]):(e=G2.exec(t))?As(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Y2.exec(t))?am(e[1],e[2]/100,e[3]/100,1):(e=X2.exec(t))?am(e[1],e[2]/100,e[3]/100,e[4]):Qg.hasOwnProperty(t)?rm(Qg[t]):t==="transparent"?new gt(NaN,NaN,NaN,0):null}function rm(t){return new gt(t>>16&255,t>>8&255,t&255,1)}function As(t,e,r,n){return n<=0&&(t=e=r=NaN),new gt(t,e,r,n)}function Q2(t){return t instanceof Ea||(t=$a(t)),t?(t=t.rgb(),new gt(t.r,t.g,t.b,t.opacity)):new gt}function Vc(t,e,r,n){return arguments.length===1?Q2(t):new gt(t,e,r,n??1)}function gt(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}Kc(gt,Vc,Zg(Ea,{brighter(t){return t=t==null?Ss:Math.pow(Ss,t),new gt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Ta:Math.pow(Ta,t),new gt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new gt(fn(this.r),fn(this.g),fn(this.b),Ps(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:nm,formatHex:nm,formatHex8:eB,formatRgb:im,toString:im}));function nm(){return`#${dn(this.r)}${dn(this.g)}${dn(this.b)}`}function eB(){return`#${dn(this.r)}${dn(this.g)}${dn(this.b)}${dn((isNaN(this.opacity)?1:this.opacity)*255)}`}function im(){const t=Ps(this.opacity);return`${t===1?"rgb(":"rgba("}${fn(this.r)}, ${fn(this.g)}, ${fn(this.b)}${t===1?")":`, ${t})`}`}function Ps(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function fn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function dn(t){return t=fn(t),(t<16?"0":"")+t.toString(16)}function am(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Vt(t,e,r,n)}function om(t){if(t instanceof Vt)return new Vt(t.h,t.s,t.l,t.opacity);if(t instanceof Ea||(t=$a(t)),!t)return new Vt;if(t instanceof Vt)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,s=a-i,u=(a+i)/2;return s?(e===a?o=(r-n)/s+(r<n)*6:r===a?o=(n-e)/s+2:o=(e-r)/s+4,s/=u<.5?a+i:2-a-i,o*=60):s=u>0&&u<1?0:o,new Vt(o,s,u,t.opacity)}function tB(t,e,r,n){return arguments.length===1?om(t):new Vt(t,e,r,n??1)}function Vt(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}Kc(Vt,tB,Zg(Ea,{brighter(t){return t=t==null?Ss:Math.pow(Ss,t),new Vt(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Ta:Math.pow(Ta,t),new Vt(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 gt(Hc(t>=240?t-240:t+120,i,n),Hc(t,i,n),Hc(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new Vt(sm(this.h),Es(this.s),Es(this.l),Ps(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=Ps(this.opacity);return`${t===1?"hsl(":"hsla("}${sm(this.h)}, ${Es(this.s)*100}%, ${Es(this.l)*100}%${t===1?")":`, ${t})`}`}}));function sm(t){return t=(t||0)%360,t<0?t+360:t}function Es(t){return Math.max(0,Math.min(1,t||0))}function Hc(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 Gc=t=>()=>t;function rB(t,e){return function(r){return t+r*e}}function nB(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 iB(t){return(t=+t)==1?um:function(e,r){return r-e?nB(e,r,t):Gc(isNaN(e)?r:e)}}function um(t,e){var r=e-t;return r?rB(t,r):Gc(isNaN(t)?e:t)}const lm=function t(e){var r=iB(e);function n(i,a){var o=r((i=Vc(i)).r,(a=Vc(a)).r),s=r(i.g,a.g),u=r(i.b,a.b),l=um(i.opacity,a.opacity);return function(c){return i.r=o(c),i.g=s(c),i.b=u(c),i.opacity=l(c),i+""}}return n.gamma=t,n}(1);function aB(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 oB(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function sB(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]=li(t[o],e[o]);for(;o<r;++o)a[o]=e[o];return function(s){for(o=0;o<n;++o)a[o]=i[o](s);return a}}function uB(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function Ts(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function lB(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]=li(t[i],e[i]):n[i]=e[i];return function(a){for(i in r)n[i]=r[i](a);return n}}var Yc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Xc=new RegExp(Yc.source,"g");function cB(t){return function(){return t}}function fB(t){return function(e){return t(e)+""}}function dB(t,e){var r=Yc.lastIndex=Xc.lastIndex=0,n,i,a,o=-1,s=[],u=[];for(t=t+"",e=e+"";(n=Yc.exec(t))&&(i=Xc.exec(e));)(a=i.index)>r&&(a=e.slice(r,a),s[o]?s[o]+=a:s[++o]=a),(n=n[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,u.push({i:o,x:Ts(n,i)})),r=Xc.lastIndex;return r<e.length&&(a=e.slice(r),s[o]?s[o]+=a:s[++o]=a),s.length<2?u[0]?fB(u[0].x):cB(e):(e=u.length,function(l){for(var c=0,f;c<e;++c)s[(f=u[c]).i]=f.x(l);return s.join("")})}function li(t,e){var r=typeof e,n;return e==null||r==="boolean"?Gc(e):(r==="number"?Ts:r==="string"?(n=$a(e))?(e=n,lm):dB:e instanceof $a?lm:e instanceof Date?uB:oB(e)?aB:Array.isArray(e)?sB:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?lB:Ts)(t,e)}function Jc(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}function hB(t,e){e===void 0&&(e=t,t=li);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 s=Math.max(0,Math.min(n-1,Math.floor(o*=n)));return a[s](o-s)}}function pB(t){return function(){return t}}function js(t){return+t}var cm=[0,1];function ht(t){return t}function Zc(t,e){return(e-=t=+t)?function(r){return(r-t)/e}:pB(isNaN(e)?NaN:.5)}function vB(t,e){var r;return t>e&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function yB(t,e,r){var n=t[0],i=t[1],a=e[0],o=e[1];return i<n?(n=Zc(i,n),a=r(o,a)):(n=Zc(n,i),a=r(a,o)),function(s){return a(n(s))}}function gB(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]=Zc(t[o],t[o+1]),a[o]=r(e[o],e[o+1]);return function(s){var u=Oa(t,s,1,n)-1;return a[u](i[u](s))}}function ka(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function $s(){var t=cm,e=cm,r=li,n,i,a,o=ht,s,u,l;function c(){var d=Math.min(t.length,e.length);return o!==ht&&(o=vB(t[0],t[d-1])),s=d>2?gB:yB,u=l=null,f}function f(d){return d==null||isNaN(d=+d)?a:(u||(u=s(t.map(n),e,r)))(n(o(d)))}return f.invert=function(d){return o(i((l||(l=s(e,t.map(n),Ts)))(d)))},f.domain=function(d){return arguments.length?(t=Array.from(d,js),c()):t.slice()},f.range=function(d){return arguments.length?(e=Array.from(d),c()):e.slice()},f.rangeRound=function(d){return e=Array.from(d),r=Jc,c()},f.clamp=function(d){return arguments.length?(o=d?!0:ht,c()):o!==ht},f.interpolate=function(d){return arguments.length?(r=d,c()):r},f.unknown=function(d){return arguments.length?(a=d,f):a},function(d,h){return n=d,i=h,c()}}function Qc(){return $s()(ht,ht)}function mB(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function ks(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function ci(t){return t=ks(Math.abs(t)),t?t[1]:NaN}function bB(t,e){return function(r,n){for(var i=r.length,a=[],o=0,s=t[0],u=0;i>0&&s>0&&(u+s+1>n&&(s=Math.max(1,n-u)),a.push(r.substring(i-=s,i+s)),!((u+=s+1)>n));)s=t[o=(o+1)%t.length];return a.reverse().join(e)}}function wB(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var _B=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ca(t){if(!(e=_B.exec(t)))throw new Error("invalid format: "+t);var e;return new ef({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]})}Ca.prototype=ef.prototype;function ef(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+""}ef.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 xB(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 fm;function OB(t,e){var r=ks(t,e);if(!r)return t+"";var n=r[0],i=r[1],a=i-(fm=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")+ks(t,Math.max(0,e+a-1))[0]}function dm(t,e){var r=ks(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 hm={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:mB,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)=>dm(t*100,e),r:dm,s:OB,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function pm(t){return t}var vm=Array.prototype.map,ym=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function SB(t){var e=t.grouping===void 0||t.thousands===void 0?pm:bB(vm.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?pm:wB(vm.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"−":t.minus+"",u=t.nan===void 0?"NaN":t.nan+"";function l(f){f=Ca(f);var d=f.fill,h=f.align,y=f.sign,v=f.symbol,p=f.zero,m=f.width,b=f.comma,w=f.precision,O=f.trim,g=f.type;g==="n"?(b=!0,g="g"):hm[g]||(w===void 0&&(w=12),O=!0,g="g"),(p||d==="0"&&h==="=")&&(p=!0,d="0",h="=");var _=v==="$"?r:v==="#"&&/[boxX]/.test(g)?"0"+g.toLowerCase():"",S=v==="$"?n:/[%p]/.test(g)?o:"",A=hm[g],E=/[defgprs%]/.test(g);w=w===void 0?6:/[gprs]/.test(g)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function N(j){var $=_,k=S,I,R,M;if(g==="c")k=A(j)+k,j="";else{j=+j;var L=j<0||1/j<0;if(j=isNaN(j)?u:A(Math.abs(j),w),O&&(j=xB(j)),L&&+j==0&&y!=="+"&&(L=!1),$=(L?y==="("?y:s:y==="-"||y==="("?"":y)+$,k=(g==="s"?ym[8+fm/3]:"")+k+(L&&y==="("?")":""),E){for(I=-1,R=j.length;++I<R;)if(M=j.charCodeAt(I),48>M||M>57){k=(M===46?i+j.slice(I+1):j.slice(I))+k,j=j.slice(0,I);break}}}b&&!p&&(j=e(j,1/0));var q=$.length+j.length+k.length,z=q<m?new Array(m-q+1).join(d):"";switch(b&&p&&(j=e(z+j,z.length?m-k.length:1/0),z=""),h){case"<":j=$+j+k+z;break;case"=":j=$+z+j+k;break;case"^":j=z.slice(0,q=z.length>>1)+$+j+k+z.slice(q);break;default:j=z+$+j+k;break}return a(j)}return N.toString=function(){return f+""},N}function c(f,d){var h=l((f=Ca(f),f.type="f",f)),y=Math.max(-8,Math.min(8,Math.floor(ci(d)/3)))*3,v=Math.pow(10,-y),p=ym[8+y/3];return function(m){return h(v*m)+p}}return{format:l,formatPrefix:c}}var Cs,tf,gm;AB({thousands:",",grouping:[3],currency:["$",""]});function AB(t){return Cs=SB(t),tf=Cs.format,gm=Cs.formatPrefix,Cs}function PB(t){return Math.max(0,-ci(Math.abs(t)))}function EB(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ci(e)/3)))*3-ci(Math.abs(t)))}function TB(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,ci(e)-ci(t))+1}function mm(t,e,r,n){var i=Wc(t,e,r),a;switch(n=Ca(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(a=EB(i,o))&&(n.precision=a),gm(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=TB(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=PB(i))&&(n.precision=a-(n.type==="%")*2);break}}return tf(n)}function Nr(t){var e=t.domain;return t.ticks=function(r){var n=e();return Uc(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return mm(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],s=n[a],u,l,c=10;for(s<o&&(l=o,o=s,s=l,l=i,i=a,a=l);c-- >0;){if(l=Fc(o,s,r),l===u)return n[i]=o,n[a]=s,e(n);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;u=l}return t},t}function Is(){var t=Qc();return t.copy=function(){return ka(t,Is())},Nt.apply(t,arguments),Nr(t)}function bm(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,js),r):t.slice()},r.unknown=function(n){return arguments.length?(e=n,r):e},r.copy=function(){return bm(t).unknown(e)},t=arguments.length?Array.from(t,js):[0,1],Nr(r)}function wm(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 _m(t){return Math.log(t)}function xm(t){return Math.exp(t)}function jB(t){return-Math.log(-t)}function $B(t){return-Math.exp(-t)}function kB(t){return isFinite(t)?+("1e"+t):t<0?0:t}function CB(t){return t===10?kB:t===Math.E?Math.exp:e=>Math.pow(t,e)}function IB(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 Om(t){return(e,r)=>-t(-e,r)}function rf(t){const e=t(_m,xm),r=e.domain;let n=10,i,a;function o(){return i=IB(n),a=CB(n),r()[0]<0?(i=Om(i),a=Om(a),t(jB,$B)):t(_m,xm),e}return e.base=function(s){return arguments.length?(n=+s,o()):n},e.domain=function(s){return arguments.length?(r(s),o()):r()},e.ticks=s=>{const u=r();let l=u[0],c=u[u.length-1];const f=c<l;f&&([l,c]=[c,l]);let d=i(l),h=i(c),y,v;const p=s==null?10:+s;let m=[];if(!(n%1)&&h-d<p){if(d=Math.floor(d),h=Math.ceil(h),l>0){for(;d<=h;++d)for(y=1;y<n;++y)if(v=d<0?y/a(-d):y*a(d),!(v<l)){if(v>c)break;m.push(v)}}else for(;d<=h;++d)for(y=n-1;y>=1;--y)if(v=d>0?y/a(-d):y*a(d),!(v<l)){if(v>c)break;m.push(v)}m.length*2<p&&(m=Uc(l,c,p))}else m=Uc(d,h,Math.min(h-d,p)).map(a);return f?m.reverse():m},e.tickFormat=(s,u)=>{if(s==null&&(s=10),u==null&&(u=n===10?"s":","),typeof u!="function"&&(!(n%1)&&(u=Ca(u)).precision==null&&(u.trim=!0),u=tf(u)),s===1/0)return u;const l=Math.max(1,n*s/e.ticks().length);return c=>{let f=c/a(Math.round(i(c)));return f*n<n-.5&&(f*=n),f<=l?u(c):""}},e.nice=()=>r(wm(r(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),e}function Sm(){const t=rf($s()).domain([1,10]);return t.copy=()=>ka(t,Sm()).base(t.base()),Nt.apply(t,arguments),t}function Am(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function Pm(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function nf(t){var e=1,r=t(Am(e),Pm(e));return r.constant=function(n){return arguments.length?t(Am(e=+n),Pm(e)):e},Nr(r)}function Em(){var t=nf($s());return t.copy=function(){return ka(t,Em()).constant(t.constant())},Nt.apply(t,arguments)}function Tm(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function NB(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function MB(t){return t<0?-t*t:t*t}function af(t){var e=t(ht,ht),r=1;function n(){return r===1?t(ht,ht):r===.5?t(NB,MB):t(Tm(r),Tm(1/r))}return e.exponent=function(i){return arguments.length?(r=+i,n()):r},Nr(e)}function of(){var t=af($s());return t.copy=function(){return ka(t,of()).exponent(t.exponent())},Nt.apply(t,arguments),t}function DB(){return of.apply(null,arguments).exponent(.5)}function jm(t){return Math.sign(t)*t*t}function RB(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function $m(){var t=Qc(),e=[0,1],r=!1,n;function i(a){var o=RB(t(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return t.invert(jm(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,js)).map(jm)),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 $m(t.domain(),e).round(r).clamp(t.clamp()).unknown(n)},Nt.apply(i,arguments),Nr(i)}function km(){var t=[],e=[],r=[],n;function i(){var o=0,s=Math.max(1,e.length);for(r=new Array(s-1);++o<s;)r[o-1]=W2(t,o/s);return a}function a(o){return o==null||isNaN(o=+o)?n:e[Oa(r,o)]}return a.invertExtent=function(o){var s=e.indexOf(o);return s<0?[NaN,NaN]:[s>0?r[s-1]:t[0],s<r.length?r[s]:t[t.length-1]]},a.domain=function(o){if(!arguments.length)return t.slice();t=[];for(let s of o)s!=null&&!isNaN(s=+s)&&t.push(s);return t.sort(Ir),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 km().domain(t).range(e).unknown(n)},Nt.apply(a,arguments)}function Cm(){var t=0,e=1,r=1,n=[.5],i=[0,1],a;function o(u){return u!=null&&u<=u?i[Oa(n,u,0,r)]:a}function s(){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,s()):[t,e]},o.range=function(u){return arguments.length?(r=(i=Array.from(u)).length-1,s()):i.slice()},o.invertExtent=function(u){var l=i.indexOf(u);return l<0?[NaN,NaN]:l<1?[t,n[0]]:l>=r?[n[r-1],e]:[n[l-1],n[l]]},o.unknown=function(u){return arguments.length&&(a=u),o},o.thresholds=function(){return n.slice()},o.copy=function(){return Cm().domain([t,e]).range(i).unknown(a)},Nt.apply(Nr(o),arguments)}function Im(){var t=[.5],e=[0,1],r,n=1;function i(a){return a!=null&&a<=a?e[Oa(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 Im().domain(t).range(e).unknown(r)},Nt.apply(i,arguments)}const sf=new Date,uf=new Date;function Ze(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),s=i.ceil(a);return a-o<s-a?o:s},i.offset=(a,o)=>(e(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,s)=>{const u=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a<o)||!(s>0))return u;let l;do u.push(l=new Date(+a)),e(a,s),t(a);while(l<a&&a<o);return u},i.filter=a=>Ze(o=>{if(o>=o)for(;t(o),!a(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;e(o,-1),!a(o););else for(;--s>=0;)for(;e(o,1),!a(o););}),r&&(i.count=(a,o)=>(sf.setTime(+a),uf.setTime(+o),t(sf),t(uf),Math.floor(r(sf,uf))),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 Ns=Ze(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Ns.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Ze(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):Ns),Ns.range;const pr=1e3,Mt=pr*60,vr=Mt*60,yr=vr*24,lf=yr*7,Nm=yr*30,cf=yr*365,hn=Ze(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*pr)},(t,e)=>(e-t)/pr,t=>t.getUTCSeconds());hn.range;const ff=Ze(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*pr)},(t,e)=>{t.setTime(+t+e*Mt)},(t,e)=>(e-t)/Mt,t=>t.getMinutes());ff.range;const df=Ze(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Mt)},(t,e)=>(e-t)/Mt,t=>t.getUTCMinutes());df.range;const hf=Ze(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*pr-t.getMinutes()*Mt)},(t,e)=>{t.setTime(+t+e*vr)},(t,e)=>(e-t)/vr,t=>t.getHours());hf.range;const pf=Ze(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*vr)},(t,e)=>(e-t)/vr,t=>t.getUTCHours());pf.range;const Ia=Ze(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Mt)/yr,t=>t.getDate()-1);Ia.range;const Ms=Ze(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yr,t=>t.getUTCDate()-1);Ms.range;const Mm=Ze(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yr,t=>Math.floor(t/yr));Mm.range;function pn(t){return Ze(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())*Mt)/lf)}const Ds=pn(0),Rs=pn(1),LB=pn(2),BB=pn(3),fi=pn(4),UB=pn(5),FB=pn(6);Ds.range,Rs.range,LB.range,BB.range,fi.range,UB.range,FB.range;function vn(t){return Ze(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)/lf)}const Ls=vn(0),Bs=vn(1),WB=vn(2),qB=vn(3),di=vn(4),zB=vn(5),KB=vn(6);Ls.range,Bs.range,WB.range,qB.range,di.range,zB.range,KB.range;const vf=Ze(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());vf.range;const yf=Ze(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());yf.range;const gr=Ze(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());gr.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Ze(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)}),gr.range;const mr=Ze(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());mr.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Ze(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)}),mr.range;function Dm(t,e,r,n,i,a){const o=[[hn,1,pr],[hn,5,5*pr],[hn,15,15*pr],[hn,30,30*pr],[a,1,Mt],[a,5,5*Mt],[a,15,15*Mt],[a,30,30*Mt],[i,1,vr],[i,3,3*vr],[i,6,6*vr],[i,12,12*vr],[n,1,yr],[n,2,2*yr],[r,1,lf],[e,1,Nm],[e,3,3*Nm],[t,1,cf]];function s(l,c,f){const d=c<l;d&&([l,c]=[c,l]);const h=f&&typeof f.range=="function"?f:u(l,c,f),y=h?h.range(l,+c+1):[];return d?y.reverse():y}function u(l,c,f){const d=Math.abs(c-l)/f,h=Bc(([,,p])=>p).right(o,d);if(h===o.length)return t.every(Wc(l/cf,c/cf,f));if(h===0)return Ns.every(Math.max(Wc(l,c,f),1));const[y,v]=o[d/o[h-1][2]<o[h][2]/d?h-1:h];return y.every(v)}return[s,u]}const[VB,HB]=Dm(mr,yf,Ls,Mm,pf,df),[GB,YB]=Dm(gr,vf,Ds,Ia,hf,ff);function gf(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 mf(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 Na(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function XB(t){var e=t.dateTime,r=t.date,n=t.time,i=t.periods,a=t.days,o=t.shortDays,s=t.months,u=t.shortMonths,l=Ma(i),c=Da(i),f=Ma(a),d=Da(a),h=Ma(o),y=Da(o),v=Ma(s),p=Da(s),m=Ma(u),b=Da(u),w={a:L,A:q,b:z,B:D,c:null,d:Wm,e:Wm,f:bU,g:jU,G:kU,H:yU,I:gU,j:mU,L:qm,m:wU,M:_U,p:B,q:F,Q:Ym,s:Xm,S:xU,u:OU,U:SU,V:AU,w:PU,W:EU,x:null,X:null,y:TU,Y:$U,Z:CU,"%":Gm},O={a:G,A:J,b:re,B:ne,c:null,d:Km,e:Km,f:DU,g:VU,G:GU,H:IU,I:NU,j:MU,L:Vm,m:RU,M:LU,p:ue,q:oe,Q:Ym,s:Xm,S:BU,u:UU,U:FU,V:WU,w:qU,W:zU,x:null,X:null,y:KU,Y:HU,Z:YU,"%":Gm},g={a:N,A:j,b:$,B:k,c:I,d:Um,e:Um,f:dU,g:Bm,G:Lm,H:Fm,I:Fm,j:uU,L:fU,m:sU,M:lU,p:E,q:oU,Q:pU,s:vU,S:cU,u:tU,U:rU,V:nU,w:eU,W:iU,x:R,X:M,y:Bm,Y:Lm,Z:aU,"%":hU};w.x=_(r,w),w.X=_(n,w),w.c=_(e,w),O.x=_(r,O),O.X=_(n,O),O.c=_(e,O);function _(W,Y){return function(te){var C=[],ye=-1,H=0,_e=W.length,Ee,Ge,Jt;for(te instanceof Date||(te=new Date(+te));++ye<_e;)W.charCodeAt(ye)===37&&(C.push(W.slice(H,ye)),(Ge=Rm[Ee=W.charAt(++ye)])!=null?Ee=W.charAt(++ye):Ge=Ee==="e"?" ":"0",(Jt=Y[Ee])&&(Ee=Jt(te,Ge)),C.push(Ee),H=ye+1);return C.push(W.slice(H,ye)),C.join("")}}function S(W,Y){return function(te){var C=Na(1900,void 0,1),ye=A(C,W,te+="",0),H,_e;if(ye!=te.length)return null;if("Q"in C)return new Date(C.Q);if("s"in C)return new Date(C.s*1e3+("L"in C?C.L:0));if(Y&&!("Z"in C)&&(C.Z=0),"p"in C&&(C.H=C.H%12+C.p*12),C.m===void 0&&(C.m="q"in C?C.q:0),"V"in C){if(C.V<1||C.V>53)return null;"w"in C||(C.w=1),"Z"in C?(H=mf(Na(C.y,0,1)),_e=H.getUTCDay(),H=_e>4||_e===0?Bs.ceil(H):Bs(H),H=Ms.offset(H,(C.V-1)*7),C.y=H.getUTCFullYear(),C.m=H.getUTCMonth(),C.d=H.getUTCDate()+(C.w+6)%7):(H=gf(Na(C.y,0,1)),_e=H.getDay(),H=_e>4||_e===0?Rs.ceil(H):Rs(H),H=Ia.offset(H,(C.V-1)*7),C.y=H.getFullYear(),C.m=H.getMonth(),C.d=H.getDate()+(C.w+6)%7)}else("W"in C||"U"in C)&&("w"in C||(C.w="u"in C?C.u%7:"W"in C?1:0),_e="Z"in C?mf(Na(C.y,0,1)).getUTCDay():gf(Na(C.y,0,1)).getDay(),C.m=0,C.d="W"in C?(C.w+6)%7+C.W*7-(_e+5)%7:C.w+C.U*7-(_e+6)%7);return"Z"in C?(C.H+=C.Z/100|0,C.M+=C.Z%100,mf(C)):gf(C)}}function A(W,Y,te,C){for(var ye=0,H=Y.length,_e=te.length,Ee,Ge;ye<H;){if(C>=_e)return-1;if(Ee=Y.charCodeAt(ye++),Ee===37){if(Ee=Y.charAt(ye++),Ge=g[Ee in Rm?Y.charAt(ye++):Ee],!Ge||(C=Ge(W,te,C))<0)return-1}else if(Ee!=te.charCodeAt(C++))return-1}return C}function E(W,Y,te){var C=l.exec(Y.slice(te));return C?(W.p=c.get(C[0].toLowerCase()),te+C[0].length):-1}function N(W,Y,te){var C=h.exec(Y.slice(te));return C?(W.w=y.get(C[0].toLowerCase()),te+C[0].length):-1}function j(W,Y,te){var C=f.exec(Y.slice(te));return C?(W.w=d.get(C[0].toLowerCase()),te+C[0].length):-1}function $(W,Y,te){var C=m.exec(Y.slice(te));return C?(W.m=b.get(C[0].toLowerCase()),te+C[0].length):-1}function k(W,Y,te){var C=v.exec(Y.slice(te));return C?(W.m=p.get(C[0].toLowerCase()),te+C[0].length):-1}function I(W,Y,te){return A(W,e,Y,te)}function R(W,Y,te){return A(W,r,Y,te)}function M(W,Y,te){return A(W,n,Y,te)}function L(W){return o[W.getDay()]}function q(W){return a[W.getDay()]}function z(W){return u[W.getMonth()]}function D(W){return s[W.getMonth()]}function B(W){return i[+(W.getHours()>=12)]}function F(W){return 1+~~(W.getMonth()/3)}function G(W){return o[W.getUTCDay()]}function J(W){return a[W.getUTCDay()]}function re(W){return u[W.getUTCMonth()]}function ne(W){return s[W.getUTCMonth()]}function ue(W){return i[+(W.getUTCHours()>=12)]}function oe(W){return 1+~~(W.getUTCMonth()/3)}return{format:function(W){var Y=_(W+="",w);return Y.toString=function(){return W},Y},parse:function(W){var Y=S(W+="",!1);return Y.toString=function(){return W},Y},utcFormat:function(W){var Y=_(W+="",O);return Y.toString=function(){return W},Y},utcParse:function(W){var Y=S(W+="",!0);return Y.toString=function(){return W},Y}}}var Rm={"-":"",_:" ",0:"0"},tt=/^\s*\d+/,JB=/^%/,ZB=/[\\^$*+?|[\]().{}]/g;function be(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 QB(t){return t.replace(ZB,"\\$&")}function Ma(t){return new RegExp("^(?:"+t.map(QB).join("|")+")","i")}function Da(t){return new Map(t.map((e,r)=>[e.toLowerCase(),r]))}function eU(t,e,r){var n=tt.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function tU(t,e,r){var n=tt.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function rU(t,e,r){var n=tt.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function nU(t,e,r){var n=tt.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function iU(t,e,r){var n=tt.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function Lm(t,e,r){var n=tt.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function Bm(t,e,r){var n=tt.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function aU(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 oU(t,e,r){var n=tt.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function sU(t,e,r){var n=tt.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Um(t,e,r){var n=tt.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function uU(t,e,r){var n=tt.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function Fm(t,e,r){var n=tt.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function lU(t,e,r){var n=tt.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function cU(t,e,r){var n=tt.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function fU(t,e,r){var n=tt.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function dU(t,e,r){var n=tt.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function hU(t,e,r){var n=JB.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function pU(t,e,r){var n=tt.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function vU(t,e,r){var n=tt.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function Wm(t,e){return be(t.getDate(),e,2)}function yU(t,e){return be(t.getHours(),e,2)}function gU(t,e){return be(t.getHours()%12||12,e,2)}function mU(t,e){return be(1+Ia.count(gr(t),t),e,3)}function qm(t,e){return be(t.getMilliseconds(),e,3)}function bU(t,e){return qm(t,e)+"000"}function wU(t,e){return be(t.getMonth()+1,e,2)}function _U(t,e){return be(t.getMinutes(),e,2)}function xU(t,e){return be(t.getSeconds(),e,2)}function OU(t){var e=t.getDay();return e===0?7:e}function SU(t,e){return be(Ds.count(gr(t)-1,t),e,2)}function zm(t){var e=t.getDay();return e>=4||e===0?fi(t):fi.ceil(t)}function AU(t,e){return t=zm(t),be(fi.count(gr(t),t)+(gr(t).getDay()===4),e,2)}function PU(t){return t.getDay()}function EU(t,e){return be(Rs.count(gr(t)-1,t),e,2)}function TU(t,e){return be(t.getFullYear()%100,e,2)}function jU(t,e){return t=zm(t),be(t.getFullYear()%100,e,2)}function $U(t,e){return be(t.getFullYear()%1e4,e,4)}function kU(t,e){var r=t.getDay();return t=r>=4||r===0?fi(t):fi.ceil(t),be(t.getFullYear()%1e4,e,4)}function CU(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+be(e/60|0,"0",2)+be(e%60,"0",2)}function Km(t,e){return be(t.getUTCDate(),e,2)}function IU(t,e){return be(t.getUTCHours(),e,2)}function NU(t,e){return be(t.getUTCHours()%12||12,e,2)}function MU(t,e){return be(1+Ms.count(mr(t),t),e,3)}function Vm(t,e){return be(t.getUTCMilliseconds(),e,3)}function DU(t,e){return Vm(t,e)+"000"}function RU(t,e){return be(t.getUTCMonth()+1,e,2)}function LU(t,e){return be(t.getUTCMinutes(),e,2)}function BU(t,e){return be(t.getUTCSeconds(),e,2)}function UU(t){var e=t.getUTCDay();return e===0?7:e}function FU(t,e){return be(Ls.count(mr(t)-1,t),e,2)}function Hm(t){var e=t.getUTCDay();return e>=4||e===0?di(t):di.ceil(t)}function WU(t,e){return t=Hm(t),be(di.count(mr(t),t)+(mr(t).getUTCDay()===4),e,2)}function qU(t){return t.getUTCDay()}function zU(t,e){return be(Bs.count(mr(t)-1,t),e,2)}function KU(t,e){return be(t.getUTCFullYear()%100,e,2)}function VU(t,e){return t=Hm(t),be(t.getUTCFullYear()%100,e,2)}function HU(t,e){return be(t.getUTCFullYear()%1e4,e,4)}function GU(t,e){var r=t.getUTCDay();return t=r>=4||r===0?di(t):di.ceil(t),be(t.getUTCFullYear()%1e4,e,4)}function YU(){return"+0000"}function Gm(){return"%"}function Ym(t){return+t}function Xm(t){return Math.floor(+t/1e3)}var hi,Jm,Zm;XU({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 XU(t){return hi=XB(t),Jm=hi.format,hi.parse,Zm=hi.utcFormat,hi.utcParse,hi}function JU(t){return new Date(t)}function ZU(t){return t instanceof Date?+t:+new Date(+t)}function bf(t,e,r,n,i,a,o,s,u,l){var c=Qc(),f=c.invert,d=c.domain,h=l(".%L"),y=l(":%S"),v=l("%I:%M"),p=l("%I %p"),m=l("%a %d"),b=l("%b %d"),w=l("%B"),O=l("%Y");function g(_){return(u(_)<_?h:s(_)<_?y:o(_)<_?v:a(_)<_?p:n(_)<_?i(_)<_?m:b:r(_)<_?w:O)(_)}return c.invert=function(_){return new Date(f(_))},c.domain=function(_){return arguments.length?d(Array.from(_,ZU)):d().map(JU)},c.ticks=function(_){var S=d();return t(S[0],S[S.length-1],_??10)},c.tickFormat=function(_,S){return S==null?g:l(S)},c.nice=function(_){var S=d();return(!_||typeof _.range!="function")&&(_=e(S[0],S[S.length-1],_??10)),_?d(wm(S,_)):c},c.copy=function(){return ka(c,bf(t,e,r,n,i,a,o,s,u,l))},c}function QU(){return Nt.apply(bf(GB,YB,gr,vf,Ds,Ia,hf,ff,hn,Jm).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function eF(){return Nt.apply(bf(VB,HB,mr,yf,Ls,Ms,pf,df,hn,Zm).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Us(){var t=0,e=1,r,n,i,a,o=ht,s=!1,u;function l(f){return f==null||isNaN(f=+f)?u:o(i===0?.5:(f=(a(f)-r)*i,s?Math.max(0,Math.min(1,f)):f))}l.domain=function(f){return arguments.length?([t,e]=f,r=a(t=+t),n=a(e=+e),i=r===n?0:1/(n-r),l):[t,e]},l.clamp=function(f){return arguments.length?(s=!!f,l):s},l.interpolator=function(f){return arguments.length?(o=f,l):o};function c(f){return function(d){var h,y;return arguments.length?([h,y]=d,o=f(h,y),l):[o(0),o(1)]}}return l.range=c(li),l.rangeRound=c(Jc),l.unknown=function(f){return arguments.length?(u=f,l):u},function(f){return a=f,r=f(t),n=f(e),i=r===n?0:1/(n-r),l}}function Mr(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function Qm(){var t=Nr(Us()(ht));return t.copy=function(){return Mr(t,Qm())},hr.apply(t,arguments)}function eb(){var t=rf(Us()).domain([1,10]);return t.copy=function(){return Mr(t,eb()).base(t.base())},hr.apply(t,arguments)}function tb(){var t=nf(Us());return t.copy=function(){return Mr(t,tb()).constant(t.constant())},hr.apply(t,arguments)}function wf(){var t=af(Us());return t.copy=function(){return Mr(t,wf()).exponent(t.exponent())},hr.apply(t,arguments)}function tF(){return wf.apply(null,arguments).exponent(.5)}function rb(){var t=[],e=ht;function r(n){if(n!=null&&!isNaN(n=+n))return e((Oa(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(Ir),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)=>F2(t,a/n))},r.copy=function(){return rb(e).domain(t)},hr.apply(r,arguments)}function Fs(){var t=0,e=.5,r=1,n=1,i,a,o,s,u,l=ht,c,f=!1,d;function h(v){return isNaN(v=+v)?d:(v=.5+((v=+c(v))-a)*(n*v<n*a?s:u),l(f?Math.max(0,Math.min(1,v)):v))}h.domain=function(v){return arguments.length?([t,e,r]=v,i=c(t=+t),a=c(e=+e),o=c(r=+r),s=i===a?0:.5/(a-i),u=a===o?0:.5/(o-a),n=a<i?-1:1,h):[t,e,r]},h.clamp=function(v){return arguments.length?(f=!!v,h):f},h.interpolator=function(v){return arguments.length?(l=v,h):l};function y(v){return function(p){var m,b,w;return arguments.length?([m,b,w]=p,l=hB(v,[m,b,w]),h):[l(0),l(.5),l(1)]}}return h.range=y(li),h.rangeRound=y(Jc),h.unknown=function(v){return arguments.length?(d=v,h):d},function(v){return c=v,i=v(t),a=v(e),o=v(r),s=i===a?0:.5/(a-i),u=a===o?0:.5/(o-a),n=a<i?-1:1,h}}function nb(){var t=Nr(Fs()(ht));return t.copy=function(){return Mr(t,nb())},hr.apply(t,arguments)}function ib(){var t=rf(Fs()).domain([.1,1,10]);return t.copy=function(){return Mr(t,ib()).base(t.base())},hr.apply(t,arguments)}function ab(){var t=nf(Fs());return t.copy=function(){return Mr(t,ab()).constant(t.constant())},hr.apply(t,arguments)}function _f(){var t=af(Fs());return t.copy=function(){return Mr(t,_f()).exponent(t.exponent())},hr.apply(t,arguments)}function rF(){return _f.apply(null,arguments).exponent(.5)}const ob=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Aa,scaleDiverging:nb,scaleDivergingLog:ib,scaleDivergingPow:_f,scaleDivergingSqrt:rF,scaleDivergingSymlog:ab,scaleIdentity:bm,scaleImplicit:qc,scaleLinear:Is,scaleLog:Sm,scaleOrdinal:zc,scalePoint:Pa,scalePow:of,scaleQuantile:km,scaleQuantize:Cm,scaleRadial:$m,scaleSequential:Qm,scaleSequentialLog:eb,scaleSequentialPow:wf,scaleSequentialQuantile:rb,scaleSequentialSqrt:tF,scaleSequentialSymlog:tb,scaleSqrt:DB,scaleSymlog:Em,scaleThreshold:Im,scaleTime:QU,scaleUtc:eF,tickFormat:mm},Symbol.toStringTag,{value:"Module"}));var nF=Kn;function iF(t,e,r){for(var n=-1,i=t.length;++n<i;){var a=t[n],o=e(a);if(o!=null&&(s===void 0?o===o&&!nF(o):r(o,s)))var s=o,u=a}return u}var Ws=iF;function aF(t,e){return t>e}var sb=aF,oF=Ws,sF=sb,uF=ri;function lF(t){return t&&t.length?oF(t,uF,sF):void 0}var cF=lF;const Dr=je(cF);function fF(t,e){return t<e}var ub=fF,dF=Ws,hF=ub,pF=ri;function vF(t){return t&&t.length?dF(t,pF,hF):void 0}var yF=vF;const qs=je(yF);var gF=Rl,mF=er,bF=ng,wF=yt;function _F(t,e){var r=wF(t)?gF:bF;return r(t,mF(e))}var xF=_F,OF=tg,SF=xF;function AF(t,e){return OF(SF(t,e),1)}var PF=AF;const EF=je(PF);var TF=Oc;function jF(t,e){return TF(t,e)}var $F=jF;const Rr=je($F);var pi=1e9,kF={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Sf,Be=!0,Dt="[DecimalError] ",yn=Dt+"Invalid argument: ",xf=Dt+"Exponent out of range: ",vi=Math.floor,gn=Math.pow,CF=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,At,rt=1e7,Le=7,lb=9007199254740991,zs=vi(lb/Le),Z={};Z.absoluteValue=Z.abs=function(){var t=new this.constructor(this);return t.s&&(t.s=1),t},Z.comparedTo=Z.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},Z.decimalPlaces=Z.dp=function(){var t=this,e=t.d.length-1,r=(e-t.e)*Le;if(e=t.d[e],e)for(;e%10==0;e/=10)r--;return r<0?0:r},Z.dividedBy=Z.div=function(t){return br(this,new this.constructor(t))},Z.dividedToIntegerBy=Z.idiv=function(t){var e=this,r=e.constructor;return ke(br(e,new r(t),0,1),r.precision)},Z.equals=Z.eq=function(t){return!this.cmp(t)},Z.exponent=function(){return Ve(this)},Z.greaterThan=Z.gt=function(t){return this.cmp(t)>0},Z.greaterThanOrEqualTo=Z.gte=function(t){return this.cmp(t)>=0},Z.isInteger=Z.isint=function(){return this.e>this.d.length-2},Z.isNegative=Z.isneg=function(){return this.s<0},Z.isPositive=Z.ispos=function(){return this.s>0},Z.isZero=function(){return this.s===0},Z.lessThan=Z.lt=function(t){return this.cmp(t)<0},Z.lessThanOrEqualTo=Z.lte=function(t){return this.cmp(t)<1},Z.logarithm=Z.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(At))throw Error(Dt+"NaN");if(r.s<1)throw Error(Dt+(r.s?"NaN":"-Infinity"));return r.eq(At)?new n(0):(Be=!1,e=br(Ra(r,a),Ra(t,a),a),Be=!0,ke(e,i))},Z.minus=Z.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?hb(e,t):cb(e,(t.s=-t.s,t))},Z.modulo=Z.mod=function(t){var e,r=this,n=r.constructor,i=n.precision;if(t=new n(t),!t.s)throw Error(Dt+"NaN");return r.s?(Be=!1,e=br(r,t,0,1).times(t),Be=!0,r.minus(e)):ke(new n(r),i)},Z.naturalExponential=Z.exp=function(){return fb(this)},Z.naturalLogarithm=Z.ln=function(){return Ra(this)},Z.negated=Z.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t},Z.plus=Z.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?cb(e,t):hb(e,(t.s=-t.s,t))},Z.precision=Z.sd=function(t){var e,r,n,i=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(yn+t);if(e=Ve(i)+1,n=i.d.length-1,r=n*Le+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},Z.squareRoot=Z.sqrt=function(){var t,e,r,n,i,a,o,s=this,u=s.constructor;if(s.s<1){if(!s.s)return new u(0);throw Error(Dt+"NaN")}for(t=Ve(s),Be=!1,i=Math.sqrt(+s),i==0||i==1/0?(e=ir(s.d),(e.length+t)%2==0&&(e+="0"),i=Math.sqrt(e),t=vi((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(br(s,a,o+2)).times(.5),ir(a.d).slice(0,o)===(e=ir(n.d)).slice(0,o)){if(e=e.slice(o-3,o+1),i==o&&e=="4999"){if(ke(a,r+1,0),a.times(a).eq(s)){n=a;break}}else if(e!="9999")break;o+=4}return Be=!0,ke(n,r)},Z.times=Z.mul=function(t){var e,r,n,i,a,o,s,u,l,c=this,f=c.constructor,d=c.d,h=(t=new f(t)).d;if(!c.s||!t.s)return new f(0);for(t.s*=c.s,r=c.e+t.e,u=d.length,l=h.length,u<l&&(a=d,d=h,h=a,o=u,u=l,l=o),a=[],o=u+l,n=o;n--;)a.push(0);for(n=l;--n>=0;){for(e=0,i=u+n;i>n;)s=a[i]+h[n]*d[i-n-1]+e,a[i--]=s%rt|0,e=s/rt|0;a[i]=(a[i]+e)%rt|0}for(;!a[--o];)a.pop();return e?++r:a.shift(),t.d=a,t.e=r,Be?ke(t,f.precision):t},Z.toDecimalPlaces=Z.todp=function(t,e){var r=this,n=r.constructor;return r=new n(r),t===void 0?r:(nr(t,0,pi),e===void 0?e=n.rounding:nr(e,0,8),ke(r,t+Ve(r)+1,e))},Z.toExponential=function(t,e){var r,n=this,i=n.constructor;return t===void 0?r=mn(n,!0):(nr(t,0,pi),e===void 0?e=i.rounding:nr(e,0,8),n=ke(new i(n),t+1,e),r=mn(n,!0,t+1)),r},Z.toFixed=function(t,e){var r,n,i=this,a=i.constructor;return t===void 0?mn(i):(nr(t,0,pi),e===void 0?e=a.rounding:nr(e,0,8),n=ke(new a(i),t+Ve(i)+1,e),r=mn(n.abs(),!1,t+Ve(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)},Z.toInteger=Z.toint=function(){var t=this,e=t.constructor;return ke(new e(t),Ve(t)+1,e.rounding)},Z.toNumber=function(){return+this},Z.toPower=Z.pow=function(t){var e,r,n,i,a,o,s=this,u=s.constructor,l=12,c=+(t=new u(t));if(!t.s)return new u(At);if(s=new u(s),!s.s){if(t.s<1)throw Error(Dt+"Infinity");return s}if(s.eq(At))return s;if(n=u.precision,t.eq(At))return ke(s,n);if(e=t.e,r=t.d.length-1,o=e>=r,a=s.s,o){if((r=c<0?-c:c)<=lb){for(i=new u(At),e=Math.ceil(n/Le+4),Be=!1;r%2&&(i=i.times(s),pb(i.d,e)),r=vi(r/2),r!==0;)s=s.times(s),pb(s.d,e);return Be=!0,t.s<0?new u(At).div(i):ke(i,n)}}else if(a<0)throw Error(Dt+"NaN");return a=a<0&&t.d[Math.max(e,r)]&1?-1:1,s.s=1,Be=!1,i=t.times(Ra(s,n+l)),Be=!0,i=fb(i),i.s=a,i},Z.toPrecision=function(t,e){var r,n,i=this,a=i.constructor;return t===void 0?(r=Ve(i),n=mn(i,r<=a.toExpNeg||r>=a.toExpPos)):(nr(t,1,pi),e===void 0?e=a.rounding:nr(e,0,8),i=ke(new a(i),t,e),r=Ve(i),n=mn(i,t<=r||r<=a.toExpNeg,t)),n},Z.toSignificantDigits=Z.tosd=function(t,e){var r=this,n=r.constructor;return t===void 0?(t=n.precision,e=n.rounding):(nr(t,1,pi),e===void 0?e=n.rounding:nr(e,0,8)),ke(new n(r),t,e)},Z.toString=Z.valueOf=Z.val=Z.toJSON=Z[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=Ve(t),r=t.constructor;return mn(t,e<=r.toExpNeg||e>=r.toExpPos)};function cb(t,e){var r,n,i,a,o,s,u,l,c=t.constructor,f=c.precision;if(!t.s||!e.s)return e.s||(e=new c(t)),Be?ke(e,f):e;if(u=t.d,l=e.d,o=t.e,i=e.e,u=u.slice(),a=o-i,a){for(a<0?(n=u,a=-a,s=l.length):(n=l,i=o,s=u.length),o=Math.ceil(f/Le),s=o>s?o+1:s+1,a>s&&(a=s,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(s=u.length,a=l.length,s-a<0&&(a=s,n=l,l=u,u=n),r=0;a;)r=(u[--a]=u[a]+l[a]+r)/rt|0,u[a]%=rt;for(r&&(u.unshift(r),++i),s=u.length;u[--s]==0;)u.pop();return e.d=u,e.e=i,Be?ke(e,f):e}function nr(t,e,r){if(t!==~~t||t<e||t>r)throw Error(yn+t)}function ir(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=Le-n.length,r&&(a+=Lr(r)),a+=n;o=t[e],n=o+"",r=Le-n.length,r&&(a+=Lr(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var br=function(){function t(n,i){var a,o=0,s=n.length;for(n=n.slice();s--;)a=n[s]*i+o,n[s]=a%rt|0,o=a/rt|0;return o&&n.unshift(o),n}function e(n,i,a,o){var s,u;if(a!=o)u=a>o?1:-1;else for(s=u=0;s<a;s++)if(n[s]!=i[s]){u=n[s]>i[s]?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*rt+n[a]-i[a];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,a,o){var s,u,l,c,f,d,h,y,v,p,m,b,w,O,g,_,S,A,E=n.constructor,N=n.s==i.s?1:-1,j=n.d,$=i.d;if(!n.s)return new E(n);if(!i.s)throw Error(Dt+"Division by zero");for(u=n.e-i.e,S=$.length,g=j.length,h=new E(N),y=h.d=[],l=0;$[l]==(j[l]||0);)++l;if($[l]>(j[l]||0)&&--u,a==null?b=a=E.precision:o?b=a+(Ve(n)-Ve(i))+1:b=a,b<0)return new E(0);if(b=b/Le+2|0,l=0,S==1)for(c=0,$=$[0],b++;(l<g||c)&&b--;l++)w=c*rt+(j[l]||0),y[l]=w/$|0,c=w%$|0;else{for(c=rt/($[0]+1)|0,c>1&&($=t($,c),j=t(j,c),S=$.length,g=j.length),O=S,v=j.slice(0,S),p=v.length;p<S;)v[p++]=0;A=$.slice(),A.unshift(0),_=$[0],$[1]>=rt/2&&++_;do c=0,s=e($,v,S,p),s<0?(m=v[0],S!=p&&(m=m*rt+(v[1]||0)),c=m/_|0,c>1?(c>=rt&&(c=rt-1),f=t($,c),d=f.length,p=v.length,s=e(f,v,d,p),s==1&&(c--,r(f,S<d?A:$,d))):(c==0&&(s=c=1),f=$.slice()),d=f.length,d<p&&f.unshift(0),r(v,f,p),s==-1&&(p=v.length,s=e($,v,S,p),s<1&&(c++,r(v,S<p?A:$,p))),p=v.length):s===0&&(c++,v=[0]),y[l++]=c,s&&v[0]?v[p++]=j[O]||0:(v=[j[O]],p=1);while((O++<g||v[0]!==void 0)&&b--)}return y[0]||y.shift(),h.e=u,ke(h,o?a+Ve(h)+1:a)}}();function fb(t,e){var r,n,i,a,o,s,u=0,l=0,c=t.constructor,f=c.precision;if(Ve(t)>16)throw Error(xf+Ve(t));if(!t.s)return new c(At);for(e==null?(Be=!1,s=f):s=e,o=new c(.03125);t.abs().gte(.1);)t=t.times(o),l+=5;for(n=Math.log(gn(2,l))/Math.LN10*2+5|0,s+=n,r=i=a=new c(At),c.precision=s;;){if(i=ke(i.times(t),s),r=r.times(++u),o=a.plus(br(i,r,s)),ir(o.d).slice(0,s)===ir(a.d).slice(0,s)){for(;l--;)a=ke(a.times(a),s);return c.precision=f,e==null?(Be=!0,ke(a,f)):a}a=o}}function Ve(t){for(var e=t.e*Le,r=t.d[0];r>=10;r/=10)e++;return e}function Of(t,e,r){if(e>t.LN10.sd())throw Be=!0,r&&(t.precision=r),Error(Dt+"LN10 precision limit exceeded");return ke(new t(t.LN10),e)}function Lr(t){for(var e="";t--;)e+="0";return e}function Ra(t,e){var r,n,i,a,o,s,u,l,c,f=1,d=10,h=t,y=h.d,v=h.constructor,p=v.precision;if(h.s<1)throw Error(Dt+(h.s?"NaN":"-Infinity"));if(h.eq(At))return new v(0);if(e==null?(Be=!1,l=p):l=e,h.eq(10))return e==null&&(Be=!0),Of(v,l);if(l+=d,v.precision=l,r=ir(y),n=r.charAt(0),a=Ve(h),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)h=h.times(t),r=ir(h.d),n=r.charAt(0),f++;a=Ve(h),n>1?(h=new v("0."+r),a++):h=new v(n+"."+r.slice(1))}else return u=Of(v,l+2,p).times(a+""),h=Ra(new v(n+"."+r.slice(1)),l-d).plus(u),v.precision=p,e==null?(Be=!0,ke(h,p)):h;for(s=o=h=br(h.minus(At),h.plus(At),l),c=ke(h.times(h),l),i=3;;){if(o=ke(o.times(c),l),u=s.plus(br(o,new v(i),l)),ir(u.d).slice(0,l)===ir(s.d).slice(0,l))return s=s.times(2),a!==0&&(s=s.plus(Of(v,l+2,p).times(a+""))),s=br(s,new v(f),l),v.precision=p,e==null?(Be=!0,ke(s,p)):s;s=u,i+=2}}function db(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=vi(r/Le),t.d=[],n=(r+1)%Le,r<0&&(n+=Le),n<i){for(n&&t.d.push(+e.slice(0,n)),i-=Le;n<i;)t.d.push(+e.slice(n,n+=Le));e=e.slice(n),n=Le-e.length}else n-=i;for(;n--;)e+="0";if(t.d.push(+e),Be&&(t.e>zs||t.e<-zs))throw Error(xf+r)}else t.s=0,t.e=0,t.d=[0];return t}function ke(t,e,r){var n,i,a,o,s,u,l,c,f=t.d;for(o=1,a=f[0];a>=10;a/=10)o++;if(n=e-o,n<0)n+=Le,i=e,l=f[c=0];else{if(c=Math.ceil((n+1)/Le),a=f.length,c>=a)return t;for(l=a=f[c],o=1;a>=10;a/=10)o++;n%=Le,i=n-Le+o}if(r!==void 0&&(a=gn(10,o-i-1),s=l/a%10|0,u=e<0||f[c+1]!==void 0||l%a,u=r<4?(s||u)&&(r==0||r==(t.s<0?3:2)):s>5||s==5&&(r==4||u||r==6&&(n>0?i>0?l/gn(10,o-i):0:f[c-1])%10&1||r==(t.s<0?8:7))),e<1||!f[0])return u?(a=Ve(t),f.length=1,e=e-a-1,f[0]=gn(10,(Le-e%Le)%Le),t.e=vi(-e/Le)||0):(f.length=1,f[0]=t.e=t.s=0),t;if(n==0?(f.length=c,a=1,c--):(f.length=c+1,a=gn(10,Le-n),f[c]=i>0?(l/gn(10,o-i)%gn(10,i)|0)*a:0),u)for(;;)if(c==0){(f[0]+=a)==rt&&(f[0]=1,++t.e);break}else{if(f[c]+=a,f[c]!=rt)break;f[c--]=0,a=1}for(n=f.length;f[--n]===0;)f.pop();if(Be&&(t.e>zs||t.e<-zs))throw Error(xf+Ve(t));return t}function hb(t,e){var r,n,i,a,o,s,u,l,c,f,d=t.constructor,h=d.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new d(t),Be?ke(e,h):e;if(u=t.d,f=e.d,n=e.e,l=t.e,u=u.slice(),o=l-n,o){for(c=o<0,c?(r=u,o=-o,s=f.length):(r=f,n=l,s=u.length),i=Math.max(Math.ceil(h/Le),s)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=u.length,s=f.length,c=i<s,c&&(s=i),i=0;i<s;i++)if(u[i]!=f[i]){c=u[i]<f[i];break}o=0}for(c&&(r=u,u=f,f=r,e.s=-e.s),s=u.length,i=f.length-s;i>0;--i)u[s++]=0;for(i=f.length;i>o;){if(u[--i]<f[i]){for(a=i;a&&u[--a]===0;)u[a]=rt-1;--u[a],u[i]+=rt}u[i]-=f[i]}for(;u[--s]===0;)u.pop();for(;u[0]===0;u.shift())--n;return u[0]?(e.d=u,e.e=n,Be?ke(e,h):e):new d(0)}function mn(t,e,r){var n,i=Ve(t),a=ir(t.d),o=a.length;return e?(r&&(n=r-o)>0?a=a.charAt(0)+"."+a.slice(1)+Lr(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Lr(-i-1)+a,r&&(n=r-o)>0&&(a+=Lr(n))):i>=o?(a+=Lr(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+Lr(n))):((n=i+1)<o&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-o)>0&&(i+1===o&&(a+="."),a+=Lr(n))),t.s<0?"-"+a:a}function pb(t,e){if(t.length>e)return t.length=e,!0}function vb(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(yn+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 db(o,a.toString())}else if(typeof a!="string")throw Error(yn+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,CF.test(a))db(o,a);else throw Error(yn+a)}if(i.prototype=Z,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=vb,i.config=i.set=IF,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 IF(t){if(!t||typeof t!="object")throw Error(Dt+"Object expected");var e,r,n,i=["precision",1,pi,"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(vi(n)===n&&n>=i[e+1]&&n<=i[e+2])this[r]=n;else throw Error(yn+r+": "+n);if((n=t[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(yn+r+": "+n);return this}var Sf=vb(kF);At=new Sf(1);const $e=Sf;function NF(t){return LF(t)||RF(t)||DF(t)||MF()}function MF(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
97
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
98
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
99
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
100
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
101
|
-
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 Cf(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 Cf(t,e)}}function EW(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function TW(t){if(Array.isArray(t))return Cf(t)}function Cf(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 kb(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 qe(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?kb(Object(r),!0).forEach(function(n){gi(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):kb(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function gi(t,e,r){return e=jW(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function jW(t){var e=$W(t,"string");return Fa(e)=="symbol"?e:e+""}function $W(t,e){if(Fa(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Fa(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function We(t,e,r){return fe(t)||fe(e)?r:Je(e)?xt(t,e,r):ae(e)?e(t):r}function Wa(t,e,r,n){var i=EF(t,function(s){return We(s,e)});if(r==="number"){var a=i.filter(function(s){return V(s)||parseFloat(s)});return a.length?[qs(a),Dr(a)]:[1/0,-1/0]}var o=n?i.filter(function(s){return!fe(s)}):i;return o.map(function(s){return Je(s)||s instanceof Date?s:""})}var kW=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,s=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(s<=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,l=0;l<s;l++){var c=l>0?i[l-1].coordinate:i[s-1].coordinate,f=i[l].coordinate,d=l>=s-1?i[0].coordinate:i[l+1].coordinate,h=void 0;if(ft(f-c)!==ft(d-f)){var y=[];if(ft(d-f)===ft(u[1]-u[0])){h=d;var v=f+u[1]-u[0];y[0]=Math.min(v,(v+c)/2),y[1]=Math.max(v,(v+c)/2)}else{h=c;var p=d+u[1]-u[0];y[0]=Math.min(f,(p+f)/2),y[1]=Math.max(f,(p+f)/2)}var m=[Math.min(f,(h+f)/2),Math.max(f,(h+f)/2)];if(e>m[0]&&e<=m[1]||e>=y[0]&&e<=y[1]){o=i[l].index;break}}else{var b=Math.min(c,d),w=Math.max(c,d);if(e>(b+f)/2&&e<=(w+f)/2){o=i[l].index;break}}}else for(var O=0;O<s;O++)if(O===0&&e<=(n[O].coordinate+n[O+1].coordinate)/2||O>0&&O<s-1&&e>(n[O].coordinate+n[O-1].coordinate)/2&&e<=(n[O].coordinate+n[O+1].coordinate)/2||O===s-1&&e>(n[O].coordinate+n[O-1].coordinate)/2){o=n[O].index;break}return o},If=function(e){var r,n=e,i=n.type.displayName,a=(r=e.type)!==null&&r!==void 0&&r.defaultProps?qe(qe({},e.type.defaultProps),e.props):e.props,o=a.stroke,s=a.fill,u;switch(i){case"Line":u=o;break;case"Area":case"Radar":u=o&&o!=="none"?o:s;break;default:u=s;break}return u},CW=function(e){var r=e.barSize,n=e.totalSize,i=e.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var o={},s=Object.keys(a),u=0,l=s.length;u<l;u++)for(var c=a[s[u]].stackGroups,f=Object.keys(c),d=0,h=f.length;d<h;d++){var y=c[f[d]],v=y.items,p=y.cateAxisId,m=v.filter(function(S){return fr(S.type).indexOf("Bar")>=0});if(m&&m.length){var b=m[0].type.defaultProps,w=b!==void 0?qe(qe({},b),m[0].props):m[0].props,O=w.barSize,g=w[p];o[g]||(o[g]=[]);var _=fe(O)?r:O;o[g].push({item:m[0],stackList:m.slice(1),barSize:fe(_)?void 0:dt(_,n,0)})}}return o},IW=function(e){var r=e.barGap,n=e.barCategoryGap,i=e.bandSize,a=e.sizeList,o=a===void 0?[]:a,s=e.maxBarSize,u=o.length;if(u<1)return null;var l=dt(r,i,0,!0),c,f=[];if(o[0].barSize===+o[0].barSize){var d=!1,h=i/u,y=o.reduce(function(O,g){return O+g.barSize||0},0);y+=(u-1)*l,y>=i&&(y-=(u-1)*l,l=0),y>=i&&h>0&&(d=!0,h*=.9,y=u*h);var v=(i-y)/2>>0,p={offset:v-l,size:0};c=o.reduce(function(O,g){var _={item:g.item,position:{offset:p.offset+p.size+l,size:d?h:g.barSize}},S=[].concat($b(O),[_]);return p=S[S.length-1].position,g.stackList&&g.stackList.length&&g.stackList.forEach(function(A){S.push({item:A,position:p})}),S},f)}else{var m=dt(n,i,0,!0);i-2*m-(u-1)*l<=0&&(l=0);var b=(i-2*m-(u-1)*l)/u;b>1&&(b>>=0);var w=s===+s?Math.min(b,s):b;c=o.reduce(function(O,g,_){var S=[].concat($b(O),[{item:g.item,position:{offset:m+(b+l)*_+(b-w)/2,size:w}}]);return g.stackList&&g.stackList.length&&g.stackList.forEach(function(A){S.push({item:A,position:S[S.length-1].position})}),S},f)}return c},NW=function(e,r,n,i){var a=n.children,o=n.width,s=n.margin,u=o-(s.left||0)-(s.right||0),l=jb({children:a,legendWidth:u});if(l){var c=i||{},f=c.width,d=c.height,h=l.align,y=l.verticalAlign,v=l.layout;if((v==="vertical"||v==="horizontal"&&y==="middle")&&h!=="center"&&V(e[h]))return qe(qe({},e),{},gi({},h,e[h]+(f||0)));if((v==="horizontal"||v==="vertical"&&h==="center")&&y!=="middle"&&V(e[y]))return qe(qe({},e),{},gi({},y,e[y]+(d||0)))}return e},MW=function(e,r,n){return fe(r)?!0:e==="horizontal"?r==="yAxis":e==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},Cb=function(e,r,n,i,a){var o=r.props.children,s=Ot(o,Ba).filter(function(l){return MW(i,a,l.props.direction)});if(s&&s.length){var u=s.map(function(l){return l.props.dataKey});return e.reduce(function(l,c){var f=We(c,n);if(fe(f))return l;var d=Array.isArray(f)?[qs(f),Dr(f)]:[f,f],h=u.reduce(function(y,v){var p=We(c,v,0),m=d[0]-Math.abs(Array.isArray(p)?p[0]:p),b=d[1]+Math.abs(Array.isArray(p)?p[1]:p);return[Math.min(m,y[0]),Math.max(b,y[1])]},[1/0,-1/0]);return[Math.min(h[0],l[0]),Math.max(h[1],l[1])]},[1/0,-1/0])}return null},DW=function(e,r,n,i,a){var o=r.map(function(s){return Cb(e,s,n,a,i)}).filter(function(s){return!fe(s)});return o&&o.length?o.reduce(function(s,u){return[Math.min(s[0],u[0]),Math.max(s[1],u[1])]},[1/0,-1/0]):null},Ib=function(e,r,n,i,a){var o=r.map(function(u){var l=u.props.dataKey;return n==="number"&&l&&Cb(e,u,l,i)||Wa(e,l,n,a)});if(n==="number")return o.reduce(function(u,l){return[Math.min(u[0],l[0]),Math.max(u[1],l[1])]},[1/0,-1/0]);var s={};return o.reduce(function(u,l){for(var c=0,f=l.length;c<f;c++)s[l[c]]||(s[l[c]]=!0,u.push(l[c]));return u},[])},Nb=function(e,r){return e==="horizontal"&&r==="xAxis"||e==="vertical"&&r==="yAxis"||e==="centric"&&r==="angleAxis"||e==="radial"&&r==="radiusAxis"},Mb=function(e,r,n,i){if(i)return e.map(function(u){return u.coordinate});var a,o,s=e.map(function(u){return u.coordinate===r&&(a=!0),u.coordinate===n&&(o=!0),u.coordinate});return a||s.push(r),o||s.push(n),s},wr=function(e,r,n){if(!e)return null;var i=e.scale,a=e.duplicateDomain,o=e.type,s=e.range,u=e.realScaleType==="scaleBand"?i.bandwidth()/2:2,l=(r||n)&&o==="category"&&i.bandwidth?i.bandwidth()/u:0;if(l=e.axisType==="angleAxis"&&(s==null?void 0:s.length)>=2?ft(s[0]-s[1])*2*l:l,r&&(e.ticks||e.niceTicks)){var c=(e.ticks||e.niceTicks).map(function(f){var d=a?a.indexOf(f):f;return{coordinate:i(d)+l,value:f,offset:l}});return c.filter(function(f){return!Xn(f.coordinate)})}return e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(f,d){return{coordinate:i(f)+l,value:f,index:d,offset:l}}):i.ticks&&!n?i.ticks(e.tickCount).map(function(f){return{coordinate:i(f)+l,value:f,offset:l}}):i.domain().map(function(f,d){return{coordinate:i(f)+l,value:a?a[f]:f,index:d,offset:l}})},Nf=new WeakMap,Ys=function(e,r){if(typeof r!="function")return e;Nf.has(e)||Nf.set(e,new WeakMap);var n=Nf.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},Db=function(e,r,n){var i=e.scale,a=e.type,o=e.layout,s=e.axisType;if(i==="auto")return o==="radial"&&s==="radiusAxis"?{scale:Aa(),realScaleType:"band"}:o==="radial"&&s==="angleAxis"?{scale:Is(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Pa(),realScaleType:"point"}:a==="category"?{scale:Aa(),realScaleType:"band"}:{scale:Is(),realScaleType:"linear"};if(rn(i)){var u="scale".concat(Jo(i));return{scale:(ob[u]||Pa)(),realScaleType:ob[u]?u:"point"}}return ae(i)?{scale:i}:{scale:Pa(),realScaleType:"point"}},Rb=1e-4,Lb=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])-Rb,o=Math.max(i[0],i[1])+Rb,s=e(r[0]),u=e(r[n-1]);(s<a||s>o||u<a||u>o)&&e.domain([r[0],r[n-1]])}},RW=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},LW=function(e,r){if(!r||r.length!==2||!V(r[0])||!V(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(!V(e[0])||e[0]<n)&&(a[0]=n),(!V(e[1])||e[1]>i)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]<n&&(a[1]=n),a},BW=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,s=0;s<r;++s){var u=Xn(e[s][n][1])?e[s][n][0]:e[s][n][1];u>=0?(e[s][n][0]=a,e[s][n][1]=a+u,a=e[s][n][1]):(e[s][n][0]=o,e[s][n][1]=o+u,o=e[s][n][1])}},UW=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 s=Xn(e[o][n][1])?e[o][n][0]:e[o][n][1];s>=0?(e[o][n][0]=a,e[o][n][1]=a+s,a=e[o][n][1]):(e[o][n][0]=0,e[o][n][1]=0)}},FW={sign:BW,expand:o$,none:Zn,silhouette:s$,wiggle:u$,positive:UW},WW=function(e,r,n){var i=r.map(function(s){return s.props.dataKey}),a=FW[n],o=a$().keys(i).value(function(s,u){return+We(s,u,0)}).order(oc).offset(a);return o(e)},qW=function(e,r,n,i,a,o){if(!e)return null;var s=o?r.reverse():r,u={},l=s.reduce(function(f,d){var h,y=(h=d.type)!==null&&h!==void 0&&h.defaultProps?qe(qe({},d.type.defaultProps),d.props):d.props,v=y.stackId,p=y.hide;if(p)return f;var m=y[n],b=f[m]||{hasStack:!1,stackGroups:{}};if(Je(v)){var w=b.stackGroups[v]||{numericAxisId:n,cateAxisId:i,items:[]};w.items.push(d),b.hasStack=!0,b.stackGroups[v]=w}else b.stackGroups[an("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[d]};return qe(qe({},f),{},gi({},m,b))},u),c={};return Object.keys(l).reduce(function(f,d){var h=l[d];if(h.hasStack){var y={};h.stackGroups=Object.keys(h.stackGroups).reduce(function(v,p){var m=h.stackGroups[p];return qe(qe({},v),{},gi({},p,{numericAxisId:n,cateAxisId:i,items:m.items,stackedData:WW(e,m.items,a)}))},y)}return qe(qe({},f),{},gi({},d,h))},c)},Bb=function(e,r){var n=r.realScaleType,i=r.type,a=r.tickCount,o=r.originalDomain,s=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 l=e.domain();if(!l.length)return null;var c=nW(l,a,s);return e.domain([qs(c),Dr(c)]),{niceTicks:c}}if(a&&i==="number"){var f=e.domain(),d=iW(f,a,s);return{niceTicks:d}}return null};function Xs(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&&!fe(i[e.dataKey])){var s=Yo(r,"value",i[e.dataKey]);if(s)return s.coordinate+n/2}return r[a]?r[a].coordinate+n/2:null}var u=We(i,fe(o)?e.dataKey:o);return fe(u)?null:e.scale(u)}var Ub=function(e){var r=e.axis,n=e.ticks,i=e.offset,a=e.bandSize,o=e.entry,s=e.index;if(r.type==="category")return n[s]?n[s].coordinate+i:null;var u=We(o,r.dataKey,r.domain[s]);return fe(u)?null:r.scale(u)-a/2+i},zW=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]},KW=function(e,r){var n,i=(n=e.type)!==null&&n!==void 0&&n.defaultProps?qe(qe({},e.type.defaultProps),e.props):e.props,a=i.stackId;if(Je(a)){var o=r[a];if(o){var s=o.items.indexOf(e);return s>=0?o.stackedData[s]:null}}return null},VW=function(e){return e.reduce(function(r,n){return[qs(n.concat([r[0]]).filter(V)),Dr(n.concat([r[1]]).filter(V))]},[1/0,-1/0])},Fb=function(e,r,n){return Object.keys(e).reduce(function(i,a){var o=e[a],s=o.stackedData,u=s.reduce(function(l,c){var f=VW(c.slice(r,n+1));return[Math.min(l[0],f[0]),Math.max(l[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})},Wb=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,qb=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Mf=function(e,r,n){if(ae(e))return e(r,n);if(!Array.isArray(e))return r;var i=[];if(V(e[0]))i[0]=n?e[0]:Math.min(e[0],r[0]);else if(Wb.test(e[0])){var a=+Wb.exec(e[0])[1];i[0]=r[0]-a}else ae(e[0])?i[0]=e[0](r[0]):i[0]=r[0];if(V(e[1]))i[1]=n?e[1]:Math.max(e[1],r[1]);else if(qb.test(e[1])){var o=+qb.exec(e[1])[1];i[1]=r[1]+o}else ae(e[1])?i[1]=e[1](r[1]):i[1]=r[1];return i},Js=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=Tc(r,function(f){return f.coordinate}),o=1/0,s=1,u=a.length;s<u;s++){var l=a[s],c=a[s-1];o=Math.min((l.coordinate||0)-(c.coordinate||0),o)}return o===1/0?0:o}return n?void 0:0},zb=function(e,r,n){return!e||!e.length||Rr(e,xt(n,"type.defaultProps.domain"))?r:e},Kb=function(e,r){var n=e.type.defaultProps?qe(qe({},e.type.defaultProps),e.props):e.props,i=n.dataKey,a=n.name,o=n.unit,s=n.formatter,u=n.tooltipType,l=n.chartType,c=n.hide;return qe(qe({},Q(e,!1)),{},{dataKey:i,unit:o,formatter:s,name:a||i,color:If(e),value:We(r,i),type:u,payload:r,chartType:l,hide:c})};function qa(t){"@babel/helpers - typeof";return qa=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},qa(t)}function Vb(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 _r(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Vb(Object(r),!0).forEach(function(n){Hb(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Vb(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Hb(t,e,r){return e=HW(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function HW(t){var e=GW(t,"string");return qa(e)=="symbol"?e:e+""}function GW(t,e){if(qa(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(qa(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function YW(t,e){return QW(t)||ZW(t,e)||JW(t,e)||XW()}function XW(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
102
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
103
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
65
|
+
height and width.`,D,N,o,l,c,f,r);var L=!Array.isArray(h)&&Yt(h.type).endsWith("Chart");return x.Children.map(h,function(W){return x.isValidElement(W)?x.cloneElement(W,Yo({width:D,height:N},L?{style:Yo({height:"100%",width:"100%",maxHeight:N,maxWidth:D},W.props.style)}:{})):W})},[r,h,l,d,f,c,E,o]);return x.createElement("div",{id:p?"".concat(p):void 0,className:ie("recharts-responsive-container",m),style:Yo(Yo({},O),{},{width:o,height:l,minWidth:c,minHeight:f,maxHeight:d}),ref:g},$)}),Xo=function(e){return null};Xo.displayName="Cell";function Qi(t){"@babel/helpers - typeof";return Qi=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},Qi(t)}function eg(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 dc(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?eg(Object(r),!0).forEach(function(n){g2(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):eg(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function g2(t,e,r){return e=m2(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function m2(t){var e=b2(t,"string");return Qi(e)=="symbol"?e:e+""}function b2(t,e){if(Qi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Qi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var zn={widthCache:{},cacheCount:0},w2=2e3,_2={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},tg="recharts_measurement_span";function x2(t){var e=dc({},t);return Object.keys(e).forEach(function(r){e[r]||delete e[r]}),e}var ea=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||wt.isSsr)return{width:0,height:0};var n=x2(r),i=JSON.stringify({text:e,copyStyle:n});if(zn.widthCache[i])return zn.widthCache[i];try{var a=document.getElementById(tg);a||(a=document.createElement("span"),a.setAttribute("id",tg),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=dc(dc({},_2),n);Object.assign(a.style,o),a.textContent="".concat(e);var s=a.getBoundingClientRect(),l={width:s.width,height:s.height};return zn.widthCache[i]=l,++zn.cacheCount>w2&&(zn.cacheCount=0,zn.widthCache={}),l}catch{return{width:0,height:0}}},O2=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function ta(t){"@babel/helpers - typeof";return ta=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},ta(t)}function Jo(t,e){return E2(t)||P2(t,e)||A2(t,e)||S2()}function S2(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
66
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function A2(t,e){if(t){if(typeof t=="string")return rg(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 rg(t,e)}}function rg(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 P2(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,s=[],l=!0,u=!1;try{if(a=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}function E2(t){if(Array.isArray(t))return t}function T2(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ng(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,j2(n.key),n)}}function $2(t,e,r){return e&&ng(t.prototype,e),r&&ng(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function j2(t){var e=k2(t,"string");return ta(e)=="symbol"?e:e+""}function k2(t,e){if(ta(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ta(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var ig=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,ag=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,C2=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,I2=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,og={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},N2=Object.keys(og),Kn="NaN";function M2(t,e){return t*og[e]}var Zo=function(){function t(e,r){T2(this,t),this.num=e,this.unit=r,this.num=e,this.unit=r,Number.isNaN(e)&&(this.unit=""),r!==""&&!C2.test(r)&&(this.num=NaN,this.unit=""),N2.includes(r)&&(this.num=M2(e,r),this.unit="px")}return $2(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=I2.exec(r))!==null&&n!==void 0?n:[],a=Jo(i,3),o=a[1],s=a[2];return new t(parseFloat(o),s??"")}}])}();function sg(t){if(t.includes(Kn))return Kn;for(var e=t;e.includes("*")||e.includes("/");){var r,n=(r=ig.exec(e))!==null&&r!==void 0?r:[],i=Jo(n,4),a=i[1],o=i[2],s=i[3],l=Zo.parse(a??""),u=Zo.parse(s??""),c=o==="*"?l.multiply(u):l.divide(u);if(c.isNaN())return Kn;e=e.replace(ig,c.toString())}for(;e.includes("+")||/.-\d+(?:\.\d+)?/.test(e);){var f,d=(f=ag.exec(e))!==null&&f!==void 0?f:[],h=Jo(d,4),y=h[1],v=h[2],p=h[3],m=Zo.parse(y??""),w=Zo.parse(p??""),b=v==="+"?m.add(w):m.subtract(w);if(b.isNaN())return Kn;e=e.replace(ag,b.toString())}return e}var lg=/\(([^()]*)\)/;function D2(t){for(var e=t;e.includes("(");){var r=lg.exec(e),n=Jo(r,2),i=n[1];e=e.replace(lg,sg(i))}return e}function L2(t){var e=t.replace(/\s+/g,"");return e=D2(e),e=sg(e),e}function B2(t){try{return L2(t)}catch{return Kn}}function hc(t){var e=B2(t.slice(5,-1));return e===Kn?"":e}var R2=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],U2=["dx","dy","angle","className","breakAll"];function pc(){return pc=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},pc.apply(this,arguments)}function ug(t,e){if(t==null)return{};var r=F2(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 F2(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 cg(t,e){return K2(t)||z2(t,e)||q2(t,e)||W2()}function W2(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
67
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function q2(t,e){if(t){if(typeof t=="string")return fg(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 fg(t,e)}}function fg(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 z2(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,s=[],l=!0,u=!1;try{if(a=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}function K2(t){if(Array.isArray(t))return t}var dg=/[ \f\n\r\t\v\u2028\u2029]+/,hg=function(e){var r=e.children,n=e.breakAll,i=e.style;try{var a=[];se(r)||(n?a=r.toString().split(""):a=r.toString().split(dg));var o=a.map(function(l){return{word:l,width:ea(l,i).width}}),s=n?0:ea(" ",i).width;return{wordsWithComputedWidth:o,spaceWidth:s}}catch{return null}},V2=function(e,r,n,i,a){var o=e.maxLines,s=e.children,l=e.style,u=e.breakAll,c=z(o),f=s,d=function(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return D.reduce(function(N,L){var W=L.word,q=L.width,M=N[N.length-1];if(M&&(i==null||a||M.width+q+n<Number(i)))M.words.push(W),M.width+=q+n;else{var R={words:[W],width:q};N.push(R)}return N},[])},h=d(r),y=function(D){return D.reduce(function(N,L){return N.width>L.width?N:L})};if(!c)return h;for(var v="…",p=function(D){var N=f.slice(0,D),L=hg({breakAll:u,style:l,children:N+v}).wordsWithComputedWidth,W=d(L),q=W.length>o||y(W).width>Number(i);return[q,W]},m=0,w=f.length-1,b=0,O;m<=w&&b<=f.length-1;){var g=Math.floor((m+w)/2),_=g-1,S=p(_),A=cg(S,2),E=A[0],I=A[1],T=p(g),$=cg(T,1),k=$[0];if(!E&&!k&&(m=g+1),E&&k&&(w=g-1),!E&&k){O=I;break}b++}return O||h},pg=function(e){var r=se(e)?[]:e.toString().split(dg);return[{words:r}]},H2=function(e){var r=e.width,n=e.scaleToFit,i=e.children,a=e.style,o=e.breakAll,s=e.maxLines;if((r||n)&&!wt.isSsr){var l,u,c=hg({breakAll:o,children:i,style:a});if(c){var f=c.wordsWithComputedWidth,d=c.spaceWidth;l=f,u=d}else return pg(i);return V2({breakAll:o,children:i,maxLines:s,style:a},l,u,r,n)}return pg(i)},vg="#808080",Hr=function(e){var r=e.x,n=r===void 0?0:r,i=e.y,a=i===void 0?0:i,o=e.lineHeight,s=o===void 0?"1em":o,l=e.capHeight,u=l===void 0?"0.71em":l,c=e.scaleToFit,f=c===void 0?!1:c,d=e.textAnchor,h=d===void 0?"start":d,y=e.verticalAnchor,v=y===void 0?"end":y,p=e.fill,m=p===void 0?vg:p,w=ug(e,R2),b=x.useMemo(function(){return H2({breakAll:w.breakAll,children:w.children,maxLines:w.maxLines,scaleToFit:f,style:w.style,width:w.width})},[w.breakAll,w.children,w.maxLines,f,w.style,w.width]),O=w.dx,g=w.dy,_=w.angle,S=w.className,A=w.breakAll,E=ug(w,U2);if(!Ue(n)||!Ue(a))return null;var I=n+(z(O)?O:0),T=a+(z(g)?g:0),$;switch(v){case"start":$=hc("calc(".concat(u,")"));break;case"middle":$=hc("calc(".concat((b.length-1)/2," * -").concat(s," + (").concat(u," / 2))"));break;default:$=hc("calc(".concat(b.length-1," * -").concat(s,")"));break}var k=[];if(f){var C=b[0].width,D=w.width;k.push("scale(".concat((z(D)?D/C:1)/C,")"))}return _&&k.push("rotate(".concat(_,", ").concat(I,", ").concat(T,")")),k.length&&(E.transform=k.join(" ")),x.createElement("text",pc({},X(E,!0),{x:I,y:T,className:ie("recharts-text",S),textAnchor:h,fill:m.includes("url")?vg:m}),b.map(function(N,L){var W=N.words.join(A?"":" ");return x.createElement("tspan",{x:I,dy:L===0?$:s,key:"".concat(W,"-").concat(L)},W)}))};function mr(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function G2(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function vc(t){let e,r,n;t.length!==2?(e=mr,r=(s,l)=>mr(t(s),l),n=(s,l)=>t(s)-l):(e=t===mr||t===G2?t:Y2,r=t,n=t);function i(s,l,u=0,c=s.length){if(u<c){if(e(l,l)!==0)return c;do{const f=u+c>>>1;r(s[f],l)<0?u=f+1:c=f}while(u<c)}return u}function a(s,l,u=0,c=s.length){if(u<c){if(e(l,l)!==0)return c;do{const f=u+c>>>1;r(s[f],l)<=0?u=f+1:c=f}while(u<c)}return u}function o(s,l,u=0,c=s.length){const f=i(s,l,u,c-1);return f>u&&n(s[f-1],l)>-n(s[f],l)?f-1:f}return{left:i,center:o,right:a}}function Y2(){return 0}function yg(t){return t===null?NaN:+t}function*X2(t,e){for(let r of t)r!=null&&(r=+r)>=r&&(yield r)}const ra=vc(mr).right;vc(yg).center;class gg extends Map{constructor(e,r=Q2){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(mg(this,e))}has(e){return super.has(mg(this,e))}set(e,r){return super.set(J2(this,e),r)}delete(e){return super.delete(Z2(this,e))}}function mg({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function J2({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function Z2({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function Q2(t){return t!==null&&typeof t=="object"?t.valueOf():t}function eB(t=mr){if(t===mr)return bg;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 bg(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(t<e?-1:t>e?1:0)}const tB=Math.sqrt(50),rB=Math.sqrt(10),nB=Math.sqrt(2);function Qo(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>=tB?10:a>=rB?5:a>=nB?2:1;let s,l,u;return i<0?(u=Math.pow(10,-i)/o,s=Math.round(t*u),l=Math.round(e*u),s/u<t&&++s,l/u>e&&--l,u=-u):(u=Math.pow(10,i)*o,s=Math.round(t/u),l=Math.round(e/u),s*u<t&&++s,l*u>e&&--l),l<s&&.5<=r&&r<2?Qo(t,e,r*2):[s,l,u]}function yc(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?Qo(e,t,r):Qo(t,e,r);if(!(a>=i))return[];const s=a-i+1,l=new Array(s);if(n)if(o<0)for(let u=0;u<s;++u)l[u]=(a-u)/-o;else for(let u=0;u<s;++u)l[u]=(a-u)*o;else if(o<0)for(let u=0;u<s;++u)l[u]=(i+u)/-o;else for(let u=0;u<s;++u)l[u]=(i+u)*o;return l}function gc(t,e,r){return e=+e,t=+t,r=+r,Qo(t,e,r)[2]}function mc(t,e,r){e=+e,t=+t,r=+r;const n=e<t,i=n?gc(e,t,r):gc(t,e,r);return(n?-1:1)*(i<0?1/-i:i)}function wg(t,e){let r;for(const n of t)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function _g(t,e){let r;for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function xg(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?bg:eB(i);n>r;){if(n-r>600){const l=n-r+1,u=e-r+1,c=Math.log(l),f=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*f*(l-f)/l)*(u-l/2<0?-1:1),h=Math.max(r,Math.floor(e-u*f/l+d)),y=Math.min(n,Math.floor(e+(l-u)*f/l+d));xg(t,e,h,y,i)}const a=t[e];let o=r,s=n;for(na(t,r,e),i(t[n],a)>0&&na(t,r,n);o<s;){for(na(t,o,s),++o,--s;i(t[o],a)<0;)++o;for(;i(t[s],a)>0;)--s}i(t[r],a)===0?na(t,r,s):(++s,na(t,s,n)),s<=e&&(r=s+1),e<=s&&(n=s-1)}return t}function na(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function iB(t,e,r){if(t=Float64Array.from(X2(t)),!(!(n=t.length)||isNaN(e=+e))){if(e<=0||n<2)return _g(t);if(e>=1)return wg(t);var n,i=(n-1)*e,a=Math.floor(i),o=wg(xg(t,a).subarray(0,a+1)),s=_g(t.subarray(a+1));return o+(s-o)*(i-a)}}function aB(t,e,r=yg){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),s=+r(t[a+1],a+1,t);return o+(s-o)*(i-a)}}function oB(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 _t(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function Jt(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 bc=Symbol("implicit");function wc(){var t=new gg,e=[],r=[],n=bc;function i(a){let o=t.get(a);if(o===void 0){if(n!==bc)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 gg;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 wc(e,r).unknown(n)},_t.apply(i,arguments),i}function ia(){var t=wc().unknown(void 0),e=t.domain,r=t.range,n=0,i=1,a,o,s=!1,l=0,u=0,c=.5;delete t.unknown;function f(){var d=e().length,h=i<n,y=h?i:n,v=h?n:i;a=(v-y)/Math.max(1,d-l+u*2),s&&(a=Math.floor(a)),y+=(v-y-a*(d-l))*c,o=a*(1-l),s&&(y=Math.round(y),o=Math.round(o));var p=oB(d).map(function(m){return y+a*m});return r(h?p.reverse():p)}return t.domain=function(d){return arguments.length?(e(d),f()):e()},t.range=function(d){return arguments.length?([n,i]=d,n=+n,i=+i,f()):[n,i]},t.rangeRound=function(d){return[n,i]=d,n=+n,i=+i,s=!0,f()},t.bandwidth=function(){return o},t.step=function(){return a},t.round=function(d){return arguments.length?(s=!!d,f()):s},t.padding=function(d){return arguments.length?(l=Math.min(1,u=+d),f()):l},t.paddingInner=function(d){return arguments.length?(l=Math.min(1,d),f()):l},t.paddingOuter=function(d){return arguments.length?(u=+d,f()):u},t.align=function(d){return arguments.length?(c=Math.max(0,Math.min(1,d)),f()):c},t.copy=function(){return ia(e(),[n,i]).round(s).paddingInner(l).paddingOuter(u).align(c)},_t.apply(f(),arguments)}function Og(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return Og(e())},t}function aa(){return Og(ia.apply(null,arguments).paddingInner(1))}function _c(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function Sg(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function oa(){}var sa=.7,es=1/sa,Vn="\\s*([+-]?\\d+)\\s*",la="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ut="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",sB=/^#([0-9a-f]{3,8})$/,lB=new RegExp(`^rgb\\(${Vn},${Vn},${Vn}\\)$`),uB=new RegExp(`^rgb\\(${Ut},${Ut},${Ut}\\)$`),cB=new RegExp(`^rgba\\(${Vn},${Vn},${Vn},${la}\\)$`),fB=new RegExp(`^rgba\\(${Ut},${Ut},${Ut},${la}\\)$`),dB=new RegExp(`^hsl\\(${la},${Ut},${Ut}\\)$`),hB=new RegExp(`^hsla\\(${la},${Ut},${Ut},${la}\\)$`),Ag={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};_c(oa,ua,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Pg,formatHex:Pg,formatHex8:pB,formatHsl:vB,formatRgb:Eg,toString:Eg});function Pg(){return this.rgb().formatHex()}function pB(){return this.rgb().formatHex8()}function vB(){return Cg(this).formatHsl()}function Eg(){return this.rgb().formatRgb()}function ua(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=sB.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?Tg(e):r===3?new ot(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?ts(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?ts(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=lB.exec(t))?new ot(e[1],e[2],e[3],1):(e=uB.exec(t))?new ot(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=cB.exec(t))?ts(e[1],e[2],e[3],e[4]):(e=fB.exec(t))?ts(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=dB.exec(t))?kg(e[1],e[2]/100,e[3]/100,1):(e=hB.exec(t))?kg(e[1],e[2]/100,e[3]/100,e[4]):Ag.hasOwnProperty(t)?Tg(Ag[t]):t==="transparent"?new ot(NaN,NaN,NaN,0):null}function Tg(t){return new ot(t>>16&255,t>>8&255,t&255,1)}function ts(t,e,r,n){return n<=0&&(t=e=r=NaN),new ot(t,e,r,n)}function yB(t){return t instanceof oa||(t=ua(t)),t?(t=t.rgb(),new ot(t.r,t.g,t.b,t.opacity)):new ot}function xc(t,e,r,n){return arguments.length===1?yB(t):new ot(t,e,r,n??1)}function ot(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}_c(ot,xc,Sg(oa,{brighter(t){return t=t==null?es:Math.pow(es,t),new ot(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?sa:Math.pow(sa,t),new ot(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ot(Gr(this.r),Gr(this.g),Gr(this.b),rs(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:$g,formatHex:$g,formatHex8:gB,formatRgb:jg,toString:jg}));function $g(){return`#${Yr(this.r)}${Yr(this.g)}${Yr(this.b)}`}function gB(){return`#${Yr(this.r)}${Yr(this.g)}${Yr(this.b)}${Yr((isNaN(this.opacity)?1:this.opacity)*255)}`}function jg(){const t=rs(this.opacity);return`${t===1?"rgb(":"rgba("}${Gr(this.r)}, ${Gr(this.g)}, ${Gr(this.b)}${t===1?")":`, ${t})`}`}function rs(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Gr(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Yr(t){return t=Gr(t),(t<16?"0":"")+t.toString(16)}function kg(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Ct(t,e,r,n)}function Cg(t){if(t instanceof Ct)return new Ct(t.h,t.s,t.l,t.opacity);if(t instanceof oa||(t=ua(t)),!t)return new Ct;if(t instanceof Ct)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,s=a-i,l=(a+i)/2;return s?(e===a?o=(r-n)/s+(r<n)*6:r===a?o=(n-e)/s+2:o=(e-r)/s+4,s/=l<.5?a+i:2-a-i,o*=60):s=l>0&&l<1?0:o,new Ct(o,s,l,t.opacity)}function mB(t,e,r,n){return arguments.length===1?Cg(t):new Ct(t,e,r,n??1)}function Ct(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}_c(Ct,mB,Sg(oa,{brighter(t){return t=t==null?es:Math.pow(es,t),new Ct(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?sa:Math.pow(sa,t),new Ct(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 ot(Oc(t>=240?t-240:t+120,i,n),Oc(t,i,n),Oc(t<120?t+240:t-120,i,n),this.opacity)},clamp(){return new Ct(Ig(this.h),ns(this.s),ns(this.l),rs(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=rs(this.opacity);return`${t===1?"hsl(":"hsla("}${Ig(this.h)}, ${ns(this.s)*100}%, ${ns(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Ig(t){return t=(t||0)%360,t<0?t+360:t}function ns(t){return Math.max(0,Math.min(1,t||0))}function Oc(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 Sc=t=>()=>t;function bB(t,e){return function(r){return t+r*e}}function wB(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 _B(t){return(t=+t)==1?Ng:function(e,r){return r-e?wB(e,r,t):Sc(isNaN(e)?r:e)}}function Ng(t,e){var r=e-t;return r?bB(t,r):Sc(isNaN(t)?e:t)}const Mg=function t(e){var r=_B(e);function n(i,a){var o=r((i=xc(i)).r,(a=xc(a)).r),s=r(i.g,a.g),l=r(i.b,a.b),u=Ng(i.opacity,a.opacity);return function(c){return i.r=o(c),i.g=s(c),i.b=l(c),i.opacity=u(c),i+""}}return n.gamma=t,n}(1);function xB(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 OB(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function SB(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]=Hn(t[o],e[o]);for(;o<r;++o)a[o]=e[o];return function(s){for(o=0;o<n;++o)a[o]=i[o](s);return a}}function AB(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function is(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function PB(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]=Hn(t[i],e[i]):n[i]=e[i];return function(a){for(i in r)n[i]=r[i](a);return n}}var Ac=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Pc=new RegExp(Ac.source,"g");function EB(t){return function(){return t}}function TB(t){return function(e){return t(e)+""}}function $B(t,e){var r=Ac.lastIndex=Pc.lastIndex=0,n,i,a,o=-1,s=[],l=[];for(t=t+"",e=e+"";(n=Ac.exec(t))&&(i=Pc.exec(e));)(a=i.index)>r&&(a=e.slice(r,a),s[o]?s[o]+=a:s[++o]=a),(n=n[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:is(n,i)})),r=Pc.lastIndex;return r<e.length&&(a=e.slice(r),s[o]?s[o]+=a:s[++o]=a),s.length<2?l[0]?TB(l[0].x):EB(e):(e=l.length,function(u){for(var c=0,f;c<e;++c)s[(f=l[c]).i]=f.x(u);return s.join("")})}function Hn(t,e){var r=typeof e,n;return e==null||r==="boolean"?Sc(e):(r==="number"?is:r==="string"?(n=ua(e))?(e=n,Mg):$B:e instanceof ua?Mg:e instanceof Date?AB:OB(e)?xB:Array.isArray(e)?SB:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?PB:is)(t,e)}function Ec(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}function jB(t,e){e===void 0&&(e=t,t=Hn);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 s=Math.max(0,Math.min(n-1,Math.floor(o*=n)));return a[s](o-s)}}function kB(t){return function(){return t}}function as(t){return+t}var Dg=[0,1];function nt(t){return t}function Tc(t,e){return(e-=t=+t)?function(r){return(r-t)/e}:kB(isNaN(e)?NaN:.5)}function CB(t,e){var r;return t>e&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function IB(t,e,r){var n=t[0],i=t[1],a=e[0],o=e[1];return i<n?(n=Tc(i,n),a=r(o,a)):(n=Tc(n,i),a=r(a,o)),function(s){return a(n(s))}}function NB(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]=Tc(t[o],t[o+1]),a[o]=r(e[o],e[o+1]);return function(s){var l=ra(t,s,1,n)-1;return a[l](i[l](s))}}function ca(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function os(){var t=Dg,e=Dg,r=Hn,n,i,a,o=nt,s,l,u;function c(){var d=Math.min(t.length,e.length);return o!==nt&&(o=CB(t[0],t[d-1])),s=d>2?NB:IB,l=u=null,f}function f(d){return d==null||isNaN(d=+d)?a:(l||(l=s(t.map(n),e,r)))(n(o(d)))}return f.invert=function(d){return o(i((u||(u=s(e,t.map(n),is)))(d)))},f.domain=function(d){return arguments.length?(t=Array.from(d,as),c()):t.slice()},f.range=function(d){return arguments.length?(e=Array.from(d),c()):e.slice()},f.rangeRound=function(d){return e=Array.from(d),r=Ec,c()},f.clamp=function(d){return arguments.length?(o=d?!0:nt,c()):o!==nt},f.interpolate=function(d){return arguments.length?(r=d,c()):r},f.unknown=function(d){return arguments.length?(a=d,f):a},function(d,h){return n=d,i=h,c()}}function $c(){return os()(nt,nt)}function MB(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function ss(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function Gn(t){return t=ss(Math.abs(t)),t?t[1]:NaN}function DB(t,e){return function(r,n){for(var i=r.length,a=[],o=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),a.push(r.substring(i-=s,i+s)),!((l+=s+1)>n));)s=t[o=(o+1)%t.length];return a.reverse().join(e)}}function LB(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var BB=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function fa(t){if(!(e=BB.exec(t)))throw new Error("invalid format: "+t);var e;return new jc({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]})}fa.prototype=jc.prototype;function jc(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+""}jc.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 RB(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 Lg;function UB(t,e){var r=ss(t,e);if(!r)return t+"";var n=r[0],i=r[1],a=i-(Lg=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")+ss(t,Math.max(0,e+a-1))[0]}function Bg(t,e){var r=ss(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 Rg={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:MB,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)=>Bg(t*100,e),r:Bg,s:UB,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Ug(t){return t}var Fg=Array.prototype.map,Wg=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function FB(t){var e=t.grouping===void 0||t.thousands===void 0?Ug:DB(Fg.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?Ug:LB(Fg.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function u(f){f=fa(f);var d=f.fill,h=f.align,y=f.sign,v=f.symbol,p=f.zero,m=f.width,w=f.comma,b=f.precision,O=f.trim,g=f.type;g==="n"?(w=!0,g="g"):Rg[g]||(b===void 0&&(b=12),O=!0,g="g"),(p||d==="0"&&h==="=")&&(p=!0,d="0",h="=");var _=v==="$"?r:v==="#"&&/[boxX]/.test(g)?"0"+g.toLowerCase():"",S=v==="$"?n:/[%p]/.test(g)?o:"",A=Rg[g],E=/[defgprs%]/.test(g);b=b===void 0?6:/[gprs]/.test(g)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function I(T){var $=_,k=S,C,D,N;if(g==="c")k=A(T)+k,T="";else{T=+T;var L=T<0||1/T<0;if(T=isNaN(T)?l:A(Math.abs(T),b),O&&(T=RB(T)),L&&+T==0&&y!=="+"&&(L=!1),$=(L?y==="("?y:s:y==="-"||y==="("?"":y)+$,k=(g==="s"?Wg[8+Lg/3]:"")+k+(L&&y==="("?")":""),E){for(C=-1,D=T.length;++C<D;)if(N=T.charCodeAt(C),48>N||N>57){k=(N===46?i+T.slice(C+1):T.slice(C))+k,T=T.slice(0,C);break}}}w&&!p&&(T=e(T,1/0));var W=$.length+T.length+k.length,q=W<m?new Array(m-W+1).join(d):"";switch(w&&p&&(T=e(q+T,q.length?m-k.length:1/0),q=""),h){case"<":T=$+T+k+q;break;case"=":T=$+q+T+k;break;case"^":T=q.slice(0,W=q.length>>1)+$+T+k+q.slice(W);break;default:T=q+$+T+k;break}return a(T)}return I.toString=function(){return f+""},I}function c(f,d){var h=u((f=fa(f),f.type="f",f)),y=Math.max(-8,Math.min(8,Math.floor(Gn(d)/3)))*3,v=Math.pow(10,-y),p=Wg[8+y/3];return function(m){return h(v*m)+p}}return{format:u,formatPrefix:c}}var ls,kc,qg;WB({thousands:",",grouping:[3],currency:["$",""]});function WB(t){return ls=FB(t),kc=ls.format,qg=ls.formatPrefix,ls}function qB(t){return Math.max(0,-Gn(Math.abs(t)))}function zB(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Gn(e)/3)))*3-Gn(Math.abs(t)))}function KB(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Gn(e)-Gn(t))+1}function zg(t,e,r,n){var i=mc(t,e,r),a;switch(n=fa(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(a=zB(i,o))&&(n.precision=a),qg(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=KB(i,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=qB(i))&&(n.precision=a-(n.type==="%")*2);break}}return kc(n)}function br(t){var e=t.domain;return t.ticks=function(r){var n=e();return yc(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var i=e();return zg(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],s=n[a],l,u,c=10;for(s<o&&(u=o,o=s,s=u,u=i,i=a,a=u);c-- >0;){if(u=gc(o,s,r),u===l)return n[i]=o,n[a]=s,e(n);if(u>0)o=Math.floor(o/u)*u,s=Math.ceil(s/u)*u;else if(u<0)o=Math.ceil(o*u)/u,s=Math.floor(s*u)/u;else break;l=u}return t},t}function us(){var t=$c();return t.copy=function(){return ca(t,us())},_t.apply(t,arguments),br(t)}function Kg(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,as),r):t.slice()},r.unknown=function(n){return arguments.length?(e=n,r):e},r.copy=function(){return Kg(t).unknown(e)},t=arguments.length?Array.from(t,as):[0,1],br(r)}function Vg(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 Hg(t){return Math.log(t)}function Gg(t){return Math.exp(t)}function VB(t){return-Math.log(-t)}function HB(t){return-Math.exp(-t)}function GB(t){return isFinite(t)?+("1e"+t):t<0?0:t}function YB(t){return t===10?GB:t===Math.E?Math.exp:e=>Math.pow(t,e)}function XB(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 Yg(t){return(e,r)=>-t(-e,r)}function Cc(t){const e=t(Hg,Gg),r=e.domain;let n=10,i,a;function o(){return i=XB(n),a=YB(n),r()[0]<0?(i=Yg(i),a=Yg(a),t(VB,HB)):t(Hg,Gg),e}return e.base=function(s){return arguments.length?(n=+s,o()):n},e.domain=function(s){return arguments.length?(r(s),o()):r()},e.ticks=s=>{const l=r();let u=l[0],c=l[l.length-1];const f=c<u;f&&([u,c]=[c,u]);let d=i(u),h=i(c),y,v;const p=s==null?10:+s;let m=[];if(!(n%1)&&h-d<p){if(d=Math.floor(d),h=Math.ceil(h),u>0){for(;d<=h;++d)for(y=1;y<n;++y)if(v=d<0?y/a(-d):y*a(d),!(v<u)){if(v>c)break;m.push(v)}}else for(;d<=h;++d)for(y=n-1;y>=1;--y)if(v=d>0?y/a(-d):y*a(d),!(v<u)){if(v>c)break;m.push(v)}m.length*2<p&&(m=yc(u,c,p))}else m=yc(d,h,Math.min(h-d,p)).map(a);return f?m.reverse():m},e.tickFormat=(s,l)=>{if(s==null&&(s=10),l==null&&(l=n===10?"s":","),typeof l!="function"&&(!(n%1)&&(l=fa(l)).precision==null&&(l.trim=!0),l=kc(l)),s===1/0)return l;const u=Math.max(1,n*s/e.ticks().length);return c=>{let f=c/a(Math.round(i(c)));return f*n<n-.5&&(f*=n),f<=u?l(c):""}},e.nice=()=>r(Vg(r(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),e}function Xg(){const t=Cc(os()).domain([1,10]);return t.copy=()=>ca(t,Xg()).base(t.base()),_t.apply(t,arguments),t}function Jg(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function Zg(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function Ic(t){var e=1,r=t(Jg(e),Zg(e));return r.constant=function(n){return arguments.length?t(Jg(e=+n),Zg(e)):e},br(r)}function Qg(){var t=Ic(os());return t.copy=function(){return ca(t,Qg()).constant(t.constant())},_t.apply(t,arguments)}function em(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function JB(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function ZB(t){return t<0?-t*t:t*t}function Nc(t){var e=t(nt,nt),r=1;function n(){return r===1?t(nt,nt):r===.5?t(JB,ZB):t(em(r),em(1/r))}return e.exponent=function(i){return arguments.length?(r=+i,n()):r},br(e)}function Mc(){var t=Nc(os());return t.copy=function(){return ca(t,Mc()).exponent(t.exponent())},_t.apply(t,arguments),t}function QB(){return Mc.apply(null,arguments).exponent(.5)}function tm(t){return Math.sign(t)*t*t}function eR(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function rm(){var t=$c(),e=[0,1],r=!1,n;function i(a){var o=eR(t(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return t.invert(tm(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,as)).map(tm)),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 rm(t.domain(),e).round(r).clamp(t.clamp()).unknown(n)},_t.apply(i,arguments),br(i)}function nm(){var t=[],e=[],r=[],n;function i(){var o=0,s=Math.max(1,e.length);for(r=new Array(s-1);++o<s;)r[o-1]=aB(t,o/s);return a}function a(o){return o==null||isNaN(o=+o)?n:e[ra(r,o)]}return a.invertExtent=function(o){var s=e.indexOf(o);return s<0?[NaN,NaN]:[s>0?r[s-1]:t[0],s<r.length?r[s]:t[t.length-1]]},a.domain=function(o){if(!arguments.length)return t.slice();t=[];for(let s of o)s!=null&&!isNaN(s=+s)&&t.push(s);return t.sort(mr),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 nm().domain(t).range(e).unknown(n)},_t.apply(a,arguments)}function im(){var t=0,e=1,r=1,n=[.5],i=[0,1],a;function o(l){return l!=null&&l<=l?i[ra(n,l,0,r)]:a}function s(){var l=-1;for(n=new Array(r);++l<r;)n[l]=((l+1)*e-(l-r)*t)/(r+1);return o}return o.domain=function(l){return arguments.length?([t,e]=l,t=+t,e=+e,s()):[t,e]},o.range=function(l){return arguments.length?(r=(i=Array.from(l)).length-1,s()):i.slice()},o.invertExtent=function(l){var u=i.indexOf(l);return u<0?[NaN,NaN]:u<1?[t,n[0]]:u>=r?[n[r-1],e]:[n[u-1],n[u]]},o.unknown=function(l){return arguments.length&&(a=l),o},o.thresholds=function(){return n.slice()},o.copy=function(){return im().domain([t,e]).range(i).unknown(a)},_t.apply(br(o),arguments)}function am(){var t=[.5],e=[0,1],r,n=1;function i(a){return a!=null&&a<=a?e[ra(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 am().domain(t).range(e).unknown(r)},_t.apply(i,arguments)}const Dc=new Date,Lc=new Date;function Fe(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),s=i.ceil(a);return a-o<s-a?o:s},i.offset=(a,o)=>(e(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,s)=>{const l=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a<o)||!(s>0))return l;let u;do l.push(u=new Date(+a)),e(a,s),t(a);while(u<a&&a<o);return l},i.filter=a=>Fe(o=>{if(o>=o)for(;t(o),!a(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;e(o,-1),!a(o););else for(;--s>=0;)for(;e(o,1),!a(o););}),r&&(i.count=(a,o)=>(Dc.setTime(+a),Lc.setTime(+o),t(Dc),t(Lc),Math.floor(r(Dc,Lc))),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 cs=Fe(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);cs.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Fe(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):cs),cs.range;const Zt=1e3,xt=Zt*60,Qt=xt*60,er=Qt*24,Bc=er*7,om=er*30,Rc=er*365,Xr=Fe(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Zt)},(t,e)=>(e-t)/Zt,t=>t.getUTCSeconds());Xr.range;const Uc=Fe(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Zt)},(t,e)=>{t.setTime(+t+e*xt)},(t,e)=>(e-t)/xt,t=>t.getMinutes());Uc.range;const Fc=Fe(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*xt)},(t,e)=>(e-t)/xt,t=>t.getUTCMinutes());Fc.range;const Wc=Fe(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Zt-t.getMinutes()*xt)},(t,e)=>{t.setTime(+t+e*Qt)},(t,e)=>(e-t)/Qt,t=>t.getHours());Wc.range;const qc=Fe(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Qt)},(t,e)=>(e-t)/Qt,t=>t.getUTCHours());qc.range;const da=Fe(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*xt)/er,t=>t.getDate()-1);da.range;const fs=Fe(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/er,t=>t.getUTCDate()-1);fs.range;const sm=Fe(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/er,t=>Math.floor(t/er));sm.range;function Jr(t){return Fe(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())*xt)/Bc)}const ds=Jr(0),hs=Jr(1),tR=Jr(2),rR=Jr(3),Yn=Jr(4),nR=Jr(5),iR=Jr(6);ds.range,hs.range,tR.range,rR.range,Yn.range,nR.range,iR.range;function Zr(t){return Fe(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)/Bc)}const ps=Zr(0),vs=Zr(1),aR=Zr(2),oR=Zr(3),Xn=Zr(4),sR=Zr(5),lR=Zr(6);ps.range,vs.range,aR.range,oR.range,Xn.range,sR.range,lR.range;const zc=Fe(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());zc.range;const Kc=Fe(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());Kc.range;const tr=Fe(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());tr.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Fe(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)}),tr.range;const rr=Fe(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());rr.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Fe(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)}),rr.range;function lm(t,e,r,n,i,a){const o=[[Xr,1,Zt],[Xr,5,5*Zt],[Xr,15,15*Zt],[Xr,30,30*Zt],[a,1,xt],[a,5,5*xt],[a,15,15*xt],[a,30,30*xt],[i,1,Qt],[i,3,3*Qt],[i,6,6*Qt],[i,12,12*Qt],[n,1,er],[n,2,2*er],[r,1,Bc],[e,1,om],[e,3,3*om],[t,1,Rc]];function s(u,c,f){const d=c<u;d&&([u,c]=[c,u]);const h=f&&typeof f.range=="function"?f:l(u,c,f),y=h?h.range(u,+c+1):[];return d?y.reverse():y}function l(u,c,f){const d=Math.abs(c-u)/f,h=vc(([,,p])=>p).right(o,d);if(h===o.length)return t.every(mc(u/Rc,c/Rc,f));if(h===0)return cs.every(Math.max(mc(u,c,f),1));const[y,v]=o[d/o[h-1][2]<o[h][2]/d?h-1:h];return y.every(v)}return[s,l]}const[uR,cR]=lm(rr,Kc,ps,sm,qc,Fc),[fR,dR]=lm(tr,zc,ds,da,Wc,Uc);function Vc(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 Hc(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 ha(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function hR(t){var e=t.dateTime,r=t.date,n=t.time,i=t.periods,a=t.days,o=t.shortDays,s=t.months,l=t.shortMonths,u=pa(i),c=va(i),f=pa(a),d=va(a),h=pa(o),y=va(o),v=pa(s),p=va(s),m=pa(l),w=va(l),b={a:L,A:W,b:q,B:M,c:null,d:pm,e:pm,f:DR,g:VR,G:GR,H:IR,I:NR,j:MR,L:vm,m:LR,M:BR,p:R,q:U,Q:_m,s:xm,S:RR,u:UR,U:FR,V:WR,w:qR,W:zR,x:null,X:null,y:KR,Y:HR,Z:YR,"%":wm},O={a:V,A:G,b:ee,B:re,c:null,d:gm,e:gm,f:QR,g:uU,G:fU,H:XR,I:JR,j:ZR,L:mm,m:eU,M:tU,p:le,q:ae,Q:_m,s:xm,S:rU,u:nU,U:iU,V:aU,w:oU,W:sU,x:null,X:null,y:lU,Y:cU,Z:dU,"%":wm},g={a:I,A:T,b:$,B:k,c:C,d:dm,e:dm,f:$R,g:fm,G:cm,H:hm,I:hm,j:AR,L:TR,m:SR,M:PR,p:E,q:OR,Q:kR,s:CR,S:ER,u:mR,U:bR,V:wR,w:gR,W:_R,x:D,X:N,y:fm,Y:cm,Z:xR,"%":jR};b.x=_(r,b),b.X=_(n,b),b.c=_(e,b),O.x=_(r,O),O.X=_(n,O),O.c=_(e,O);function _(F,H){return function(Q){var j=[],de=-1,K=0,Pe=F.length,ke,Ye,jr;for(Q instanceof Date||(Q=new Date(+Q));++de<Pe;)F.charCodeAt(de)===37&&(j.push(F.slice(K,de)),(Ye=um[ke=F.charAt(++de)])!=null?ke=F.charAt(++de):Ye=ke==="e"?" ":"0",(jr=H[ke])&&(ke=jr(Q,Ye)),j.push(ke),K=de+1);return j.push(F.slice(K,de)),j.join("")}}function S(F,H){return function(Q){var j=ha(1900,void 0,1),de=A(j,F,Q+="",0),K,Pe;if(de!=Q.length)return null;if("Q"in j)return new Date(j.Q);if("s"in j)return new Date(j.s*1e3+("L"in j?j.L:0));if(H&&!("Z"in j)&&(j.Z=0),"p"in j&&(j.H=j.H%12+j.p*12),j.m===void 0&&(j.m="q"in j?j.q:0),"V"in j){if(j.V<1||j.V>53)return null;"w"in j||(j.w=1),"Z"in j?(K=Hc(ha(j.y,0,1)),Pe=K.getUTCDay(),K=Pe>4||Pe===0?vs.ceil(K):vs(K),K=fs.offset(K,(j.V-1)*7),j.y=K.getUTCFullYear(),j.m=K.getUTCMonth(),j.d=K.getUTCDate()+(j.w+6)%7):(K=Vc(ha(j.y,0,1)),Pe=K.getDay(),K=Pe>4||Pe===0?hs.ceil(K):hs(K),K=da.offset(K,(j.V-1)*7),j.y=K.getFullYear(),j.m=K.getMonth(),j.d=K.getDate()+(j.w+6)%7)}else("W"in j||"U"in j)&&("w"in j||(j.w="u"in j?j.u%7:"W"in j?1:0),Pe="Z"in j?Hc(ha(j.y,0,1)).getUTCDay():Vc(ha(j.y,0,1)).getDay(),j.m=0,j.d="W"in j?(j.w+6)%7+j.W*7-(Pe+5)%7:j.w+j.U*7-(Pe+6)%7);return"Z"in j?(j.H+=j.Z/100|0,j.M+=j.Z%100,Hc(j)):Vc(j)}}function A(F,H,Q,j){for(var de=0,K=H.length,Pe=Q.length,ke,Ye;de<K;){if(j>=Pe)return-1;if(ke=H.charCodeAt(de++),ke===37){if(ke=H.charAt(de++),Ye=g[ke in um?H.charAt(de++):ke],!Ye||(j=Ye(F,Q,j))<0)return-1}else if(ke!=Q.charCodeAt(j++))return-1}return j}function E(F,H,Q){var j=u.exec(H.slice(Q));return j?(F.p=c.get(j[0].toLowerCase()),Q+j[0].length):-1}function I(F,H,Q){var j=h.exec(H.slice(Q));return j?(F.w=y.get(j[0].toLowerCase()),Q+j[0].length):-1}function T(F,H,Q){var j=f.exec(H.slice(Q));return j?(F.w=d.get(j[0].toLowerCase()),Q+j[0].length):-1}function $(F,H,Q){var j=m.exec(H.slice(Q));return j?(F.m=w.get(j[0].toLowerCase()),Q+j[0].length):-1}function k(F,H,Q){var j=v.exec(H.slice(Q));return j?(F.m=p.get(j[0].toLowerCase()),Q+j[0].length):-1}function C(F,H,Q){return A(F,e,H,Q)}function D(F,H,Q){return A(F,r,H,Q)}function N(F,H,Q){return A(F,n,H,Q)}function L(F){return o[F.getDay()]}function W(F){return a[F.getDay()]}function q(F){return l[F.getMonth()]}function M(F){return s[F.getMonth()]}function R(F){return i[+(F.getHours()>=12)]}function U(F){return 1+~~(F.getMonth()/3)}function V(F){return o[F.getUTCDay()]}function G(F){return a[F.getUTCDay()]}function ee(F){return l[F.getUTCMonth()]}function re(F){return s[F.getUTCMonth()]}function le(F){return i[+(F.getUTCHours()>=12)]}function ae(F){return 1+~~(F.getUTCMonth()/3)}return{format:function(F){var H=_(F+="",b);return H.toString=function(){return F},H},parse:function(F){var H=S(F+="",!1);return H.toString=function(){return F},H},utcFormat:function(F){var H=_(F+="",O);return H.toString=function(){return F},H},utcParse:function(F){var H=S(F+="",!0);return H.toString=function(){return F},H}}}var um={"-":"",_:" ",0:"0"},ze=/^\s*\d+/,pR=/^%/,vR=/[\\^$*+?|[\]().{}]/g;function he(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 yR(t){return t.replace(vR,"\\$&")}function pa(t){return new RegExp("^(?:"+t.map(yR).join("|")+")","i")}function va(t){return new Map(t.map((e,r)=>[e.toLowerCase(),r]))}function gR(t,e,r){var n=ze.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function mR(t,e,r){var n=ze.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function bR(t,e,r){var n=ze.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function wR(t,e,r){var n=ze.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function _R(t,e,r){var n=ze.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function cm(t,e,r){var n=ze.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function fm(t,e,r){var n=ze.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function xR(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 OR(t,e,r){var n=ze.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function SR(t,e,r){var n=ze.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function dm(t,e,r){var n=ze.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function AR(t,e,r){var n=ze.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function hm(t,e,r){var n=ze.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function PR(t,e,r){var n=ze.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function ER(t,e,r){var n=ze.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function TR(t,e,r){var n=ze.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function $R(t,e,r){var n=ze.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function jR(t,e,r){var n=pR.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function kR(t,e,r){var n=ze.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function CR(t,e,r){var n=ze.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function pm(t,e){return he(t.getDate(),e,2)}function IR(t,e){return he(t.getHours(),e,2)}function NR(t,e){return he(t.getHours()%12||12,e,2)}function MR(t,e){return he(1+da.count(tr(t),t),e,3)}function vm(t,e){return he(t.getMilliseconds(),e,3)}function DR(t,e){return vm(t,e)+"000"}function LR(t,e){return he(t.getMonth()+1,e,2)}function BR(t,e){return he(t.getMinutes(),e,2)}function RR(t,e){return he(t.getSeconds(),e,2)}function UR(t){var e=t.getDay();return e===0?7:e}function FR(t,e){return he(ds.count(tr(t)-1,t),e,2)}function ym(t){var e=t.getDay();return e>=4||e===0?Yn(t):Yn.ceil(t)}function WR(t,e){return t=ym(t),he(Yn.count(tr(t),t)+(tr(t).getDay()===4),e,2)}function qR(t){return t.getDay()}function zR(t,e){return he(hs.count(tr(t)-1,t),e,2)}function KR(t,e){return he(t.getFullYear()%100,e,2)}function VR(t,e){return t=ym(t),he(t.getFullYear()%100,e,2)}function HR(t,e){return he(t.getFullYear()%1e4,e,4)}function GR(t,e){var r=t.getDay();return t=r>=4||r===0?Yn(t):Yn.ceil(t),he(t.getFullYear()%1e4,e,4)}function YR(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+he(e/60|0,"0",2)+he(e%60,"0",2)}function gm(t,e){return he(t.getUTCDate(),e,2)}function XR(t,e){return he(t.getUTCHours(),e,2)}function JR(t,e){return he(t.getUTCHours()%12||12,e,2)}function ZR(t,e){return he(1+fs.count(rr(t),t),e,3)}function mm(t,e){return he(t.getUTCMilliseconds(),e,3)}function QR(t,e){return mm(t,e)+"000"}function eU(t,e){return he(t.getUTCMonth()+1,e,2)}function tU(t,e){return he(t.getUTCMinutes(),e,2)}function rU(t,e){return he(t.getUTCSeconds(),e,2)}function nU(t){var e=t.getUTCDay();return e===0?7:e}function iU(t,e){return he(ps.count(rr(t)-1,t),e,2)}function bm(t){var e=t.getUTCDay();return e>=4||e===0?Xn(t):Xn.ceil(t)}function aU(t,e){return t=bm(t),he(Xn.count(rr(t),t)+(rr(t).getUTCDay()===4),e,2)}function oU(t){return t.getUTCDay()}function sU(t,e){return he(vs.count(rr(t)-1,t),e,2)}function lU(t,e){return he(t.getUTCFullYear()%100,e,2)}function uU(t,e){return t=bm(t),he(t.getUTCFullYear()%100,e,2)}function cU(t,e){return he(t.getUTCFullYear()%1e4,e,4)}function fU(t,e){var r=t.getUTCDay();return t=r>=4||r===0?Xn(t):Xn.ceil(t),he(t.getUTCFullYear()%1e4,e,4)}function dU(){return"+0000"}function wm(){return"%"}function _m(t){return+t}function xm(t){return Math.floor(+t/1e3)}var Jn,Om,Sm;hU({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 hU(t){return Jn=hR(t),Om=Jn.format,Jn.parse,Sm=Jn.utcFormat,Jn.utcParse,Jn}function pU(t){return new Date(t)}function vU(t){return t instanceof Date?+t:+new Date(+t)}function Gc(t,e,r,n,i,a,o,s,l,u){var c=$c(),f=c.invert,d=c.domain,h=u(".%L"),y=u(":%S"),v=u("%I:%M"),p=u("%I %p"),m=u("%a %d"),w=u("%b %d"),b=u("%B"),O=u("%Y");function g(_){return(l(_)<_?h:s(_)<_?y:o(_)<_?v:a(_)<_?p:n(_)<_?i(_)<_?m:w:r(_)<_?b:O)(_)}return c.invert=function(_){return new Date(f(_))},c.domain=function(_){return arguments.length?d(Array.from(_,vU)):d().map(pU)},c.ticks=function(_){var S=d();return t(S[0],S[S.length-1],_??10)},c.tickFormat=function(_,S){return S==null?g:u(S)},c.nice=function(_){var S=d();return(!_||typeof _.range!="function")&&(_=e(S[0],S[S.length-1],_??10)),_?d(Vg(S,_)):c},c.copy=function(){return ca(c,Gc(t,e,r,n,i,a,o,s,l,u))},c}function yU(){return _t.apply(Gc(fR,dR,tr,zc,ds,da,Wc,Uc,Xr,Om).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function gU(){return _t.apply(Gc(uR,cR,rr,Kc,ps,fs,qc,Fc,Xr,Sm).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function ys(){var t=0,e=1,r,n,i,a,o=nt,s=!1,l;function u(f){return f==null||isNaN(f=+f)?l:o(i===0?.5:(f=(a(f)-r)*i,s?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([t,e]=f,r=a(t=+t),n=a(e=+e),i=r===n?0:1/(n-r),u):[t,e]},u.clamp=function(f){return arguments.length?(s=!!f,u):s},u.interpolator=function(f){return arguments.length?(o=f,u):o};function c(f){return function(d){var h,y;return arguments.length?([h,y]=d,o=f(h,y),u):[o(0),o(1)]}}return u.range=c(Hn),u.rangeRound=c(Ec),u.unknown=function(f){return arguments.length?(l=f,u):l},function(f){return a=f,r=f(t),n=f(e),i=r===n?0:1/(n-r),u}}function wr(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function Am(){var t=br(ys()(nt));return t.copy=function(){return wr(t,Am())},Jt.apply(t,arguments)}function Pm(){var t=Cc(ys()).domain([1,10]);return t.copy=function(){return wr(t,Pm()).base(t.base())},Jt.apply(t,arguments)}function Em(){var t=Ic(ys());return t.copy=function(){return wr(t,Em()).constant(t.constant())},Jt.apply(t,arguments)}function Yc(){var t=Nc(ys());return t.copy=function(){return wr(t,Yc()).exponent(t.exponent())},Jt.apply(t,arguments)}function mU(){return Yc.apply(null,arguments).exponent(.5)}function Tm(){var t=[],e=nt;function r(n){if(n!=null&&!isNaN(n=+n))return e((ra(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(mr),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)=>iB(t,a/n))},r.copy=function(){return Tm(e).domain(t)},Jt.apply(r,arguments)}function gs(){var t=0,e=.5,r=1,n=1,i,a,o,s,l,u=nt,c,f=!1,d;function h(v){return isNaN(v=+v)?d:(v=.5+((v=+c(v))-a)*(n*v<n*a?s:l),u(f?Math.max(0,Math.min(1,v)):v))}h.domain=function(v){return arguments.length?([t,e,r]=v,i=c(t=+t),a=c(e=+e),o=c(r=+r),s=i===a?0:.5/(a-i),l=a===o?0:.5/(o-a),n=a<i?-1:1,h):[t,e,r]},h.clamp=function(v){return arguments.length?(f=!!v,h):f},h.interpolator=function(v){return arguments.length?(u=v,h):u};function y(v){return function(p){var m,w,b;return arguments.length?([m,w,b]=p,u=jB(v,[m,w,b]),h):[u(0),u(.5),u(1)]}}return h.range=y(Hn),h.rangeRound=y(Ec),h.unknown=function(v){return arguments.length?(d=v,h):d},function(v){return c=v,i=v(t),a=v(e),o=v(r),s=i===a?0:.5/(a-i),l=a===o?0:.5/(o-a),n=a<i?-1:1,h}}function $m(){var t=br(gs()(nt));return t.copy=function(){return wr(t,$m())},Jt.apply(t,arguments)}function jm(){var t=Cc(gs()).domain([.1,1,10]);return t.copy=function(){return wr(t,jm()).base(t.base())},Jt.apply(t,arguments)}function km(){var t=Ic(gs());return t.copy=function(){return wr(t,km()).constant(t.constant())},Jt.apply(t,arguments)}function Xc(){var t=Nc(gs());return t.copy=function(){return wr(t,Xc()).exponent(t.exponent())},Jt.apply(t,arguments)}function bU(){return Xc.apply(null,arguments).exponent(.5)}const Cm=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:ia,scaleDiverging:$m,scaleDivergingLog:jm,scaleDivergingPow:Xc,scaleDivergingSqrt:bU,scaleDivergingSymlog:km,scaleIdentity:Kg,scaleImplicit:bc,scaleLinear:us,scaleLog:Xg,scaleOrdinal:wc,scalePoint:aa,scalePow:Mc,scaleQuantile:nm,scaleQuantize:im,scaleRadial:rm,scaleSequential:Am,scaleSequentialLog:Pm,scaleSequentialPow:Yc,scaleSequentialQuantile:Tm,scaleSequentialSqrt:mU,scaleSequentialSymlog:Em,scaleSqrt:QB,scaleSymlog:Qg,scaleThreshold:am,scaleTime:yU,scaleUtc:gU,tickFormat:zg},Symbol.toStringTag,{value:"Module"}));var wU=$n;function _U(t,e,r){for(var n=-1,i=t.length;++n<i;){var a=t[n],o=e(a);if(o!=null&&(s===void 0?o===o&&!wU(o):r(o,s)))var s=o,l=a}return l}var ms=_U;function xU(t,e){return t>e}var Im=xU,OU=ms,SU=Im,AU=Un;function PU(t){return t&&t.length?OU(t,AU,SU):void 0}var EU=PU;const _r=we(EU);function TU(t,e){return t<e}var Nm=TU,$U=ms,jU=Nm,kU=Un;function CU(t){return t&&t.length?$U(t,kU,jU):void 0}var IU=CU;const bs=we(IU);var NU=hu,MU=Bt,DU=$y,LU=at;function BU(t,e){var r=LU(t)?NU:DU;return r(t,MU(e))}var RU=BU,UU=Ey,FU=RU;function WU(t,e){return UU(FU(t,e),1)}var qU=WU;const zU=we(qU);var KU=Qu;function VU(t,e){return KU(t,e)}var HU=VU;const xr=we(HU);var Zn=1e9,GU={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Qc,je=!0,Ot="[DecimalError] ",Qr=Ot+"Invalid argument: ",Jc=Ot+"Exponent out of range: ",Qn=Math.floor,en=Math.pow,YU=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ht,Ke=1e7,$e=7,Mm=9007199254740991,ws=Qn(Mm/$e),Y={};Y.absoluteValue=Y.abs=function(){var t=new this.constructor(this);return t.s&&(t.s=1),t},Y.comparedTo=Y.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},Y.decimalPlaces=Y.dp=function(){var t=this,e=t.d.length-1,r=(e-t.e)*$e;if(e=t.d[e],e)for(;e%10==0;e/=10)r--;return r<0?0:r},Y.dividedBy=Y.div=function(t){return nr(this,new this.constructor(t))},Y.dividedToIntegerBy=Y.idiv=function(t){var e=this,r=e.constructor;return xe(nr(e,new r(t),0,1),r.precision)},Y.equals=Y.eq=function(t){return!this.cmp(t)},Y.exponent=function(){return Le(this)},Y.greaterThan=Y.gt=function(t){return this.cmp(t)>0},Y.greaterThanOrEqualTo=Y.gte=function(t){return this.cmp(t)>=0},Y.isInteger=Y.isint=function(){return this.e>this.d.length-2},Y.isNegative=Y.isneg=function(){return this.s<0},Y.isPositive=Y.ispos=function(){return this.s>0},Y.isZero=function(){return this.s===0},Y.lessThan=Y.lt=function(t){return this.cmp(t)<0},Y.lessThanOrEqualTo=Y.lte=function(t){return this.cmp(t)<1},Y.logarithm=Y.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(ht))throw Error(Ot+"NaN");if(r.s<1)throw Error(Ot+(r.s?"NaN":"-Infinity"));return r.eq(ht)?new n(0):(je=!1,e=nr(ya(r,a),ya(t,a),a),je=!0,xe(e,i))},Y.minus=Y.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?Rm(e,t):Dm(e,(t.s=-t.s,t))},Y.modulo=Y.mod=function(t){var e,r=this,n=r.constructor,i=n.precision;if(t=new n(t),!t.s)throw Error(Ot+"NaN");return r.s?(je=!1,e=nr(r,t,0,1).times(t),je=!0,r.minus(e)):xe(new n(r),i)},Y.naturalExponential=Y.exp=function(){return Lm(this)},Y.naturalLogarithm=Y.ln=function(){return ya(this)},Y.negated=Y.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t},Y.plus=Y.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?Dm(e,t):Rm(e,(t.s=-t.s,t))},Y.precision=Y.sd=function(t){var e,r,n,i=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(Qr+t);if(e=Le(i)+1,n=i.d.length-1,r=n*$e+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},Y.squareRoot=Y.sqrt=function(){var t,e,r,n,i,a,o,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(Ot+"NaN")}for(t=Le(s),je=!1,i=Math.sqrt(+s),i==0||i==1/0?(e=Wt(s.d),(e.length+t)%2==0&&(e+="0"),i=Math.sqrt(e),t=Qn((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 l(e)):n=new l(i.toString()),r=l.precision,i=o=r+3;;)if(a=n,n=a.plus(nr(s,a,o+2)).times(.5),Wt(a.d).slice(0,o)===(e=Wt(n.d)).slice(0,o)){if(e=e.slice(o-3,o+1),i==o&&e=="4999"){if(xe(a,r+1,0),a.times(a).eq(s)){n=a;break}}else if(e!="9999")break;o+=4}return je=!0,xe(n,r)},Y.times=Y.mul=function(t){var e,r,n,i,a,o,s,l,u,c=this,f=c.constructor,d=c.d,h=(t=new f(t)).d;if(!c.s||!t.s)return new f(0);for(t.s*=c.s,r=c.e+t.e,l=d.length,u=h.length,l<u&&(a=d,d=h,h=a,o=l,l=u,u=o),a=[],o=l+u,n=o;n--;)a.push(0);for(n=u;--n>=0;){for(e=0,i=l+n;i>n;)s=a[i]+h[n]*d[i-n-1]+e,a[i--]=s%Ke|0,e=s/Ke|0;a[i]=(a[i]+e)%Ke|0}for(;!a[--o];)a.pop();return e?++r:a.shift(),t.d=a,t.e=r,je?xe(t,f.precision):t},Y.toDecimalPlaces=Y.todp=function(t,e){var r=this,n=r.constructor;return r=new n(r),t===void 0?r:(Ft(t,0,Zn),e===void 0?e=n.rounding:Ft(e,0,8),xe(r,t+Le(r)+1,e))},Y.toExponential=function(t,e){var r,n=this,i=n.constructor;return t===void 0?r=tn(n,!0):(Ft(t,0,Zn),e===void 0?e=i.rounding:Ft(e,0,8),n=xe(new i(n),t+1,e),r=tn(n,!0,t+1)),r},Y.toFixed=function(t,e){var r,n,i=this,a=i.constructor;return t===void 0?tn(i):(Ft(t,0,Zn),e===void 0?e=a.rounding:Ft(e,0,8),n=xe(new a(i),t+Le(i)+1,e),r=tn(n.abs(),!1,t+Le(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)},Y.toInteger=Y.toint=function(){var t=this,e=t.constructor;return xe(new e(t),Le(t)+1,e.rounding)},Y.toNumber=function(){return+this},Y.toPower=Y.pow=function(t){var e,r,n,i,a,o,s=this,l=s.constructor,u=12,c=+(t=new l(t));if(!t.s)return new l(ht);if(s=new l(s),!s.s){if(t.s<1)throw Error(Ot+"Infinity");return s}if(s.eq(ht))return s;if(n=l.precision,t.eq(ht))return xe(s,n);if(e=t.e,r=t.d.length-1,o=e>=r,a=s.s,o){if((r=c<0?-c:c)<=Mm){for(i=new l(ht),e=Math.ceil(n/$e+4),je=!1;r%2&&(i=i.times(s),Um(i.d,e)),r=Qn(r/2),r!==0;)s=s.times(s),Um(s.d,e);return je=!0,t.s<0?new l(ht).div(i):xe(i,n)}}else if(a<0)throw Error(Ot+"NaN");return a=a<0&&t.d[Math.max(e,r)]&1?-1:1,s.s=1,je=!1,i=t.times(ya(s,n+u)),je=!0,i=Lm(i),i.s=a,i},Y.toPrecision=function(t,e){var r,n,i=this,a=i.constructor;return t===void 0?(r=Le(i),n=tn(i,r<=a.toExpNeg||r>=a.toExpPos)):(Ft(t,1,Zn),e===void 0?e=a.rounding:Ft(e,0,8),i=xe(new a(i),t,e),r=Le(i),n=tn(i,t<=r||r<=a.toExpNeg,t)),n},Y.toSignificantDigits=Y.tosd=function(t,e){var r=this,n=r.constructor;return t===void 0?(t=n.precision,e=n.rounding):(Ft(t,1,Zn),e===void 0?e=n.rounding:Ft(e,0,8)),xe(new n(r),t,e)},Y.toString=Y.valueOf=Y.val=Y.toJSON=Y[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=Le(t),r=t.constructor;return tn(t,e<=r.toExpNeg||e>=r.toExpPos)};function Dm(t,e){var r,n,i,a,o,s,l,u,c=t.constructor,f=c.precision;if(!t.s||!e.s)return e.s||(e=new c(t)),je?xe(e,f):e;if(l=t.d,u=e.d,o=t.e,i=e.e,l=l.slice(),a=o-i,a){for(a<0?(n=l,a=-a,s=u.length):(n=u,i=o,s=l.length),o=Math.ceil(f/$e),s=o>s?o+1:s+1,a>s&&(a=s,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(s=l.length,a=u.length,s-a<0&&(a=s,n=u,u=l,l=n),r=0;a;)r=(l[--a]=l[a]+u[a]+r)/Ke|0,l[a]%=Ke;for(r&&(l.unshift(r),++i),s=l.length;l[--s]==0;)l.pop();return e.d=l,e.e=i,je?xe(e,f):e}function Ft(t,e,r){if(t!==~~t||t<e||t>r)throw Error(Qr+t)}function Wt(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=$e-n.length,r&&(a+=Or(r)),a+=n;o=t[e],n=o+"",r=$e-n.length,r&&(a+=Or(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var nr=function(){function t(n,i){var a,o=0,s=n.length;for(n=n.slice();s--;)a=n[s]*i+o,n[s]=a%Ke|0,o=a/Ke|0;return o&&n.unshift(o),n}function e(n,i,a,o){var s,l;if(a!=o)l=a>o?1:-1;else for(s=l=0;s<a;s++)if(n[s]!=i[s]){l=n[s]>i[s]?1:-1;break}return l}function r(n,i,a){for(var o=0;a--;)n[a]-=o,o=n[a]<i[a]?1:0,n[a]=o*Ke+n[a]-i[a];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,a,o){var s,l,u,c,f,d,h,y,v,p,m,w,b,O,g,_,S,A,E=n.constructor,I=n.s==i.s?1:-1,T=n.d,$=i.d;if(!n.s)return new E(n);if(!i.s)throw Error(Ot+"Division by zero");for(l=n.e-i.e,S=$.length,g=T.length,h=new E(I),y=h.d=[],u=0;$[u]==(T[u]||0);)++u;if($[u]>(T[u]||0)&&--l,a==null?w=a=E.precision:o?w=a+(Le(n)-Le(i))+1:w=a,w<0)return new E(0);if(w=w/$e+2|0,u=0,S==1)for(c=0,$=$[0],w++;(u<g||c)&&w--;u++)b=c*Ke+(T[u]||0),y[u]=b/$|0,c=b%$|0;else{for(c=Ke/($[0]+1)|0,c>1&&($=t($,c),T=t(T,c),S=$.length,g=T.length),O=S,v=T.slice(0,S),p=v.length;p<S;)v[p++]=0;A=$.slice(),A.unshift(0),_=$[0],$[1]>=Ke/2&&++_;do c=0,s=e($,v,S,p),s<0?(m=v[0],S!=p&&(m=m*Ke+(v[1]||0)),c=m/_|0,c>1?(c>=Ke&&(c=Ke-1),f=t($,c),d=f.length,p=v.length,s=e(f,v,d,p),s==1&&(c--,r(f,S<d?A:$,d))):(c==0&&(s=c=1),f=$.slice()),d=f.length,d<p&&f.unshift(0),r(v,f,p),s==-1&&(p=v.length,s=e($,v,S,p),s<1&&(c++,r(v,S<p?A:$,p))),p=v.length):s===0&&(c++,v=[0]),y[u++]=c,s&&v[0]?v[p++]=T[O]||0:(v=[T[O]],p=1);while((O++<g||v[0]!==void 0)&&w--)}return y[0]||y.shift(),h.e=l,xe(h,o?a+Le(h)+1:a)}}();function Lm(t,e){var r,n,i,a,o,s,l=0,u=0,c=t.constructor,f=c.precision;if(Le(t)>16)throw Error(Jc+Le(t));if(!t.s)return new c(ht);for(e==null?(je=!1,s=f):s=e,o=new c(.03125);t.abs().gte(.1);)t=t.times(o),u+=5;for(n=Math.log(en(2,u))/Math.LN10*2+5|0,s+=n,r=i=a=new c(ht),c.precision=s;;){if(i=xe(i.times(t),s),r=r.times(++l),o=a.plus(nr(i,r,s)),Wt(o.d).slice(0,s)===Wt(a.d).slice(0,s)){for(;u--;)a=xe(a.times(a),s);return c.precision=f,e==null?(je=!0,xe(a,f)):a}a=o}}function Le(t){for(var e=t.e*$e,r=t.d[0];r>=10;r/=10)e++;return e}function Zc(t,e,r){if(e>t.LN10.sd())throw je=!0,r&&(t.precision=r),Error(Ot+"LN10 precision limit exceeded");return xe(new t(t.LN10),e)}function Or(t){for(var e="";t--;)e+="0";return e}function ya(t,e){var r,n,i,a,o,s,l,u,c,f=1,d=10,h=t,y=h.d,v=h.constructor,p=v.precision;if(h.s<1)throw Error(Ot+(h.s?"NaN":"-Infinity"));if(h.eq(ht))return new v(0);if(e==null?(je=!1,u=p):u=e,h.eq(10))return e==null&&(je=!0),Zc(v,u);if(u+=d,v.precision=u,r=Wt(y),n=r.charAt(0),a=Le(h),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)h=h.times(t),r=Wt(h.d),n=r.charAt(0),f++;a=Le(h),n>1?(h=new v("0."+r),a++):h=new v(n+"."+r.slice(1))}else return l=Zc(v,u+2,p).times(a+""),h=ya(new v(n+"."+r.slice(1)),u-d).plus(l),v.precision=p,e==null?(je=!0,xe(h,p)):h;for(s=o=h=nr(h.minus(ht),h.plus(ht),u),c=xe(h.times(h),u),i=3;;){if(o=xe(o.times(c),u),l=s.plus(nr(o,new v(i),u)),Wt(l.d).slice(0,u)===Wt(s.d).slice(0,u))return s=s.times(2),a!==0&&(s=s.plus(Zc(v,u+2,p).times(a+""))),s=nr(s,new v(f),u),v.precision=p,e==null?(je=!0,xe(s,p)):s;s=l,i+=2}}function Bm(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=Qn(r/$e),t.d=[],n=(r+1)%$e,r<0&&(n+=$e),n<i){for(n&&t.d.push(+e.slice(0,n)),i-=$e;n<i;)t.d.push(+e.slice(n,n+=$e));e=e.slice(n),n=$e-e.length}else n-=i;for(;n--;)e+="0";if(t.d.push(+e),je&&(t.e>ws||t.e<-ws))throw Error(Jc+r)}else t.s=0,t.e=0,t.d=[0];return t}function xe(t,e,r){var n,i,a,o,s,l,u,c,f=t.d;for(o=1,a=f[0];a>=10;a/=10)o++;if(n=e-o,n<0)n+=$e,i=e,u=f[c=0];else{if(c=Math.ceil((n+1)/$e),a=f.length,c>=a)return t;for(u=a=f[c],o=1;a>=10;a/=10)o++;n%=$e,i=n-$e+o}if(r!==void 0&&(a=en(10,o-i-1),s=u/a%10|0,l=e<0||f[c+1]!==void 0||u%a,l=r<4?(s||l)&&(r==0||r==(t.s<0?3:2)):s>5||s==5&&(r==4||l||r==6&&(n>0?i>0?u/en(10,o-i):0:f[c-1])%10&1||r==(t.s<0?8:7))),e<1||!f[0])return l?(a=Le(t),f.length=1,e=e-a-1,f[0]=en(10,($e-e%$e)%$e),t.e=Qn(-e/$e)||0):(f.length=1,f[0]=t.e=t.s=0),t;if(n==0?(f.length=c,a=1,c--):(f.length=c+1,a=en(10,$e-n),f[c]=i>0?(u/en(10,o-i)%en(10,i)|0)*a:0),l)for(;;)if(c==0){(f[0]+=a)==Ke&&(f[0]=1,++t.e);break}else{if(f[c]+=a,f[c]!=Ke)break;f[c--]=0,a=1}for(n=f.length;f[--n]===0;)f.pop();if(je&&(t.e>ws||t.e<-ws))throw Error(Jc+Le(t));return t}function Rm(t,e){var r,n,i,a,o,s,l,u,c,f,d=t.constructor,h=d.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new d(t),je?xe(e,h):e;if(l=t.d,f=e.d,n=e.e,u=t.e,l=l.slice(),o=u-n,o){for(c=o<0,c?(r=l,o=-o,s=f.length):(r=f,n=u,s=l.length),i=Math.max(Math.ceil(h/$e),s)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=l.length,s=f.length,c=i<s,c&&(s=i),i=0;i<s;i++)if(l[i]!=f[i]){c=l[i]<f[i];break}o=0}for(c&&(r=l,l=f,f=r,e.s=-e.s),s=l.length,i=f.length-s;i>0;--i)l[s++]=0;for(i=f.length;i>o;){if(l[--i]<f[i]){for(a=i;a&&l[--a]===0;)l[a]=Ke-1;--l[a],l[i]+=Ke}l[i]-=f[i]}for(;l[--s]===0;)l.pop();for(;l[0]===0;l.shift())--n;return l[0]?(e.d=l,e.e=n,je?xe(e,h):e):new d(0)}function tn(t,e,r){var n,i=Le(t),a=Wt(t.d),o=a.length;return e?(r&&(n=r-o)>0?a=a.charAt(0)+"."+a.slice(1)+Or(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Or(-i-1)+a,r&&(n=r-o)>0&&(a+=Or(n))):i>=o?(a+=Or(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+Or(n))):((n=i+1)<o&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-o)>0&&(i+1===o&&(a+="."),a+=Or(n))),t.s<0?"-"+a:a}function Um(t,e){if(t.length>e)return t.length=e,!0}function Fm(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(Qr+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 Bm(o,a.toString())}else if(typeof a!="string")throw Error(Qr+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,YU.test(a))Bm(o,a);else throw Error(Qr+a)}if(i.prototype=Y,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=Fm,i.config=i.set=XU,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 XU(t){if(!t||typeof t!="object")throw Error(Ot+"Object expected");var e,r,n,i=["precision",1,Zn,"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(Qn(n)===n&&n>=i[e+1]&&n<=i[e+2])this[r]=n;else throw Error(Qr+r+": "+n);if((n=t[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Qr+r+": "+n);return this}var Qc=Fm(GU);ht=new Qc(1);const _e=Qc;function JU(t){return tF(t)||eF(t)||QU(t)||ZU()}function ZU(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
68
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function QU(t,e){if(t){if(typeof t=="string")return ef(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 ef(t,e)}}function eF(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function tF(t){if(Array.isArray(t))return ef(t)}function ef(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 rF=function(e){return e},Wm={"@@functional/placeholder":!0},qm=function(e){return e===Wm},zm=function(e){return function r(){return arguments.length===0||arguments.length===1&&qm(arguments.length<=0?void 0:arguments[0])?r:e.apply(void 0,arguments)}},nF=function t(e,r){return e===1?r:zm(function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];var o=i.filter(function(s){return s!==Wm}).length;return o>=e?r.apply(void 0,i):t(e-o,zm(function(){for(var s=arguments.length,l=new Array(s),u=0;u<s;u++)l[u]=arguments[u];var c=i.map(function(f){return qm(f)?l.shift():f});return r.apply(void 0,JU(c).concat(l))}))})},_s=function(e){return nF(e.length,e)},tf=function(e,r){for(var n=[],i=e;i<r;++i)n[i-e]=i;return n},iF=_s(function(t,e){return Array.isArray(e)?e.map(t):Object.keys(e).map(function(r){return e[r]}).map(t)}),aF=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];if(!r.length)return rF;var i=r.reverse(),a=i[0],o=i.slice(1);return function(){return o.reduce(function(s,l){return l(s)},a.apply(void 0,arguments))}},rf=function(e){return Array.isArray(e)?e.reverse():e.split("").reverse.join("")},Km=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(s,l){return s===r[l]})||(r=a,n=e.apply(void 0,a)),n}};function oF(t){var e;return t===0?e=1:e=Math.floor(new _e(t).abs().log(10).toNumber())+1,e}function sF(t,e,r){for(var n=new _e(t),i=0,a=[];n.lt(e)&&i<1e5;)a.push(n.toNumber()),n=n.add(r),i++;return a}var lF=_s(function(t,e,r){var n=+t,i=+e;return n+r*(i-n)}),uF=_s(function(t,e,r){var n=e-+t;return n=n||1/0,(r-t)/n}),cF=_s(function(t,e,r){var n=e-+t;return n=n||1/0,Math.max(0,Math.min(1,(r-t)/n))});const xs={rangeStep:sF,getDigitCount:oF,interpolateNumber:lF,uninterpolateNumber:uF,uninterpolateTruncation:cF};function nf(t){return hF(t)||dF(t)||Vm(t)||fF()}function fF(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
69
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dF(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function hF(t){if(Array.isArray(t))return af(t)}function ga(t,e){return yF(t)||vF(t,e)||Vm(t,e)||pF()}function pF(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
70
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vm(t,e){if(t){if(typeof t=="string")return af(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 af(t,e)}}function af(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 vF(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](),s;!(n=(s=o.next()).done)&&(r.push(s.value),!(e&&r.length===e));n=!0);}catch(l){i=!0,a=l}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}}function yF(t){if(Array.isArray(t))return t}function Hm(t){var e=ga(t,2),r=e[0],n=e[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function Gm(t,e,r){if(t.lte(0))return new _e(0);var n=xs.getDigitCount(t.toNumber()),i=new _e(10).pow(n),a=t.div(i),o=n!==1?.05:.1,s=new _e(Math.ceil(a.div(o).toNumber())).add(r).mul(o),l=s.mul(i);return e?l:new _e(Math.ceil(l))}function gF(t,e,r){var n=1,i=new _e(t);if(!i.isint()&&r){var a=Math.abs(t);a<1?(n=new _e(10).pow(xs.getDigitCount(t)-1),i=new _e(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new _e(Math.floor(t)))}else t===0?i=new _e(Math.floor((e-1)/2)):r||(i=new _e(Math.floor(t)));var o=Math.floor((e-1)/2),s=aF(iF(function(l){return i.add(new _e(l-o).mul(n)).toNumber()}),tf);return s(0,e)}function Ym(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 _e(0),tickMin:new _e(0),tickMax:new _e(0)};var a=Gm(new _e(e).sub(t).div(r-1),n,i),o;t<=0&&e>=0?o=new _e(0):(o=new _e(t).add(e).div(2),o=o.sub(new _e(o).mod(a)));var s=Math.ceil(o.sub(t).div(a).toNumber()),l=Math.ceil(new _e(e).sub(o).div(a).toNumber()),u=s+l+1;return u>r?Ym(t,e,r,n,i+1):(u<r&&(l=e>0?l+(r-u):l,s=e>0?s:s+(r-u)),{step:a,tickMin:o.sub(new _e(s).mul(a)),tickMax:o.add(new _e(l).mul(a))})}function mF(t){var e=ga(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),s=Hm([r,n]),l=ga(s,2),u=l[0],c=l[1];if(u===-1/0||c===1/0){var f=c===1/0?[u].concat(nf(tf(0,i-1).map(function(){return 1/0}))):[].concat(nf(tf(0,i-1).map(function(){return-1/0})),[c]);return r>n?rf(f):f}if(u===c)return gF(u,i,a);var d=Ym(u,c,o,a),h=d.step,y=d.tickMin,v=d.tickMax,p=xs.rangeStep(y,v.add(new _e(.1).mul(h)),h);return r>n?rf(p):p}function bF(t,e){var r=ga(t,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Hm([n,i]),s=ga(o,2),l=s[0],u=s[1];if(l===-1/0||u===1/0)return[n,i];if(l===u)return[l];var c=Math.max(e,2),f=Gm(new _e(u).sub(l).div(c-1),a,0),d=[].concat(nf(xs.rangeStep(new _e(l),new _e(u).sub(new _e(.99).mul(f)),f)),[u]);return n>i?rf(d):d}var wF=Km(mF),_F=Km(bF),xF=process.env.NODE_ENV==="production",of="Invariant failed";function st(t,e){if(xF)throw new Error(of);var r=typeof e=="function"?e():e,n=r?"".concat(of,": ").concat(r):of;throw new Error(n)}var OF=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function ei(t){"@babel/helpers - typeof";return ei=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},ei(t)}function Os(){return Os=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},Os.apply(this,arguments)}function SF(t,e){return TF(t)||EF(t,e)||PF(t,e)||AF()}function AF(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
71
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function PF(t,e){if(t){if(typeof t=="string")return Xm(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 Xm(t,e)}}function Xm(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 EF(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,s=[],l=!0,u=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}function TF(t){if(Array.isArray(t))return t}function $F(t,e){if(t==null)return{};var r=jF(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 jF(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 kF(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function CF(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,Qm(n.key),n)}}function IF(t,e,r){return e&&CF(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function NF(t,e,r){return e=Ss(e),MF(t,Jm()?Reflect.construct(e,r||[],Ss(t).constructor):e.apply(t,r))}function MF(t,e){if(e&&(ei(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return DF(t)}function DF(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Jm(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Jm=function(){return!!t})()}function Ss(t){return Ss=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ss(t)}function LF(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&&sf(t,e)}function sf(t,e){return sf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},sf(t,e)}function Zm(t,e,r){return e=Qm(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qm(t){var e=BF(t,"string");return ei(e)=="symbol"?e:e+""}function BF(t,e){if(ei(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ei(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ma=function(t){function e(){return kF(this,e),NF(this,e,arguments)}return LF(e,t),IF(e,[{key:"render",value:function(){var n=this.props,i=n.offset,a=n.layout,o=n.width,s=n.dataKey,l=n.data,u=n.dataPointFormatter,c=n.xAxis,f=n.yAxis,d=$F(n,OF),h=X(d,!1);this.props.direction==="x"&&c.type!=="number"&&(process.env.NODE_ENV!=="production"?st(!1,'ErrorBar requires Axis type property to be "number".'):st());var y=l.map(function(v){var p=u(v,s),m=p.x,w=p.y,b=p.value,O=p.errorVal;if(!O)return null;var g=[],_,S;if(Array.isArray(O)){var A=SF(O,2);_=A[0],S=A[1]}else _=S=O;if(a==="vertical"){var E=c.scale,I=w+i,T=I+o,$=I-o,k=E(b-_),C=E(b+S);g.push({x1:C,y1:T,x2:C,y2:$}),g.push({x1:k,y1:I,x2:C,y2:I}),g.push({x1:k,y1:T,x2:k,y2:$})}else if(a==="horizontal"){var D=f.scale,N=m+i,L=N-o,W=N+o,q=D(b-_),M=D(b+S);g.push({x1:L,y1:M,x2:W,y2:M}),g.push({x1:N,y1:q,x2:N,y2:M}),g.push({x1:L,y1:q,x2:W,y2:q})}return x.createElement(ce,Os({className:"recharts-errorBar",key:"bar-".concat(g.map(function(R){return"".concat(R.x1,"-").concat(R.x2,"-").concat(R.y1,"-").concat(R.y2)}))},h),g.map(function(R){return x.createElement("line",Os({},R,{key:"line-".concat(R.x1,"-").concat(R.x2,"-").concat(R.y1,"-").concat(R.y2)}))}))});return x.createElement(ce,{className:"recharts-errorBars"},y)}}])}(x.Component);Zm(ma,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"}),Zm(ma,"displayName","ErrorBar");function ba(t){"@babel/helpers - typeof";return ba=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},ba(t)}function eb(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 rn(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?eb(Object(r),!0).forEach(function(n){RF(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):eb(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function RF(t,e,r){return e=UF(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function UF(t){var e=FF(t,"string");return ba(e)=="symbol"?e:e+""}function FF(t,e){if(ba(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ba(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var tb=function(e){var r=e.children,n=e.formattedGraphicalItems,i=e.legendWidth,a=e.legendContent,o=dt(r,Vr);if(!o)return null;var s=Vr.defaultProps,l=s!==void 0?rn(rn({},s),o.props):{},u;return o.props&&o.props.payload?u=o.props&&o.props.payload:a==="children"?u=(n||[]).reduce(function(c,f){var d=f.item,h=f.props,y=h.sectors||h.data||[];return c.concat(y.map(function(v){return{type:o.props.iconType||d.props.legendType,value:v.name,color:v.fill,payload:v}}))},[]):u=(n||[]).map(function(c){var f=c.item,d=f.type.defaultProps,h=d!==void 0?rn(rn({},d),f.props):{},y=h.dataKey,v=h.name,p=h.legendType,m=h.hide;return{inactive:m,dataKey:y,type:l.iconType||p||"square",color:uf(f),value:v||y,payload:h}}),rn(rn(rn({},l),Vr.getWithHeight(o,i)),{},{payload:u,item:o})};function wa(t){"@babel/helpers - typeof";return wa=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},wa(t)}function rb(t){return KF(t)||zF(t)||qF(t)||WF()}function WF(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
72
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qF(t,e){if(t){if(typeof t=="string")return lf(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 lf(t,e)}}function zF(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function KF(t){if(Array.isArray(t))return lf(t)}function lf(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 nb(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 Me(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?nb(Object(r),!0).forEach(function(n){ti(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):nb(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ti(t,e,r){return e=VF(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function VF(t){var e=HF(t,"string");return wa(e)=="symbol"?e:e+""}function HF(t,e){if(wa(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(wa(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ne(t,e,r){return se(t)||se(e)?r:Ue(e)?ct(t,e,r):te(e)?e(t):r}function _a(t,e,r,n){var i=zU(t,function(s){return Ne(s,e)});if(r==="number"){var a=i.filter(function(s){return z(s)||parseFloat(s)});return a.length?[bs(a),_r(a)]:[1/0,-1/0]}var o=n?i.filter(function(s){return!se(s)}):i;return o.map(function(s){return Ue(s)||s instanceof Date?s:""})}var GF=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,s=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(s<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var l=a.range,u=0;u<s;u++){var c=u>0?i[u-1].coordinate:i[s-1].coordinate,f=i[u].coordinate,d=u>=s-1?i[0].coordinate:i[u+1].coordinate,h=void 0;if(tt(f-c)!==tt(d-f)){var y=[];if(tt(d-f)===tt(l[1]-l[0])){h=d;var v=f+l[1]-l[0];y[0]=Math.min(v,(v+c)/2),y[1]=Math.max(v,(v+c)/2)}else{h=c;var p=d+l[1]-l[0];y[0]=Math.min(f,(p+f)/2),y[1]=Math.max(f,(p+f)/2)}var m=[Math.min(f,(h+f)/2),Math.max(f,(h+f)/2)];if(e>m[0]&&e<=m[1]||e>=y[0]&&e<=y[1]){o=i[u].index;break}}else{var w=Math.min(c,d),b=Math.max(c,d);if(e>(w+f)/2&&e<=(b+f)/2){o=i[u].index;break}}}else for(var O=0;O<s;O++)if(O===0&&e<=(n[O].coordinate+n[O+1].coordinate)/2||O>0&&O<s-1&&e>(n[O].coordinate+n[O-1].coordinate)/2&&e<=(n[O].coordinate+n[O+1].coordinate)/2||O===s-1&&e>(n[O].coordinate+n[O-1].coordinate)/2){o=n[O].index;break}return o},uf=function(e){var r,n=e,i=n.type.displayName,a=(r=e.type)!==null&&r!==void 0&&r.defaultProps?Me(Me({},e.type.defaultProps),e.props):e.props,o=a.stroke,s=a.fill,l;switch(i){case"Line":l=o;break;case"Area":case"Radar":l=o&&o!=="none"?o:s;break;default:l=s;break}return l},YF=function(e){var r=e.barSize,n=e.totalSize,i=e.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var o={},s=Object.keys(a),l=0,u=s.length;l<u;l++)for(var c=a[s[l]].stackGroups,f=Object.keys(c),d=0,h=f.length;d<h;d++){var y=c[f[d]],v=y.items,p=y.cateAxisId,m=v.filter(function(S){return Yt(S.type).indexOf("Bar")>=0});if(m&&m.length){var w=m[0].type.defaultProps,b=w!==void 0?Me(Me({},w),m[0].props):m[0].props,O=b.barSize,g=b[p];o[g]||(o[g]=[]);var _=se(O)?r:O;o[g].push({item:m[0],stackList:m.slice(1),barSize:se(_)?void 0:rt(_,n,0)})}}return o},XF=function(e){var r=e.barGap,n=e.barCategoryGap,i=e.bandSize,a=e.sizeList,o=a===void 0?[]:a,s=e.maxBarSize,l=o.length;if(l<1)return null;var u=rt(r,i,0,!0),c,f=[];if(o[0].barSize===+o[0].barSize){var d=!1,h=i/l,y=o.reduce(function(O,g){return O+g.barSize||0},0);y+=(l-1)*u,y>=i&&(y-=(l-1)*u,u=0),y>=i&&h>0&&(d=!0,h*=.9,y=l*h);var v=(i-y)/2>>0,p={offset:v-u,size:0};c=o.reduce(function(O,g){var _={item:g.item,position:{offset:p.offset+p.size+u,size:d?h:g.barSize}},S=[].concat(rb(O),[_]);return p=S[S.length-1].position,g.stackList&&g.stackList.length&&g.stackList.forEach(function(A){S.push({item:A,position:p})}),S},f)}else{var m=rt(n,i,0,!0);i-2*m-(l-1)*u<=0&&(u=0);var w=(i-2*m-(l-1)*u)/l;w>1&&(w>>=0);var b=s===+s?Math.min(w,s):w;c=o.reduce(function(O,g,_){var S=[].concat(rb(O),[{item:g.item,position:{offset:m+(w+u)*_+(w-b)/2,size:b}}]);return g.stackList&&g.stackList.length&&g.stackList.forEach(function(A){S.push({item:A,position:S[S.length-1].position})}),S},f)}return c},JF=function(e,r,n,i){var a=n.children,o=n.width,s=n.margin,l=o-(s.left||0)-(s.right||0),u=tb({children:a,legendWidth:l});if(u){var c=i||{},f=c.width,d=c.height,h=u.align,y=u.verticalAlign,v=u.layout;if((v==="vertical"||v==="horizontal"&&y==="middle")&&h!=="center"&&z(e[h]))return Me(Me({},e),{},ti({},h,e[h]+(f||0)));if((v==="horizontal"||v==="vertical"&&h==="center")&&y!=="middle"&&z(e[y]))return Me(Me({},e),{},ti({},y,e[y]+(d||0)))}return e},ZF=function(e,r,n){return se(r)?!0:e==="horizontal"?r==="yAxis":e==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},ib=function(e,r,n,i,a){var o=r.props.children,s=ft(o,ma).filter(function(u){return ZF(i,a,u.props.direction)});if(s&&s.length){var l=s.map(function(u){return u.props.dataKey});return e.reduce(function(u,c){var f=Ne(c,n);if(se(f))return u;var d=Array.isArray(f)?[bs(f),_r(f)]:[f,f],h=l.reduce(function(y,v){var p=Ne(c,v,0),m=d[0]-Math.abs(Array.isArray(p)?p[0]:p),w=d[1]+Math.abs(Array.isArray(p)?p[1]:p);return[Math.min(m,y[0]),Math.max(w,y[1])]},[1/0,-1/0]);return[Math.min(h[0],u[0]),Math.max(h[1],u[1])]},[1/0,-1/0])}return null},QF=function(e,r,n,i,a){var o=r.map(function(s){return ib(e,s,n,a,i)}).filter(function(s){return!se(s)});return o&&o.length?o.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},ab=function(e,r,n,i,a){var o=r.map(function(l){var u=l.props.dataKey;return n==="number"&&u&&ib(e,l,u,i)||_a(e,u,n,a)});if(n==="number")return o.reduce(function(l,u){return[Math.min(l[0],u[0]),Math.max(l[1],u[1])]},[1/0,-1/0]);var s={};return o.reduce(function(l,u){for(var c=0,f=u.length;c<f;c++)s[u[c]]||(s[u[c]]=!0,l.push(u[c]));return l},[])},ob=function(e,r){return e==="horizontal"&&r==="xAxis"||e==="vertical"&&r==="yAxis"||e==="centric"&&r==="angleAxis"||e==="radial"&&r==="radiusAxis"},sb=function(e,r,n,i){if(i)return e.map(function(l){return l.coordinate});var a,o,s=e.map(function(l){return l.coordinate===r&&(a=!0),l.coordinate===n&&(o=!0),l.coordinate});return a||s.push(r),o||s.push(n),s},ir=function(e,r,n){if(!e)return null;var i=e.scale,a=e.duplicateDomain,o=e.type,s=e.range,l=e.realScaleType==="scaleBand"?i.bandwidth()/2:2,u=(r||n)&&o==="category"&&i.bandwidth?i.bandwidth()/l:0;if(u=e.axisType==="angleAxis"&&(s==null?void 0:s.length)>=2?tt(s[0]-s[1])*2*u:u,r&&(e.ticks||e.niceTicks)){var c=(e.ticks||e.niceTicks).map(function(f){var d=a?a.indexOf(f):f;return{coordinate:i(d)+u,value:f,offset:u}});return c.filter(function(f){return!Nn(f.coordinate)})}return e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(f,d){return{coordinate:i(f)+u,value:f,index:d,offset:u}}):i.ticks&&!n?i.ticks(e.tickCount).map(function(f){return{coordinate:i(f)+u,value:f,offset:u}}):i.domain().map(function(f,d){return{coordinate:i(f)+u,value:a?a[f]:f,index:d,offset:u}})},cf=new WeakMap,As=function(e,r){if(typeof r!="function")return e;cf.has(e)||cf.set(e,new WeakMap);var n=cf.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},lb=function(e,r,n){var i=e.scale,a=e.type,o=e.layout,s=e.axisType;if(i==="auto")return o==="radial"&&s==="radiusAxis"?{scale:ia(),realScaleType:"band"}:o==="radial"&&s==="angleAxis"?{scale:us(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:aa(),realScaleType:"point"}:a==="category"?{scale:ia(),realScaleType:"band"}:{scale:us(),realScaleType:"linear"};if(Ur(i)){var l="scale".concat(Eo(i));return{scale:(Cm[l]||aa)(),realScaleType:Cm[l]?l:"point"}}return te(i)?{scale:i}:{scale:aa(),realScaleType:"point"}},ub=1e-4,cb=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])-ub,o=Math.max(i[0],i[1])+ub,s=e(r[0]),l=e(r[n-1]);(s<a||s>o||l<a||l>o)&&e.domain([r[0],r[n-1]])}},eW=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},tW=function(e,r){if(!r||r.length!==2||!z(r[0])||!z(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(!z(e[0])||e[0]<n)&&(a[0]=n),(!z(e[1])||e[1]>i)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]<n&&(a[1]=n),a},rW=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,s=0;s<r;++s){var l=Nn(e[s][n][1])?e[s][n][0]:e[s][n][1];l>=0?(e[s][n][0]=a,e[s][n][1]=a+l,a=e[s][n][1]):(e[s][n][0]=o,e[s][n][1]=o+l,o=e[s][n][1])}},nW=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 s=Nn(e[o][n][1])?e[o][n][0]:e[o][n][1];s>=0?(e[o][n][0]=a,e[o][n][1]=a+s,a=e[o][n][1]):(e[o][n][0]=0,e[o][n][1]=0)}},iW={sign:rW,expand:O$,none:Dn,silhouette:S$,wiggle:A$,positive:nW},aW=function(e,r,n){var i=r.map(function(s){return s.props.dataKey}),a=iW[n],o=x$().keys(i).value(function(s,l){return+Ne(s,l,0)}).order(Du).offset(a);return o(e)},oW=function(e,r,n,i,a,o){if(!e)return null;var s=o?r.reverse():r,l={},u=s.reduce(function(f,d){var h,y=(h=d.type)!==null&&h!==void 0&&h.defaultProps?Me(Me({},d.type.defaultProps),d.props):d.props,v=y.stackId,p=y.hide;if(p)return f;var m=y[n],w=f[m]||{hasStack:!1,stackGroups:{}};if(Ue(v)){var b=w.stackGroups[v]||{numericAxisId:n,cateAxisId:i,items:[]};b.items.push(d),w.hasStack=!0,w.stackGroups[v]=b}else w.stackGroups[Wr("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[d]};return Me(Me({},f),{},ti({},m,w))},l),c={};return Object.keys(u).reduce(function(f,d){var h=u[d];if(h.hasStack){var y={};h.stackGroups=Object.keys(h.stackGroups).reduce(function(v,p){var m=h.stackGroups[p];return Me(Me({},v),{},ti({},p,{numericAxisId:n,cateAxisId:i,items:m.items,stackedData:aW(e,m.items,a)}))},y)}return Me(Me({},f),{},ti({},d,h))},c)},fb=function(e,r){var n=r.realScaleType,i=r.type,a=r.tickCount,o=r.originalDomain,s=r.allowDecimals,l=n||r.scale;if(l!=="auto"&&l!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=e.domain();if(!u.length)return null;var c=wF(u,a,s);return e.domain([bs(c),_r(c)]),{niceTicks:c}}if(a&&i==="number"){var f=e.domain(),d=_F(f,a,s);return{niceTicks:d}}return null};function Ps(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&&!se(i[e.dataKey])){var s=Ao(r,"value",i[e.dataKey]);if(s)return s.coordinate+n/2}return r[a]?r[a].coordinate+n/2:null}var l=Ne(i,se(o)?e.dataKey:o);return se(l)?null:e.scale(l)}var db=function(e){var r=e.axis,n=e.ticks,i=e.offset,a=e.bandSize,o=e.entry,s=e.index;if(r.type==="category")return n[s]?n[s].coordinate+i:null;var l=Ne(o,r.dataKey,r.domain[s]);return se(l)?null:r.scale(l)-a/2+i},sW=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]},lW=function(e,r){var n,i=(n=e.type)!==null&&n!==void 0&&n.defaultProps?Me(Me({},e.type.defaultProps),e.props):e.props,a=i.stackId;if(Ue(a)){var o=r[a];if(o){var s=o.items.indexOf(e);return s>=0?o.stackedData[s]:null}}return null},uW=function(e){return e.reduce(function(r,n){return[bs(n.concat([r[0]]).filter(z)),_r(n.concat([r[1]]).filter(z))]},[1/0,-1/0])},hb=function(e,r,n){return Object.keys(e).reduce(function(i,a){var o=e[a],s=o.stackedData,l=s.reduce(function(u,c){var f=uW(c.slice(r,n+1));return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},pb=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,vb=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ff=function(e,r,n){if(te(e))return e(r,n);if(!Array.isArray(e))return r;var i=[];if(z(e[0]))i[0]=n?e[0]:Math.min(e[0],r[0]);else if(pb.test(e[0])){var a=+pb.exec(e[0])[1];i[0]=r[0]-a}else te(e[0])?i[0]=e[0](r[0]):i[0]=r[0];if(z(e[1]))i[1]=n?e[1]:Math.max(e[1],r[1]);else if(vb.test(e[1])){var o=+vb.exec(e[1])[1];i[1]=r[1]+o}else te(e[1])?i[1]=e[1](r[1]):i[1]=r[1];return i},Es=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=ic(r,function(f){return f.coordinate}),o=1/0,s=1,l=a.length;s<l;s++){var u=a[s],c=a[s-1];o=Math.min((u.coordinate||0)-(c.coordinate||0),o)}return o===1/0?0:o}return n?void 0:0},yb=function(e,r,n){return!e||!e.length||xr(e,ct(n,"type.defaultProps.domain"))?r:e},gb=function(e,r){var n=e.type.defaultProps?Me(Me({},e.type.defaultProps),e.props):e.props,i=n.dataKey,a=n.name,o=n.unit,s=n.formatter,l=n.tooltipType,u=n.chartType,c=n.hide;return Me(Me({},X(e,!1)),{},{dataKey:i,unit:o,formatter:s,name:a||i,color:uf(e),value:Ne(r,i),type:l,payload:r,chartType:u,hide:c})};function xa(t){"@babel/helpers - typeof";return xa=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},xa(t)}function mb(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?mb(Object(r),!0).forEach(function(n){bb(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):mb(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function bb(t,e,r){return e=cW(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function cW(t){var e=fW(t,"string");return xa(e)=="symbol"?e:e+""}function fW(t,e){if(xa(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(xa(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function dW(t,e){return yW(t)||vW(t,e)||pW(t,e)||hW()}function hW(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
73
|
+
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 wb(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 wb(t,e)}}function wb(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 vW(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,s=[],l=!0,u=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}function yW(t){if(Array.isArray(t))return t}var Ts=Math.PI/180,gW=function(e){return e*180/Math.PI},pe=function(e,r,n,i){return{x:e+Math.cos(-Ts*i)*n,y:r+Math.sin(-Ts*i)*n}},_b=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(e-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},xb=function(e,r,n,i,a){var o=e.width,s=e.height,l=e.startAngle,u=e.endAngle,c=rt(e.cx,o,o/2),f=rt(e.cy,s,s/2),d=_b(o,s,n),h=rt(e.innerRadius,d,0),y=rt(e.outerRadius,d,d*.8),v=Object.keys(r);return v.reduce(function(p,m){var w=r[m],b=w.domain,O=w.reversed,g;if(se(w.range))i==="angleAxis"?g=[l,u]:i==="radiusAxis"&&(g=[h,y]),O&&(g=[g[1],g[0]]);else{g=w.range;var _=g,S=dW(_,2);l=S[0],u=S[1]}var A=lb(w,a),E=A.realScaleType,I=A.scale;I.domain(b).range(g),cb(I);var T=fb(I,ar(ar({},w),{},{realScaleType:E})),$=ar(ar(ar({},w),T),{},{range:g,radius:y,realScaleType:E,scale:I,cx:c,cy:f,innerRadius:h,outerRadius:y,startAngle:l,endAngle:u});return ar(ar({},p),{},bb({},m,$))},{})},mW=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))},bW=function(e,r){var n=e.x,i=e.y,a=r.cx,o=r.cy,s=mW({x:n,y:i},{x:a,y:o});if(s<=0)return{radius:s};var l=(n-a)/s,u=Math.acos(l);return i>o&&(u=2*Math.PI-u),{radius:s,angle:gW(u),angleInRadian:u}},wW=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}},_W=function(e,r){var n=r.startAngle,i=r.endAngle,a=Math.floor(n/360),o=Math.floor(i/360),s=Math.min(a,o);return e+s*360},Ob=function(e,r){var n=e.x,i=e.y,a=bW({x:n,y:i},r),o=a.radius,s=a.angle,l=r.innerRadius,u=r.outerRadius;if(o<l||o>u)return!1;if(o===0)return!0;var c=wW(r),f=c.startAngle,d=c.endAngle,h=s,y;if(f<=d){for(;h>d;)h-=360;for(;h<f;)h+=360;y=h>=f&&h<=d}else{for(;h>f;)h-=360;for(;h<d;)h+=360;y=h>=d&&h<=f}return y?ar(ar({},r),{},{radius:o,angle:_W(h,r)}):null},Sb=function(e){return!x.isValidElement(e)&&!te(e)&&typeof e!="boolean"?e.className:""};function Oa(t){"@babel/helpers - typeof";return Oa=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},Oa(t)}var xW=["offset"];function OW(t){return EW(t)||PW(t)||AW(t)||SW()}function SW(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
74
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function AW(t,e){if(t){if(typeof t=="string")return df(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 df(t,e)}}function PW(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function EW(t){if(Array.isArray(t))return df(t)}function df(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 TW(t,e){if(t==null)return{};var r=$W(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 $W(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 Ab(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 We(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ab(Object(r),!0).forEach(function(n){jW(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ab(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function jW(t,e,r){return e=kW(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function kW(t){var e=CW(t,"string");return Oa(e)=="symbol"?e:e+""}function CW(t,e){if(Oa(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Oa(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Sa(){return Sa=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},Sa.apply(this,arguments)}var IW=function(e){var r=e.value,n=e.formatter,i=se(e.children)?r:e.children;return te(n)?n(i):i},NW=function(e,r){var n=tt(r-e),i=Math.min(Math.abs(r-e),360);return n*i},MW=function(e,r,n){var i=e.position,a=e.viewBox,o=e.offset,s=e.className,l=a,u=l.cx,c=l.cy,f=l.innerRadius,d=l.outerRadius,h=l.startAngle,y=l.endAngle,v=l.clockWise,p=(f+d)/2,m=NW(h,y),w=m>=0?1:-1,b,O;i==="insideStart"?(b=h+w*o,O=v):i==="insideEnd"?(b=y-w*o,O=!v):i==="end"&&(b=y+w*o,O=v),O=m<=0?O:!O;var g=pe(u,c,p,b),_=pe(u,c,p,b+(O?1:-1)*359),S="M".concat(g.x,",").concat(g.y,`
|
|
104
75
|
A`).concat(p,",").concat(p,",0,1,").concat(O?0:1,`,
|
|
105
|
-
`).concat(_.x,",").concat(_.y),A=
|
|
106
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
76
|
+
`).concat(_.x,",").concat(_.y),A=se(e.id)?Wr("recharts-radial-line-"):e.id;return x.createElement("text",Sa({},n,{dominantBaseline:"central",className:ie("recharts-radial-bar-label",s)}),x.createElement("defs",null,x.createElement("path",{id:A,d:S})),x.createElement("textPath",{xlinkHref:"#".concat(A)},r))},DW=function(e){var r=e.viewBox,n=e.offset,i=e.position,a=r,o=a.cx,s=a.cy,l=a.innerRadius,u=a.outerRadius,c=a.startAngle,f=a.endAngle,d=(c+f)/2;if(i==="outside"){var h=pe(o,s,u+n,d),y=h.x,v=h.y;return{x:y,y:v,textAnchor:y>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"end"};var p=(l+u)/2,m=pe(o,s,p,d),w=m.x,b=m.y;return{x:w,y:b,textAnchor:"middle",verticalAnchor:"middle"}},LW=function(e){var r=e.viewBox,n=e.parentViewBox,i=e.offset,a=e.position,o=r,s=o.x,l=o.y,u=o.width,c=o.height,f=c>=0?1:-1,d=f*i,h=f>0?"end":"start",y=f>0?"start":"end",v=u>=0?1:-1,p=v*i,m=v>0?"end":"start",w=v>0?"start":"end";if(a==="top"){var b={x:s+u/2,y:l-f*i,textAnchor:"middle",verticalAnchor:h};return We(We({},b),n?{height:Math.max(l-n.y,0),width:u}:{})}if(a==="bottom"){var O={x:s+u/2,y:l+c+d,textAnchor:"middle",verticalAnchor:y};return We(We({},O),n?{height:Math.max(n.y+n.height-(l+c),0),width:u}:{})}if(a==="left"){var g={x:s-p,y:l+c/2,textAnchor:m,verticalAnchor:"middle"};return We(We({},g),n?{width:Math.max(g.x-n.x,0),height:c}:{})}if(a==="right"){var _={x:s+u+p,y:l+c/2,textAnchor:w,verticalAnchor:"middle"};return We(We({},_),n?{width:Math.max(n.x+n.width-_.x,0),height:c}:{})}var S=n?{width:u,height:c}:{};return a==="insideLeft"?We({x:s+p,y:l+c/2,textAnchor:w,verticalAnchor:"middle"},S):a==="insideRight"?We({x:s+u-p,y:l+c/2,textAnchor:m,verticalAnchor:"middle"},S):a==="insideTop"?We({x:s+u/2,y:l+d,textAnchor:"middle",verticalAnchor:y},S):a==="insideBottom"?We({x:s+u/2,y:l+c-d,textAnchor:"middle",verticalAnchor:h},S):a==="insideTopLeft"?We({x:s+p,y:l+d,textAnchor:w,verticalAnchor:y},S):a==="insideTopRight"?We({x:s+u-p,y:l+d,textAnchor:m,verticalAnchor:y},S):a==="insideBottomLeft"?We({x:s+p,y:l+c-d,textAnchor:w,verticalAnchor:h},S):a==="insideBottomRight"?We({x:s+u-p,y:l+c-d,textAnchor:m,verticalAnchor:h},S):jn(a)&&(z(a.x)||Fr(a.x))&&(z(a.y)||Fr(a.y))?We({x:s+rt(a.x,u),y:l+rt(a.y,c),textAnchor:"end",verticalAnchor:"end"},S):We({x:s+u/2,y:l+c/2,textAnchor:"middle",verticalAnchor:"middle"},S)},BW=function(e){return"cx"in e&&z(e.cx)};function Ve(t){var e=t.offset,r=e===void 0?5:e,n=TW(t,xW),i=We({offset:r},n),a=i.viewBox,o=i.position,s=i.value,l=i.children,u=i.content,c=i.className,f=c===void 0?"":c,d=i.textBreakAll;if(!a||se(s)&&se(l)&&!x.isValidElement(u)&&!te(u))return null;if(x.isValidElement(u))return x.cloneElement(u,i);var h;if(te(u)){if(h=x.createElement(u,i),x.isValidElement(h))return h}else h=IW(i);var y=BW(a),v=X(i,!0);if(y&&(o==="insideStart"||o==="insideEnd"||o==="end"))return MW(i,h,v);var p=y?DW(i):LW(i);return x.createElement(Hr,Sa({className:ie("recharts-label",f)},v,p,{breakAll:d}),h)}Ve.displayName="Label";var Pb=function(e){var r=e.cx,n=e.cy,i=e.angle,a=e.startAngle,o=e.endAngle,s=e.r,l=e.radius,u=e.innerRadius,c=e.outerRadius,f=e.x,d=e.y,h=e.top,y=e.left,v=e.width,p=e.height,m=e.clockWise,w=e.labelViewBox;if(w)return w;if(z(v)&&z(p)){if(z(f)&&z(d))return{x:f,y:d,width:v,height:p};if(z(h)&&z(y))return{x:h,y,width:v,height:p}}return z(f)&&z(d)?{x:f,y:d,width:0,height:0}:z(r)&&z(n)?{cx:r,cy:n,startAngle:a||i||0,endAngle:o||i||0,innerRadius:u||0,outerRadius:c||l||s||0,clockWise:m}:e.viewBox?e.viewBox:{}},RW=function(e,r){return e?e===!0?x.createElement(Ve,{key:"label-implicit",viewBox:r}):Ue(e)?x.createElement(Ve,{key:"label-implicit",viewBox:r,value:e}):x.isValidElement(e)?e.type===Ve?x.cloneElement(e,{key:"label-implicit",viewBox:r}):x.createElement(Ve,{key:"label-implicit",content:e,viewBox:r}):te(e)?x.createElement(Ve,{key:"label-implicit",content:e,viewBox:r}):jn(e)?x.createElement(Ve,Sa({viewBox:r},e,{key:"label-implicit"})):null:null},UW=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=Pb(e),o=ft(i,Ve).map(function(l,u){return x.cloneElement(l,{viewBox:r||a,key:"label-".concat(u)})});if(!n)return o;var s=RW(e.label,r||a);return[s].concat(OW(o))};Ve.parseViewBox=Pb,Ve.renderCallByParent=UW;function FW(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var WW=FW;const Eb=we(WW);function Aa(t){"@babel/helpers - typeof";return Aa=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},Aa(t)}var qW=["valueAccessor"],zW=["data","dataKey","clockWise","id","textBreakAll"];function KW(t){return YW(t)||GW(t)||HW(t)||VW()}function VW(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
77
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HW(t,e){if(t){if(typeof t=="string")return hf(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 hf(t,e)}}function GW(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function YW(t){if(Array.isArray(t))return hf(t)}function hf(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 $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 Tb(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 $b(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Tb(Object(r),!0).forEach(function(n){XW(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Tb(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function XW(t,e,r){return e=JW(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function JW(t){var e=ZW(t,"string");return Aa(e)=="symbol"?e:e+""}function ZW(t,e){if(Aa(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Aa(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function jb(t,e){if(t==null)return{};var r=QW(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 QW(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 eq=function(e){return Array.isArray(e.value)?Eb(e.value):e.value};function It(t){var e=t.valueAccessor,r=e===void 0?eq:e,n=jb(t,qW),i=n.data,a=n.dataKey,o=n.clockWise,s=n.id,l=n.textBreakAll,u=jb(n,zW);return!i||!i.length?null:x.createElement(ce,{className:"recharts-label-list"},i.map(function(c,f){var d=se(a)?r(c,f):Ne(c&&c.payload,a),h=se(s)?{}:{id:"".concat(s,"-").concat(f)};return x.createElement(Ve,$s({},X(c,!0),u,h,{parentViewBox:c.parentViewBox,value:d,textBreakAll:l,viewBox:Ve.parseViewBox(se(o)?c:$b($b({},c),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}It.displayName="LabelList";function tq(t,e){return t?t===!0?x.createElement(It,{key:"labelList-implicit",data:e}):x.isValidElement(t)||te(t)?x.createElement(It,{key:"labelList-implicit",data:e,content:t}):jn(t)?x.createElement(It,$s({data:e},t,{key:"labelList-implicit"})):null:null}function rq(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=ft(n,It).map(function(o,s){return x.cloneElement(o,{data:e,key:"labelList-".concat(s)})});if(!r)return i;var a=tq(t.label,e);return[a].concat(KW(i))}It.renderCallByParent=rq;function Pa(t){"@babel/helpers - typeof";return Pa=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},Pa(t)}function pf(){return pf=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},pf.apply(this,arguments)}function kb(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 Cb(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?kb(Object(r),!0).forEach(function(n){nq(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):kb(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function nq(t,e,r){return e=iq(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function iq(t){var e=aq(t,"string");return Pa(e)=="symbol"?e:e+""}function aq(t,e){if(Pa(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Pa(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var oq=function(e,r){var n=tt(r-e),i=Math.min(Math.abs(r-e),359.999);return n*i},js=function(e){var r=e.cx,n=e.cy,i=e.radius,a=e.angle,o=e.sign,s=e.isExternal,l=e.cornerRadius,u=e.cornerIsExternal,c=l*(s?1:-1)+i,f=Math.asin(l/c)/Ts,d=u?a:a+o*f,h=pe(r,n,c,d),y=pe(r,n,i,d),v=u?a-o*f:a,p=pe(r,n,c*Math.cos(f*Ts),v);return{center:h,circleTangency:y,lineTangency:p,theta:f}},Ib=function(e){var r=e.cx,n=e.cy,i=e.innerRadius,a=e.outerRadius,o=e.startAngle,s=e.endAngle,l=oq(o,s),u=o+l,c=pe(r,n,a,o),f=pe(r,n,a,u),d="M ".concat(c.x,",").concat(c.y,`
|
|
107
78
|
A `).concat(a,",").concat(a,`,0,
|
|
108
|
-
`).concat(+(Math.abs(
|
|
79
|
+
`).concat(+(Math.abs(l)>180),",").concat(+(o>u),`,
|
|
109
80
|
`).concat(f.x,",").concat(f.y,`
|
|
110
|
-
`);if(i>0){var h=
|
|
81
|
+
`);if(i>0){var h=pe(r,n,i,o),y=pe(r,n,i,u);d+="L ".concat(y.x,",").concat(y.y,`
|
|
111
82
|
A `).concat(i,",").concat(i,`,0,
|
|
112
|
-
`).concat(+(Math.abs(
|
|
113
|
-
`).concat(h.x,",").concat(h.y," Z")}else d+="L ".concat(r,",").concat(n," Z");return d},
|
|
83
|
+
`).concat(+(Math.abs(l)>180),",").concat(+(o<=u),`,
|
|
84
|
+
`).concat(h.x,",").concat(h.y," Z")}else d+="L ".concat(r,",").concat(n," Z");return d},sq=function(e){var r=e.cx,n=e.cy,i=e.innerRadius,a=e.outerRadius,o=e.cornerRadius,s=e.forceCornerRadius,l=e.cornerIsExternal,u=e.startAngle,c=e.endAngle,f=tt(c-u),d=js({cx:r,cy:n,radius:a,angle:u,sign:f,cornerRadius:o,cornerIsExternal:l}),h=d.circleTangency,y=d.lineTangency,v=d.theta,p=js({cx:r,cy:n,radius:a,angle:c,sign:-f,cornerRadius:o,cornerIsExternal:l}),m=p.circleTangency,w=p.lineTangency,b=p.theta,O=l?Math.abs(u-c):Math.abs(u-c)-v-b;if(O<0)return s?"M ".concat(y.x,",").concat(y.y,`
|
|
114
85
|
a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0
|
|
115
86
|
a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0
|
|
116
|
-
`):
|
|
87
|
+
`):Ib({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:u,endAngle:c});var g="M ".concat(y.x,",").concat(y.y,`
|
|
117
88
|
A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(h.x,",").concat(h.y,`
|
|
118
89
|
A`).concat(a,",").concat(a,",0,").concat(+(O>180),",").concat(+(f<0),",").concat(m.x,",").concat(m.y,`
|
|
119
|
-
A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(
|
|
120
|
-
`);if(i>0){var _=
|
|
121
|
-
A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(
|
|
122
|
-
A`).concat(i,",").concat(i,",0,").concat(+(
|
|
123
|
-
A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(A.x,",").concat(A.y,"Z")}else g+="L".concat(r,",").concat(n,"Z");return g},
|
|
90
|
+
A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(w.x,",").concat(w.y,`
|
|
91
|
+
`);if(i>0){var _=js({cx:r,cy:n,radius:i,angle:u,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),S=_.circleTangency,A=_.lineTangency,E=_.theta,I=js({cx:r,cy:n,radius:i,angle:c,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),T=I.circleTangency,$=I.lineTangency,k=I.theta,C=l?Math.abs(u-c):Math.abs(u-c)-E-k;if(C<0&&o===0)return"".concat(g,"L").concat(r,",").concat(n,"Z");g+="L".concat($.x,",").concat($.y,`
|
|
92
|
+
A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(T.x,",").concat(T.y,`
|
|
93
|
+
A`).concat(i,",").concat(i,",0,").concat(+(C>180),",").concat(+(f>0),",").concat(S.x,",").concat(S.y,`
|
|
94
|
+
A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(A.x,",").concat(A.y,"Z")}else g+="L".concat(r,",").concat(n,"Z");return g},lq={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Nb=function(e){var r=Cb(Cb({},lq),e),n=r.cx,i=r.cy,a=r.innerRadius,o=r.outerRadius,s=r.cornerRadius,l=r.forceCornerRadius,u=r.cornerIsExternal,c=r.startAngle,f=r.endAngle,d=r.className;if(o<a||c===f)return null;var h=ie("recharts-sector",d),y=o-a,v=rt(s,y,0,!0),p;return v>0&&Math.abs(c-f)<360?p=sq({cx:n,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(v,y/2),forceCornerRadius:l,cornerIsExternal:u,startAngle:c,endAngle:f}):p=Ib({cx:n,cy:i,innerRadius:a,outerRadius:o,startAngle:c,endAngle:f}),x.createElement("path",pf({},X(r,!0),{className:h,d:p,role:"img"}))};function Ea(t){"@babel/helpers - typeof";return Ea=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},Ea(t)}function vf(){return vf=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},vf.apply(this,arguments)}function Mb(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 Db(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Mb(Object(r),!0).forEach(function(n){uq(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Mb(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function uq(t,e,r){return e=cq(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function cq(t){var e=fq(t,"string");return Ea(e)=="symbol"?e:e+""}function fq(t,e){if(Ea(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ea(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Lb={curveBasisClosed:f$,curveBasisOpen:d$,curveBasis:c$,curveBumpX:XT,curveBumpY:JT,curveLinearClosed:h$,curveLinear:ko,curveMonotoneX:p$,curveMonotoneY:v$,curveNatural:y$,curveStep:g$,curveStepAfter:b$,curveStepBefore:m$},ks=function(e){return e.x===+e.x&&e.y===+e.y},Ta=function(e){return e.x},$a=function(e){return e.y},dq=function(e,r){if(te(e))return e;var n="curve".concat(Eo(e));return(n==="curveMonotone"||n==="curveBump")&&r?Lb["".concat(n).concat(r==="vertical"?"Y":"X")]:Lb[n]||ko},hq=function(e){var r=e.type,n=r===void 0?"linear":r,i=e.points,a=i===void 0?[]:i,o=e.baseLine,s=e.layout,l=e.connectNulls,u=l===void 0?!1:l,c=dq(n,s),f=u?a.filter(function(v){return ks(v)}):a,d;if(Array.isArray(o)){var h=u?o.filter(function(v){return ks(v)}):o,y=f.map(function(v,p){return Db(Db({},v),{},{base:h[p]})});return s==="vertical"?d=Co().y($a).x1(Ta).x0(function(v){return v.base.x}):d=Co().x(Ta).y1($a).y0(function(v){return v.base.y}),d.defined(ks).curve(c),d(y)}return s==="vertical"&&z(o)?d=Co().y($a).x1(Ta).x0(o):z(o)?d=Co().x(Ta).y1($a).y0(o):d=hv().x(Ta).y($a),d.defined(ks).curve(c),d(f)},nn=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?hq(e):i;return fe.createElement("path",vf({},X(e,!1),Po(e),{className:ie("recharts-curve",r),d:o,ref:a}))},yf={exports:{}},Cs={exports:{}},ge={};/** @license React v16.13.1
|
|
124
95
|
* react-is.production.min.js
|
|
125
96
|
*
|
|
126
97
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
127
98
|
*
|
|
128
99
|
* This source code is licensed under the MIT license found in the
|
|
129
100
|
* LICENSE file in the root directory of this source tree.
|
|
130
|
-
*/var
|
|
101
|
+
*/var Bb;function pq(){if(Bb)return ge;Bb=1;var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,r=t?Symbol.for("react.portal"):60106,n=t?Symbol.for("react.fragment"):60107,i=t?Symbol.for("react.strict_mode"):60108,a=t?Symbol.for("react.profiler"):60114,o=t?Symbol.for("react.provider"):60109,s=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,u=t?Symbol.for("react.concurrent_mode"):60111,c=t?Symbol.for("react.forward_ref"):60112,f=t?Symbol.for("react.suspense"):60113,d=t?Symbol.for("react.suspense_list"):60120,h=t?Symbol.for("react.memo"):60115,y=t?Symbol.for("react.lazy"):60116,v=t?Symbol.for("react.block"):60121,p=t?Symbol.for("react.fundamental"):60117,m=t?Symbol.for("react.responder"):60118,w=t?Symbol.for("react.scope"):60119;function b(g){if(typeof g=="object"&&g!==null){var _=g.$$typeof;switch(_){case e:switch(g=g.type,g){case l:case u:case n:case a:case i:case f:return g;default:switch(g=g&&g.$$typeof,g){case s:case c:case y:case h:case o:return g;default:return _}}case r:return _}}}function O(g){return b(g)===u}return ge.AsyncMode=l,ge.ConcurrentMode=u,ge.ContextConsumer=s,ge.ContextProvider=o,ge.Element=e,ge.ForwardRef=c,ge.Fragment=n,ge.Lazy=y,ge.Memo=h,ge.Portal=r,ge.Profiler=a,ge.StrictMode=i,ge.Suspense=f,ge.isAsyncMode=function(g){return O(g)||b(g)===l},ge.isConcurrentMode=O,ge.isContextConsumer=function(g){return b(g)===s},ge.isContextProvider=function(g){return b(g)===o},ge.isElement=function(g){return typeof g=="object"&&g!==null&&g.$$typeof===e},ge.isForwardRef=function(g){return b(g)===c},ge.isFragment=function(g){return b(g)===n},ge.isLazy=function(g){return b(g)===y},ge.isMemo=function(g){return b(g)===h},ge.isPortal=function(g){return b(g)===r},ge.isProfiler=function(g){return b(g)===a},ge.isStrictMode=function(g){return b(g)===i},ge.isSuspense=function(g){return b(g)===f},ge.isValidElementType=function(g){return typeof g=="string"||typeof g=="function"||g===n||g===u||g===a||g===i||g===f||g===d||typeof g=="object"&&g!==null&&(g.$$typeof===y||g.$$typeof===h||g.$$typeof===o||g.$$typeof===s||g.$$typeof===c||g.$$typeof===p||g.$$typeof===m||g.$$typeof===w||g.$$typeof===v)},ge.typeOf=b,ge}var me={};/** @license React v16.13.1
|
|
131
102
|
* react-is.development.js
|
|
132
103
|
*
|
|
133
104
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
134
105
|
*
|
|
135
106
|
* This source code is licensed under the MIT license found in the
|
|
136
107
|
* LICENSE file in the root directory of this source tree.
|
|
137
|
-
*/var
|
|
108
|
+
*/var Rb;function vq(){return Rb||(Rb=1,process.env.NODE_ENV!=="production"&&function(){var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,r=t?Symbol.for("react.portal"):60106,n=t?Symbol.for("react.fragment"):60107,i=t?Symbol.for("react.strict_mode"):60108,a=t?Symbol.for("react.profiler"):60114,o=t?Symbol.for("react.provider"):60109,s=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,u=t?Symbol.for("react.concurrent_mode"):60111,c=t?Symbol.for("react.forward_ref"):60112,f=t?Symbol.for("react.suspense"):60113,d=t?Symbol.for("react.suspense_list"):60120,h=t?Symbol.for("react.memo"):60115,y=t?Symbol.for("react.lazy"):60116,v=t?Symbol.for("react.block"):60121,p=t?Symbol.for("react.fundamental"):60117,m=t?Symbol.for("react.responder"):60118,w=t?Symbol.for("react.scope"):60119;function b(j){return typeof j=="string"||typeof j=="function"||j===n||j===u||j===a||j===i||j===f||j===d||typeof j=="object"&&j!==null&&(j.$$typeof===y||j.$$typeof===h||j.$$typeof===o||j.$$typeof===s||j.$$typeof===c||j.$$typeof===p||j.$$typeof===m||j.$$typeof===w||j.$$typeof===v)}function O(j){if(typeof j=="object"&&j!==null){var de=j.$$typeof;switch(de){case e:var K=j.type;switch(K){case l:case u:case n:case a:case i:case f:return K;default:var Pe=K&&K.$$typeof;switch(Pe){case s:case c:case y:case h:case o:return Pe;default:return de}}case r:return de}}}var g=l,_=u,S=s,A=o,E=e,I=c,T=n,$=y,k=h,C=r,D=a,N=i,L=f,W=!1;function q(j){return W||(W=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),M(j)||O(j)===l}function M(j){return O(j)===u}function R(j){return O(j)===s}function U(j){return O(j)===o}function V(j){return typeof j=="object"&&j!==null&&j.$$typeof===e}function G(j){return O(j)===c}function ee(j){return O(j)===n}function re(j){return O(j)===y}function le(j){return O(j)===h}function ae(j){return O(j)===r}function F(j){return O(j)===a}function H(j){return O(j)===i}function Q(j){return O(j)===f}me.AsyncMode=g,me.ConcurrentMode=_,me.ContextConsumer=S,me.ContextProvider=A,me.Element=E,me.ForwardRef=I,me.Fragment=T,me.Lazy=$,me.Memo=k,me.Portal=C,me.Profiler=D,me.StrictMode=N,me.Suspense=L,me.isAsyncMode=q,me.isConcurrentMode=M,me.isContextConsumer=R,me.isContextProvider=U,me.isElement=V,me.isForwardRef=G,me.isFragment=ee,me.isLazy=re,me.isMemo=le,me.isPortal=ae,me.isProfiler=F,me.isStrictMode=H,me.isSuspense=Q,me.isValidElementType=b,me.typeOf=O}()),me}var Ub;function Fb(){return Ub||(Ub=1,process.env.NODE_ENV==="production"?Cs.exports=pq():Cs.exports=vq()),Cs.exports}/*
|
|
138
109
|
object-assign
|
|
139
110
|
(c) Sindre Sorhus
|
|
140
111
|
@license MIT
|
|
141
|
-
*/var
|
|
142
|
-
Valid keys: `+JSON.stringify(Object.keys(
|
|
143
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
144
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
145
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
146
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
147
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
148
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
149
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
150
|
-
`).concat(e+n,",").concat(r+s*f[1])),c+="L ".concat(e+n,",").concat(r+i-s*f[2]),f[2]>0&&(c+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(
|
|
151
|
-
`).concat(e+n-
|
|
112
|
+
*/var gf,Wb;function yq(){if(Wb)return gf;Wb=1;var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function n(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function i(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var o={},s=0;s<10;s++)o["_"+String.fromCharCode(s)]=s;var l=Object.getOwnPropertyNames(o).map(function(c){return o[c]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(c){u[c]=c}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return gf=i()?Object.assign:function(a,o){for(var s,l=n(a),u,c=1;c<arguments.length;c++){s=Object(arguments[c]);for(var f in s)e.call(s,f)&&(l[f]=s[f]);if(t){u=t(s);for(var d=0;d<u.length;d++)r.call(s,u[d])&&(l[u[d]]=s[u[d]])}}return l},gf}var mf,qb;function bf(){if(qb)return mf;qb=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return mf=t,mf}var wf,zb;function Kb(){return zb||(zb=1,wf=Function.call.bind(Object.prototype.hasOwnProperty)),wf}var _f,Vb;function gq(){if(Vb)return _f;Vb=1;var t=function(){};if(process.env.NODE_ENV!=="production"){var e=bf(),r={},n=Kb();t=function(a){var o="Warning: "+a;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function i(a,o,s,l,u){if(process.env.NODE_ENV!=="production"){for(var c in a)if(n(a,c)){var f;try{if(typeof a[c]!="function"){var d=Error((l||"React class")+": "+s+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}f=a[c](o,c,l,s,null,e)}catch(y){f=y}if(f&&!(f instanceof Error)&&t((l||"React class")+": type specification of "+s+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in r)){r[f.message]=!0;var h=u?u():"";t("Failed "+s+" type: "+f.message+(h??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(r={})},_f=i,_f}var xf,Hb;function mq(){if(Hb)return xf;Hb=1;var t=Fb(),e=yq(),r=bf(),n=Kb(),i=gq(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(s){var l="Warning: "+s;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function o(){return null}return xf=function(s,l){var u=typeof Symbol=="function"&&Symbol.iterator,c="@@iterator";function f(M){var R=M&&(u&&M[u]||M[c]);if(typeof R=="function")return R}var d="<<anonymous>>",h={array:m("array"),bigint:m("bigint"),bool:m("boolean"),func:m("function"),number:m("number"),object:m("object"),string:m("string"),symbol:m("symbol"),any:w(),arrayOf:b,element:O(),elementType:g(),instanceOf:_,node:I(),objectOf:A,oneOf:S,oneOfType:E,shape:$,exact:k};function y(M,R){return M===R?M!==0||1/M===1/R:M!==M&&R!==R}function v(M,R){this.message=M,this.data=R&&typeof R=="object"?R:{},this.stack=""}v.prototype=Error.prototype;function p(M){if(process.env.NODE_ENV!=="production")var R={},U=0;function V(ee,re,le,ae,F,H,Q){if(ae=ae||d,H=H||le,Q!==r){if(l){var j=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 j.name="Invariant Violation",j}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var de=ae+":"+le;!R[de]&&U<3&&(a("You are manually calling a React.PropTypes validation function for the `"+H+"` prop on `"+ae+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),R[de]=!0,U++)}}return re[le]==null?ee?re[le]===null?new v("The "+F+" `"+H+"` is marked as required "+("in `"+ae+"`, but its value is `null`.")):new v("The "+F+" `"+H+"` is marked as required in "+("`"+ae+"`, but its value is `undefined`.")):null:M(re,le,ae,F,H)}var G=V.bind(null,!1);return G.isRequired=V.bind(null,!0),G}function m(M){function R(U,V,G,ee,re,le){var ae=U[V],F=N(ae);if(F!==M){var H=L(ae);return new v("Invalid "+ee+" `"+re+"` of type "+("`"+H+"` supplied to `"+G+"`, expected ")+("`"+M+"`."),{expectedType:M})}return null}return p(R)}function w(){return p(o)}function b(M){function R(U,V,G,ee,re){if(typeof M!="function")return new v("Property `"+re+"` of component `"+G+"` has invalid PropType notation inside arrayOf.");var le=U[V];if(!Array.isArray(le)){var ae=N(le);return new v("Invalid "+ee+" `"+re+"` of type "+("`"+ae+"` supplied to `"+G+"`, expected an array."))}for(var F=0;F<le.length;F++){var H=M(le,F,G,ee,re+"["+F+"]",r);if(H instanceof Error)return H}return null}return p(R)}function O(){function M(R,U,V,G,ee){var re=R[U];if(!s(re)){var le=N(re);return new v("Invalid "+G+" `"+ee+"` of type "+("`"+le+"` supplied to `"+V+"`, expected a single ReactElement."))}return null}return p(M)}function g(){function M(R,U,V,G,ee){var re=R[U];if(!t.isValidElementType(re)){var le=N(re);return new v("Invalid "+G+" `"+ee+"` of type "+("`"+le+"` supplied to `"+V+"`, expected a single ReactElement type."))}return null}return p(M)}function _(M){function R(U,V,G,ee,re){if(!(U[V]instanceof M)){var le=M.name||d,ae=q(U[V]);return new v("Invalid "+ee+" `"+re+"` of type "+("`"+ae+"` supplied to `"+G+"`, expected ")+("instance of `"+le+"`."))}return null}return p(R)}function S(M){if(!Array.isArray(M))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):a("Invalid argument supplied to oneOf, expected an array.")),o;function R(U,V,G,ee,re){for(var le=U[V],ae=0;ae<M.length;ae++)if(y(le,M[ae]))return null;var F=JSON.stringify(M,function(Q,j){var de=L(j);return de==="symbol"?String(j):j});return new v("Invalid "+ee+" `"+re+"` of value `"+String(le)+"` "+("supplied to `"+G+"`, expected one of "+F+"."))}return p(R)}function A(M){function R(U,V,G,ee,re){if(typeof M!="function")return new v("Property `"+re+"` of component `"+G+"` has invalid PropType notation inside objectOf.");var le=U[V],ae=N(le);if(ae!=="object")return new v("Invalid "+ee+" `"+re+"` of type "+("`"+ae+"` supplied to `"+G+"`, expected an object."));for(var F in le)if(n(le,F)){var H=M(le,F,G,ee,re+"."+F,r);if(H instanceof Error)return H}return null}return p(R)}function E(M){if(!Array.isArray(M))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var R=0;R<M.length;R++){var U=M[R];if(typeof U!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+W(U)+" at index "+R+"."),o}function V(G,ee,re,le,ae){for(var F=[],H=0;H<M.length;H++){var Q=M[H],j=Q(G,ee,re,le,ae,r);if(j==null)return null;j.data&&n(j.data,"expectedType")&&F.push(j.data.expectedType)}var de=F.length>0?", expected one of type ["+F.join(", ")+"]":"";return new v("Invalid "+le+" `"+ae+"` supplied to "+("`"+re+"`"+de+"."))}return p(V)}function I(){function M(R,U,V,G,ee){return C(R[U])?null:new v("Invalid "+G+" `"+ee+"` supplied to "+("`"+V+"`, expected a ReactNode."))}return p(M)}function T(M,R,U,V,G){return new v((M||"React class")+": "+R+" type `"+U+"."+V+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+G+"`.")}function $(M){function R(U,V,G,ee,re){var le=U[V],ae=N(le);if(ae!=="object")return new v("Invalid "+ee+" `"+re+"` of type `"+ae+"` "+("supplied to `"+G+"`, expected `object`."));for(var F in M){var H=M[F];if(typeof H!="function")return T(G,ee,re,F,L(H));var Q=H(le,F,G,ee,re+"."+F,r);if(Q)return Q}return null}return p(R)}function k(M){function R(U,V,G,ee,re){var le=U[V],ae=N(le);if(ae!=="object")return new v("Invalid "+ee+" `"+re+"` of type `"+ae+"` "+("supplied to `"+G+"`, expected `object`."));var F=e({},U[V],M);for(var H in F){var Q=M[H];if(n(M,H)&&typeof Q!="function")return T(G,ee,re,H,L(Q));if(!Q)return new v("Invalid "+ee+" `"+re+"` key `"+H+"` supplied to `"+G+"`.\nBad object: "+JSON.stringify(U[V],null," ")+`
|
|
113
|
+
Valid keys: `+JSON.stringify(Object.keys(M),null," "));var j=Q(le,H,G,ee,re+"."+H,r);if(j)return j}return null}return p(R)}function C(M){switch(typeof M){case"number":case"string":case"undefined":return!0;case"boolean":return!M;case"object":if(Array.isArray(M))return M.every(C);if(M===null||s(M))return!0;var R=f(M);if(R){var U=R.call(M),V;if(R!==M.entries){for(;!(V=U.next()).done;)if(!C(V.value))return!1}else for(;!(V=U.next()).done;){var G=V.value;if(G&&!C(G[1]))return!1}}else return!1;return!0;default:return!1}}function D(M,R){return M==="symbol"?!0:R?R["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&R instanceof Symbol:!1}function N(M){var R=typeof M;return Array.isArray(M)?"array":M instanceof RegExp?"object":D(R,M)?"symbol":R}function L(M){if(typeof M>"u"||M===null)return""+M;var R=N(M);if(R==="object"){if(M instanceof Date)return"date";if(M instanceof RegExp)return"regexp"}return R}function W(M){var R=L(M);switch(R){case"array":case"object":return"an "+R;case"boolean":case"date":case"regexp":return"a "+R;default:return R}}function q(M){return!M.constructor||!M.constructor.name?d:M.constructor.name}return h.checkPropTypes=i,h.resetWarningCache=i.resetWarningCache,h.PropTypes=h,h},xf}var Of,Gb;function bq(){if(Gb)return Of;Gb=1;var t=bf();function e(){}function r(){}return r.resetWarningCache=e,Of=function(){function n(o,s,l,u,c,f){if(f!==t){var d=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 d.name="Invariant Violation",d}}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},Of}if(process.env.NODE_ENV!=="production"){var wq=Fb(),_q=!0;yf.exports=mq()(wq.isElement,_q)}else yf.exports=bq()();var xq=yf.exports;const be=we(xq);var Oq=Object.getOwnPropertyNames,Sq=Object.getOwnPropertySymbols,Aq=Object.prototype.hasOwnProperty;function Yb(t,e){return function(n,i,a){return t(n,i,a)&&e(n,i,a)}}function Is(t){return function(r,n,i){if(!r||!n||typeof r!="object"||typeof n!="object")return t(r,n,i);var a=i.cache,o=a.get(r),s=a.get(n);if(o&&s)return o===n&&s===r;a.set(r,n),a.set(n,r);var l=t(r,n,i);return a.delete(r),a.delete(n),l}}function Xb(t){return Oq(t).concat(Sq(t))}var Pq=Object.hasOwn||function(t,e){return Aq.call(t,e)};function an(t,e){return t===e||!t&&!e&&t!==t&&e!==e}var Eq="__v",Tq="__o",$q="_owner",Jb=Object.getOwnPropertyDescriptor,Zb=Object.keys;function jq(t,e,r){var 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 kq(t,e){return an(t.getTime(),e.getTime())}function Cq(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function Iq(t,e){return t===e}function Qb(t,e,r){var n=t.size;if(n!==e.size)return!1;if(!n)return!0;for(var i=new Array(n),a=t.entries(),o,s,l=0;(o=a.next())&&!o.done;){for(var u=e.entries(),c=!1,f=0;(s=u.next())&&!s.done;){if(i[f]){f++;continue}var d=o.value,h=s.value;if(r.equals(d[0],h[0],l,f,t,e,r)&&r.equals(d[1],h[1],d[0],h[0],t,e,r)){c=i[f]=!0;break}f++}if(!c)return!1;l++}return!0}var Nq=an;function Mq(t,e,r){var n=Zb(t),i=n.length;if(Zb(e).length!==i)return!1;for(;i-- >0;)if(!t0(t,e,r,n[i]))return!1;return!0}function ja(t,e,r){var n=Xb(t),i=n.length;if(Xb(e).length!==i)return!1;for(var a,o,s;i-- >0;)if(a=n[i],!t0(t,e,r,a)||(o=Jb(t,a),s=Jb(e,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function Dq(t,e){return an(t.valueOf(),e.valueOf())}function Lq(t,e){return t.source===e.source&&t.flags===e.flags}function e0(t,e,r){var n=t.size;if(n!==e.size)return!1;if(!n)return!0;for(var i=new Array(n),a=t.values(),o,s;(o=a.next())&&!o.done;){for(var l=e.values(),u=!1,c=0;(s=l.next())&&!s.done;){if(!i[c]&&r.equals(o.value,s.value,o.value,s.value,t,e,r)){u=i[c]=!0;break}c++}if(!u)return!1}return!0}function Bq(t,e){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(t[r]!==e[r])return!1;return!0}function Rq(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 t0(t,e,r,n){return(n===$q||n===Tq||n===Eq)&&(t.$$typeof||e.$$typeof)?!0:Pq(e,n)&&r.equals(t[n],e[n],n,n,t,e,r)}var Uq="[object Arguments]",Fq="[object Boolean]",Wq="[object Date]",qq="[object Error]",zq="[object Map]",Kq="[object Number]",Vq="[object Object]",Hq="[object RegExp]",Gq="[object Set]",Yq="[object String]",Xq="[object URL]",Jq=Array.isArray,r0=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,n0=Object.assign,Zq=Object.prototype.toString.call.bind(Object.prototype.toString);function Qq(t){var e=t.areArraysEqual,r=t.areDatesEqual,n=t.areErrorsEqual,i=t.areFunctionsEqual,a=t.areMapsEqual,o=t.areNumbersEqual,s=t.areObjectsEqual,l=t.arePrimitiveWrappersEqual,u=t.areRegExpsEqual,c=t.areSetsEqual,f=t.areTypedArraysEqual,d=t.areUrlsEqual;return function(y,v,p){if(y===v)return!0;if(y==null||v==null)return!1;var m=typeof y;if(m!==typeof v)return!1;if(m!=="object")return m==="number"?o(y,v,p):m==="function"?i(y,v,p):!1;var w=y.constructor;if(w!==v.constructor)return!1;if(w===Object)return s(y,v,p);if(Jq(y))return e(y,v,p);if(r0!=null&&r0(y))return f(y,v,p);if(w===Date)return r(y,v,p);if(w===RegExp)return u(y,v,p);if(w===Map)return a(y,v,p);if(w===Set)return c(y,v,p);var b=Zq(y);return b===Wq?r(y,v,p):b===Hq?u(y,v,p):b===zq?a(y,v,p):b===Gq?c(y,v,p):b===Vq?typeof y.then!="function"&&typeof v.then!="function"&&s(y,v,p):b===Xq?d(y,v,p):b===qq?n(y,v,p):b===Uq?s(y,v,p):b===Fq||b===Kq||b===Yq?l(y,v,p):!1}}function ez(t){var e=t.circular,r=t.createCustomConfig,n=t.strict,i={areArraysEqual:n?ja:jq,areDatesEqual:kq,areErrorsEqual:Cq,areFunctionsEqual:Iq,areMapsEqual:n?Yb(Qb,ja):Qb,areNumbersEqual:Nq,areObjectsEqual:n?ja:Mq,arePrimitiveWrappersEqual:Dq,areRegExpsEqual:Lq,areSetsEqual:n?Yb(e0,ja):e0,areTypedArraysEqual:n?ja:Bq,areUrlsEqual:Rq};if(r&&(i=n0({},i,r(i))),e){var a=Is(i.areArraysEqual),o=Is(i.areMapsEqual),s=Is(i.areObjectsEqual),l=Is(i.areSetsEqual);i=n0({},i,{areArraysEqual:a,areMapsEqual:o,areObjectsEqual:s,areSetsEqual:l})}return i}function tz(t){return function(e,r,n,i,a,o,s){return t(e,r,s)}}function rz(t){var e=t.circular,r=t.comparator,n=t.createState,i=t.equals,a=t.strict;if(n)return function(l,u){var c=n(),f=c.cache,d=f===void 0?e?new WeakMap:void 0:f,h=c.meta;return r(l,u,{cache:d,equals:i,meta:h,strict:a})};if(e)return function(l,u){return r(l,u,{cache:new WeakMap,equals:i,meta:void 0,strict:a})};var o={cache:void 0,equals:i,meta:void 0,strict:a};return function(l,u){return r(l,u,o)}}var nz=Sr();Sr({strict:!0}),Sr({circular:!0}),Sr({circular:!0,strict:!0}),Sr({createInternalComparator:function(){return an}}),Sr({strict:!0,createInternalComparator:function(){return an}}),Sr({circular:!0,createInternalComparator:function(){return an}}),Sr({circular:!0,createInternalComparator:function(){return an},strict:!0});function Sr(t){t===void 0&&(t={});var e=t.circular,r=e===void 0?!1:e,n=t.createInternalComparator,i=t.createState,a=t.strict,o=a===void 0?!1:a,s=ez(t),l=Qq(s),u=n?n(l):tz(l);return rz({circular:r,comparator:l,createState:i,equals:u,strict:o})}function iz(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function i0(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):iz(i)};requestAnimationFrame(n)}function Sf(t){"@babel/helpers - typeof";return Sf=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},Sf(t)}function az(t){return uz(t)||lz(t)||sz(t)||oz()}function oz(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
114
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sz(t,e){if(t){if(typeof t=="string")return a0(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 a0(t,e)}}function a0(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 lz(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function uz(t){if(Array.isArray(t))return t}function cz(){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,s=az(o),l=s[0],u=s.slice(1);if(typeof l=="number"){i0(i.bind(null,u),l);return}i(l),i0(i.bind(null,u));return}Sf(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 ka(t){"@babel/helpers - typeof";return ka=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},ka(t)}function o0(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 s0(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?o0(Object(r),!0).forEach(function(n){l0(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o0(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function l0(t,e,r){return e=fz(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fz(t){var e=dz(t,"string");return ka(e)==="symbol"?e:String(e)}function dz(t,e){if(ka(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ka(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var hz=function(e,r){return[Object.keys(e),Object.keys(r)].reduce(function(n,i){return n.filter(function(a){return i.includes(a)})})},pz=function(e){return e},vz=function(e){return e.replace(/([A-Z])/g,function(r){return"-".concat(r.toLowerCase())})},Ca=function(e,r){return Object.keys(r).reduce(function(n,i){return s0(s0({},n),{},l0({},i,e(i,r[i])))},{})},u0=function(e,r,n){return e.map(function(i){return"".concat(vz(i)," ").concat(r,"ms ").concat(n)}).join(",")},yz=process.env.NODE_ENV!=="production",Ns=function(e,r,n,i,a,o,s,l){if(yz&&typeof console<"u"&&console.warn&&(r===void 0&&console.warn("LogUtils requires an error message argument"),!e))if(r===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,i,a,o,s,l],c=0;console.warn(r.replace(/%s/g,function(){return u[c++]}))}};function gz(t,e){return wz(t)||bz(t,e)||c0(t,e)||mz()}function mz(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
115
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bz(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,s=[],l=!0,u=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}function wz(t){if(Array.isArray(t))return t}function _z(t){return Sz(t)||Oz(t)||c0(t)||xz()}function xz(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
116
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function c0(t,e){if(t){if(typeof t=="string")return Af(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 Af(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 Af(t)}function Af(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 Ms=1e-4,f0=function(e,r){return[0,3*e,3*r-6*e,3*e-3*r+1]},d0=function(e,r){return e.map(function(n,i){return n*Math.pow(r,i)}).reduce(function(n,i){return n+i})},h0=function(e,r){return function(n){var i=f0(e,r);return d0(i,n)}},Az=function(e,r){return function(n){var i=f0(e,r),a=[].concat(_z(i.map(function(o,s){return o*s}).slice(1)),[0]);return d0(a,n)}},p0=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],s=r[3];if(r.length===1)switch(r[0]){case"linear":i=0,a=0,o=1,s=1;break;case"ease":i=.25,a=.1,o=.25,s=1;break;case"ease-in":i=.42,a=0,o=1,s=1;break;case"ease-out":i=.42,a=0,o=.58,s=1;break;case"ease-in-out":i=0,a=0,o=.58,s=1;break;default:{var l=r[0].split("(");if(l[0]==="cubic-bezier"&&l[1].split(")")[0].split(",").length===4){var u=l[1].split(")")[0].split(",").map(function(p){return parseFloat(p)}),c=gz(u,4);i=c[0],a=c[1],o=c[2],s=c[3]}else Ns(!1,"[configBezier]: arguments should be one of oneOf 'linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out','cubic-bezier(x1,y1,x2,y2)', instead received %s",r)}}Ns([i,o,a,s].every(function(p){return typeof p=="number"&&p>=0&&p<=1}),"[configBezier]: arguments should be x1, y1, x2, y2 of [0, 1] instead received %s",r);var f=h0(i,o),d=h0(a,s),h=Az(i,o),y=function(m){return m>1?1:m<0?0:m},v=function(m){for(var w=m>1?1:m,b=w,O=0;O<8;++O){var g=f(b)-w,_=h(b);if(Math.abs(g-w)<Ms||_<Ms)return d(b);b=y(b-g/_)}return d(b)};return v.isStepper=!1,v},Pz=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,s=o===void 0?17:o,l=function(c,f,d){var h=-(c-f)*n,y=d*a,v=d+(h-y)*s/1e3,p=d*s/1e3+c;return Math.abs(p-f)<Ms&&Math.abs(v)<Ms?[f,0]:[p,v]};return l.isStepper=!0,l.dt=s,l},Ez=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 p0(i);case"spring":return Pz();default:if(i.split("(")[0]==="cubic-bezier")return p0(i);Ns(!1,"[configEasing]: first argument should be one of 'ease', 'ease-in', 'ease-out', 'ease-in-out','cubic-bezier(x1,y1,x2,y2)', 'linear' and 'spring', instead received %s",r)}return typeof i=="function"?i:(Ns(!1,"[configEasing]: first argument type should be function or string, instead received %s",r),null)};function Ia(t){"@babel/helpers - typeof";return Ia=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},Ia(t)}function v0(t){return jz(t)||$z(t)||g0(t)||Tz()}function Tz(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
117
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $z(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function jz(t){if(Array.isArray(t))return Ef(t)}function y0(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 Ge(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?y0(Object(r),!0).forEach(function(n){Pf(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):y0(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Pf(t,e,r){return e=kz(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function kz(t){var e=Cz(t,"string");return Ia(e)==="symbol"?e:String(e)}function Cz(t,e){if(Ia(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ia(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Iz(t,e){return Dz(t)||Mz(t,e)||g0(t,e)||Nz()}function Nz(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
118
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function g0(t,e){if(t){if(typeof t=="string")return Ef(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 Ef(t,e)}}function Ef(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 Mz(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,s=[],l=!0,u=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}function Dz(t){if(Array.isArray(t))return t}var Ds=function(e,r,n){return e+(r-e)*n},Tf=function(e){var r=e.from,n=e.to;return r!==n},Lz=function t(e,r,n){var i=Ca(function(a,o){if(Tf(o)){var s=e(o.from,o.to,o.velocity),l=Iz(s,2),u=l[0],c=l[1];return Ge(Ge({},o),{},{from:u,velocity:c})}return o},r);return n<1?Ca(function(a,o){return Tf(o)?Ge(Ge({},o),{},{velocity:Ds(o.velocity,i[a].velocity,n),from:Ds(o.from,i[a].from,n)}):o},r):t(e,i,n-1)};const Bz=function(t,e,r,n,i){var a=hz(t,e),o=a.reduce(function(p,m){return Ge(Ge({},p),{},Pf({},m,[t[m],e[m]]))},{}),s=a.reduce(function(p,m){return Ge(Ge({},p),{},Pf({},m,{from:t[m],velocity:0,to:e[m]}))},{}),l=-1,u,c,f=function(){return null},d=function(){return Ca(function(m,w){return w.from},s)},h=function(){return!Object.values(s).filter(Tf).length},y=function(m){u||(u=m);var w=m-u,b=w/r.dt;s=Lz(r,s,b),i(Ge(Ge(Ge({},t),e),d())),u=m,h()||(l=requestAnimationFrame(f))},v=function(m){c||(c=m);var w=(m-c)/n,b=Ca(function(g,_){return Ds.apply(void 0,v0(_).concat([r(w)]))},o);if(i(Ge(Ge(Ge({},t),e),b)),w<1)l=requestAnimationFrame(f);else{var O=Ca(function(g,_){return Ds.apply(void 0,v0(_).concat([r(1)]))},o);i(Ge(Ge(Ge({},t),e),O))}};return f=r.isStepper?y:v,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(l)}}};function ri(t){"@babel/helpers - typeof";return ri=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},ri(t)}var Rz=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function Uz(t,e){if(t==null)return{};var r=Fz(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 Fz(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 $f(t){return Kz(t)||zz(t)||qz(t)||Wz()}function Wz(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
119
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qz(t,e){if(t){if(typeof t=="string")return jf(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 jf(t,e)}}function zz(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Kz(t){if(Array.isArray(t))return jf(t)}function jf(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 m0(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 Nt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?m0(Object(r),!0).forEach(function(n){Na(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):m0(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Na(t,e,r){return e=b0(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Vz(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Hz(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,b0(n.key),n)}}function Gz(t,e,r){return e&&Hz(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function b0(t){var e=Yz(t,"string");return ri(e)==="symbol"?e:String(e)}function Yz(t,e){if(ri(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ri(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Xz(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&&kf(t,e)}function kf(t,e){return kf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},kf(t,e)}function Jz(t){var e=Zz();return function(){var n=Ls(t),i;if(e){var a=Ls(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Cf(this,i)}}function Cf(t,e){if(e&&(ri(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return If(t)}function If(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Zz(){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 Ls(t){return Ls=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ls(t)}var St=function(t){Xz(r,t);var e=Jz(r);function r(n,i){var a;Vz(this,r),a=e.call(this,n,i);var o=a.props,s=o.isActive,l=o.attributeName,u=o.from,c=o.to,f=o.steps,d=o.children,h=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(If(a)),a.changeStyle=a.changeStyle.bind(If(a)),!s||h<=0)return a.state={style:{}},typeof d=="function"&&(a.state={style:c}),Cf(a);if(f&&f.length)a.state={style:f[0].style};else if(u){if(typeof d=="function")return a.state={style:u},Cf(a);a.state={style:l?Na({},l,u):u}}else a.state={style:{}};return a}return Gz(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,s=a.canBegin,l=a.attributeName,u=a.shouldReAnimate,c=a.to,f=a.from,d=this.state.style;if(s){if(!o){var h={style:l?Na({},l,c):c};this.state&&d&&(l&&d[l]!==c||!l&&d!==c)&&this.setState(h);return}if(!(nz(i.to,c)&&i.canBegin&&i.isActive)){var y=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var v=y||u?f:i.to;if(this.state&&d){var p={style:l?Na({},l,v):v};(l&&d[l]!==v||!l&&d!==v)&&this.setState(p)}this.runAnimation(Nt(Nt({},this.props),{},{from:v,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,s=i.to,l=i.duration,u=i.easing,c=i.begin,f=i.onAnimationEnd,d=i.onAnimationStart,h=Bz(o,s,Ez(u),l,this.changeStyle),y=function(){a.stopJSAnimation=h()};this.manager.start([d,c,y,l,f])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,s=i.begin,l=i.onAnimationStart,u=o[0],c=u.style,f=u.duration,d=f===void 0?0:f,h=function(v,p,m){if(m===0)return v;var w=p.duration,b=p.easing,O=b===void 0?"ease":b,g=p.style,_=p.properties,S=p.onAnimationEnd,A=m>0?o[m-1]:p,E=_||Object.keys(g);if(typeof O=="function"||O==="spring")return[].concat($f(v),[a.runJSAnimation.bind(a,{from:A.style,to:g,duration:w,easing:O}),w]);var I=u0(E,w,O),T=Nt(Nt(Nt({},A.style),g),{},{transition:I});return[].concat($f(v),[T,w,S]).filter(pz)};return this.manager.start([l].concat($f(o.reduce(h,[c,Math.max(d,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=cz());var a=i.begin,o=i.duration,s=i.attributeName,l=i.to,u=i.easing,c=i.onAnimationStart,f=i.onAnimationEnd,d=i.steps,h=i.children,y=this.manager;if(this.unSubscribe=y.subscribe(this.handleStyleChange),typeof u=="function"||typeof h=="function"||u==="spring"){this.runJSAnimation(i);return}if(d.length>1){this.runStepAnimation(i);return}var v=s?Na({},s,l):l,p=u0(Object.keys(v),o,u);y.start([c,a,Nt(Nt({},v),{},{transition:p}),o,f])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var s=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=Uz(i,Rz),u=x.Children.count(a),c=this.state.style;if(typeof a=="function")return a(c);if(!s||u===0||o<=0)return a;var f=function(h){var y=h.props,v=y.style,p=v===void 0?{}:v,m=y.className,w=x.cloneElement(h,Nt(Nt({},l),{},{style:Nt(Nt({},p),c),className:m}));return w};return u===1?f(x.Children.only(a)):x.createElement("div",null,x.Children.map(a,function(d){return f(d)}))}}]),r}(x.PureComponent);St.displayName="Animate",St.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}},St.propTypes={from:be.oneOfType([be.object,be.string]),to:be.oneOfType([be.object,be.string]),attributeName:be.string,duration:be.number,begin:be.number,easing:be.oneOfType([be.string,be.func]),steps:be.arrayOf(be.shape({duration:be.number.isRequired,style:be.object.isRequired,easing:be.oneOfType([be.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),be.func]),properties:be.arrayOf("string"),onAnimationEnd:be.func})),children:be.oneOfType([be.node,be.func]),isActive:be.bool,canBegin:be.bool,onAnimationEnd:be.func,shouldReAnimate:be.bool,onAnimationStart:be.func,onAnimationReStart:be.func};function Ma(t){"@babel/helpers - typeof";return Ma=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},Ma(t)}function Bs(){return Bs=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},Bs.apply(this,arguments)}function Qz(t,e){return n3(t)||r3(t,e)||t3(t,e)||e3()}function e3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
120
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function t3(t,e){if(t){if(typeof t=="string")return w0(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 w0(t,e)}}function w0(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 r3(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,s=[],l=!0,u=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}function n3(t){if(Array.isArray(t))return t}function _0(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 x0(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?_0(Object(r),!0).forEach(function(n){i3(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_0(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function i3(t,e,r){return e=a3(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a3(t){var e=o3(t,"string");return Ma(e)=="symbol"?e:e+""}function o3(t,e){if(Ma(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ma(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var O0=function(e,r,n,i,a){var o=Math.min(Math.abs(n)/2,Math.abs(i)/2),s=i>=0?1:-1,l=n>=0?1:-1,u=i>=0&&n>=0||i<0&&n<0?1:0,c;if(o>0&&a instanceof Array){for(var f=[0,0,0,0],d=0,h=4;d<h;d++)f[d]=a[d]>o?o:a[d];c="M".concat(e,",").concat(r+s*f[0]),f[0]>0&&(c+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(e+l*f[0],",").concat(r)),c+="L ".concat(e+n-l*f[1],",").concat(r),f[1]>0&&(c+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`,
|
|
121
|
+
`).concat(e+n,",").concat(r+s*f[1])),c+="L ".concat(e+n,",").concat(r+i-s*f[2]),f[2]>0&&(c+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(u,`,
|
|
122
|
+
`).concat(e+n-l*f[2],",").concat(r+i)),c+="L ".concat(e+l*f[3],",").concat(r+i),f[3]>0&&(c+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`,
|
|
152
123
|
`).concat(e,",").concat(r+i-s*f[3])),c+="Z"}else if(o>0&&a===+a&&a>0){var y=Math.min(o,a);c="M ".concat(e,",").concat(r+s*y,`
|
|
153
|
-
A `).concat(y,",").concat(y,",0,0,").concat(
|
|
154
|
-
L `).concat(e+n-
|
|
155
|
-
A `).concat(y,",").concat(y,",0,0,").concat(
|
|
124
|
+
A `).concat(y,",").concat(y,",0,0,").concat(u,",").concat(e+l*y,",").concat(r,`
|
|
125
|
+
L `).concat(e+n-l*y,",").concat(r,`
|
|
126
|
+
A `).concat(y,",").concat(y,",0,0,").concat(u,",").concat(e+n,",").concat(r+s*y,`
|
|
156
127
|
L `).concat(e+n,",").concat(r+i-s*y,`
|
|
157
|
-
A `).concat(y,",").concat(y,",0,0,").concat(
|
|
158
|
-
L `).concat(e+
|
|
159
|
-
A `).concat(y,",").concat(y,",0,0,").concat(
|
|
160
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function X3(t,e){if(t){if(typeof t=="string")return ad(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 ad(t,e)}}function J3(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Z3(t){if(Array.isArray(t))return ad(t)}function ad(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 Q0=function(e){return e&&e.x===+e.x&&e.y===+e.y},Q3=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return e.forEach(function(n){Q0(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),Q0(e[0])&&r[r.length-1].push(e[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},no=function(e,r){var n=Q3(e);r&&(n=[n.reduce(function(a,o){return[].concat(Z0(a),Z0(o))},[])]);var i=n.map(function(a){return a.reduce(function(o,s,u){return"".concat(o).concat(u===0?"M":"L").concat(s.x,",").concat(s.y)},"")}).join("");return n.length===1?"".concat(i,"Z"):i},eK=function(e,r,n){var i=no(e,n);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(no(r.reverse(),n).slice(1))},ew=function(e){var r=e.points,n=e.className,i=e.baseLinePoints,a=e.connectNulls,o=H3(e,V3);if(!r||!r.length)return null;var s=le("recharts-polygon",n);if(i&&i.length){var u=o.stroke&&o.stroke!=="none",l=eK(r,i,a);return x.createElement("g",{className:s},x.createElement("path",bi({},Q(o,!0),{fill:l.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:l})),u?x.createElement("path",bi({},Q(o,!0),{fill:"none",d:no(r,a)})):null,u?x.createElement("path",bi({},Q(o,!0),{fill:"none",d:no(i,a)})):null)}var c=no(r,a);return x.createElement("path",bi({},Q(o,!0),{fill:c.slice(-1)==="Z"?o.fill:"none",className:s,d:c}))};function od(){return od=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},od.apply(this,arguments)}var wi=function(e){var r=e.cx,n=e.cy,i=e.r,a=e.className,o=le("recharts-dot",a);return r===+r&&n===+n&&i===+i?ve.createElement("circle",od({},Q(e,!1),Xo(e),{className:o,cx:r,cy:n,r:i})):null};function io(t){"@babel/helpers - typeof";return io=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},io(t)}var tK=["x","y","top","left","width","height","className"];function sd(){return sd=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},sd.apply(this,arguments)}function tw(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 rK(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?tw(Object(r),!0).forEach(function(n){nK(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):tw(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function nK(t,e,r){return e=iK(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function iK(t){var e=aK(t,"string");return io(e)=="symbol"?e:e+""}function aK(t,e){if(io(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(io(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function oK(t,e){if(t==null)return{};var r=sK(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 sK(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 uK=function(e,r,n,i,a,o){return"M".concat(e,",").concat(a,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},lK=function(e){var r=e.x,n=r===void 0?0:r,i=e.y,a=i===void 0?0:i,o=e.top,s=o===void 0?0:o,u=e.left,l=u===void 0?0:u,c=e.width,f=c===void 0?0:c,d=e.height,h=d===void 0?0:d,y=e.className,v=oK(e,tK),p=rK({x:n,y:a,top:s,left:l,width:f,height:h},v);return!V(n)||!V(a)||!V(f)||!V(h)||!V(s)||!V(l)?null:x.createElement("path",sd({},Q(p,!0),{className:le("recharts-cross",y),d:uK(n,a,f,h,s,l)}))},cK=["cx","cy","innerRadius","outerRadius","gridType","radialLines"];function ao(t){"@babel/helpers - typeof";return ao=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},ao(t)}function fK(t,e){if(t==null)return{};var r=dK(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 dK(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 xr(){return xr=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},xr.apply(this,arguments)}function rw(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 oo(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?rw(Object(r),!0).forEach(function(n){hK(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):rw(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function hK(t,e,r){return e=pK(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pK(t){var e=vK(t,"string");return ao(e)=="symbol"?e:e+""}function vK(t,e){if(ao(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ao(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var yK=function(e,r,n,i){var a="";return i.forEach(function(o,s){var u=we(r,n,e,o);s?a+="L ".concat(u.x,",").concat(u.y):a+="M ".concat(u.x,",").concat(u.y)}),a+="Z",a},gK=function(e){var r=e.cx,n=e.cy,i=e.innerRadius,a=e.outerRadius,o=e.polarAngles,s=e.radialLines;if(!o||!o.length||!s)return null;var u=oo({stroke:"#ccc"},Q(e,!1));return x.createElement("g",{className:"recharts-polar-grid-angle"},o.map(function(l){var c=we(r,n,i,l),f=we(r,n,a,l);return x.createElement("line",xr({},u,{key:"line-".concat(l),x1:c.x,y1:c.y,x2:f.x,y2:f.y}))}))},mK=function(e){var r=e.cx,n=e.cy,i=e.radius,a=e.index,o=oo(oo({stroke:"#ccc"},Q(e,!1)),{},{fill:"none"});return x.createElement("circle",xr({},o,{className:le("recharts-polar-grid-concentric-circle",e.className),key:"circle-".concat(a),cx:r,cy:n,r:i}))},bK=function(e){var r=e.radius,n=e.index,i=oo(oo({stroke:"#ccc"},Q(e,!1)),{},{fill:"none"});return x.createElement("path",xr({},i,{className:le("recharts-polar-grid-concentric-polygon",e.className),key:"path-".concat(n),d:yK(r,e.cx,e.cy,e.polarAngles)}))},wK=function(e){var r=e.polarRadius,n=e.gridType;return!r||!r.length?null:x.createElement("g",{className:"recharts-polar-grid-concentric"},r.map(function(i,a){var o=a;return n==="circle"?x.createElement(mK,xr({key:o},e,{radius:i,index:a})):x.createElement(bK,xr({key:o},e,{radius:i,index:a}))}))},nw=function(e){var r=e.cx,n=r===void 0?0:r,i=e.cy,a=i===void 0?0:i,o=e.innerRadius,s=o===void 0?0:o,u=e.outerRadius,l=u===void 0?0:u,c=e.gridType,f=c===void 0?"polygon":c,d=e.radialLines,h=d===void 0?!0:d,y=fK(e,cK);return l<=0?null:x.createElement("g",{className:"recharts-polar-grid"},x.createElement(gK,xr({cx:n,cy:a,innerRadius:s,outerRadius:l,gridType:f,radialLines:h},y)),x.createElement(wK,xr({cx:n,cy:a,innerRadius:s,outerRadius:l,gridType:f,radialLines:h},y)))};nw.displayName="PolarGrid";var _K=Ws,xK=sb,OK=er;function SK(t,e){return t&&t.length?_K(t,OK(e),xK):void 0}var AK=SK;const PK=je(AK);var EK=Ws,TK=er,jK=ub;function $K(t,e){return t&&t.length?EK(t,TK(e),jK):void 0}var kK=$K;const CK=je(kK);var IK=["cx","cy","angle","ticks","axisLine"],NK=["ticks","tick","angle","tickFormatter","stroke"];function _i(t){"@babel/helpers - typeof";return _i=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},_i(t)}function so(){return so=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},so.apply(this,arguments)}function iw(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 xn(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?iw(Object(r),!0).forEach(function(n){cu(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):iw(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function aw(t,e){if(t==null)return{};var r=MK(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 MK(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 DK(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ow(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,uw(n.key),n)}}function RK(t,e,r){return e&&ow(t.prototype,e),r&&ow(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function LK(t,e,r){return e=lu(e),BK(t,sw()?Reflect.construct(e,r||[],lu(t).constructor):e.apply(t,r))}function BK(t,e){if(e&&(_i(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return UK(t)}function UK(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function sw(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(sw=function(){return!!t})()}function lu(t){return lu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},lu(t)}function FK(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&&ud(t,e)}function ud(t,e){return ud=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ud(t,e)}function cu(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=WK(t,"string");return _i(e)=="symbol"?e:e+""}function WK(t,e){if(_i(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(_i(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var xi=function(t){function e(){return DK(this,e),LK(this,e,arguments)}return FK(e,t),RK(e,[{key:"getTickValueCoord",value:function(n){var i=n.coordinate,a=this.props,o=a.angle,s=a.cx,u=a.cy;return we(s,u,i,o)}},{key:"getTickTextAnchor",value:function(){var n=this.props.orientation,i;switch(n){case"left":i="end";break;case"right":i="start";break;default:i="middle";break}return i}},{key:"getViewBox",value:function(){var n=this.props,i=n.cx,a=n.cy,o=n.angle,s=n.ticks,u=PK(s,function(c){return c.coordinate||0}),l=CK(s,function(c){return c.coordinate||0});return{cx:i,cy:a,startAngle:o,endAngle:o,innerRadius:l.coordinate||0,outerRadius:u.coordinate||0}}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,a=n.cy,o=n.angle,s=n.ticks,u=n.axisLine,l=aw(n,IK),c=s.reduce(function(y,v){return[Math.min(y[0],v.coordinate),Math.max(y[1],v.coordinate)]},[1/0,-1/0]),f=we(i,a,c[0],o),d=we(i,a,c[1],o),h=xn(xn(xn({},Q(l,!1)),{},{fill:"none"},Q(u,!1)),{},{x1:f.x,y1:f.y,x2:d.x,y2:d.y});return x.createElement("line",so({className:"recharts-polar-radius-axis-line"},h))}},{key:"renderTicks",value:function(){var n=this,i=this.props,a=i.ticks,o=i.tick,s=i.angle,u=i.tickFormatter,l=i.stroke,c=aw(i,NK),f=this.getTickTextAnchor(),d=Q(c,!1),h=Q(o,!1),y=a.map(function(v,p){var m=n.getTickValueCoord(v),b=xn(xn(xn(xn({textAnchor:f,transform:"rotate(".concat(90-s,", ").concat(m.x,", ").concat(m.y,")")},d),{},{stroke:"none",fill:l},h),{},{index:p},m),{},{payload:v});return x.createElement(pe,so({className:le("recharts-polar-radius-axis-tick",Zb(o)),key:"tick-".concat(v.coordinate)},on(n.props,v,p)),e.renderTickItem(o,b,u?u(v.value,p):v.value))});return x.createElement(pe,{className:"recharts-polar-radius-axis-ticks"},y)}},{key:"render",value:function(){var n=this.props,i=n.ticks,a=n.axisLine,o=n.tick;return!i||!i.length?null:x.createElement(pe,{className:le("recharts-polar-radius-axis",this.props.className)},a&&this.renderAxisLine(),o&&this.renderTicks(),nt.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(n,i,a){var o;return x.isValidElement(n)?o=x.cloneElement(n,i):ae(n)?o=n(i):o=x.createElement(cn,so({},i,{className:"recharts-polar-radius-axis-tick-value"}),a),o}}])}(x.PureComponent);cu(xi,"displayName","PolarRadiusAxis"),cu(xi,"axisType","radiusAxis"),cu(xi,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function Oi(t){"@babel/helpers - typeof";return Oi=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},Oi(t)}function On(){return On=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},On.apply(this,arguments)}function lw(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 Sn(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?lw(Object(r),!0).forEach(function(n){du(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):lw(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function qK(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function cw(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,dw(n.key),n)}}function zK(t,e,r){return e&&cw(t.prototype,e),r&&cw(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function KK(t,e,r){return e=fu(e),VK(t,fw()?Reflect.construct(e,r||[],fu(t).constructor):e.apply(t,r))}function VK(t,e){if(e&&(Oi(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return HK(t)}function HK(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function fw(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(fw=function(){return!!t})()}function fu(t){return fu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},fu(t)}function GK(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&&ld(t,e)}function ld(t,e){return ld=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ld(t,e)}function du(t,e,r){return e=dw(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function dw(t){var e=YK(t,"string");return Oi(e)=="symbol"?e:e+""}function YK(t,e){if(Oi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Oi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var XK=Math.PI/180,hw=1e-5,Si=function(t){function e(){return qK(this,e),KK(this,e,arguments)}return GK(e,t),zK(e,[{key:"getTickLineCoord",value:function(n){var i=this.props,a=i.cx,o=i.cy,s=i.radius,u=i.orientation,l=i.tickSize,c=l||8,f=we(a,o,s,n.coordinate),d=we(a,o,s+(u==="inner"?-1:1)*c,n.coordinate);return{x1:f.x,y1:f.y,x2:d.x,y2:d.y}}},{key:"getTickTextAnchor",value:function(n){var i=this.props.orientation,a=Math.cos(-n.coordinate*XK),o;return a>hw?o=i==="outer"?"start":"end":a<-hw?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,a=n.cy,o=n.radius,s=n.axisLine,u=n.axisLineType,l=Sn(Sn({},Q(this.props,!1)),{},{fill:"none"},Q(s,!1));if(u==="circle")return x.createElement(wi,On({className:"recharts-polar-angle-axis-line"},l,{cx:i,cy:a,r:o}));var c=this.props.ticks,f=c.map(function(d){return we(i,a,o,d.coordinate)});return x.createElement(ew,On({className:"recharts-polar-angle-axis-line"},l,{points:f}))}},{key:"renderTicks",value:function(){var n=this,i=this.props,a=i.ticks,o=i.tick,s=i.tickLine,u=i.tickFormatter,l=i.stroke,c=Q(this.props,!1),f=Q(o,!1),d=Sn(Sn({},c),{},{fill:"none"},Q(s,!1)),h=a.map(function(y,v){var p=n.getTickLineCoord(y),m=n.getTickTextAnchor(y),b=Sn(Sn(Sn({textAnchor:m},c),{},{stroke:"none",fill:l},f),{},{index:v,payload:y,x:p.x2,y:p.y2});return x.createElement(pe,On({className:le("recharts-polar-angle-axis-tick",Zb(o)),key:"tick-".concat(y.coordinate)},on(n.props,y,v)),s&&x.createElement("line",On({className:"recharts-polar-angle-axis-tick-line"},d,p)),o&&e.renderTickItem(o,b,u?u(y.value,v):y.value))});return x.createElement(pe,{className:"recharts-polar-angle-axis-ticks"},h)}},{key:"render",value:function(){var n=this.props,i=n.ticks,a=n.radius,o=n.axisLine;return a<=0||!i||!i.length?null:x.createElement(pe,{className:le("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,i,a){var o;return x.isValidElement(n)?o=x.cloneElement(n,i):ae(n)?o=n(i):o=x.createElement(cn,On({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}])}(x.PureComponent);du(Si,"displayName","PolarAngleAxis"),du(Si,"axisType","angleAxis"),du(Si,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var JK=Ay,ZK=JK(Object.getPrototypeOf,Object),QK=ZK,eV=lr,tV=QK,rV=cr,nV="[object Object]",iV=Function.prototype,aV=Object.prototype,pw=iV.toString,oV=aV.hasOwnProperty,sV=pw.call(Object);function uV(t){if(!rV(t)||eV(t)!=nV)return!1;var e=tV(t);if(e===null)return!0;var r=oV.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&pw.call(r)==sV}var lV=uV;const cV=je(lV);var fV=lr,dV=cr,hV="[object Boolean]";function pV(t){return t===!0||t===!1||dV(t)&&fV(t)==hV}var vV=pV;const yV=je(vV);function uo(t){"@babel/helpers - typeof";return uo=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},uo(t)}function hu(){return hu=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},hu.apply(this,arguments)}function gV(t,e){return _V(t)||wV(t,e)||bV(t,e)||mV()}function mV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
161
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bV(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 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 wV(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,s=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(c){l=!0,i=c}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function _V(t){if(Array.isArray(t))return t}function yw(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 gw(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?yw(Object(r),!0).forEach(function(n){xV(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):yw(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function xV(t,e,r){return e=OV(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function OV(t){var e=SV(t,"string");return uo(e)=="symbol"?e:e+""}function SV(t,e){if(uo(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(uo(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var mw=function(e,r,n,i,a){var o=n-i,s;return s="M ".concat(e,",").concat(r),s+="L ".concat(e+n,",").concat(r),s+="L ".concat(e+n-o/2,",").concat(r+a),s+="L ".concat(e+n-o/2-i,",").concat(r+a),s+="L ".concat(e,",").concat(r," Z"),s},AV={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},PV=function(e){var r=gw(gw({},AV),e),n=x.useRef(),i=x.useState(-1),a=gV(i,2),o=a[0],s=a[1];x.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var w=n.current.getTotalLength();w&&s(w)}catch{}},[]);var u=r.x,l=r.y,c=r.upperWidth,f=r.lowerWidth,d=r.height,h=r.className,y=r.animationEasing,v=r.animationDuration,p=r.animationBegin,m=r.isUpdateAnimationActive;if(u!==+u||l!==+l||c!==+c||f!==+f||d!==+d||c===0&&f===0||d===0)return null;var b=le("recharts-trapezoid",h);return m?x.createElement(Rt,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:d,x:u,y:l},to:{upperWidth:c,lowerWidth:f,height:d,x:u,y:l},duration:v,animationEasing:y,isActive:m},function(w){var O=w.upperWidth,g=w.lowerWidth,_=w.height,S=w.x,A=w.y;return x.createElement(Rt,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:p,duration:v,easing:y},x.createElement("path",hu({},Q(r,!0),{className:b,d:mw(S,A,O,g,_),ref:n})))}):x.createElement("g",null,x.createElement("path",hu({},Q(r,!0),{className:b,d:mw(u,l,c,f,d)})))},EV=["option","shapeType","propTransformer","activeClassName","isActive"];function lo(t){"@babel/helpers - typeof";return lo=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},lo(t)}function TV(t,e){if(t==null)return{};var r=jV(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 jV(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 bw(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 pu(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?bw(Object(r),!0).forEach(function(n){$V(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):bw(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function $V(t,e,r){return e=kV(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function kV(t){var e=CV(t,"string");return lo(e)=="symbol"?e:e+""}function CV(t,e){if(lo(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(lo(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function IV(t,e){return pu(pu({},e),t)}function NV(t,e){return t==="symbols"}function ww(t){var e=t.shapeType,r=t.elementProps;switch(e){case"rectangle":return x.createElement(id,r);case"trapezoid":return x.createElement(PV,r);case"sector":return x.createElement(u0,r);case"symbols":if(NV(e))return x.createElement(uc,r);break;default:return null}}function MV(t){return x.isValidElement(t)?t.props:t}function _w(t){var e=t.option,r=t.shapeType,n=t.propTransformer,i=n===void 0?IV:n,a=t.activeClassName,o=a===void 0?"recharts-active-shape":a,s=t.isActive,u=TV(t,EV),l;if(x.isValidElement(e))l=x.cloneElement(e,pu(pu({},u),MV(e)));else if(ae(e))l=e(u);else if(cV(e)&&!yV(e)){var c=i(e,u);l=x.createElement(ww,{shapeType:r,elementProps:c})}else{var f=u;l=x.createElement(ww,{shapeType:r,elementProps:f})}return s?x.createElement(pe,{className:o},l):l}function vu(t,e){return e!=null&&"trapezoids"in t.props}function yu(t,e){return e!=null&&"sectors"in t.props}function co(t,e){return e!=null&&"points"in t.props}function DV(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 RV(t,e){var r=t.endAngle===e.endAngle,n=t.startAngle===e.startAngle;return r&&n}function LV(t,e){var r=t.x===e.x,n=t.y===e.y,i=t.z===e.z;return r&&n&&i}function BV(t,e){var r;return vu(t,e)?r=DV:yu(t,e)?r=RV:co(t,e)&&(r=LV),r}function UV(t,e){var r;return vu(t,e)?r="trapezoids":yu(t,e)?r="sectors":co(t,e)&&(r="points"),r}function FV(t,e){if(vu(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(yu(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 co(t,e)?e.payload:{}}function WV(t){var e=t.activeTooltipItem,r=t.graphicalItem,n=t.itemData,i=UV(r,e),a=FV(r,e),o=n.filter(function(u,l){var c=Rr(a,u),f=r.props[i].filter(function(y){var v=BV(r,e);return v(y,e)}),d=r.props[i].indexOf(f[f.length-1]),h=l===d;return c&&h}),s=n.indexOf(o[o.length-1]);return s}var gu;function Ai(t){"@babel/helpers - typeof";return Ai=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},Ai(t)}function Pi(){return Pi=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},Pi.apply(this,arguments)}function xw(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 Me(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?xw(Object(r),!0).forEach(function(n){Lt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):xw(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function qV(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ow(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,Aw(n.key),n)}}function zV(t,e,r){return e&&Ow(t.prototype,e),r&&Ow(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function KV(t,e,r){return e=mu(e),VV(t,Sw()?Reflect.construct(e,r||[],mu(t).constructor):e.apply(t,r))}function VV(t,e){if(e&&(Ai(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return HV(t)}function HV(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Sw(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Sw=function(){return!!t})()}function mu(t){return mu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},mu(t)}function GV(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&&cd(t,e)}function cd(t,e){return cd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},cd(t,e)}function Lt(t,e,r){return e=Aw(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Aw(t){var e=YV(t,"string");return Ai(e)=="symbol"?e:e+""}function YV(t,e){if(Ai(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ai(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Or=function(t){function e(r){var n;return qV(this,e),n=KV(this,e,[r]),Lt(n,"pieRef",null),Lt(n,"sectorRefs",[]),Lt(n,"id",an("recharts-pie-")),Lt(n,"handleAnimationEnd",function(){var i=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),ae(i)&&i()}),Lt(n,"handleAnimationStart",function(){var i=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),ae(i)&&i()}),n.state={isAnimationFinished:!r.isAnimationActive,prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,sectorToFocus:0},n}return GV(e,t),zV(e,[{key:"isActiveIndex",value:function(n){var i=this.props.activeIndex;return Array.isArray(i)?i.indexOf(n)!==-1:n===i}},{key:"hasActiveIndex",value:function(){var n=this.props.activeIndex;return Array.isArray(n)?n.length!==0:n||n===0}},{key:"renderLabels",value:function(n){var i=this.props.isAnimationActive;if(i&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.label,s=a.labelLine,u=a.dataKey,l=a.valueKey,c=Q(this.props,!1),f=Q(o,!1),d=Q(s,!1),h=o&&o.offsetRadius||20,y=n.map(function(v,p){var m=(v.startAngle+v.endAngle)/2,b=we(v.cx,v.cy,v.outerRadius+h,m),w=Me(Me(Me(Me({},c),v),{},{stroke:"none"},f),{},{index:p,textAnchor:e.getTextAnchor(b.x,v.cx)},b),O=Me(Me(Me(Me({},c),v),{},{fill:"none",stroke:v.fill},d),{},{index:p,points:[we(v.cx,v.cy,v.outerRadius,m),b]}),g=u;return fe(u)&&fe(l)?g="value":fe(u)&&(g=l),x.createElement(pe,{key:"label-".concat(v.startAngle,"-").concat(v.endAngle,"-").concat(v.midAngle,"-").concat(p)},s&&e.renderLabelLineItem(s,O,"line"),e.renderLabelItem(o,w,We(v,g)))});return x.createElement(pe,{className:"recharts-pie-labels"},y)}},{key:"renderSectorsStatically",value:function(n){var i=this,a=this.props,o=a.activeShape,s=a.blendStroke,u=a.inactiveShape;return n.map(function(l,c){if((l==null?void 0:l.startAngle)===0&&(l==null?void 0:l.endAngle)===0&&n.length!==1)return null;var f=i.isActiveIndex(c),d=u&&i.hasActiveIndex()?u:null,h=f?o:d,y=Me(Me({},l),{},{stroke:s?l.fill:l.stroke,tabIndex:-1});return x.createElement(pe,Pi({ref:function(p){p&&!i.sectorRefs.includes(p)&&i.sectorRefs.push(p)},tabIndex:-1,className:"recharts-pie-sector"},on(i.props,l,c),{key:"sector-".concat(l==null?void 0:l.startAngle,"-").concat(l==null?void 0:l.endAngle,"-").concat(l.midAngle,"-").concat(c)}),x.createElement(_w,Pi({option:h,isActive:f,shapeType:"sector"},y)))})}},{key:"renderSectorsWithAnimation",value:function(){var n=this,i=this.props,a=i.sectors,o=i.isAnimationActive,s=i.animationBegin,u=i.animationDuration,l=i.animationEasing,c=i.animationId,f=this.state,d=f.prevSectors,h=f.prevIsAnimationActive;return x.createElement(Rt,{begin:s,duration:u,isActive:o,easing:l,from:{t:0},to:{t:1},key:"pie-".concat(c,"-").concat(h),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(y){var v=y.t,p=[],m=a&&a[0],b=m.startAngle;return a.forEach(function(w,O){var g=d&&d[O],_=O>0?xt(w,"paddingAngle",0):0;if(g){var S=Fe(g.endAngle-g.startAngle,w.endAngle-w.startAngle),A=Me(Me({},w),{},{startAngle:b+_,endAngle:b+S(v)+_});p.push(A),b=A.endAngle}else{var E=w.endAngle,N=w.startAngle,j=Fe(0,E-N),$=j(v),k=Me(Me({},w),{},{startAngle:b+_,endAngle:b+$+_});p.push(k),b=k.endAngle}}),x.createElement(pe,null,n.renderSectorsStatically(p))})}},{key:"attachKeyboardHandlers",value:function(n){var i=this;n.onkeydown=function(a){if(!a.altKey)switch(a.key){case"ArrowLeft":{var o=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[o].focus(),i.setState({sectorToFocus:o});break}case"ArrowRight":{var s=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[s].focus(),i.setState({sectorToFocus:s});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,i=n.sectors,a=n.isAnimationActive,o=this.state.prevSectors;return a&&i&&i.length&&(!o||!Rr(o,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,i=this.props,a=i.hide,o=i.sectors,s=i.className,u=i.label,l=i.cx,c=i.cy,f=i.innerRadius,d=i.outerRadius,h=i.isAnimationActive,y=this.state.isAnimationFinished;if(a||!o||!o.length||!V(l)||!V(c)||!V(f)||!V(d))return null;var v=le("recharts-pie",s);return x.createElement(pe,{tabIndex:this.props.rootTabIndex,className:v,ref:function(m){n.pieRef=m}},this.renderSectors(),u&&this.renderLabels(o),nt.renderCallByParent(this.props,null,!1),(!h||y)&&Ht.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return i.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:n.sectors!==i.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,i){return n>i?"start":n<i?"end":"middle"}},{key:"renderLabelLineItem",value:function(n,i,a){if(x.isValidElement(n))return x.cloneElement(n,i);if(ae(n))return n(i);var o=le("recharts-pie-label-line",typeof n!="boolean"?n.className:"");return x.createElement(wn,Pi({},i,{key:a,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(n,i,a){if(x.isValidElement(n))return x.cloneElement(n,i);var o=a;if(ae(n)&&(o=n(i),x.isValidElement(o)))return o;var s=le("recharts-pie-label-text",typeof n!="boolean"&&!ae(n)?n.className:"");return x.createElement(cn,Pi({},i,{alignmentBaseline:"middle",className:s}),o)}}])}(x.PureComponent);gu=Or,Lt(Or,"displayName","Pie"),Lt(Or,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!It.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0}),Lt(Or,"parseDeltaAngle",function(t,e){var r=ft(e-t),n=Math.min(Math.abs(e-t),360);return r*n}),Lt(Or,"getRealPieData",function(t){var e=t.data,r=t.children,n=Q(t,!1),i=Ot(r,ws);return e&&e.length?e.map(function(a,o){return Me(Me(Me({payload:a},n),a),i&&i[o]&&i[o].props)}):i&&i.length?i.map(function(a){return Me(Me({},n),a.props)}):[]}),Lt(Or,"parseCoordinateOfPie",function(t,e){var r=e.top,n=e.left,i=e.width,a=e.height,o=Yb(i,a),s=n+dt(t.cx,i,i/2),u=r+dt(t.cy,a,a/2),l=dt(t.innerRadius,o,0),c=dt(t.outerRadius,o,o*.8),f=t.maxRadius||Math.sqrt(i*i+a*a)/2;return{cx:s,cy:u,innerRadius:l,outerRadius:c,maxRadius:f}}),Lt(Or,"getComposedData",function(t){var e=t.item,r=t.offset,n=e.type.defaultProps!==void 0?Me(Me({},e.type.defaultProps),e.props):e.props,i=gu.getRealPieData(n);if(!i||!i.length)return null;var a=n.cornerRadius,o=n.startAngle,s=n.endAngle,u=n.paddingAngle,l=n.dataKey,c=n.nameKey,f=n.valueKey,d=n.tooltipType,h=Math.abs(n.minAngle),y=gu.parseCoordinateOfPie(n,r),v=gu.parseDeltaAngle(o,s),p=Math.abs(v),m=l;fe(l)&&fe(f)?(zt(!1,`Use "dataKey" to specify the value of pie,
|
|
162
|
-
the props "valueKey" will be deprecated in 1.1.0`),m="value"):
|
|
163
|
-
the props "valueKey" will be deprecated in 1.1.0`),m=f);var b=i.filter(function(A){return We(A,m,0)!==0}).length,w=(p>=360?b:b-1)*u,O=p-b*h-w,g=i.reduce(function(A,E){var N=We(E,m,0);return A+(V(N)?N:0)},0),_;if(g>0){var S;_=i.map(function(A,E){var N=We(A,m,0),j=We(A,c,E),$=(V(N)?N:0)/g,k;E?k=S.endAngle+ft(v)*u*(N!==0?1:0):k=o;var I=k+ft(v)*((N!==0?h:0)+$*O),R=(k+I)/2,M=(y.innerRadius+y.outerRadius)/2,L=[{name:j,value:N,payload:A,dataKey:m,type:d}],q=we(y.cx,y.cy,M,R);return S=Me(Me(Me({percent:$,cornerRadius:a,name:j,tooltipPayload:L,midAngle:R,middleRadius:M,tooltipPosition:q},A),y),{},{value:We(A,m),startAngle:k,endAngle:I,payload:A,paddingAngle:ft(v)*u}),S})}return Me(Me({},y),{},{sectors:_,data:i})});function XV(t){return t&&t.length?t[0]:void 0}var JV=XV,ZV=JV;const QV=je(ZV);var eH=["key"];function Ei(t){"@babel/helpers - typeof";return Ei=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},Ei(t)}function tH(t,e){if(t==null)return{};var r=rH(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 rH(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 bu(){return bu=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},bu.apply(this,arguments)}function Pw(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 pt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Pw(Object(r),!0).forEach(function(n){Sr(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Pw(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function nH(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ew(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 iH(t,e,r){return e&&Ew(t.prototype,e),r&&Ew(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function aH(t,e,r){return e=wu(e),oH(t,Tw()?Reflect.construct(e,r||[],wu(t).constructor):e.apply(t,r))}function oH(t,e){if(e&&(Ei(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return sH(t)}function sH(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Tw(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Tw=function(){return!!t})()}function wu(t){return wu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},wu(t)}function uH(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&&fd(t,e)}function fd(t,e){return fd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},fd(t,e)}function Sr(t,e,r){return e=jw(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function jw(t){var e=lH(t,"string");return Ei(e)=="symbol"?e:e+""}function lH(t,e){if(Ei(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ei(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var fo=function(t){function e(){var r;nH(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=aH(this,e,[].concat(i)),Sr(r,"state",{isAnimationFinished:!1}),Sr(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),ae(o)&&o()}),Sr(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),ae(o)&&o()}),Sr(r,"handleMouseEnter",function(o){var s=r.props.onMouseEnter;s&&s(r.props,o)}),Sr(r,"handleMouseLeave",function(o){var s=r.props.onMouseLeave;s&&s(r.props,o)}),r}return uH(e,t),iH(e,[{key:"renderDots",value:function(n){var i=this.props,a=i.dot,o=i.dataKey,s=Q(this.props,!1),u=Q(a,!0),l=n.map(function(c,f){var d=pt(pt(pt({key:"dot-".concat(f),r:3},s),u),{},{dataKey:o,cx:c.x,cy:c.y,index:f,payload:c});return e.renderDotItem(a,d)});return x.createElement(pe,{className:"recharts-radar-dots"},l)}},{key:"renderPolygonStatically",value:function(n){var i=this.props,a=i.shape,o=i.dot,s=i.isRange,u=i.baseLinePoints,l=i.connectNulls,c;return x.isValidElement(a)?c=x.cloneElement(a,pt(pt({},this.props),{},{points:n})):ae(a)?c=a(pt(pt({},this.props),{},{points:n})):c=x.createElement(ew,bu({},Q(this.props,!0),{onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,points:n,baseLinePoints:s?u:null,connectNulls:l})),x.createElement(pe,{className:"recharts-radar-polygon"},c,o?this.renderDots(n):null)}},{key:"renderPolygonWithAnimation",value:function(){var n=this,i=this.props,a=i.points,o=i.isAnimationActive,s=i.animationBegin,u=i.animationDuration,l=i.animationEasing,c=i.animationId,f=this.state.prevPoints;return x.createElement(Rt,{begin:s,duration:u,isActive:o,easing:l,from:{t:0},to:{t:1},key:"radar-".concat(c),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(d){var h=d.t,y=f&&f.length/a.length,v=a.map(function(p,m){var b=f&&f[Math.floor(m*y)];if(b){var w=Fe(b.x,p.x),O=Fe(b.y,p.y);return pt(pt({},p),{},{x:w(h),y:O(h)})}var g=Fe(p.cx,p.x),_=Fe(p.cy,p.y);return pt(pt({},p),{},{x:g(h),y:_(h)})});return n.renderPolygonStatically(v)})}},{key:"renderPolygon",value:function(){var n=this.props,i=n.points,a=n.isAnimationActive,o=n.isRange,s=this.state.prevPoints;return a&&i&&i.length&&!o&&(!s||!Rr(s,i))?this.renderPolygonWithAnimation():this.renderPolygonStatically(i)}},{key:"render",value:function(){var n=this.props,i=n.hide,a=n.className,o=n.points,s=n.isAnimationActive;if(i||!o||!o.length)return null;var u=this.state.isAnimationFinished,l=le("recharts-radar",a);return x.createElement(pe,{className:l},this.renderPolygon(),(!s||u)&&Ht.renderCallByParent(this.props,o))}}],[{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:"renderDotItem",value:function(n,i){var a;if(x.isValidElement(n))a=x.cloneElement(n,i);else if(ae(n))a=n(i);else{var o=i.key,s=tH(i,eH);a=x.createElement(wi,bu({},s,{key:o,className:le("recharts-radar-dot",typeof n!="boolean"?n.className:"")}))}return a}}])}(x.PureComponent);Sr(fo,"displayName","Radar"),Sr(fo,"defaultProps",{angleAxisId:0,radiusAxisId:0,hide:!1,activeDot:!0,dot:!1,legendType:"rect",isAnimationActive:!It.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"}),Sr(fo,"getComposedData",function(t){var e=t.radiusAxis,r=t.angleAxis,n=t.displayedData,i=t.dataKey,a=t.bandSize,o=r.cx,s=r.cy,u=!1,l=[],c=r.type!=="number"?a??0:0;n.forEach(function(d,h){var y=We(d,r.dataKey,h),v=We(d,i),p=r.scale(y)+c,m=Array.isArray(v)?t0(v):v,b=fe(m)?void 0:e.scale(m);Array.isArray(v)&&v.length>=2&&(u=!0),l.push(pt(pt({},we(o,s,b,p)),{},{name:y,value:v,cx:o,cy:s,radius:b,angle:p,payload:d}))});var f=[];return u&&l.forEach(function(d){if(Array.isArray(d.value)){var h=QV(d.value),y=fe(h)?void 0:e.scale(h);f.push(pt(pt({},d),{},{radius:y},we(o,s,y,d.angle)))}else f.push(d)}),{points:l,isRange:u,baseLinePoints:f}});var cH=Math.ceil,fH=Math.max;function dH(t,e,r,n){for(var i=-1,a=fH(cH((e-t)/(r||1)),0),o=Array(a);a--;)o[n?a:++i]=t,t+=r;return o}var hH=dH,pH=Og,$w=1/0,vH=17976931348623157e292;function yH(t){if(!t)return t===0?t:0;if(t=pH(t),t===$w||t===-$w){var e=t<0?-1:1;return e*vH}return t===t?t:0}var kw=yH,gH=hH,mH=vs,dd=kw;function bH(t){return function(e,r,n){return n&&typeof n!="number"&&mH(e,r,n)&&(r=n=void 0),e=dd(e),r===void 0?(r=e,e=0):r=dd(r),n=n===void 0?e<r?1:-1:dd(n),gH(e,r,n,t)}}var wH=bH,_H=wH,xH=_H(),OH=xH;const _u=je(OH);function ho(t){"@babel/helpers - typeof";return ho=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},ho(t)}function Cw(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 Iw(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Cw(Object(r),!0).forEach(function(n){Nw(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Cw(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Nw(t,e,r){return e=SH(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function SH(t){var e=AH(t,"string");return ho(e)=="symbol"?e:e+""}function AH(t,e){if(ho(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ho(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var PH=["Webkit","Moz","O","ms"],EH=function(e,r){var n=e.replace(/(\w)/,function(a){return a.toUpperCase()}),i=PH.reduce(function(a,o){return Iw(Iw({},a),{},Nw({},o+n,r))},{});return i[e]=r,i};function Ti(t){"@babel/helpers - typeof";return Ti=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},Ti(t)}function xu(){return xu=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},xu.apply(this,arguments)}function Mw(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 hd(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Mw(Object(r),!0).forEach(function(n){Pt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Mw(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function TH(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Dw(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,Lw(n.key),n)}}function jH(t,e,r){return e&&Dw(t.prototype,e),r&&Dw(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function $H(t,e,r){return e=Ou(e),kH(t,Rw()?Reflect.construct(e,r||[],Ou(t).constructor):e.apply(t,r))}function kH(t,e){if(e&&(Ti(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return CH(t)}function CH(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Rw(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Rw=function(){return!!t})()}function Ou(t){return Ou=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ou(t)}function IH(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&&pd(t,e)}function pd(t,e){return pd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},pd(t,e)}function Pt(t,e,r){return e=Lw(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Lw(t){var e=NH(t,"string");return Ti(e)=="symbol"?e:e+""}function NH(t,e){if(Ti(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ti(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var MH=function(e){var r=e.data,n=e.startIndex,i=e.endIndex,a=e.x,o=e.width,s=e.travellerWidth;if(!r||!r.length)return{};var u=r.length,l=Pa().domain(_u(0,u)).range([a,a+o-s]),c=l.domain().map(function(f){return l(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:l(n),endX:l(i),scale:l,scaleValues:c}},Bw=function(e){return e.changedTouches&&!!e.changedTouches.length},ji=function(t){function e(r){var n;return TH(this,e),n=$H(this,e,[r]),Pt(n,"handleDrag",function(i){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(i):n.state.isSlideMoving&&n.handleSlideDrag(i)}),Pt(n,"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&n.handleDrag(i.changedTouches[0])}),Pt(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,a=i.endIndex,o=i.onDragEnd,s=i.startIndex;o==null||o({endIndex:a,startIndex:s})}),n.detachDragEndListener()}),Pt(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Pt(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Pt(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Pt(n,"handleSlideDragStart",function(i){var a=Bw(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 IH(e,t),jH(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,s=this.props,u=s.gap,l=s.data,c=l.length-1,f=Math.min(i,a),d=Math.max(i,a),h=e.getIndexInRange(o,f),y=e.getIndexInRange(o,d);return{startIndex:h-h%u,endIndex:y===c?c:y-y%u}}},{key:"getTextOfTick",value:function(n){var i=this.props,a=i.data,o=i.tickFormatter,s=i.dataKey,u=We(a[n],s,n);return ae(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,s=i.endX,u=this.props,l=u.x,c=u.width,f=u.travellerWidth,d=u.startIndex,h=u.endIndex,y=u.onChange,v=n.pageX-a;v>0?v=Math.min(v,l+c-f-s,l+c-f-o):v<0&&(v=Math.max(v,l-o,l-s));var p=this.getIndex({startX:o+v,endX:s+v});(p.startIndex!==d||p.endIndex!==h)&&y&&y(p),this.setState({startX:o+v,endX:s+v,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=Bw(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,s=i.endX,u=i.startX,l=this.state[o],c=this.props,f=c.x,d=c.width,h=c.travellerWidth,y=c.onChange,v=c.gap,p=c.data,m={startX:this.state.startX,endX:this.state.endX},b=n.pageX-a;b>0?b=Math.min(b,f+d-h-l):b<0&&(b=Math.max(b,f-l)),m[o]=l+b;var w=this.getIndex(m),O=w.startIndex,g=w.endIndex,_=function(){var A=p.length-1;return o==="startX"&&(s>u?O%v===0:g%v===0)||s<u&&g===A||o==="endX"&&(s>u?g%v===0:O%v===0)||s>u&&g===A};this.setState(Pt(Pt({},o,l+b),"brushMoveStartX",n.pageX),function(){y&&_()&&y(w)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var a=this,o=this.state,s=o.scaleValues,u=o.startX,l=o.endX,c=this.state[i],f=s.indexOf(c);if(f!==-1){var d=f+n;if(!(d===-1||d>=s.length)){var h=s[d];i==="startX"&&h>=l||i==="endX"&&h<=u||this.setState(Pt({},i,h),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,s=n.height,u=n.fill,l=n.stroke;return x.createElement("rect",{stroke:l,fill:u,x:i,y:a,width:o,height:s})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,u=n.data,l=n.children,c=n.padding,f=x.Children.only(l);return f?x.cloneElement(f,{x:i,y:a,width:o,height:s,margin:c,compact:!0,data:u}):null}},{key:"renderTravellerLayer",value:function(n,i){var a,o,s=this,u=this.props,l=u.y,c=u.travellerWidth,f=u.height,d=u.traveller,h=u.ariaLabel,y=u.data,v=u.startIndex,p=u.endIndex,m=Math.max(n,this.props.x),b=hd(hd({},Q(this.props,!1)),{},{x:m,y:l,width:c,height:f}),w=h||"Min value: ".concat((a=y[v])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=y[p])===null||o===void 0?void 0:o.name);return x.createElement(pe,{tabIndex:0,role:"slider","aria-label":w,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(g){["ArrowLeft","ArrowRight"].includes(g.key)&&(g.preventDefault(),g.stopPropagation(),s.handleTravellerMoveKeyboard(g.key==="ArrowRight"?1:-1,i))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(d,b))}},{key:"renderSlide",value:function(n,i){var a=this.props,o=a.y,s=a.height,u=a.stroke,l=a.travellerWidth,c=Math.min(n,i)+l,f=Math.max(Math.abs(i-n)-l,0);return x.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:c,y:o,width:f,height:s})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,a=n.endIndex,o=n.y,s=n.height,u=n.travellerWidth,l=n.stroke,c=this.state,f=c.startX,d=c.endX,h=5,y={pointerEvents:"none",fill:l};return x.createElement(pe,{className:"recharts-brush-texts"},x.createElement(cn,xu({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,d)-h,y:o+s/2},y),this.getTextOfTick(i)),x.createElement(cn,xu({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,d)+u+h,y:o+s/2},y),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,i=n.data,a=n.className,o=n.children,s=n.x,u=n.y,l=n.width,c=n.height,f=n.alwaysShowText,d=this.state,h=d.startX,y=d.endX,v=d.isTextActive,p=d.isSlideMoving,m=d.isTravellerMoving,b=d.isTravellerFocused;if(!i||!i.length||!V(s)||!V(u)||!V(l)||!V(c)||l<=0||c<=0)return null;var w=le("recharts-brush",a),O=x.Children.count(o)===1,g=EH("userSelect","none");return x.createElement(pe,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:g},this.renderBackground(),O&&this.renderPanorama(),this.renderSlide(h,y),this.renderTravellerLayer(h,"startX"),this.renderTravellerLayer(y,"endX"),(v||p||m||b||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,a=n.y,o=n.width,s=n.height,u=n.stroke,l=Math.floor(a+s/2)-1;return x.createElement(x.Fragment,null,x.createElement("rect",{x:i,y:a,width:o,height:s,fill:u,stroke:"none"}),x.createElement("line",{x1:i+1,y1:l,x2:i+o-1,y2:l,fill:"none",stroke:"#fff"}),x.createElement("line",{x1:i+1,y1:l+2,x2:i+o-1,y2:l+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var a;return x.isValidElement(n)?a=x.cloneElement(n,i):ae(n)?a=n(i):a=e.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(n,i){var a=n.data,o=n.width,s=n.x,u=n.travellerWidth,l=n.updateId,c=n.startIndex,f=n.endIndex;if(a!==i.prevData||l!==i.prevUpdateId)return hd({prevData:a,prevTravellerWidth:u,prevUpdateId:l,prevX:s,prevWidth:o},a&&a.length?MH({data:a,width:o,x:s,travellerWidth:u,startIndex:c,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||s!==i.prevX||u!==i.prevTravellerWidth)){i.scale.range([s,s+o-u]);var d=i.scale.domain().map(function(h){return i.scale(h)});return{prevData:a,prevTravellerWidth:u,prevUpdateId:l,prevX:s,prevWidth:o,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:d}}return null}},{key:"getIndexInRange",value:function(n,i){for(var a=n.length,o=0,s=a-1;s-o>1;){var u=Math.floor((o+s)/2);n[u]>i?s=u:o=u}return i>=n[s]?s:o}}])}(x.PureComponent);Pt(ji,"displayName","Brush"),Pt(ji,"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 DH=Pc;function RH(t,e){var r;return DH(t,function(n,i,a){return r=e(n,i,a),!r}),!!r}var LH=RH,BH=cy,UH=er,FH=LH,WH=yt,qH=vs;function zH(t,e,r){var n=WH(t)?BH:FH;return r&&qH(t,e,r)&&(e=void 0),n(t,UH(e))}var KH=zH;const VH=je(KH);var ar=function(e,r){var n=e.alwaysShow,i=e.ifOverflow;return n&&(i="extendDomain"),i===r},Uw=og;function HH(t,e,r){e=="__proto__"&&Uw?Uw(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var GH=HH,YH=GH,XH=rg,JH=er;function ZH(t,e){var r={};return e=JH(e),XH(t,function(n,i,a){YH(r,i,e(n,i,a))}),r}var QH=ZH;const e8=je(QH);function t8(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(!e(t[r],r,t))return!1;return!0}var r8=t8,n8=Pc;function i8(t,e){var r=!0;return n8(t,function(n,i,a){return r=!!e(n,i,a),r}),r}var a8=i8,o8=r8,s8=a8,u8=er,l8=yt,c8=vs;function f8(t,e,r){var n=l8(t)?o8:s8;return r&&c8(t,e,r)&&(e=void 0),n(t,u8(e))}var d8=f8;const Fw=je(d8);var h8=["x","y"];function $i(t){"@babel/helpers - typeof";return $i=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},$i(t)}function vd(){return vd=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},vd.apply(this,arguments)}function Ww(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 po(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ww(Object(r),!0).forEach(function(n){p8(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ww(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function p8(t,e,r){return e=v8(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function v8(t){var e=y8(t,"string");return $i(e)=="symbol"?e:e+""}function y8(t,e){if($i(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if($i(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function g8(t,e){if(t==null)return{};var r=m8(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 m8(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 b8(t,e){var r=t.x,n=t.y,i=g8(t,h8),a="".concat(r),o=parseInt(a,10),s="".concat(n),u=parseInt(s,10),l="".concat(e.height||i.height),c=parseInt(l,10),f="".concat(e.width||i.width),d=parseInt(f,10);return po(po(po(po(po({},e),i),o?{x:o}:{}),u?{y:u}:{}),{},{height:c,width:d,name:e.name,radius:e.radius})}function qw(t){return x.createElement(_w,vd({shapeType:"rectangle",propTransformer:b8,activeClassName:"recharts-active-bar"},t))}var w8=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=V(n)||mT(n);return a?e(n,i):(a||(process.env.NODE_ENV!=="production"?mt(!1,"minPointSize callback function received a value with type of ".concat($i(n),". Currently only numbers or null/undefined are supported.")):mt()),r)}},_8=["value","background"],zw;function ki(t){"@babel/helpers - typeof";return ki=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},ki(t)}function x8(t,e){if(t==null)return{};var r=O8(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 O8(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 Su(){return Su=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},Su.apply(this,arguments)}function Kw(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 He(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Kw(Object(r),!0).forEach(function(n){Ur(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Kw(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function S8(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Vw(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,Gw(n.key),n)}}function A8(t,e,r){return e&&Vw(t.prototype,e),r&&Vw(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function P8(t,e,r){return e=Au(e),E8(t,Hw()?Reflect.construct(e,r||[],Au(t).constructor):e.apply(t,r))}function E8(t,e){if(e&&(ki(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return T8(t)}function T8(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Hw(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Hw=function(){return!!t})()}function Au(t){return Au=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Au(t)}function j8(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&&yd(t,e)}function yd(t,e){return yd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},yd(t,e)}function Ur(t,e,r){return e=Gw(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Gw(t){var e=$8(t,"string");return ki(e)=="symbol"?e:e+""}function $8(t,e){if(ki(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ki(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var An=function(t){function e(){var r;S8(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=P8(this,e,[].concat(i)),Ur(r,"state",{isAnimationFinished:!1}),Ur(r,"id",an("recharts-bar-")),Ur(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),o&&o()}),Ur(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),o&&o()}),r}return j8(e,t),A8(e,[{key:"renderRectanglesStatically",value:function(n){var i=this,a=this.props,o=a.shape,s=a.dataKey,u=a.activeIndex,l=a.activeBar,c=Q(this.props,!1);return n&&n.map(function(f,d){var h=d===u,y=h?l:o,v=He(He(He({},c),f),{},{isActive:h,option:y,index:d,dataKey:s,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return x.createElement(pe,Su({className:"recharts-bar-rectangle"},on(i.props,f,d),{key:"rectangle-".concat(f==null?void 0:f.x,"-").concat(f==null?void 0:f.y,"-").concat(f==null?void 0:f.value,"-").concat(d)}),x.createElement(qw,v))})}},{key:"renderRectanglesWithAnimation",value:function(){var n=this,i=this.props,a=i.data,o=i.layout,s=i.isAnimationActive,u=i.animationBegin,l=i.animationDuration,c=i.animationEasing,f=i.animationId,d=this.state.prevData;return x.createElement(Rt,{begin:u,duration:l,isActive:s,easing:c,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(h){var y=h.t,v=a.map(function(p,m){var b=d&&d[m];if(b){var w=Fe(b.x,p.x),O=Fe(b.y,p.y),g=Fe(b.width,p.width),_=Fe(b.height,p.height);return He(He({},p),{},{x:w(y),y:O(y),width:g(y),height:_(y)})}if(o==="horizontal"){var S=Fe(0,p.height),A=S(y);return He(He({},p),{},{y:p.y+p.height-A,height:A})}var E=Fe(0,p.width),N=E(y);return He(He({},p),{},{width:N})});return x.createElement(pe,null,n.renderRectanglesStatically(v))})}},{key:"renderRectangles",value:function(){var n=this.props,i=n.data,a=n.isAnimationActive,o=this.state.prevData;return a&&i&&i.length&&(!o||!Rr(o,i))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(i)}},{key:"renderBackground",value:function(){var n=this,i=this.props,a=i.data,o=i.dataKey,s=i.activeIndex,u=Q(this.props.background,!1);return a.map(function(l,c){l.value;var f=l.background,d=x8(l,_8);if(!f)return null;var h=He(He(He(He(He({},d),{},{fill:"#eee"},f),u),on(n.props,l,c)),{},{onAnimationStart:n.handleAnimationStart,onAnimationEnd:n.handleAnimationEnd,dataKey:o,index:c,className:"recharts-bar-background-rectangle"});return x.createElement(qw,Su({key:"background-bar-".concat(c),option:n.props.background,isActive:c===s},h))})}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.data,s=a.xAxis,u=a.yAxis,l=a.layout,c=a.children,f=Ot(c,Ba);if(!f)return null;var d=l==="vertical"?o[0].height/2:o[0].width/2,h=function(p,m){var b=Array.isArray(p.value)?p.value[1]:p.value;return{x:p.x,y:p.y,value:b,errorVal:We(p,m)}},y={clipPath:n?"url(#clipPath-".concat(i,")"):null};return x.createElement(pe,y,f.map(function(v){return x.cloneElement(v,{key:"error-bar-".concat(i,"-").concat(v.props.dataKey),data:o,xAxis:s,yAxis:u,layout:l,offset:d,dataPointFormatter:h})}))}},{key:"render",value:function(){var n=this.props,i=n.hide,a=n.data,o=n.className,s=n.xAxis,u=n.yAxis,l=n.left,c=n.top,f=n.width,d=n.height,h=n.isAnimationActive,y=n.background,v=n.id;if(i||!a||!a.length)return null;var p=this.state.isAnimationFinished,m=le("recharts-bar",o),b=s&&s.allowDataOverflow,w=u&&u.allowDataOverflow,O=b||w,g=fe(v)?this.id:v;return x.createElement(pe,{className:m},b||w?x.createElement("defs",null,x.createElement("clipPath",{id:"clipPath-".concat(g)},x.createElement("rect",{x:b?l:l-f/2,y:w?c:c-d/2,width:b?f:f*2,height:w?d:d*2}))):null,x.createElement(pe,{className:"recharts-bar-rectangles",clipPath:O?"url(#clipPath-".concat(g,")"):null},y?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(O,g),(!h||p)&&Ht.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}}])}(x.PureComponent);zw=An,Ur(An,"displayName","Bar"),Ur(An,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!It.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"}),Ur(An,"getComposedData",function(t){var e=t.props,r=t.item,n=t.barPosition,i=t.bandSize,a=t.xAxis,o=t.yAxis,s=t.xAxisTicks,u=t.yAxisTicks,l=t.stackedData,c=t.dataStartIndex,f=t.displayedData,d=t.offset,h=RW(n,r);if(!h)return null;var y=e.layout,v=r.type.defaultProps,p=v!==void 0?He(He({},v),r.props):r.props,m=p.dataKey,b=p.children,w=p.minPointSize,O=y==="horizontal"?o:a,g=l?O.scale.domain():null,_=zW({numericAxis:O}),S=Ot(b,ws),A=f.map(function(E,N){var j,$,k,I,R,M;l?j=LW(l[c+N],g):(j=We(E,m),Array.isArray(j)||(j=[_,j]));var L=w8(w,zw.defaultProps.minPointSize)(j[1],N);if(y==="horizontal"){var q,z=[o.scale(j[0]),o.scale(j[1])],D=z[0],B=z[1];$=Ub({axis:a,ticks:s,bandSize:i,offset:h.offset,entry:E,index:N}),k=(q=B??D)!==null&&q!==void 0?q:void 0,I=h.size;var F=D-B;if(R=Number.isNaN(F)?0:F,M={x:$,y:o.y,width:I,height:o.height},Math.abs(L)>0&&Math.abs(R)<Math.abs(L)){var G=ft(R||L)*(Math.abs(L)-Math.abs(R));k-=G,R+=G}}else{var J=[a.scale(j[0]),a.scale(j[1])],re=J[0],ne=J[1];if($=re,k=Ub({axis:o,ticks:u,bandSize:i,offset:h.offset,entry:E,index:N}),I=ne-re,R=h.size,M={x:a.x,y:k,width:a.width,height:R},Math.abs(L)>0&&Math.abs(I)<Math.abs(L)){var ue=ft(I||L)*(Math.abs(L)-Math.abs(I));I+=ue}}return He(He(He({},E),{},{x:$,y:k,width:I,height:R,value:l?j:j[1],payload:E,background:M},S&&S[N]&&S[N].props),{},{tooltipPayload:[Kb(r,E)],tooltipPosition:{x:$+I/2,y:k+R/2}})});return He({data:A,layout:y},d)});function vo(t){"@babel/helpers - typeof";return vo=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},vo(t)}function k8(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Yw(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 C8(t,e,r){return e&&Yw(t.prototype,e),r&&Yw(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Xw(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 Yt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Xw(Object(r),!0).forEach(function(n){Pu(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Xw(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Pu(t,e,r){return e=Jw(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Jw(t){var e=I8(t,"string");return vo(e)=="symbol"?e:e+""}function I8(t,e){if(vo(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(vo(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var gd=function(e,r,n,i,a){var o=e.width,s=e.height,u=e.layout,l=e.children,c=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:s-n.bottom,bottomMirror:s-n.bottom},d=!!St(l,An);return c.reduce(function(h,y){var v=r[y],p=v.orientation,m=v.domain,b=v.padding,w=b===void 0?{}:b,O=v.mirror,g=v.reversed,_="".concat(p).concat(O?"Mirror":""),S,A,E,N,j;if(v.type==="number"&&(v.padding==="gap"||v.padding==="no-gap")){var $=m[1]-m[0],k=1/0,I=v.categoricalDomain.sort(_T);if(I.forEach(function(J,re){re>0&&(k=Math.min((J||0)-(I[re-1]||0),k))}),Number.isFinite(k)){var R=k/$,M=v.layout==="vertical"?n.height:n.width;if(v.padding==="gap"&&(S=R*M/2),v.padding==="no-gap"){var L=dt(e.barCategoryGap,R*M),q=R*M/2;S=q-L-(q-L)/M*L}}}i==="xAxis"?A=[n.left+(w.left||0)+(S||0),n.left+n.width-(w.right||0)-(S||0)]:i==="yAxis"?A=u==="horizontal"?[n.top+n.height-(w.bottom||0),n.top+(w.top||0)]:[n.top+(w.top||0)+(S||0),n.top+n.height-(w.bottom||0)-(S||0)]:A=v.range,g&&(A=[A[1],A[0]]);var z=Db(v,a,d),D=z.scale,B=z.realScaleType;D.domain(m).range(A),Lb(D);var F=Bb(D,Yt(Yt({},v),{},{realScaleType:B}));i==="xAxis"?(j=p==="top"&&!O||p==="bottom"&&O,E=n.left,N=f[_]-j*v.height):i==="yAxis"&&(j=p==="left"&&!O||p==="right"&&O,E=f[_]-j*v.width,N=n.top);var G=Yt(Yt(Yt({},v),F),{},{realScaleType:B,x:E,y:N,scale:D,width:i==="xAxis"?n.width:v.width,height:i==="yAxis"?n.height:v.height});return G.bandSize=Js(G,F),!v.hide&&i==="xAxis"?f[_]+=(j?-1:1)*G.height:v.hide||(f[_]+=(j?-1:1)*G.width),Yt(Yt({},h),{},Pu({},y,G))},{})},Zw=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)}},N8=function(e){var r=e.x1,n=e.y1,i=e.x2,a=e.y2;return Zw({x:r,y:n},{x:i,y:a})},Qw=function(){function t(e){k8(this,t),this.scale=e}return C8(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 s=this.bandwidth?this.bandwidth():0;return this.scale(r)+s}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)}}])}();Pu(Qw,"EPS",1e-4);var md=function(e){var r=Object.keys(e).reduce(function(n,i){return Yt(Yt({},n),{},Pu({},i,Qw.create(e[i])))},{});return Yt(Yt({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,s=a.position;return e8(i,function(u,l){return r[l].apply(u,{bandAware:o,position:s})})},isInRange:function(i){return Fw(i,function(a,o){return r[o].isInRange(a)})}})};function M8(t){return(t%180+180)%180}var D8=function(e){var r=e.width,n=e.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=M8(i),o=a*Math.PI/180,s=Math.atan(n/r),u=o>s&&o<Math.PI-s?n/Math.sin(o):r/Math.cos(o);return Math.abs(u)},R8=er,L8=va,B8=fs;function U8(t){return function(e,r,n){var i=Object(e);if(!L8(e)){var a=R8(r);e=B8(e),r=function(s){return a(i[s],s,i)}}var o=t(e,r,n);return o>-1?i[a?e[o]:o]:void 0}}var F8=U8,W8=kw;function q8(t){var e=W8(t),r=e%1;return e===e?r?e-r:e:0}var z8=q8,K8=zy,V8=er,H8=z8,G8=Math.max;function Y8(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:H8(r);return i<0&&(i=G8(n+i,0)),K8(t,V8(e),i)}var X8=Y8,J8=F8,Z8=X8,Q8=J8(Z8),eG=Q8;const tG=je(eG);var rG=x1(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("")});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)}var bd=x.createContext(void 0),wd=x.createContext(void 0),e_=x.createContext(void 0),t_=x.createContext({}),r_=x.createContext(void 0),n_=x.createContext(0),i_=x.createContext(0),a_=function(e){var r=e.state,n=r.xAxisMap,i=r.yAxisMap,a=r.offset,o=e.clipPathId,s=e.children,u=e.width,l=e.height,c=rG(a);return x.createElement(bd.Provider,{value:n},x.createElement(wd.Provider,{value:i},x.createElement(t_.Provider,{value:a},x.createElement(e_.Provider,{value:c},x.createElement(r_.Provider,{value:o},x.createElement(n_.Provider,{value:l},x.createElement(i_.Provider,{value:u},s)))))))},nG=function(){return x.useContext(r_)};function o_(t){var e=Object.keys(t);return e.length===0?"There are no available ids.":"Available ids are: ".concat(e,".")}var s_=function(e){var r=x.useContext(bd);r==null&&(process.env.NODE_ENV!=="production"?mt(!1,"Could not find Recharts context; are you sure this is rendered inside a Recharts wrapper component?"):mt());var n=r[e];return n==null&&(process.env.NODE_ENV!=="production"?mt(!1,'Could not find xAxis by id "'.concat(e,'" [').concat(Eu(e),"]. ").concat(o_(r))):mt()),n},iG=function(){var e=x.useContext(bd);return Cr(e)},aG=function(){var e=x.useContext(wd),r=tG(e,function(n){return Fw(n.domain,Number.isFinite)});return r||Cr(e)},u_=function(e){var r=x.useContext(wd);r==null&&(process.env.NODE_ENV!=="production"?mt(!1,"Could not find Recharts context; are you sure this is rendered inside a Recharts wrapper component?"):mt());var n=r[e];return n==null&&(process.env.NODE_ENV!=="production"?mt(!1,'Could not find yAxis by id "'.concat(e,'" [').concat(Eu(e),"]. ").concat(o_(r))):mt()),n},oG=function(){var e=x.useContext(e_);return e},sG=function(){return x.useContext(t_)},_d=function(){return x.useContext(i_)},xd=function(){return x.useContext(n_)};function Ci(t){"@babel/helpers - typeof";return Ci=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},Ci(t)}function uG(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lG(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 cG(t,e,r){return e&&lG(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function fG(t,e,r){return e=Tu(e),dG(t,l_()?Reflect.construct(e,r||[],Tu(t).constructor):e.apply(t,r))}function dG(t,e){if(e&&(Ci(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return hG(t)}function hG(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function l_(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(l_=function(){return!!t})()}function Tu(t){return Tu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Tu(t)}function pG(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&&Od(t,e)}function Od(t,e){return Od=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Od(t,e)}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 f_(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){Sd(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 Sd(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=vG(t,"string");return Ci(e)=="symbol"?e:e+""}function vG(t,e){if(Ci(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ci(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function yG(t,e){return wG(t)||bG(t,e)||mG(t,e)||gG()}function gG(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
164
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mG(t,e){if(t){if(typeof t=="string")return h_(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 h_(t,e)}}function h_(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 bG(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,s=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(c){l=!0,i=c}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function wG(t){if(Array.isArray(t))return t}function Ad(){return Ad=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},Ad.apply(this,arguments)}var _G=function(e,r){var n;return x.isValidElement(e)?n=x.cloneElement(e,r):ae(e)?n=e(r):n=x.createElement("line",Ad({},r,{className:"recharts-reference-line-line"})),n},xG=function(e,r,n,i,a,o,s,u,l){var c=a.x,f=a.y,d=a.width,h=a.height;if(n){var y=l.y,v=e.y.apply(y,{position:o});if(ar(l,"discard")&&!e.y.isInRange(v))return null;var p=[{x:c+d,y:v},{x:c,y:v}];return u==="left"?p.reverse():p}if(r){var m=l.x,b=e.x.apply(m,{position:o});if(ar(l,"discard")&&!e.x.isInRange(b))return null;var w=[{x:b,y:f+h},{x:b,y:f}];return s==="top"?w.reverse():w}if(i){var O=l.segment,g=O.map(function(_){return e.apply(_,{position:o})});return ar(l,"discard")&&VH(g,function(_){return!e.isInRange(_)})?null:g}return null};function OG(t){var e=t.x,r=t.y,n=t.segment,i=t.xAxisId,a=t.yAxisId,o=t.shape,s=t.className,u=t.alwaysShow,l=nG(),c=s_(i),f=u_(a),d=oG();if(!l||!d)return null;zt(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var h=md({x:c.scale,y:f.scale}),y=Je(e),v=Je(r),p=n&&n.length===2,m=xG(h,y,v,p,d,t.position,c.orientation,f.orientation,t);if(!m)return null;var b=yG(m,2),w=b[0],O=w.x,g=w.y,_=b[1],S=_.x,A=_.y,E=ar(t,"hidden")?"url(#".concat(l,")"):void 0,N=f_(f_({clipPath:E},Q(t,!0)),{},{x1:O,y1:g,x2:S,y2:A});return x.createElement(pe,{className:le("recharts-reference-line",s)},_G(o,N),nt.renderCallByParent(t,N8({x1:O,y1:g,x2:S,y2:A})))}var Pd=function(t){function e(){return uG(this,e),fG(this,e,arguments)}return pG(e,t),cG(e,[{key:"render",value:function(){return x.createElement(OG,this.props)}}])}(x.Component);Sd(Pd,"displayName","ReferenceLine"),Sd(Pd,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function Ed(){return Ed=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},Ed.apply(this,arguments)}function Ii(t){"@babel/helpers - typeof";return Ii=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},Ii(t)}function p_(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 v_(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?p_(Object(r),!0).forEach(function(n){$u(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p_(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function SG(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function AG(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,g_(n.key),n)}}function PG(t,e,r){return e&&AG(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function EG(t,e,r){return e=ju(e),TG(t,y_()?Reflect.construct(e,r||[],ju(t).constructor):e.apply(t,r))}function TG(t,e){if(e&&(Ii(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jG(t)}function jG(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 ju(t){return ju=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ju(t)}function $G(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&&Td(t,e)}function Td(t,e){return Td=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Td(t,e)}function $u(t,e,r){return e=g_(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function g_(t){var e=kG(t,"string");return Ii(e)=="symbol"?e:e+""}function kG(t,e){if(Ii(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ii(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var CG=function(e){var r=e.x,n=e.y,i=e.xAxis,a=e.yAxis,o=md({x:i.scale,y:a.scale}),s=o.apply({x:r,y:n},{bandAware:!0});return ar(e,"discard")&&!o.isInRange(s)?null:s},ku=function(t){function e(){return SG(this,e),EG(this,e,arguments)}return $G(e,t),PG(e,[{key:"render",value:function(){var n=this.props,i=n.x,a=n.y,o=n.r,s=n.alwaysShow,u=n.clipPathId,l=Je(i),c=Je(a);if(zt(s===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!l||!c)return null;var f=CG(this.props);if(!f)return null;var d=f.x,h=f.y,y=this.props,v=y.shape,p=y.className,m=ar(this.props,"hidden")?"url(#".concat(u,")"):void 0,b=v_(v_({clipPath:m},Q(this.props,!0)),{},{cx:d,cy:h});return x.createElement(pe,{className:le("recharts-reference-dot",p)},e.renderDot(v,b),nt.renderCallByParent(this.props,{x:d-o,y:h-o,width:2*o,height:2*o}))}}])}(x.Component);$u(ku,"displayName","ReferenceDot"),$u(ku,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1}),$u(ku,"renderDot",function(t,e){var r;return x.isValidElement(t)?r=x.cloneElement(t,e):ae(t)?r=t(e):r=x.createElement(wi,Ed({},e,{cx:e.cx,cy:e.cy,className:"recharts-reference-dot-dot"})),r});function jd(){return jd=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},jd.apply(this,arguments)}function Ni(t){"@babel/helpers - typeof";return Ni=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},Ni(t)}function m_(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 b_(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?m_(Object(r),!0).forEach(function(n){Iu(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):m_(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function IG(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function NG(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.key),n)}}function MG(t,e,r){return e&&NG(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function DG(t,e,r){return e=Cu(e),RG(t,w_()?Reflect.construct(e,r||[],Cu(t).constructor):e.apply(t,r))}function RG(t,e){if(e&&(Ni(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return LG(t)}function LG(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function w_(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(w_=function(){return!!t})()}function Cu(t){return Cu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Cu(t)}function BG(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&&$d(t,e)}function $d(t,e){return $d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},$d(t,e)}function Iu(t,e,r){return e=__(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function __(t){var e=UG(t,"string");return Ni(e)=="symbol"?e:e+""}function UG(t,e){if(Ni(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ni(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var FG=function(e,r,n,i,a){var o=a.x1,s=a.x2,u=a.y1,l=a.y2,c=a.xAxis,f=a.yAxis;if(!c||!f)return null;var d=md({x:c.scale,y:f.scale}),h={x:e?d.x.apply(o,{position:"start"}):d.x.rangeMin,y:n?d.y.apply(u,{position:"start"}):d.y.rangeMin},y={x:r?d.x.apply(s,{position:"end"}):d.x.rangeMax,y:i?d.y.apply(l,{position:"end"}):d.y.rangeMax};return ar(a,"discard")&&(!d.isInRange(h)||!d.isInRange(y))?null:Zw(h,y)},Nu=function(t){function e(){return IG(this,e),DG(this,e,arguments)}return BG(e,t),MG(e,[{key:"render",value:function(){var n=this.props,i=n.x1,a=n.x2,o=n.y1,s=n.y2,u=n.className,l=n.alwaysShow,c=n.clipPathId;zt(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=Je(i),d=Je(a),h=Je(o),y=Je(s),v=this.props.shape;if(!f&&!d&&!h&&!y&&!v)return null;var p=FG(f,d,h,y,this.props);if(!p&&!v)return null;var m=ar(this.props,"hidden")?"url(#".concat(c,")"):void 0;return x.createElement(pe,{className:le("recharts-reference-area",u)},e.renderRect(v,b_(b_({clipPath:m},Q(this.props,!0)),p)),nt.renderCallByParent(this.props,p))}}])}(x.Component);Iu(Nu,"displayName","ReferenceArea"),Iu(Nu,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1}),Iu(Nu,"renderRect",function(t,e){var r;return x.isValidElement(t)?r=x.cloneElement(t,e):ae(t)?r=t(e):r=x.createElement(id,jd({},e,{className:"recharts-reference-area-rect"})),r});function x_(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 WG(t,e,r){var n={width:t.width+e.width,height:t.height+e.height};return D8(n,r)}function qG(t,e,r){var n=r==="width",i=t.x,a=t.y,o=t.width,s=t.height;return e===1?{start:n?i:a,end:n?i+o:a+s}:{start:n?i+o:a+s,end:n?i:a}}function Mu(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 zG(t,e){return x_(t,e+1)}function KG(t,e,r,n,i){for(var a=(n||[]).slice(),o=e.start,s=e.end,u=0,l=1,c=o,f=function(){var y=n==null?void 0:n[u];if(y===void 0)return{v:x_(n,l)};var v=u,p,m=function(){return p===void 0&&(p=r(y,v)),p},b=y.coordinate,w=u===0||Mu(t,b,m,c,s);w||(u=0,c=o,l+=1),w&&(c=b+t*(m()/2+i),u+=l)},d;l<=a.length;)if(d=f(),d)return d.v;return[]}function yo(t){"@babel/helpers - typeof";return yo=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},yo(t)}function O_(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 ot(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?O_(Object(r),!0).forEach(function(n){VG(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):O_(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function VG(t,e,r){return e=HG(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function HG(t){var e=GG(t,"string");return yo(e)=="symbol"?e:e+""}function GG(t,e){if(yo(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(yo(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function YG(t,e,r,n,i){for(var a=(n||[]).slice(),o=a.length,s=e.start,u=e.end,l=function(d){var h=a[d],y,v=function(){return y===void 0&&(y=r(h,d)),y};if(d===o-1){var p=t*(h.coordinate+t*v()/2-u);a[d]=h=ot(ot({},h),{},{tickCoord:p>0?h.coordinate-p*t:h.coordinate})}else a[d]=h=ot(ot({},h),{},{tickCoord:h.coordinate});var m=Mu(t,h.tickCoord,v,s,u);m&&(u=h.tickCoord-t*(v()/2+i),a[d]=ot(ot({},h),{},{isShow:!0}))},c=o-1;c>=0;c--)l(c);return a}function XG(t,e,r,n,i,a){var o=(n||[]).slice(),s=o.length,u=e.start,l=e.end;if(a){var c=n[s-1],f=r(c,s-1),d=t*(c.coordinate+t*f/2-l);o[s-1]=c=ot(ot({},c),{},{tickCoord:d>0?c.coordinate-d*t:c.coordinate});var h=Mu(t,c.tickCoord,function(){return f},u,l);h&&(l=c.tickCoord-t*(f/2+i),o[s-1]=ot(ot({},c),{},{isShow:!0}))}for(var y=a?s-1:s,v=function(b){var w=o[b],O,g=function(){return O===void 0&&(O=r(w,b)),O};if(b===0){var _=t*(w.coordinate-t*g()/2-u);o[b]=w=ot(ot({},w),{},{tickCoord:_<0?w.coordinate-_*t:w.coordinate})}else o[b]=w=ot(ot({},w),{},{tickCoord:w.coordinate});var S=Mu(t,w.tickCoord,g,u,l);S&&(u=w.tickCoord+t*(g()/2+i),o[b]=ot(ot({},w),{},{isShow:!0}))},p=0;p<y;p++)v(p);return o}function kd(t,e,r){var n=t.tick,i=t.ticks,a=t.viewBox,o=t.minTickGap,s=t.orientation,u=t.interval,l=t.tickFormatter,c=t.unit,f=t.angle;if(!i||!i.length||!n)return[];if(V(u)||It.isSsr)return zG(i,typeof u=="number"&&V(u)?u:0);var d=[],h=s==="top"||s==="bottom"?"width":"height",y=c&&h==="width"?_a(c,{fontSize:e,letterSpacing:r}):{width:0,height:0},v=function(w,O){var g=ae(l)?l(w.value,O):w.value;return h==="width"?WG(_a(g,{fontSize:e,letterSpacing:r}),y,f):_a(g,{fontSize:e,letterSpacing:r})[h]},p=i.length>=2?ft(i[1].coordinate-i[0].coordinate):1,m=qG(a,p,h);return u==="equidistantPreserveStart"?KG(p,m,v,i,o):(u==="preserveStart"||u==="preserveStartEnd"?d=XG(p,m,v,i,o,u==="preserveStartEnd"):d=YG(p,m,v,i,o),d.filter(function(b){return b.isShow}))}var JG=["viewBox"],ZG=["viewBox"],QG=["ticks"];function Mi(t){"@babel/helpers - typeof";return Mi=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},Mi(t)}function Di(){return Di=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},Di.apply(this,arguments)}function S_(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 et(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?S_(Object(r),!0).forEach(function(n){Nd(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):S_(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Cd(t,e){if(t==null)return{};var r=e6(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 e6(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 t6(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function A_(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,E_(n.key),n)}}function r6(t,e,r){return e&&A_(t.prototype,e),r&&A_(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function n6(t,e,r){return e=Du(e),i6(t,P_()?Reflect.construct(e,r||[],Du(t).constructor):e.apply(t,r))}function i6(t,e){if(e&&(Mi(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return a6(t)}function a6(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 Du(t){return Du=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Du(t)}function o6(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&&Id(t,e)}function Id(t,e){return Id=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Id(t,e)}function Nd(t,e,r){return e=E_(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function E_(t){var e=s6(t,"string");return Mi(e)=="symbol"?e:e+""}function s6(t,e){if(Mi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Mi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Ri=function(t){function e(r){var n;return t6(this,e),n=n6(this,e,[r]),n.state={fontSize:"",letterSpacing:""},n}return o6(e,t),r6(e,[{key:"shouldComponentUpdate",value:function(n,i){var a=n.viewBox,o=Cd(n,JG),s=this.props,u=s.viewBox,l=Cd(s,ZG);return!Jn(a,u)||!Jn(o,l)||!Jn(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,s=i.width,u=i.height,l=i.orientation,c=i.tickSize,f=i.mirror,d=i.tickMargin,h,y,v,p,m,b,w=f?-1:1,O=n.tickSize||c,g=V(n.tickCoord)?n.tickCoord:n.coordinate;switch(l){case"top":h=y=n.coordinate,p=o+ +!f*u,v=p-w*O,b=v-w*d,m=g;break;case"left":v=p=n.coordinate,y=a+ +!f*s,h=y-w*O,m=h-w*d,b=g;break;case"right":v=p=n.coordinate,y=a+ +f*s,h=y+w*O,m=h+w*d,b=g;break;default:h=y=n.coordinate,p=o+ +f*u,v=p+w*O,b=v+w*d,m=g;break}return{line:{x1:h,y1:v,x2:y,y2:p},tick:{x:m,y:b}}}},{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,s=n.height,u=n.orientation,l=n.mirror,c=n.axisLine,f=et(et(et({},Q(this.props,!1)),Q(c,!1)),{},{fill:"none"});if(u==="top"||u==="bottom"){var d=+(u==="top"&&!l||u==="bottom"&&l);f=et(et({},f),{},{x1:i,y1:a+d*s,x2:i+o,y2:a+d*s})}else{var h=+(u==="left"&&!l||u==="right"&&l);f=et(et({},f),{},{x1:i+h*o,y1:a,x2:i+h*o,y2:a+s})}return x.createElement("line",Di({},f,{className:le("recharts-cartesian-axis-line",xt(c,"className"))}))}},{key:"renderTicks",value:function(n,i,a){var o=this,s=this.props,u=s.tickLine,l=s.stroke,c=s.tick,f=s.tickFormatter,d=s.unit,h=kd(et(et({},this.props),{},{ticks:n}),i,a),y=this.getTickTextAnchor(),v=this.getTickVerticalAnchor(),p=Q(this.props,!1),m=Q(c,!1),b=et(et({},p),{},{fill:"none"},Q(u,!1)),w=h.map(function(O,g){var _=o.getTickLineCoord(O),S=_.line,A=_.tick,E=et(et(et(et({textAnchor:y,verticalAnchor:v},p),{},{stroke:"none",fill:l},m),A),{},{index:g,payload:O,visibleTicksCount:h.length,tickFormatter:f});return x.createElement(pe,Di({className:"recharts-cartesian-axis-tick",key:"tick-".concat(O.value,"-").concat(O.coordinate,"-").concat(O.tickCoord)},on(o.props,O,g)),u&&x.createElement("line",Di({},b,S,{className:le("recharts-cartesian-axis-tick-line",xt(u,"className"))})),c&&e.renderTickItem(c,E,"".concat(ae(f)?f(O.value,g):O.value).concat(d||"")))});return x.createElement("g",{className:"recharts-cartesian-axis-ticks"},w)}},{key:"render",value:function(){var n=this,i=this.props,a=i.axisLine,o=i.width,s=i.height,u=i.ticksGenerator,l=i.className,c=i.hide;if(c)return null;var f=this.props,d=f.ticks,h=Cd(f,QG),y=d;return ae(u)&&(y=d&&d.length>0?u(this.props):u(h)),o<=0||s<=0||!y||!y.length?null:x.createElement(pe,{className:le("recharts-cartesian-axis",l),ref:function(p){n.layerReference=p}},a&&this.renderAxisLine(),this.renderTicks(y,this.state.fontSize,this.state.letterSpacing),nt.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var o,s=le(i.className,"recharts-cartesian-axis-tick-value");return x.isValidElement(n)?o=x.cloneElement(n,et(et({},i),{},{className:s})):ae(n)?o=n(et(et({},i),{},{className:s})):o=x.createElement(cn,Di({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(x.Component);Nd(Ri,"displayName","CartesianAxis"),Nd(Ri,"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 u6=["x1","y1","x2","y2","key"],l6=["offset"];function Pn(t){"@babel/helpers - typeof";return Pn=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},Pn(t)}function T_(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 st(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?T_(Object(r),!0).forEach(function(n){c6(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):T_(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function c6(t,e,r){return e=f6(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function f6(t){var e=d6(t,"string");return Pn(e)=="symbol"?e:e+""}function d6(t,e){if(Pn(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Pn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function En(){return En=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},En.apply(this,arguments)}function j_(t,e){if(t==null)return{};var r=h6(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 h6(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 p6=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,s=e.height,u=e.ry;return x.createElement("rect",{x:i,y:a,ry:u,width:o,height:s,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function $_(t,e){var r;if(x.isValidElement(t))r=x.cloneElement(t,e);else if(ae(t))r=t(e);else{var n=e.x1,i=e.y1,a=e.x2,o=e.y2,s=e.key,u=j_(e,u6),l=Q(u,!1);l.offset;var c=j_(l,l6);r=x.createElement("line",En({},c,{x1:n,y1:i,x2:a,y2:o,fill:"none",key:s}))}return r}function v6(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(s,u){var l=st(st({},t),{},{x1:e,y1:s,x2:e+r,y2:s,key:"line-".concat(u),index:u});return $_(i,l)});return x.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function y6(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(s,u){var l=st(st({},t),{},{x1:s,y1:e,x2:s,y2:e+r,key:"line-".concat(u),index:u});return $_(i,l)});return x.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function g6(t){var e=t.horizontalFill,r=t.fillOpacity,n=t.x,i=t.y,a=t.width,o=t.height,s=t.horizontalPoints,u=t.horizontal,l=u===void 0?!0:u;if(!l||!e||!e.length)return null;var c=s.map(function(d){return Math.round(d+i-i)}).sort(function(d,h){return d-h});i!==c[0]&&c.unshift(0);var f=c.map(function(d,h){var y=!c[h+1],v=y?i+o-d:c[h+1]-d;if(v<=0)return null;var p=h%e.length;return x.createElement("rect",{key:"react-".concat(h),y:d,x:n,height:v,width:a,stroke:"none",fill:e[p],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function m6(t){var e=t.vertical,r=e===void 0?!0:e,n=t.verticalFill,i=t.fillOpacity,a=t.x,o=t.y,s=t.width,u=t.height,l=t.verticalPoints;if(!r||!n||!n.length)return null;var c=l.map(function(d){return Math.round(d+a-a)}).sort(function(d,h){return d-h});a!==c[0]&&c.unshift(0);var f=c.map(function(d,h){var y=!c[h+1],v=y?a+s-d:c[h+1]-d;if(v<=0)return null;var p=h%n.length;return x.createElement("rect",{key:"react-".concat(h),x:d,y:o,width:v,height:u,stroke:"none",fill:n[p],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var b6=function(e,r){var n=e.xAxis,i=e.width,a=e.height,o=e.offset;return Mb(kd(st(st(st({},Ri.defaultProps),n),{},{ticks:wr(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.left,o.left+o.width,r)},w6=function(e,r){var n=e.yAxis,i=e.width,a=e.height,o=e.offset;return Mb(kd(st(st(st({},Ri.defaultProps),n),{},{ticks:wr(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.top,o.top+o.height,r)},Li={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Ru(t){var e,r,n,i,a,o,s=_d(),u=xd(),l=sG(),c=st(st({},t),{},{stroke:(e=t.stroke)!==null&&e!==void 0?e:Li.stroke,fill:(r=t.fill)!==null&&r!==void 0?r:Li.fill,horizontal:(n=t.horizontal)!==null&&n!==void 0?n:Li.horizontal,horizontalFill:(i=t.horizontalFill)!==null&&i!==void 0?i:Li.horizontalFill,vertical:(a=t.vertical)!==null&&a!==void 0?a:Li.vertical,verticalFill:(o=t.verticalFill)!==null&&o!==void 0?o:Li.verticalFill,x:V(t.x)?t.x:l.left,y:V(t.y)?t.y:l.top,width:V(t.width)?t.width:l.width,height:V(t.height)?t.height:l.height}),f=c.x,d=c.y,h=c.width,y=c.height,v=c.syncWithTicks,p=c.horizontalValues,m=c.verticalValues,b=iG(),w=aG();if(!V(h)||h<=0||!V(y)||y<=0||!V(f)||f!==+f||!V(d)||d!==+d)return null;var O=c.verticalCoordinatesGenerator||b6,g=c.horizontalCoordinatesGenerator||w6,_=c.horizontalPoints,S=c.verticalPoints;if((!_||!_.length)&&ae(g)){var A=p&&p.length,E=g({yAxis:w?st(st({},w),{},{ticks:A?p:w.ticks}):void 0,width:s,height:u,offset:l},A?!0:v);zt(Array.isArray(E),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Pn(E),"]")),Array.isArray(E)&&(_=E)}if((!S||!S.length)&&ae(O)){var N=m&&m.length,j=O({xAxis:b?st(st({},b),{},{ticks:N?m:b.ticks}):void 0,width:s,height:u,offset:l},N?!0:v);zt(Array.isArray(j),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Pn(j),"]")),Array.isArray(j)&&(S=j)}return x.createElement("g",{className:"recharts-cartesian-grid"},x.createElement(p6,{fill:c.fill,fillOpacity:c.fillOpacity,x:c.x,y:c.y,width:c.width,height:c.height,ry:c.ry}),x.createElement(v6,En({},c,{offset:l,horizontalPoints:_,xAxis:b,yAxis:w})),x.createElement(y6,En({},c,{offset:l,verticalPoints:S,xAxis:b,yAxis:w})),x.createElement(g6,En({},c,{horizontalPoints:_})),x.createElement(m6,En({},c,{verticalPoints:S})))}Ru.displayName="CartesianGrid";var _6=["type","layout","connectNulls","ref"],x6=["key"];function Bi(t){"@babel/helpers - typeof";return Bi=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},Bi(t)}function k_(t,e){if(t==null)return{};var r=O6(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 O6(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 go(){return go=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},go.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 Et(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){Xt(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 Ui(t){return E6(t)||P6(t)||A6(t)||S6()}function S6(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
165
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function A6(t,e){if(t){if(typeof t=="string")return Md(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 Md(t,e)}}function P6(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function E6(t){if(Array.isArray(t))return Md(t)}function Md(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 T6(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function I_(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 j6(t,e,r){return e&&I_(t.prototype,e),r&&I_(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function $6(t,e,r){return e=Lu(e),k6(t,N_()?Reflect.construct(e,r||[],Lu(t).constructor):e.apply(t,r))}function k6(t,e){if(e&&(Bi(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return C6(t)}function C6(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function N_(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(N_=function(){return!!t})()}function Lu(t){return Lu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Lu(t)}function I6(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&&Dd(t,e)}function Dd(t,e){return Dd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Dd(t,e)}function Xt(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=N6(t,"string");return Bi(e)=="symbol"?e:e+""}function N6(t,e){if(Bi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Bi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var mo=function(t){function e(){var r;T6(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=$6(this,e,[].concat(i)),Xt(r,"state",{isAnimationFinished:!0,totalLength:0}),Xt(r,"generateSimpleStrokeDasharray",function(o,s){return"".concat(s,"px ").concat(o-s,"px")}),Xt(r,"getStrokeDasharray",function(o,s,u){var l=u.reduce(function(m,b){return m+b});if(!l)return r.generateSimpleStrokeDasharray(s,o);for(var c=Math.floor(o/l),f=o%l,d=s-o,h=[],y=0,v=0;y<u.length;v+=u[y],++y)if(v+u[y]>f){h=[].concat(Ui(u.slice(0,y)),[f-v]);break}var p=h.length%2===0?[0,d]:[d];return[].concat(Ui(e.repeat(u,c)),Ui(h),p).map(function(m){return"".concat(m,"px")}).join(", ")}),Xt(r,"id",an("recharts-line-")),Xt(r,"pathRef",function(o){r.mainCurve=o}),Xt(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Xt(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return I6(e,t),j6(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,s=a.xAxis,u=a.yAxis,l=a.layout,c=a.children,f=Ot(c,Ba);if(!f)return null;var d=function(v,p){return{x:v.x,y:v.y,value:v.value,errorVal:We(v.payload,p)}},h={clipPath:n?"url(#clipPath-".concat(i,")"):null};return x.createElement(pe,h,f.map(function(y){return x.cloneElement(y,{key:"bar-".concat(y.props.dataKey),data:o,xAxis:s,yAxis:u,layout:l,dataPointFormatter:d})}))}},{key:"renderDots",value:function(n,i,a){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var s=this.props,u=s.dot,l=s.points,c=s.dataKey,f=Q(this.props,!1),d=Q(u,!0),h=l.map(function(v,p){var m=Et(Et(Et({key:"dot-".concat(p),r:3},f),d),{},{index:p,cx:v.x,cy:v.y,value:v.value,dataKey:c,payload:v.payload,points:l});return e.renderDotItem(u,m)}),y={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return x.createElement(pe,go({className:"recharts-line-dots",key:"dots"},y),h)}},{key:"renderCurveStatically",value:function(n,i,a,o){var s=this.props,u=s.type,l=s.layout,c=s.connectNulls;s.ref;var f=k_(s,_6),d=Et(Et(Et({},Q(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:n},o),{},{type:u,layout:l,connectNulls:c});return x.createElement(wn,go({},d,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var a=this,o=this.props,s=o.points,u=o.strokeDasharray,l=o.isAnimationActive,c=o.animationBegin,f=o.animationDuration,d=o.animationEasing,h=o.animationId,y=o.animateNewValues,v=o.width,p=o.height,m=this.state,b=m.prevPoints,w=m.totalLength;return x.createElement(Rt,{begin:c,duration:f,isActive:l,easing:d,from:{t:0},to:{t:1},key:"line-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(O){var g=O.t;if(b){var _=b.length/s.length,S=s.map(function($,k){var I=Math.floor(k*_);if(b[I]){var R=b[I],M=Fe(R.x,$.x),L=Fe(R.y,$.y);return Et(Et({},$),{},{x:M(g),y:L(g)})}if(y){var q=Fe(v*2,$.x),z=Fe(p/2,$.y);return Et(Et({},$),{},{x:q(g),y:z(g)})}return Et(Et({},$),{},{x:$.x,y:$.y})});return a.renderCurveStatically(S,n,i)}var A=Fe(0,w),E=A(g),N;if(u){var j="".concat(u).split(/[,\s]+/gim).map(function($){return parseFloat($)});N=a.getStrokeDasharray(E,w,j)}else N=a.generateSimpleStrokeDasharray(w,E);return a.renderCurveStatically(s,n,i,{strokeDasharray:N})})}},{key:"renderCurve",value:function(n,i){var a=this.props,o=a.points,s=a.isAnimationActive,u=this.state,l=u.prevPoints,c=u.totalLength;return s&&o&&o.length&&(!l&&c>0||!Rr(l,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,s=i.points,u=i.className,l=i.xAxis,c=i.yAxis,f=i.top,d=i.left,h=i.width,y=i.height,v=i.isAnimationActive,p=i.id;if(a||!s||!s.length)return null;var m=this.state.isAnimationFinished,b=s.length===1,w=le("recharts-line",u),O=l&&l.allowDataOverflow,g=c&&c.allowDataOverflow,_=O||g,S=fe(p)?this.id:p,A=(n=Q(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},E=A.r,N=E===void 0?3:E,j=A.strokeWidth,$=j===void 0?2:j,k=Pv(o)?o:{},I=k.clipDot,R=I===void 0?!0:I,M=N*2+$;return x.createElement(pe,{className:w},O||g?x.createElement("defs",null,x.createElement("clipPath",{id:"clipPath-".concat(S)},x.createElement("rect",{x:O?d:d-h/2,y:g?f:f-y/2,width:O?h:h*2,height:g?y:y*2})),!R&&x.createElement("clipPath",{id:"clipPath-dots-".concat(S)},x.createElement("rect",{x:d-M/2,y:f-M/2,width:h+M,height:y+M}))):null,!b&&this.renderCurve(_,S),this.renderErrorBar(_,S),(b||o)&&this.renderDots(_,R,S),(!v||m)&&Ht.renderCallByParent(this.props,s))}}],[{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(Ui(n),[0]):n,o=[],s=0;s<i;++s)o=[].concat(Ui(o),Ui(a));return o}},{key:"renderDotItem",value:function(n,i){var a;if(x.isValidElement(n))a=x.cloneElement(n,i);else if(ae(n))a=n(i);else{var o=i.key,s=k_(i,x6),u=le("recharts-line-dot",typeof n!="boolean"?n.className:"");a=x.createElement(wi,go({key:o},s,{className:u}))}return a}}])}(x.PureComponent);Xt(mo,"displayName","Line"),Xt(mo,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!It.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1}),Xt(mo,"getComposedData",function(t){var e=t.props,r=t.xAxis,n=t.yAxis,i=t.xAxisTicks,a=t.yAxisTicks,o=t.dataKey,s=t.bandSize,u=t.displayedData,l=t.offset,c=e.layout,f=u.map(function(d,h){var y=We(d,o);return c==="horizontal"?{x:Xs({axis:r,ticks:i,bandSize:s,entry:d,index:h}),y:fe(y)?null:n.scale(y),value:y,payload:d}:{x:fe(y)?null:r.scale(y),y:Xs({axis:n,ticks:a,bandSize:s,entry:d,index:h}),value:y,payload:d}});return Et({points:f,layout:c},l)});var M6=["layout","type","stroke","connectNulls","isRange","ref"],D6=["key"],D_;function Fi(t){"@babel/helpers - typeof";return Fi=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},Fi(t)}function R_(t,e){if(t==null)return{};var r=R6(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 R6(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 Tn(){return Tn=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},Tn.apply(this,arguments)}function L_(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 Fr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?L_(Object(r),!0).forEach(function(n){or(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):L_(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function L6(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function B_(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,F_(n.key),n)}}function B6(t,e,r){return e&&B_(t.prototype,e),r&&B_(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function U6(t,e,r){return e=Bu(e),F6(t,U_()?Reflect.construct(e,r||[],Bu(t).constructor):e.apply(t,r))}function F6(t,e){if(e&&(Fi(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return W6(t)}function W6(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function U_(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(U_=function(){return!!t})()}function Bu(t){return Bu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Bu(t)}function q6(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&&Rd(t,e)}function Rd(t,e){return Rd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Rd(t,e)}function or(t,e,r){return e=F_(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function F_(t){var e=z6(t,"string");return Fi(e)=="symbol"?e:e+""}function z6(t,e){if(Fi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Fi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Wr=function(t){function e(){var r;L6(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=U6(this,e,[].concat(i)),or(r,"state",{isAnimationFinished:!0}),or(r,"id",an("recharts-area-")),or(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),ae(o)&&o()}),or(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),ae(o)&&o()}),r}return q6(e,t),B6(e,[{key:"renderDots",value:function(n,i,a){var o=this.props.isAnimationActive,s=this.state.isAnimationFinished;if(o&&!s)return null;var u=this.props,l=u.dot,c=u.points,f=u.dataKey,d=Q(this.props,!1),h=Q(l,!0),y=c.map(function(p,m){var b=Fr(Fr(Fr({key:"dot-".concat(m),r:3},d),h),{},{index:m,cx:p.x,cy:p.y,dataKey:f,value:p.value,payload:p.payload,points:c});return e.renderDotItem(l,b)}),v={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return x.createElement(pe,Tn({className:"recharts-area-dots"},v),y)}},{key:"renderHorizontalRect",value:function(n){var i=this.props,a=i.baseLine,o=i.points,s=i.strokeWidth,u=o[0].x,l=o[o.length-1].x,c=n*Math.abs(u-l),f=Dr(o.map(function(d){return d.y||0}));return V(a)&&typeof a=="number"?f=Math.max(a,f):a&&Array.isArray(a)&&a.length&&(f=Math.max(Dr(a.map(function(d){return d.y||0})),f)),V(f)?x.createElement("rect",{x:u<l?u:u-c,y:0,width:c,height:Math.floor(f+(s?parseInt("".concat(s),10):1))}):null}},{key:"renderVerticalRect",value:function(n){var i=this.props,a=i.baseLine,o=i.points,s=i.strokeWidth,u=o[0].y,l=o[o.length-1].y,c=n*Math.abs(u-l),f=Dr(o.map(function(d){return d.x||0}));return V(a)&&typeof a=="number"?f=Math.max(a,f):a&&Array.isArray(a)&&a.length&&(f=Math.max(Dr(a.map(function(d){return d.x||0})),f)),V(f)?x.createElement("rect",{x:0,y:u<l?u:u-c,width:f+(s?parseInt("".concat(s),10):1),height:Math.floor(c)}):null}},{key:"renderClipRect",value:function(n){var i=this.props.layout;return i==="vertical"?this.renderVerticalRect(n):this.renderHorizontalRect(n)}},{key:"renderAreaStatically",value:function(n,i,a,o){var s=this.props,u=s.layout,l=s.type,c=s.stroke,f=s.connectNulls,d=s.isRange;s.ref;var h=R_(s,M6);return x.createElement(pe,{clipPath:a?"url(#clipPath-".concat(o,")"):null},x.createElement(wn,Tn({},Q(h,!0),{points:n,connectNulls:f,type:l,baseLine:i,layout:u,stroke:"none",className:"recharts-area-area"})),c!=="none"&&x.createElement(wn,Tn({},Q(this.props,!1),{className:"recharts-area-curve",layout:u,type:l,connectNulls:f,fill:"none",points:n})),c!=="none"&&d&&x.createElement(wn,Tn({},Q(this.props,!1),{className:"recharts-area-curve",layout:u,type:l,connectNulls:f,fill:"none",points:i})))}},{key:"renderAreaWithAnimation",value:function(n,i){var a=this,o=this.props,s=o.points,u=o.baseLine,l=o.isAnimationActive,c=o.animationBegin,f=o.animationDuration,d=o.animationEasing,h=o.animationId,y=this.state,v=y.prevPoints,p=y.prevBaseLine;return x.createElement(Rt,{begin:c,duration:f,isActive:l,easing:d,from:{t:0},to:{t:1},key:"area-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(m){var b=m.t;if(v){var w=v.length/s.length,O=s.map(function(A,E){var N=Math.floor(E*w);if(v[N]){var j=v[N],$=Fe(j.x,A.x),k=Fe(j.y,A.y);return Fr(Fr({},A),{},{x:$(b),y:k(b)})}return A}),g;if(V(u)&&typeof u=="number"){var _=Fe(p,u);g=_(b)}else if(fe(u)||Xn(u)){var S=Fe(p,0);g=S(b)}else g=u.map(function(A,E){var N=Math.floor(E*w);if(p[N]){var j=p[N],$=Fe(j.x,A.x),k=Fe(j.y,A.y);return Fr(Fr({},A),{},{x:$(b),y:k(b)})}return A});return a.renderAreaStatically(O,g,n,i)}return x.createElement(pe,null,x.createElement("defs",null,x.createElement("clipPath",{id:"animationClipPath-".concat(i)},a.renderClipRect(b))),x.createElement(pe,{clipPath:"url(#animationClipPath-".concat(i,")")},a.renderAreaStatically(s,u,n,i)))})}},{key:"renderArea",value:function(n,i){var a=this.props,o=a.points,s=a.baseLine,u=a.isAnimationActive,l=this.state,c=l.prevPoints,f=l.prevBaseLine,d=l.totalLength;return u&&o&&o.length&&(!c&&d>0||!Rr(c,o)||!Rr(f,s))?this.renderAreaWithAnimation(n,i):this.renderAreaStatically(o,s,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,s=i.points,u=i.className,l=i.top,c=i.left,f=i.xAxis,d=i.yAxis,h=i.width,y=i.height,v=i.isAnimationActive,p=i.id;if(a||!s||!s.length)return null;var m=this.state.isAnimationFinished,b=s.length===1,w=le("recharts-area",u),O=f&&f.allowDataOverflow,g=d&&d.allowDataOverflow,_=O||g,S=fe(p)?this.id:p,A=(n=Q(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},E=A.r,N=E===void 0?3:E,j=A.strokeWidth,$=j===void 0?2:j,k=Pv(o)?o:{},I=k.clipDot,R=I===void 0?!0:I,M=N*2+$;return x.createElement(pe,{className:w},O||g?x.createElement("defs",null,x.createElement("clipPath",{id:"clipPath-".concat(S)},x.createElement("rect",{x:O?c:c-h/2,y:g?l:l-y/2,width:O?h:h*2,height:g?y:y*2})),!R&&x.createElement("clipPath",{id:"clipPath-dots-".concat(S)},x.createElement("rect",{x:c-M/2,y:l-M/2,width:h+M,height:y+M}))):null,b?null:this.renderArea(_,S),(o||b)&&this.renderDots(_,R,S),(!v||m)&&Ht.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:n.points!==i.curPoints||n.baseLine!==i.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])}(x.PureComponent);D_=Wr,or(Wr,"displayName","Area"),or(Wr,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!It.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"}),or(Wr,"getBaseValue",function(t,e,r,n){var i=t.layout,a=t.baseValue,o=e.props.baseValue,s=o??a;if(V(s)&&typeof s=="number")return s;var u=i==="horizontal"?n:r,l=u.scale.domain();if(u.type==="number"){var c=Math.max(l[0],l[1]),f=Math.min(l[0],l[1]);return s==="dataMin"?f:s==="dataMax"||c<0?c:Math.max(Math.min(l[0],l[1]),0)}return s==="dataMin"?l[0]:s==="dataMax"?l[1]:l[0]}),or(Wr,"getComposedData",function(t){var e=t.props,r=t.item,n=t.xAxis,i=t.yAxis,a=t.xAxisTicks,o=t.yAxisTicks,s=t.bandSize,u=t.dataKey,l=t.stackedData,c=t.dataStartIndex,f=t.displayedData,d=t.offset,h=e.layout,y=l&&l.length,v=D_.getBaseValue(e,r,n,i),p=h==="horizontal",m=!1,b=f.map(function(O,g){var _;y?_=l[c+g]:(_=We(O,u),Array.isArray(_)?m=!0:_=[v,_]);var S=_[1]==null||y&&We(O,u)==null;return p?{x:Xs({axis:n,ticks:a,bandSize:s,entry:O,index:g}),y:S?null:i.scale(_[1]),value:_,payload:O}:{x:S?null:n.scale(_[1]),y:Xs({axis:i,ticks:o,bandSize:s,entry:O,index:g}),value:_,payload:O}}),w;return y||m?w=b.map(function(O){var g=Array.isArray(O.value)?O.value[0]:null;return p?{x:O.x,y:g!=null&&O.y!=null?i.scale(g):null}:{x:g!=null?n.scale(g):null,y:O.y}}):w=p?i.scale(v):n.scale(v),Fr({points:b,baseLine:w,layout:h,isRange:m},d)}),or(Wr,"renderDotItem",function(t,e){var r;if(x.isValidElement(t))r=x.cloneElement(t,e);else if(ae(t))r=t(e);else{var n=le("recharts-area-dot",typeof t!="boolean"?t.className:""),i=e.key,a=R_(e,D6);r=x.createElement(wi,Tn({},a,{key:i,className:n}))}return r});function Wi(t){"@babel/helpers - typeof";return Wi=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},Wi(t)}function K6(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function V6(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,z_(n.key),n)}}function H6(t,e,r){return e&&V6(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function G6(t,e,r){return e=Uu(e),Y6(t,W_()?Reflect.construct(e,r||[],Uu(t).constructor):e.apply(t,r))}function Y6(t,e){if(e&&(Wi(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return X6(t)}function X6(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function W_(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(W_=function(){return!!t})()}function Uu(t){return Uu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Uu(t)}function J6(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&&Ld(t,e)}function Ld(t,e){return Ld=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Ld(t,e)}function q_(t,e,r){return e=z_(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function z_(t){var e=Z6(t,"string");return Wi(e)=="symbol"?e:e+""}function Z6(t,e){if(Wi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Wi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Bd(){return Bd=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},Bd.apply(this,arguments)}function Q6(t){var e=t.xAxisId,r=_d(),n=xd(),i=s_(e);return i==null?null:ve.createElement(Ri,Bd({},i,{className:le("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(o){return wr(o,!0)}}))}var qr=function(t){function e(){return K6(this,e),G6(this,e,arguments)}return J6(e,t),H6(e,[{key:"render",value:function(){return ve.createElement(Q6,this.props)}}])}(ve.Component);q_(qr,"displayName","XAxis"),q_(qr,"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 qi(t){"@babel/helpers - typeof";return qi=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},qi(t)}function e5(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function t5(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,H_(n.key),n)}}function r5(t,e,r){return e&&t5(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function n5(t,e,r){return e=Fu(e),i5(t,K_()?Reflect.construct(e,r||[],Fu(t).constructor):e.apply(t,r))}function i5(t,e){if(e&&(qi(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return a5(t)}function a5(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function K_(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(K_=function(){return!!t})()}function Fu(t){return Fu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Fu(t)}function o5(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&&Ud(t,e)}function Ud(t,e){return Ud=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Ud(t,e)}function V_(t,e,r){return e=H_(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function H_(t){var e=s5(t,"string");return qi(e)=="symbol"?e:e+""}function s5(t,e){if(qi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(qi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Fd(){return Fd=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},Fd.apply(this,arguments)}var u5=function(e){var r=e.yAxisId,n=_d(),i=xd(),a=u_(r);return a==null?null:ve.createElement(Ri,Fd({},a,{className:le("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:i},ticksGenerator:function(s){return wr(s,!0)}}))},zr=function(t){function e(){return e5(this,e),n5(this,e,arguments)}return o5(e,t),r5(e,[{key:"render",value:function(){return ve.createElement(u5,this.props)}}])}(ve.Component);V_(zr,"displayName","YAxis"),V_(zr,"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 G_(t){return d5(t)||f5(t)||c5(t)||l5()}function l5(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
166
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function c5(t,e){if(t){if(typeof t=="string")return Wd(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 Wd(t,e)}}function f5(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function d5(t){if(Array.isArray(t))return Wd(t)}function Wd(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 qd=function(e,r,n,i,a){var o=Ot(e,Pd),s=Ot(e,ku),u=[].concat(G_(o),G_(s)),l=Ot(e,Nu),c="".concat(i,"Id"),f=i[0],d=r;if(u.length&&(d=u.reduce(function(v,p){if(p.props[c]===n&&ar(p.props,"extendDomain")&&V(p.props[f])){var m=p.props[f];return[Math.min(v[0],m),Math.max(v[1],m)]}return v},d)),l.length){var h="".concat(f,"1"),y="".concat(f,"2");d=l.reduce(function(v,p){if(p.props[c]===n&&ar(p.props,"extendDomain")&&V(p.props[h])&&V(p.props[y])){var m=p.props[h],b=p.props[y];return[Math.min(v[0],m,b),Math.max(v[1],m,b)]}return v},d)}return a&&a.length&&(d=a.reduce(function(v,p){return V(p)?[Math.min(v[0],p),Math.max(v[1],p)]:v},d)),d},Y_={exports:{}};(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,l,c){this.fn=u,this.context=l,this.once=c||!1}function a(u,l,c,f,d){if(typeof c!="function")throw new TypeError("The listener must be a function");var h=new i(c,f||u,d),y=r?r+l:l;return u._events[y]?u._events[y].fn?u._events[y]=[u._events[y],h]:u._events[y].push(h):(u._events[y]=h,u._eventsCount++),u}function o(u,l){--u._eventsCount===0?u._events=new n:delete u._events[l]}function s(){this._events=new n,this._eventsCount=0}s.prototype.eventNames=function(){var l=[],c,f;if(this._eventsCount===0)return l;for(f in c=this._events)e.call(c,f)&&l.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},s.prototype.listeners=function(l){var c=r?r+l:l,f=this._events[c];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,h=f.length,y=new Array(h);d<h;d++)y[d]=f[d].fn;return y},s.prototype.listenerCount=function(l){var c=r?r+l:l,f=this._events[c];return f?f.fn?1:f.length:0},s.prototype.emit=function(l,c,f,d,h,y){var v=r?r+l:l;if(!this._events[v])return!1;var p=this._events[v],m=arguments.length,b,w;if(p.fn){switch(p.once&&this.removeListener(l,p.fn,void 0,!0),m){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,c),!0;case 3:return p.fn.call(p.context,c,f),!0;case 4:return p.fn.call(p.context,c,f,d),!0;case 5:return p.fn.call(p.context,c,f,d,h),!0;case 6:return p.fn.call(p.context,c,f,d,h,y),!0}for(w=1,b=new Array(m-1);w<m;w++)b[w-1]=arguments[w];p.fn.apply(p.context,b)}else{var O=p.length,g;for(w=0;w<O;w++)switch(p[w].once&&this.removeListener(l,p[w].fn,void 0,!0),m){case 1:p[w].fn.call(p[w].context);break;case 2:p[w].fn.call(p[w].context,c);break;case 3:p[w].fn.call(p[w].context,c,f);break;case 4:p[w].fn.call(p[w].context,c,f,d);break;default:if(!b)for(g=1,b=new Array(m-1);g<m;g++)b[g-1]=arguments[g];p[w].fn.apply(p[w].context,b)}}return!0},s.prototype.on=function(l,c,f){return a(this,l,c,f,!1)},s.prototype.once=function(l,c,f){return a(this,l,c,f,!0)},s.prototype.removeListener=function(l,c,f,d){var h=r?r+l:l;if(!this._events[h])return this;if(!c)return o(this,h),this;var y=this._events[h];if(y.fn)y.fn===c&&(!d||y.once)&&(!f||y.context===f)&&o(this,h);else{for(var v=0,p=[],m=y.length;v<m;v++)(y[v].fn!==c||d&&!y[v].once||f&&y[v].context!==f)&&p.push(y[v]);p.length?this._events[h]=p.length===1?p[0]:p:o(this,h)}return this},s.prototype.removeAllListeners=function(l){var c;return l?(c=r?r+l:l,this._events[c]&&o(this,c)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=r,s.EventEmitter=s,t.exports=s})(Y_);var h5=Y_.exports;const p5=je(h5);var zd=new p5,Kd="recharts.syncMouseEvents";function bo(t){"@babel/helpers - typeof";return bo=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},bo(t)}function v5(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function y5(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 g5(t,e,r){return e&&y5(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Vd(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=m5(t,"string");return bo(e)=="symbol"?e:e+""}function m5(t,e){if(bo(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(bo(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var b5=function(){function t(){v5(this,t),Vd(this,"activeIndex",0),Vd(this,"coordinateList",[]),Vd(this,"layout","horizontal")}return g5(t,[{key:"setDetails",value:function(r){var n,i=r.coordinateList,a=i===void 0?null:i,o=r.container,s=o===void 0?null:o,u=r.layout,l=u===void 0?null:u,c=r.offset,f=c===void 0?null:c,d=r.mouseHandlerCallback,h=d===void 0?null:d;this.coordinateList=(n=a??this.coordinateList)!==null&&n!==void 0?n:[],this.container=s??this.container,this.layout=l??this.layout,this.offset=f??this.offset,this.mouseHandlerCallback=h??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,s=i.height,u=this.coordinateList[this.activeIndex].coordinate,l=((r=window)===null||r===void 0?void 0:r.scrollX)||0,c=((n=window)===null||n===void 0?void 0:n.scrollY)||0,f=a+u+l,d=o+this.offset.top+s/2+c;this.mouseHandlerCallback({pageX:f,pageY:d})}}}])}();function w5(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&&V(n)&&V(i))return!0}return!1}function _5(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 J_(t){var e=t.cx,r=t.cy,n=t.radius,i=t.startAngle,a=t.endAngle,o=we(e,r,n,i),s=we(e,r,n,a);return{points:[o,s],cx:e,cy:r,radius:n,startAngle:i,endAngle:a}}function x5(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 s=e.cx,u=e.cy,l=e.innerRadius,c=e.outerRadius,f=e.angle,d=we(s,u,l,f),h=we(s,u,c,f);n=d.x,i=d.y,a=h.x,o=h.y}else return J_(e);return[{x:n,y:i},{x:a,y:o}]}function wo(t){"@babel/helpers - typeof";return wo=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},wo(t)}function Z_(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 Wu(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Z_(Object(r),!0).forEach(function(n){O5(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Z_(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function O5(t,e,r){return e=S5(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function S5(t){var e=A5(t,"string");return wo(e)=="symbol"?e:e+""}function A5(t,e){if(wo(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(wo(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function P5(t){var e,r,n=t.element,i=t.tooltipEventType,a=t.isActive,o=t.activeCoordinate,s=t.activePayload,u=t.offset,l=t.activeTooltipIndex,c=t.tooltipAxisBandSize,f=t.layout,d=t.chartName,h=(e=n.props.cursor)!==null&&e!==void 0?e:(r=n.type.defaultProps)===null||r===void 0?void 0:r.cursor;if(!n||!h||!a||!o||d!=="ScatterChart"&&i!=="axis")return null;var y,v=wn;if(d==="ScatterChart")y=o,v=lK;else if(d==="BarChart")y=_5(f,o,u,c),v=id;else if(f==="radial"){var p=J_(o),m=p.cx,b=p.cy,w=p.radius,O=p.startAngle,g=p.endAngle;y={cx:m,cy:b,startAngle:O,endAngle:g,innerRadius:w,outerRadius:w},v=u0}else y={points:x5(f,o,u)},v=wn;var _=Wu(Wu(Wu(Wu({stroke:"#ccc",pointerEvents:"none"},u),y),Q(h,!1)),{},{payload:s,payloadIndex:l,className:le("recharts-tooltip-cursor",h.className)});return x.isValidElement(h)?x.cloneElement(h,_):x.createElement(v,_)}var E5=["item"],T5=["children","className","width","height","style","compact","title","desc"];function zi(t){"@babel/helpers - typeof";return zi=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},zi(t)}function Ki(){return Ki=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},Ki.apply(this,arguments)}function Q_(t,e){return k5(t)||$5(t,e)||rx(t,e)||j5()}function j5(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
167
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
168
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rx(t,e){if(t){if(typeof t=="string")return Gd(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 Gd(t,e)}}function F5(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function W5(t){if(Array.isArray(t))return Gd(t)}function Gd(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 nx(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 U(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?nx(Object(r),!0).forEach(function(n){se(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):nx(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function se(t,e,r){return e=ix(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ix(t){var e=q5(t,"string");return zi(e)=="symbol"?e:e+""}function q5(t,e){if(zi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(zi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var z5={xAxis:["bottom","top"],yAxis:["left","right"]},K5={width:"100%",height:"100%"},ax={x:0,y:0};function zu(t){return t}var V5=function(e,r){return r==="horizontal"?e.x:r==="vertical"?e.y:r==="centric"?e.angle:e.radius},H5=function(e,r,n,i){var a=r.find(function(c){return c&&c.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,s=i.radius;return U(U(U({},i),we(i.cx,i.cy,s,o)),{},{angle:o,radius:s})}var u=a.coordinate,l=i.angle;return U(U(U({},i),we(i.cx,i.cy,u,l)),{},{angle:l,radius:u})}return ax},Ku=function(e,r){var n=r.graphicalItems,i=r.dataStartIndex,a=r.dataEndIndex,o=(n??[]).reduce(function(s,u){var l=u.props.data;return l&&l.length?[].concat(Vi(s),Vi(l)):s},[]);return o.length>0?o:e&&e.length&&V(i)&&V(a)?e.slice(i,a+1):[]};function ox(t){return t==="number"?[0,"auto"]:void 0}var Yd=function(e,r,n,i){var a=e.graphicalItems,o=e.tooltipAxis,s=Ku(r,e);return n<0||!a||!a.length||n>=s.length?null:a.reduce(function(u,l){var c,f=(c=l.props.data)!==null&&c!==void 0?c:r;f&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=n&&(f=f.slice(e.dataStartIndex,e.dataEndIndex+1));var d;if(o.dataKey&&!o.allowDuplicatedCategory){var h=f===void 0?s:f;d=Yo(h,o.dataKey,i)}else d=f&&f[n]||s[n];return d?[].concat(Vi(u),[Kb(l,d)]):u},[])},sx=function(e,r,n,i){var a=i||{x:e.chartX,y:e.chartY},o=V5(a,n),s=e.orderedTooltipTicks,u=e.tooltipAxis,l=e.tooltipTicks,c=kW(o,s,l,u);if(c>=0&&l){var f=l[c]&&l[c].value,d=Yd(e,r,c,f),h=H5(n,s,c,a);return{activeTooltipIndex:c,activeLabel:f,activePayload:d,activeCoordinate:h}}return null},G5=function(e,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,u=r.dataStartIndex,l=r.dataEndIndex,c=e.layout,f=e.children,d=e.stackOffset,h=Nb(c,a);return n.reduce(function(y,v){var p,m=v.type.defaultProps!==void 0?U(U({},v.type.defaultProps),v.props):v.props,b=m.type,w=m.dataKey,O=m.allowDataOverflow,g=m.allowDuplicatedCategory,_=m.scale,S=m.ticks,A=m.includeHidden,E=m[o];if(y[E])return y;var N=Ku(e.data,{graphicalItems:i.filter(function(F){var G,J=o in F.props?F.props[o]:(G=F.type.defaultProps)===null||G===void 0?void 0:G[o];return J===E}),dataStartIndex:u,dataEndIndex:l}),j=N.length,$,k,I;w5(m.domain,O,b)&&($=Mf(m.domain,null,O),h&&(b==="number"||_!=="auto")&&(I=Wa(N,w,"category")));var R=ox(b);if(!$||$.length===0){var M,L=(M=m.domain)!==null&&M!==void 0?M:R;if(w){if($=Wa(N,w,b),b==="category"&&h){var q=wT($);g&&q?(k=$,$=_u(0,j)):g||($=zb(L,$,v).reduce(function(F,G){return F.indexOf(G)>=0?F:[].concat(Vi(F),[G])},[]))}else if(b==="category")g?$=$.filter(function(F){return F!==""&&!fe(F)}):$=zb(L,$,v).reduce(function(F,G){return F.indexOf(G)>=0||G===""||fe(G)?F:[].concat(Vi(F),[G])},[]);else if(b==="number"){var z=DW(N,i.filter(function(F){var G,J,re=o in F.props?F.props[o]:(G=F.type.defaultProps)===null||G===void 0?void 0:G[o],ne="hide"in F.props?F.props.hide:(J=F.type.defaultProps)===null||J===void 0?void 0:J.hide;return re===E&&(A||!ne)}),w,a,c);z&&($=z)}h&&(b==="number"||_!=="auto")&&(I=Wa(N,w,"category"))}else h?$=_u(0,j):s&&s[E]&&s[E].hasStack&&b==="number"?$=d==="expand"?[0,1]:Fb(s[E].stackGroups,u,l):$=Ib(N,i.filter(function(F){var G=o in F.props?F.props[o]:F.type.defaultProps[o],J="hide"in F.props?F.props.hide:F.type.defaultProps.hide;return G===E&&(A||!J)}),b,c,!0);if(b==="number")$=qd(f,$,E,a,S),L&&($=Mf(L,$,O));else if(b==="category"&&L){var D=L,B=$.every(function(F){return D.indexOf(F)>=0});B&&($=D)}}return U(U({},y),{},se({},E,U(U({},m),{},{axisType:a,domain:$,categoricalDomain:I,duplicateDomain:k,originalDomain:(p=m.domain)!==null&&p!==void 0?p:R,isCategorical:h,layout:c})))},{})},Y5=function(e,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,u=r.dataStartIndex,l=r.dataEndIndex,c=e.layout,f=e.children,d=Ku(e.data,{graphicalItems:n,dataStartIndex:u,dataEndIndex:l}),h=d.length,y=Nb(c,a),v=-1;return n.reduce(function(p,m){var b=m.type.defaultProps!==void 0?U(U({},m.type.defaultProps),m.props):m.props,w=b[o],O=ox("number");if(!p[w]){v++;var g;return y?g=_u(0,h):s&&s[w]&&s[w].hasStack?(g=Fb(s[w].stackGroups,u,l),g=qd(f,g,w,a)):(g=Mf(O,Ib(d,n.filter(function(_){var S,A,E=o in _.props?_.props[o]:(S=_.type.defaultProps)===null||S===void 0?void 0:S[o],N="hide"in _.props?_.props.hide:(A=_.type.defaultProps)===null||A===void 0?void 0:A.hide;return E===w&&!N}),"number",c),i.defaultProps.allowDataOverflow),g=qd(f,g,w,a)),U(U({},p),{},se({},w,U(U({axisType:a},i.defaultProps),{},{hide:!0,orientation:xt(z5,"".concat(a,".").concat(v%2),null),domain:g,originalDomain:O,isCategorical:y,layout:c})))}return p},{})},X5=function(e,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,s=r.stackGroups,u=r.dataStartIndex,l=r.dataEndIndex,c=e.children,f="".concat(i,"Id"),d=Ot(c,a),h={};return d&&d.length?h=G5(e,{axes:d,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:u,dataEndIndex:l}):o&&o.length&&(h=Y5(e,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:u,dataEndIndex:l})),h},J5=function(e){var r=Cr(e),n=wr(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:Tc(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:Js(r,n)}},ux=function(e){var r=e.children,n=e.defaultShowTooltip,i=St(r,ji),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}},Z5=function(e){return!e||!e.length?!1:e.some(function(r){var n=fr(r&&r.type);return n&&n.indexOf("Bar")>=0})},lx=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"}},Q5=function(e,r){var n=e.props,i=e.graphicalItems,a=e.xAxisMap,o=a===void 0?{}:a,s=e.yAxisMap,u=s===void 0?{}:s,l=n.width,c=n.height,f=n.children,d=n.margin||{},h=St(f,ji),y=St(f,ln),v=Object.keys(u).reduce(function(g,_){var S=u[_],A=S.orientation;return!S.mirror&&!S.hide?U(U({},g),{},se({},A,g[A]+S.width)):g},{left:d.left||0,right:d.right||0}),p=Object.keys(o).reduce(function(g,_){var S=o[_],A=S.orientation;return!S.mirror&&!S.hide?U(U({},g),{},se({},A,xt(g,"".concat(A))+S.height)):g},{top:d.top||0,bottom:d.bottom||0}),m=U(U({},p),v),b=m.bottom;h&&(m.bottom+=h.props.height||ji.defaultProps.height),y&&r&&(m=NW(m,i,n,r));var w=l-m.left-m.right,O=c-m.top-m.bottom;return U(U({brushBottom:b},m),{},{width:Math.max(w,0),height:Math.max(O,0)})},e4=function(e,r){if(r==="xAxis")return e[r].width;if(r==="yAxis")return e[r].height},_o=function(e){var r=e.chartName,n=e.GraphicalChild,i=e.defaultTooltipEventType,a=i===void 0?"axis":i,o=e.validateTooltipEventTypes,s=o===void 0?["axis"]:o,u=e.axisComponents,l=e.legendContent,c=e.formatAxisMap,f=e.defaultProps,d=function(m,b){var w=b.graphicalItems,O=b.stackGroups,g=b.offset,_=b.updateId,S=b.dataStartIndex,A=b.dataEndIndex,E=m.barSize,N=m.layout,j=m.barGap,$=m.barCategoryGap,k=m.maxBarSize,I=lx(N),R=I.numericAxisName,M=I.cateAxisName,L=Z5(w),q=[];return w.forEach(function(z,D){var B=Ku(m.data,{graphicalItems:[z],dataStartIndex:S,dataEndIndex:A}),F=z.type.defaultProps!==void 0?U(U({},z.type.defaultProps),z.props):z.props,G=F.dataKey,J=F.maxBarSize,re=F["".concat(R,"Id")],ne=F["".concat(M,"Id")],ue={},oe=u.reduce(function(Ar,jt){var So,Ao,Xi=b["".concat(jt.axisType,"Map")],Po=F["".concat(jt.axisType,"Id")];Xi&&Xi[Po]||jt.axisType==="zAxis"||(process.env.NODE_ENV!=="production"?mt(!1,"Specifying a(n) ".concat(jt.axisType,"Id requires a corresponding ").concat(jt.axisType,"Id on the targeted graphical component ").concat((So=z==null||(Ao=z.type)===null||Ao===void 0?void 0:Ao.displayName)!==null&&So!==void 0?So:"")):mt());var Kr=Xi[Po];return U(U({},Ar),{},se(se({},jt.axisType,Kr),"".concat(jt.axisType,"Ticks"),wr(Kr)))},ue),W=oe[M],Y=oe["".concat(M,"Ticks")],te=O&&O[re]&&O[re].hasStack&&KW(z,O[re].stackGroups),C=fr(z.type).indexOf("Bar")>=0,ye=Js(W,Y),H=[],_e=L&&CW({barSize:E,stackGroups:O,totalSize:e4(oe,M)});if(C){var Ee,Ge,Jt=fe(J)?k:J,Zt=(Ee=(Ge=Js(W,Y,!0))!==null&&Ge!==void 0?Ge:Jt)!==null&&Ee!==void 0?Ee:0;H=IW({barGap:j,barCategoryGap:$,bandSize:Zt!==ye?Zt:ye,sizeList:_e[ne],maxBarSize:Jt}),Zt!==ye&&(H=H.map(function(Ar){return U(U({},Ar),{},{position:U(U({},Ar.position),{},{offset:Ar.position.offset-Zt/2})})}))}var Yi=z&&z.type&&z.type.getComposedData;Yi&&q.push({props:U(U({},Yi(U(U({},oe),{},{displayedData:B,props:m,dataKey:G,item:z,bandSize:ye,barPosition:H,offset:g,stackedData:te,layout:N,dataStartIndex:S,dataEndIndex:A}))),{},se(se(se({key:z.key||"item-".concat(D)},R,oe[R]),M,oe[M]),"animationId",_)),childIndex:CT(z,m.children),item:z})}),q},h=function(m,b){var w=m.props,O=m.dataStartIndex,g=m.dataEndIndex,_=m.updateId;if(!Av({props:w}))return null;var S=w.children,A=w.layout,E=w.stackOffset,N=w.data,j=w.reverseStackOrder,$=lx(A),k=$.numericAxisName,I=$.cateAxisName,R=Ot(S,n),M=qW(N,R,"".concat(k,"Id"),"".concat(I,"Id"),E,j),L=u.reduce(function(F,G){var J="".concat(G.axisType,"Map");return U(U({},F),{},se({},J,X5(w,U(U({},G),{},{graphicalItems:R,stackGroups:G.axisType===k&&M,dataStartIndex:O,dataEndIndex:g}))))},{}),q=Q5(U(U({},L),{},{props:w,graphicalItems:R}),b==null?void 0:b.legendBBox);Object.keys(L).forEach(function(F){L[F]=c(w,L[F],q,F.replace("Map",""),r)});var z=L["".concat(I,"Map")],D=J5(z),B=d(w,U(U({},L),{},{dataStartIndex:O,dataEndIndex:g,updateId:_,graphicalItems:R,stackGroups:M,offset:q}));return U(U({formattedGraphicalItems:B,graphicalItems:R,offset:q,stackGroups:M},D),L)},y=function(p){function m(b){var w,O,g;return I5(this,m),g=D5(this,m,[b]),se(g,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),se(g,"accessibilityManager",new b5),se(g,"handleLegendBBoxUpdate",function(_){if(_){var S=g.state,A=S.dataStartIndex,E=S.dataEndIndex,N=S.updateId;g.setState(U({legendBBox:_},h({props:g.props,dataStartIndex:A,dataEndIndex:E,updateId:N},U(U({},g.state),{},{legendBBox:_}))))}}),se(g,"handleReceiveSyncEvent",function(_,S,A){if(g.props.syncId===_){if(A===g.eventEmitterSymbol&&typeof g.props.syncMethod!="function")return;g.applySyncEvent(S)}}),se(g,"handleBrushChange",function(_){var S=_.startIndex,A=_.endIndex;if(S!==g.state.dataStartIndex||A!==g.state.dataEndIndex){var E=g.state.updateId;g.setState(function(){return U({dataStartIndex:S,dataEndIndex:A},h({props:g.props,dataStartIndex:S,dataEndIndex:A,updateId:E},g.state))}),g.triggerSyncEvent({dataStartIndex:S,dataEndIndex:A})}}),se(g,"handleMouseEnter",function(_){var S=g.getMouseInfo(_);if(S){var A=U(U({},S),{},{isTooltipActive:!0});g.setState(A),g.triggerSyncEvent(A);var E=g.props.onMouseEnter;ae(E)&&E(A,_)}}),se(g,"triggeredAfterMouseMove",function(_){var S=g.getMouseInfo(_),A=S?U(U({},S),{},{isTooltipActive:!0}):{isTooltipActive:!1};g.setState(A),g.triggerSyncEvent(A);var E=g.props.onMouseMove;ae(E)&&E(A,_)}),se(g,"handleItemMouseEnter",function(_){g.setState(function(){return{isTooltipActive:!0,activeItem:_,activePayload:_.tooltipPayload,activeCoordinate:_.tooltipPosition||{x:_.cx,y:_.cy}}})}),se(g,"handleItemMouseLeave",function(){g.setState(function(){return{isTooltipActive:!1}})}),se(g,"handleMouseMove",function(_){_.persist(),g.throttleTriggeredAfterMouseMove(_)}),se(g,"handleMouseLeave",function(_){g.throttleTriggeredAfterMouseMove.cancel();var S={isTooltipActive:!1};g.setState(S),g.triggerSyncEvent(S);var A=g.props.onMouseLeave;ae(A)&&A(S,_)}),se(g,"handleOuterEvent",function(_){var S=kT(_),A=xt(g.props,"".concat(S));if(S&&ae(A)){var E,N;/.*touch.*/i.test(S)?N=g.getMouseInfo(_.changedTouches[0]):N=g.getMouseInfo(_),A((E=N)!==null&&E!==void 0?E:{},_)}}),se(g,"handleClick",function(_){var S=g.getMouseInfo(_);if(S){var A=U(U({},S),{},{isTooltipActive:!0});g.setState(A),g.triggerSyncEvent(A);var E=g.props.onClick;ae(E)&&E(A,_)}}),se(g,"handleMouseDown",function(_){var S=g.props.onMouseDown;if(ae(S)){var A=g.getMouseInfo(_);S(A,_)}}),se(g,"handleMouseUp",function(_){var S=g.props.onMouseUp;if(ae(S)){var A=g.getMouseInfo(_);S(A,_)}}),se(g,"handleTouchMove",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&g.throttleTriggeredAfterMouseMove(_.changedTouches[0])}),se(g,"handleTouchStart",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&g.handleMouseDown(_.changedTouches[0])}),se(g,"handleTouchEnd",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&g.handleMouseUp(_.changedTouches[0])}),se(g,"handleDoubleClick",function(_){var S=g.props.onDoubleClick;if(ae(S)){var A=g.getMouseInfo(_);S(A,_)}}),se(g,"handleContextMenu",function(_){var S=g.props.onContextMenu;if(ae(S)){var A=g.getMouseInfo(_);S(A,_)}}),se(g,"triggerSyncEvent",function(_){g.props.syncId!==void 0&&zd.emit(Kd,g.props.syncId,_,g.eventEmitterSymbol)}),se(g,"applySyncEvent",function(_){var S=g.props,A=S.layout,E=S.syncMethod,N=g.state.updateId,j=_.dataStartIndex,$=_.dataEndIndex;if(_.dataStartIndex!==void 0||_.dataEndIndex!==void 0)g.setState(U({dataStartIndex:j,dataEndIndex:$},h({props:g.props,dataStartIndex:j,dataEndIndex:$,updateId:N},g.state)));else if(_.activeTooltipIndex!==void 0){var k=_.chartX,I=_.chartY,R=_.activeTooltipIndex,M=g.state,L=M.offset,q=M.tooltipTicks;if(!L)return;if(typeof E=="function")R=E(q,_);else if(E==="value"){R=-1;for(var z=0;z<q.length;z++)if(q[z].value===_.activeLabel){R=z;break}}var D=U(U({},L),{},{x:L.left,y:L.top}),B=Math.min(k,D.x+D.width),F=Math.min(I,D.y+D.height),G=q[R]&&q[R].value,J=Yd(g.state,g.props.data,R),re=q[R]?{x:A==="horizontal"?q[R].coordinate:B,y:A==="horizontal"?F:q[R].coordinate}:ax;g.setState(U(U({},_),{},{activeLabel:G,activeCoordinate:re,activePayload:J,activeTooltipIndex:R}))}else g.setState(_)}),se(g,"renderCursor",function(_){var S,A=g.state,E=A.isTooltipActive,N=A.activeCoordinate,j=A.activePayload,$=A.offset,k=A.activeTooltipIndex,I=A.tooltipAxisBandSize,R=g.getTooltipEventType(),M=(S=_.props.active)!==null&&S!==void 0?S:E,L=g.props.layout,q=_.key||"_recharts-cursor";return x.createElement(P5,{key:q,activeCoordinate:N,activePayload:j,activeTooltipIndex:k,chartName:r,element:_,isActive:M,layout:L,offset:$,tooltipAxisBandSize:I,tooltipEventType:R})}),se(g,"renderPolarAxis",function(_,S,A){var E=xt(_,"type.axisType"),N=xt(g.state,"".concat(E,"Map")),j=_.type.defaultProps,$=j!==void 0?U(U({},j),_.props):_.props,k=N&&N[$["".concat(E,"Id")]];return x.cloneElement(_,U(U({},k),{},{className:le(E,k.className),key:_.key||"".concat(S,"-").concat(A),ticks:wr(k,!0)}))}),se(g,"renderPolarGrid",function(_){var S=_.props,A=S.radialLines,E=S.polarAngles,N=S.polarRadius,j=g.state,$=j.radiusAxisMap,k=j.angleAxisMap,I=Cr($),R=Cr(k),M=R.cx,L=R.cy,q=R.innerRadius,z=R.outerRadius;return x.cloneElement(_,{polarAngles:Array.isArray(E)?E:wr(R,!0).map(function(D){return D.coordinate}),polarRadius:Array.isArray(N)?N:wr(I,!0).map(function(D){return D.coordinate}),cx:M,cy:L,innerRadius:q,outerRadius:z,key:_.key||"polar-grid",radialLines:A})}),se(g,"renderLegend",function(){var _=g.state.formattedGraphicalItems,S=g.props,A=S.children,E=S.width,N=S.height,j=g.props.margin||{},$=E-(j.left||0)-(j.right||0),k=jb({children:A,formattedGraphicalItems:_,legendWidth:$,legendContent:l});if(!k)return null;var I=k.item,R=ex(k,E5);return x.cloneElement(I,U(U({},R),{},{chartWidth:E,chartHeight:N,margin:j,onBBoxUpdate:g.handleLegendBBoxUpdate}))}),se(g,"renderTooltip",function(){var _,S=g.props,A=S.children,E=S.accessibilityLayer,N=St(A,tr);if(!N)return null;var j=g.state,$=j.isTooltipActive,k=j.activeCoordinate,I=j.activePayload,R=j.activeLabel,M=j.offset,L=(_=N.props.active)!==null&&_!==void 0?_:$;return x.cloneElement(N,{viewBox:U(U({},M),{},{x:M.left,y:M.top}),active:L,label:R,payload:L?I:[],coordinate:k,accessibilityLayer:E})}),se(g,"renderBrush",function(_){var S=g.props,A=S.margin,E=S.data,N=g.state,j=N.offset,$=N.dataStartIndex,k=N.dataEndIndex,I=N.updateId;return x.cloneElement(_,{key:_.key||"_recharts-brush",onChange:Ys(g.handleBrushChange,_.props.onChange),data:E,x:V(_.props.x)?_.props.x:j.left,y:V(_.props.y)?_.props.y:j.top+j.height+j.brushBottom-(A.bottom||0),width:V(_.props.width)?_.props.width:j.width,startIndex:$,endIndex:k,updateId:"brush-".concat(I)})}),se(g,"renderReferenceElement",function(_,S,A){if(!_)return null;var E=g,N=E.clipPathId,j=g.state,$=j.xAxisMap,k=j.yAxisMap,I=j.offset,R=_.type.defaultProps||{},M=_.props,L=M.xAxisId,q=L===void 0?R.xAxisId:L,z=M.yAxisId,D=z===void 0?R.yAxisId:z;return x.cloneElement(_,{key:_.key||"".concat(S,"-").concat(A),xAxis:$[q],yAxis:k[D],viewBox:{x:I.left,y:I.top,width:I.width,height:I.height},clipPathId:N})}),se(g,"renderActivePoints",function(_){var S=_.item,A=_.activePoint,E=_.basePoint,N=_.childIndex,j=_.isRange,$=[],k=S.props.key,I=S.item.type.defaultProps!==void 0?U(U({},S.item.type.defaultProps),S.item.props):S.item.props,R=I.activeDot,M=I.dataKey,L=U(U({index:N,dataKey:M,cx:A.x,cy:A.y,r:4,fill:If(S.item),strokeWidth:2,stroke:"#fff",payload:A.payload,value:A.value},Q(R,!1)),Xo(R));return $.push(m.renderActiveDot(R,L,"".concat(k,"-activePoint-").concat(N))),E?$.push(m.renderActiveDot(R,U(U({},L),{},{cx:E.x,cy:E.y}),"".concat(k,"-basePoint-").concat(N))):j&&$.push(null),$}),se(g,"renderGraphicChild",function(_,S,A){var E=g.filterFormatItem(_,S,A);if(!E)return null;var N=g.getTooltipEventType(),j=g.state,$=j.isTooltipActive,k=j.tooltipAxis,I=j.activeTooltipIndex,R=j.activeLabel,M=g.props.children,L=St(M,tr),q=E.props,z=q.points,D=q.isRange,B=q.baseLine,F=E.item.type.defaultProps!==void 0?U(U({},E.item.type.defaultProps),E.item.props):E.item.props,G=F.activeDot,J=F.hide,re=F.activeBar,ne=F.activeShape,ue=!!(!J&&$&&L&&(G||re||ne)),oe={};N!=="axis"&&L&&L.props.trigger==="click"?oe={onClick:Ys(g.handleItemMouseEnter,_.props.onClick)}:N!=="axis"&&(oe={onMouseLeave:Ys(g.handleItemMouseLeave,_.props.onMouseLeave),onMouseEnter:Ys(g.handleItemMouseEnter,_.props.onMouseEnter)});var W=x.cloneElement(_,U(U({},E.props),oe));function Y(jt){return typeof k.dataKey=="function"?k.dataKey(jt.payload):null}if(ue)if(I>=0){var te,C;if(k.dataKey&&!k.allowDuplicatedCategory){var ye=typeof k.dataKey=="function"?Y:"payload.".concat(k.dataKey.toString());te=Yo(z,ye,R),C=D&&B&&Yo(B,ye,R)}else te=z==null?void 0:z[I],C=D&&B&&B[I];if(ne||re){var H=_.props.activeIndex!==void 0?_.props.activeIndex:I;return[x.cloneElement(_,U(U(U({},E.props),oe),{},{activeIndex:H})),null,null]}if(!fe(te))return[W].concat(Vi(g.renderActivePoints({item:E,activePoint:te,basePoint:C,childIndex:I,isRange:D})))}else{var _e,Ee=(_e=g.getItemByXY(g.state.activeCoordinate))!==null&&_e!==void 0?_e:{graphicalItem:W},Ge=Ee.graphicalItem,Jt=Ge.item,Zt=Jt===void 0?_:Jt,Yi=Ge.childIndex,Ar=U(U(U({},E.props),oe),{},{activeIndex:Yi});return[x.cloneElement(Zt,Ar),null,null]}return D?[W,null,null]:[W,null]}),se(g,"renderCustomized",function(_,S,A){return x.cloneElement(_,U(U({key:"recharts-customized-".concat(A)},g.props),g.state))}),se(g,"renderMap",{CartesianGrid:{handler:zu,once:!0},ReferenceArea:{handler:g.renderReferenceElement},ReferenceLine:{handler:zu},ReferenceDot:{handler:g.renderReferenceElement},XAxis:{handler:zu},YAxis:{handler:zu},Brush:{handler:g.renderBrush,once:!0},Bar:{handler:g.renderGraphicChild},Line:{handler:g.renderGraphicChild},Area:{handler:g.renderGraphicChild},Radar:{handler:g.renderGraphicChild},RadialBar:{handler:g.renderGraphicChild},Scatter:{handler:g.renderGraphicChild},Pie:{handler:g.renderGraphicChild},Funnel:{handler:g.renderGraphicChild},Tooltip:{handler:g.renderCursor,once:!0},PolarGrid:{handler:g.renderPolarGrid,once:!0},PolarAngleAxis:{handler:g.renderPolarAxis},PolarRadiusAxis:{handler:g.renderPolarAxis},Customized:{handler:g.renderCustomized}}),g.clipPathId="".concat((w=b.id)!==null&&w!==void 0?w:an("recharts"),"-clip"),g.throttleTriggeredAfterMouseMove=Ag(g.triggeredAfterMouseMove,(O=b.throttleDelay)!==null&&O!==void 0?O:1e3/60),g.state={},g}return B5(m,p),M5(m,[{key:"componentDidMount",value:function(){var w,O;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(O=this.props.margin.top)!==null&&O!==void 0?O:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var w=this.props,O=w.children,g=w.data,_=w.height,S=w.layout,A=St(O,tr);if(A){var E=A.props.defaultIndex;if(!(typeof E!="number"||E<0||E>this.state.tooltipTicks.length-1)){var N=this.state.tooltipTicks[E]&&this.state.tooltipTicks[E].value,j=Yd(this.state,g,E,N),$=this.state.tooltipTicks[E].coordinate,k=(this.state.offset.top+_)/2,I=S==="horizontal",R=I?{x:$,y:k}:{y:$,x:k},M=this.state.formattedGraphicalItems.find(function(q){var z=q.item;return z.type.name==="Scatter"});M&&(R=U(U({},R),M.props.points[E].tooltipPosition),j=M.props.points[E].tooltipPayload);var L={activeTooltipIndex:E,isTooltipActive:!0,activeLabel:N,activePayload:j,activeCoordinate:R};this.setState(L),this.renderCursor(A),this.accessibilityManager.setIndex(E)}}}},{key:"getSnapshotBeforeUpdate",value:function(w,O){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==O.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==w.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==w.margin){var g,_;this.accessibilityManager.setDetails({offset:{left:(g=this.props.margin.left)!==null&&g!==void 0?g:0,top:(_=this.props.margin.top)!==null&&_!==void 0?_:0}})}return null}},{key:"componentDidUpdate",value:function(w){Vl([St(w.children,tr)],[St(this.props.children,tr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var w=St(this.props.children,tr);if(w&&typeof w.props.shared=="boolean"){var O=w.props.shared?"axis":"item";return s.indexOf(O)>=0?O:a}return a}},{key:"getMouseInfo",value:function(w){if(!this.container)return null;var O=this.container,g=O.getBoundingClientRect(),_=o2(g),S={chartX:Math.round(w.pageX-_.left),chartY:Math.round(w.pageY-_.top)},A=g.width/O.offsetWidth||1,E=this.inRange(S.chartX,S.chartY,A);if(!E)return null;var N=this.state,j=N.xAxisMap,$=N.yAxisMap,k=this.getTooltipEventType(),I=sx(this.state,this.props.data,this.props.layout,E);if(k!=="axis"&&j&&$){var R=Cr(j).scale,M=Cr($).scale,L=R&&R.invert?R.invert(S.chartX):null,q=M&&M.invert?M.invert(S.chartY):null;return U(U({},S),{},{xValue:L,yValue:q},I)}return I?U(U({},S),I):null}},{key:"inRange",value:function(w,O){var g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,_=this.props.layout,S=w/g,A=O/g;if(_==="horizontal"||_==="vertical"){var E=this.state.offset,N=S>=E.left&&S<=E.left+E.width&&A>=E.top&&A<=E.top+E.height;return N?{x:S,y:A}:null}var j=this.state,$=j.angleAxisMap,k=j.radiusAxisMap;if($&&k){var I=Cr($);return Jb({x:S,y:A},I)}return null}},{key:"parseEventsOfWrapper",value:function(){var w=this.props.children,O=this.getTooltipEventType(),g=St(w,tr),_={};g&&O==="axis"&&(g.props.trigger==="click"?_={onClick:this.handleClick}:_={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 S=Xo(this.props,this.handleOuterEvent);return U(U({},S),_)}},{key:"addListener",value:function(){zd.on(Kd,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){zd.removeListener(Kd,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(w,O,g){for(var _=this.state.formattedGraphicalItems,S=0,A=_.length;S<A;S++){var E=_[S];if(E.item===w||E.props.key===w.key||O===fr(E.item.type)&&g===E.childIndex)return E}return null}},{key:"renderClipPath",value:function(){var w=this.clipPathId,O=this.state.offset,g=O.left,_=O.top,S=O.height,A=O.width;return x.createElement("defs",null,x.createElement("clipPath",{id:w},x.createElement("rect",{x:g,y:_,height:S,width:A})))}},{key:"getXScales",value:function(){var w=this.state.xAxisMap;return w?Object.entries(w).reduce(function(O,g){var _=Q_(g,2),S=_[0],A=_[1];return U(U({},O),{},se({},S,A.scale))},{}):null}},{key:"getYScales",value:function(){var w=this.state.yAxisMap;return w?Object.entries(w).reduce(function(O,g){var _=Q_(g,2),S=_[0],A=_[1];return U(U({},O),{},se({},S,A.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(w){var O;return(O=this.state.xAxisMap)===null||O===void 0||(O=O[w])===null||O===void 0?void 0:O.scale}},{key:"getYScaleByAxisId",value:function(w){var O;return(O=this.state.yAxisMap)===null||O===void 0||(O=O[w])===null||O===void 0?void 0:O.scale}},{key:"getItemByXY",value:function(w){var O=this.state,g=O.formattedGraphicalItems,_=O.activeItem;if(g&&g.length)for(var S=0,A=g.length;S<A;S++){var E=g[S],N=E.props,j=E.item,$=j.type.defaultProps!==void 0?U(U({},j.type.defaultProps),j.props):j.props,k=fr(j.type);if(k==="Bar"){var I=(N.data||[]).find(function(q){return z3(w,q)});if(I)return{graphicalItem:E,payload:I}}else if(k==="RadialBar"){var R=(N.data||[]).find(function(q){return Jb(w,q)});if(R)return{graphicalItem:E,payload:R}}else if(vu(E,_)||yu(E,_)||co(E,_)){var M=WV({graphicalItem:E,activeTooltipItem:_,itemData:$.data}),L=$.activeIndex===void 0?M:$.activeIndex;return{graphicalItem:U(U({},E),{},{childIndex:L}),payload:co(E,_)?$.data[M]:E.props.data[M]}}}return null}},{key:"render",value:function(){var w=this;if(!Av(this))return null;var O=this.props,g=O.children,_=O.className,S=O.width,A=O.height,E=O.style,N=O.compact,j=O.title,$=O.desc,k=ex(O,T5),I=Q(k,!1);if(N)return x.createElement(a_,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},x.createElement(Gl,Ki({},I,{width:S,height:A,title:j,desc:$}),this.renderClipPath(),Tv(g,this.renderMap)));if(this.props.accessibilityLayer){var R,M;I.tabIndex=(R=this.props.tabIndex)!==null&&R!==void 0?R:0,I.role=(M=this.props.role)!==null&&M!==void 0?M:"application",I.onKeyDown=function(q){w.accessibilityManager.keyboardEvent(q)},I.onFocus=function(){w.accessibilityManager.focus()}}var L=this.parseEventsOfWrapper();return x.createElement(a_,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},x.createElement("div",Ki({className:le("recharts-wrapper",_),style:U({position:"relative",cursor:"default",width:S,height:A},E)},L,{ref:function(z){w.container=z}}),x.createElement(Gl,Ki({},I,{width:S,height:A,title:j,desc:$,style:K5}),this.renderClipPath(),Tv(g,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(x.Component);se(y,"displayName",r),se(y,"defaultProps",U({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),se(y,"getDerivedStateFromProps",function(p,m){var b=p.dataKey,w=p.data,O=p.children,g=p.width,_=p.height,S=p.layout,A=p.stackOffset,E=p.margin,N=m.dataStartIndex,j=m.dataEndIndex;if(m.updateId===void 0){var $=ux(p);return U(U(U({},$),{},{updateId:0},h(U(U({props:p},$),{},{updateId:0}),m)),{},{prevDataKey:b,prevData:w,prevWidth:g,prevHeight:_,prevLayout:S,prevStackOffset:A,prevMargin:E,prevChildren:O})}if(b!==m.prevDataKey||w!==m.prevData||g!==m.prevWidth||_!==m.prevHeight||S!==m.prevLayout||A!==m.prevStackOffset||!Jn(E,m.prevMargin)){var k=ux(p),I={chartX:m.chartX,chartY:m.chartY,isTooltipActive:m.isTooltipActive},R=U(U({},sx(m,w,S)),{},{updateId:m.updateId+1}),M=U(U(U({},k),I),R);return U(U(U({},M),h(U({props:p},M),m)),{},{prevDataKey:b,prevData:w,prevWidth:g,prevHeight:_,prevLayout:S,prevStackOffset:A,prevMargin:E,prevChildren:O})}if(!Vl(O,m.prevChildren)){var L,q,z,D,B=St(O,ji),F=B&&(L=(q=B.props)===null||q===void 0?void 0:q.startIndex)!==null&&L!==void 0?L:N,G=B&&(z=(D=B.props)===null||D===void 0?void 0:D.endIndex)!==null&&z!==void 0?z:j,J=F!==N||G!==j,re=!fe(w),ne=re&&!J?m.updateId:m.updateId+1;return U(U({updateId:ne},h(U(U({props:p},m),{},{updateId:ne,dataStartIndex:F,dataEndIndex:G}),m)),{},{prevChildren:O,dataStartIndex:F,dataEndIndex:G})}return null}),se(y,"renderActiveDot",function(p,m,b){var w;return x.isValidElement(p)?w=x.cloneElement(p,m):ae(p)?w=p(m):w=x.createElement(wi,m),x.createElement(pe,{className:"recharts-active-dot",key:b},w)});var v=x.forwardRef(function(m,b){return x.createElement(y,Ki({},m,{ref:b}))});return v.displayName=y.displayName,v},t4=_o({chartName:"LineChart",GraphicalChild:mo,axisComponents:[{axisType:"xAxis",AxisComp:qr},{axisType:"yAxis",AxisComp:zr}],formatAxisMap:gd}),r4=_o({chartName:"BarChart",GraphicalChild:An,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:qr},{axisType:"yAxis",AxisComp:zr}],formatAxisMap:gd}),n4=_o({chartName:"PieChart",GraphicalChild:Or,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:Si},{axisType:"radiusAxis",AxisComp:xi}],formatAxisMap:Xb,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),i4=_o({chartName:"RadarChart",GraphicalChild:fo,axisComponents:[{axisType:"angleAxis",AxisComp:Si},{axisType:"radiusAxis",AxisComp:xi}],formatAxisMap:Xb,defaultProps:{layout:"centric",startAngle:90,endAngle:-270,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),a4=_o({chartName:"AreaChart",GraphicalChild:Wr,axisComponents:[{axisType:"xAxis",AxisComp:qr},{axisType:"yAxis",AxisComp:zr}],formatAxisMap:gd});const o4={light:"",dark:".dark"},cx=ve.createContext(null);function fx(){const t=ve.useContext(cx);if(!t)throw new Error("useChart must be used within a <ChartContainer />");return t}const Hi=ve.forwardRef(({id:t,className:e,children:r,config:n,...i},a)=>{const o=ve.useId(),s=`chart-${t||o.replace(/:/g,"")}`;return P.jsx(cx.Provider,{value:{config:n},children:P.jsxs("div",{"data-chart":s,ref:a,className:it("flex w-full h-full justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",e),...i,children:[P.jsx(s4,{id:s,config:n}),P.jsx(QL,{children:r})]})})});Hi.displayName="Chart";const s4=({id:t,config:e})=>{const r=Object.entries(e).filter(([n,i])=>i.theme||i.color);return r.length?P.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(o4).map(([n,i])=>`
|
|
128
|
+
A `).concat(y,",").concat(y,",0,0,").concat(u,",").concat(e+n-l*y,",").concat(r+i,`
|
|
129
|
+
L `).concat(e+l*y,",").concat(r+i,`
|
|
130
|
+
A `).concat(y,",").concat(y,",0,0,").concat(u,",").concat(e,",").concat(r+i-s*y," Z")}else c="M ".concat(e,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return c},s3=function(e,r){if(!e||!r)return!1;var n=e.x,i=e.y,a=r.x,o=r.y,s=r.width,l=r.height;if(Math.abs(s)>0&&Math.abs(l)>0){var u=Math.min(a,a+s),c=Math.max(a,a+s),f=Math.min(o,o+l),d=Math.max(o,o+l);return n>=u&&n<=c&&i>=f&&i<=d}return!1},l3={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Nf=function(e){var r=x0(x0({},l3),e),n=x.useRef(),i=x.useState(-1),a=Qz(i,2),o=a[0],s=a[1];x.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var O=n.current.getTotalLength();O&&s(O)}catch{}},[]);var l=r.x,u=r.y,c=r.width,f=r.height,d=r.radius,h=r.className,y=r.animationEasing,v=r.animationDuration,p=r.animationBegin,m=r.isAnimationActive,w=r.isUpdateAnimationActive;if(l!==+l||u!==+u||c!==+c||f!==+f||c===0||f===0)return null;var b=ie("recharts-rectangle",h);return w?x.createElement(St,{canBegin:o>0,from:{width:c,height:f,x:l,y:u},to:{width:c,height:f,x:l,y:u},duration:v,animationEasing:y,isActive:w},function(O){var g=O.width,_=O.height,S=O.x,A=O.y;return x.createElement(St,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:p,duration:v,isActive:m,easing:y},x.createElement("path",Bs({},X(r,!0),{className:b,d:O0(S,A,g,_,d),ref:n})))}):x.createElement("path",Bs({},X(r,!0),{className:b,d:O0(l,u,c,f,d)}))},u3=["points","className","baseLinePoints","connectNulls"];function ni(){return ni=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},ni.apply(this,arguments)}function c3(t,e){if(t==null)return{};var r=f3(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 f3(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 S0(t){return v3(t)||p3(t)||h3(t)||d3()}function d3(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
131
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function h3(t,e){if(t){if(typeof t=="string")return Mf(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 Mf(t,e)}}function p3(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function v3(t){if(Array.isArray(t))return Mf(t)}function Mf(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 A0=function(e){return e&&e.x===+e.x&&e.y===+e.y},y3=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return e.forEach(function(n){A0(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),A0(e[0])&&r[r.length-1].push(e[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},Da=function(e,r){var n=y3(e);r&&(n=[n.reduce(function(a,o){return[].concat(S0(a),S0(o))},[])]);var i=n.map(function(a){return a.reduce(function(o,s,l){return"".concat(o).concat(l===0?"M":"L").concat(s.x,",").concat(s.y)},"")}).join("");return n.length===1?"".concat(i,"Z"):i},g3=function(e,r,n){var i=Da(e,n);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(Da(r.reverse(),n).slice(1))},P0=function(e){var r=e.points,n=e.className,i=e.baseLinePoints,a=e.connectNulls,o=c3(e,u3);if(!r||!r.length)return null;var s=ie("recharts-polygon",n);if(i&&i.length){var l=o.stroke&&o.stroke!=="none",u=g3(r,i,a);return x.createElement("g",{className:s},x.createElement("path",ni({},X(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:u})),l?x.createElement("path",ni({},X(o,!0),{fill:"none",d:Da(r,a)})):null,l?x.createElement("path",ni({},X(o,!0),{fill:"none",d:Da(i,a)})):null)}var c=Da(r,a);return x.createElement("path",ni({},X(o,!0),{fill:c.slice(-1)==="Z"?o.fill:"none",className:s,d:c}))};function Df(){return Df=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},Df.apply(this,arguments)}var ii=function(e){var r=e.cx,n=e.cy,i=e.r,a=e.className,o=ie("recharts-dot",a);return r===+r&&n===+n&&i===+i?fe.createElement("circle",Df({},X(e,!1),Po(e),{className:o,cx:r,cy:n,r:i})):null};function La(t){"@babel/helpers - typeof";return La=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},La(t)}var m3=["x","y","top","left","width","height","className"];function Lf(){return Lf=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},Lf.apply(this,arguments)}function E0(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 b3(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?E0(Object(r),!0).forEach(function(n){w3(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):E0(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function w3(t,e,r){return e=_3(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _3(t){var e=x3(t,"string");return La(e)=="symbol"?e:e+""}function x3(t,e){if(La(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(La(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function O3(t,e){if(t==null)return{};var r=S3(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 S3(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 A3=function(e,r,n,i,a,o){return"M".concat(e,",").concat(a,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},P3=function(e){var r=e.x,n=r===void 0?0:r,i=e.y,a=i===void 0?0:i,o=e.top,s=o===void 0?0:o,l=e.left,u=l===void 0?0:l,c=e.width,f=c===void 0?0:c,d=e.height,h=d===void 0?0:d,y=e.className,v=O3(e,m3),p=b3({x:n,y:a,top:s,left:u,width:f,height:h},v);return!z(n)||!z(a)||!z(f)||!z(h)||!z(s)||!z(u)?null:x.createElement("path",Lf({},X(p,!0),{className:ie("recharts-cross",y),d:A3(n,a,f,h,s,u)}))},E3=["cx","cy","innerRadius","outerRadius","gridType","radialLines"];function Ba(t){"@babel/helpers - typeof";return Ba=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},Ba(t)}function T3(t,e){if(t==null)return{};var r=$3(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 $3(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 or(){return or=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},or.apply(this,arguments)}function T0(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 Ra(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?T0(Object(r),!0).forEach(function(n){j3(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):T0(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function j3(t,e,r){return e=k3(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function k3(t){var e=C3(t,"string");return Ba(e)=="symbol"?e:e+""}function C3(t,e){if(Ba(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ba(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var I3=function(e,r,n,i){var a="";return i.forEach(function(o,s){var l=pe(r,n,e,o);s?a+="L ".concat(l.x,",").concat(l.y):a+="M ".concat(l.x,",").concat(l.y)}),a+="Z",a},N3=function(e){var r=e.cx,n=e.cy,i=e.innerRadius,a=e.outerRadius,o=e.polarAngles,s=e.radialLines;if(!o||!o.length||!s)return null;var l=Ra({stroke:"#ccc"},X(e,!1));return x.createElement("g",{className:"recharts-polar-grid-angle"},o.map(function(u){var c=pe(r,n,i,u),f=pe(r,n,a,u);return x.createElement("line",or({},l,{key:"line-".concat(u),x1:c.x,y1:c.y,x2:f.x,y2:f.y}))}))},M3=function(e){var r=e.cx,n=e.cy,i=e.radius,a=e.index,o=Ra(Ra({stroke:"#ccc"},X(e,!1)),{},{fill:"none"});return x.createElement("circle",or({},o,{className:ie("recharts-polar-grid-concentric-circle",e.className),key:"circle-".concat(a),cx:r,cy:n,r:i}))},D3=function(e){var r=e.radius,n=e.index,i=Ra(Ra({stroke:"#ccc"},X(e,!1)),{},{fill:"none"});return x.createElement("path",or({},i,{className:ie("recharts-polar-grid-concentric-polygon",e.className),key:"path-".concat(n),d:I3(r,e.cx,e.cy,e.polarAngles)}))},L3=function(e){var r=e.polarRadius,n=e.gridType;return!r||!r.length?null:x.createElement("g",{className:"recharts-polar-grid-concentric"},r.map(function(i,a){var o=a;return n==="circle"?x.createElement(M3,or({key:o},e,{radius:i,index:a})):x.createElement(D3,or({key:o},e,{radius:i,index:a}))}))},$0=function(e){var r=e.cx,n=r===void 0?0:r,i=e.cy,a=i===void 0?0:i,o=e.innerRadius,s=o===void 0?0:o,l=e.outerRadius,u=l===void 0?0:l,c=e.gridType,f=c===void 0?"polygon":c,d=e.radialLines,h=d===void 0?!0:d,y=T3(e,E3);return u<=0?null:x.createElement("g",{className:"recharts-polar-grid"},x.createElement(N3,or({cx:n,cy:a,innerRadius:s,outerRadius:u,gridType:f,radialLines:h},y)),x.createElement(L3,or({cx:n,cy:a,innerRadius:s,outerRadius:u,gridType:f,radialLines:h},y)))};$0.displayName="PolarGrid";var B3=ms,R3=Im,U3=Bt;function F3(t,e){return t&&t.length?B3(t,U3(e),R3):void 0}var W3=F3;const q3=we(W3);var z3=ms,K3=Bt,V3=Nm;function H3(t,e){return t&&t.length?z3(t,K3(e),V3):void 0}var G3=H3;const Y3=we(G3);var X3=["cx","cy","angle","ticks","axisLine"],J3=["ticks","tick","angle","tickFormatter","stroke"];function ai(t){"@babel/helpers - typeof";return ai=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},ai(t)}function Ua(){return Ua=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},Ua.apply(this,arguments)}function j0(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 on(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?j0(Object(r),!0).forEach(function(n){Us(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):j0(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function k0(t,e){if(t==null)return{};var r=Z3(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 Z3(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 Q3(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function C0(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,N0(n.key),n)}}function eK(t,e,r){return e&&C0(t.prototype,e),r&&C0(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function tK(t,e,r){return e=Rs(e),rK(t,I0()?Reflect.construct(e,r||[],Rs(t).constructor):e.apply(t,r))}function rK(t,e){if(e&&(ai(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nK(t)}function nK(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function I0(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(I0=function(){return!!t})()}function Rs(t){return Rs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Rs(t)}function iK(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&&Bf(t,e)}function Bf(t,e){return Bf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Bf(t,e)}function Us(t,e,r){return e=N0(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function N0(t){var e=aK(t,"string");return ai(e)=="symbol"?e:e+""}function aK(t,e){if(ai(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ai(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var oi=function(t){function e(){return Q3(this,e),tK(this,e,arguments)}return iK(e,t),eK(e,[{key:"getTickValueCoord",value:function(n){var i=n.coordinate,a=this.props,o=a.angle,s=a.cx,l=a.cy;return pe(s,l,i,o)}},{key:"getTickTextAnchor",value:function(){var n=this.props.orientation,i;switch(n){case"left":i="end";break;case"right":i="start";break;default:i="middle";break}return i}},{key:"getViewBox",value:function(){var n=this.props,i=n.cx,a=n.cy,o=n.angle,s=n.ticks,l=q3(s,function(c){return c.coordinate||0}),u=Y3(s,function(c){return c.coordinate||0});return{cx:i,cy:a,startAngle:o,endAngle:o,innerRadius:u.coordinate||0,outerRadius:l.coordinate||0}}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,a=n.cy,o=n.angle,s=n.ticks,l=n.axisLine,u=k0(n,X3),c=s.reduce(function(y,v){return[Math.min(y[0],v.coordinate),Math.max(y[1],v.coordinate)]},[1/0,-1/0]),f=pe(i,a,c[0],o),d=pe(i,a,c[1],o),h=on(on(on({},X(u,!1)),{},{fill:"none"},X(l,!1)),{},{x1:f.x,y1:f.y,x2:d.x,y2:d.y});return x.createElement("line",Ua({className:"recharts-polar-radius-axis-line"},h))}},{key:"renderTicks",value:function(){var n=this,i=this.props,a=i.ticks,o=i.tick,s=i.angle,l=i.tickFormatter,u=i.stroke,c=k0(i,J3),f=this.getTickTextAnchor(),d=X(c,!1),h=X(o,!1),y=a.map(function(v,p){var m=n.getTickValueCoord(v),w=on(on(on(on({textAnchor:f,transform:"rotate(".concat(90-s,", ").concat(m.x,", ").concat(m.y,")")},d),{},{stroke:"none",fill:u},h),{},{index:p},m),{},{payload:v});return x.createElement(ce,Ua({className:ie("recharts-polar-radius-axis-tick",Sb(o)),key:"tick-".concat(v.coordinate)},qr(n.props,v,p)),e.renderTickItem(o,w,l?l(v.value,p):v.value))});return x.createElement(ce,{className:"recharts-polar-radius-axis-ticks"},y)}},{key:"render",value:function(){var n=this.props,i=n.ticks,a=n.axisLine,o=n.tick;return!i||!i.length?null:x.createElement(ce,{className:ie("recharts-polar-radius-axis",this.props.className)},a&&this.renderAxisLine(),o&&this.renderTicks(),Ve.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(n,i,a){var o;return x.isValidElement(n)?o=x.cloneElement(n,i):te(n)?o=n(i):o=x.createElement(Hr,Ua({},i,{className:"recharts-polar-radius-axis-tick-value"}),a),o}}])}(x.PureComponent);Us(oi,"displayName","PolarRadiusAxis"),Us(oi,"axisType","radiusAxis"),Us(oi,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function si(t){"@babel/helpers - typeof";return si=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},si(t)}function sn(){return sn=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},sn.apply(this,arguments)}function M0(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 ln(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?M0(Object(r),!0).forEach(function(n){Ws(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):M0(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function oK(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function D0(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,B0(n.key),n)}}function sK(t,e,r){return e&&D0(t.prototype,e),r&&D0(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function lK(t,e,r){return e=Fs(e),uK(t,L0()?Reflect.construct(e,r||[],Fs(t).constructor):e.apply(t,r))}function uK(t,e){if(e&&(si(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cK(t)}function cK(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function L0(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(L0=function(){return!!t})()}function Fs(t){return Fs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Fs(t)}function fK(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&&Rf(t,e)}function Rf(t,e){return Rf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Rf(t,e)}function Ws(t,e,r){return e=B0(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function B0(t){var e=dK(t,"string");return si(e)=="symbol"?e:e+""}function dK(t,e){if(si(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(si(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var hK=Math.PI/180,R0=1e-5,li=function(t){function e(){return oK(this,e),lK(this,e,arguments)}return fK(e,t),sK(e,[{key:"getTickLineCoord",value:function(n){var i=this.props,a=i.cx,o=i.cy,s=i.radius,l=i.orientation,u=i.tickSize,c=u||8,f=pe(a,o,s,n.coordinate),d=pe(a,o,s+(l==="inner"?-1:1)*c,n.coordinate);return{x1:f.x,y1:f.y,x2:d.x,y2:d.y}}},{key:"getTickTextAnchor",value:function(n){var i=this.props.orientation,a=Math.cos(-n.coordinate*hK),o;return a>R0?o=i==="outer"?"start":"end":a<-R0?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,a=n.cy,o=n.radius,s=n.axisLine,l=n.axisLineType,u=ln(ln({},X(this.props,!1)),{},{fill:"none"},X(s,!1));if(l==="circle")return x.createElement(ii,sn({className:"recharts-polar-angle-axis-line"},u,{cx:i,cy:a,r:o}));var c=this.props.ticks,f=c.map(function(d){return pe(i,a,o,d.coordinate)});return x.createElement(P0,sn({className:"recharts-polar-angle-axis-line"},u,{points:f}))}},{key:"renderTicks",value:function(){var n=this,i=this.props,a=i.ticks,o=i.tick,s=i.tickLine,l=i.tickFormatter,u=i.stroke,c=X(this.props,!1),f=X(o,!1),d=ln(ln({},c),{},{fill:"none"},X(s,!1)),h=a.map(function(y,v){var p=n.getTickLineCoord(y),m=n.getTickTextAnchor(y),w=ln(ln(ln({textAnchor:m},c),{},{stroke:"none",fill:u},f),{},{index:v,payload:y,x:p.x2,y:p.y2});return x.createElement(ce,sn({className:ie("recharts-polar-angle-axis-tick",Sb(o)),key:"tick-".concat(y.coordinate)},qr(n.props,y,v)),s&&x.createElement("line",sn({className:"recharts-polar-angle-axis-tick-line"},d,p)),o&&e.renderTickItem(o,w,l?l(y.value,v):y.value))});return x.createElement(ce,{className:"recharts-polar-angle-axis-ticks"},h)}},{key:"render",value:function(){var n=this.props,i=n.ticks,a=n.radius,o=n.axisLine;return a<=0||!i||!i.length?null:x.createElement(ce,{className:ie("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,i,a){var o;return x.isValidElement(n)?o=x.cloneElement(n,i):te(n)?o=n(i):o=x.createElement(Hr,sn({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}])}(x.PureComponent);Ws(li,"displayName","PolarAngleAxis"),Ws(li,"axisType","angleAxis"),Ws(li,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var pK=Jv,vK=pK(Object.getPrototypeOf,Object),yK=vK,gK=Ht,mK=yK,bK=Gt,wK="[object Object]",_K=Function.prototype,xK=Object.prototype,U0=_K.toString,OK=xK.hasOwnProperty,SK=U0.call(Object);function AK(t){if(!bK(t)||gK(t)!=wK)return!1;var e=mK(t);if(e===null)return!0;var r=OK.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&U0.call(r)==SK}var PK=AK;const EK=we(PK);var TK=Ht,$K=Gt,jK="[object Boolean]";function kK(t){return t===!0||t===!1||$K(t)&&TK(t)==jK}var CK=kK;const IK=we(CK);function Fa(t){"@babel/helpers - typeof";return Fa=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},Fa(t)}function qs(){return qs=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},qs.apply(this,arguments)}function NK(t,e){return BK(t)||LK(t,e)||DK(t,e)||MK()}function MK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
132
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DK(t,e){if(t){if(typeof t=="string")return F0(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 F0(t,e)}}function F0(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 LK(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,s=[],l=!0,u=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}function BK(t){if(Array.isArray(t))return t}function W0(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 q0(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?W0(Object(r),!0).forEach(function(n){RK(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):W0(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function RK(t,e,r){return e=UK(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function UK(t){var e=FK(t,"string");return Fa(e)=="symbol"?e:e+""}function FK(t,e){if(Fa(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Fa(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var z0=function(e,r,n,i,a){var o=n-i,s;return s="M ".concat(e,",").concat(r),s+="L ".concat(e+n,",").concat(r),s+="L ".concat(e+n-o/2,",").concat(r+a),s+="L ".concat(e+n-o/2-i,",").concat(r+a),s+="L ".concat(e,",").concat(r," Z"),s},WK={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},qK=function(e){var r=q0(q0({},WK),e),n=x.useRef(),i=x.useState(-1),a=NK(i,2),o=a[0],s=a[1];x.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var b=n.current.getTotalLength();b&&s(b)}catch{}},[]);var l=r.x,u=r.y,c=r.upperWidth,f=r.lowerWidth,d=r.height,h=r.className,y=r.animationEasing,v=r.animationDuration,p=r.animationBegin,m=r.isUpdateAnimationActive;if(l!==+l||u!==+u||c!==+c||f!==+f||d!==+d||c===0&&f===0||d===0)return null;var w=ie("recharts-trapezoid",h);return m?x.createElement(St,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:d,x:l,y:u},to:{upperWidth:c,lowerWidth:f,height:d,x:l,y:u},duration:v,animationEasing:y,isActive:m},function(b){var O=b.upperWidth,g=b.lowerWidth,_=b.height,S=b.x,A=b.y;return x.createElement(St,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:p,duration:v,easing:y},x.createElement("path",qs({},X(r,!0),{className:w,d:z0(S,A,O,g,_),ref:n})))}):x.createElement("g",null,x.createElement("path",qs({},X(r,!0),{className:w,d:z0(l,u,c,f,d)})))},zK=["option","shapeType","propTransformer","activeClassName","isActive"];function Wa(t){"@babel/helpers - typeof";return Wa=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},Wa(t)}function KK(t,e){if(t==null)return{};var r=VK(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 VK(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 K0(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 zs(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?K0(Object(r),!0).forEach(function(n){HK(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):K0(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function HK(t,e,r){return e=GK(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function GK(t){var e=YK(t,"string");return Wa(e)=="symbol"?e:e+""}function YK(t,e){if(Wa(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Wa(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function XK(t,e){return zs(zs({},e),t)}function JK(t,e){return t==="symbols"}function V0(t){var e=t.shapeType,r=t.elementProps;switch(e){case"rectangle":return x.createElement(Nf,r);case"trapezoid":return x.createElement(qK,r);case"sector":return x.createElement(Nb,r);case"symbols":if(JK(e))return x.createElement(Bu,r);break;default:return null}}function ZK(t){return x.isValidElement(t)?t.props:t}function H0(t){var e=t.option,r=t.shapeType,n=t.propTransformer,i=n===void 0?XK:n,a=t.activeClassName,o=a===void 0?"recharts-active-shape":a,s=t.isActive,l=KK(t,zK),u;if(x.isValidElement(e))u=x.cloneElement(e,zs(zs({},l),ZK(e)));else if(te(e))u=e(l);else if(EK(e)&&!IK(e)){var c=i(e,l);u=x.createElement(V0,{shapeType:r,elementProps:c})}else{var f=l;u=x.createElement(V0,{shapeType:r,elementProps:f})}return s?x.createElement(ce,{className:o},u):u}function Ks(t,e){return e!=null&&"trapezoids"in t.props}function Vs(t,e){return e!=null&&"sectors"in t.props}function qa(t,e){return e!=null&&"points"in t.props}function QK(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 eV(t,e){var r=t.endAngle===e.endAngle,n=t.startAngle===e.startAngle;return r&&n}function tV(t,e){var r=t.x===e.x,n=t.y===e.y,i=t.z===e.z;return r&&n&&i}function rV(t,e){var r;return Ks(t,e)?r=QK:Vs(t,e)?r=eV:qa(t,e)&&(r=tV),r}function nV(t,e){var r;return Ks(t,e)?r="trapezoids":Vs(t,e)?r="sectors":qa(t,e)&&(r="points"),r}function iV(t,e){if(Ks(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(Vs(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 qa(t,e)?e.payload:{}}function aV(t){var e=t.activeTooltipItem,r=t.graphicalItem,n=t.itemData,i=nV(r,e),a=iV(r,e),o=n.filter(function(l,u){var c=xr(a,l),f=r.props[i].filter(function(y){var v=rV(r,e);return v(y,e)}),d=r.props[i].indexOf(f[f.length-1]),h=u===d;return c&&h}),s=n.indexOf(o[o.length-1]);return s}var Hs;function ui(t){"@babel/helpers - typeof";return ui=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},ui(t)}function ci(){return ci=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},ci.apply(this,arguments)}function G0(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 Ae(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?G0(Object(r),!0).forEach(function(n){At(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):G0(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function oV(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Y0(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,J0(n.key),n)}}function sV(t,e,r){return e&&Y0(t.prototype,e),r&&Y0(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function lV(t,e,r){return e=Gs(e),uV(t,X0()?Reflect.construct(e,r||[],Gs(t).constructor):e.apply(t,r))}function uV(t,e){if(e&&(ui(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cV(t)}function cV(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function X0(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(X0=function(){return!!t})()}function Gs(t){return Gs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Gs(t)}function fV(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&&Uf(t,e)}function Uf(t,e){return Uf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Uf(t,e)}function At(t,e,r){return e=J0(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function J0(t){var e=dV(t,"string");return ui(e)=="symbol"?e:e+""}function dV(t,e){if(ui(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ui(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var sr=function(t){function e(r){var n;return oV(this,e),n=lV(this,e,[r]),At(n,"pieRef",null),At(n,"sectorRefs",[]),At(n,"id",Wr("recharts-pie-")),At(n,"handleAnimationEnd",function(){var i=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),te(i)&&i()}),At(n,"handleAnimationStart",function(){var i=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),te(i)&&i()}),n.state={isAnimationFinished:!r.isAnimationActive,prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,sectorToFocus:0},n}return fV(e,t),sV(e,[{key:"isActiveIndex",value:function(n){var i=this.props.activeIndex;return Array.isArray(i)?i.indexOf(n)!==-1:n===i}},{key:"hasActiveIndex",value:function(){var n=this.props.activeIndex;return Array.isArray(n)?n.length!==0:n||n===0}},{key:"renderLabels",value:function(n){var i=this.props.isAnimationActive;if(i&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.label,s=a.labelLine,l=a.dataKey,u=a.valueKey,c=X(this.props,!1),f=X(o,!1),d=X(s,!1),h=o&&o.offsetRadius||20,y=n.map(function(v,p){var m=(v.startAngle+v.endAngle)/2,w=pe(v.cx,v.cy,v.outerRadius+h,m),b=Ae(Ae(Ae(Ae({},c),v),{},{stroke:"none"},f),{},{index:p,textAnchor:e.getTextAnchor(w.x,v.cx)},w),O=Ae(Ae(Ae(Ae({},c),v),{},{fill:"none",stroke:v.fill},d),{},{index:p,points:[pe(v.cx,v.cy,v.outerRadius,m),w]}),g=l;return se(l)&&se(u)?g="value":se(l)&&(g=u),x.createElement(ce,{key:"label-".concat(v.startAngle,"-").concat(v.endAngle,"-").concat(v.midAngle,"-").concat(p)},s&&e.renderLabelLineItem(s,O,"line"),e.renderLabelItem(o,b,Ne(v,g)))});return x.createElement(ce,{className:"recharts-pie-labels"},y)}},{key:"renderSectorsStatically",value:function(n){var i=this,a=this.props,o=a.activeShape,s=a.blendStroke,l=a.inactiveShape;return n.map(function(u,c){if((u==null?void 0:u.startAngle)===0&&(u==null?void 0:u.endAngle)===0&&n.length!==1)return null;var f=i.isActiveIndex(c),d=l&&i.hasActiveIndex()?l:null,h=f?o:d,y=Ae(Ae({},u),{},{stroke:s?u.fill:u.stroke,tabIndex:-1});return x.createElement(ce,ci({ref:function(p){p&&!i.sectorRefs.includes(p)&&i.sectorRefs.push(p)},tabIndex:-1,className:"recharts-pie-sector"},qr(i.props,u,c),{key:"sector-".concat(u==null?void 0:u.startAngle,"-").concat(u==null?void 0:u.endAngle,"-").concat(u.midAngle,"-").concat(c)}),x.createElement(H0,ci({option:h,isActive:f,shapeType:"sector"},y)))})}},{key:"renderSectorsWithAnimation",value:function(){var n=this,i=this.props,a=i.sectors,o=i.isAnimationActive,s=i.animationBegin,l=i.animationDuration,u=i.animationEasing,c=i.animationId,f=this.state,d=f.prevSectors,h=f.prevIsAnimationActive;return x.createElement(St,{begin:s,duration:l,isActive:o,easing:u,from:{t:0},to:{t:1},key:"pie-".concat(c,"-").concat(h),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(y){var v=y.t,p=[],m=a&&a[0],w=m.startAngle;return a.forEach(function(b,O){var g=d&&d[O],_=O>0?ct(b,"paddingAngle",0):0;if(g){var S=Ie(g.endAngle-g.startAngle,b.endAngle-b.startAngle),A=Ae(Ae({},b),{},{startAngle:w+_,endAngle:w+S(v)+_});p.push(A),w=A.endAngle}else{var E=b.endAngle,I=b.startAngle,T=Ie(0,E-I),$=T(v),k=Ae(Ae({},b),{},{startAngle:w+_,endAngle:w+$+_});p.push(k),w=k.endAngle}}),x.createElement(ce,null,n.renderSectorsStatically(p))})}},{key:"attachKeyboardHandlers",value:function(n){var i=this;n.onkeydown=function(a){if(!a.altKey)switch(a.key){case"ArrowLeft":{var o=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[o].focus(),i.setState({sectorToFocus:o});break}case"ArrowRight":{var s=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[s].focus(),i.setState({sectorToFocus:s});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,i=n.sectors,a=n.isAnimationActive,o=this.state.prevSectors;return a&&i&&i.length&&(!o||!xr(o,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,i=this.props,a=i.hide,o=i.sectors,s=i.className,l=i.label,u=i.cx,c=i.cy,f=i.innerRadius,d=i.outerRadius,h=i.isAnimationActive,y=this.state.isAnimationFinished;if(a||!o||!o.length||!z(u)||!z(c)||!z(f)||!z(d))return null;var v=ie("recharts-pie",s);return x.createElement(ce,{tabIndex:this.props.rootTabIndex,className:v,ref:function(m){n.pieRef=m}},this.renderSectors(),l&&this.renderLabels(o),Ve.renderCallByParent(this.props,null,!1),(!h||y)&&It.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return i.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:n.sectors!==i.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,i){return n>i?"start":n<i?"end":"middle"}},{key:"renderLabelLineItem",value:function(n,i,a){if(x.isValidElement(n))return x.cloneElement(n,i);if(te(n))return n(i);var o=ie("recharts-pie-label-line",typeof n!="boolean"?n.className:"");return x.createElement(nn,ci({},i,{key:a,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(n,i,a){if(x.isValidElement(n))return x.cloneElement(n,i);var o=a;if(te(n)&&(o=n(i),x.isValidElement(o)))return o;var s=ie("recharts-pie-label-text",typeof n!="boolean"&&!te(n)?n.className:"");return x.createElement(Hr,ci({},i,{alignmentBaseline:"middle",className:s}),o)}}])}(x.PureComponent);Hs=sr,At(sr,"displayName","Pie"),At(sr,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!wt.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0}),At(sr,"parseDeltaAngle",function(t,e){var r=tt(e-t),n=Math.min(Math.abs(e-t),360);return r*n}),At(sr,"getRealPieData",function(t){var e=t.data,r=t.children,n=X(t,!1),i=ft(r,Xo);return e&&e.length?e.map(function(a,o){return Ae(Ae(Ae({payload:a},n),a),i&&i[o]&&i[o].props)}):i&&i.length?i.map(function(a){return Ae(Ae({},n),a.props)}):[]}),At(sr,"parseCoordinateOfPie",function(t,e){var r=e.top,n=e.left,i=e.width,a=e.height,o=_b(i,a),s=n+rt(t.cx,i,i/2),l=r+rt(t.cy,a,a/2),u=rt(t.innerRadius,o,0),c=rt(t.outerRadius,o,o*.8),f=t.maxRadius||Math.sqrt(i*i+a*a)/2;return{cx:s,cy:l,innerRadius:u,outerRadius:c,maxRadius:f}}),At(sr,"getComposedData",function(t){var e=t.item,r=t.offset,n=e.type.defaultProps!==void 0?Ae(Ae({},e.type.defaultProps),e.props):e.props,i=Hs.getRealPieData(n);if(!i||!i.length)return null;var a=n.cornerRadius,o=n.startAngle,s=n.endAngle,l=n.paddingAngle,u=n.dataKey,c=n.nameKey,f=n.valueKey,d=n.tooltipType,h=Math.abs(n.minAngle),y=Hs.parseCoordinateOfPie(n,r),v=Hs.parseDeltaAngle(o,s),p=Math.abs(v),m=u;se(u)&&se(f)?(jt(!1,`Use "dataKey" to specify the value of pie,
|
|
133
|
+
the props "valueKey" will be deprecated in 1.1.0`),m="value"):se(u)&&(jt(!1,`Use "dataKey" to specify the value of pie,
|
|
134
|
+
the props "valueKey" will be deprecated in 1.1.0`),m=f);var w=i.filter(function(A){return Ne(A,m,0)!==0}).length,b=(p>=360?w:w-1)*l,O=p-w*h-b,g=i.reduce(function(A,E){var I=Ne(E,m,0);return A+(z(I)?I:0)},0),_;if(g>0){var S;_=i.map(function(A,E){var I=Ne(A,m,0),T=Ne(A,c,E),$=(z(I)?I:0)/g,k;E?k=S.endAngle+tt(v)*l*(I!==0?1:0):k=o;var C=k+tt(v)*((I!==0?h:0)+$*O),D=(k+C)/2,N=(y.innerRadius+y.outerRadius)/2,L=[{name:T,value:I,payload:A,dataKey:m,type:d}],W=pe(y.cx,y.cy,N,D);return S=Ae(Ae(Ae({percent:$,cornerRadius:a,name:T,tooltipPayload:L,midAngle:D,middleRadius:N,tooltipPosition:W},A),y),{},{value:Ne(A,m),startAngle:k,endAngle:C,payload:A,paddingAngle:tt(v)*l}),S})}return Ae(Ae({},y),{},{sectors:_,data:i})});function hV(t){return t&&t.length?t[0]:void 0}var pV=hV,vV=pV;const yV=we(vV);var gV=["key"];function fi(t){"@babel/helpers - typeof";return fi=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},fi(t)}function mV(t,e){if(t==null)return{};var r=bV(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 bV(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 Ys(){return Ys=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},Ys.apply(this,arguments)}function Z0(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 it(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Z0(Object(r),!0).forEach(function(n){lr(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Z0(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function wV(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Q0(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,tw(n.key),n)}}function _V(t,e,r){return e&&Q0(t.prototype,e),r&&Q0(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function xV(t,e,r){return e=Xs(e),OV(t,ew()?Reflect.construct(e,r||[],Xs(t).constructor):e.apply(t,r))}function OV(t,e){if(e&&(fi(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return SV(t)}function SV(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ew(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ew=function(){return!!t})()}function Xs(t){return Xs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Xs(t)}function AV(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&&Ff(t,e)}function Ff(t,e){return Ff=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Ff(t,e)}function lr(t,e,r){return e=tw(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function tw(t){var e=PV(t,"string");return fi(e)=="symbol"?e:e+""}function PV(t,e){if(fi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(fi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var za=function(t){function e(){var r;wV(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=xV(this,e,[].concat(i)),lr(r,"state",{isAnimationFinished:!1}),lr(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),te(o)&&o()}),lr(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),te(o)&&o()}),lr(r,"handleMouseEnter",function(o){var s=r.props.onMouseEnter;s&&s(r.props,o)}),lr(r,"handleMouseLeave",function(o){var s=r.props.onMouseLeave;s&&s(r.props,o)}),r}return AV(e,t),_V(e,[{key:"renderDots",value:function(n){var i=this.props,a=i.dot,o=i.dataKey,s=X(this.props,!1),l=X(a,!0),u=n.map(function(c,f){var d=it(it(it({key:"dot-".concat(f),r:3},s),l),{},{dataKey:o,cx:c.x,cy:c.y,index:f,payload:c});return e.renderDotItem(a,d)});return x.createElement(ce,{className:"recharts-radar-dots"},u)}},{key:"renderPolygonStatically",value:function(n){var i=this.props,a=i.shape,o=i.dot,s=i.isRange,l=i.baseLinePoints,u=i.connectNulls,c;return x.isValidElement(a)?c=x.cloneElement(a,it(it({},this.props),{},{points:n})):te(a)?c=a(it(it({},this.props),{},{points:n})):c=x.createElement(P0,Ys({},X(this.props,!0),{onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,points:n,baseLinePoints:s?l:null,connectNulls:u})),x.createElement(ce,{className:"recharts-radar-polygon"},c,o?this.renderDots(n):null)}},{key:"renderPolygonWithAnimation",value:function(){var n=this,i=this.props,a=i.points,o=i.isAnimationActive,s=i.animationBegin,l=i.animationDuration,u=i.animationEasing,c=i.animationId,f=this.state.prevPoints;return x.createElement(St,{begin:s,duration:l,isActive:o,easing:u,from:{t:0},to:{t:1},key:"radar-".concat(c),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(d){var h=d.t,y=f&&f.length/a.length,v=a.map(function(p,m){var w=f&&f[Math.floor(m*y)];if(w){var b=Ie(w.x,p.x),O=Ie(w.y,p.y);return it(it({},p),{},{x:b(h),y:O(h)})}var g=Ie(p.cx,p.x),_=Ie(p.cy,p.y);return it(it({},p),{},{x:g(h),y:_(h)})});return n.renderPolygonStatically(v)})}},{key:"renderPolygon",value:function(){var n=this.props,i=n.points,a=n.isAnimationActive,o=n.isRange,s=this.state.prevPoints;return a&&i&&i.length&&!o&&(!s||!xr(s,i))?this.renderPolygonWithAnimation():this.renderPolygonStatically(i)}},{key:"render",value:function(){var n=this.props,i=n.hide,a=n.className,o=n.points,s=n.isAnimationActive;if(i||!o||!o.length)return null;var l=this.state.isAnimationFinished,u=ie("recharts-radar",a);return x.createElement(ce,{className:u},this.renderPolygon(),(!s||l)&&It.renderCallByParent(this.props,o))}}],[{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:"renderDotItem",value:function(n,i){var a;if(x.isValidElement(n))a=x.cloneElement(n,i);else if(te(n))a=n(i);else{var o=i.key,s=mV(i,gV);a=x.createElement(ii,Ys({},s,{key:o,className:ie("recharts-radar-dot",typeof n!="boolean"?n.className:"")}))}return a}}])}(x.PureComponent);lr(za,"displayName","Radar"),lr(za,"defaultProps",{angleAxisId:0,radiusAxisId:0,hide:!1,activeDot:!0,dot:!1,legendType:"rect",isAnimationActive:!wt.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"}),lr(za,"getComposedData",function(t){var e=t.radiusAxis,r=t.angleAxis,n=t.displayedData,i=t.dataKey,a=t.bandSize,o=r.cx,s=r.cy,l=!1,u=[],c=r.type!=="number"?a??0:0;n.forEach(function(d,h){var y=Ne(d,r.dataKey,h),v=Ne(d,i),p=r.scale(y)+c,m=Array.isArray(v)?Eb(v):v,w=se(m)?void 0:e.scale(m);Array.isArray(v)&&v.length>=2&&(l=!0),u.push(it(it({},pe(o,s,w,p)),{},{name:y,value:v,cx:o,cy:s,radius:w,angle:p,payload:d}))});var f=[];return l&&u.forEach(function(d){if(Array.isArray(d.value)){var h=yV(d.value),y=se(h)?void 0:e.scale(h);f.push(it(it({},d),{},{radius:y},pe(o,s,y,d.angle)))}else f.push(d)}),{points:u,isRange:l,baseLinePoints:f}});var EV=Math.ceil,TV=Math.max;function $V(t,e,r,n){for(var i=-1,a=TV(EV((e-t)/(r||1)),0),o=Array(a);a--;)o[n?a:++i]=t,t+=r;return o}var jV=$V,kV=Yy,rw=1/0,CV=17976931348623157e292;function IV(t){if(!t)return t===0?t:0;if(t=kV(t),t===rw||t===-rw){var e=t<0?-1:1;return e*CV}return t===t?t:0}var nw=IV,NV=jV,MV=Ko,Wf=nw;function DV(t){return function(e,r,n){return n&&typeof n!="number"&&MV(e,r,n)&&(r=n=void 0),e=Wf(e),r===void 0?(r=e,e=0):r=Wf(r),n=n===void 0?e<r?1:-1:Wf(n),NV(e,r,n,t)}}var LV=DV,BV=LV,RV=BV(),UV=RV;const Js=we(UV);function Ka(t){"@babel/helpers - typeof";return Ka=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},Ka(t)}function iw(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 aw(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?iw(Object(r),!0).forEach(function(n){ow(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):iw(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ow(t,e,r){return e=FV(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function FV(t){var e=WV(t,"string");return Ka(e)=="symbol"?e:e+""}function WV(t,e){if(Ka(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ka(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var qV=["Webkit","Moz","O","ms"],zV=function(e,r){var n=e.replace(/(\w)/,function(a){return a.toUpperCase()}),i=qV.reduce(function(a,o){return aw(aw({},a),{},ow({},o+n,r))},{});return i[e]=r,i};function di(t){"@babel/helpers - typeof";return di=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},di(t)}function Zs(){return Zs=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},Zs.apply(this,arguments)}function sw(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 qf(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?sw(Object(r),!0).forEach(function(n){pt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):sw(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function KV(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lw(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,cw(n.key),n)}}function VV(t,e,r){return e&&lw(t.prototype,e),r&&lw(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function HV(t,e,r){return e=Qs(e),GV(t,uw()?Reflect.construct(e,r||[],Qs(t).constructor):e.apply(t,r))}function GV(t,e){if(e&&(di(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return YV(t)}function YV(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function uw(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(uw=function(){return!!t})()}function Qs(t){return Qs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Qs(t)}function XV(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&&zf(t,e)}function zf(t,e){return zf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},zf(t,e)}function pt(t,e,r){return e=cw(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function cw(t){var e=JV(t,"string");return di(e)=="symbol"?e:e+""}function JV(t,e){if(di(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(di(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ZV=function(e){var r=e.data,n=e.startIndex,i=e.endIndex,a=e.x,o=e.width,s=e.travellerWidth;if(!r||!r.length)return{};var l=r.length,u=aa().domain(Js(0,l)).range([a,a+o-s]),c=u.domain().map(function(f){return u(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(n),endX:u(i),scale:u,scaleValues:c}},fw=function(e){return e.changedTouches&&!!e.changedTouches.length},hi=function(t){function e(r){var n;return KV(this,e),n=HV(this,e,[r]),pt(n,"handleDrag",function(i){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(i):n.state.isSlideMoving&&n.handleSlideDrag(i)}),pt(n,"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&n.handleDrag(i.changedTouches[0])}),pt(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,a=i.endIndex,o=i.onDragEnd,s=i.startIndex;o==null||o({endIndex:a,startIndex:s})}),n.detachDragEndListener()}),pt(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),pt(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),pt(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),pt(n,"handleSlideDragStart",function(i){var a=fw(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 XV(e,t),VV(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,s=this.props,l=s.gap,u=s.data,c=u.length-1,f=Math.min(i,a),d=Math.max(i,a),h=e.getIndexInRange(o,f),y=e.getIndexInRange(o,d);return{startIndex:h-h%l,endIndex:y===c?c:y-y%l}}},{key:"getTextOfTick",value:function(n){var i=this.props,a=i.data,o=i.tickFormatter,s=i.dataKey,l=Ne(a[n],s,n);return te(o)?o(l,n):l}},{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,s=i.endX,l=this.props,u=l.x,c=l.width,f=l.travellerWidth,d=l.startIndex,h=l.endIndex,y=l.onChange,v=n.pageX-a;v>0?v=Math.min(v,u+c-f-s,u+c-f-o):v<0&&(v=Math.max(v,u-o,u-s));var p=this.getIndex({startX:o+v,endX:s+v});(p.startIndex!==d||p.endIndex!==h)&&y&&y(p),this.setState({startX:o+v,endX:s+v,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=fw(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,s=i.endX,l=i.startX,u=this.state[o],c=this.props,f=c.x,d=c.width,h=c.travellerWidth,y=c.onChange,v=c.gap,p=c.data,m={startX:this.state.startX,endX:this.state.endX},w=n.pageX-a;w>0?w=Math.min(w,f+d-h-u):w<0&&(w=Math.max(w,f-u)),m[o]=u+w;var b=this.getIndex(m),O=b.startIndex,g=b.endIndex,_=function(){var A=p.length-1;return o==="startX"&&(s>l?O%v===0:g%v===0)||s<l&&g===A||o==="endX"&&(s>l?g%v===0:O%v===0)||s>l&&g===A};this.setState(pt(pt({},o,u+w),"brushMoveStartX",n.pageX),function(){y&&_()&&y(b)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var a=this,o=this.state,s=o.scaleValues,l=o.startX,u=o.endX,c=this.state[i],f=s.indexOf(c);if(f!==-1){var d=f+n;if(!(d===-1||d>=s.length)){var h=s[d];i==="startX"&&h>=u||i==="endX"&&h<=l||this.setState(pt({},i,h),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,s=n.height,l=n.fill,u=n.stroke;return x.createElement("rect",{stroke:u,fill:l,x:i,y:a,width:o,height:s})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,l=n.data,u=n.children,c=n.padding,f=x.Children.only(u);return f?x.cloneElement(f,{x:i,y:a,width:o,height:s,margin:c,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(n,i){var a,o,s=this,l=this.props,u=l.y,c=l.travellerWidth,f=l.height,d=l.traveller,h=l.ariaLabel,y=l.data,v=l.startIndex,p=l.endIndex,m=Math.max(n,this.props.x),w=qf(qf({},X(this.props,!1)),{},{x:m,y:u,width:c,height:f}),b=h||"Min value: ".concat((a=y[v])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=y[p])===null||o===void 0?void 0:o.name);return x.createElement(ce,{tabIndex:0,role:"slider","aria-label":b,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(g){["ArrowLeft","ArrowRight"].includes(g.key)&&(g.preventDefault(),g.stopPropagation(),s.handleTravellerMoveKeyboard(g.key==="ArrowRight"?1:-1,i))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(d,w))}},{key:"renderSlide",value:function(n,i){var a=this.props,o=a.y,s=a.height,l=a.stroke,u=a.travellerWidth,c=Math.min(n,i)+u,f=Math.max(Math.abs(i-n)-u,0);return x.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:c,y:o,width:f,height:s})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,a=n.endIndex,o=n.y,s=n.height,l=n.travellerWidth,u=n.stroke,c=this.state,f=c.startX,d=c.endX,h=5,y={pointerEvents:"none",fill:u};return x.createElement(ce,{className:"recharts-brush-texts"},x.createElement(Hr,Zs({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,d)-h,y:o+s/2},y),this.getTextOfTick(i)),x.createElement(Hr,Zs({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,d)+l+h,y:o+s/2},y),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,i=n.data,a=n.className,o=n.children,s=n.x,l=n.y,u=n.width,c=n.height,f=n.alwaysShowText,d=this.state,h=d.startX,y=d.endX,v=d.isTextActive,p=d.isSlideMoving,m=d.isTravellerMoving,w=d.isTravellerFocused;if(!i||!i.length||!z(s)||!z(l)||!z(u)||!z(c)||u<=0||c<=0)return null;var b=ie("recharts-brush",a),O=x.Children.count(o)===1,g=zV("userSelect","none");return x.createElement(ce,{className:b,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:g},this.renderBackground(),O&&this.renderPanorama(),this.renderSlide(h,y),this.renderTravellerLayer(h,"startX"),this.renderTravellerLayer(y,"endX"),(v||p||m||w||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,a=n.y,o=n.width,s=n.height,l=n.stroke,u=Math.floor(a+s/2)-1;return x.createElement(x.Fragment,null,x.createElement("rect",{x:i,y:a,width:o,height:s,fill:l,stroke:"none"}),x.createElement("line",{x1:i+1,y1:u,x2:i+o-1,y2:u,fill:"none",stroke:"#fff"}),x.createElement("line",{x1:i+1,y1:u+2,x2:i+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var a;return x.isValidElement(n)?a=x.cloneElement(n,i):te(n)?a=n(i):a=e.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(n,i){var a=n.data,o=n.width,s=n.x,l=n.travellerWidth,u=n.updateId,c=n.startIndex,f=n.endIndex;if(a!==i.prevData||u!==i.prevUpdateId)return qf({prevData:a,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o},a&&a.length?ZV({data:a,width:o,x:s,travellerWidth:l,startIndex:c,endIndex:f}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||s!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([s,s+o-l]);var d=i.scale.domain().map(function(h){return i.scale(h)});return{prevData:a,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:d}}return null}},{key:"getIndexInRange",value:function(n,i){for(var a=n.length,o=0,s=a-1;s-o>1;){var l=Math.floor((o+s)/2);n[l]>i?s=l:o=l}return i>=n[s]?s:o}}])}(x.PureComponent);pt(hi,"displayName","Brush"),pt(hi,"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 QV=rc;function eH(t,e){var r;return QV(t,function(n,i,a){return r=e(n,i,a),!r}),!!r}var tH=eH,rH=Dv,nH=Bt,iH=tH,aH=at,oH=Ko;function sH(t,e,r){var n=aH(t)?rH:iH;return r&&oH(t,e,r)&&(e=void 0),n(t,nH(e))}var lH=sH;const uH=we(lH);var qt=function(e,r){var n=e.alwaysShow,i=e.ifOverflow;return n&&(i="extendDomain"),i===r},dw=Cy;function cH(t,e,r){e=="__proto__"&&dw?dw(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var fH=cH,dH=fH,hH=Ty,pH=Bt;function vH(t,e){var r={};return e=pH(e),hH(t,function(n,i,a){dH(r,i,e(n,i,a))}),r}var yH=vH;const gH=we(yH);function mH(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(!e(t[r],r,t))return!1;return!0}var bH=mH,wH=rc;function _H(t,e){var r=!0;return wH(t,function(n,i,a){return r=!!e(n,i,a),r}),r}var xH=_H,OH=bH,SH=xH,AH=Bt,PH=at,EH=Ko;function TH(t,e,r){var n=PH(t)?OH:SH;return r&&EH(t,e,r)&&(e=void 0),n(t,AH(e))}var $H=TH;const hw=we($H);var jH=["x","y"];function pi(t){"@babel/helpers - typeof";return pi=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},pi(t)}function Kf(){return Kf=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},Kf.apply(this,arguments)}function pw(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 Va(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?pw(Object(r),!0).forEach(function(n){kH(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):pw(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function kH(t,e,r){return e=CH(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function CH(t){var e=IH(t,"string");return pi(e)=="symbol"?e:e+""}function IH(t,e){if(pi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(pi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function NH(t,e){if(t==null)return{};var r=MH(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 MH(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 DH(t,e){var r=t.x,n=t.y,i=NH(t,jH),a="".concat(r),o=parseInt(a,10),s="".concat(n),l=parseInt(s,10),u="".concat(e.height||i.height),c=parseInt(u,10),f="".concat(e.width||i.width),d=parseInt(f,10);return Va(Va(Va(Va(Va({},e),i),o?{x:o}:{}),l?{y:l}:{}),{},{height:c,width:d,name:e.name,radius:e.radius})}function vw(t){return x.createElement(H0,Kf({shapeType:"rectangle",propTransformer:DH,activeClassName:"recharts-active-bar"},t))}var LH=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=z(n)||M1(n);return a?e(n,i):(a||(process.env.NODE_ENV!=="production"?st(!1,"minPointSize callback function received a value with type of ".concat(pi(n),". Currently only numbers or null/undefined are supported.")):st()),r)}},BH=["value","background"],yw;function vi(t){"@babel/helpers - typeof";return vi=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},vi(t)}function RH(t,e){if(t==null)return{};var r=UH(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 UH(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 el(){return el=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},el.apply(this,arguments)}function gw(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?gw(Object(r),!0).forEach(function(n){Ar(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):gw(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function FH(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mw(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,ww(n.key),n)}}function WH(t,e,r){return e&&mw(t.prototype,e),r&&mw(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function qH(t,e,r){return e=tl(e),zH(t,bw()?Reflect.construct(e,r||[],tl(t).constructor):e.apply(t,r))}function zH(t,e){if(e&&(vi(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return KH(t)}function KH(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function bw(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(bw=function(){return!!t})()}function tl(t){return tl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},tl(t)}function VH(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&&Vf(t,e)}function Vf(t,e){return Vf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Vf(t,e)}function Ar(t,e,r){return e=ww(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ww(t){var e=HH(t,"string");return vi(e)=="symbol"?e:e+""}function HH(t,e){if(vi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(vi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var un=function(t){function e(){var r;FH(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=qH(this,e,[].concat(i)),Ar(r,"state",{isAnimationFinished:!1}),Ar(r,"id",Wr("recharts-bar-")),Ar(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),o&&o()}),Ar(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),o&&o()}),r}return VH(e,t),WH(e,[{key:"renderRectanglesStatically",value:function(n){var i=this,a=this.props,o=a.shape,s=a.dataKey,l=a.activeIndex,u=a.activeBar,c=X(this.props,!1);return n&&n.map(function(f,d){var h=d===l,y=h?u:o,v=Be(Be(Be({},c),f),{},{isActive:h,option:y,index:d,dataKey:s,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return x.createElement(ce,el({className:"recharts-bar-rectangle"},qr(i.props,f,d),{key:"rectangle-".concat(f==null?void 0:f.x,"-").concat(f==null?void 0:f.y,"-").concat(f==null?void 0:f.value,"-").concat(d)}),x.createElement(vw,v))})}},{key:"renderRectanglesWithAnimation",value:function(){var n=this,i=this.props,a=i.data,o=i.layout,s=i.isAnimationActive,l=i.animationBegin,u=i.animationDuration,c=i.animationEasing,f=i.animationId,d=this.state.prevData;return x.createElement(St,{begin:l,duration:u,isActive:s,easing:c,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(h){var y=h.t,v=a.map(function(p,m){var w=d&&d[m];if(w){var b=Ie(w.x,p.x),O=Ie(w.y,p.y),g=Ie(w.width,p.width),_=Ie(w.height,p.height);return Be(Be({},p),{},{x:b(y),y:O(y),width:g(y),height:_(y)})}if(o==="horizontal"){var S=Ie(0,p.height),A=S(y);return Be(Be({},p),{},{y:p.y+p.height-A,height:A})}var E=Ie(0,p.width),I=E(y);return Be(Be({},p),{},{width:I})});return x.createElement(ce,null,n.renderRectanglesStatically(v))})}},{key:"renderRectangles",value:function(){var n=this.props,i=n.data,a=n.isAnimationActive,o=this.state.prevData;return a&&i&&i.length&&(!o||!xr(o,i))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(i)}},{key:"renderBackground",value:function(){var n=this,i=this.props,a=i.data,o=i.dataKey,s=i.activeIndex,l=X(this.props.background,!1);return a.map(function(u,c){u.value;var f=u.background,d=RH(u,BH);if(!f)return null;var h=Be(Be(Be(Be(Be({},d),{},{fill:"#eee"},f),l),qr(n.props,u,c)),{},{onAnimationStart:n.handleAnimationStart,onAnimationEnd:n.handleAnimationEnd,dataKey:o,index:c,className:"recharts-bar-background-rectangle"});return x.createElement(vw,el({key:"background-bar-".concat(c),option:n.props.background,isActive:c===s},h))})}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.data,s=a.xAxis,l=a.yAxis,u=a.layout,c=a.children,f=ft(c,ma);if(!f)return null;var d=u==="vertical"?o[0].height/2:o[0].width/2,h=function(p,m){var w=Array.isArray(p.value)?p.value[1]:p.value;return{x:p.x,y:p.y,value:w,errorVal:Ne(p,m)}},y={clipPath:n?"url(#clipPath-".concat(i,")"):null};return x.createElement(ce,y,f.map(function(v){return x.cloneElement(v,{key:"error-bar-".concat(i,"-").concat(v.props.dataKey),data:o,xAxis:s,yAxis:l,layout:u,offset:d,dataPointFormatter:h})}))}},{key:"render",value:function(){var n=this.props,i=n.hide,a=n.data,o=n.className,s=n.xAxis,l=n.yAxis,u=n.left,c=n.top,f=n.width,d=n.height,h=n.isAnimationActive,y=n.background,v=n.id;if(i||!a||!a.length)return null;var p=this.state.isAnimationFinished,m=ie("recharts-bar",o),w=s&&s.allowDataOverflow,b=l&&l.allowDataOverflow,O=w||b,g=se(v)?this.id:v;return x.createElement(ce,{className:m},w||b?x.createElement("defs",null,x.createElement("clipPath",{id:"clipPath-".concat(g)},x.createElement("rect",{x:w?u:u-f/2,y:b?c:c-d/2,width:w?f:f*2,height:b?d:d*2}))):null,x.createElement(ce,{className:"recharts-bar-rectangles",clipPath:O?"url(#clipPath-".concat(g,")"):null},y?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(O,g),(!h||p)&&It.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}}])}(x.PureComponent);yw=un,Ar(un,"displayName","Bar"),Ar(un,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!wt.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"}),Ar(un,"getComposedData",function(t){var e=t.props,r=t.item,n=t.barPosition,i=t.bandSize,a=t.xAxis,o=t.yAxis,s=t.xAxisTicks,l=t.yAxisTicks,u=t.stackedData,c=t.dataStartIndex,f=t.displayedData,d=t.offset,h=eW(n,r);if(!h)return null;var y=e.layout,v=r.type.defaultProps,p=v!==void 0?Be(Be({},v),r.props):r.props,m=p.dataKey,w=p.children,b=p.minPointSize,O=y==="horizontal"?o:a,g=u?O.scale.domain():null,_=sW({numericAxis:O}),S=ft(w,Xo),A=f.map(function(E,I){var T,$,k,C,D,N;u?T=tW(u[c+I],g):(T=Ne(E,m),Array.isArray(T)||(T=[_,T]));var L=LH(b,yw.defaultProps.minPointSize)(T[1],I);if(y==="horizontal"){var W,q=[o.scale(T[0]),o.scale(T[1])],M=q[0],R=q[1];$=db({axis:a,ticks:s,bandSize:i,offset:h.offset,entry:E,index:I}),k=(W=R??M)!==null&&W!==void 0?W:void 0,C=h.size;var U=M-R;if(D=Number.isNaN(U)?0:U,N={x:$,y:o.y,width:C,height:o.height},Math.abs(L)>0&&Math.abs(D)<Math.abs(L)){var V=tt(D||L)*(Math.abs(L)-Math.abs(D));k-=V,D+=V}}else{var G=[a.scale(T[0]),a.scale(T[1])],ee=G[0],re=G[1];if($=ee,k=db({axis:o,ticks:l,bandSize:i,offset:h.offset,entry:E,index:I}),C=re-ee,D=h.size,N={x:a.x,y:k,width:a.width,height:D},Math.abs(L)>0&&Math.abs(C)<Math.abs(L)){var le=tt(C||L)*(Math.abs(L)-Math.abs(C));C+=le}}return Be(Be(Be({},E),{},{x:$,y:k,width:C,height:D,value:u?T:T[1],payload:E,background:N},S&&S[I]&&S[I].props),{},{tooltipPayload:[gb(r,E)],tooltipPosition:{x:$+C/2,y:k+D/2}})});return Be({data:A,layout:y},d)});function Ha(t){"@babel/helpers - typeof";return Ha=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},Ha(t)}function GH(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _w(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,Ow(n.key),n)}}function YH(t,e,r){return e&&_w(t.prototype,e),r&&_w(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function xw(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 Mt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?xw(Object(r),!0).forEach(function(n){rl(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):xw(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function rl(t,e,r){return e=Ow(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ow(t){var e=XH(t,"string");return Ha(e)=="symbol"?e:e+""}function XH(t,e){if(Ha(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ha(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Hf=function(e,r,n,i,a){var o=e.width,s=e.height,l=e.layout,u=e.children,c=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:s-n.bottom,bottomMirror:s-n.bottom},d=!!dt(u,un);return c.reduce(function(h,y){var v=r[y],p=v.orientation,m=v.domain,w=v.padding,b=w===void 0?{}:w,O=v.mirror,g=v.reversed,_="".concat(p).concat(O?"Mirror":""),S,A,E,I,T;if(v.type==="number"&&(v.padding==="gap"||v.padding==="no-gap")){var $=m[1]-m[0],k=1/0,C=v.categoricalDomain.sort(B1);if(C.forEach(function(G,ee){ee>0&&(k=Math.min((G||0)-(C[ee-1]||0),k))}),Number.isFinite(k)){var D=k/$,N=v.layout==="vertical"?n.height:n.width;if(v.padding==="gap"&&(S=D*N/2),v.padding==="no-gap"){var L=rt(e.barCategoryGap,D*N),W=D*N/2;S=W-L-(W-L)/N*L}}}i==="xAxis"?A=[n.left+(b.left||0)+(S||0),n.left+n.width-(b.right||0)-(S||0)]:i==="yAxis"?A=l==="horizontal"?[n.top+n.height-(b.bottom||0),n.top+(b.top||0)]:[n.top+(b.top||0)+(S||0),n.top+n.height-(b.bottom||0)-(S||0)]:A=v.range,g&&(A=[A[1],A[0]]);var q=lb(v,a,d),M=q.scale,R=q.realScaleType;M.domain(m).range(A),cb(M);var U=fb(M,Mt(Mt({},v),{},{realScaleType:R}));i==="xAxis"?(T=p==="top"&&!O||p==="bottom"&&O,E=n.left,I=f[_]-T*v.height):i==="yAxis"&&(T=p==="left"&&!O||p==="right"&&O,E=f[_]-T*v.width,I=n.top);var V=Mt(Mt(Mt({},v),U),{},{realScaleType:R,x:E,y:I,scale:M,width:i==="xAxis"?n.width:v.width,height:i==="yAxis"?n.height:v.height});return V.bandSize=Es(V,U),!v.hide&&i==="xAxis"?f[_]+=(T?-1:1)*V.height:v.hide||(f[_]+=(T?-1:1)*V.width),Mt(Mt({},h),{},rl({},y,V))},{})},Sw=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)}},JH=function(e){var r=e.x1,n=e.y1,i=e.x2,a=e.y2;return Sw({x:r,y:n},{x:i,y:a})},Aw=function(){function t(e){GH(this,t),this.scale=e}return YH(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 s=this.bandwidth?this.bandwidth():0;return this.scale(r)+s}default:return this.scale(r)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+l}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)}}])}();rl(Aw,"EPS",1e-4);var Gf=function(e){var r=Object.keys(e).reduce(function(n,i){return Mt(Mt({},n),{},rl({},i,Aw.create(e[i])))},{});return Mt(Mt({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,s=a.position;return gH(i,function(l,u){return r[u].apply(l,{bandAware:o,position:s})})},isInRange:function(i){return hw(i,function(a,o){return r[o].isInRange(a)})}})};function ZH(t){return(t%180+180)%180}var QH=function(e){var r=e.width,n=e.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=ZH(i),o=a*Math.PI/180,s=Math.atan(n/r),l=o>s&&o<Math.PI-s?n/Math.sin(o):r/Math.cos(o);return Math.abs(l)},e8=Bt,t8=Gi,r8=Fo;function n8(t){return function(e,r,n){var i=Object(e);if(!t8(e)){var a=e8(r);e=r8(e),r=function(s){return a(i[s],s,i)}}var o=t(e,r,n);return o>-1?i[a?e[o]:o]:void 0}}var i8=n8,a8=nw;function o8(t){var e=a8(t),r=e%1;return e===e?r?e-r:e:0}var s8=o8,l8=yy,u8=Bt,c8=s8,f8=Math.max;function d8(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:c8(r);return i<0&&(i=f8(n+i,0)),l8(t,u8(e),i)}var h8=d8,p8=i8,v8=h8,y8=p8(v8),g8=y8;const m8=we(g8);var b8=RE(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("")});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)}var Yf=x.createContext(void 0),Xf=x.createContext(void 0),Pw=x.createContext(void 0),Ew=x.createContext({}),Tw=x.createContext(void 0),$w=x.createContext(0),jw=x.createContext(0),kw=function(e){var r=e.state,n=r.xAxisMap,i=r.yAxisMap,a=r.offset,o=e.clipPathId,s=e.children,l=e.width,u=e.height,c=b8(a);return x.createElement(Yf.Provider,{value:n},x.createElement(Xf.Provider,{value:i},x.createElement(Ew.Provider,{value:a},x.createElement(Pw.Provider,{value:c},x.createElement(Tw.Provider,{value:o},x.createElement($w.Provider,{value:u},x.createElement(jw.Provider,{value:l},s)))))))},w8=function(){return x.useContext(Tw)};function Cw(t){var e=Object.keys(t);return e.length===0?"There are no available ids.":"Available ids are: ".concat(e,".")}var Iw=function(e){var r=x.useContext(Yf);r==null&&(process.env.NODE_ENV!=="production"?st(!1,"Could not find Recharts context; are you sure this is rendered inside a Recharts wrapper component?"):st());var n=r[e];return n==null&&(process.env.NODE_ENV!=="production"?st(!1,'Could not find xAxis by id "'.concat(e,'" [').concat(nl(e),"]. ").concat(Cw(r))):st()),n},_8=function(){var e=x.useContext(Yf);return gr(e)},x8=function(){var e=x.useContext(Xf),r=m8(e,function(n){return hw(n.domain,Number.isFinite)});return r||gr(e)},Nw=function(e){var r=x.useContext(Xf);r==null&&(process.env.NODE_ENV!=="production"?st(!1,"Could not find Recharts context; are you sure this is rendered inside a Recharts wrapper component?"):st());var n=r[e];return n==null&&(process.env.NODE_ENV!=="production"?st(!1,'Could not find yAxis by id "'.concat(e,'" [').concat(nl(e),"]. ").concat(Cw(r))):st()),n},O8=function(){var e=x.useContext(Pw);return e},S8=function(){return x.useContext(Ew)},Jf=function(){return x.useContext(jw)},Zf=function(){return x.useContext($w)};function yi(t){"@babel/helpers - typeof";return yi=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},yi(t)}function A8(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function P8(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,Bw(n.key),n)}}function E8(t,e,r){return e&&P8(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function T8(t,e,r){return e=il(e),$8(t,Mw()?Reflect.construct(e,r||[],il(t).constructor):e.apply(t,r))}function $8(t,e){if(e&&(yi(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return j8(t)}function j8(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Mw(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Mw=function(){return!!t})()}function il(t){return il=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},il(t)}function k8(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&&Qf(t,e)}function Qf(t,e){return Qf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Qf(t,e)}function Dw(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 Lw(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Dw(Object(r),!0).forEach(function(n){ed(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Dw(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ed(t,e,r){return e=Bw(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Bw(t){var e=C8(t,"string");return yi(e)=="symbol"?e:e+""}function C8(t,e){if(yi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(yi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function I8(t,e){return L8(t)||D8(t,e)||M8(t,e)||N8()}function N8(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
135
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function M8(t,e){if(t){if(typeof t=="string")return Rw(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 Rw(t,e)}}function Rw(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 D8(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,s=[],l=!0,u=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}function L8(t){if(Array.isArray(t))return t}function td(){return td=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},td.apply(this,arguments)}var B8=function(e,r){var n;return x.isValidElement(e)?n=x.cloneElement(e,r):te(e)?n=e(r):n=x.createElement("line",td({},r,{className:"recharts-reference-line-line"})),n},R8=function(e,r,n,i,a,o,s,l,u){var c=a.x,f=a.y,d=a.width,h=a.height;if(n){var y=u.y,v=e.y.apply(y,{position:o});if(qt(u,"discard")&&!e.y.isInRange(v))return null;var p=[{x:c+d,y:v},{x:c,y:v}];return l==="left"?p.reverse():p}if(r){var m=u.x,w=e.x.apply(m,{position:o});if(qt(u,"discard")&&!e.x.isInRange(w))return null;var b=[{x:w,y:f+h},{x:w,y:f}];return s==="top"?b.reverse():b}if(i){var O=u.segment,g=O.map(function(_){return e.apply(_,{position:o})});return qt(u,"discard")&&uH(g,function(_){return!e.isInRange(_)})?null:g}return null};function U8(t){var e=t.x,r=t.y,n=t.segment,i=t.xAxisId,a=t.yAxisId,o=t.shape,s=t.className,l=t.alwaysShow,u=w8(),c=Iw(i),f=Nw(a),d=O8();if(!u||!d)return null;jt(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var h=Gf({x:c.scale,y:f.scale}),y=Ue(e),v=Ue(r),p=n&&n.length===2,m=R8(h,y,v,p,d,t.position,c.orientation,f.orientation,t);if(!m)return null;var w=I8(m,2),b=w[0],O=b.x,g=b.y,_=w[1],S=_.x,A=_.y,E=qt(t,"hidden")?"url(#".concat(u,")"):void 0,I=Lw(Lw({clipPath:E},X(t,!0)),{},{x1:O,y1:g,x2:S,y2:A});return x.createElement(ce,{className:ie("recharts-reference-line",s)},B8(o,I),Ve.renderCallByParent(t,JH({x1:O,y1:g,x2:S,y2:A})))}var rd=function(t){function e(){return A8(this,e),T8(this,e,arguments)}return k8(e,t),E8(e,[{key:"render",value:function(){return x.createElement(U8,this.props)}}])}(x.Component);ed(rd,"displayName","ReferenceLine"),ed(rd,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function nd(){return nd=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},nd.apply(this,arguments)}function gi(t){"@babel/helpers - typeof";return gi=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},gi(t)}function Uw(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 Fw(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Uw(Object(r),!0).forEach(function(n){ol(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Uw(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function F8(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function W8(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,qw(n.key),n)}}function q8(t,e,r){return e&&W8(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function z8(t,e,r){return e=al(e),K8(t,Ww()?Reflect.construct(e,r||[],al(t).constructor):e.apply(t,r))}function K8(t,e){if(e&&(gi(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return V8(t)}function V8(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ww(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ww=function(){return!!t})()}function al(t){return al=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},al(t)}function H8(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&&id(t,e)}function id(t,e){return id=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},id(t,e)}function ol(t,e,r){return e=qw(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qw(t){var e=G8(t,"string");return gi(e)=="symbol"?e:e+""}function G8(t,e){if(gi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(gi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Y8=function(e){var r=e.x,n=e.y,i=e.xAxis,a=e.yAxis,o=Gf({x:i.scale,y:a.scale}),s=o.apply({x:r,y:n},{bandAware:!0});return qt(e,"discard")&&!o.isInRange(s)?null:s},sl=function(t){function e(){return F8(this,e),z8(this,e,arguments)}return H8(e,t),q8(e,[{key:"render",value:function(){var n=this.props,i=n.x,a=n.y,o=n.r,s=n.alwaysShow,l=n.clipPathId,u=Ue(i),c=Ue(a);if(jt(s===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!c)return null;var f=Y8(this.props);if(!f)return null;var d=f.x,h=f.y,y=this.props,v=y.shape,p=y.className,m=qt(this.props,"hidden")?"url(#".concat(l,")"):void 0,w=Fw(Fw({clipPath:m},X(this.props,!0)),{},{cx:d,cy:h});return x.createElement(ce,{className:ie("recharts-reference-dot",p)},e.renderDot(v,w),Ve.renderCallByParent(this.props,{x:d-o,y:h-o,width:2*o,height:2*o}))}}])}(x.Component);ol(sl,"displayName","ReferenceDot"),ol(sl,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1}),ol(sl,"renderDot",function(t,e){var r;return x.isValidElement(t)?r=x.cloneElement(t,e):te(t)?r=t(e):r=x.createElement(ii,nd({},e,{cx:e.cx,cy:e.cy,className:"recharts-reference-dot-dot"})),r});function ad(){return ad=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},ad.apply(this,arguments)}function mi(t){"@babel/helpers - typeof";return mi=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},mi(t)}function zw(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 Kw(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?zw(Object(r),!0).forEach(function(n){ul(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):zw(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function X8(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function J8(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,Hw(n.key),n)}}function Z8(t,e,r){return e&&J8(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Q8(t,e,r){return e=ll(e),eG(t,Vw()?Reflect.construct(e,r||[],ll(t).constructor):e.apply(t,r))}function eG(t,e){if(e&&(mi(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tG(t)}function tG(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Vw(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Vw=function(){return!!t})()}function ll(t){return ll=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ll(t)}function rG(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&&od(t,e)}function od(t,e){return od=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},od(t,e)}function ul(t,e,r){return e=Hw(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Hw(t){var e=nG(t,"string");return mi(e)=="symbol"?e:e+""}function nG(t,e){if(mi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(mi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var iG=function(e,r,n,i,a){var o=a.x1,s=a.x2,l=a.y1,u=a.y2,c=a.xAxis,f=a.yAxis;if(!c||!f)return null;var d=Gf({x:c.scale,y:f.scale}),h={x:e?d.x.apply(o,{position:"start"}):d.x.rangeMin,y:n?d.y.apply(l,{position:"start"}):d.y.rangeMin},y={x:r?d.x.apply(s,{position:"end"}):d.x.rangeMax,y:i?d.y.apply(u,{position:"end"}):d.y.rangeMax};return qt(a,"discard")&&(!d.isInRange(h)||!d.isInRange(y))?null:Sw(h,y)},cl=function(t){function e(){return X8(this,e),Q8(this,e,arguments)}return rG(e,t),Z8(e,[{key:"render",value:function(){var n=this.props,i=n.x1,a=n.x2,o=n.y1,s=n.y2,l=n.className,u=n.alwaysShow,c=n.clipPathId;jt(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=Ue(i),d=Ue(a),h=Ue(o),y=Ue(s),v=this.props.shape;if(!f&&!d&&!h&&!y&&!v)return null;var p=iG(f,d,h,y,this.props);if(!p&&!v)return null;var m=qt(this.props,"hidden")?"url(#".concat(c,")"):void 0;return x.createElement(ce,{className:ie("recharts-reference-area",l)},e.renderRect(v,Kw(Kw({clipPath:m},X(this.props,!0)),p)),Ve.renderCallByParent(this.props,p))}}])}(x.Component);ul(cl,"displayName","ReferenceArea"),ul(cl,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1}),ul(cl,"renderRect",function(t,e){var r;return x.isValidElement(t)?r=x.cloneElement(t,e):te(t)?r=t(e):r=x.createElement(Nf,ad({},e,{className:"recharts-reference-area-rect"})),r});function Gw(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 aG(t,e,r){var n={width:t.width+e.width,height:t.height+e.height};return QH(n,r)}function oG(t,e,r){var n=r==="width",i=t.x,a=t.y,o=t.width,s=t.height;return e===1?{start:n?i:a,end:n?i+o:a+s}:{start:n?i+o:a+s,end:n?i:a}}function fl(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 sG(t,e){return Gw(t,e+1)}function lG(t,e,r,n,i){for(var a=(n||[]).slice(),o=e.start,s=e.end,l=0,u=1,c=o,f=function(){var y=n==null?void 0:n[l];if(y===void 0)return{v:Gw(n,u)};var v=l,p,m=function(){return p===void 0&&(p=r(y,v)),p},w=y.coordinate,b=l===0||fl(t,w,m,c,s);b||(l=0,c=o,u+=1),b&&(c=w+t*(m()/2+i),l+=u)},d;u<=a.length;)if(d=f(),d)return d.v;return[]}function Ga(t){"@babel/helpers - typeof";return Ga=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},Ga(t)}function Yw(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 Xe(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Yw(Object(r),!0).forEach(function(n){uG(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Yw(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function uG(t,e,r){return e=cG(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function cG(t){var e=fG(t,"string");return Ga(e)=="symbol"?e:e+""}function fG(t,e){if(Ga(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ga(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function dG(t,e,r,n,i){for(var a=(n||[]).slice(),o=a.length,s=e.start,l=e.end,u=function(d){var h=a[d],y,v=function(){return y===void 0&&(y=r(h,d)),y};if(d===o-1){var p=t*(h.coordinate+t*v()/2-l);a[d]=h=Xe(Xe({},h),{},{tickCoord:p>0?h.coordinate-p*t:h.coordinate})}else a[d]=h=Xe(Xe({},h),{},{tickCoord:h.coordinate});var m=fl(t,h.tickCoord,v,s,l);m&&(l=h.tickCoord-t*(v()/2+i),a[d]=Xe(Xe({},h),{},{isShow:!0}))},c=o-1;c>=0;c--)u(c);return a}function hG(t,e,r,n,i,a){var o=(n||[]).slice(),s=o.length,l=e.start,u=e.end;if(a){var c=n[s-1],f=r(c,s-1),d=t*(c.coordinate+t*f/2-u);o[s-1]=c=Xe(Xe({},c),{},{tickCoord:d>0?c.coordinate-d*t:c.coordinate});var h=fl(t,c.tickCoord,function(){return f},l,u);h&&(u=c.tickCoord-t*(f/2+i),o[s-1]=Xe(Xe({},c),{},{isShow:!0}))}for(var y=a?s-1:s,v=function(w){var b=o[w],O,g=function(){return O===void 0&&(O=r(b,w)),O};if(w===0){var _=t*(b.coordinate-t*g()/2-l);o[w]=b=Xe(Xe({},b),{},{tickCoord:_<0?b.coordinate-_*t:b.coordinate})}else o[w]=b=Xe(Xe({},b),{},{tickCoord:b.coordinate});var S=fl(t,b.tickCoord,g,l,u);S&&(l=b.tickCoord+t*(g()/2+i),o[w]=Xe(Xe({},b),{},{isShow:!0}))},p=0;p<y;p++)v(p);return o}function sd(t,e,r){var n=t.tick,i=t.ticks,a=t.viewBox,o=t.minTickGap,s=t.orientation,l=t.interval,u=t.tickFormatter,c=t.unit,f=t.angle;if(!i||!i.length||!n)return[];if(z(l)||wt.isSsr)return sG(i,typeof l=="number"&&z(l)?l:0);var d=[],h=s==="top"||s==="bottom"?"width":"height",y=c&&h==="width"?ea(c,{fontSize:e,letterSpacing:r}):{width:0,height:0},v=function(b,O){var g=te(u)?u(b.value,O):b.value;return h==="width"?aG(ea(g,{fontSize:e,letterSpacing:r}),y,f):ea(g,{fontSize:e,letterSpacing:r})[h]},p=i.length>=2?tt(i[1].coordinate-i[0].coordinate):1,m=oG(a,p,h);return l==="equidistantPreserveStart"?lG(p,m,v,i,o):(l==="preserveStart"||l==="preserveStartEnd"?d=hG(p,m,v,i,o,l==="preserveStartEnd"):d=dG(p,m,v,i,o),d.filter(function(w){return w.isShow}))}var pG=["viewBox"],vG=["viewBox"],yG=["ticks"];function bi(t){"@babel/helpers - typeof";return bi=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},bi(t)}function wi(){return wi=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},wi.apply(this,arguments)}function Xw(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 qe(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Xw(Object(r),!0).forEach(function(n){cd(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Xw(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ld(t,e){if(t==null)return{};var r=gG(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 gG(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 mG(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Jw(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,Qw(n.key),n)}}function bG(t,e,r){return e&&Jw(t.prototype,e),r&&Jw(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function wG(t,e,r){return e=dl(e),_G(t,Zw()?Reflect.construct(e,r||[],dl(t).constructor):e.apply(t,r))}function _G(t,e){if(e&&(bi(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xG(t)}function xG(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Zw(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Zw=function(){return!!t})()}function dl(t){return dl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},dl(t)}function OG(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&&ud(t,e)}function ud(t,e){return ud=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ud(t,e)}function cd(t,e,r){return e=Qw(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qw(t){var e=SG(t,"string");return bi(e)=="symbol"?e:e+""}function SG(t,e){if(bi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(bi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var _i=function(t){function e(r){var n;return mG(this,e),n=wG(this,e,[r]),n.state={fontSize:"",letterSpacing:""},n}return OG(e,t),bG(e,[{key:"shouldComponentUpdate",value:function(n,i){var a=n.viewBox,o=ld(n,pG),s=this.props,l=s.viewBox,u=ld(s,vG);return!Mn(a,l)||!Mn(o,u)||!Mn(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,s=i.width,l=i.height,u=i.orientation,c=i.tickSize,f=i.mirror,d=i.tickMargin,h,y,v,p,m,w,b=f?-1:1,O=n.tickSize||c,g=z(n.tickCoord)?n.tickCoord:n.coordinate;switch(u){case"top":h=y=n.coordinate,p=o+ +!f*l,v=p-b*O,w=v-b*d,m=g;break;case"left":v=p=n.coordinate,y=a+ +!f*s,h=y-b*O,m=h-b*d,w=g;break;case"right":v=p=n.coordinate,y=a+ +f*s,h=y+b*O,m=h+b*d,w=g;break;default:h=y=n.coordinate,p=o+ +f*l,v=p+b*O,w=v+b*d,m=g;break}return{line:{x1:h,y1:v,x2:y,y2:p},tick:{x:m,y:w}}}},{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,s=n.height,l=n.orientation,u=n.mirror,c=n.axisLine,f=qe(qe(qe({},X(this.props,!1)),X(c,!1)),{},{fill:"none"});if(l==="top"||l==="bottom"){var d=+(l==="top"&&!u||l==="bottom"&&u);f=qe(qe({},f),{},{x1:i,y1:a+d*s,x2:i+o,y2:a+d*s})}else{var h=+(l==="left"&&!u||l==="right"&&u);f=qe(qe({},f),{},{x1:i+h*o,y1:a,x2:i+h*o,y2:a+s})}return x.createElement("line",wi({},f,{className:ie("recharts-cartesian-axis-line",ct(c,"className"))}))}},{key:"renderTicks",value:function(n,i,a){var o=this,s=this.props,l=s.tickLine,u=s.stroke,c=s.tick,f=s.tickFormatter,d=s.unit,h=sd(qe(qe({},this.props),{},{ticks:n}),i,a),y=this.getTickTextAnchor(),v=this.getTickVerticalAnchor(),p=X(this.props,!1),m=X(c,!1),w=qe(qe({},p),{},{fill:"none"},X(l,!1)),b=h.map(function(O,g){var _=o.getTickLineCoord(O),S=_.line,A=_.tick,E=qe(qe(qe(qe({textAnchor:y,verticalAnchor:v},p),{},{stroke:"none",fill:u},m),A),{},{index:g,payload:O,visibleTicksCount:h.length,tickFormatter:f});return x.createElement(ce,wi({className:"recharts-cartesian-axis-tick",key:"tick-".concat(O.value,"-").concat(O.coordinate,"-").concat(O.tickCoord)},qr(o.props,O,g)),l&&x.createElement("line",wi({},w,S,{className:ie("recharts-cartesian-axis-tick-line",ct(l,"className"))})),c&&e.renderTickItem(c,E,"".concat(te(f)?f(O.value,g):O.value).concat(d||"")))});return x.createElement("g",{className:"recharts-cartesian-axis-ticks"},b)}},{key:"render",value:function(){var n=this,i=this.props,a=i.axisLine,o=i.width,s=i.height,l=i.ticksGenerator,u=i.className,c=i.hide;if(c)return null;var f=this.props,d=f.ticks,h=ld(f,yG),y=d;return te(l)&&(y=d&&d.length>0?l(this.props):l(h)),o<=0||s<=0||!y||!y.length?null:x.createElement(ce,{className:ie("recharts-cartesian-axis",u),ref:function(p){n.layerReference=p}},a&&this.renderAxisLine(),this.renderTicks(y,this.state.fontSize,this.state.letterSpacing),Ve.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var o,s=ie(i.className,"recharts-cartesian-axis-tick-value");return x.isValidElement(n)?o=x.cloneElement(n,qe(qe({},i),{},{className:s})):te(n)?o=n(qe(qe({},i),{},{className:s})):o=x.createElement(Hr,wi({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(x.Component);cd(_i,"displayName","CartesianAxis"),cd(_i,"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 AG=["x1","y1","x2","y2","key"],PG=["offset"];function cn(t){"@babel/helpers - typeof";return cn=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},cn(t)}function e_(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 Je(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?e_(Object(r),!0).forEach(function(n){EG(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e_(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function EG(t,e,r){return e=TG(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function TG(t){var e=$G(t,"string");return cn(e)=="symbol"?e:e+""}function $G(t,e){if(cn(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(cn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function fn(){return fn=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},fn.apply(this,arguments)}function t_(t,e){if(t==null)return{};var r=jG(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 jG(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 kG=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,s=e.height,l=e.ry;return x.createElement("rect",{x:i,y:a,ry:l,width:o,height:s,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function r_(t,e){var r;if(x.isValidElement(t))r=x.cloneElement(t,e);else if(te(t))r=t(e);else{var n=e.x1,i=e.y1,a=e.x2,o=e.y2,s=e.key,l=t_(e,AG),u=X(l,!1);u.offset;var c=t_(u,PG);r=x.createElement("line",fn({},c,{x1:n,y1:i,x2:a,y2:o,fill:"none",key:s}))}return r}function CG(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(s,l){var u=Je(Je({},t),{},{x1:e,y1:s,x2:e+r,y2:s,key:"line-".concat(l),index:l});return r_(i,u)});return x.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function IG(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(s,l){var u=Je(Je({},t),{},{x1:s,y1:e,x2:s,y2:e+r,key:"line-".concat(l),index:l});return r_(i,u)});return x.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function NG(t){var e=t.horizontalFill,r=t.fillOpacity,n=t.x,i=t.y,a=t.width,o=t.height,s=t.horizontalPoints,l=t.horizontal,u=l===void 0?!0:l;if(!u||!e||!e.length)return null;var c=s.map(function(d){return Math.round(d+i-i)}).sort(function(d,h){return d-h});i!==c[0]&&c.unshift(0);var f=c.map(function(d,h){var y=!c[h+1],v=y?i+o-d:c[h+1]-d;if(v<=0)return null;var p=h%e.length;return x.createElement("rect",{key:"react-".concat(h),y:d,x:n,height:v,width:a,stroke:"none",fill:e[p],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function MG(t){var e=t.vertical,r=e===void 0?!0:e,n=t.verticalFill,i=t.fillOpacity,a=t.x,o=t.y,s=t.width,l=t.height,u=t.verticalPoints;if(!r||!n||!n.length)return null;var c=u.map(function(d){return Math.round(d+a-a)}).sort(function(d,h){return d-h});a!==c[0]&&c.unshift(0);var f=c.map(function(d,h){var y=!c[h+1],v=y?a+s-d:c[h+1]-d;if(v<=0)return null;var p=h%n.length;return x.createElement("rect",{key:"react-".concat(h),x:d,y:o,width:v,height:l,stroke:"none",fill:n[p],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var DG=function(e,r){var n=e.xAxis,i=e.width,a=e.height,o=e.offset;return sb(sd(Je(Je(Je({},_i.defaultProps),n),{},{ticks:ir(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.left,o.left+o.width,r)},LG=function(e,r){var n=e.yAxis,i=e.width,a=e.height,o=e.offset;return sb(sd(Je(Je(Je({},_i.defaultProps),n),{},{ticks:ir(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.top,o.top+o.height,r)},xi={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function hl(t){var e,r,n,i,a,o,s=Jf(),l=Zf(),u=S8(),c=Je(Je({},t),{},{stroke:(e=t.stroke)!==null&&e!==void 0?e:xi.stroke,fill:(r=t.fill)!==null&&r!==void 0?r:xi.fill,horizontal:(n=t.horizontal)!==null&&n!==void 0?n:xi.horizontal,horizontalFill:(i=t.horizontalFill)!==null&&i!==void 0?i:xi.horizontalFill,vertical:(a=t.vertical)!==null&&a!==void 0?a:xi.vertical,verticalFill:(o=t.verticalFill)!==null&&o!==void 0?o:xi.verticalFill,x:z(t.x)?t.x:u.left,y:z(t.y)?t.y:u.top,width:z(t.width)?t.width:u.width,height:z(t.height)?t.height:u.height}),f=c.x,d=c.y,h=c.width,y=c.height,v=c.syncWithTicks,p=c.horizontalValues,m=c.verticalValues,w=_8(),b=x8();if(!z(h)||h<=0||!z(y)||y<=0||!z(f)||f!==+f||!z(d)||d!==+d)return null;var O=c.verticalCoordinatesGenerator||DG,g=c.horizontalCoordinatesGenerator||LG,_=c.horizontalPoints,S=c.verticalPoints;if((!_||!_.length)&&te(g)){var A=p&&p.length,E=g({yAxis:b?Je(Je({},b),{},{ticks:A?p:b.ticks}):void 0,width:s,height:l,offset:u},A?!0:v);jt(Array.isArray(E),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(cn(E),"]")),Array.isArray(E)&&(_=E)}if((!S||!S.length)&&te(O)){var I=m&&m.length,T=O({xAxis:w?Je(Je({},w),{},{ticks:I?m:w.ticks}):void 0,width:s,height:l,offset:u},I?!0:v);jt(Array.isArray(T),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(cn(T),"]")),Array.isArray(T)&&(S=T)}return x.createElement("g",{className:"recharts-cartesian-grid"},x.createElement(kG,{fill:c.fill,fillOpacity:c.fillOpacity,x:c.x,y:c.y,width:c.width,height:c.height,ry:c.ry}),x.createElement(CG,fn({},c,{offset:u,horizontalPoints:_,xAxis:w,yAxis:b})),x.createElement(IG,fn({},c,{offset:u,verticalPoints:S,xAxis:w,yAxis:b})),x.createElement(NG,fn({},c,{horizontalPoints:_})),x.createElement(MG,fn({},c,{verticalPoints:S})))}hl.displayName="CartesianGrid";var BG=["type","layout","connectNulls","ref"],RG=["key"];function Oi(t){"@babel/helpers - typeof";return Oi=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},Oi(t)}function n_(t,e){if(t==null)return{};var r=UG(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 UG(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 Ya(){return Ya=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},Ya.apply(this,arguments)}function i_(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 vt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?i_(Object(r),!0).forEach(function(n){Dt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i_(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Si(t){return zG(t)||qG(t)||WG(t)||FG()}function FG(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
136
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WG(t,e){if(t){if(typeof t=="string")return fd(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 fd(t,e)}}function qG(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function zG(t){if(Array.isArray(t))return fd(t)}function fd(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 KG(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a_(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,s_(n.key),n)}}function VG(t,e,r){return e&&a_(t.prototype,e),r&&a_(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function HG(t,e,r){return e=pl(e),GG(t,o_()?Reflect.construct(e,r||[],pl(t).constructor):e.apply(t,r))}function GG(t,e){if(e&&(Oi(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return YG(t)}function YG(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function o_(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(o_=function(){return!!t})()}function pl(t){return pl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},pl(t)}function XG(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&&dd(t,e)}function dd(t,e){return dd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},dd(t,e)}function Dt(t,e,r){return e=s_(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function s_(t){var e=JG(t,"string");return Oi(e)=="symbol"?e:e+""}function JG(t,e){if(Oi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Oi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Xa=function(t){function e(){var r;KG(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=HG(this,e,[].concat(i)),Dt(r,"state",{isAnimationFinished:!0,totalLength:0}),Dt(r,"generateSimpleStrokeDasharray",function(o,s){return"".concat(s,"px ").concat(o-s,"px")}),Dt(r,"getStrokeDasharray",function(o,s,l){var u=l.reduce(function(m,w){return m+w});if(!u)return r.generateSimpleStrokeDasharray(s,o);for(var c=Math.floor(o/u),f=o%u,d=s-o,h=[],y=0,v=0;y<l.length;v+=l[y],++y)if(v+l[y]>f){h=[].concat(Si(l.slice(0,y)),[f-v]);break}var p=h.length%2===0?[0,d]:[d];return[].concat(Si(e.repeat(l,c)),Si(h),p).map(function(m){return"".concat(m,"px")}).join(", ")}),Dt(r,"id",Wr("recharts-line-")),Dt(r,"pathRef",function(o){r.mainCurve=o}),Dt(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Dt(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return XG(e,t),VG(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,s=a.xAxis,l=a.yAxis,u=a.layout,c=a.children,f=ft(c,ma);if(!f)return null;var d=function(v,p){return{x:v.x,y:v.y,value:v.value,errorVal:Ne(v.payload,p)}},h={clipPath:n?"url(#clipPath-".concat(i,")"):null};return x.createElement(ce,h,f.map(function(y){return x.cloneElement(y,{key:"bar-".concat(y.props.dataKey),data:o,xAxis:s,yAxis:l,layout:u,dataPointFormatter:d})}))}},{key:"renderDots",value:function(n,i,a){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var s=this.props,l=s.dot,u=s.points,c=s.dataKey,f=X(this.props,!1),d=X(l,!0),h=u.map(function(v,p){var m=vt(vt(vt({key:"dot-".concat(p),r:3},f),d),{},{index:p,cx:v.x,cy:v.y,value:v.value,dataKey:c,payload:v.payload,points:u});return e.renderDotItem(l,m)}),y={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return x.createElement(ce,Ya({className:"recharts-line-dots",key:"dots"},y),h)}},{key:"renderCurveStatically",value:function(n,i,a,o){var s=this.props,l=s.type,u=s.layout,c=s.connectNulls;s.ref;var f=n_(s,BG),d=vt(vt(vt({},X(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:n},o),{},{type:l,layout:u,connectNulls:c});return x.createElement(nn,Ya({},d,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var a=this,o=this.props,s=o.points,l=o.strokeDasharray,u=o.isAnimationActive,c=o.animationBegin,f=o.animationDuration,d=o.animationEasing,h=o.animationId,y=o.animateNewValues,v=o.width,p=o.height,m=this.state,w=m.prevPoints,b=m.totalLength;return x.createElement(St,{begin:c,duration:f,isActive:u,easing:d,from:{t:0},to:{t:1},key:"line-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(O){var g=O.t;if(w){var _=w.length/s.length,S=s.map(function($,k){var C=Math.floor(k*_);if(w[C]){var D=w[C],N=Ie(D.x,$.x),L=Ie(D.y,$.y);return vt(vt({},$),{},{x:N(g),y:L(g)})}if(y){var W=Ie(v*2,$.x),q=Ie(p/2,$.y);return vt(vt({},$),{},{x:W(g),y:q(g)})}return vt(vt({},$),{},{x:$.x,y:$.y})});return a.renderCurveStatically(S,n,i)}var A=Ie(0,b),E=A(g),I;if(l){var T="".concat(l).split(/[,\s]+/gim).map(function($){return parseFloat($)});I=a.getStrokeDasharray(E,b,T)}else I=a.generateSimpleStrokeDasharray(b,E);return a.renderCurveStatically(s,n,i,{strokeDasharray:I})})}},{key:"renderCurve",value:function(n,i){var a=this.props,o=a.points,s=a.isAnimationActive,l=this.state,u=l.prevPoints,c=l.totalLength;return s&&o&&o.length&&(!u&&c>0||!xr(u,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,s=i.points,l=i.className,u=i.xAxis,c=i.yAxis,f=i.top,d=i.left,h=i.width,y=i.height,v=i.isAnimationActive,p=i.id;if(a||!s||!s.length)return null;var m=this.state.isAnimationFinished,w=s.length===1,b=ie("recharts-line",l),O=u&&u.allowDataOverflow,g=c&&c.allowDataOverflow,_=O||g,S=se(p)?this.id:p,A=(n=X(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},E=A.r,I=E===void 0?3:E,T=A.strokeWidth,$=T===void 0?2:T,k=Zp(o)?o:{},C=k.clipDot,D=C===void 0?!0:C,N=I*2+$;return x.createElement(ce,{className:b},O||g?x.createElement("defs",null,x.createElement("clipPath",{id:"clipPath-".concat(S)},x.createElement("rect",{x:O?d:d-h/2,y:g?f:f-y/2,width:O?h:h*2,height:g?y:y*2})),!D&&x.createElement("clipPath",{id:"clipPath-dots-".concat(S)},x.createElement("rect",{x:d-N/2,y:f-N/2,width:h+N,height:y+N}))):null,!w&&this.renderCurve(_,S),this.renderErrorBar(_,S),(w||o)&&this.renderDots(_,D,S),(!v||m)&&It.renderCallByParent(this.props,s))}}],[{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(Si(n),[0]):n,o=[],s=0;s<i;++s)o=[].concat(Si(o),Si(a));return o}},{key:"renderDotItem",value:function(n,i){var a;if(x.isValidElement(n))a=x.cloneElement(n,i);else if(te(n))a=n(i);else{var o=i.key,s=n_(i,RG),l=ie("recharts-line-dot",typeof n!="boolean"?n.className:"");a=x.createElement(ii,Ya({key:o},s,{className:l}))}return a}}])}(x.PureComponent);Dt(Xa,"displayName","Line"),Dt(Xa,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!wt.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1}),Dt(Xa,"getComposedData",function(t){var e=t.props,r=t.xAxis,n=t.yAxis,i=t.xAxisTicks,a=t.yAxisTicks,o=t.dataKey,s=t.bandSize,l=t.displayedData,u=t.offset,c=e.layout,f=l.map(function(d,h){var y=Ne(d,o);return c==="horizontal"?{x:Ps({axis:r,ticks:i,bandSize:s,entry:d,index:h}),y:se(y)?null:n.scale(y),value:y,payload:d}:{x:se(y)?null:r.scale(y),y:Ps({axis:n,ticks:a,bandSize:s,entry:d,index:h}),value:y,payload:d}});return vt({points:f,layout:c},u)});var ZG=["layout","type","stroke","connectNulls","isRange","ref"],QG=["key"],l_;function Ai(t){"@babel/helpers - typeof";return Ai=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},Ai(t)}function u_(t,e){if(t==null)return{};var r=e6(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 e6(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 dn(){return dn=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},dn.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 Pr(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){zt(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 t6(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f_(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,h_(n.key),n)}}function r6(t,e,r){return e&&f_(t.prototype,e),r&&f_(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function n6(t,e,r){return e=vl(e),i6(t,d_()?Reflect.construct(e,r||[],vl(t).constructor):e.apply(t,r))}function i6(t,e){if(e&&(Ai(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return a6(t)}function a6(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function d_(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(d_=function(){return!!t})()}function vl(t){return vl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},vl(t)}function o6(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&&hd(t,e)}function hd(t,e){return hd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},hd(t,e)}function zt(t,e,r){return e=h_(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function h_(t){var e=s6(t,"string");return Ai(e)=="symbol"?e:e+""}function s6(t,e){if(Ai(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ai(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Er=function(t){function e(){var r;t6(this,e);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return r=n6(this,e,[].concat(i)),zt(r,"state",{isAnimationFinished:!0}),zt(r,"id",Wr("recharts-area-")),zt(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),te(o)&&o()}),zt(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),te(o)&&o()}),r}return o6(e,t),r6(e,[{key:"renderDots",value:function(n,i,a){var o=this.props.isAnimationActive,s=this.state.isAnimationFinished;if(o&&!s)return null;var l=this.props,u=l.dot,c=l.points,f=l.dataKey,d=X(this.props,!1),h=X(u,!0),y=c.map(function(p,m){var w=Pr(Pr(Pr({key:"dot-".concat(m),r:3},d),h),{},{index:m,cx:p.x,cy:p.y,dataKey:f,value:p.value,payload:p.payload,points:c});return e.renderDotItem(u,w)}),v={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return x.createElement(ce,dn({className:"recharts-area-dots"},v),y)}},{key:"renderHorizontalRect",value:function(n){var i=this.props,a=i.baseLine,o=i.points,s=i.strokeWidth,l=o[0].x,u=o[o.length-1].x,c=n*Math.abs(l-u),f=_r(o.map(function(d){return d.y||0}));return z(a)&&typeof a=="number"?f=Math.max(a,f):a&&Array.isArray(a)&&a.length&&(f=Math.max(_r(a.map(function(d){return d.y||0})),f)),z(f)?x.createElement("rect",{x:l<u?l:l-c,y:0,width:c,height:Math.floor(f+(s?parseInt("".concat(s),10):1))}):null}},{key:"renderVerticalRect",value:function(n){var i=this.props,a=i.baseLine,o=i.points,s=i.strokeWidth,l=o[0].y,u=o[o.length-1].y,c=n*Math.abs(l-u),f=_r(o.map(function(d){return d.x||0}));return z(a)&&typeof a=="number"?f=Math.max(a,f):a&&Array.isArray(a)&&a.length&&(f=Math.max(_r(a.map(function(d){return d.x||0})),f)),z(f)?x.createElement("rect",{x:0,y:l<u?l:l-c,width:f+(s?parseInt("".concat(s),10):1),height:Math.floor(c)}):null}},{key:"renderClipRect",value:function(n){var i=this.props.layout;return i==="vertical"?this.renderVerticalRect(n):this.renderHorizontalRect(n)}},{key:"renderAreaStatically",value:function(n,i,a,o){var s=this.props,l=s.layout,u=s.type,c=s.stroke,f=s.connectNulls,d=s.isRange;s.ref;var h=u_(s,ZG);return x.createElement(ce,{clipPath:a?"url(#clipPath-".concat(o,")"):null},x.createElement(nn,dn({},X(h,!0),{points:n,connectNulls:f,type:u,baseLine:i,layout:l,stroke:"none",className:"recharts-area-area"})),c!=="none"&&x.createElement(nn,dn({},X(this.props,!1),{className:"recharts-area-curve",layout:l,type:u,connectNulls:f,fill:"none",points:n})),c!=="none"&&d&&x.createElement(nn,dn({},X(this.props,!1),{className:"recharts-area-curve",layout:l,type:u,connectNulls:f,fill:"none",points:i})))}},{key:"renderAreaWithAnimation",value:function(n,i){var a=this,o=this.props,s=o.points,l=o.baseLine,u=o.isAnimationActive,c=o.animationBegin,f=o.animationDuration,d=o.animationEasing,h=o.animationId,y=this.state,v=y.prevPoints,p=y.prevBaseLine;return x.createElement(St,{begin:c,duration:f,isActive:u,easing:d,from:{t:0},to:{t:1},key:"area-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(m){var w=m.t;if(v){var b=v.length/s.length,O=s.map(function(A,E){var I=Math.floor(E*b);if(v[I]){var T=v[I],$=Ie(T.x,A.x),k=Ie(T.y,A.y);return Pr(Pr({},A),{},{x:$(w),y:k(w)})}return A}),g;if(z(l)&&typeof l=="number"){var _=Ie(p,l);g=_(w)}else if(se(l)||Nn(l)){var S=Ie(p,0);g=S(w)}else g=l.map(function(A,E){var I=Math.floor(E*b);if(p[I]){var T=p[I],$=Ie(T.x,A.x),k=Ie(T.y,A.y);return Pr(Pr({},A),{},{x:$(w),y:k(w)})}return A});return a.renderAreaStatically(O,g,n,i)}return x.createElement(ce,null,x.createElement("defs",null,x.createElement("clipPath",{id:"animationClipPath-".concat(i)},a.renderClipRect(w))),x.createElement(ce,{clipPath:"url(#animationClipPath-".concat(i,")")},a.renderAreaStatically(s,l,n,i)))})}},{key:"renderArea",value:function(n,i){var a=this.props,o=a.points,s=a.baseLine,l=a.isAnimationActive,u=this.state,c=u.prevPoints,f=u.prevBaseLine,d=u.totalLength;return l&&o&&o.length&&(!c&&d>0||!xr(c,o)||!xr(f,s))?this.renderAreaWithAnimation(n,i):this.renderAreaStatically(o,s,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,s=i.points,l=i.className,u=i.top,c=i.left,f=i.xAxis,d=i.yAxis,h=i.width,y=i.height,v=i.isAnimationActive,p=i.id;if(a||!s||!s.length)return null;var m=this.state.isAnimationFinished,w=s.length===1,b=ie("recharts-area",l),O=f&&f.allowDataOverflow,g=d&&d.allowDataOverflow,_=O||g,S=se(p)?this.id:p,A=(n=X(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},E=A.r,I=E===void 0?3:E,T=A.strokeWidth,$=T===void 0?2:T,k=Zp(o)?o:{},C=k.clipDot,D=C===void 0?!0:C,N=I*2+$;return x.createElement(ce,{className:b},O||g?x.createElement("defs",null,x.createElement("clipPath",{id:"clipPath-".concat(S)},x.createElement("rect",{x:O?c:c-h/2,y:g?u:u-y/2,width:O?h:h*2,height:g?y:y*2})),!D&&x.createElement("clipPath",{id:"clipPath-dots-".concat(S)},x.createElement("rect",{x:c-N/2,y:u-N/2,width:h+N,height:y+N}))):null,w?null:this.renderArea(_,S),(o||w)&&this.renderDots(_,D,S),(!v||m)&&It.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:n.points!==i.curPoints||n.baseLine!==i.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])}(x.PureComponent);l_=Er,zt(Er,"displayName","Area"),zt(Er,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!wt.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"}),zt(Er,"getBaseValue",function(t,e,r,n){var i=t.layout,a=t.baseValue,o=e.props.baseValue,s=o??a;if(z(s)&&typeof s=="number")return s;var l=i==="horizontal"?n:r,u=l.scale.domain();if(l.type==="number"){var c=Math.max(u[0],u[1]),f=Math.min(u[0],u[1]);return s==="dataMin"?f:s==="dataMax"||c<0?c:Math.max(Math.min(u[0],u[1]),0)}return s==="dataMin"?u[0]:s==="dataMax"?u[1]:u[0]}),zt(Er,"getComposedData",function(t){var e=t.props,r=t.item,n=t.xAxis,i=t.yAxis,a=t.xAxisTicks,o=t.yAxisTicks,s=t.bandSize,l=t.dataKey,u=t.stackedData,c=t.dataStartIndex,f=t.displayedData,d=t.offset,h=e.layout,y=u&&u.length,v=l_.getBaseValue(e,r,n,i),p=h==="horizontal",m=!1,w=f.map(function(O,g){var _;y?_=u[c+g]:(_=Ne(O,l),Array.isArray(_)?m=!0:_=[v,_]);var S=_[1]==null||y&&Ne(O,l)==null;return p?{x:Ps({axis:n,ticks:a,bandSize:s,entry:O,index:g}),y:S?null:i.scale(_[1]),value:_,payload:O}:{x:S?null:n.scale(_[1]),y:Ps({axis:i,ticks:o,bandSize:s,entry:O,index:g}),value:_,payload:O}}),b;return y||m?b=w.map(function(O){var g=Array.isArray(O.value)?O.value[0]:null;return p?{x:O.x,y:g!=null&&O.y!=null?i.scale(g):null}:{x:g!=null?n.scale(g):null,y:O.y}}):b=p?i.scale(v):n.scale(v),Pr({points:w,baseLine:b,layout:h,isRange:m},d)}),zt(Er,"renderDotItem",function(t,e){var r;if(x.isValidElement(t))r=x.cloneElement(t,e);else if(te(t))r=t(e);else{var n=ie("recharts-area-dot",typeof t!="boolean"?t.className:""),i=e.key,a=u_(e,QG);r=x.createElement(ii,dn({},a,{key:i,className:n}))}return r});function Pi(t){"@babel/helpers - typeof";return Pi=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},Pi(t)}function l6(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u6(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,y_(n.key),n)}}function c6(t,e,r){return e&&u6(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function f6(t,e,r){return e=yl(e),d6(t,p_()?Reflect.construct(e,r||[],yl(t).constructor):e.apply(t,r))}function d6(t,e){if(e&&(Pi(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return h6(t)}function h6(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 yl(t){return yl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},yl(t)}function p6(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&&pd(t,e)}function pd(t,e){return pd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},pd(t,e)}function v_(t,e,r){return e=y_(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function y_(t){var e=v6(t,"string");return Pi(e)=="symbol"?e:e+""}function v6(t,e){if(Pi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Pi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function vd(){return vd=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},vd.apply(this,arguments)}function y6(t){var e=t.xAxisId,r=Jf(),n=Zf(),i=Iw(e);return i==null?null:fe.createElement(_i,vd({},i,{className:ie("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(o){return ir(o,!0)}}))}var Tr=function(t){function e(){return l6(this,e),f6(this,e,arguments)}return p6(e,t),c6(e,[{key:"render",value:function(){return fe.createElement(y6,this.props)}}])}(fe.Component);v_(Tr,"displayName","XAxis"),v_(Tr,"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 Ei(t){"@babel/helpers - typeof";return Ei=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},Ei(t)}function g6(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function m6(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,b_(n.key),n)}}function b6(t,e,r){return e&&m6(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function w6(t,e,r){return e=gl(e),_6(t,g_()?Reflect.construct(e,r||[],gl(t).constructor):e.apply(t,r))}function _6(t,e){if(e&&(Ei(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return x6(t)}function x6(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function g_(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(g_=function(){return!!t})()}function gl(t){return gl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},gl(t)}function O6(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&&yd(t,e)}function yd(t,e){return yd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},yd(t,e)}function m_(t,e,r){return e=b_(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function b_(t){var e=S6(t,"string");return Ei(e)=="symbol"?e:e+""}function S6(t,e){if(Ei(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ei(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function gd(){return gd=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},gd.apply(this,arguments)}var A6=function(e){var r=e.yAxisId,n=Jf(),i=Zf(),a=Nw(r);return a==null?null:fe.createElement(_i,gd({},a,{className:ie("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:i},ticksGenerator:function(s){return ir(s,!0)}}))},$r=function(t){function e(){return g6(this,e),w6(this,e,arguments)}return O6(e,t),b6(e,[{key:"render",value:function(){return fe.createElement(A6,this.props)}}])}(fe.Component);m_($r,"displayName","YAxis"),m_($r,"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 w_(t){return $6(t)||T6(t)||E6(t)||P6()}function P6(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
137
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function E6(t,e){if(t){if(typeof t=="string")return md(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 md(t,e)}}function T6(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function $6(t){if(Array.isArray(t))return md(t)}function md(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 bd=function(e,r,n,i,a){var o=ft(e,rd),s=ft(e,sl),l=[].concat(w_(o),w_(s)),u=ft(e,cl),c="".concat(i,"Id"),f=i[0],d=r;if(l.length&&(d=l.reduce(function(v,p){if(p.props[c]===n&&qt(p.props,"extendDomain")&&z(p.props[f])){var m=p.props[f];return[Math.min(v[0],m),Math.max(v[1],m)]}return v},d)),u.length){var h="".concat(f,"1"),y="".concat(f,"2");d=u.reduce(function(v,p){if(p.props[c]===n&&qt(p.props,"extendDomain")&&z(p.props[h])&&z(p.props[y])){var m=p.props[h],w=p.props[y];return[Math.min(v[0],m,w),Math.max(v[1],m,w)]}return v},d)}return a&&a.length&&(d=a.reduce(function(v,p){return z(p)?[Math.min(v[0],p),Math.max(v[1],p)]:v},d)),d},__={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(l,u,c){this.fn=l,this.context=u,this.once=c||!1}function a(l,u,c,f,d){if(typeof c!="function")throw new TypeError("The listener must be a function");var h=new i(c,f||l,d),y=r?r+u:u;return l._events[y]?l._events[y].fn?l._events[y]=[l._events[y],h]:l._events[y].push(h):(l._events[y]=h,l._eventsCount++),l}function o(l,u){--l._eventsCount===0?l._events=new n:delete l._events[u]}function s(){this._events=new n,this._eventsCount=0}s.prototype.eventNames=function(){var u=[],c,f;if(this._eventsCount===0)return u;for(f in c=this._events)e.call(c,f)&&u.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(c)):u},s.prototype.listeners=function(u){var c=r?r+u:u,f=this._events[c];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,h=f.length,y=new Array(h);d<h;d++)y[d]=f[d].fn;return y},s.prototype.listenerCount=function(u){var c=r?r+u:u,f=this._events[c];return f?f.fn?1:f.length:0},s.prototype.emit=function(u,c,f,d,h,y){var v=r?r+u:u;if(!this._events[v])return!1;var p=this._events[v],m=arguments.length,w,b;if(p.fn){switch(p.once&&this.removeListener(u,p.fn,void 0,!0),m){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,c),!0;case 3:return p.fn.call(p.context,c,f),!0;case 4:return p.fn.call(p.context,c,f,d),!0;case 5:return p.fn.call(p.context,c,f,d,h),!0;case 6:return p.fn.call(p.context,c,f,d,h,y),!0}for(b=1,w=new Array(m-1);b<m;b++)w[b-1]=arguments[b];p.fn.apply(p.context,w)}else{var O=p.length,g;for(b=0;b<O;b++)switch(p[b].once&&this.removeListener(u,p[b].fn,void 0,!0),m){case 1:p[b].fn.call(p[b].context);break;case 2:p[b].fn.call(p[b].context,c);break;case 3:p[b].fn.call(p[b].context,c,f);break;case 4:p[b].fn.call(p[b].context,c,f,d);break;default:if(!w)for(g=1,w=new Array(m-1);g<m;g++)w[g-1]=arguments[g];p[b].fn.apply(p[b].context,w)}}return!0},s.prototype.on=function(u,c,f){return a(this,u,c,f,!1)},s.prototype.once=function(u,c,f){return a(this,u,c,f,!0)},s.prototype.removeListener=function(u,c,f,d){var h=r?r+u:u;if(!this._events[h])return this;if(!c)return o(this,h),this;var y=this._events[h];if(y.fn)y.fn===c&&(!d||y.once)&&(!f||y.context===f)&&o(this,h);else{for(var v=0,p=[],m=y.length;v<m;v++)(y[v].fn!==c||d&&!y[v].once||f&&y[v].context!==f)&&p.push(y[v]);p.length?this._events[h]=p.length===1?p[0]:p:o(this,h)}return this},s.prototype.removeAllListeners=function(u){var c;return u?(c=r?r+u:u,this._events[c]&&o(this,c)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=r,s.EventEmitter=s,t.exports=s})(__);var j6=__.exports;const k6=we(j6);var wd=new k6,_d="recharts.syncMouseEvents";function Ja(t){"@babel/helpers - typeof";return Ja=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},Ja(t)}function C6(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function I6(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 N6(t,e,r){return e&&I6(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function xd(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=M6(t,"string");return Ja(e)=="symbol"?e:e+""}function M6(t,e){if(Ja(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Ja(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var D6=function(){function t(){C6(this,t),xd(this,"activeIndex",0),xd(this,"coordinateList",[]),xd(this,"layout","horizontal")}return N6(t,[{key:"setDetails",value:function(r){var n,i=r.coordinateList,a=i===void 0?null:i,o=r.container,s=o===void 0?null:o,l=r.layout,u=l===void 0?null:l,c=r.offset,f=c===void 0?null:c,d=r.mouseHandlerCallback,h=d===void 0?null:d;this.coordinateList=(n=a??this.coordinateList)!==null&&n!==void 0?n:[],this.container=s??this.container,this.layout=u??this.layout,this.offset=f??this.offset,this.mouseHandlerCallback=h??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,s=i.height,l=this.coordinateList[this.activeIndex].coordinate,u=((r=window)===null||r===void 0?void 0:r.scrollX)||0,c=((n=window)===null||n===void 0?void 0:n.scrollY)||0,f=a+l+u,d=o+this.offset.top+s/2+c;this.mouseHandlerCallback({pageX:f,pageY:d})}}}])}();function L6(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&&z(n)&&z(i))return!0}return!1}function B6(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 O_(t){var e=t.cx,r=t.cy,n=t.radius,i=t.startAngle,a=t.endAngle,o=pe(e,r,n,i),s=pe(e,r,n,a);return{points:[o,s],cx:e,cy:r,radius:n,startAngle:i,endAngle:a}}function R6(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 s=e.cx,l=e.cy,u=e.innerRadius,c=e.outerRadius,f=e.angle,d=pe(s,l,u,f),h=pe(s,l,c,f);n=d.x,i=d.y,a=h.x,o=h.y}else return O_(e);return[{x:n,y:i},{x:a,y:o}]}function Za(t){"@babel/helpers - typeof";return Za=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},Za(t)}function S_(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 ml(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?S_(Object(r),!0).forEach(function(n){U6(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):S_(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function U6(t,e,r){return e=F6(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function F6(t){var e=W6(t,"string");return Za(e)=="symbol"?e:e+""}function W6(t,e){if(Za(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Za(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function q6(t){var e,r,n=t.element,i=t.tooltipEventType,a=t.isActive,o=t.activeCoordinate,s=t.activePayload,l=t.offset,u=t.activeTooltipIndex,c=t.tooltipAxisBandSize,f=t.layout,d=t.chartName,h=(e=n.props.cursor)!==null&&e!==void 0?e:(r=n.type.defaultProps)===null||r===void 0?void 0:r.cursor;if(!n||!h||!a||!o||d!=="ScatterChart"&&i!=="axis")return null;var y,v=nn;if(d==="ScatterChart")y=o,v=P3;else if(d==="BarChart")y=B6(f,o,l,c),v=Nf;else if(f==="radial"){var p=O_(o),m=p.cx,w=p.cy,b=p.radius,O=p.startAngle,g=p.endAngle;y={cx:m,cy:w,startAngle:O,endAngle:g,innerRadius:b,outerRadius:b},v=Nb}else y={points:R6(f,o,l)},v=nn;var _=ml(ml(ml(ml({stroke:"#ccc",pointerEvents:"none"},l),y),X(h,!1)),{},{payload:s,payloadIndex:u,className:ie("recharts-tooltip-cursor",h.className)});return x.isValidElement(h)?x.cloneElement(h,_):x.createElement(v,_)}var z6=["item"],K6=["children","className","width","height","style","compact","title","desc"];function Ti(t){"@babel/helpers - typeof";return Ti=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},Ti(t)}function $i(){return $i=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},$i.apply(this,arguments)}function A_(t,e){return G6(t)||H6(t,e)||T_(t,e)||V6()}function V6(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
138
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function H6(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,a,o,s=[],l=!0,u=!1;try{if(a=(r=r.call(t)).next,e!==0)for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}function G6(t){if(Array.isArray(t))return t}function P_(t,e){if(t==null)return{};var r=Y6(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 Y6(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 X6(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function J6(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 Z6(t,e,r){return e&&J6(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Q6(t,e,r){return e=bl(e),e5(t,E_()?Reflect.construct(e,r||[],bl(t).constructor):e.apply(t,r))}function e5(t,e){if(e&&(Ti(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return t5(t)}function t5(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function E_(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(E_=function(){return!!t})()}function bl(t){return bl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},bl(t)}function r5(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&&Od(t,e)}function Od(t,e){return Od=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Od(t,e)}function ji(t){return a5(t)||i5(t)||T_(t)||n5()}function n5(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
139
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function T_(t,e){if(t){if(typeof t=="string")return Sd(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 Sd(t,e)}}function i5(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function a5(t){if(Array.isArray(t))return Sd(t)}function Sd(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 $_(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 B(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?$_(Object(r),!0).forEach(function(n){ne(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$_(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ne(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=o5(t,"string");return Ti(e)=="symbol"?e:e+""}function o5(t,e){if(Ti(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ti(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var s5={xAxis:["bottom","top"],yAxis:["left","right"]},l5={width:"100%",height:"100%"},k_={x:0,y:0};function wl(t){return t}var u5=function(e,r){return r==="horizontal"?e.x:r==="vertical"?e.y:r==="centric"?e.angle:e.radius},c5=function(e,r,n,i){var a=r.find(function(c){return c&&c.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,s=i.radius;return B(B(B({},i),pe(i.cx,i.cy,s,o)),{},{angle:o,radius:s})}var l=a.coordinate,u=i.angle;return B(B(B({},i),pe(i.cx,i.cy,l,u)),{},{angle:u,radius:l})}return k_},_l=function(e,r){var n=r.graphicalItems,i=r.dataStartIndex,a=r.dataEndIndex,o=(n??[]).reduce(function(s,l){var u=l.props.data;return u&&u.length?[].concat(ji(s),ji(u)):s},[]);return o.length>0?o:e&&e.length&&z(i)&&z(a)?e.slice(i,a+1):[]};function C_(t){return t==="number"?[0,"auto"]:void 0}var Ad=function(e,r,n,i){var a=e.graphicalItems,o=e.tooltipAxis,s=_l(r,e);return n<0||!a||!a.length||n>=s.length?null:a.reduce(function(l,u){var c,f=(c=u.props.data)!==null&&c!==void 0?c:r;f&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=n&&(f=f.slice(e.dataStartIndex,e.dataEndIndex+1));var d;if(o.dataKey&&!o.allowDuplicatedCategory){var h=f===void 0?s:f;d=Ao(h,o.dataKey,i)}else d=f&&f[n]||s[n];return d?[].concat(ji(l),[gb(u,d)]):l},[])},I_=function(e,r,n,i){var a=i||{x:e.chartX,y:e.chartY},o=u5(a,n),s=e.orderedTooltipTicks,l=e.tooltipAxis,u=e.tooltipTicks,c=GF(o,s,u,l);if(c>=0&&u){var f=u[c]&&u[c].value,d=Ad(e,r,c,f),h=c5(n,s,c,a);return{activeTooltipIndex:c,activeLabel:f,activePayload:d,activeCoordinate:h}}return null},f5=function(e,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,c=e.layout,f=e.children,d=e.stackOffset,h=ob(c,a);return n.reduce(function(y,v){var p,m=v.type.defaultProps!==void 0?B(B({},v.type.defaultProps),v.props):v.props,w=m.type,b=m.dataKey,O=m.allowDataOverflow,g=m.allowDuplicatedCategory,_=m.scale,S=m.ticks,A=m.includeHidden,E=m[o];if(y[E])return y;var I=_l(e.data,{graphicalItems:i.filter(function(U){var V,G=o in U.props?U.props[o]:(V=U.type.defaultProps)===null||V===void 0?void 0:V[o];return G===E}),dataStartIndex:l,dataEndIndex:u}),T=I.length,$,k,C;L6(m.domain,O,w)&&($=ff(m.domain,null,O),h&&(w==="number"||_!=="auto")&&(C=_a(I,b,"category")));var D=C_(w);if(!$||$.length===0){var N,L=(N=m.domain)!==null&&N!==void 0?N:D;if(b){if($=_a(I,b,w),w==="category"&&h){var W=L1($);g&&W?(k=$,$=Js(0,T)):g||($=yb(L,$,v).reduce(function(U,V){return U.indexOf(V)>=0?U:[].concat(ji(U),[V])},[]))}else if(w==="category")g?$=$.filter(function(U){return U!==""&&!se(U)}):$=yb(L,$,v).reduce(function(U,V){return U.indexOf(V)>=0||V===""||se(V)?U:[].concat(ji(U),[V])},[]);else if(w==="number"){var q=QF(I,i.filter(function(U){var V,G,ee=o in U.props?U.props[o]:(V=U.type.defaultProps)===null||V===void 0?void 0:V[o],re="hide"in U.props?U.props.hide:(G=U.type.defaultProps)===null||G===void 0?void 0:G.hide;return ee===E&&(A||!re)}),b,a,c);q&&($=q)}h&&(w==="number"||_!=="auto")&&(C=_a(I,b,"category"))}else h?$=Js(0,T):s&&s[E]&&s[E].hasStack&&w==="number"?$=d==="expand"?[0,1]:hb(s[E].stackGroups,l,u):$=ab(I,i.filter(function(U){var V=o in U.props?U.props[o]:U.type.defaultProps[o],G="hide"in U.props?U.props.hide:U.type.defaultProps.hide;return V===E&&(A||!G)}),w,c,!0);if(w==="number")$=bd(f,$,E,a,S),L&&($=ff(L,$,O));else if(w==="category"&&L){var M=L,R=$.every(function(U){return M.indexOf(U)>=0});R&&($=M)}}return B(B({},y),{},ne({},E,B(B({},m),{},{axisType:a,domain:$,categoricalDomain:C,duplicateDomain:k,originalDomain:(p=m.domain)!==null&&p!==void 0?p:D,isCategorical:h,layout:c})))},{})},d5=function(e,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,c=e.layout,f=e.children,d=_l(e.data,{graphicalItems:n,dataStartIndex:l,dataEndIndex:u}),h=d.length,y=ob(c,a),v=-1;return n.reduce(function(p,m){var w=m.type.defaultProps!==void 0?B(B({},m.type.defaultProps),m.props):m.props,b=w[o],O=C_("number");if(!p[b]){v++;var g;return y?g=Js(0,h):s&&s[b]&&s[b].hasStack?(g=hb(s[b].stackGroups,l,u),g=bd(f,g,b,a)):(g=ff(O,ab(d,n.filter(function(_){var S,A,E=o in _.props?_.props[o]:(S=_.type.defaultProps)===null||S===void 0?void 0:S[o],I="hide"in _.props?_.props.hide:(A=_.type.defaultProps)===null||A===void 0?void 0:A.hide;return E===b&&!I}),"number",c),i.defaultProps.allowDataOverflow),g=bd(f,g,b,a)),B(B({},p),{},ne({},b,B(B({axisType:a},i.defaultProps),{},{hide:!0,orientation:ct(s5,"".concat(a,".").concat(v%2),null),domain:g,originalDomain:O,isCategorical:y,layout:c})))}return p},{})},h5=function(e,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,c=e.children,f="".concat(i,"Id"),d=ft(c,a),h={};return d&&d.length?h=f5(e,{axes:d,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:u}):o&&o.length&&(h=d5(e,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:u})),h},p5=function(e){var r=gr(e),n=ir(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:ic(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:Es(r,n)}},N_=function(e){var r=e.children,n=e.defaultShowTooltip,i=dt(r,hi),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}},v5=function(e){return!e||!e.length?!1:e.some(function(r){var n=Yt(r&&r.type);return n&&n.indexOf("Bar")>=0})},M_=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"}},y5=function(e,r){var n=e.props,i=e.graphicalItems,a=e.xAxisMap,o=a===void 0?{}:a,s=e.yAxisMap,l=s===void 0?{}:s,u=n.width,c=n.height,f=n.children,d=n.margin||{},h=dt(f,hi),y=dt(f,Vr),v=Object.keys(l).reduce(function(g,_){var S=l[_],A=S.orientation;return!S.mirror&&!S.hide?B(B({},g),{},ne({},A,g[A]+S.width)):g},{left:d.left||0,right:d.right||0}),p=Object.keys(o).reduce(function(g,_){var S=o[_],A=S.orientation;return!S.mirror&&!S.hide?B(B({},g),{},ne({},A,ct(g,"".concat(A))+S.height)):g},{top:d.top||0,bottom:d.bottom||0}),m=B(B({},p),v),w=m.bottom;h&&(m.bottom+=h.props.height||hi.defaultProps.height),y&&r&&(m=JF(m,i,n,r));var b=u-m.left-m.right,O=c-m.top-m.bottom;return B(B({brushBottom:w},m),{},{width:Math.max(b,0),height:Math.max(O,0)})},g5=function(e,r){if(r==="xAxis")return e[r].width;if(r==="yAxis")return e[r].height},Qa=function(e){var r=e.chartName,n=e.GraphicalChild,i=e.defaultTooltipEventType,a=i===void 0?"axis":i,o=e.validateTooltipEventTypes,s=o===void 0?["axis"]:o,l=e.axisComponents,u=e.legendContent,c=e.formatAxisMap,f=e.defaultProps,d=function(m,w){var b=w.graphicalItems,O=w.stackGroups,g=w.offset,_=w.updateId,S=w.dataStartIndex,A=w.dataEndIndex,E=m.barSize,I=m.layout,T=m.barGap,$=m.barCategoryGap,k=m.maxBarSize,C=M_(I),D=C.numericAxisName,N=C.cateAxisName,L=v5(b),W=[];return b.forEach(function(q,M){var R=_l(m.data,{graphicalItems:[q],dataStartIndex:S,dataEndIndex:A}),U=q.type.defaultProps!==void 0?B(B({},q.type.defaultProps),q.props):q.props,V=U.dataKey,G=U.maxBarSize,ee=U["".concat(D,"Id")],re=U["".concat(N,"Id")],le={},ae=l.reduce(function(hn,ur){var Td,$d,jd=w["".concat(ur.axisType,"Map")],R_=U["".concat(ur.axisType,"Id")];jd&&jd[R_]||ur.axisType==="zAxis"||(process.env.NODE_ENV!=="production"?st(!1,"Specifying a(n) ".concat(ur.axisType,"Id requires a corresponding ").concat(ur.axisType,"Id on the targeted graphical component ").concat((Td=q==null||($d=q.type)===null||$d===void 0?void 0:$d.displayName)!==null&&Td!==void 0?Td:"")):st());var U_=jd[R_];return B(B({},hn),{},ne(ne({},ur.axisType,U_),"".concat(ur.axisType,"Ticks"),ir(U_)))},le),F=ae[N],H=ae["".concat(N,"Ticks")],Q=O&&O[ee]&&O[ee].hasStack&&lW(q,O[ee].stackGroups),j=Yt(q.type).indexOf("Bar")>=0,de=Es(F,H),K=[],Pe=L&&YF({barSize:E,stackGroups:O,totalSize:g5(ae,N)});if(j){var ke,Ye,jr=se(G)?k:G,Ii=(ke=(Ye=Es(F,H,!0))!==null&&Ye!==void 0?Ye:jr)!==null&&ke!==void 0?ke:0;K=XF({barGap:T,barCategoryGap:$,bandSize:Ii!==de?Ii:de,sizeList:Pe[re],maxBarSize:jr}),Ii!==de&&(K=K.map(function(hn){return B(B({},hn),{},{position:B(B({},hn.position),{},{offset:hn.position.offset-Ii/2})})}))}var xl=q&&q.type&&q.type.getComposedData;xl&&W.push({props:B(B({},xl(B(B({},ae),{},{displayedData:R,props:m,dataKey:V,item:q,bandSize:de,barPosition:K,offset:g,stackedData:Q,layout:I,dataStartIndex:S,dataEndIndex:A}))),{},ne(ne(ne({key:q.key||"item-".concat(M)},D,ae[D]),N,ae[N]),"animationId",_)),childIndex:Y1(q,m.children),item:q})}),W},h=function(m,w){var b=m.props,O=m.dataStartIndex,g=m.dataEndIndex,_=m.updateId;if(!Jp({props:b}))return null;var S=b.children,A=b.layout,E=b.stackOffset,I=b.data,T=b.reverseStackOrder,$=M_(A),k=$.numericAxisName,C=$.cateAxisName,D=ft(S,n),N=oW(I,D,"".concat(k,"Id"),"".concat(C,"Id"),E,T),L=l.reduce(function(U,V){var G="".concat(V.axisType,"Map");return B(B({},U),{},ne({},G,h5(b,B(B({},V),{},{graphicalItems:D,stackGroups:V.axisType===k&&N,dataStartIndex:O,dataEndIndex:g}))))},{}),W=y5(B(B({},L),{},{props:b,graphicalItems:D}),w==null?void 0:w.legendBBox);Object.keys(L).forEach(function(U){L[U]=c(b,L[U],W,U.replace("Map",""),r)});var q=L["".concat(C,"Map")],M=p5(q),R=d(b,B(B({},L),{},{dataStartIndex:O,dataEndIndex:g,updateId:_,graphicalItems:D,stackGroups:N,offset:W}));return B(B({formattedGraphicalItems:R,graphicalItems:D,offset:W,stackGroups:N},M),L)},y=function(p){function m(w){var b,O,g;return X6(this,m),g=Q6(this,m,[w]),ne(g,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),ne(g,"accessibilityManager",new D6),ne(g,"handleLegendBBoxUpdate",function(_){if(_){var S=g.state,A=S.dataStartIndex,E=S.dataEndIndex,I=S.updateId;g.setState(B({legendBBox:_},h({props:g.props,dataStartIndex:A,dataEndIndex:E,updateId:I},B(B({},g.state),{},{legendBBox:_}))))}}),ne(g,"handleReceiveSyncEvent",function(_,S,A){if(g.props.syncId===_){if(A===g.eventEmitterSymbol&&typeof g.props.syncMethod!="function")return;g.applySyncEvent(S)}}),ne(g,"handleBrushChange",function(_){var S=_.startIndex,A=_.endIndex;if(S!==g.state.dataStartIndex||A!==g.state.dataEndIndex){var E=g.state.updateId;g.setState(function(){return B({dataStartIndex:S,dataEndIndex:A},h({props:g.props,dataStartIndex:S,dataEndIndex:A,updateId:E},g.state))}),g.triggerSyncEvent({dataStartIndex:S,dataEndIndex:A})}}),ne(g,"handleMouseEnter",function(_){var S=g.getMouseInfo(_);if(S){var A=B(B({},S),{},{isTooltipActive:!0});g.setState(A),g.triggerSyncEvent(A);var E=g.props.onMouseEnter;te(E)&&E(A,_)}}),ne(g,"triggeredAfterMouseMove",function(_){var S=g.getMouseInfo(_),A=S?B(B({},S),{},{isTooltipActive:!0}):{isTooltipActive:!1};g.setState(A),g.triggerSyncEvent(A);var E=g.props.onMouseMove;te(E)&&E(A,_)}),ne(g,"handleItemMouseEnter",function(_){g.setState(function(){return{isTooltipActive:!0,activeItem:_,activePayload:_.tooltipPayload,activeCoordinate:_.tooltipPosition||{x:_.cx,y:_.cy}}})}),ne(g,"handleItemMouseLeave",function(){g.setState(function(){return{isTooltipActive:!1}})}),ne(g,"handleMouseMove",function(_){_.persist(),g.throttleTriggeredAfterMouseMove(_)}),ne(g,"handleMouseLeave",function(_){g.throttleTriggeredAfterMouseMove.cancel();var S={isTooltipActive:!1};g.setState(S),g.triggerSyncEvent(S);var A=g.props.onMouseLeave;te(A)&&A(S,_)}),ne(g,"handleOuterEvent",function(_){var S=G1(_),A=ct(g.props,"".concat(S));if(S&&te(A)){var E,I;/.*touch.*/i.test(S)?I=g.getMouseInfo(_.changedTouches[0]):I=g.getMouseInfo(_),A((E=I)!==null&&E!==void 0?E:{},_)}}),ne(g,"handleClick",function(_){var S=g.getMouseInfo(_);if(S){var A=B(B({},S),{},{isTooltipActive:!0});g.setState(A),g.triggerSyncEvent(A);var E=g.props.onClick;te(E)&&E(A,_)}}),ne(g,"handleMouseDown",function(_){var S=g.props.onMouseDown;if(te(S)){var A=g.getMouseInfo(_);S(A,_)}}),ne(g,"handleMouseUp",function(_){var S=g.props.onMouseUp;if(te(S)){var A=g.getMouseInfo(_);S(A,_)}}),ne(g,"handleTouchMove",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&g.throttleTriggeredAfterMouseMove(_.changedTouches[0])}),ne(g,"handleTouchStart",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&g.handleMouseDown(_.changedTouches[0])}),ne(g,"handleTouchEnd",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&g.handleMouseUp(_.changedTouches[0])}),ne(g,"handleDoubleClick",function(_){var S=g.props.onDoubleClick;if(te(S)){var A=g.getMouseInfo(_);S(A,_)}}),ne(g,"handleContextMenu",function(_){var S=g.props.onContextMenu;if(te(S)){var A=g.getMouseInfo(_);S(A,_)}}),ne(g,"triggerSyncEvent",function(_){g.props.syncId!==void 0&&wd.emit(_d,g.props.syncId,_,g.eventEmitterSymbol)}),ne(g,"applySyncEvent",function(_){var S=g.props,A=S.layout,E=S.syncMethod,I=g.state.updateId,T=_.dataStartIndex,$=_.dataEndIndex;if(_.dataStartIndex!==void 0||_.dataEndIndex!==void 0)g.setState(B({dataStartIndex:T,dataEndIndex:$},h({props:g.props,dataStartIndex:T,dataEndIndex:$,updateId:I},g.state)));else if(_.activeTooltipIndex!==void 0){var k=_.chartX,C=_.chartY,D=_.activeTooltipIndex,N=g.state,L=N.offset,W=N.tooltipTicks;if(!L)return;if(typeof E=="function")D=E(W,_);else if(E==="value"){D=-1;for(var q=0;q<W.length;q++)if(W[q].value===_.activeLabel){D=q;break}}var M=B(B({},L),{},{x:L.left,y:L.top}),R=Math.min(k,M.x+M.width),U=Math.min(C,M.y+M.height),V=W[D]&&W[D].value,G=Ad(g.state,g.props.data,D),ee=W[D]?{x:A==="horizontal"?W[D].coordinate:R,y:A==="horizontal"?U:W[D].coordinate}:k_;g.setState(B(B({},_),{},{activeLabel:V,activeCoordinate:ee,activePayload:G,activeTooltipIndex:D}))}else g.setState(_)}),ne(g,"renderCursor",function(_){var S,A=g.state,E=A.isTooltipActive,I=A.activeCoordinate,T=A.activePayload,$=A.offset,k=A.activeTooltipIndex,C=A.tooltipAxisBandSize,D=g.getTooltipEventType(),N=(S=_.props.active)!==null&&S!==void 0?S:E,L=g.props.layout,W=_.key||"_recharts-cursor";return x.createElement(q6,{key:W,activeCoordinate:I,activePayload:T,activeTooltipIndex:k,chartName:r,element:_,isActive:N,layout:L,offset:$,tooltipAxisBandSize:C,tooltipEventType:D})}),ne(g,"renderPolarAxis",function(_,S,A){var E=ct(_,"type.axisType"),I=ct(g.state,"".concat(E,"Map")),T=_.type.defaultProps,$=T!==void 0?B(B({},T),_.props):_.props,k=I&&I[$["".concat(E,"Id")]];return x.cloneElement(_,B(B({},k),{},{className:ie(E,k.className),key:_.key||"".concat(S,"-").concat(A),ticks:ir(k,!0)}))}),ne(g,"renderPolarGrid",function(_){var S=_.props,A=S.radialLines,E=S.polarAngles,I=S.polarRadius,T=g.state,$=T.radiusAxisMap,k=T.angleAxisMap,C=gr($),D=gr(k),N=D.cx,L=D.cy,W=D.innerRadius,q=D.outerRadius;return x.cloneElement(_,{polarAngles:Array.isArray(E)?E:ir(D,!0).map(function(M){return M.coordinate}),polarRadius:Array.isArray(I)?I:ir(C,!0).map(function(M){return M.coordinate}),cx:N,cy:L,innerRadius:W,outerRadius:q,key:_.key||"polar-grid",radialLines:A})}),ne(g,"renderLegend",function(){var _=g.state.formattedGraphicalItems,S=g.props,A=S.children,E=S.width,I=S.height,T=g.props.margin||{},$=E-(T.left||0)-(T.right||0),k=tb({children:A,formattedGraphicalItems:_,legendWidth:$,legendContent:u});if(!k)return null;var C=k.item,D=P_(k,z6);return x.cloneElement(C,B(B({},D),{},{chartWidth:E,chartHeight:I,margin:T,onBBoxUpdate:g.handleLegendBBoxUpdate}))}),ne(g,"renderTooltip",function(){var _,S=g.props,A=S.children,E=S.accessibilityLayer,I=dt(A,Rt);if(!I)return null;var T=g.state,$=T.isTooltipActive,k=T.activeCoordinate,C=T.activePayload,D=T.activeLabel,N=T.offset,L=(_=I.props.active)!==null&&_!==void 0?_:$;return x.cloneElement(I,{viewBox:B(B({},N),{},{x:N.left,y:N.top}),active:L,label:D,payload:L?C:[],coordinate:k,accessibilityLayer:E})}),ne(g,"renderBrush",function(_){var S=g.props,A=S.margin,E=S.data,I=g.state,T=I.offset,$=I.dataStartIndex,k=I.dataEndIndex,C=I.updateId;return x.cloneElement(_,{key:_.key||"_recharts-brush",onChange:As(g.handleBrushChange,_.props.onChange),data:E,x:z(_.props.x)?_.props.x:T.left,y:z(_.props.y)?_.props.y:T.top+T.height+T.brushBottom-(A.bottom||0),width:z(_.props.width)?_.props.width:T.width,startIndex:$,endIndex:k,updateId:"brush-".concat(C)})}),ne(g,"renderReferenceElement",function(_,S,A){if(!_)return null;var E=g,I=E.clipPathId,T=g.state,$=T.xAxisMap,k=T.yAxisMap,C=T.offset,D=_.type.defaultProps||{},N=_.props,L=N.xAxisId,W=L===void 0?D.xAxisId:L,q=N.yAxisId,M=q===void 0?D.yAxisId:q;return x.cloneElement(_,{key:_.key||"".concat(S,"-").concat(A),xAxis:$[W],yAxis:k[M],viewBox:{x:C.left,y:C.top,width:C.width,height:C.height},clipPathId:I})}),ne(g,"renderActivePoints",function(_){var S=_.item,A=_.activePoint,E=_.basePoint,I=_.childIndex,T=_.isRange,$=[],k=S.props.key,C=S.item.type.defaultProps!==void 0?B(B({},S.item.type.defaultProps),S.item.props):S.item.props,D=C.activeDot,N=C.dataKey,L=B(B({index:I,dataKey:N,cx:A.x,cy:A.y,r:4,fill:uf(S.item),strokeWidth:2,stroke:"#fff",payload:A.payload,value:A.value},X(D,!1)),Po(D));return $.push(m.renderActiveDot(D,L,"".concat(k,"-activePoint-").concat(I))),E?$.push(m.renderActiveDot(D,B(B({},L),{},{cx:E.x,cy:E.y}),"".concat(k,"-basePoint-").concat(I))):T&&$.push(null),$}),ne(g,"renderGraphicChild",function(_,S,A){var E=g.filterFormatItem(_,S,A);if(!E)return null;var I=g.getTooltipEventType(),T=g.state,$=T.isTooltipActive,k=T.tooltipAxis,C=T.activeTooltipIndex,D=T.activeLabel,N=g.props.children,L=dt(N,Rt),W=E.props,q=W.points,M=W.isRange,R=W.baseLine,U=E.item.type.defaultProps!==void 0?B(B({},E.item.type.defaultProps),E.item.props):E.item.props,V=U.activeDot,G=U.hide,ee=U.activeBar,re=U.activeShape,le=!!(!G&&$&&L&&(V||ee||re)),ae={};I!=="axis"&&L&&L.props.trigger==="click"?ae={onClick:As(g.handleItemMouseEnter,_.props.onClick)}:I!=="axis"&&(ae={onMouseLeave:As(g.handleItemMouseLeave,_.props.onMouseLeave),onMouseEnter:As(g.handleItemMouseEnter,_.props.onMouseEnter)});var F=x.cloneElement(_,B(B({},E.props),ae));function H(ur){return typeof k.dataKey=="function"?k.dataKey(ur.payload):null}if(le)if(C>=0){var Q,j;if(k.dataKey&&!k.allowDuplicatedCategory){var de=typeof k.dataKey=="function"?H:"payload.".concat(k.dataKey.toString());Q=Ao(q,de,D),j=M&&R&&Ao(R,de,D)}else Q=q==null?void 0:q[C],j=M&&R&&R[C];if(re||ee){var K=_.props.activeIndex!==void 0?_.props.activeIndex:C;return[x.cloneElement(_,B(B(B({},E.props),ae),{},{activeIndex:K})),null,null]}if(!se(Q))return[F].concat(ji(g.renderActivePoints({item:E,activePoint:Q,basePoint:j,childIndex:C,isRange:M})))}else{var Pe,ke=(Pe=g.getItemByXY(g.state.activeCoordinate))!==null&&Pe!==void 0?Pe:{graphicalItem:F},Ye=ke.graphicalItem,jr=Ye.item,Ii=jr===void 0?_:jr,xl=Ye.childIndex,hn=B(B(B({},E.props),ae),{},{activeIndex:xl});return[x.cloneElement(Ii,hn),null,null]}return M?[F,null,null]:[F,null]}),ne(g,"renderCustomized",function(_,S,A){return x.cloneElement(_,B(B({key:"recharts-customized-".concat(A)},g.props),g.state))}),ne(g,"renderMap",{CartesianGrid:{handler:wl,once:!0},ReferenceArea:{handler:g.renderReferenceElement},ReferenceLine:{handler:wl},ReferenceDot:{handler:g.renderReferenceElement},XAxis:{handler:wl},YAxis:{handler:wl},Brush:{handler:g.renderBrush,once:!0},Bar:{handler:g.renderGraphicChild},Line:{handler:g.renderGraphicChild},Area:{handler:g.renderGraphicChild},Radar:{handler:g.renderGraphicChild},RadialBar:{handler:g.renderGraphicChild},Scatter:{handler:g.renderGraphicChild},Pie:{handler:g.renderGraphicChild},Funnel:{handler:g.renderGraphicChild},Tooltip:{handler:g.renderCursor,once:!0},PolarGrid:{handler:g.renderPolarGrid,once:!0},PolarAngleAxis:{handler:g.renderPolarAxis},PolarRadiusAxis:{handler:g.renderPolarAxis},Customized:{handler:g.renderCustomized}}),g.clipPathId="".concat((b=w.id)!==null&&b!==void 0?b:Wr("recharts"),"-clip"),g.throttleTriggeredAfterMouseMove=Jy(g.triggeredAfterMouseMove,(O=w.throttleDelay)!==null&&O!==void 0?O:1e3/60),g.state={},g}return r5(m,p),Z6(m,[{key:"componentDidMount",value:function(){var b,O;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(O=this.props.margin.top)!==null&&O!==void 0?O:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var b=this.props,O=b.children,g=b.data,_=b.height,S=b.layout,A=dt(O,Rt);if(A){var E=A.props.defaultIndex;if(!(typeof E!="number"||E<0||E>this.state.tooltipTicks.length-1)){var I=this.state.tooltipTicks[E]&&this.state.tooltipTicks[E].value,T=Ad(this.state,g,E,I),$=this.state.tooltipTicks[E].coordinate,k=(this.state.offset.top+_)/2,C=S==="horizontal",D=C?{x:$,y:k}:{y:$,x:k},N=this.state.formattedGraphicalItems.find(function(W){var q=W.item;return q.type.name==="Scatter"});N&&(D=B(B({},D),N.props.points[E].tooltipPosition),T=N.props.points[E].tooltipPayload);var L={activeTooltipIndex:E,isTooltipActive:!0,activeLabel:I,activePayload:T,activeCoordinate:D};this.setState(L),this.renderCursor(A),this.accessibilityManager.setIndex(E)}}}},{key:"getSnapshotBeforeUpdate",value:function(b,O){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==O.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==b.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==b.margin){var g,_;this.accessibilityManager.setDetails({offset:{left:(g=this.props.margin.left)!==null&&g!==void 0?g:0,top:(_=this.props.margin.top)!==null&&_!==void 0?_:0}})}return null}},{key:"componentDidUpdate",value:function(b){xu([dt(b.children,Rt)],[dt(this.props.children,Rt)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var b=dt(this.props.children,Rt);if(b&&typeof b.props.shared=="boolean"){var O=b.props.shared?"axis":"item";return s.indexOf(O)>=0?O:a}return a}},{key:"getMouseInfo",value:function(b){if(!this.container)return null;var O=this.container,g=O.getBoundingClientRect(),_=O2(g),S={chartX:Math.round(b.pageX-_.left),chartY:Math.round(b.pageY-_.top)},A=g.width/O.offsetWidth||1,E=this.inRange(S.chartX,S.chartY,A);if(!E)return null;var I=this.state,T=I.xAxisMap,$=I.yAxisMap,k=this.getTooltipEventType(),C=I_(this.state,this.props.data,this.props.layout,E);if(k!=="axis"&&T&&$){var D=gr(T).scale,N=gr($).scale,L=D&&D.invert?D.invert(S.chartX):null,W=N&&N.invert?N.invert(S.chartY):null;return B(B({},S),{},{xValue:L,yValue:W},C)}return C?B(B({},S),C):null}},{key:"inRange",value:function(b,O){var g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,_=this.props.layout,S=b/g,A=O/g;if(_==="horizontal"||_==="vertical"){var E=this.state.offset,I=S>=E.left&&S<=E.left+E.width&&A>=E.top&&A<=E.top+E.height;return I?{x:S,y:A}:null}var T=this.state,$=T.angleAxisMap,k=T.radiusAxisMap;if($&&k){var C=gr($);return Ob({x:S,y:A},C)}return null}},{key:"parseEventsOfWrapper",value:function(){var b=this.props.children,O=this.getTooltipEventType(),g=dt(b,Rt),_={};g&&O==="axis"&&(g.props.trigger==="click"?_={onClick:this.handleClick}:_={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 S=Po(this.props,this.handleOuterEvent);return B(B({},S),_)}},{key:"addListener",value:function(){wd.on(_d,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){wd.removeListener(_d,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(b,O,g){for(var _=this.state.formattedGraphicalItems,S=0,A=_.length;S<A;S++){var E=_[S];if(E.item===b||E.props.key===b.key||O===Yt(E.item.type)&&g===E.childIndex)return E}return null}},{key:"renderClipPath",value:function(){var b=this.clipPathId,O=this.state.offset,g=O.left,_=O.top,S=O.height,A=O.width;return x.createElement("defs",null,x.createElement("clipPath",{id:b},x.createElement("rect",{x:g,y:_,height:S,width:A})))}},{key:"getXScales",value:function(){var b=this.state.xAxisMap;return b?Object.entries(b).reduce(function(O,g){var _=A_(g,2),S=_[0],A=_[1];return B(B({},O),{},ne({},S,A.scale))},{}):null}},{key:"getYScales",value:function(){var b=this.state.yAxisMap;return b?Object.entries(b).reduce(function(O,g){var _=A_(g,2),S=_[0],A=_[1];return B(B({},O),{},ne({},S,A.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(b){var O;return(O=this.state.xAxisMap)===null||O===void 0||(O=O[b])===null||O===void 0?void 0:O.scale}},{key:"getYScaleByAxisId",value:function(b){var O;return(O=this.state.yAxisMap)===null||O===void 0||(O=O[b])===null||O===void 0?void 0:O.scale}},{key:"getItemByXY",value:function(b){var O=this.state,g=O.formattedGraphicalItems,_=O.activeItem;if(g&&g.length)for(var S=0,A=g.length;S<A;S++){var E=g[S],I=E.props,T=E.item,$=T.type.defaultProps!==void 0?B(B({},T.type.defaultProps),T.props):T.props,k=Yt(T.type);if(k==="Bar"){var C=(I.data||[]).find(function(W){return s3(b,W)});if(C)return{graphicalItem:E,payload:C}}else if(k==="RadialBar"){var D=(I.data||[]).find(function(W){return Ob(b,W)});if(D)return{graphicalItem:E,payload:D}}else if(Ks(E,_)||Vs(E,_)||qa(E,_)){var N=aV({graphicalItem:E,activeTooltipItem:_,itemData:$.data}),L=$.activeIndex===void 0?N:$.activeIndex;return{graphicalItem:B(B({},E),{},{childIndex:L}),payload:qa(E,_)?$.data[N]:E.props.data[N]}}}return null}},{key:"render",value:function(){var b=this;if(!Jp(this))return null;var O=this.props,g=O.children,_=O.className,S=O.width,A=O.height,E=O.style,I=O.compact,T=O.title,$=O.desc,k=P_(O,K6),C=X(k,!1);if(I)return x.createElement(kw,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},x.createElement(Su,$i({},C,{width:S,height:A,title:T,desc:$}),this.renderClipPath(),ev(g,this.renderMap)));if(this.props.accessibilityLayer){var D,N;C.tabIndex=(D=this.props.tabIndex)!==null&&D!==void 0?D:0,C.role=(N=this.props.role)!==null&&N!==void 0?N:"application",C.onKeyDown=function(W){b.accessibilityManager.keyboardEvent(W)},C.onFocus=function(){b.accessibilityManager.focus()}}var L=this.parseEventsOfWrapper();return x.createElement(kw,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},x.createElement("div",$i({className:ie("recharts-wrapper",_),style:B({position:"relative",cursor:"default",width:S,height:A},E)},L,{ref:function(q){b.container=q}}),x.createElement(Su,$i({},C,{width:S,height:A,title:T,desc:$,style:l5}),this.renderClipPath(),ev(g,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(x.Component);ne(y,"displayName",r),ne(y,"defaultProps",B({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),ne(y,"getDerivedStateFromProps",function(p,m){var w=p.dataKey,b=p.data,O=p.children,g=p.width,_=p.height,S=p.layout,A=p.stackOffset,E=p.margin,I=m.dataStartIndex,T=m.dataEndIndex;if(m.updateId===void 0){var $=N_(p);return B(B(B({},$),{},{updateId:0},h(B(B({props:p},$),{},{updateId:0}),m)),{},{prevDataKey:w,prevData:b,prevWidth:g,prevHeight:_,prevLayout:S,prevStackOffset:A,prevMargin:E,prevChildren:O})}if(w!==m.prevDataKey||b!==m.prevData||g!==m.prevWidth||_!==m.prevHeight||S!==m.prevLayout||A!==m.prevStackOffset||!Mn(E,m.prevMargin)){var k=N_(p),C={chartX:m.chartX,chartY:m.chartY,isTooltipActive:m.isTooltipActive},D=B(B({},I_(m,b,S)),{},{updateId:m.updateId+1}),N=B(B(B({},k),C),D);return B(B(B({},N),h(B({props:p},N),m)),{},{prevDataKey:w,prevData:b,prevWidth:g,prevHeight:_,prevLayout:S,prevStackOffset:A,prevMargin:E,prevChildren:O})}if(!xu(O,m.prevChildren)){var L,W,q,M,R=dt(O,hi),U=R&&(L=(W=R.props)===null||W===void 0?void 0:W.startIndex)!==null&&L!==void 0?L:I,V=R&&(q=(M=R.props)===null||M===void 0?void 0:M.endIndex)!==null&&q!==void 0?q:T,G=U!==I||V!==T,ee=!se(b),re=ee&&!G?m.updateId:m.updateId+1;return B(B({updateId:re},h(B(B({props:p},m),{},{updateId:re,dataStartIndex:U,dataEndIndex:V}),m)),{},{prevChildren:O,dataStartIndex:U,dataEndIndex:V})}return null}),ne(y,"renderActiveDot",function(p,m,w){var b;return x.isValidElement(p)?b=x.cloneElement(p,m):te(p)?b=p(m):b=x.createElement(ii,m),x.createElement(ce,{className:"recharts-active-dot",key:w},b)});var v=x.forwardRef(function(m,w){return x.createElement(y,$i({},m,{ref:w}))});return v.displayName=y.displayName,v},m5=Qa({chartName:"LineChart",GraphicalChild:Xa,axisComponents:[{axisType:"xAxis",AxisComp:Tr},{axisType:"yAxis",AxisComp:$r}],formatAxisMap:Hf}),b5=Qa({chartName:"BarChart",GraphicalChild:un,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Tr},{axisType:"yAxis",AxisComp:$r}],formatAxisMap:Hf}),w5=Qa({chartName:"PieChart",GraphicalChild:sr,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:li},{axisType:"radiusAxis",AxisComp:oi}],formatAxisMap:xb,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),_5=Qa({chartName:"RadarChart",GraphicalChild:za,axisComponents:[{axisType:"angleAxis",AxisComp:li},{axisType:"radiusAxis",AxisComp:oi}],formatAxisMap:xb,defaultProps:{layout:"centric",startAngle:90,endAngle:-270,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),x5=Qa({chartName:"AreaChart",GraphicalChild:Er,axisComponents:[{axisType:"xAxis",AxisComp:Tr},{axisType:"yAxis",AxisComp:$r}],formatAxisMap:Hf});const O5={light:"",dark:".dark"},D_=fe.createContext(null);function L_(){const t=fe.useContext(D_);if(!t)throw new Error("useChart must be used within a <ChartContainer />");return t}const ki=fe.forwardRef(({id:t,className:e,children:r,config:n,...i},a)=>{const o=fe.useId(),s=`chart-${t||o.replace(/:/g,"")}`;return P.jsx(D_.Provider,{value:{config:n},children:P.jsxs("div",{"data-chart":s,ref:a,className:He("flex w-full h-full justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",e),...i,children:[P.jsx(S5,{id:s,config:n}),P.jsx(y2,{children:r})]})})});ki.displayName="Chart";const S5=({id:t,config:e})=>{const r=Object.entries(e).filter(([n,i])=>i.theme||i.color);return r.length?P.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(O5).map(([n,i])=>`
|
|
169
140
|
${i} [data-chart=${t}] {
|
|
170
|
-
${r.map(([a,o])=>{var
|
|
141
|
+
${r.map(([a,o])=>{var l;const s=((l=o.theme)==null?void 0:l[n])||o.color;return s?` --color-${a}: ${s};`:null}).join(`
|
|
171
142
|
`)}
|
|
172
143
|
}
|
|
173
144
|
`).join(`
|
|
174
|
-
`)}}):null},
|
|
175
|
-
`).filter(l=>l.trim()),s=a==="numbered"?"ol":"ul",u=a==="numbered"?"list-decimal list-inside space-y-1":"list-disc list-inside space-y-1";return P.jsx(s,{className:u,children:o.map((l,c)=>P.jsx("li",{children:l},c))})}case"code":{const{code:i,language:a}=r;return P.jsxs("div",{className:"relative",children:[a&&P.jsx("div",{className:"absolute top-2 right-2 text-xs text-muted-foreground bg-muted px-2 py-1 rounded",children:a}),P.jsx("pre",{className:"bg-muted p-4 rounded-lg overflow-x-auto",children:P.jsx("code",{className:"text-sm font-mono",children:i})})]})}case"entity-list":return P.jsx(c4,{content:r});case"entity-detail":return P.jsx(f4,{content:r});case"query":return P.jsx(d4,{content:r});case"chart":return P.jsx(l4,{content:r});case"tabs":{const{tabs:i}=r;return P.jsxs("div",{className:"w-full",children:[P.jsx("div",{className:"border-b border-border mb-4",children:P.jsx("div",{className:"flex gap-4",children:i==null?void 0:i.map((a,o)=>P.jsx("button",{className:`px-4 py-2 font-medium ${o===0?"border-b-2 border-primary":"text-muted-foreground"}`,children:a.label},a.id))})}),P.jsx("div",{className:"p-4",children:((n=i==null?void 0:i[0])==null?void 0:n.content)||"No content"})]})}case"accordion":{const{items:i}=r;return P.jsx("div",{className:"space-y-2",children:i==null?void 0:i.map(a=>P.jsxs(en,{children:[P.jsx(Tl,{children:P.jsx("h3",{className:"font-semibold",children:a.title})}),P.jsx(jl,{children:P.jsx("p",{className:"text-sm text-muted-foreground",children:a.content})})]},a.id))})}case"card":{const{title:i,description:a,imageUrl:o,buttonText:s,buttonLink:u}=r;return P.jsxs(en,{children:[o&&P.jsx("img",{src:o,alt:i,className:"w-full h-48 object-cover rounded-t-lg"}),P.jsx(Tl,{children:P.jsx("h3",{className:"text-xl font-semibold",children:i})}),P.jsxs(jl,{children:[P.jsx("p",{className:"text-muted-foreground mb-4",children:a}),s&&P.jsx(El,{asChild:!0,children:P.jsx("a",{href:u||"#",children:s})})]})]})}case"form-input":case"form-textarea":case"form-select":case"form-checkbox":case"form-submit":return P.jsx("div",{className:"p-4 border border-dashed border-muted-foreground/30 rounded-lg",children:P.jsx("p",{className:"text-sm text-muted-foreground",children:"Form component (preview not available)"})});default:return console.error("Unknown component type:",e,t),P.jsx("div",{className:"p-4 border border-dashed border-muted-foreground/30 rounded-lg bg-muted/20",children:P.jsxs("p",{className:"text-sm text-muted-foreground",children:["Unknown component type: ",e]})})}},c4=({content:t})=>{const[e,r]=x.useState([]),[n,i]=x.useState([]),[a,o]=x.useState(null),[s,u]=x.useState(!0);x.useEffect(()=>{l()},[t.entityId]);const l=async()=>{if(!t.entityId){u(!1);return}try{const[f,d,h]=await Promise.all([ct.from("entities").select("*").eq("id",t.entityId).eq("is_published",!0).single(),ct.from("entity_fields").select("*").eq("entity_id",t.entityId).order("position"),ct.from("entity_records").select("*").eq("entity_id",t.entityId).eq("is_published",!0).order("created_at",{ascending:t.sortOrder!=="asc"}).limit(t.limit||10)]);o(f.data),i(d.data||[]),r(h.data||[])}catch(f){console.error("Error loading entity data:",f)}u(!1)};if(s)return P.jsx("div",{className:"text-muted-foreground",children:"Loading..."});if(!a)return P.jsx("div",{className:"text-muted-foreground",children:"Entity not found"});if(e.length===0)return P.jsx("div",{className:"text-muted-foreground",children:"No records available"});const c=n.filter(f=>(t.fields||[]).includes(f.name));return t.displayStyle==="table"?P.jsx("div",{className:"overflow-x-auto",children:P.jsxs("table",{className:"w-full border-collapse",children:[P.jsx("thead",{children:P.jsx("tr",{className:"border-b",children:c.map(f=>P.jsx("th",{className:"text-left p-3 font-semibold",children:f.display_name},f.id))})}),P.jsx("tbody",{children:e.map(f=>P.jsx("tr",{className:"border-b",children:c.map(d=>P.jsx("td",{className:"p-3",children:Oo(f.data[d.name],d.field_type)},d.id))},f.id))})]})}):t.displayStyle==="list"?P.jsx("div",{className:"space-y-4",children:e.map(f=>P.jsx(en,{className:"p-4",children:c.map(d=>P.jsxs("div",{className:"mb-2",children:[P.jsxs("span",{className:"font-semibold",children:[d.display_name,": "]}),P.jsx("span",{children:Oo(f.data[d.name],d.field_type)})]},d.id))},f.id))}):P.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:e.map(f=>P.jsx(en,{className:"p-6",children:c.map(d=>P.jsxs("div",{className:"mb-3",children:[P.jsx("div",{className:"text-sm font-semibold text-muted-foreground mb-1",children:d.display_name}),P.jsx("div",{className:"text-base",children:Oo(f.data[d.name],d.field_type)})]},d.id))},f.id))})},f4=({content:t})=>{const[e,r]=x.useState(null),[n,i]=x.useState([]),[a,o]=x.useState(!0);x.useEffect(()=>{s()},[t.entityId,t.recordId]);const s=async()=>{if(!t.entityId||!t.recordId){o(!1);return}try{const[l,c]=await Promise.all([ct.from("entity_fields").select("*").eq("entity_id",t.entityId).order("position"),ct.from("entity_records").select("*").eq("id",t.recordId).eq("is_published",!0).single()]);i(l.data||[]),r(c.data)}catch(l){console.error("Error loading record:",l)}o(!1)};if(a)return P.jsx("div",{className:"text-muted-foreground",children:"Loading..."});if(!e)return P.jsx("div",{className:"text-muted-foreground",children:"Record not found"});const u=n.filter(l=>(t.fields||[]).includes(l.name));return t.layout==="horizontal"?P.jsx("div",{className:"flex flex-wrap gap-6",children:u.map(l=>P.jsxs("div",{className:"flex-1 min-w-[200px]",children:[P.jsx("div",{className:"text-sm font-semibold text-muted-foreground mb-1",children:l.display_name}),P.jsx("div",{className:"text-base",children:Oo(e.data[l.name],l.field_type)})]},l.id))}):P.jsx("div",{className:"space-y-4",children:u.map(l=>P.jsxs("div",{children:[P.jsx("div",{className:"text-sm font-semibold text-muted-foreground mb-1",children:l.display_name}),P.jsx("div",{className:"text-base",children:Oo(e.data[l.name],l.field_type)})]},l.id))})},d4=({content:t})=>{const[e,r]=x.useState([]),[n,i]=x.useState(null),[a,o]=x.useState(!0),[s,u]=x.useState(null);x.useEffect(()=>{l()},[t.queryId]);const l=async()=>{if(!t.queryId){o(!1);return}try{const{data:d,error:h}=await ct.functions.invoke("execute-query",{body:{queryId:t.queryId}});if(h)throw h;d.success?(r(d.data||[]),i(d.settings)):u(d.error||"Failed to execute query")}catch(d){console.error("Error executing query:",d),u("Failed to load query results")}o(!1)};if(a)return P.jsx("div",{className:"text-muted-foreground",children:"Loading query results..."});if(s)return P.jsx("div",{className:"text-destructive",children:s});if(!n)return P.jsx("div",{className:"text-muted-foreground",children:"Query not found"});if(e.length===0)return P.jsx("div",{className:"text-muted-foreground",children:"No results found"});const c=n.display_style||"table",f=n.show_row_numbers||!1;if(c==="table"){const d=Object.keys(e[0]||{});return P.jsx("div",{className:"overflow-x-auto",children:P.jsxs("table",{className:"w-full border-collapse",children:[P.jsx("thead",{children:P.jsxs("tr",{className:"border-b",children:[f&&P.jsx("th",{className:"text-left p-3 font-semibold",children:"#"}),d.map(h=>P.jsx("th",{className:"text-left p-3 font-semibold",children:h},h))]})}),P.jsx("tbody",{children:e.map((h,y)=>P.jsxs("tr",{className:"border-b",children:[f&&P.jsx("td",{className:"p-3 text-muted-foreground",children:y+1}),d.map(v=>P.jsx("td",{className:"p-3",children:h[v]!==null&&h[v]!==void 0?String(h[v]):"-"},v))]},y))})]})})}return c==="list"?P.jsx("div",{className:"space-y-4",children:e.map((d,h)=>P.jsxs(en,{className:"p-4",children:[f&&P.jsxs("div",{className:"text-sm text-muted-foreground mb-2",children:["#",h+1]}),Object.entries(d).map(([y,v])=>P.jsxs("div",{className:"mb-2",children:[P.jsxs("span",{className:"font-semibold",children:[y,": "]}),P.jsx("span",{children:v!=null?String(v):"-"})]},y))]},h))}):P.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:e.map((d,h)=>P.jsxs(en,{className:"p-6",children:[f&&P.jsxs("div",{className:"text-sm text-muted-foreground mb-3",children:["#",h+1]}),Object.entries(d).map(([y,v])=>P.jsxs("div",{className:"mb-3",children:[P.jsx("div",{className:"text-sm font-semibold text-muted-foreground mb-1",children:y}),P.jsx("div",{className:"text-base",children:v!=null?String(v):"-"})]},y))]},h))})},Oo=(t,e)=>{if(t==null||t==="")return"-";switch(e){case"image":return P.jsx("img",{src:t,alt:"",className:"max-w-full h-auto rounded"});case"url":return P.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:t});case"boolean":return t==="true"||t===!0?"Yes":"No";case"longtext":return P.jsx("div",{className:"whitespace-pre-wrap",children:t});case"date":return new Date(t).toLocaleDateString();default:return String(t)}},h4=({to:t,className:e,children:r})=>P.jsx("a",{href:t,className:e,children:r}),p4=({slug:t,LinkComponent:e=h4})=>{const[r,n]=x.useState(null),[i,a]=x.useState([]),[o,s]=x.useState([]),[u,l]=x.useState(null),[c,f]=x.useState([]),[d,h]=x.useState([]),[y,v]=x.useState([]),[p,m]=x.useState(!0),[b,w]=x.useState(new Map);x.useEffect(()=>{O()},[t]);const O=async()=>{const{data:j}=await ct.from("pages").select("*").eq("is_published",!0).order("menu_order");if(v(j||[]),!t){m(!1);return}const{data:$}=await ct.from("pages").select("*").eq("slug",t).eq("is_published",!0).single();if($){const{data:k}=await ct.from("page_rows").select("*").eq("page_id",$.id).order("position"),{data:I}=await ct.from("page_components").select("*").eq("page_id",$.id).order("position");if(n($),a(k||[]),s(I||[]),$.layout_id){const{data:L}=await ct.from("layouts").select("*").eq("id",$.layout_id).eq("is_published",!0).maybeSingle();if(L){const{data:q}=await ct.from("layout_rows").select("*").eq("layout_id",L.id).order("position"),{data:z}=await ct.from("layout_components").select("*").eq("layout_id",L.id).order("position");l(L),f(q||[]),h(z||[])}}const R=(I||[]).filter(L=>L.is_widget_instance&&L.widget_id),M=new Map;for(const L of R)if(!M.has(L.widget_id)){const{data:q}=await ct.from("widget_rows").select("*").eq("widget_id",L.widget_id).order("position"),{data:z}=await ct.from("widget_components").select("*").eq("widget_id",L.widget_id).order("position");M.set(L.widget_id,{rows:q||[],components:z||[]})}w(M)}m(!1)},g=(j,$)=>o.filter(k=>k.row_id===j&&k.column_index===$).sort((k,I)=>k.position-I.position),_=(j,$)=>d.filter(k=>k.row_id===j&&k.column_index===$).sort((k,I)=>k.position-I.position),S={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4"},A=j=>{const $=b.get(j);return $?$.rows.sort((k,I)=>k.position-I.position).map(k=>{const I=$.components.filter(M=>M.row_id===k.id).sort((M,L)=>M.position-L.position),R=Array.from({length:k.columns},()=>[]);return I.forEach(M=>{M.column_index<k.columns&&R[M.column_index].push(M)}),P.jsx("div",{className:`grid gap-6 ${S[k.columns]}`,children:R.map((M,L)=>P.jsx("div",{className:"space-y-6",children:M.map(q=>P.jsx(Jd,{component:q},q.id))},L))},k.id)}):null},E=()=>P.jsxs("div",{className:"max-w-7xl mx-auto space-y-8",children:[!u&&P.jsx("h1",{className:"text-4xl font-bold mb-8",children:r==null?void 0:r.title}),i.map(j=>P.jsx("div",{className:`grid gap-6 ${S[j.columns]}`,children:Array.from({length:j.columns},($,k)=>P.jsx("div",{className:"space-y-6",children:g(j.id,k).map(I=>I.is_widget_instance&&I.widget_id?P.jsx("div",{children:A(I.widget_id)},I.id):P.jsx(Jd,{component:I},I.id))},k))},j.id))]}),N=()=>u?P.jsx("div",{className:"space-y-8",children:c.map(j=>P.jsx("div",{className:`grid gap-6 ${S[j.columns]}`,children:Array.from({length:j.columns},($,k)=>P.jsx("div",{className:"space-y-6",children:_(j.id,k).map(I=>I.component_type==="page-content"?P.jsx("div",{className:"space-y-8",children:E()},I.id):P.jsx(Jd,{component:I},I.id))},k))},j.id))}):E();return p?P.jsx("div",{className:"min-h-screen flex items-center justify-center",children:"Loading..."}):P.jsxs("div",{className:"min-h-screen bg-background",children:[P.jsx("nav",{className:"border-b bg-card shadow-[var(--shadow-soft)]",children:P.jsx("div",{className:"container mx-auto px-4 py-4",children:P.jsxs("div",{className:"flex items-center gap-6",children:[P.jsx(e,{to:"/",className:"text-xl font-bold bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent",children:"My Website"}),P.jsx("div",{className:"flex gap-4",children:y.map(j=>P.jsx(e,{to:`/page/${j.slug}`,className:`text-sm transition-colors hover:text-primary ${j.slug===t?"text-primary font-medium":"text-muted-foreground"}`,children:j.title},j.id))})]})})}),P.jsx("main",{className:"container mx-auto px-4 py-12 overflow-y-auto",children:r?N():P.jsxs("div",{className:"text-center py-20",children:[P.jsx("h1",{className:"text-4xl font-bold mb-4",children:"Welcome to My Website"}),P.jsx("p",{className:"text-muted-foreground mb-8",children:"Select a page from the navigation above to get started"}),P.jsx(e,{to:"/auth",className:"inline-flex items-center justify-center rounded-md bg-primary px-6 py-3 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90",children:"Admin Login"})]})})]})};Vr.PublicPage=p4,Object.defineProperty(Vr,Symbol.toStringTag,{value:"Module"})});
|
|
145
|
+
`)}}):null},eo=Rt,Ci=fe.forwardRef(({active:t,payload:e,className:r,indicator:n="dot",hideLabel:i=!1,hideIndicator:a=!1,label:o,labelFormatter:s,labelClassName:l,formatter:u,color:c,nameKey:f,labelKey:d},h)=>{const{config:y}=L_(),v=fe.useMemo(()=>{var g;if(i||!(e!=null&&e.length))return null;const[m]=e,w=`${d||m.dataKey||m.name||"value"}`,b=Pd(y,m,w),O=!d&&typeof o=="string"?((g=y[o])==null?void 0:g.label)||o:b==null?void 0:b.label;return s?P.jsx("div",{className:He("font-medium",l),children:s(O,e)}):O?P.jsx("div",{className:He("font-medium",l),children:O}):null},[o,s,e,i,l,y,d]);if(!t||!(e!=null&&e.length))return null;const p=e.length===1&&n!=="dot";return P.jsxs("div",{ref:h,className:He("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",r),children:[p?null:v,P.jsx("div",{className:"grid gap-1.5",children:e.map((m,w)=>{const b=`${f||m.name||m.dataKey||"value"}`,O=Pd(y,m,b),g=c||m.payload.fill||m.color;return P.jsx("div",{className:He("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",n==="dot"&&"items-center"),children:u&&(m==null?void 0:m.value)!==void 0&&m.name?u(m.value,m.name,m,w,m.payload):P.jsxs(P.Fragment,{children:[O!=null&&O.icon?P.jsx(O.icon,{}):!a&&P.jsx("div",{className:He("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":n==="dot","w-1":n==="line","w-0 border-[1.5px] border-dashed bg-transparent":n==="dashed","my-0.5":p&&n==="dashed"}),style:{"--color-bg":g,"--color-border":g}}),P.jsxs("div",{className:He("flex flex-1 justify-between leading-none",p?"items-end":"items-center"),children:[P.jsxs("div",{className:"grid gap-1.5",children:[p?v:null,P.jsx("span",{className:"text-muted-foreground",children:(O==null?void 0:O.label)||m.name})]}),m.value&&P.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:m.value.toLocaleString()})]})]})},m.dataKey)})})]})});Ci.displayName="ChartTooltip";const A5=Vr,B_=fe.forwardRef(({className:t,hideIcon:e=!1,payload:r,verticalAlign:n="bottom",nameKey:i},a)=>{const{config:o}=L_();return r!=null&&r.length?P.jsx("div",{ref:a,className:He("flex items-center justify-center gap-4",n==="top"?"pb-3":"pt-3",t),children:r.map(s=>{const l=`${i||s.dataKey||"value"}`,u=Pd(o,s,l);return P.jsxs("div",{className:He("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[u!=null&&u.icon&&!e?P.jsx(u.icon,{}):P.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:s.color}}),u==null?void 0:u.label]},s.value)})}):null});B_.displayName="ChartLegend";function Pd(t,e,r){if(typeof e!="object"||e===null)return;const n="payload"in e&&typeof e.payload=="object"&&e.payload!==null?e.payload:void 0;let i=r;return r in e&&typeof e[r]=="string"?i=e[r]:n&&r in n&&typeof n[r]=="string"&&(i=n[r]),i in t?t[i]:t[r]}const yt=["hsl(var(--chart-1))","hsl(var(--chart-2))","hsl(var(--chart-3))","hsl(var(--chart-4))","hsl(var(--chart-5))"],P5=({content:t})=>{let e=[];try{e=JSON.parse(t.data||"[]")}catch{return P.jsxs("div",{className:"p-4 border border-destructive/50 rounded-lg bg-destructive/10",children:[P.jsx("p",{className:"text-destructive font-semibold",children:"Invalid chart data"}),P.jsx("p",{className:"text-sm text-muted-foreground",children:"Please provide valid JSON data"})]})}if(!e.length)return P.jsx("div",{className:"p-4 border border-border rounded-lg bg-muted/20",children:P.jsx("p",{className:"text-muted-foreground",children:"No chart data available"})});const r=e.reduce((i,a,o)=>(Object.keys(a).forEach(s=>{s!==t.xAxisKey&&s!=="name"&&!i[s]&&(i[s]={label:s.charAt(0).toUpperCase()+s.slice(1),color:yt[Object.keys(i).length%yt.length]})}),i),{}),n=()=>{switch(t.chartType){case"bar":return P.jsx(ki,{config:r,children:P.jsxs(b5,{data:e,children:[P.jsx(hl,{strokeDasharray:"3 3",className:"stroke-muted"}),P.jsx(Tr,{dataKey:t.xAxisKey||"name",tickLine:!1,axisLine:!1}),P.jsx($r,{tickLine:!1,axisLine:!1}),P.jsx(eo,{content:P.jsx(Ci,{})}),P.jsx(un,{dataKey:t.yAxisKey||"value",fill:yt[0],radius:[8,8,0,0]})]})});case"line":const i=(t.dataKeys||"").split(",").filter(Boolean);return P.jsx(ki,{config:r,children:P.jsxs(m5,{data:e,children:[P.jsx(hl,{strokeDasharray:"3 3",className:"stroke-muted"}),P.jsx(Tr,{dataKey:t.xAxisKey||"month",tickLine:!1,axisLine:!1}),P.jsx($r,{tickLine:!1,axisLine:!1}),P.jsx(eo,{content:P.jsx(Ci,{})}),P.jsx(A5,{content:P.jsx(B_,{})}),i.map((o,s)=>P.jsx(Xa,{type:"monotone",dataKey:o.trim(),stroke:yt[s%yt.length],strokeWidth:2,dot:!1},o))]})});case"area":const a=(t.dataKeys||"").split(",").filter(Boolean);return P.jsx(ki,{config:r,children:P.jsxs(x5,{data:e,children:[P.jsx(hl,{strokeDasharray:"3 3",className:"stroke-muted"}),P.jsx(Tr,{dataKey:t.xAxisKey||"time",tickLine:!1,axisLine:!1}),P.jsx($r,{tickLine:!1,axisLine:!1}),P.jsx(eo,{content:P.jsx(Ci,{})}),a.map((o,s)=>P.jsx(Er,{type:"monotone",dataKey:o.trim(),stroke:yt[s%yt.length],fill:yt[s%yt.length],fillOpacity:.6},o))]})});case"pie":return P.jsx(ki,{config:r,children:P.jsxs(w5,{children:[P.jsx(eo,{content:P.jsx(Ci,{})}),P.jsx(sr,{data:e,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:80,label:!0,children:e.map((o,s)=>P.jsx(Xo,{fill:yt[s%yt.length]},`cell-${s}`))})]})});case"radar":return P.jsx(ki,{config:r,children:P.jsxs(_5,{data:e,children:[P.jsx($0,{className:"stroke-muted"}),P.jsx(li,{dataKey:"subject"}),P.jsx(oi,{}),P.jsx(eo,{content:P.jsx(Ci,{})}),P.jsx(za,{name:"Score",dataKey:"value",stroke:yt[0],fill:yt[0],fillOpacity:.6})]})});default:return P.jsx("div",{className:"text-muted-foreground",children:"Unsupported chart type"})}};return P.jsxs("div",{className:"w-full space-y-4",children:[t.title&&P.jsx("h3",{className:"text-xl font-semibold text-center",children:t.title}),P.jsx("div",{className:"w-full min-h-[300px] max-h-[400px] h-[400px]",children:n()})]})},Ed=({component:t})=>{var n;if(!t)return console.error("ComponentRenderer received undefined component"),null;let{component_type:e,content:r}=t;if(!e)return console.error("Component missing component_type:",t),null;switch(r&&typeof r=="object"&&"content"in r&&Object.keys(r).length===1&&(r=r.content),console.log("Rendering component type:",e,"with content:",r),e){case"heading":{const{text:i,level:a}=r,o=a,s={h1:"text-4xl font-bold",h2:"text-3xl font-bold",h3:"text-2xl font-semibold"};return P.jsx(o,{className:s[a],children:i})}case"text":case"paragraph":{const{text:i}=r;return P.jsx("p",{className:"text-base leading-relaxed whitespace-pre-wrap",children:i})}case"image":{const{url:i,alt:a}=r;return i?P.jsx("img",{src:i,alt:a,className:"w-full max-w-2xl rounded-lg shadow-[var(--shadow-medium)]"}):null}case"button":{const{text:i,link:a}=r;return P.jsx(nu,{asChild:!0,children:P.jsx("a",{href:a||"#",children:i})})}case"link":{const{text:i,url:a}=r;return P.jsx("a",{href:a||"#",className:"text-primary hover:underline",children:i})}case"video":{const{url:i}=r;if(!i)return null;let a="";return i.includes("youtube.com")||i.includes("youtu.be")?a=`https://www.youtube.com/embed/${i.includes("youtu.be")?i.split("/").pop():new URLSearchParams(new URL(i).search).get("v")}`:i.includes("vimeo.com")&&(a=`https://player.vimeo.com/video/${i.split("/").pop()}`),a?P.jsx("div",{className:"aspect-video w-full max-w-2xl",children:P.jsx("iframe",{src:a,className:"w-full h-full rounded-lg",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})}):P.jsx("p",{className:"text-muted-foreground",children:"Invalid video URL"})}case"divider":return P.jsx(Ap,{className:"my-4"});case"spacer":{const{height:i}=r,a={small:"h-5",medium:"h-10",large:"h-20"};return P.jsx("div",{className:a[i]||a.medium})}case"quote":{const{text:i,author:a}=r;return P.jsxs("blockquote",{className:"border-l-4 border-primary pl-4 italic",children:[P.jsx("p",{className:"text-lg",children:i}),a&&P.jsxs("footer",{className:"mt-2 text-sm text-muted-foreground",children:["— ",a]})]})}case"list":{const{items:i,type:a}=r,o=i.split(`
|
|
146
|
+
`).filter(u=>u.trim()),s=a==="numbered"?"ol":"ul",l=a==="numbered"?"list-decimal list-inside space-y-1":"list-disc list-inside space-y-1";return P.jsx(s,{className:l,children:o.map((u,c)=>P.jsx("li",{children:u},c))})}case"code":{const{code:i,language:a}=r;return P.jsxs("div",{className:"relative",children:[a&&P.jsx("div",{className:"absolute top-2 right-2 text-xs text-muted-foreground bg-muted px-2 py-1 rounded",children:a}),P.jsx("pre",{className:"bg-muted p-4 rounded-lg overflow-x-auto",children:P.jsx("code",{className:"text-sm font-mono",children:i})})]})}case"entity-list":return P.jsx(E5,{content:r});case"entity-detail":return P.jsx(T5,{content:r});case"query":return P.jsx($5,{content:r});case"chart":return P.jsx(P5,{content:r});case"tabs":{const{tabs:i}=r;return P.jsxs("div",{className:"w-full",children:[P.jsx("div",{className:"border-b border-border mb-4",children:P.jsx("div",{className:"flex gap-4",children:i==null?void 0:i.map((a,o)=>P.jsx("button",{className:`px-4 py-2 font-medium ${o===0?"border-b-2 border-primary":"text-muted-foreground"}`,children:a.label},a.id))})}),P.jsx("div",{className:"p-4",children:((n=i==null?void 0:i[0])==null?void 0:n.content)||"No content"})]})}case"accordion":{const{items:i}=r;return P.jsx("div",{className:"space-y-2",children:i==null?void 0:i.map(a=>P.jsxs(Br,{children:[P.jsx(iu,{children:P.jsx("h3",{className:"font-semibold",children:a.title})}),P.jsx(au,{children:P.jsx("p",{className:"text-sm text-muted-foreground",children:a.content})})]},a.id))})}case"card":{const{title:i,description:a,imageUrl:o,buttonText:s,buttonLink:l}=r;return P.jsxs(Br,{children:[o&&P.jsx("img",{src:o,alt:i,className:"w-full h-48 object-cover rounded-t-lg"}),P.jsx(iu,{children:P.jsx("h3",{className:"text-xl font-semibold",children:i})}),P.jsxs(au,{children:[P.jsx("p",{className:"text-muted-foreground mb-4",children:a}),s&&P.jsx(nu,{asChild:!0,children:P.jsx("a",{href:l||"#",children:s})})]})]})}case"form-input":case"form-textarea":case"form-select":case"form-checkbox":case"form-submit":return P.jsx("div",{className:"p-4 border border-dashed border-muted-foreground/30 rounded-lg",children:P.jsx("p",{className:"text-sm text-muted-foreground",children:"Form component (preview not available)"})});default:return console.error("Unknown component type:",e,t),P.jsx("div",{className:"p-4 border border-dashed border-muted-foreground/30 rounded-lg bg-muted/20",children:P.jsxs("p",{className:"text-sm text-muted-foreground",children:["Unknown component type: ",e]})})}},E5=({content:t})=>{const[e,r]=x.useState([]),[n,i]=x.useState([]),[a,o]=x.useState(null),[s,l]=x.useState(!0);x.useEffect(()=>{u()},[t.entityId]);const u=async()=>{if(!t.entityId){l(!1);return}try{const[f,d,h]=await Promise.all([et.from("entities").select("*").eq("id",t.entityId).eq("is_published",!0).single(),et.from("entity_fields").select("*").eq("entity_id",t.entityId).order("position"),et.from("entity_records").select("*").eq("entity_id",t.entityId).eq("is_published",!0).order("created_at",{ascending:t.sortOrder!=="asc"}).limit(t.limit||10)]);o(f.data),i(d.data||[]),r(h.data||[])}catch(f){console.error("Error loading entity data:",f)}l(!1)};if(s)return P.jsx("div",{className:"text-muted-foreground",children:"Loading..."});if(!a)return P.jsx("div",{className:"text-muted-foreground",children:"Entity not found"});if(e.length===0)return P.jsx("div",{className:"text-muted-foreground",children:"No records available"});const c=n.filter(f=>(t.fields||[]).includes(f.name));return t.displayStyle==="table"?P.jsx("div",{className:"overflow-x-auto",children:P.jsxs("table",{className:"w-full border-collapse",children:[P.jsx("thead",{children:P.jsx("tr",{className:"border-b",children:c.map(f=>P.jsx("th",{className:"text-left p-3 font-semibold",children:f.display_name},f.id))})}),P.jsx("tbody",{children:e.map(f=>P.jsx("tr",{className:"border-b",children:c.map(d=>P.jsx("td",{className:"p-3",children:to(f.data[d.name],d.field_type)},d.id))},f.id))})]})}):t.displayStyle==="list"?P.jsx("div",{className:"space-y-4",children:e.map(f=>P.jsx(Br,{className:"p-4",children:c.map(d=>P.jsxs("div",{className:"mb-2",children:[P.jsxs("span",{className:"font-semibold",children:[d.display_name,": "]}),P.jsx("span",{children:to(f.data[d.name],d.field_type)})]},d.id))},f.id))}):P.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:e.map(f=>P.jsx(Br,{className:"p-6",children:c.map(d=>P.jsxs("div",{className:"mb-3",children:[P.jsx("div",{className:"text-sm font-semibold text-muted-foreground mb-1",children:d.display_name}),P.jsx("div",{className:"text-base",children:to(f.data[d.name],d.field_type)})]},d.id))},f.id))})},T5=({content:t})=>{const[e,r]=x.useState(null),[n,i]=x.useState([]),[a,o]=x.useState(!0);x.useEffect(()=>{s()},[t.entityId,t.recordId]);const s=async()=>{if(!t.entityId||!t.recordId){o(!1);return}try{const[u,c]=await Promise.all([et.from("entity_fields").select("*").eq("entity_id",t.entityId).order("position"),et.from("entity_records").select("*").eq("id",t.recordId).eq("is_published",!0).single()]);i(u.data||[]),r(c.data)}catch(u){console.error("Error loading record:",u)}o(!1)};if(a)return P.jsx("div",{className:"text-muted-foreground",children:"Loading..."});if(!e)return P.jsx("div",{className:"text-muted-foreground",children:"Record not found"});const l=n.filter(u=>(t.fields||[]).includes(u.name));return t.layout==="horizontal"?P.jsx("div",{className:"flex flex-wrap gap-6",children:l.map(u=>P.jsxs("div",{className:"flex-1 min-w-[200px]",children:[P.jsx("div",{className:"text-sm font-semibold text-muted-foreground mb-1",children:u.display_name}),P.jsx("div",{className:"text-base",children:to(e.data[u.name],u.field_type)})]},u.id))}):P.jsx("div",{className:"space-y-4",children:l.map(u=>P.jsxs("div",{children:[P.jsx("div",{className:"text-sm font-semibold text-muted-foreground mb-1",children:u.display_name}),P.jsx("div",{className:"text-base",children:to(e.data[u.name],u.field_type)})]},u.id))})},$5=({content:t})=>{const[e,r]=x.useState([]),[n,i]=x.useState(null),[a,o]=x.useState(!0),[s,l]=x.useState(null);x.useEffect(()=>{u()},[t.queryId]);const u=async()=>{if(!t.queryId){o(!1);return}try{const{data:d,error:h}=await et.functions.invoke("execute-query",{body:{queryId:t.queryId}});if(h)throw h;d.success?(r(d.data||[]),i(d.settings)):l(d.error||"Failed to execute query")}catch(d){console.error("Error executing query:",d),l("Failed to load query results")}o(!1)};if(a)return P.jsx("div",{className:"text-muted-foreground",children:"Loading query results..."});if(s)return P.jsx("div",{className:"text-destructive",children:s});if(!n)return P.jsx("div",{className:"text-muted-foreground",children:"Query not found"});if(e.length===0)return P.jsx("div",{className:"text-muted-foreground",children:"No results found"});const c=n.display_style||"table",f=n.show_row_numbers||!1;if(c==="table"){const d=Object.keys(e[0]||{});return P.jsx("div",{className:"overflow-x-auto",children:P.jsxs("table",{className:"w-full border-collapse",children:[P.jsx("thead",{children:P.jsxs("tr",{className:"border-b",children:[f&&P.jsx("th",{className:"text-left p-3 font-semibold",children:"#"}),d.map(h=>P.jsx("th",{className:"text-left p-3 font-semibold",children:h},h))]})}),P.jsx("tbody",{children:e.map((h,y)=>P.jsxs("tr",{className:"border-b",children:[f&&P.jsx("td",{className:"p-3 text-muted-foreground",children:y+1}),d.map(v=>P.jsx("td",{className:"p-3",children:h[v]!==null&&h[v]!==void 0?String(h[v]):"-"},v))]},y))})]})})}return c==="list"?P.jsx("div",{className:"space-y-4",children:e.map((d,h)=>P.jsxs(Br,{className:"p-4",children:[f&&P.jsxs("div",{className:"text-sm text-muted-foreground mb-2",children:["#",h+1]}),Object.entries(d).map(([y,v])=>P.jsxs("div",{className:"mb-2",children:[P.jsxs("span",{className:"font-semibold",children:[y,": "]}),P.jsx("span",{children:v!=null?String(v):"-"})]},y))]},h))}):P.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:e.map((d,h)=>P.jsxs(Br,{className:"p-6",children:[f&&P.jsxs("div",{className:"text-sm text-muted-foreground mb-3",children:["#",h+1]}),Object.entries(d).map(([y,v])=>P.jsxs("div",{className:"mb-3",children:[P.jsx("div",{className:"text-sm font-semibold text-muted-foreground mb-1",children:y}),P.jsx("div",{className:"text-base",children:v!=null?String(v):"-"})]},y))]},h))})},to=(t,e)=>{if(t==null||t==="")return"-";switch(e){case"image":return P.jsx("img",{src:t,alt:"",className:"max-w-full h-auto rounded"});case"url":return P.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:t});case"boolean":return t==="true"||t===!0?"Yes":"No";case"longtext":return P.jsx("div",{className:"whitespace-pre-wrap",children:t});case"date":return new Date(t).toLocaleDateString();default:return String(t)}},j5=({to:t,className:e,children:r})=>P.jsx("a",{href:t,className:e,children:r}),k5=({slug:t,LinkComponent:e=j5})=>{const[r,n]=x.useState(null),[i,a]=x.useState([]),[o,s]=x.useState([]),[l,u]=x.useState(null),[c,f]=x.useState([]),[d,h]=x.useState([]),[y,v]=x.useState([]),[p,m]=x.useState(!0),[w,b]=x.useState(new Map);x.useEffect(()=>{O()},[t]);const O=async()=>{const{data:T}=await et.from("pages").select("*").eq("is_published",!0).order("menu_order");if(v(T||[]),!t){m(!1);return}const{data:$}=await et.from("pages").select("*").eq("slug",t).eq("is_published",!0).single();if($){const{data:k}=await et.from("page_rows").select("*").eq("page_id",$.id).order("position"),{data:C}=await et.from("page_components").select("*").eq("page_id",$.id).order("position");if(n($),a(k||[]),s(C||[]),$.layout_id){const{data:L}=await et.from("layouts").select("*").eq("id",$.layout_id).eq("is_published",!0).maybeSingle();if(L){const{data:W}=await et.from("layout_rows").select("*").eq("layout_id",L.id).order("position"),{data:q}=await et.from("layout_components").select("*").eq("layout_id",L.id).order("position");u(L),f(W||[]),h(q||[])}}const D=(C||[]).filter(L=>L.is_widget_instance&&L.widget_id),N=new Map;for(const L of D)if(!N.has(L.widget_id)){const{data:W}=await et.from("widget_rows").select("*").eq("widget_id",L.widget_id).order("position"),{data:q}=await et.from("widget_components").select("*").eq("widget_id",L.widget_id).order("position");N.set(L.widget_id,{rows:W||[],components:q||[]})}b(N)}m(!1)},g=(T,$)=>o.filter(k=>k.row_id===T&&k.column_index===$).sort((k,C)=>k.position-C.position),_=(T,$)=>d.filter(k=>k.row_id===T&&k.column_index===$).sort((k,C)=>k.position-C.position),S={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4"},A=T=>{const $=w.get(T);return $?$.rows.sort((k,C)=>k.position-C.position).map(k=>{const C=$.components.filter(N=>N.row_id===k.id).sort((N,L)=>N.position-L.position),D=Array.from({length:k.columns},()=>[]);return C.forEach(N=>{N.column_index<k.columns&&D[N.column_index].push(N)}),P.jsx("div",{className:`grid gap-6 ${S[k.columns]}`,children:D.map((N,L)=>P.jsx("div",{className:"space-y-6",children:N.map(W=>P.jsx(Ed,{component:W},W.id))},L))},k.id)}):null},E=()=>P.jsxs("div",{className:"max-w-7xl mx-auto space-y-8",children:[!l&&P.jsx("h1",{className:"text-4xl font-bold mb-8",children:r==null?void 0:r.title}),i.map(T=>P.jsx("div",{className:`grid gap-6 ${S[T.columns]}`,children:Array.from({length:T.columns},($,k)=>P.jsx("div",{className:"space-y-6",children:g(T.id,k).map(C=>C.is_widget_instance&&C.widget_id?P.jsx("div",{children:A(C.widget_id)},C.id):P.jsx(Ed,{component:C},C.id))},k))},T.id))]}),I=()=>l?P.jsx("div",{className:"space-y-8",children:c.map(T=>P.jsx("div",{className:`grid gap-6 ${S[T.columns]}`,children:Array.from({length:T.columns},($,k)=>P.jsx("div",{className:"space-y-6",children:_(T.id,k).map(C=>C.component_type==="page-content"?P.jsx("div",{className:"space-y-8",children:E()},C.id):P.jsx(Ed,{component:C},C.id))},k))},T.id))}):E();return p?P.jsx("div",{className:"min-h-screen flex items-center justify-center",children:"Loading..."}):P.jsxs("div",{className:"min-h-screen bg-background",children:[P.jsx("nav",{className:"border-b bg-card shadow-[var(--shadow-soft)]",children:P.jsx("div",{className:"container mx-auto px-4 py-4",children:P.jsxs("div",{className:"flex items-center gap-6",children:[P.jsx(e,{to:"/",className:"text-xl font-bold bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent",children:"My Website"}),P.jsx("div",{className:"flex gap-4",children:y.map(T=>P.jsx(e,{to:`/page/${T.slug}`,className:`text-sm transition-colors hover:text-primary ${T.slug===t?"text-primary font-medium":"text-muted-foreground"}`,children:T.title},T.id))})]})})}),P.jsx("main",{className:"container mx-auto px-4 py-12 overflow-y-auto",children:r?I():P.jsxs("div",{className:"text-center py-20",children:[P.jsx("h1",{className:"text-4xl font-bold mb-4",children:"Welcome to My Website"}),P.jsx("p",{className:"text-muted-foreground mb-8",children:"Select a page from the navigation above to get started"}),P.jsx(e,{to:"/auth",className:"inline-flex items-center justify-center rounded-md bg-primary px-6 py-3 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90",children:"Admin Login"})]})})]})};cr.PublicPage=k5,Object.defineProperty(cr,Symbol.toStringTag,{value:"Module"})});
|